Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _update(self, value):
self._valueChanged[self.typ].emit(value)
self._valueChanged[str].emit(self.to_str(value))
def dataTypes(self):
return [self.typ.__name__, 'str']
class _Status(QObject):
stat = STAT
# Queues
active_queue = StatusItem('active_queue', int) # number of motions blending
queue = StatusItem('queue', int) # current size of the trajectory planner queue
queue_full = StatusItem('queue_full', bool) # the trajectory planner queue full flag
queued_mdi_commands = StatusItem('queued_mdi_commands', int) #
# Positions
position = StatusItem('position', tuple) # trajectory position
actual_position = StatusItem('actual_position', tuple) # current position, in machine units
joint_position = StatusItem('joint_position', tuple) # joint commanded positions
joint_actual_position = StatusItem('joint_actual_position', tuple) # joint actual positions
dtg = StatusItem('dtg', tuple) # DTG per axis, as reported by trajectory planner
distance_to_go = StatusItem('distance_to_go', float) # vector DTG, as reported by trajectory planner
# Velocities
current_vel = StatusItem('current_vel', float) # current velocity in user units per second
velocity = StatusItem('velocity', float) # unclear
# Offsets
# Velocities
current_vel = StatusItem('current_vel', float) # current velocity in user units per second
velocity = StatusItem('velocity', float) # unclear
# Offsets
coords = ["G53", "G54", "G55", "G56", "G57", "G58", "G59", "G59.1", "G59.2", "G59.3"]
g5x_index = StatusItem('g5x_index', int, coords.__getitem__) # active coordinate system index, G54=1, G55=2 etc
g5x_offset = StatusItem('g5x_offset', tuple) # offset of the currently active coordinate system
g92_offset = StatusItem('g92_offset', tuple) # values of the current g92 offset
tool_offset = StatusItem('tool_offset', tuple) # offset values of the current tool
rotation_xy = StatusItem('rotation_xy', float) # current XY rotation angle around Z axis
# I/O
ain = StatusItem('ain', tuple) # current value of the analog input pins
aout = StatusItem('aout', tuple) # current value of the analog output pins
din = StatusItem('din', tuple) # current value of the digital input pins
dout = StatusItem('dout', tuple) # current value of the digital output pins
# Cooling
mist = StatusItem('mist', bool) # mist self.status
flood = StatusItem('flood', bool) # flood self.status, either FLOOD_OFF or FLOOD_ON
# Active codes
to_str = lambda gcodes: " ".join(["M%g" % gcode for gcode in sorted(gcodes[1:]) if gcode != -1])
mcodes = StatusItem('mcodes', tuple, to_str) # currently active M-codes
to_str = lambda mcodes: " ".join(["G%g" % (mcode/10.) for mcode in sorted(mcodes[1:]) if mcode != -1])
gcodes = StatusItem('gcodes', tuple, to_str) # active G-codes for each modal group
# Home and Limit
homed = StatusItem('homed', tuple) # homed flag for each joint
active_queue = StatusItem('active_queue', int) # number of motions blending
queue = StatusItem('queue', int) # current size of the trajectory planner queue
queue_full = StatusItem('queue_full', bool) # the trajectory planner queue full flag
queued_mdi_commands = StatusItem('queued_mdi_commands', int) #
# Positions
position = StatusItem('position', tuple) # trajectory position
actual_position = StatusItem('actual_position', tuple) # current position, in machine units
joint_position = StatusItem('joint_position', tuple) # joint commanded positions
joint_actual_position = StatusItem('joint_actual_position', tuple) # joint actual positions
dtg = StatusItem('dtg', tuple) # DTG per axis, as reported by trajectory planner
distance_to_go = StatusItem('distance_to_go', float) # vector DTG, as reported by trajectory planner
# Velocities
current_vel = StatusItem('current_vel', float) # current velocity in user units per second
velocity = StatusItem('velocity', float) # unclear
# Offsets
coords = ["G53", "G54", "G55", "G56", "G57", "G58", "G59", "G59.1", "G59.2", "G59.3"]
g5x_index = StatusItem('g5x_index', int, coords.__getitem__) # active coordinate system index, G54=1, G55=2 etc
g5x_offset = StatusItem('g5x_offset', tuple) # offset of the currently active coordinate system
g92_offset = StatusItem('g92_offset', tuple) # values of the current g92 offset
tool_offset = StatusItem('tool_offset', tuple) # offset values of the current tool
rotation_xy = StatusItem('rotation_xy', float) # current XY rotation angle around Z axis
# I/O
ain = StatusItem('ain', tuple) # current value of the analog input pins
aout = StatusItem('aout', tuple) # current value of the analog output pins
din = StatusItem('din', tuple) # current value of the digital input pins
dout = StatusItem('dout', tuple) # current value of the digital output pins
# Cooling
# Velocities
current_vel = StatusItem('current_vel', float) # current velocity in user units per second
velocity = StatusItem('velocity', float) # unclear
# Offsets
coords = ["G53", "G54", "G55", "G56", "G57", "G58", "G59", "G59.1", "G59.2", "G59.3"]
g5x_index = StatusItem('g5x_index', int, coords.__getitem__) # active coordinate system index, G54=1, G55=2 etc
g5x_offset = StatusItem('g5x_offset', tuple) # offset of the currently active coordinate system
g92_offset = StatusItem('g92_offset', tuple) # values of the current g92 offset
tool_offset = StatusItem('tool_offset', tuple) # offset values of the current tool
rotation_xy = StatusItem('rotation_xy', float) # current XY rotation angle around Z axis
# I/O
ain = StatusItem('ain', tuple) # current value of the analog input pins
aout = StatusItem('aout', tuple) # current value of the analog output pins
din = StatusItem('din', tuple) # current value of the digital input pins
dout = StatusItem('dout', tuple) # current value of the digital output pins
# Cooling
mist = StatusItem('mist', bool) # mist self.status
flood = StatusItem('flood', bool) # flood self.status, either FLOOD_OFF or FLOOD_ON
# Active codes
to_str = lambda gcodes: " ".join(["M%g" % gcode for gcode in sorted(gcodes[1:]) if gcode != -1])
mcodes = StatusItem('mcodes', tuple, to_str) # currently active M-codes
to_str = lambda mcodes: " ".join(["G%g" % (mcode/10.) for mcode in sorted(mcodes[1:]) if mcode != -1])
gcodes = StatusItem('gcodes', tuple, to_str) # active G-codes for each modal group
# Home and Limit
homed = StatusItem('homed', tuple) # homed flag for each joint
inpos = StatusItem('inpos', bool) # machine-in-position flag
linuxcnc.MOTION_TYPE_FEED: "Linear Feed",
linuxcnc.MOTION_TYPE_ARC: "Arc Feed",
linuxcnc.MOTION_TYPE_TOOLCHANGE: "Tool Change",
linuxcnc.MOTION_TYPE_PROBING: "Probing",
linuxcnc.MOTION_TYPE_INDEXROTARY: "Rotary Index"}.get)
# current state of RS274NGC interpreter
interp_state = StatusItem('interp_state', int,
to_str = {0: "Unknown",
linuxcnc.INTERP_IDLE: "Idle",
linuxcnc.INTERP_READING: "Reading",
linuxcnc.INTERP_PAUSED: "Paused",
linuxcnc.INTERP_WAITING: "Waiting"}.get)
# current RS274NGC interpreter return code
interpreter_errcode = StatusItem('interpreter_errcode', int,
to_str = {0: "Unknown",
1: "Ok",
2: "Exit",
3: "Finished",
4: "Endfile",
4: "File not open",
5: "Error"}.get)
settings = StatusItem('settings', tuple) # interpreter settings. (sequence_number, feed_rate, speed)
jog_mode_signal = Signal(bool) # jog mode = true
linear_units = StatusItem('linear_units', float,
to_str = { 0.0: "N/A",
1.0: "mm",
1/25.4: "in"}.get)
# Positions
position = StatusItem('position', tuple) # trajectory position
actual_position = StatusItem('actual_position', tuple) # current position, in machine units
joint_position = StatusItem('joint_position', tuple) # joint commanded positions
joint_actual_position = StatusItem('joint_actual_position', tuple) # joint actual positions
dtg = StatusItem('dtg', tuple) # DTG per axis, as reported by trajectory planner
distance_to_go = StatusItem('distance_to_go', float) # vector DTG, as reported by trajectory planner
# Velocities
current_vel = StatusItem('current_vel', float) # current velocity in user units per second
velocity = StatusItem('velocity', float) # unclear
# Offsets
coords = ["G53", "G54", "G55", "G56", "G57", "G58", "G59", "G59.1", "G59.2", "G59.3"]
g5x_index = StatusItem('g5x_index', int, coords.__getitem__) # active coordinate system index, G54=1, G55=2 etc
g5x_offset = StatusItem('g5x_offset', tuple) # offset of the currently active coordinate system
g92_offset = StatusItem('g92_offset', tuple) # values of the current g92 offset
tool_offset = StatusItem('tool_offset', tuple) # offset values of the current tool
rotation_xy = StatusItem('rotation_xy', float) # current XY rotation angle around Z axis
# I/O
ain = StatusItem('ain', tuple) # current value of the analog input pins
aout = StatusItem('aout', tuple) # current value of the analog output pins
din = StatusItem('din', tuple) # current value of the digital input pins
dout = StatusItem('dout', tuple) # current value of the digital output pins
# Cooling
mist = StatusItem('mist', bool) # mist self.status
flood = StatusItem('flood', bool) # flood self.status, either FLOOD_OFF or FLOOD_ON
# Active codes
current_line = StatusItem('current_line', int) # currently executing line
read_line = StatusItem('read_line', int) # line the RS274NGC interpreter is currently reading
call_level = StatusItem('call_level', int) #
# Overrides
feedrate = StatusItem('feedrate', float) # feed-rate override, 0-1
rapidrate = StatusItem('rapidrate', float) # rapid-rate override, 0-1
max_velocity = StatusItem('max_velocity', float) # max velocity in machine units/s
feed_override_enabled = StatusItem('feed_override_enabled', bool)# enable flag for feed override
adaptive_feed_enabled = StatusItem('adaptive_feed_enabled', bool)# self.status of adaptive feedrate override
# State
enabled = StatusItem('enabled', bool) # trajectory planner enabled
# estop = StatusItem([int], [bool]) # linuxcnc.STATE_ESTOP or not
estop = StatusItem(item = 'estop',
description = "Task Mode")
# state = StatusItem([int], [str]) # current command execution status. One of RCS_DONE, RCS_EXEC, RCS_ERROR.
state = StatusItem(item = 'state',
description = "Command Execution Status",
to_str = {0: "Unknown",
linuxcnc.RCS_DONE: "Done",
linuxcnc.RCS_EXEC: "Exec",
linuxcnc.RCS_ERROR: "Error",}.get
)
# exec_state = StatusItem([int], [str]) # task execution state
exec_state = StatusItem(item = 'exec_state',
description = "Task Execution State",
to_str = {linuxcnc.EXEC_ERROR: "Error",
linuxcnc.EXEC_DONE: "Done",
linuxcnc.TRAJ_MODE_COORD: "Coord",
linuxcnc.TRAJ_MODE_FREE: "Free",
linuxcnc.TRAJ_MODE_TELEOP: "Teleop"}.get)
# type of the currently executing motion
motion_type = StatusItem('motion_type', int,
to_str = {0: "None",
linuxcnc.MOTION_TYPE_TRAVERSE: "Traverse",
linuxcnc.MOTION_TYPE_FEED: "Linear Feed",
linuxcnc.MOTION_TYPE_ARC: "Arc Feed",
linuxcnc.MOTION_TYPE_TOOLCHANGE: "Tool Change",
linuxcnc.MOTION_TYPE_PROBING: "Probing",
linuxcnc.MOTION_TYPE_INDEXROTARY: "Rotary Index"}.get)
# current state of RS274NGC interpreter
interp_state = StatusItem('interp_state', int,
to_str = {0: "Unknown",
linuxcnc.INTERP_IDLE: "Idle",
linuxcnc.INTERP_READING: "Reading",
linuxcnc.INTERP_PAUSED: "Paused",
linuxcnc.INTERP_WAITING: "Waiting"}.get)
# current RS274NGC interpreter return code
interpreter_errcode = StatusItem('interpreter_errcode', int,
to_str = {0: "Unknown",
1: "Ok",
2: "Exit",
3: "Finished",
4: "Endfile",
4: "File not open",
5: "Error"}.get)
# Active codes
to_str = lambda gcodes: " ".join(["M%g" % gcode for gcode in sorted(gcodes[1:]) if gcode != -1])
mcodes = StatusItem('mcodes', tuple, to_str) # currently active M-codes
to_str = lambda mcodes: " ".join(["G%g" % (mcode/10.) for mcode in sorted(mcodes[1:]) if mcode != -1])
gcodes = StatusItem('gcodes', tuple, to_str) # active G-codes for each modal group
# Home and Limit
homed = StatusItem('homed', tuple) # homed flag for each joint
inpos = StatusItem('inpos', bool) # machine-in-position flag
limit = StatusItem('limit', tuple) # axis limit self.status masks
# Delays
delay_left = StatusItem('delay_left', float) # remaining time on dwell (G4) command, seconds
input_timeout = StatusItem('input_timeout', bool) # flag for M66 timer in progress
# Lube
lube = StatusItem('lube', bool) # lube on flag
lube_level = StatusItem('lube_level', int) # lube level, reflects iocontrol.0.lube_level.
# Program control
optional_stop = StatusItem('optional_stop', bool) # option stop enables flag
block_delete = StatusItem('block_delete', bool) # block delete current self.status
paused = StatusItem('paused', bool) # motion paused flag
feed_hold_enabled = StatusItem('feed_hold_enabled', bool) # enable flag for feed hold
# Probe
probe_tripped = StatusItem('probe_tripped', bool) # probe tripped flag (latched)
probe_val = StatusItem('probe_val', bool) # reflects value of the motion.probe-input pin
probed_position = StatusItem('probed_position', tuple) # position where probe tripped
probing = StatusItem('probing', bool) # probing in progress flag
to_str = lambda mcodes: " ".join(["G%g" % (mcode/10.) for mcode in sorted(mcodes[1:]) if mcode != -1])
gcodes = StatusItem('gcodes', tuple, to_str) # active G-codes for each modal group
# Home and Limit
homed = StatusItem('homed', tuple) # homed flag for each joint
inpos = StatusItem('inpos', bool) # machine-in-position flag
limit = StatusItem('limit', tuple) # axis limit self.status masks
# Delays
delay_left = StatusItem('delay_left', float) # remaining time on dwell (G4) command, seconds
input_timeout = StatusItem('input_timeout', bool) # flag for M66 timer in progress
# Lube
lube = StatusItem('lube', bool) # lube on flag
lube_level = StatusItem('lube_level', int) # lube level, reflects iocontrol.0.lube_level.
# Program control
optional_stop = StatusItem('optional_stop', bool) # option stop enables flag
block_delete = StatusItem('block_delete', bool) # block delete current self.status
paused = StatusItem('paused', bool) # motion paused flag
feed_hold_enabled = StatusItem('feed_hold_enabled', bool) # enable flag for feed hold
# Probe
probe_tripped = StatusItem('probe_tripped', bool) # probe tripped flag (latched)
probe_val = StatusItem('probe_val', bool) # reflects value of the motion.probe-input pin
probed_position = StatusItem('probed_position', tuple) # position where probe tripped
probing = StatusItem('probing', bool) # probing in progress flag
# Program File
file = StatusItem('file', str) # path of currently loaded gcode file
to_str = ["NA", "in", "mm", "cm"].__getitem__