yinyujing 2 anni fa
parent
commit
d268839a77
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      NB_IOT_TCP_HP_SOCKET/MainForm_TCP.cs

+ 2 - 1
NB_IOT_TCP_HP_SOCKET/MainForm_TCP.cs

@@ -1313,7 +1313,7 @@ namespace NB_IOT_TCP_HP_SOCKET
                             {
                                 string sourceNumber = insourcingData.SourceNumber;
                                 List<HistoryRecord> list = new List<HistoryRecord>();
-                                if (meterHis.ContainsKey(sourceNumber)) 
+                                if (meterHis.Count > 0 && meterHis.ContainsKey(sourceNumber)) 
                                 {
                                     list = meterHis[sourceNumber];
                                 }
@@ -1362,6 +1362,7 @@ namespace NB_IOT_TCP_HP_SOCKET
                                     // 保存抄表数据
                                     //ProtocolAnalysisTools.SaveRecord(list);
                                     ProtocolAnalysisTools.SaveRecordNew(meterHis[sourceNumber]);
+                                    meterHis.Remove(sourceNumber);
                                 }
                             }
                         }