Skip to content

Conversation

@hansu
Copy link
Member

@hansu hansu commented Jul 3, 2025

Main changes:

  • Add button "refresh dir" in open file page

  • Main window / jog:

    • Add icon for continuous jog, change alignment of jog increment button box
    • Add setting for jog button size + right pane width
    • Style velocity/spindle info box (remove S-prefix, add units)

    jog

  • G-code editor:

    • Add button to show preview beside editor (split view). The split-state is currently remembered during the session. Not on exit.
    • Add comment/uncomment button for G-code + keybinding
    • Re-arrange search and replace bar

    gcode-edit

  • MDI-entry: bigger enter button (touch-friendly)

    MDI-button

And the changes from other PRs which are already in master:

@PeterMue Can you please add resp. recreate the new icons to your https://github.com/PeterMue/gmoccapy-icon-themes? For those I get weird colors, but I think you will add them as SVG and then generate the PNGs so this problem will disappear I guess. Only for the Comment-button I haven't created a symbolic one. Thanks!

Sorry @Sigma1912 @BsAtHome @zz912 that I create this in favor of reviewing your PRs, but these changes are mostly from march and I will get this done to avoid conflicts especially when there will be some activity in the LinuxCNC meeting in Oslo this weekend.

@PeterMue
Copy link
Contributor

PeterMue commented Jul 3, 2025

I'll take a look

@zz912
Copy link
Contributor

zz912 commented Jul 3, 2025

Hi,

I tested 3.5.1 and here are my findings:

  1. is possible make tooltips for continous buttons? Not everyone will understand the symbol, so a tooltip might help.
  2. The same "back change" symbol and the same "back to main menu" symbol are close together. Would it be possible to differentiate them at least a little?
    Back
  3. Calculator in tooltable is good, but it put numbers with decimal comma. After Apply it crashes.
    Convert_string

@hansu
Copy link
Member Author

hansu commented Jul 3, 2025

Hi,

I tested 3.5.1 and here are my findings:

1. is possible make tooltips for continous buttons? Not everyone will understand the symbol, so a tooltip might help.

Sure.

2. The same "back change" symbol and the same "back to main menu" symbol are close together. Would it be possible to differentiate them at least a little?

I tried but it was rejected by the community. I didn't remember the issue or thread, but I kept the images in the latest release: f3a8136

3. Calculator in tooltable is good, but it put numbers with decimal comma. After Apply it crashes.

Oh, I didn't test that. The everlasting problems with the localization in the tool table...
@Sigma1912 We decided to drop localization in the tool table, but the calculator still does. For the offsetpage it fits but here not.

@hansu hansu force-pushed the gmoccapy-3-5-1 branch from 9a99bfd to 1d6c46c Compare July 3, 2025 18:17
@hansu
Copy link
Member Author

hansu commented Jul 3, 2025

@PeterMue Please also for the button that came via #3496. Thanks!

@Sigma1912
Copy link
Contributor

We decided to drop localization in the tool table, but the calculator still does. For the offsetpage it fits but here not.

I cannot test this right now but I think replacing this line:

                store[row][col] = locale.format_string("%11.4f", value)

https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/usr_intf/gmoccapy/gmoccapy.py#L1992

with this

                store[row][col] = ("%11.4f" % value)

should do it.

@hansu
Copy link
Member Author

hansu commented Jul 3, 2025

           store[row][col] = ("%11.4f" % value)

That would bee to easy 😄. But yeah, almost that 😉 (4bcfd3e). Thanks.

@zz912
Copy link
Contributor

zz912 commented Jul 3, 2025

We decided to drop localization in the tool table, but the calculator still does. For the offsetpage it fits but here not.

I would rather disable localization in the calculator.
Decimal comma makes only problems in technical software.

@hansu hansu force-pushed the gmoccapy-3-5-1 branch from 1d6c46c to 5b3d243 Compare July 3, 2025 20:30
@hansu
Copy link
Member Author

hansu commented Jul 3, 2025

I would rather disable localization in the calculator.
Decimal comma makes only problems in technical software.

Yes, but it should be possibly to use the comma key on the keyboard as decimal separator.
I suggest to show only the dot in the calculator and treat comma and dot as decimal separators.

@zz912
Copy link
Contributor

zz912 commented Jul 3, 2025

I would rather disable localization in the calculator.
Decimal comma makes only problems in technical software.

Yes, but it should be possibly to use the comma key on the keyboard as decimal separator. I suggest to show only the dot in the calculator and treat comma and dot as decimal separators.

It was Norberts conditions.

Maybe this will help:

self.model[path][col] = f"{float(new_text.replace(',', '.')):10.4f}"

@hansu
Copy link
Member Author

hansu commented Jul 3, 2025

Hmm but weird that it crashes though.

