You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f18a8d7
Browse filesBrowse the repository at this point in the historyBrowse files
raiseLinuxCNC_Exception("timeout waiting for homing to complete:\nstatus.homed:"+str(self.status.homed) +"\nstatus.position:"+str(self.status.position))
103
103
104
104
105
+
defwait_for_machine_on(self, timeout=10.0):
106
+
"""Returns once the machine is on, raises LinuxCNC_Exception if
107
+
it did not turn on before the timeout. state(STATE_ON) is done
108
+
once task has passed it on, the machine is on some cycles later,
109
+
and motion refuses to home until it is."""
110
+
111
+
start_time=time.time()
112
+
whileTrue:
113
+
self.status.poll()
114
+
ifself.status.task_state==linuxcnc.STATE_ON:
115
+
return
116
+
if (time.time() -start_time) >timeout:
117
+
raiseLinuxCNC_Exception("timeout waiting for the machine to turn on: task_state %d"%self.status.task_state)
118
+
time.sleep(0.01)
119
+
120
+
121
+
defhome_all(self, timeout=30.0):
122
+
"""Arguments:
123
+
124
+
'timeout' is a float, the number of seconds to wait for the
125
+
machine to turn on and then for the joints to home.
126
+
127
+
Homes every joint with home(-1) once the machine is on. A
128
+
command is done once task has passed it on: the machine is on
129
+
and the joints are homed some cycles later, and task refuses
130
+
homing and MDI until they are.
131
+
132
+
Returns once every joint is homed, raises LinuxCNC_Exception if
133
+
the machine did not turn on or a joint did not home before the
134
+
timeout."""
135
+
136
+
self.wait_for_machine_on(timeout)
137
+
self.command.home(-1)
138
+
start_time=time.time()
139
+
whileTrue:
140
+
self.status.poll()
141
+
ifall(self.status.homed[:self.status.joints]):
142
+
return
143
+
if (time.time() -start_time) >timeout:
144
+
raiseLinuxCNC_Exception("timeout waiting for homing to complete:\nstatus.homed:"+str(self.status.homed) +"\nstatus.position:"+str(self.status.position))
0 commit comments