protected void RefreshTimeTaggedMeasurementsPerNode() { List <Node> nodeList = new List <Node>(); nodeList = CommonFunctions.GetNodeList(null, true); foreach (Node node in nodeList) { //lock (syncRoot) lock (minMaxPointIDsPerNode) { if (minMaxPointIDsPerNode.ContainsKey(node.ID)) { minMaxPointIDsPerNode[node.ID] = CommonFunctions.GetMinMaxPointIDs(null, node.ID); } else { minMaxPointIDsPerNode.Add(node.ID, CommonFunctions.GetMinMaxPointIDs(null, node.ID)); } } } foreach (Node node in nodeList) { KeyValuePair <int, int> minMaxPointID = minMaxPointIDsPerNode[node.ID]; TimeTaggedDataMessage message; if (!string.IsNullOrEmpty(node.TimeSeriesDataServiceUrl)) { message = new TimeTaggedDataMessage() { TimeTaggedMeasurements = CommonFunctions.GetTimeTaggedMeasurements(node.TimeSeriesDataServiceUrl + "/timeseriesdata/read/current/" + minMaxPointID.Key.ToString() + "-" + minMaxPointID.Value.ToString() + "/XML") } } ; else { message = new TimeTaggedDataMessage(); } //lock (syncRoot) lock (timeTaggedMeasurementsPerNode) { if (timeTaggedMeasurementsPerNode.ContainsKey(node.ID)) { timeTaggedMeasurementsPerNode[node.ID] = message; } else { timeTaggedMeasurementsPerNode.Add(node.ID, message); } } } }
protected void RefreshTimeTaggedMeasurementsPerNode() { List<Node> nodeList = new List<Node>(); nodeList = CommonFunctions.GetNodeList(null, true); foreach (Node node in nodeList) { //lock (syncRoot) lock (minMaxPointIDsPerNode) { if (minMaxPointIDsPerNode.ContainsKey(node.ID)) minMaxPointIDsPerNode[node.ID] = CommonFunctions.GetMinMaxPointIDs(null, node.ID); else minMaxPointIDsPerNode.Add(node.ID, CommonFunctions.GetMinMaxPointIDs(null, node.ID)); } } foreach (Node node in nodeList) { KeyValuePair<int, int> minMaxPointID = minMaxPointIDsPerNode[node.ID]; TimeTaggedDataMessage message; if (!string.IsNullOrEmpty(node.TimeSeriesDataServiceUrl)) message = new TimeTaggedDataMessage() { TimeTaggedMeasurements = CommonFunctions.GetTimeTaggedMeasurements(node.TimeSeriesDataServiceUrl + "/timeseriesdata/read/current/" + minMaxPointID.Key.ToString() + "-" + minMaxPointID.Value.ToString() + "/XML") }; else message = new TimeTaggedDataMessage(); //lock (syncRoot) lock (timeTaggedMeasurementsPerNode) { if (timeTaggedMeasurementsPerNode.ContainsKey(node.ID)) timeTaggedMeasurementsPerNode[node.ID] = message; else timeTaggedMeasurementsPerNode.Add(node.ID, message); } } }