- Posts: 381
- Thank you received: 0
compose SUBROUTINE_PATH from different include files
I am currently reworking my router. Just about everything standard. Ceaser seemed to have a saying: divide and conquer. So I split my ini in different files just like in the example "/usr/share/doc/linuxcnc/examples/sample-configs/sim/axis/ini_with_includes".
The manual V2.8.4 dated 22-09-29 says in 8.2.24 [RS274NGC] section
What i'd like to do, if it was in bash would be adding successively to the path variable about like thisSUBROUTINE_PATH = ncsubroutines:/tmp/testsubs:lathesubs:millsubs - Specifies a colon (
separated list of up to 10 di-
rectories to be searched when single-file subroutines are specified in gcode. These directories are searched after searching
[DISPLAY]PROGRAM_PREFIX (if it is specified) and before searching [WIZARD]WIZARD_ROOT (if specified). The
paths are searched in the order that they are listed. The first matching subroutine file found in the search is used. Directo-
ries are specified relative to the current directory for the ini file or as absolute paths. The list must contain no intervening
whitespace.
Is this possible at all? if, how?
greez
chris
Please Log in to join the conversation.
#INCLUDE generally inserts a whole file at that point, it doesn't interleave and combine sections.
So the INI find system will look for SUBROUTINE_PATH in the first [RS274NGC] that it sees and use that.
So I don't think that it is as easy as having a reference to the current path, I just don't think that it will find the second and third stanzas.
Please Log in to join the conversation.
So its a double no go. Thought, it would be a nice feature.
greez
chris
Please Log in to join the conversation.
What I'd like to try in "function handle_includes () " is roughly:
- compose a list of all include files that contain a string like "SUBROUTINE_PATH ="
- add all the paths following the string "SUBROUTINE_PATH +=" say in "composed-path" variable
- eliminate double occurances and then count the elements separated by ":", as we seem to be limited to 10 subdirs or 9 ":". If 9 ":" are exceeded, throw a corresponding message and abort (side note: why is the limit 10?)
- proceed with the composition of all include files
- revisit the part with string "SUBROUTINE_PATH = xyz" and replace "xyz" with "composed-path"
Any objections?
greez
chris
Please Log in to join the conversation.
Please Log in to join the conversation.
Here I see the keywords "PATH_PREPEND" and "PATH_APPEND". I have to dig in the source code to see how it's done. I guess the very code could be inspiring
greez
chris
Please Log in to join the conversation.
