QtDragon DRO decimal places

More
15 Mar 2021 21:08 - 15 Mar 2021 21:10 #202411 by turbostew
Hello All,

Wanting to change my DROs to 3 dicimal places instead of 4.

DRO_FORMAT_MM and DRO_FORMAT_IN don't seen to have an effect in QtDragon_HD. According to the INI files docs they should...

linuxcnc.org/docs/2.8/html/config/ini-config.html

How can I change these?

Thanks,
Kent
Last edit: 15 Mar 2021 21:10 by turbostew.

Please Log in or Create an account to join the conversation.

More
15 Mar 2021 21:37 #202419 by cmorley
Replied by cmorley on topic QtDragon DRO decimal places
That INI setting sets the DRO inbed into the graphics display/
This is how AXIS and Qtaxis display the DRO/

Qtdragon uses labels to display the DRO.
You would need to modify the .ui file.
linuxcnc.org/docs/devel/html/gui/qtvcp_w...ml#_dro_label_widget

Please Log in or Create an account to join the conversation.

More
15 Mar 2021 22:42 - 15 Mar 2021 23:17 #202430 by turbostew
Thanks Chris,

I see the help file but not clear. i don't see an "imperial" associated with the DRO in the QtDragon_HD.ui.

I see "setimperialtexttemplate" in dro_widget.py but find this function nowhere else...
Can you give me an example? Or another clue?

Thanks,
Kent
Last edit: 15 Mar 2021 23:17 by turbostew.

Please Log in or Create an account to join the conversation.

More
15 Mar 2021 23:26 - 15 Mar 2021 23:41 #202434 by turbostew
Well I did it like this in initialize in QtDragon_hd_handler.....

self.w["dro_axis_x"].setimperialtexttemplate('%9.3f') ##DKS
self.w["dro_axis_x"].update_units() ##DKS
self.w["dro_axis_y"].setimperialtexttemplate('%9.3f') ##DKS
self.w["dro_axis_y"].update_units() ##DKS
self.w["dro_axis_z"].setimperialtexttemplate('%9.3f') ##DKS
self.w["dro_axis_z"].update_units() ##DKS

But this didn't make changes to the tool table and offsets significant digits :( Want one place to change all significant digits....
Last edit: 15 Mar 2021 23:41 by turbostew.

Please Log in or Create an account to join the conversation.

More
16 Mar 2021 13:21 #202471 by cmorley
Replied by cmorley on topic QtDragon DRO decimal places
Yes all a bit klunky still.

self.w.NAME OF TOOL EDITOR.imperial_text_template = '%9.4f'

self.w.NAME OF ORIGIN EDITOR.imperial_text_template = '%9.4f'
The following user(s) said Thank You: turbostew

Please Log in or Create an account to join the conversation.

More
16 Mar 2021 18:10 #202492 by turbostew
Well the origin editor works great but still see 4 decimals in tool editor. Checked tool offsetview.py and I think everything is OK.

Am I wearing out my welcome yet?, I can be less verbose if requested:) I am not sure if my testing/problems are appreciated or I am becoming a thorn....

Thank You Chris!

Please Log in or Create an account to join the conversation.

More
22 Mar 2021 05:37 #203201 by cmorley
Replied by cmorley on topic QtDragon DRO decimal places
I confirm and understand the problem - try to get to it tomorrow night.

Please Log in or Create an account to join the conversation.

More
26 Mar 2021 06:02 #203669 by cmorley
Replied by cmorley on topic QtDragon DRO decimal places
Sorry for the delay.
You can use this code to modify the tool offset template:
self.w.tooloffsetview.tablemodel.imperial_text_template = '%9.1f'

I'll be making this a more consistent function call in the future.

Please Log in or Create an account to join the conversation.

More
26 Mar 2021 10:18 #203681 by cmorley
Replied by cmorley on topic QtDragon DRO decimal places
I pushed some work, if you update and get an error from the above suggested change try this:
        self.w.offset_table.setProperty('imperial_template', '%9.1f')
        self.w.tooloffsetview.setProperty('imperial_template', '%9.1f')

Please Log in or Create an account to join the conversation.

More
26 Mar 2021 14:44 #203719 by turbostew
Thanks Chris!!!!!!!!

That did the trick...

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.081 seconds
Powered by Kunena Forum