@zz912
Copy link
Contributor

zz912 commented Jul 3, 2025

It crashed here:

line = line + "%s%s "%(KEYWORDS[num], float(test))

In save function:
def save(self,widget):

Not in function :

def col_editted(self, widget, path, new_text, col, filter):

The col_editted function was probably skipped by the calculator.

@Sigma1912
Copy link
Contributor

Sigma1912 commented Jul 4, 2025

Yes, but it should be possibly to use the comma key on the keyboard as decimal separator.

We could have the calculator widget accept ',' as well as '.' by converting all commas to dots:

Changing this

        temp = temp.replace(",", ".")

https://github.com/Sigma1912/linuxcnc/blob/master/lib/python/gladevcp/calculatorwidget.py#L174

to this:

        temp = self.eval_string.strip( " " ).replace("Pi", "math.pi")
        temp = temp.replace(",", ".")

@Sigma1912
Copy link
Contributor

An other option would be to do it in the signal handler function similar to what is done in 'col_editted':

Changing this

            else:
                store[row][col] = f"{value:11.4f}"

https://github.com/Sigma1912/linuxcnc/blob/master/src/emc/usr_intf/gmoccapy/gmoccapy.py#L1992

to this

            else:
                value = float(str(value).replace(",", "."))
                store[row][col] = f"{value:11.4f}"

@Sigma1912
Copy link
Contributor

Sigma1912 commented Jul 4, 2025

I think I would prefer the second option thus not allowing mixing comma AND dots in the calculator but either commas OR dots depdending on the locale set.
Also it wouldn't disable the calculator widget from handing back float values according to locale setting.

The col_editted function was probably skipped by the calculator.

Yes, the calculator uses the 'editing-started' signal which is emitted as soon as a cell is in editing mode while the 'edited' signal is emitted after the cell has been edited using the keyboard.

@zz912
Copy link
Contributor

zz912 commented Jul 4, 2025

[Sigma1912]

I think I would prefer the second option thus not allowing mixing comma AND dots in the calculator but either commas OR dots depdending on the locale set.
Also it wouldn't disable the calculator widget from handing back float values according to locale setting.

I would say that history is repeating itself here.
Please see:
#2966 (comment)

I also preferred to use only comma, or only dot.
But then we found out that somewhere decimal dot is necessary.
For example, using decimal comma in g-code is nonsense.
Using a decimal comma in DRO is ugly.
I concluded from the above discussion:

  1. Use decimal point in all localizations.
  2. Make inputs resistant decimal comma.

If we could agree on this, we could make it a rule and list it here:
http://linuxcnc.org/docs/devel/html/gui/gui-dev-reference.html

@Sigma1912
Copy link
Contributor

@zz912
So are you saying that you would prefer the calculator to hand back only values with decimal point (ie option 1)?
That's also fine with me as I live in decimal dot land.

@zz912
Copy link
Contributor

zz912 commented Jul 4, 2025

So are you saying that you would prefer the calculator to hand back only values with decimal point (ie option 1)?

Yes

That's also fine with me as I live in decimal dot land.

You are lucky man.

@Sigma1912
Copy link
Contributor

Sigma1912 commented Jul 4, 2025

Could you test this please?
In 'lib/python/gladevcp/calculator_widget.py' around line 210 change this:

        except:
            b = "Error"
        self.entry.set_text( b )
        self.entry.set_position(len(self.eval_string))

to this:

        except:
            b = "Error"
        b = b.replace(",", ".")
        self.entry.set_text( b )
        self.entry.set_position(len(self.eval_string))

This should have the advantage of only accepting the decimal symbol set in the locale (ie dot OR comma but not both) and then hand back values with decimal dot.

@zz912
Copy link
Contributor

zz912 commented Jul 4, 2025

I'll look at it tonight.

@zz912
Copy link
Contributor

zz912 commented Jul 4, 2025

It did not help.

I tested it with print command:

        except:
            b = "Error"
        b = b.replace(",", ".")
        self.entry.set_text( b )
        print(b)
        self.entry.set_position(len(self.eval_string))

b was with decimal point, but in table cell was comma.

It is weird.

If you want to test other localizations, here is the manual:
#2966 (comment)

@hansu
Copy link
Member Author

hansu commented Jul 4, 2025

That's also fine with me as I live in decimal dot land.

Where do you live? Because your name sounds German... Or just a German living abroad? 🤔

@Sigma1912
Copy link
Contributor

I'm in Switzerland

@hansu
Copy link
Member Author

hansu commented Jul 5, 2025

Ah, didn't know that they use dots.

@Sigma1912
Copy link
Contributor

Sigma1912 commented Jul 5, 2025

Ah, didn't know that they use dots.

I think we are about the only ones in europe beside the irish and the brits

I notice that the offset page uses decimal comma format, is that intended? Seems somewhat odd to use decimal dot in the dro and the tool table but decimal comma in the offset table:
offsetpage

Wouldn`t it be preferable to have the decimal dot format everywhere in Gmoccapy?

@hansu
Copy link
Member Author

hansu commented Jul 5, 2025

I notice that the offset page uses decimal comma format, is that intended?

I think this was originally intended by Norbert, like the tool table also used localization.
But now as we agreed to use dots in the tool table and tool information, we should use dots everywhere in Gmoccapy.

@zz912
Copy link
Contributor

zz912 commented Jul 5, 2025

Wouldn`t it be preferable to have the decimal dot format everywhere in Gmoccapy?

Yes, yes, yes. My opinion. But don't forget to accept decimal comma in inputs. The best is plain:
.replace(",",` ".")

@PeterMue
Copy link
Contributor

PeterMue commented Jul 7, 2025

@Sigma1912 Check this out: https://github.com/PeterMue/gmoccapy-icon-themes (Section "Symbolic Icon

This is the source of the material icons, if you like, please send me a PR or let me know, then I will add the new icons.

@hansu
Copy link
Member Author

hansu commented Jul 7, 2025

Also a bit about that in the docs: https://linuxcnc.org/docs/html/gui/gmoccapy.html#gmoccapy:icon-theme-section

@Sigma1912
Copy link
Contributor

Two more icons ('Add' and 'Delete') in this recent PR
#3509

@Sigma1912
Copy link
Contributor

@hansu
We had a small discussion about the tool table and using 'switch to highlighted' instead of 'switch to checked' tool somewhere.
I can't find it, but I was wondering if the 'Select'/'Auswählen' column could be 'Delete'. With my PR the 'Delete' button is right underneath that column so it might be fairly intuitive.

See
#3509 (comment)

The 'switch to highlighted' instead of 'switch to checked' tool change would then be in sync with the 'switch to selected offset' in the offset page.

@Sigma1912
Copy link
Contributor

I have also prepared adding a buttonbox to the offsetpage:

offsetpage

Maybe we could move some of the 'edit offsets', 'Zero G92' , 'Set selected offset' buttons to the new button box.
What do you think?

@PeterMue
Copy link
Contributor

PeterMue commented Jul 7, 2025

Two more icons ('Add' and 'Delete') in this recent PR #3509

I'll integrate them in https://github.com/PeterMue/gmoccapy-icon-themes and update the hansu#9 accordingly.

@Sigma1912
Copy link
Contributor

Sigma1912 commented Jul 8, 2025

Proposed tooltable 'change to highlighted':
Recording

Todos:

  • remove automatically checking checkbox of currently loaded tool
  • maybe show currently loaded too in the new buttonbox as tool info frame is hidden when using the onboard keyboard.

Comments welcome.

@zz912
Copy link
Contributor

zz912 commented Jul 8, 2025

So what are check buttons for now?

@Sigma1912
Copy link
Contributor

Checkbuttons would only be used to delete the selected lines

@Sigma1912
Copy link
Contributor

Deleting is really the only use case where selecting multiple lines makes any sense.

@zz912
Copy link
Contributor

zz912 commented Jul 8, 2025

I think it would be confusing to have both there. Both "select line" and "checkbuttons".

Select line can multiple lines too.

@Sigma1912
Copy link
Contributor

Sigma1912 commented Jul 8, 2025

Select line can multiple lines too.

Yes, but it requires holding down the shift key which is a pain when using a touch screen (without a physical keyboard)

@gmoccapy
Copy link
Collaborator

gmoccapy commented Jul 9, 2025

Hallo,

IMHO we should delete the column with the checkboxes.
The checkbox column is an historical relict. Long time ago, when I coded that widget, I have not been able to find a solution to edit cells without the checkbox. And also multiple line selection was not possible at that state. Sure some of the problems are caused by my poor python knowledge at that time.

Is it possible to select several lines holding down and clicking that line, as we all are used to do in Excel? That would allow deleting several tools at once (I can not remember having done that in all my time working on CNC machines).

The single selected line will be edited, if several lines have been selected, which one will be used for the next step? That is why you get an error if you change tool and have not selected any row or several.

Norvbert

@hansu
Copy link
Member Author

hansu commented Jul 9, 2025

Almost all have completely misunderstood this PR :'(
It should have been a discussion about the features I presented, not about any new ones.
It's now hard to follow the topics itself.

So please continue for the several topics that arose from this in the dedicated topics:

Offset page: #3513
Tool table: #3509
Calculator - localization: #3500

@hansu hansu force-pushed the gmoccapy-3-5-1 branch from 23a2b62 to 284d829 Compare July 9, 2025 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants