Schildkroet / Candle2

GRBL control interface in Qt.
GNU General Public License v3.0
203 stars 56 forks source link

support multiple machine-specific configurations ("profiles") #57

Closed scgtrp closed 9 months ago

scgtrp commented 9 months ago

This makes Candle2 usable for driving multiple machines from the same computer, by making separate copies of the entire config file per machine.

By default, nothing will change; the file format is unchanged, and the current configuration is treated as a default profile. If multiple profiles are present at startup, the user is prompted to select one. If the environment variable $CANDLE_PROFILE is present and non-empty, that profile is used without prompting.

Profiles are stored in the app config directory, as urlencode(profilename) + ".ini". (URL-encoding the names allows profiles to be named without regard for the platform's file naming rules.)

There is currently no UI for managing profiles; they may be created by manually copying settings.ini to a new file in the same directory, or by setting $CANDLE_PROFILE to a profile that does not yet exist (it will be created with default settings).

scgtrp commented 9 months ago

My use case here is that I have two GRBL machines now, a laser engraver and a CNC router, and I wanted different user command buttons for each.

I'm not opposed to adding a UI for this; I didn't in this PR because (1) I wanted to make sure you're okay with this before I go expanding on it, and (2) UI design is hard and I don't feel like doing it tonight. :)

Schildkroet commented 9 months ago

Thx for the contribution