private void ReadModuleVariables(XmlReader reader) { map.Clear(); if (reader.IsEmptyElement) { return; } ObjectRef currentObj = new ObjectRef(); string var_Name = ""; string var_Time = ""; string var_Quality = ""; bool inVar = false; while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Element: inVar = false; switch (reader.Name) { case "Obj": currentObj = ObjectRef.Make(moduleID, reader.GetAttribute("id")); break; case "Var": var_Name = reader.GetAttribute("name"); var_Time = reader.GetAttribute("time"); var_Quality = reader.GetAttribute("quality"); inVar = true; break; } break; case XmlNodeType.Text: if (inVar) { var t = TimestampFromString(var_Time); var q = QualityFromString(var_Quality); var v = DataValue.FromJSON(reader.Value); var varRef = new VariableRef(currentObj, var_Name); map[varRef] = new VTQ(t, q, v); inVar = false; } break; case XmlNodeType.EndElement: inVar = false; if (reader.Name == "Module") { return; } break; } } }
public static MemberValue Make(string moduleID, string localObjectID, string memberName, DataValue value) { return(new MemberValue(MemberRef.Make(ObjectRef.Make(moduleID, localObjectID), memberName), value)); }
public static AddArrayElement Make(string moduleID, string localObjectID, string arrayMemberName, DataValue valueToAdd) { return(new AddArrayElement(MemberRef.Make(ObjectRef.Make(moduleID, localObjectID), arrayMemberName), valueToAdd)); }
public static MemberRefIdx Make(string moduleID, string localObjectID, string memberName, int index) { return(new MemberRefIdx(ObjectRef.Make(moduleID, localObjectID), memberName, index)); }
public static MemberRef Make(string moduleID, string localObjectID, string memberName) { return(new MemberRef(ObjectRef.Make(moduleID, localObjectID), memberName)); }
public static VariableValue Make(string moduleID, string localObjectID, string variable, VTQ value) { return(new VariableValue(VariableRef.Make(ObjectRef.Make(moduleID, localObjectID), variable), value)); }
public static VariableRef Make(string moduleID, string localObjectID, string variableName) { return(new VariableRef(ObjectRef.Make(moduleID, localObjectID), variableName)); }
public static ObjectValue Make(string moduleID, string localObjectID, DataValue value) { return(new ObjectValue(ObjectRef.Make(moduleID, localObjectID), value)); }