@@ -950,11 +950,13 @@ def hook_gcode_sending(self, comm_instance, phase, cmd, cmd_type, gcode, *args,
950
950
if "G90" in cmd .upper ():
951
951
# absolute positioning
952
952
self .positioning = 0
953
+ self ._plugin_manager .send_plugin_message (self ._identifier , dict (type = "grbl_state" , positioning = self .positioning ))
953
954
954
955
# we need to track relative position mode for "RUN" position updates
955
956
if "G91" in cmd .upper ():
956
957
# relative positioning
957
958
self .positioning = 1
959
+ self ._plugin_manager .send_plugin_message (self ._identifier , dict (type = "grbl_state" , positioning = self .positioning ))
958
960
959
961
# save our G command for shorthand post processors
960
962
if cmd .upper ().startswith ("G" ):
@@ -1096,7 +1098,9 @@ def hook_gcode_received(self, comm_instance, line, *args, **kwargs):
1096
1098
y = self .grblY ,
1097
1099
z = self .grblZ ,
1098
1100
speed = self .grblSpeed ,
1099
- power = self .grblPowerLevel ))
1101
+ power = self .grblPowerLevel ,
1102
+ coord = self .grblCoordinateSystem ,
1103
+ positioning = self .positioning ))
1100
1104
1101
1105
# odd edge case where a machine could be asleep or holding while connecting
1102
1106
if not self ._printer .is_operational () and self .grblState .upper ().strip () in ("SLEEP" , "HOLD:0" , "HOLD:1" , "DOOR:0" , "DOOR:1" ):
@@ -1121,7 +1125,7 @@ def hook_gcode_received(self, comm_instance, line, *args, **kwargs):
1121
1125
1122
1126
return self .pick_a_response (response )
1123
1127
1124
- if line .startswith ('Grbl' ):
1128
+ if line .strip (). startswith ('Grbl' ):
1125
1129
# Hack to make Arduino based GRBL work.
1126
1130
# When the serial port is opened, it resets and the "hello" command
1127
1131
# is not processed.
@@ -1172,7 +1176,8 @@ def hook_gcode_received(self, comm_instance, line, *args, **kwargs):
1172
1176
self ._plugin_manager .send_plugin_message (self ._identifier , dict (type = "grbl_state" ,
1173
1177
speed = self .grblSpeed ,
1174
1178
power = self .grblPowerLevel ,
1175
- coord = self .grblCoordinateSystem ))
1179
+ coord = self .grblCoordinateSystem ,
1180
+ positioning = self .positioning ))
1176
1181
1177
1182
return self .pick_a_response (None )
1178
1183
0 commit comments