-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Suggestion] make the .bCNC modular #424
Comments
One option is to have the #include comand in the .ini file. 2016-09-10 10:46 GMT-03:00 Carlo notifications@github.com:
|
I'm trying to implement a modular configuration directory under ~/.config/bCNC/ directory in Linux or in $User/%AppData%/bCNC in windows. But as the load config is fairly easy, you put the filenames in the line that read the config file and the last config variable readed is what it is used. For saving it seems that all the configuration is saved .bCNC file. I'm trying to guess from the code how to load the Buttons Machine and Tools configuration from different files and saving them in the same file when you perform a save or automatically at the program closing. |
After some look at the code of bCNC modifying the ini file .bCNC to split in different files will be a difficult exercise, without some discussion with @vlachoudis it is difficult to integrate in the structure of bCNC. |
@onekk a modular approach with be certainly better. I didn't think of it at the begging that is going to expand so much. I would have to think how would be the easiest way and as well provide some compatibility of reading the old files. |
I believe that adding the #Include option will be the easy way. 2016-09-15 2:13 GMT-03:00 Vasilis Vlachoudis notifications@github.com:
|
I have done an approach that it was easy for a CAM program that I ve started to write but now is abandoned. I have defined a python module that hold the global variable named glb.py and defined some empty dictionaries. plus for every file i have wrote the rules that check the esistence of the files and state two predefined location, defined in the init routine of the program based on the os identificator. Linux hold the data in the .config hidden directory Windows maybe in the $user directory i didn't remember well if it is in %APPDATA% or similar
THis function read the tooltable and pupulate the
When necessary the dictionary is dumped to file with this routine and there is even an update routine that write the tooltable and reread if necessary.
with this approach every variable is defined with a name and it is more compact to address in the code in the glb.py the
A variable hold the fields under each tool item:
But maybe there is another better appoach. In this manner the Dictionary is imported and "propagated" importing only the glb module (global variable module). But I'm not a professional programmer. Regards |
It was becoming diffficult to mantain the .bCNC in sync with customisation across version change.
In prevision of the 1.0 version, it will be advisable to make the .bCNC file contain only interface customisations, and put the toll, material and ather settngs in external file, maybe in separate direcory with meninful name (bCNC-settings?)
with maybe a toll.ini and material.ini and ,maybe a machine.ini
in this manner the relevant customisation will be preserved across bCNC version change and will be possible make a script to convert the tables between versions
I have used successfully in one of my project adopted this approach and it served me very well, if the program at the first startup din't find the appropriate directory it create them othewise it utilize the files present in the directory.
Regards
The text was updated successfully, but these errors were encountered: