Пример #1
0
 public BinaryViewModel(PropellerSerialPort port)
     : base(port, typeof(BinaryFrame))
 {
     base.OnUpdated += delegate()
     {
         this.CurrentValue = (base.CurrentFrame as BinaryFrame).CurrentValue;
     };
 }
 public DataLoggerViewModel(PropellerSerialPort port) : base(port, typeof(IPropellerFrame))
 {
     ReadData = new System.Collections.ObjectModel.ObservableCollection<string>();
     uiDispatcher = Dispatcher.CurrentDispatcher;
     base.OnUpdated += delegate
     {
         if (base.StoreHistory)
         {
             uiDispatcher.BeginInvoke(DispatcherPriority.Background, new ThreadStart(() =>
             {
                 ReadData.Insert(0, string.Format("Received {0} : {1}", base.CurrentFrame.GetType().Name, base.CurrentFrame.ToString()));
             }));
         }
     };
 }
Пример #3
0
 public H48CViewModel(PropellerSerialPort port) : base(port, typeof(H48CFrame)) 
 {
     Last10Frames = new List<H48CFrame>();
     base.OnUpdated += delegate
     {
         Update(base.CurrentFrame as H48CFrame);
     };
 }
Пример #4
0
 public PortViewModel(PropellerSerialPort port)
 {
     this.port = port;
     DeviceList = new ObservableCollection<string>();
     ListDevices();
 }