I have a 3rd party working on a system for me and they've delivered a working vxWorks image with binaries that run their software. They've also provided me with source code describing the specific models, but haven't provided me the entire development environment yet. I'm trying to fill in some of the dependencies so I can emulate their models in my own software for when the vxWorks machines fail and I can only emulate real-time in Windows. I have everything working except for the configuration loading.
In the following code, I am writing GenericBase
from scratch as those were not provided. CReadOnlyModule
is read-only since I expect to get updates and can't maintain configuration control if I change this class.
class CReadOnlyModule : public GenericBase
CReadOnlyModule(const std::string& inName);
// I think inName is "ReadOnlyModule"
CReadOnlyModule::CReadOnlyModule(const std::string& inName)
m_pParameterSet = new ParameterSet("default", false);
I also have a configuration file which sets the value of mMyParameter1. It looks like this (but it contains several Modules and parameters per module.
FLOAT MyParameter1 200
ENDDEF MODULE ReadOnlyModule
How can I set mMyParameter1
to the value in the config file within the framework above?
I believe the parsing needs to be done in the constructors of GenericBase or ParameterSet and the driving needs to be in CreateFloat. The inName is important here because it defines the name to lookup when reading the cfg. Therefore I can only assume that the file is opened and parsed in GenericBase. But if that's the case, how can I get the information into the CreateFloat()
MyParameter1 is not an exclusive name and it's set to different values for different modules in this cfg.
Edit: F5 F5 F5 F5 F5 F5 F5