mirror of
https://github.com/EyeTrackVR/OpenIris.git
synced 2025-11-04 15:39:42 +08:00
implemented:
- save, load, reset functions for config
This commit is contained in:
parent
4a8ebffa82
commit
f3606676f9
@ -33,18 +33,36 @@ void ProjectConfig::initStructures()
|
||||
void ProjectConfig::load()
|
||||
{
|
||||
log_d("Loading project config");
|
||||
|
||||
if (this->_already_loaded)
|
||||
{
|
||||
log_d("Project config already loaded");
|
||||
return;
|
||||
}
|
||||
bool device_success = this->read("device", this->config.device);
|
||||
bool camera_success = this->read("camera", this->config.camera);
|
||||
bool network_info_success = this->read("network_info", this->config.networks);
|
||||
if (!device_success || !camera_success || !network_info_success)
|
||||
{
|
||||
log_e("Failed to load project config");
|
||||
this->_already_loaded = false;
|
||||
return;
|
||||
}
|
||||
this->_already_loaded = false;
|
||||
this->notify(ObserverEvent::configLoaded);
|
||||
}
|
||||
|
||||
void ProjectConfig::save()
|
||||
{
|
||||
log_d("Saving project config");
|
||||
this->write("device", this->config.device);
|
||||
this->write("camera", this->config.camera);
|
||||
this->write("network_info", this->config.networks);
|
||||
}
|
||||
|
||||
void ProjectConfig::reset()
|
||||
{
|
||||
log_d("Resetting project config");
|
||||
log_w("Resetting project config");
|
||||
this->clear();
|
||||
}
|
||||
|
||||
//**********************************************************************************************************************
|
||||
|
||||
Loading…
Reference in New Issue
Block a user