DNXML *xml = DNXML::createXMLFromFile(contentRoot, "property.xml");
if (xml)
{
+ float tickIntervalFull = 1.0;
+ float tickIntervalSignal = 0;
+ float tickIntervalInput = 0;
+ float tickIntervalOutput = 0;
+
valid = true;
DNXMLElement *element = xml->getRoot();
if (!element)
is >> t;
if (t>0)
{
- setTickIntervalSec(t, t/mNumUpdateScan,t,t);
+ tickIntervalFull = t;
}
else
{
dnNotifyError("Initialization failed",message);
}
}
+ else if (pname == "TICKINTERVALSEC_FULLSCAN")
+ {
+ std::istringstream is(e->text);
+ float t = 0.0;
+ is >> t;
+ if (t>0)
+ {
+ }
+ else
+ {
+ valid = false;
+ std::string message = "Error in property.xml. TickIntervalSec_FullScan is not configured properly.";
+ dnNotifyError("Initialization failed",message);
+ }
+
+ }
+ else if (pname == "TICKINTERVALSEC_SIGNALSCAN")
+ {
+ std::istringstream is(e->text);
+ float t = 0.0;
+ is >> t;
+ if (t>0)
+ {
+ tickIntervalSignal = t;
+ }
+ else
+ {
+ valid = false;
+ std::string message = "Error in property.xml. TickIntervalSec_SignalScan is not configured properly.";
+ dnNotifyError("Initialization failed",message);
+ }
+
+ }
+ else if (pname == "TICKINTERVALSEC_INPUTSCAN")
+ {
+ std::istringstream is(e->text);
+ float t = 0.0;
+ is >> t;
+ if (t>0)
+ {
+ tickIntervalInput = t;
+ }
+ else
+ {
+ valid = false;
+ std::string message = "Error in property.xml. TickIntervalSec_InputScan is not configured properly.";
+ dnNotifyError("Initialization failed",message);
+ }
+
+ }
+ else if (pname == "TICKINTERVALSEC_OUTPUTSCAN")
+ {
+ std::istringstream is(e->text);
+ float t = 0.0;
+ is >> t;
+ if (t>0)
+ {
+ tickIntervalOutput = t;
+ }
+ else
+ {
+ valid = false;
+ std::string message = "Error in property.xml. TickIntervalSec_OutputScan is not configured properly.";
+ dnNotifyError("Initialization failed",message);
+ }
+ }
else if (pname == "UIPATH")
{
mUIPath = e->text;
}
delete xml;
+
+ if (tickIntervalSignal <= 0)
+ {
+ tickIntervalSignal = tickIntervalFull / 5.0;
+ }
+ if (tickIntervalInput <= 0)
+ {
+ tickIntervalInput = tickIntervalFull;
+ }
+ if (tickIntervalOutput <= 0)
+ {
+ tickIntervalOutput = tickIntervalFull;
+ }
+
+ mTimeKeeper->setIntevalSec(tickIntervalFull, tickIntervalSignal, tickIntervalInput, tickIntervalOutput);
}
return valid;
}