- Posts: 233
- Thank you received: 0
METRIC / SAE Indicator for pyVCP
9 years 11 months ago #83417
by Askjerry
Replied by Askjerry on topic METRIC / SAE Indicator for pyVCP
The read-ahead shouldn't make much difference... it is more of a flag, it is more of a flag when in manual entry mode so you don't type G0 X10 expecting 10mm and get a surprise when it goes 10 inches instead.
When code is running... you are more or less just watching the show... it's when you are manually doing things... that's when it gets interesting.
When code is running... you are more or less just watching the show... it's when you are manually doing things... that's when it gets interesting.
Please Log in to join the conversation.
9 years 11 months ago #83418
by cmorley
Replied by cmorley on topic METRIC / SAE Indicator for pyVCP
it can be important if you stop/abort a program and then restart in the middle.
I agree that metric/imperial settings are rarely changed in the middle of a program.
Chris M
I agree that metric/imperial settings are rarely changed in the middle of a program.
Chris M
Please Log in to join the conversation.
9 years 11 months ago #83431
by andypugh
Isn't this more Pythonic:
Replied by andypugh on topic METRIC / SAE Indicator for pyVCP
cmorley wrote:
Code:for i in sorted(status.gcodes[1:]): if i == -1: continue if i % 10 == 0: if i == 210: metric = True break elif i == 200: metric = False break
Isn't this more Pythonic:
Code:
metric = True if 210 in s.gcodes else False
Please Log in to join the conversation.
9 years 11 months ago #83466
by cmorley
Replied by cmorley on topic METRIC / SAE Indicator for pyVCP
yes it is.
My example came from code in gscreen which parses gcode for different reasons.
I was not trying for the best code, just an example.
Chris M
My example came from code in gscreen which parses gcode for different reasons.
I was not trying for the best code, just an example.
Chris M
Please Log in to join the conversation.
Time to create page: 0.043 seconds
