|
@@ -55,6 +55,8 @@ namespace NB_IOT_TCP_HP_SOCKET
|
|
|
|
|
|
public static TcpServer server = new TcpServer();
|
|
|
public static TcpServer monitor = new TcpServer();
|
|
|
+
|
|
|
+ private static Dictionary<string, List<HistoryRecord>> meterHis = new Dictionary<string, List<HistoryRecord>>();
|
|
|
|
|
|
private delegate void ShowMsg(string msg, ListBox lb);
|
|
|
private ShowMsg AddMsgDelegate;
|
|
@@ -928,6 +930,7 @@ namespace NB_IOT_TCP_HP_SOCKET
|
|
|
}
|
|
|
|
|
|
InsourcingData insourcingData = new InsourcingData();
|
|
|
+ insourcingData.SourceNumber = psp.SourceNumber;
|
|
|
insourcingData.Data = psp.Data;
|
|
|
insourcingData.ConnId = clientInfo.ConnId;
|
|
|
insourcingData.DT = dt;
|
|
@@ -1308,7 +1311,12 @@ namespace NB_IOT_TCP_HP_SOCKET
|
|
|
|
|
|
else if ("1".Equals(insourcingData.DataType))
|
|
|
{
|
|
|
+ string sourceNumber = insourcingData.SourceNumber;
|
|
|
List<HistoryRecord> list = new List<HistoryRecord>();
|
|
|
+ if (meterHis.ContainsKey(sourceNumber))
|
|
|
+ {
|
|
|
+ list = meterHis[sourceNumber];
|
|
|
+ }
|
|
|
|
|
|
|
|
|
CellMonitorDeviceType cellMonitorDeviceType = new CellMonitorDeviceType(insourcingData.AgreementParam);
|
|
@@ -1346,12 +1354,15 @@ namespace NB_IOT_TCP_HP_SOCKET
|
|
|
{
|
|
|
list.AddRange(item);
|
|
|
}
|
|
|
+ meterHis[sourceNumber] = list;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- ProtocolAnalysisTools.SaveRecordNew(list);
|
|
|
+ if (cm.IsEnd)
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+ ProtocolAnalysisTools.SaveRecordNew(meterHis[sourceNumber]);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1389,7 +1400,8 @@ namespace NB_IOT_TCP_HP_SOCKET
|
|
|
List<HistoryRecord> item = this.UpdateHistoryData(insourcingData.Recordtime, null, dt, _analogData, _switchData);
|
|
|
|
|
|
|
|
|
- ProtocolAnalysisTools.SaveRecord(item);
|
|
|
+
|
|
|
+ ProtocolAnalysisTools.SaveRecordNew(item);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1817,7 +1829,7 @@ namespace NB_IOT_TCP_HP_SOCKET
|
|
|
public string AgreementParam { get; set; }
|
|
|
public DateTime Recordtime { get; set; }
|
|
|
public DataTable DT { get; set; }
|
|
|
-
|
|
|
+ public string SourceNumber { get; set; }
|
|
|
}
|
|
|
|
|
|
|