Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glade Tooltable widget destroys tooltable in a particular case #2966

Open
hansu opened this issue Apr 20, 2024 · 1 comment
Open

Glade Tooltable widget destroys tooltable in a particular case #2966

hansu opened this issue Apr 20, 2024 · 1 comment

Comments

@hansu
Copy link
Member

hansu commented Apr 20, 2024

When using locale settings for e.g. Germany, so having a "," as decimal point, the tool table shows the correct decimal point after starting.
But after loading an (empty) G-code file and reloading the tool table, the decimal point changes to a dot:

temp-2024-04-19_15.42.17.mp4

This can lead to loss of the complete tool table in the following (quite common) case:

  1. Load a G-code file
  2. Add the missing tool
  3. Apply the changes ... boom! all tools are gone!
temp-2024-04-19_15.44.31.mp4

Version: latest from 2.9 branch.

Traceback (most recent call last):
  File "/home/cnc/linuxcnc/linuxcnc-2.9/bin/gmoccapy", line 4947, in on_btn_apply_tool_changes_clicked
    self.widgets.tooledit1.save(None)
  File "/home/cnc/linuxcnc/linuxcnc-2.9/lib/python/gladevcp/tooledit_widget.py", line 348, in save
    line = line + "%s%s "%(KEYWORDS[num], locale.atof(test))
                                          ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/locale.py", line 338, in atof
    return func(delocalize(string))
           ^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: '0,0000'
 (gmoccapy:62)
Tool file was modified since it was last read
/usr/lib/python3/dist-packages/gi/overrides/GObject.py:493: Warning: ../../../gobject/gsignal.c:2772: instance '0x460ff90' has no handler with id '113342181'
  return func(*args, **kwargs)
@zz912
Copy link
Contributor

zz912 commented Apr 23, 2024

I can confirm this behavior. Any G-code file can be used for recall, not just an empty G-code file.

In place for tool information is used as a decimal point and a dot. It is also in the Czech localization.
tool
It looks wierd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants