Skip to content

Gmoccapy: value checks on table entries - #4559

Merged
hansu merged 3 commits into
LinuxCNC:masterfrom
Sigma1912:gmoccapy_table-entry-value-checks
Sep 25, 2026
Merged

hansu merged 3 commits into
LinuxCNC:masterfrom
Sigma1912:gmoccapy_table-entry-value-checks

Conversation

@Sigma1912

@Sigma1912 Sigma1912 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Successor for #4436

Fixes #4435

Lines containing whitespace only are skipped rather than creating a new line with all '0'

A message is shown on startup if
 - duplicate tool numbers have been found in the tool table
 - orientation is not in range 0...9
 - a line is malformed, these are saved to a separate file so they are not silently deleted on save
The tool number for a new tool is preset to one above the highest nummber found in the table instead of '0'
@Sigma1912 Sigma1912 changed the title Gmoccapy table entry value checks Gmoccapy: value checks on table entries Sep 17, 2026
Comment thread lib/python/gladevcp/calculatorwidget.py Outdated
@Sigma1912
Sigma1912 force-pushed the gmoccapy_table-entry-value-checks branch from cb81188 to fcad9fd Compare September 17, 2026 13:44
- value validation is done by the widgets the values are entered for
- if the calculator is set to 'integer_only' it will reject any value or expression containing '.' or ','
- value editing is handled in the widget regardless whether directly with the keyboard or the calculator
- On save the table is checked for duplicate tool numbers
@Sigma1912
Sigma1912 force-pushed the gmoccapy_table-entry-value-checks branch from fcad9fd to 127d59f Compare September 21, 2026 13:05
@hansu

hansu commented Sep 24, 2026

Copy link
Copy Markdown
Member

@Sigma1912 referring to #4436 (comment)

I think we agreed that we don't want to silently change floats to integers and I have already changed the calculator widget to not accept keyboard input containing decimals.

It still accepts decimal separators in integer mode if I understand you correctly...

@Sigma1912

Copy link
Copy Markdown
Contributor Author

It still accepts decimal separators in integer mode if I understand you correctly...

No. An entry of, say, '5.0' is rejected both as a keyboard entry directly into the cell as well as a keyboard entry into the calculator.

@hansu

hansu commented Sep 24, 2026

Copy link
Copy Markdown
Member

It still accepts decimal separators in integer mode if I understand you correctly...

No. An entry of, say, '5.0' is rejected both as a keyboard entry directly into the cell as well as a keyboard entry into the calculator.

I am talking about this:

calc.mp4

@Sigma1912

Copy link
Copy Markdown
Contributor Author

Well, you can type in whatever you want but it's rejected with a type error message popup after hitting 'Enter'. This is consistent with direct keyboard entries in the cell.

@hansu

hansu commented Sep 25, 2026

Copy link
Copy Markdown
Member

Well, you can type in whatever you want but it's rejected with a type error message popup after hitting 'Enter'. This is consistent with direct keyboard entries in the cell.

Yeah sure. So commas are accepted as keyboard input but rejected as return value :).

So fine from my side. @BsAtHome any further objections?

@BsAtHome

Copy link
Copy Markdown
Contributor

@BsAtHome any further objections?

No.

@hansu
hansu merged commit 41568b4 into LinuxCNC:master Sep 25, 2026
17 checks passed
@Sigma1912
Sigma1912 deleted the gmoccapy_table-entry-value-checks branch September 25, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gmoccapy: Tool number and pocket are not editable with calculator

3 participants