void CLogicEvent::read (xmlNodePtr node) { xmlCheckNodeName (node, "EVENT"); ConditionName = getXMLProp (node, "ConditionName"); EventAction.read(node); }
void CLogicVariable::read (xmlNodePtr node) { xmlCheckNodeName (node, "VARIABLE"); _Name = getXMLProp (node, "Name"); _Value = atoiInt64 (getXMLProp (node, "Value").c_str()); NLMISC::fromString(getXMLProp(node, "Verbose"), _Verbose); }
void CLogicEventMessage::read (xmlNodePtr node, const char *subName) { xmlCheckNodeName (node, string(string(subName)+string("EVENT_MESSAGE")).c_str()); Destination = getXMLProp (node, "Destination"); DestinationId = atoiInt64(getXMLProp (node, "DestinationId").c_str()); MessageId = getXMLProp (node, "MessageId"); Arguments = getXMLProp (node, "Arguments"); }
void CLogicEventAction::read (xmlNodePtr node) { xmlCheckNodeName (node, "EVENT_ACTION"); NLMISC::fromString(getXMLProp(node, "IsStateChange"), IsStateChange); if (IsStateChange) { StateChange = getXMLProp (node, "StateChange"); } else { EventMessage.read(node); } }
void CLogicCounter::read (xmlNodePtr node) { xmlCheckNodeName (node, "COUNTER"); _Name = getXMLProp (node, "Name"); _Value = atoiInt64 (getXMLProp (node, "Value").c_str()); _Verbose = atoi(getXMLProp (node, "Verbose").c_str()) == 1; Period.setValue(atoiInt64(getXMLProp (node, "Period").c_str())); Phase.setValue(atoiInt64(getXMLProp (node, "Phase").c_str())); Step.setValue(atoiInt64(getXMLProp (node, "Step").c_str())); LowLimit.setValue(atoiInt64(getXMLProp (node, "LowLimit").c_str())); HighLimit.setValue(atoiInt64(getXMLProp (node, "HighLimit").c_str())); Mode.setValue(atoiInt64(getXMLProp (node, "Mode").c_str())); Control.setValue(atoiInt64(getXMLProp (node, "Control").c_str())); }
void CLogicStateMachine::read (xmlNodePtr node) { xmlCheckNodeName (node, "STATE_MACHINE"); setName (getXMLProp (node, "Name")); { // Count the parent uint nb = CIXml::countChildren (node, "VARIABLE"); uint i = 0; xmlNodePtr parent = CIXml::getFirstChildNode (node, "VARIABLE"); while (i<nb) { CLogicVariable v; v.read(parent); _Variables.insert (make_pair(v.getName(), v)); // Next parent parent = CIXml::getNextChildNode (parent, "VARIABLE"); i++; } } { // Count the parent uint nb = CIXml::countChildren (node, "COUNTER"); uint i = 0; xmlNodePtr parent = CIXml::getFirstChildNode (node, "COUNTER"); while (i<nb) { CLogicCounter v; v.read(parent); _Counters.insert (make_pair(v.getName(), v)); // Next parent parent = CIXml::getNextChildNode (parent, "COUNTER"); i++; } } { // Count the parent uint nb = CIXml::countChildren (node, "CONDITION"); uint i = 0; xmlNodePtr parent = CIXml::getFirstChildNode (node, "CONDITION"); while (i<nb) { CLogicCondition v; v.read(parent); _Conditions.insert (make_pair(v.getName(), v)); // Next parent parent = CIXml::getNextChildNode (parent, "CONDITION"); i++; } } { // Count the parent uint nb = CIXml::countChildren (node, "STATE"); uint i = 0; xmlNodePtr parent = CIXml::getFirstChildNode (node, "STATE"); while (i<nb) { CLogicState v; v.read(parent); _States.insert (make_pair(v.getName(), v)); // Next parent parent = CIXml::getNextChildNode (parent, "STATE"); i++; } } setCurrentState (getXMLProp (node, "CurrentState")); }