Verified Commit 2f35040f authored by Romain De Laage De Bellefaye's avatar Romain De Laage De Bellefaye 🌳
Browse files

Compilation errors

parent a698a567
......@@ -39,7 +39,7 @@ class Database {
void initEnsEtat(Automate& a) const;
void saveAutomaton(const Automate& a) const;
void saveFunction(const QString& name, const Fonction& f) const;
void saveVoisinage(const QString& name, RegleVoisinage& r) const;
void saveVoisinage(const QString& name, const RegleVoisinage& r) const;
void saveEnsemble(Automate& a) const;
void initSingletonAutomate(const QString& modele) const;
};
......
......@@ -174,7 +174,8 @@ RegleVoisinage* Database::getRegleVoisinage(const QString& name) const {
regle->setr(query.value("rayon").toInt());
return regle;
} else if(type == 2) {
}
else if(type == 2) {
if(query.isNull("rayon"))
throw "Error: r can't be undefined here";
......@@ -182,7 +183,8 @@ RegleVoisinage* Database::getRegleVoisinage(const QString& name) const {
regle->setr(query.value("rayon").toInt());
return regle;
} else if(type != 3) {
}
else if(type != 3) {
query.prepare("SELECT x, y FROM coord_voisinage WHERE id = :id");
query.bindValue(":id", name);
query.exec();
......@@ -412,7 +414,7 @@ void Database::saveVoisinage(const QString& name, const RegleVoisinage& r) const
query.bindValue(":rayon", r.getr());
query.exec();
RegleVoisinageArbitraire& new_r = dynamic_cast<RegleVoisinageArbitraire&>(r);
const RegleVoisinageArbitraire& new_r = dynamic_cast<const RegleVoisinageArbitraire&>(r);
for(size_t i = 0 ; i<new_r.coordonnees.size() ; i++)
{
query.prepare("INSERT INTO coord_voisinage VALUES (:nom, :x, :y)");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment