49 #ifndef _LAE_XML_TUNE_H 50 #define _LAE_XML_TUNE_H 54 #include "rnr/rnrconfig.h" 55 #include "rnr/appkit/Xml.h" 57 #include "rnr/tinyxml/tinyxml.h" 108 bool bAllInstances=
false);
132 const std::string &strXmlFileName=
LaeEtcTune);
143 int rc = Xml::saveFile(strXmlFileName);
163 rc = Xml::saveFile(strXmlFileName);
269 TiXmlElement *pElemSubSec,
282 TiXmlElement *pElemSubSec,
306 std::string &strAttrType,
307 std::string &strAttrLoc,
327 const std::string &strText,
349 const std::string &strText,
372 const std::string &strText,
389 int strToNorm(
const std::string &strElem,
390 const std::string &strText,
401 setErrorMsg(
"%s: Element <%s> unknown - ignoring.",
402 m_strXmlFileName.c_str(), strElem.c_str());
403 LOGWARN(
"%s", m_bufErrMsg);
409 #endif // _LAE_XML_TUNE_H std::string m_strSecElemRangeSensor
range sensor section elem name
Laelaps tuning data class.
LaeXmlTune <b><i>Laelaps</i></b> XML tuning class.
const char *const LaeEtcTune
xml tune file
virtual int saveFile(const LaeTunes &tunes, const std::string &strXmlFileName=LaeEtcTune)
Set DOM from <b><i>Laelaps</i></b> tuning parameters and save XML file.
virtual int loadFile(const std::string &strXmlFileName=LaeEtcTune)
Load XML file into DOM.
int strToDoubleWithMinimum(const std::string &strElem, const std::string &strText, const double fMin, double &fVal)
Convert text to value with a minimum value.
int strToNorm(const std::string &strElem, const std::string &strText, LaeNorm &eNorm)
Convert text to norm enum.
virtual int createTemplateFile(const std::string &strXmlFileName=LaeEtcTune)
Create a template <b><i>Laelaps</i></b> XML configuration file. root element.
int setGlobalThreadTunes(TiXmlElement *pElemSubSec, LaeTunes &tunes)
Set the global threads tune parameters from the parsed DOM.
void warnUnknownElem(const std::string &strElem)
Warn on unknown element.
int setVL6180Tunes(TiXmlElement *pElemSec, std::string &strAttrType, std::string &strAttrLoc, LaeTunes &tunes)
Set <b><i>Laelaps</i></b> VL6180 range sensor tuning parameters from DOM.
int setPowertrainVelPidTunes(const std::string &strLoc, TiXmlElement *pElemSubSec, LaeTunes &tunes)
Set a powertrain pair's velocity PID tune parameters from the parsed DOM.
virtual int setTunesFromDOM(LaeTunes &tunes)
Set the tune parameters from the parsed DOM.
const char *const LaeSysCfgPath
System configuration search path.
virtual int load(LaeTunes &tunes, const std::string &strSearchPath=LaeSysCfgPath, const std::string &strXmlFileName=LaeEtcTune, bool bAllInstances=false)
Load XML file into DOM and set the <b><i>Laelaps</i></b> tuning parameters.
The <b><i>Laelaps</i></b> namespace encapsulates all <b><i>Laelaps</i></b> related constructs...
virtual int setBatteryTunes(TiXmlElement *pElemSec, LaeTunes &tunes)
Set <b><i>Laelaps</i></b> battery tune parameters from the parsed DOM.
const char *const LaeXsiUrl
xml schema instance url
virtual int setPowertrainTunes(TiXmlElement *pElemSec, LaeTunes &tunes)
Set <b><i>Laelaps</i></b> powertrain tuning parameters from the parsed DOM.
std::string m_strSecElemPowertrains
powertrain section element name
const char *const LaeXslUrl
xml stylesheet url
virtual ~LaeXmlTune()
Destructor.
int strToDoubleWithinRange(const std::string &strElem, const std::string &strText, const double fMin, const double fMax, double &fVal)
Convert text to FPN value within minimum,maximum range.
virtual int setRangeSensorTunes(TiXmlElement *pElemSec, LaeTunes &tunes)
Set <b><i>Laelaps</i></b> range sensor tuning parameters from DOM.
int setPowertrainTireTunes(const std::string &strLoc, TiXmlElement *pElemSubSec, LaeTunes &tunes)
Set a powertrain pair's tire tune parameters from the parsed DOM.
int setGlobalTunes(TiXmlElement *pElemSec, LaeTunes &tunes)
Set the global tune parameters from the parsed DOM.
LaeXmlTune()
Default constructor.
std::string m_strMajElemTuning
major element under 'laelaps'
virtual int saveFile(const std::string &strXmlFileName=LaeEtcTune)
Save DOM to XML file.
static const int LAE_ECODE_XML
XML error.
int setGlobalTrajTunes(TiXmlElement *pElemSubSec, LaeTunes &tunes)
Set the global trajectory tune parameters from the parsed DOM.
virtual int setDOMFromTunes(const LaeTunes &tunes)
Set the DOM from the <b><i>Laelaps</i></b> tune parameters.
std::string m_strSecElemBattery
battery section element name
std::string m_strSecElemGlobal
global tuning section element
LaeNorm
Length/Distance Norm.
int strToIntWithinRange(const std::string &strElem, const std::string &strText, const int nMin, const int nMax, int &nVal)
Convert text to integer value within minimum,maximum range.
Top-level package include file.
static const int LAE_OK
not an error, success