Explorar el Código

1、cancel simulator timer update property

chenkui hace 1 año
padre
commit
20cbcb4b9a

+ 3 - 10
Venus/Framework/SimulatorCore/Commons/SerialPortDeviceViewModel.cs

@@ -55,7 +55,7 @@ namespace MECF.Framework.Simulator.Core.Commons
 
         protected SerialPortDeviceSimulator _simulator;
 
-        private int maxItemNumber = 100;
+        private int maxItemNumber = 50;
 
         public SerialPortDeviceViewModel(string name) : base(name)
         {
@@ -117,7 +117,7 @@ namespace MECF.Framework.Simulator.Core.Commons
                     //TransactionLogItems = new ObservableCollection<TransactionLogItem>(TransactionLogItems.Skip(1).Take(maxItemNumber).ToList());
                     TransactionLogItems.Clear();
                 }
-                Poll();
+                InvokePropertyChanged();
             }));
         }
 
@@ -131,19 +131,12 @@ namespace MECF.Framework.Simulator.Core.Commons
                     TransactionLogItems.Clear();
                     //TransactionLogItems = new ObservableCollection<TransactionLogItem>(TransactionLogItems.Skip(1).Take(maxItemNumber).ToList());
                 }
-                Poll();
+                InvokePropertyChanged();
             }));
         }
 
         protected override void Poll()
         {
-            Application.Current.Dispatcher.Invoke(new Action(() =>
-            {
-
-
-                InvokePropertyChanged();
-
-            }));
         }
     }
 }

+ 4 - 10
Venus/Framework/SimulatorCore/Commons/SocketDeviceViewModel.cs

@@ -54,7 +54,7 @@ namespace MECF.Framework.Simulator.Core.Commons
             }
         }
 
-        private int maxItemNumber = 200;
+        private int maxItemNumber = 50;
         public string LocalPortSetPoint { get; set; }
 
         public ObservableCollection<TransactionLogItem> TransactionLogItems { get; set; }
@@ -111,7 +111,7 @@ namespace MECF.Framework.Simulator.Core.Commons
                 if (TransactionLogItems.Count > maxItemNumber)
                     //TransactionLogItems = new ObservableCollection<TransactionLogItem>(TransactionLogItems.Skip(1).Take(maxItemNumber).ToList());
                     TransactionLogItems.Clear();
-                Poll();
+                InvokeAllPropertyChanged();
             }));
         }
 
@@ -123,19 +123,13 @@ namespace MECF.Framework.Simulator.Core.Commons
                 if (TransactionLogItems.Count > maxItemNumber)
                     //TransactionLogItems = new ObservableCollection<TransactionLogItem>(TransactionLogItems.Skip(1).Take(maxItemNumber).ToList());
                     TransactionLogItems.Clear();
-                Poll();
+                InvokeAllPropertyChanged();
             }));
         }
 
         protected override void Poll()
         {
-            Application.Current.Dispatcher.Invoke(new Action(() =>
-            {
-
-
-                InvokeAllPropertyChanged();
-
-            }));
+            
         }
     }
 }