Request to add functionality - rewriting configuration files

More
13 Jan 2023 06:31 #261777 by zz912
I would like to request the addition of PNCconf configurator functionality. My point is that I would like to make LCNC integrations that the user will be able to edit without my help. I would like the users for whom I did the LCNC integration to be able to change for example:
- feed rates
- pulses/mm
- adding 4th axis
- set limits
-......
I would like them to need my assistance only for really complex tasks.
- spindle Modbus communication settings
- ATC cycle setting
- MPG configuration adjustments
- .......

It is clear to me that it is not possible to create such an extensive PNCconf functionality that would cover all the possibilities of LCNC.

The current state is that PNCconf is used to generate the skeleton configuration files. This skeleton is then changed manually and it is no longer possible to use PNCconf because it would overwrite the modifications.

The custom.hal file is used to maintain PNCconf functionality even at a later stage of LCNC integration.

Andy helped me a lot with the "delsig" trick, so I don't have to make any changes to the default.hal file.

The problem remains with the ini file. Currently I will need to add a command for "REMAP M6" to the ini file.

I would like a configuration file at the level of PNCconfig that would overwrite the configuration files just created.

This file would be similar to a git diff file, but it would specify in which group it has something to edit.
It could only delete and add lines.

It could look like this:
[RS274NGC]
- RS274NGC_STARTUP_CODE = G17 G21 G40 G43H0 G54 G64P0.005 G80 G90 G94 G97 M5 M9
+ RS274NGC_STARTUP_CODE = G17 G21 G40
+ REMAP=M6 modalgroup=6 ngc=mychange

Please Log in or Create an account to join the conversation.

More
14 Jan 2023 11:39 #261923 by andypugh
Would using an actual diff file and the Linux "patch" command do what you want?

Please Log in or Create an account to join the conversation.

More
15 Jan 2023 09:08 #262023 by zz912
Yes.

Now I have a lot of work with my project Brother TC-211. So now I make the diff file manually and modify ini file manually. The request described above is beyond my programming skills.

A fantastic thing would be if PNCconf generated a sample diff file when configuring the LCNC for the first time. This diff file should have a pattern in it of how to use it.

When modifying the LCNC configuration, PNCconf could handle the diff file automatically with git.

PNCconf should alert the user that the patch has taken place.

Please Log in or Create an account to join the conversation.

More
15 Jan 2023 09:45 #262025 by zz912
Now that I think about it again, the answer is NO.
I would need something similar.

Maybe a "patch" could be used, but I don't know how to simply write a diff file to solve the following problems:

For example, changing the command RS274NGC_STARTUP_CODE would be without problems, because this command is only once in the ini file.

For example, changing the STEPGEN_MAXVEL, STEPGEN_MAXACCEL command
would be a problem because these commands appear in multiple sections in the ini file. [JOINT_0], [JOINT_1],[JOINT_2]

I would need an "LCNC patch" that would not work with lines, but with sections.

Please Log in or Create an account to join the conversation.

More
16 Jan 2023 23:07 #262185 by andypugh
"diff" files have context around the changes to make them unambiguous.

The way you create one is to edit the original file, save as a new file and then run the "diff" command on the two files.

Then you can re-apply that "diff" file with patch, later.

You don't create the diff by hand, you edit the files ot be what you want, and keep the diff for later.

Please Log in or Create an account to join the conversation.

More
18 Jan 2023 15:29 #262346 by zz912
"diff" files have context around the changes to make them unambiguous.
It's a mystery to me how it works, but since the entire programming world uses it, I'll believe it.

So the procedure should be like this?

First time PNCconfig generates the machine.ini file
- generate a PNCconf machine.ini file
- copy machine.ini to machine-copy.ini
- edit machine-copy.ini
- create a diff file from machine.ini and machine-copy.ini
- use patch to modify machine.ini

The next time PNCconfig generates the machine.ini file
- generate a PNCconf machine.ini file
- use patch to modify machine.ini

The last tab in PNCconf could have three buttons:
1) do nothing
2) editing the ini file (to create a diff file)
it would automatically create a copy of the ini file and open it in the editor. Closing the editor would create a diff file and delete this copy.
3) applying changes from the diff file (patch)
it would show the diff file and the resulting ini file.

Please Log in or Create an account to join the conversation.

More
25 Jan 2023 17:36 #262893 by andypugh
Might work, have a play :-)

Please Log in or Create an account to join the conversation.

More
05 Feb 2023 19:17 #263767 by zz912
I can't use Python3 so I used ChatGPT. I don't know if I'm shocked, horrified, or excited. I'm attaching a program that looks usable to solve my problem. I haven't been able to get him to expand and modify this program, but it's good enough as a skeleton.
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.083 seconds
Powered by Kunena Forum