private void loadInfo() { if (File.Exists("alert.properties")) { alertTable = File.ReadAllText("alert.properties"); } if (File.Exists("dbmapping.properties")) { string[] mappings = File.ReadAllLines("dbmapping.properties"); for (int i = 0; i < mappings.Length; i++) { string[] values = mappings[i].Split(','); dbNameMapping.Add(values[0], values[1]); } } LabelStructure labelStructure = new LabelStructure(); if (File.Exists("label.properties")) { string[] labels = File.ReadAllLines("label.properties"); labelStructure.load(labels); } opc.registerOPCServer(); handles = opc.addOPCLabels(labelStructure); }
public Dictionary<string, Dictionary<string, uint>> addOPCLabels(LabelStructure label) { Dictionary<string, Dictionary<string, uint>> labelHandles = new Dictionary<string, Dictionary<string, uint>>(); foreach (string equip in label.equipmentNames) { Dictionary<string, LabelItem> items = label.labelItemNamems[equip]; Dictionary<string, uint> handles = new Dictionary<string, uint>(); foreach (KeyValuePair<string, LabelItem> pair in items) { deactive(); uint handle = OPClib.CreateTag(equip + "." + pair.Key, getDefaultValue(pair.Value.labelType), 0, true); handles.Add(pair.Key, handle); } labelHandles.Add(equip, handles); } return labelHandles; }
public Dictionary <string, Dictionary <string, uint> > addOPCLabels(LabelStructure label) { Dictionary <string, Dictionary <string, uint> > labelHandles = new Dictionary <string, Dictionary <string, uint> >(); foreach (string equip in label.equipmentNames) { Dictionary <string, LabelItem> items = label.labelItemNamems[equip]; Dictionary <string, uint> handles = new Dictionary <string, uint>(); foreach (KeyValuePair <string, LabelItem> pair in items) { deactive(); uint handle = OPClib.CreateTag(equip + "." + pair.Key, getDefaultValue(pair.Value.labelType), 0, true); handles.Add(pair.Key, handle); } labelHandles.Add(equip, handles); } return(labelHandles); }
private void loadInfo() { if (File.Exists("alert.properties")) { alertTable = File.ReadAllText("alert.properties"); } if (File.Exists("dbmapping.properties")) { string[] mappings = File.ReadAllLines("dbmapping.properties"); for (int i = 0; i < mappings.Length; i++) { string[] values = mappings[i].Split(','); dbNameMapping.Add(values[0], values[1]); } } LabelStructure labelStructure = new LabelStructure(); if (File.Exists("label.properties")) { string[] labels = File.ReadAllLines("label.properties"); labelStructure.load(labels); } opc.registerOPCServer(); handles = opc.addOPCLabels(labelStructure); }