ini: Fix Tcl interaction, fix missing updates and some improvements#3988
Open
BsAtHome wants to merge 1 commit intoLinuxCNC:masterfrom
Open
ini: Fix Tcl interaction, fix missing updates and some improvements#3988BsAtHome wants to merge 1 commit intoLinuxCNC:masterfrom
BsAtHome wants to merge 1 commit intoLinuxCNC:masterfrom
Conversation
ini: Expose enum mapping functions in python ini: Improve linuxcnc pre-run ini-file check ini: Reintroduce to remove comments in values
Collaborator
|
How would an INI line like this be interpreted? MDI_COMMAND_MACRO0 = G0 Z25;X0 Y0;Z0, Goto\nUser\nZero |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the problem with the ini-parser and Tcl interaction. The Tcl side now maps onto the new ini-parser and gets the data from the same parser and data pool as all other parts of linuxCNC. There is no longer a necessity to predigest the ini-file. This PR fixes #3972.
There is a need to get rid of some Tcl code that uses the parse_ini method to add sections/variables to the global Tcl scope as associative arrays. But that can wait for another time because the fallout would be larger than a simple update. It works now by reading the data from the new parser instead of trying to read the ini-file manually.
LinuxCNC pre-flight config check got an update. A new ini-file checker was written in python, linuxcnc_check_ini, to replace the old Tcl version (check_config.tcl). Checks have been greatly expanded, it performs better and uses the new ini-parser for all reading.
The new pre-flight check tests all ini-file variables that are known to be boolean to be valid if they are present in the ini-file. It also tests known enumerations and some integer variables with known numerical limits. This PR fixes #3863.
The python interface now exposes conversion routines for some commonly used enumerations (linear/angular units and joint type). This way no reimplementations are necessary and they will be handled consistently.
A previously missed python based user interface (gscreen.py) has been updated to use the proper typed conversions.
The values in ini-files can now again have comments on the line where they are defined. You can embed both
#and;characters by escaping them (\#and\;) or using hex escapes. There we actually ini-files in the config directory using comments on a variable definition line. These should work properly now. There were not detected any strings that embed the comment characters. However, if some were missed, they are easily fixed.The documentation has been updated.