Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Romain De Laage De Bellefaye
LO21-projet
Commits
c28907e7
Commit
c28907e7
authored
Jun 10, 2021
by
Leon Do Castelo
Browse files
Update autosql.cpp
parent
64c304af
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/autosql.cpp
View file @
c28907e7
...
...
@@ -480,3 +480,27 @@ void Database::stockerReseau(const Reseau& reseau, const QString& nomReseau, con
}
}
void
Database
::
initSingletonAutomate
(
QString
&
modele
)
const
{
Automate
::
getInstance
().
reinitialiserAutomate
();
QSqlQuery
reseau
(
db
);
reseau
.
prepare
(
"SELECT * FROM automates WHERE nom = :id"
);
reseau
.
bindValue
(
":id"
,
modele
);
reseau
.
exec
();
Automate
::
getInstance
().
setTitle
(
reseau
.
value
(
"nom"
).
toString
().
toStdString
());
Automate
::
getInstance
().
setAuthor
(
reseau
.
value
(
"auteur"
).
toString
().
toStdString
());
Automate
::
getInstance
().
setDesc
(
reseau
.
value
(
"description"
).
toString
().
toStdString
());
Automate
::
getInstance
().
setYear
(
reseau
.
value
(
"annee"
).
toInt
());
Automate
::
getInstance
().
setFonction
(
*
Database
::
getFonction
(
Automate
::
getInstance
()));
Automate
::
getInstance
().
setRegleVoisinage
(
*
Database
::
getRegleVoisinage
(
modele
));
Database
::
initEnsEtat
(
Automate
::
getInstance
());
//Automate::getInstance().getEnsemble();
std
::
vector
<
QString
>
reseaux
=
Database
::
getListeReseaux
(
modele
);
Automate
::
getInstance
().
setReseauInit
(
Database
::
getReseau
(
reseaux
[
0
].
toInt
()));
Automate
::
getInstance
().
initialiserBuffer
();
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment