Preview in MM while DRO's are in inch
- auto-mation-assist
- Topic Author
- Offline
- Platinum Member
- Posts: 425
- Thank you received: 81
Gmoccapy version is 3.13.10 and running in place with development master.
It is mostly working from what I can tell but I noticed is that the angles show in the preview were all in MM while the DRO's were all indicating in inch. This difference remained until I clicked on the make the preview as large as possible button near the lower right of the UI. The preview display then showed the angles in inches when returning back to the normal size of the preview window.
While trouble shooting this I also noticed that there is a duplicate line in gmoccapy at 2258, self.widgets.btn_jump_to.set_sensitive(self.widgets.IconFileSelection1.btn_jump_to.get_sensitive())
Please Log in or Create an account to join the conversation.
Did I get that right?
Please Log in or Create an account to join the conversation.
- auto-mation-assist
- Topic Author
- Offline
- Platinum Member
- Posts: 425
- Thank you received: 81
Please Log in or Create an account to join the conversation.
- auto-mation-assist
- Topic Author
- Offline
- Platinum Member
- Posts: 425
- Thank you received: 81
Attachments:
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- auto-mation-assist
- Topic Author
- Offline
- Platinum Member
- Posts: 425
- Thank you received: 81
Please Log in or Create an account to join the conversation.
- auto-mation-assist
- Topic Author
- Offline
- Platinum Member
- Posts: 425
- Thank you received: 81
In gmoccapy.py line 87 and 88 have
_INCH = 0 # imperial units are active
_MM = 1 # metric units are active
I added these two temp lines 584 and 585
print ("584 Get Linear units")
print("linear units is ",self.stat.linear_units)
This moved everything down two lines but at the original gmoccapy.py starting at line 584 I see
if self.stat.linear_units != _MM:
digits = 4
self.dro_digits = self.prefs.getpref("dro_digits", digits, int)
self.dro_size = self.prefs.getpref("dro_size", 28, int)
In the terminal I get this back from my print statements.
584 Get Linear units
linear units is 0.03937007874015748
I was expecting back 0 so this seems unusual to me since I would expect either a 0 or 1.
The 0.03937007874015748 is not eqaul to _MM: so digits in dro should be 4 but they are 3 for mm. This odd value, if not a format problem is strange.
What do you think?
Please Log in or Create an account to join the conversation.
So you might confirm if that is for mode units or display units or I am remembering wrong.
Please Log in or Create an account to join the conversation.
It seems it does. If you switch to G21 and then back to G20, then the DRO in gremlin is correct.[ GMoccapy/gremlin probably doesn't reload the screen on g20/g21 changes.
584 Get Linear units
linear units is 0.03937007874015748
I was expecting back 0 so this seems unusual to me since I would expect either a 0 or 1.
This is just the factor which shows you that gmoccapy is using inch (=1/25.4)
From gmoccapy code:
# self.stat.linear_units will return 1.0 for metric and 1/25,4 for imperial
From emcsh.cc:
"For linear joints, something close to 0.03937 is deemed "inch", 1.000 is "mm", 0.1 is "cm", otherwise it's "custom"."
Please Log in or Create an account to join the conversation.
- auto-mation-assist
- Topic Author
- Offline
- Platinum Member
- Posts: 425
- Thank you received: 81
.
The value being passed to Gremlin dro.set_property("metric_units" is 1/25.4 instead of True or False at start up. This variable is not declared in the self.dro_dic = {}, and data is routed to it is coming from the wrong source, self.widgets.gremlin.set_property("metric_units", int( self.stat.linear_units ) )
This gives it a scaling value instead of True or False.
My line numbers are approximate for
For testing I added this to the self.dro_dic = {}
at about line 650
dro.set_property("metric_units", False)
And this under def _init_gremlin( self ):
at about line 2072
dro = self.dro_dic[list(self.dro_dic.keys())[0]]
self.widgets.gremlin.set_property("metric_units", dro.metric_units)
With these lines added the preview display is correct at start up.
dro.set_property("metric_units", False) or set to True depending on desired default value.
This ends up routing to:
**** Entering init gremlin ****
dro object is <combi_dro.Combi_DRO object at 0x7f14f12cffc0 (Combi_DRO at 0x562b81b5b330)>
combi_dro.Combi_DRO metric units False
linear_units is 0.03937007874015748 and was the prior incorrect variable used for configuring the gremlin dro's (not True or False)
As a note I find that there are so many uses of "unit" versions that it gets very confusing
Please Log in or Create an account to join the conversation.