Talk:BControl Preferences

From Bcontrol

S: How will these files be read/parsed by functions that need this info?

read + parsed every time a function needs a value?

read + parsed the first time the system starts up, or whenever a new protocol is loaded?

We need something speedy.

CarlosBrody 02:29, 26 June 2007 (EDT)


I didn't notice this comment until now.

Naturally, we wouldn't want the settings files read every time.

A global variable called BControl_Settings stores an object of class SettingsObject. The first get or load (or compare...) loads settings files into a struct that is a field of this SettingsObject. Additional Settings('load',...) calls read more settings into the global SettingsObject from additional files (overwriting values if specific settings already exist); however, in the standard case, only in newstartup will settings files (specifically the Default and Custom files) be read into memory from the filesystem.

Protocol developers should use the Settings(...) interface (BControl Settings Interface) for global settings, and are also are free to instantiate and store their own SettingsObject objects for their own specialized purposes - though I suppose they may elect to use the global object via the Settings(...) interface and simply require that users have additional settings in their Custom settings file relating to their particular protocols.

Sebastien 08:57, 31 July 2007 (EDT)