Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pousseseringue-arduino
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
FabLAAS
PousseSeringue
pousseseringue-arduino
Commits
01135270
Commit
01135270
authored
1 year ago
by
Malaurie Bernard
Browse files
Options
Downloads
Patches
Plain Diff
Code editting to use snake case convention in web.cpp.
parent
a2ab48fb
No related branches found
No related tags found
1 merge request
!17
Malaurie's work on UI + CLI interface + AccelStepper interface
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web.cpp
+102
-103
102 additions, 103 deletions
web.cpp
with
102 additions
and
103 deletions
web.cpp
+
102
−
103
View file @
01135270
...
...
@@ -11,27 +11,27 @@
#include
<EEPROM.h>
int
lengthSyringePump
=
50
;
//Length of
syringe
pump
in mm
#define
syringe
_
pump
_length_mm 50
int
status
L
abel
I
d1
;
int
status
L
abel
I
d2
;
int
graph
I
d
;
int
millis
L
abel
I
d
;
int
test
S
witch
I
d
;
int
status
_l
abel
_i
d1
;
int
status
_l
abel
_i
d2
;
int
graph
_i
d
;
int
millis
_l
abel
_i
d
;
int
test
_s
witch
_i
d
;
uint16_t
status
;
uint16_t
activation
;
uint16_t
E
tat
B
utton
S
eringue
;
uint16_t
e
tat
_b
utton
_s
eringue
;
uint16_t
bouton1
,
bouton2
,
bouton3
,
bouton4
,
bouton5
,
bouton6
,
bouton7
,
bouton8
,
bouton9
,
bouton10
,
bouton11
,
bouton12
,
bouton13
,
bouton14
,
bouton15
,
bouton16
,
bouton17
,
bouton18
,
bouton19
,
bouton20
,
bouton21
,
bouton22
,
bouton23
,
bouton24
,
bouton25
,
bouton26
,
bouton27
,
bouton28
,
bouton29
,
bouton30
,
bouton31
,
bouton32
,
bouton33
,
bouton34
,
bouton35
,
bouton36
,
bouton37
,
bouton38
,
bouton39
,
bouton40
,
bouton41
,
bouton42
,
bouton43
,
bouton44
,
bouton45
,
bouton46
,
bouton47
,
bouton48
,
bouton49
,
bouton50
,
bouton51
,
bouton52
,
bouton53
,
bouton54
,
bouton55
,
bouton56
,
bouton57
,
bouton58
,
bouton59
,
bouton60
,
bouton61
,
bouton62
,
bouton63
,
bouton64
,
bouton65
,
bouton66
,
bouton67
,
bouton68
,
bouton69
,
bouton70
,
bouton71
,
bouton72
,
bouton73
,
bouton74
,
bouton75
,
bouton76
,
bouton77
,
bouton78
,
bouton79
,
bouton80
,
bouton81
,
bouton82
,
bouton83
,
bouton84
,
bouton85
,
bouton86
,
bouton87
,
bouton88
,
bouton89
,
bouton90
,
bouton91
,
bouton92
,
bouton93
,
bouton94
,
bouton95
,
bouton96
,
bouton97
,
bouton98
;
uint16_t
zero
;
uint16_t
style
B
utton
,
style
L
abel
,
style
S
witcher
,
style
S
lider
,
style
B
utton2
,
style
L
abel2
,
style
S
lider2
;
uint16_t
style
_b
utton
,
style
_l
abel
,
style
_s
witcher
,
style
_s
lider
,
style
_b
utton2
,
style
_l
abel2
,
style
_s
lider2
;
uint16_t
nv
B
outon
C
trl
,
nv
B
outon
;
uint16_t
nv
_b
outon
_c
trl
,
nv
_b
outon
;
uint16_t
slider
;
...
...
@@ -39,7 +39,7 @@ char couleur1[30], couleur2[30], couleur3[30], couleur4[30], couleur5[30], coule
bool
test
=
true
;
long
unsigned
last
T
ime
=
0
;
long
unsigned
last
_t
ime
=
0
;
// Couleurs à utiliser
const
char
*
couleurs
[]
=
{
...
...
@@ -57,28 +57,28 @@ const char* couleurs[] = {
uint8_t
mock_read_uart
(
void
);
void
number
C
all
B
ack
(
Control
*
sender
,
int
type
);
void
text
C
all
B
ack
(
Control
*
sender
,
int
type
);
void
slider
C
all
B
ack
(
Control
*
sender
,
int
type
);
void
button
S
tatus
C
all
B
ack1
(
Control
*
sender
,
int
type
,
void
*
param
);
void
button
S
tatus
C
all
B
ack2
(
Control
*
sender
,
int
type
,
void
*
param
);
void
button
C
allback
(
Control
*
sender
,
int
type
);
void
pad
C
all
B
ack
(
Control
*
sender
,
int
value
);
void
switch
S
tatus
C
all
B
ack1
(
Control
*
sender
,
int
value
,
void
*
param
);
void
switch
S
tatus
C
all
B
ack2
(
Control
*
sender
,
int
value
,
void
*
param
);
void
select
C
all
B
ack
(
Control
*
sender
,
int
value
);
void
other
S
witch
C
all
B
ack
(
Control
*
sender
,
int
value
);
void
button
S
eringue
(
Control
*
sender
,
int
type
);
void
general
C
allback
(
Control
*
sender
,
int
type
);
void
nv
B
outon
C
trl
C
allback
(
Control
*
sender
,
int
type
);
void
nv
B
outon
C
allback
(
Control
*
sender
,
int
type
);
void
position
C
hoice
(
Control
*
sender
,
int
type
);
void
go
ToZ
ero
(
Control
*
sender
,
int
type
);
void
on
O
ff
();
void
web
S
etup
()
void
number
_c
all
b
ack
(
Control
*
sender
,
int
type
);
void
text
_c
all
b
ack
(
Control
*
sender
,
int
type
);
void
slider
_c
all
b
ack
(
Control
*
sender
,
int
type
);
void
button
_s
tatus
_c
all
b
ack1
(
Control
*
sender
,
int
type
,
void
*
param
);
void
button
_s
tatus
_c
all
b
ack2
(
Control
*
sender
,
int
type
,
void
*
param
);
void
button
_c
allback
(
Control
*
sender
,
int
type
);
void
pad
_c
all
b
ack
(
Control
*
sender
,
int
value
);
void
switch
_s
tatus
_c
all
b
ack1
(
Control
*
sender
,
int
value
,
void
*
param
);
void
switch
_s
tatus
_c
all
b
ack2
(
Control
*
sender
,
int
value
,
void
*
param
);
void
select
_c
all
b
ack
(
Control
*
sender
,
int
value
);
void
other
_s
witch
_c
all
b
ack
(
Control
*
sender
,
int
value
);
void
button
_s
eringue
(
Control
*
sender
,
int
type
);
void
general
_c
allback
(
Control
*
sender
,
int
type
);
void
nv
_b
outon
_c
trl
_c
allback
(
Control
*
sender
,
int
type
);
void
nv
_b
outon
_c
allback
(
Control
*
sender
,
int
type
);
void
position
_c
hoice
(
Control
*
sender
,
int
type
);
void
go
_to_z
ero
(
Control
*
sender
,
int
type
);
void
on
_o
ff
();
void
web
_s
etup
()
{
...
...
@@ -117,32 +117,32 @@ void webSetup ()
//Au dessus des tables
status
L
abel
I
d1
=
ESPUI
.
label
(
"Etat du pousse-seringue 1 :"
,
ControlColor
::
None
,
"A l'arrêt"
);
status
_l
abel
_i
d1
=
ESPUI
.
label
(
"Etat du pousse-seringue 1 :"
,
ControlColor
::
None
,
"A l'arrêt"
);
//Mettre en route le pousse-seringue
activation
=
ESPUI
.
addControl
(
ControlType
::
Switcher
,
"Mise en marche"
,
"Arrêt"
,
ControlColor
::
None
,
status
L
abel
I
d1
,
&
switch
S
tatus
C
all
B
ack1
,
(
void
*
)
19
);
activation
=
ESPUI
.
addControl
(
ControlType
::
Switcher
,
"Mise en marche"
,
"Arrêt"
,
ControlColor
::
None
,
status
_l
abel
_i
d1
,
switch
_s
tatus
_c
all
b
ack1
,
(
void
*
)
19
);
//Style
ESPUI
.
setPanelStyle
(
status
L
abel
I
d1
,
couleurs
[
2
]);
ESPUI
.
setElementStyle
(
status
L
abel
I
d1
,
couleurs
[
3
]);
ESPUI
.
setPanelStyle
(
status
_l
abel
_i
d1
,
couleurs
[
2
]);
ESPUI
.
setElementStyle
(
status
_l
abel
_i
d1
,
couleurs
[
3
]);
//Deplacement demandé du pousse-seringue
uint16_t
main
N
umber
=
ESPUI
.
number
(
"Positions finale et possitionnement du pousse-seringue"
,
position
C
hoice
,
ControlColor
::
None
,
0
,
0
,
50
);
ESPUI
.
addControl
(
Min
,
""
,
"0"
,
None
,
main
N
umber
);
ESPUI
.
addControl
(
Max
,
""
,
"50"
,
None
,
main
N
umber
);
uint16_t
main
_n
umber
=
ESPUI
.
number
(
"Positions finale et possitionnement du pousse-seringue"
,
position
_c
hoice
,
ControlColor
::
None
,
0
,
0
,
50
);
ESPUI
.
addControl
(
Min
,
""
,
"0"
,
None
,
main
_n
umber
);
ESPUI
.
addControl
(
Max
,
""
,
"50"
,
None
,
main
_n
umber
);
//Visualisation de l'avancement
slider
=
ESPUI
.
addControl
(
ControlType
::
Slider
,
"Distance"
,
"0"
,
ControlColor
::
None
,
main
N
umber
,
slider
C
all
B
ack
);
slider
=
ESPUI
.
addControl
(
ControlType
::
Slider
,
"Distance"
,
"0"
,
ControlColor
::
None
,
main
_n
umber
,
slider
_c
all
b
ack
);
//Style
ESPUI
.
setPanelStyle
(
main
N
umber
,
couleurs
[
4
]);
ESPUI
.
setElementStyle
(
main
N
umber
,
couleurs
[
5
]);
ESPUI
.
setPanelStyle
(
main
_n
umber
,
couleurs
[
4
]);
ESPUI
.
setElementStyle
(
main
_n
umber
,
couleurs
[
5
]);
zero
=
ESPUI
.
button
(
"Initialisation"
,
go
ToZ
ero
,
ControlColor
::
None
,
"Allez en butée"
);
zero
=
ESPUI
.
button
(
"Initialisation"
,
go
_to_z
ero
,
ControlColor
::
None
,
"Allez en butée"
);
ESPUI
.
setPanelStyle
(
zero
,
couleurs
[
4
]);
ESPUI
.
setElementStyle
(
zero
,
couleurs
[
5
]);
...
...
@@ -153,7 +153,7 @@ void webSetup ()
//Choix de la seringue 1
ESPUI
.
addControl
(
ControlType
::
Separator
,
"Seringue 1"
,
""
,
ControlColor
::
None
,
tab1
);
uint16_t
select1
=
ESPUI
.
addControl
(
ControlType
::
Select
,
"Choix de la seringue :"
,
""
,
ControlColor
::
None
,
tab1
,
&
select
C
all
B
ack
);
=
ESPUI
.
addControl
(
ControlType
::
Select
,
"Choix de la seringue :"
,
""
,
ControlColor
::
None
,
tab1
,
select
_c
all
b
ack
);
ESPUI
.
addControl
(
ControlType
::
Option
,
"Seringue A"
,
"Opt1"
,
ControlColor
::
None
,
select1
);
ESPUI
.
addControl
(
ControlType
::
Option
,
"Seringue B"
,
"Opt2"
,
ControlColor
::
None
,
select1
);
ESPUI
.
addControl
(
ControlType
::
Option
,
"Seringue C"
,
"Opt3"
,
ControlColor
::
None
,
select1
);
...
...
@@ -170,32 +170,31 @@ void webSetup ()
//TAB3 : Nouvelle seringue
ESPUI
.
addControl
(
ControlType
::
Text
,
"Nom de la seringue :"
,
""
,
ControlColor
::
Alizarin
,
tab3
,
&
text
C
all
B
ack
);
ESPUI
.
addControl
(
ControlType
::
Number
,
"Diamètre interne de la seringue en mm"
,
"5"
,
ControlColor
::
Alizarin
,
tab3
,
&
number
C
all
B
ack
);
ESPUI
.
addControl
(
ControlType
::
Number
,
"Volume total de la seringue en µL"
,
"5"
,
ControlColor
::
Alizarin
,
tab3
,
&
number
C
all
B
ack
);
ESPUI
.
addControl
(
ControlType
::
Text
,
"Nom de la seringue :"
,
""
,
ControlColor
::
Alizarin
,
tab3
,
text
_c
all
b
ack
);
ESPUI
.
addControl
(
ControlType
::
Number
,
"Diamètre interne de la seringue en mm"
,
"5"
,
ControlColor
::
Alizarin
,
tab3
,
number
_c
all
b
ack
);
ESPUI
.
addControl
(
ControlType
::
Number
,
"Volume total de la seringue en µL"
,
"5"
,
ControlColor
::
Alizarin
,
tab3
,
number
_c
all
b
ack
);
E
tat
B
utton
S
eringue
=
ESPUI
.
addControl
(
ControlType
::
Button
,
"Ajouter la seringue"
,
"Valider"
,
ControlColor
::
Peterriver
,
tab3
,
&
button
S
eringue
);
e
tat
_b
utton
_s
eringue
=
ESPUI
.
addControl
(
ControlType
::
Button
,
"Ajouter la seringue"
,
"Valider"
,
ControlColor
::
Peterriver
,
tab3
,
button
_s
eringue
);
//TAB4 : Configurations avancées
//Diamètre de la vis
ESPUI
.
addControl
(
ControlType
::
Number
,
"Diamètre de la vis sans fin"
,
"5"
,
ControlColor
::
None
,
tab4
,
&
number
C
all
B
ack
);
ESPUI
.
addControl
(
ControlType
::
Number
,
"Diamètre de la vis sans fin"
,
"5"
,
ControlColor
::
None
,
tab4
,
number
_c
all
b
ack
);
//Sens de rotation du moteur
ESPUI
.
addControl
(
ControlType
::
Switcher
,
"Sens de rotation du moteur"
,
"Horaire"
,
ControlColor
::
None
,
tab4
,
&
other
S
witch
C
all
B
ack
);
ESPUI
.
addControl
(
ControlType
::
Switcher
,
"Sens de rotation du moteur"
,
"Horaire"
,
ControlColor
::
None
,
tab4
,
other
_s
witch
_c
all
b
ack
);
//TAB5 : Test de style
nv
B
outon
C
trl
=
ESPUI
.
addControl
(
ControlType
::
Button
,
"Nouveau Bouton"
,
"Let magic happen"
,
ControlColor
::
None
,
tab5
,
nv
B
outon
C
trl
C
allback
);
ESPUI
.
setPanelStyle
(
nv
B
outon
C
trl
,
couleurs
[
0
]);
ESPUI
.
setElementStyle
(
nv
B
outon
C
trl
,
couleurs
[
1
]);
nv
_b
outon
_c
trl
=
ESPUI
.
addControl
(
ControlType
::
Button
,
"Nouveau Bouton"
,
"Let magic happen"
,
ControlColor
::
None
,
tab5
,
nv
_b
outon
_c
trl
_c
allback
);
ESPUI
.
setPanelStyle
(
nv
_b
outon
_c
trl
,
couleurs
[
0
]);
ESPUI
.
setElementStyle
(
nv
_b
outon
_c
trl
,
couleurs
[
1
]);
nv
B
outon
=
ESPUI
.
addControl
(
ControlType
::
Button
,
"Abra"
,
"Cadabra"
,
ControlColor
::
None
,
tab5
,
nv
B
outon
C
allback
);
nv
_b
outon
=
ESPUI
.
addControl
(
ControlType
::
Button
,
"Abra"
,
"Cadabra"
,
ControlColor
::
None
,
tab5
,
nv
_b
outon
_c
allback
);
syringe
.
isRunning
();
//Lancement
...
...
@@ -205,13 +204,13 @@ void webSetup ()
/************ Les fonctions callbacks ****************/
void
number
C
all
B
ack
(
Control
*
sender
,
int
type
)
void
number
_c
all
b
ack
(
Control
*
sender
,
int
type
)
{
Serial
.
println
(
sender
->
value
);
}
void
text
C
all
B
ack
(
Control
*
sender
,
int
type
)
void
text
_c
all
b
ack
(
Control
*
sender
,
int
type
)
{
Serial
.
print
(
"Text: ID: "
);
Serial
.
print
(
sender
->
id
);
...
...
@@ -219,7 +218,7 @@ void textCallBack(Control* sender, int type)
Serial
.
println
(
sender
->
value
);
}
void
slider
C
all
B
ack
(
Control
*
sender
,
int
type
)
void
slider
_c
all
b
ack
(
Control
*
sender
,
int
type
)
{
Serial
.
print
(
"Slider: ID: "
);
Serial
.
print
(
sender
->
id
);
...
...
@@ -231,41 +230,41 @@ void sliderCallBack(Control* sender, int type)
Serial
.
println
(
sliderValueWithOffset
);
}
void
button
S
tatus
C
all
B
ack1
(
Control
*
sender
,
int
type
,
void
*
param
)
void
button
_s
tatus
_c
all
b
ack1
(
Control
*
sender
,
int
type
,
void
*
param
)
{
Serial
.
println
(
String
(
"param: "
)
+
String
(
long
(
param
)));
switch
(
type
)
{
case
B_DOWN
:
Serial
.
println
(
"Status: Start"
);
ESPUI
.
print
(
status
L
abel
I
d1
,
"En marche"
);
ESPUI
.
print
(
status
_l
abel
_i
d1
,
"En marche"
);
break
;
case
B_UP
:
Serial
.
println
(
"Status: Stop"
);
ESPUI
.
print
(
status
L
abel
I
d1
,
"A l'arrêt"
);
ESPUI
.
print
(
status
_l
abel
_i
d1
,
"A l'arrêt"
);
break
;
}
}
void
button
S
tatus
C
all
B
ack2
(
Control
*
sender
,
int
type
,
void
*
param
)
void
button
_s
tatus
_c
all
b
ack2
(
Control
*
sender
,
int
type
,
void
*
param
)
{
Serial
.
println
(
String
(
"param: "
)
+
String
(
long
(
param
)));
switch
(
type
)
{
case
B_DOWN
:
Serial
.
println
(
"Status: Start"
);
ESPUI
.
print
(
status
L
abel
I
d2
,
"En marche"
);
ESPUI
.
print
(
status
_l
abel
_i
d2
,
"En marche"
);
break
;
case
B_UP
:
Serial
.
println
(
"Status: Stop"
);
ESPUI
.
print
(
status
L
abel
I
d2
,
"A l'arrêt"
);
ESPUI
.
print
(
status
_l
abel
_i
d2
,
"A l'arrêt"
);
break
;
}
}
void
button
C
allback
(
Control
*
sender
,
int
type
)
void
button
_c
allback
(
Control
*
sender
,
int
type
)
{
switch
(
type
)
{
...
...
@@ -279,7 +278,7 @@ void buttonCallback(Control* sender, int type)
}
}
void
pad
C
all
B
ack
(
Control
*
sender
,
int
value
)
void
pad
_c
all
b
ack
(
Control
*
sender
,
int
value
)
{
switch
(
value
)
{
...
...
@@ -329,7 +328,7 @@ void padCallBack(Control* sender, int value)
}
void
switch
S
tatus
C
all
B
ack2
(
Control
*
sender
,
int
value
,
void
*
param
)
void
switch
_s
tatus
_c
all
b
ack2
(
Control
*
sender
,
int
value
,
void
*
param
)
{
Serial
.
println
(
String
(
"param: "
)
+
String
(
long
(
param
)));
...
...
@@ -337,12 +336,12 @@ void switchStatusCallBack2(Control* sender, int value, void* param)
{
case
S_ACTIVE
:
Serial
.
print
(
"Active:"
);
ESPUI
.
print
(
status
L
abel
I
d2
,
"En marche"
);
ESPUI
.
print
(
status
_l
abel
_i
d2
,
"En marche"
);
break
;
case
S_INACTIVE
:
Serial
.
print
(
"Inactive"
);
ESPUI
.
print
(
status
L
abel
I
d2
,
"A l'arrêt"
);
ESPUI
.
print
(
status
_l
abel
_i
d2
,
"A l'arrêt"
);
break
;
}
...
...
@@ -351,7 +350,7 @@ void switchStatusCallBack2(Control* sender, int value, void* param)
}
void
select
C
all
B
ack
(
Control
*
sender
,
int
value
)
void
select
_c
all
b
ack
(
Control
*
sender
,
int
value
)
{
Serial
.
print
(
"Select: ID: "
);
Serial
.
print
(
sender
->
id
);
...
...
@@ -359,7 +358,7 @@ void selectCallBack(Control* sender, int value)
Serial
.
println
(
sender
->
value
);
}
void
other
S
witch
C
all
B
ack
(
Control
*
sender
,
int
value
)
void
other
_s
witch
_c
all
b
ack
(
Control
*
sender
,
int
value
)
{
switch
(
value
)
{
...
...
@@ -377,7 +376,7 @@ void otherSwitchCallBack(Control* sender, int value)
}
void
button
S
eringue
(
Control
*
sender
,
int
type
)
void
button
_s
eringue
(
Control
*
sender
,
int
type
)
{
switch
(
type
)
{
...
...
@@ -393,7 +392,7 @@ void buttonSeringue(Control* sender, int type)
//Most elements in this test UI are assigned this generic callback which prints some
//basic information. Event types are defined in ESPUI.h
void
general
C
allback
(
Control
*
sender
,
int
type
)
{
void
general
_c
allback
(
Control
*
sender
,
int
type
)
{
Serial
.
print
(
"CB: id("
);
Serial
.
print
(
sender
->
id
);
Serial
.
print
(
") Type("
);
...
...
@@ -410,33 +409,33 @@ void nvBoutonCtrlCallback(Control *sender, int type) {
if
(
type
==
B_UP
)
{
test
=
!
test
;
ESPUI
.
updateVisibility
(
nv
B
outon
,
test
);
ESPUI
.
updateVisibility
(
nv
_b
outon
,
test
);
}
}
void
nv
B
outon
C
allback
(
Control
*
sender
,
int
type
)
{
void
nv
_b
outon
_ctrl_c
allback
(
Control
*
sender
,
int
type
)
{
if
(
type
==
B_DOWN
)
{
ESPUI
.
setPanelStyle
(
nv
B
outon
,
couleurs
[
2
]);
ESPUI
.
setElementStyle
(
nv
B
outon
,
couleurs
[
3
]);
ESPUI
.
setPanelStyle
(
nv
_b
outon
,
couleurs
[
2
]);
ESPUI
.
setElementStyle
(
nv
_b
outon
,
couleurs
[
3
]);
}
}
void
position
C
hoice
(
Control
*
sender
,
int
type
)
{
void
position
_c
hoice
(
Control
*
sender
,
int
type
)
{
Serial
.
printf
(
"val=%s
\n
"
,
sender
->
value
.
c_str
());
Syringe
::
Syringe_configuration_t
conf
=
syringe
.
configuration
();
conf
.
volume_value
=
syringe
.
mmToMm3
(
atof
(
sender
->
value
.
c_str
()));
syringe
.
configureSyringe
(
conf
);
//
Syringe::Syringe_configuration_t conf = syringe.configuration();
//
conf.volume_value = syringe.mmToMm3(atof(sender->value.c_str()));
//
syringe.configureSyringe(conf);
}
void
go
ToZ
ero
(
Control
*
sender
,
int
type
)
{
void
go
_to_z
ero
(
Control
*
sender
,
int
type
)
{
if
(
type
==
B_UP
)
{
syringe
.
findZero
();
ESPUI
.
print
(
status
L
abel
I
d1
,
"En marche"
);
ESPUI
.
setPanelStyle
(
status
L
abel
I
d1
,
couleurs
[
0
]);
ESPUI
.
setElementStyle
(
status
L
abel
I
d1
,
couleurs
[
1
]);
//
syringe.findZero();
ESPUI
.
print
(
status
_l
abel
_i
d1
,
"En marche"
);
ESPUI
.
setPanelStyle
(
status
_l
abel
_i
d1
,
couleurs
[
0
]);
ESPUI
.
setElementStyle
(
status
_l
abel
_i
d1
,
couleurs
[
1
]);
...
...
@@ -456,18 +455,18 @@ void switchStatusCallBack1(Control* sender, int value, void* param)
{
case
S_ACTIVE
:
Serial
.
print
(
"Active:"
);
ESPUI
.
print
(
status
L
abel
I
d1
,
"En marche"
);
ESPUI
.
setPanelStyle
(
status
L
abel
I
d1
,
couleurs
[
0
]);
ESPUI
.
setElementStyle
(
status
L
abel
I
d1
,
couleurs
[
1
]);
syringe
.
fill
();
ESPUI
.
print
(
status
_l
abel
_i
d1
,
"En marche"
);
ESPUI
.
setPanelStyle
(
status
_l
abel
_i
d1
,
couleurs
[
0
]);
ESPUI
.
setElementStyle
(
status
_l
abel
_i
d1
,
couleurs
[
1
]);
//
syringe.fill();
break
;
case
S_INACTIVE
:
Serial
.
print
(
"Inactive"
);
ESPUI
.
print
(
status
L
abel
I
d1
,
"A l'arrêt"
);
ESPUI
.
setPanelStyle
(
status
L
abel
I
d1
,
couleurs
[
2
]);
ESPUI
.
setElementStyle
(
status
L
abel
I
d1
,
couleurs
[
3
]);
syringe
.
stayHere
();
ESPUI
.
print
(
status
_l
abel
_i
d1
,
"A l'arrêt"
);
ESPUI
.
setPanelStyle
(
status
_l
abel
_i
d1
,
couleurs
[
2
]);
ESPUI
.
setElementStyle
(
status
_l
abel
_i
d1
,
couleurs
[
3
]);
//
syringe.stayHere();
break
;
}
...
...
@@ -480,15 +479,15 @@ void switchStatusCallBack1(Control* sender, int value, void* param)
void
webLoop
()
{
//bool switchi = syringe.isRunning();
bool
a
=
syringe
.
isRunning
();
if
(
millis
()
>
last
T
ime
+
500
)
{
//
bool a = syringe.isRunning();
//
if(millis() > last
_t
ime + 500) {
//ESPUI.updateSlider(slider, syringe.currentPosition()*100/lengthSyringePump);
lastTime
=
millis
();
if
(
syringe
.
isRunning
())
ESPUI
.
updateControlValue
(
activation
,
"1"
);
else
ESPUI
.
updateControlValue
(
activation
,
"0"
);
//
lastTime = millis();
//
if (syringe.isRunning())
//
ESPUI.updateControlValue(activation, "1");
//
else
//
ESPUI.updateControlValue(activation, "0");
}
//
}
}
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