Skip to content
GitLab
Menu
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
6179f8c3
Commit
6179f8c3
authored
Jun 11, 2021
by
Leon Do Castelo
Browse files
GETREGLEVOISINAGE
parent
2cbf72a3
Pipeline
#79649
passed with stage
in 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/autosql.cpp
View file @
6179f8c3
...
...
@@ -182,25 +182,30 @@ RegleVoisinage* Database::getRegleVoisinage(const QString& name) const {
regle
->
setr
(
query
.
value
(
"rayon"
).
toInt
());
return
regle
;
}
else
if
(
type
!=
3
)
// n'existe pas
throw
"Unknown type of rule"
;
query
.
prepare
(
"SELECT x, y FROM coord_voisinage WHERE id = :id"
);
query
.
bindValue
(
":id"
,
name
);
query
.
exec
();
if
(
!
query
.
first
())
throw
"There must be at least one coord in this rule"
;
RegleVoisinageArbitraire
*
regle
=
new
RegleVoisinageArbitraire
;
do
{
/// @todo voisinage arbitraire
///
/// dans l'attente de la possibilité de le faire
}
while
(
query
.
next
());
return
regle
;
}
else
if
(
type
!=
3
)
{
query
.
prepare
(
"SELECT x, y FROM coord_voisinage WHERE id = :id"
);
query
.
bindValue
(
":id"
,
name
);
query
.
exec
();
if
(
!
query
.
first
())
throw
"There must be at least one coord in this rule"
;
RegleVoisinageArbitraire
*
regle
=
new
RegleVoisinageArbitraire
;
Coordonnees
coord
;
do
{
coord
.
x
=
query
.
value
(
0
).
toUInt
();
coord
.
y
=
query
.
value
(
1
).
toUInt
();
regle
->
coordonnees
.
push_back
(
coord
);
}
while
(
query
.
next
());
query
.
prepare
(
"SELECT COUNT(*) FROM coord_voisinage WHERE id = :id"
);
query
.
bindValue
(
":id"
,
name
);
query
.
exec
();
regle
->
setNbVoisins
(
query
.
value
(
0
).
toUInt
());
return
regle
;
}
}
/// Retourne un descriptif des réseaux ("id", "nom", "id", "nom", etc.) liés à un automate
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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