Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
field
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
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
NAOS
Natuition
field
Commits
69c87767
Commit
69c87767
authored
3 years ago
by
Vincent LAMBERT
Browse files
Options
Downloads
Patches
Plain Diff
Hotfix
parent
bfb65133
No related branches found
Branches containing commit
Tags
v1-rc1.3.1
v1-rc1.3.2
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
adapters.py
+4
-0
4 additions, 0 deletions
adapters.py
connectors.py
+4
-0
4 additions, 0 deletions
connectors.py
uiWebRobot/my_states.py
+10
-12
10 additions, 12 deletions
uiWebRobot/my_states.py
with
18 additions
and
12 deletions
adapters.py
+
4
−
0
View file @
69c87767
...
...
@@ -64,6 +64,10 @@ class SmoothieAdapter:
def
disconnect
(
self
):
self
.
_smc
.
disconnect
()
@property
def
is_disconnect
(
self
):
return
self
.
_smc
.
is_open
def
get_connector
(
self
):
"""
Only for debug!
"""
...
...
This diff is collapsed.
Click to expand it.
connectors.py
+
4
−
0
View file @
69c87767
...
...
@@ -67,6 +67,10 @@ class SmoothieV11SerialConnector:
def
disconnect
(
self
):
self
.
_ser
.
close
()
@property
def
is_open
(
self
):
return
self
.
_ser
.
is_open
def
get_serial
(
self
):
"""
Only for debug!
"""
...
...
This diff is collapsed.
Click to expand it.
uiWebRobot/my_states.py
+
10
−
12
View file @
69c87767
...
...
@@ -306,23 +306,16 @@ class CreateFieldState(State):
return
WaitWorkingState
(
self
.
socketio
,
self
.
logger
,
False
)
self
.
field
=
self
.
fieldCreator
.
calculateField
()
if
config
.
TWO_POINTS_FOR_CREATE_FIELD
:
self
.
fieldCreator
.
saveField
(
"
../field.txt
"
)
else
:
if
not
config
.
TWO_POINTS_FOR_CREATE_FIELD
:
self
.
manoeuvre
=
True
self
.
fieldCreator
.
manoeuvre
()
self
.
manoeuvre
=
False
self
.
statusOfUIObject
[
"
stopButton
"
]
=
None
self
.
statusOfUIObject
[
"
fieldButton
"
]
=
"
validate
"
self
.
statusOfUIObject
[
"
stopButton
"
]
=
None
self
.
statusOfUIObject
[
"
fieldButton
"
]
=
"
validate
"
self
.
socketio
.
emit
(
'
field
'
,
{
"
status
"
:
"
finish
"
},
namespace
=
'
/button
'
,
broadcast
=
True
)
if
config
.
TWO_POINTS_FOR_CREATE_FIELD
:
self
.
socketio
.
emit
(
'
field
'
,
{
"
status
"
:
"
validate
"
},
namespace
=
'
/button
'
,
broadcast
=
True
)
self
.
smoothie
.
disconnect
()
self
.
gps
.
disconnect
()
if
config
.
TWO_POINTS_FOR_CREATE_FIELD
:
return
WaitWorkingState
(
self
.
socketio
,
self
.
logger
,
True
)
else
:
return
self
return
self
elif
event
==
Events
.
VALIDATE_FIELD
:
return
self
elif
event
==
Events
.
VALIDATE_FIELD_NAME
:
...
...
@@ -348,7 +341,11 @@ class CreateFieldState(State):
if
x
>
0
:
x
*=
config
.
A_MAX
/
100
#print(f"[{self.__class__.__name__}] -> Move '{x}'.")
self
.
smoothie
.
custom_move_to
(
F
=
config
.
A_F_UI
,
A
=
x
)
if
not
self
.
smoothie
.
is_disconnect
:
try
:
self
.
smoothie
.
custom_move_to
(
F
=
config
.
A_F_UI
,
A
=
x
)
except
serial
.
PortNotOpenError
:
pass
elif
data
[
"
type
"
]
==
"
field
"
:
msg
=
f
"
[
{
self
.
__class__
.
__name__
}
] -> Slider value :
{
data
[
'
value
'
]
}
.
"
self
.
logger
.
write_and_flush
(
msg
+
"
\n
"
)
...
...
@@ -361,6 +358,7 @@ class CreateFieldState(State):
self
.
socketio
.
emit
(
'
field
'
,
{
"
status
"
:
"
inRun
"
},
namespace
=
'
/button
'
,
broadcast
=
True
)
self
.
statusOfUIObject
[
"
fieldButton
"
]
=
None
except
TimeoutError
:
print
(
"
bip
"
)
if
self
.
notificationQueue
is
not
None
:
self
.
notificationQueue
.
send
(
json
.
dumps
({
"
message_name
"
:
"
No_GPS_for_field
"
}))
self
.
smoothie
.
disconnect
()
...
...
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