-
Notifications
You must be signed in to change notification settings - Fork 3
getConfigSetting
value = Datamaster.getConfigSetting(key)
value = Datamaster.getConfigSetting(key)
Return the a string with the value
assigned to the given key
. getConfigSetting
looks for the key first in config.ini
at the location given by Datamaster.getPath
, then in default.ini
. If the key can not be found in either location or default.ini
does not exist an error is thrown. If config.ini
does not exist and empty file is created at Datamaster.getPath
.
To allow for a degree of customization Datamaster reads certain values from configuration files namely default.ini
which is tracked by git and config.ini
which is not. This has the added benefit of allowing some universal parameters (such as the location of the datastore) to be set to default values and still allow for other (Such as the Google API keys used by DataReporter) to remain secret (or at least not openly public).
Keys | Description |
---|---|
datastore_path | Location of the datastore directory storing the exported *.mat files |
master_directory | Location of the SQLite Database used by Datamaster |
client_id | Google API Console Client Id used for authentication via OAuth |
client_secret | Google API Console Client Id used for authentication via OAuth |
Both default.ini
and config.ini
are plan text files that can be edited using any text editor. Each key-value pair must be placed on a separate line using the format: key-value
. Below is an example configuration file:
datastore_path=C:\Users\Alex\OneDrive\ARG17\Datastore
master_directory_path=%datastore%\master_directory.sqlite
Macros can be used when setting key-values and will be replaced at run time by the relevant value
Macro | Replacement |
---|---|
%datastore% |
Value specifed by the datastore_path key |
%Datamaster% |
Value given by Datamaster.getPath
|
- Access Methods
- Static Methods