Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plante-qui-pleure
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Puissegur Alexis
plante-qui-pleure
Commits
b52a8915
Commit
b52a8915
authored
6 years ago
by
Puissegur Alexis
Browse files
Options
Downloads
Patches
Plain Diff
oui
parent
71f15949
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/Vue/FXMLVue.fxml
+4
-4
4 additions, 4 deletions
app/src/Vue/FXMLVue.fxml
app/src/Vue/FXMLVueController.java
+13
-5
13 additions, 5 deletions
app/src/Vue/FXMLVueController.java
with
17 additions
and
9 deletions
app/src/Vue/FXMLVue.fxml
+
4
−
4
View file @
b52a8915
...
...
@@ -65,7 +65,7 @@
<Image
url=
"@images/temperature.jpg"
/>
</image></ImageView>
<Label
text=
"température"
/>
<Label
fx:id=
"temperature"
text=
"
0
"
/>
<Label
fx:id=
"temperature"
text=
"
-1
"
/>
<Label
text=
"°C"
/>
</children>
</HBox>
...
...
@@ -76,7 +76,7 @@
<Image
url=
"@images/intensity.jpg"
/>
</image></ImageView>
<Label
text=
"luminosité"
/>
<Label
fx:id=
"intensity"
text=
"
0
"
/>
<Label
fx:id=
"intensity"
text=
"
-1
"
/>
<Label
text=
"LUX"
/>
</children>
</HBox>
...
...
@@ -87,7 +87,7 @@
<Image
url=
"@images/humidity.png"
/>
</image></ImageView>
<Label
text=
"humidité dans l'air"
/>
<Label
fx:id=
"humidityAir"
text=
"
0
"
/>
<Label
fx:id=
"humidityAir"
text=
"
-1
"
/>
<Label
text=
"\%"
/>
</children>
</HBox>
...
...
@@ -98,7 +98,7 @@
<Image
url=
"@images/humidity.png"
/>
</image></ImageView>
<Label
text=
"humidité plante"
/>
<Label
fx:id=
"humidityPlante"
text=
"
0
"
/>
<Label
fx:id=
"humidityPlante"
text=
"
-1
"
/>
<Label
text=
"\%"
/>
</children>
...
...
This diff is collapsed.
Click to expand it.
app/src/Vue/FXMLVueController.java
+
13
−
5
View file @
b52a8915
...
...
@@ -129,13 +129,15 @@ public class FXMLVueController implements Initializable, Observer {
seuil
.
valueProperty
().
addListener
(
new
ChangeListener
<
Number
>()
{
@Override
public
void
changed
(
ObservableValue
<?
extends
Number
>
obs
,
Number
old
v
al
,
Number
newVal
)
{
public
void
changed
(
ObservableValue
<?
extends
Number
>
obs
,
Number
old
V
al
,
Number
newVal
)
{
int
intVal
=
((
int
)
Math
.
round
(
newVal
.
doubleValue
())/
10
)*
10
;
int
intOld
=
((
int
)
Math
.
round
(
oldVal
.
doubleValue
())/
10
)*
10
;
seuil
.
setValue
(
intVal
);
humiditySeuil
.
setText
(
""
+
intVal
);
if
(
humidityPlante
.
getText
()
!=
null
&&
intVal
>
Integer
.
parseInt
(
humidityPlante
.
getText
())){
// STOP
if
(
humidityPlante
.
getText
()
!=
null
&&
intVal
<=
Integer
.
parseInt
(
humidityPlante
.
getText
())
&&
intOld
>
Integer
.
parseInt
(
humidityPlante
.
getText
())){
// STOP
boolean
tmp
=
true
;
changeImagePlante
(
false
);
while
(
tmp
){
try
{
System
.
out
.
println
(
"STOP"
);
...
...
@@ -145,8 +147,10 @@ public class FXMLVueController implements Initializable, Observer {
e
.
printStackTrace
();
}
}
}
else
{
}
else
if
(
intVal
>
Integer
.
parseInt
(
humidityPlante
.
getText
()))
{
work
();
changeImagePlante
(
true
);
}
}
});
...
...
@@ -157,10 +161,14 @@ public class FXMLVueController implements Initializable, Observer {
humidityPlante
.
textProperty
().
addListener
(
new
ChangeListener
<
String
>()
{
@Override
public
void
changed
(
ObservableValue
<?
extends
String
>
observable
,
String
oldValue
,
String
newValue
)
{
if
(
newValue
!=
null
&&
humiditySeuil
.
getText
()
!=
null
&&
Integer
.
parseInt
(
newValue
)
<
Integer
.
parseInt
(
humiditySeuil
.
getText
()))
{
System
.
out
.
println
(
oldValue
);
System
.
out
.
println
(
newValue
);
if
(
oldValue
!=
null
&&
newValue
!=
null
&&
humiditySeuil
.
getText
()
!=
null
&&
Integer
.
parseInt
(
newValue
)
<
Integer
.
parseInt
(
humiditySeuil
.
getText
()))
{
changeImagePlante
(
true
);
alert
=
true
;
work
();
if
(
Integer
.
parseInt
(
oldValue
)
>
Integer
.
parseInt
(
humiditySeuil
.
getText
())){
work
();
}
}
else
{
if
(
alert
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment