plugins - storing variables within uccnc

This is where you talk about Plugins. How they are made and how they work, show examples.

plugins - storing variables within uccnc

Postby Robertspark » Wed Sep 14, 2016 4:48 pm

Hello,

with the Contour Shuttle Xpress plugin that I attempted (its a little rough!), I use the streamwriter and streamreader class within c# to store the settings for the various buttons on the contour shuttle xpress.

Is there a way that these settings can be store these values within the uccnc without resorting to a text file to saving and recalling these settings.

Thanks very much

(no rush on any explanations or guidance, I'm doing other things (other than plugins) at present)
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: plugins - storing variables within uccnc

Postby Robertspark » Wed Sep 14, 2016 6:24 pm

Ahhhh!

[having a lot of epiphanies this evening!]

Function: string Readkey(string section, string key, string defaultvalue)
Description: This function reads a key value from the profile (.pro) file. The section and the key parameter defines which key to read from the profile file and the function returns with the defaultvalue parameter if the key does not exist in the profile file. The function returns a string type.
Example: string mykeyvalue = exec.Readkey("axessettingscontrolX", "Axisenabled", "False");

Function: void Writekey(string section, string key, string value)
Description: This function writes a key value into the profile (.pro) file. The section, and the key parameter defines which key to write to the profile file. The value parameter is the new value to write. If the key already exists in the profile file then the function overwrites the key with the new value. If the key does not exist then the function creates the key in the file with the set value.
Example: exec.Writekey("axessettingscontrolX", "Axisenabled", "False");
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm


Return to Plugins

Who is online

Users browsing this forum: No registered users and 6 guests