Example #1
0
        public MainWindow()
        {
            InitializeComponent();
            DataContext  = this;
            SendDataStrs = new ObservableCollection <string>();
            SendCommandListBox.ItemsSource = SendDataStrs;
            SendDataStrs.Add("sdfas");
            SendDataStrs.Add("sdf");
            ReceiveDataStrs = new ObservableCollection <string>();
            ReceiveCommandListBox.ItemsSource = ReceiveDataStrs;
            ReceiveDataStrs.Add("HAHAHA");

            SetAccRangeComboBoxSource = new ObservableCollection <VR33BAccelerometerRange>()
            {
                VR33BAccelerometerRange._2g, VR33BAccelerometerRange._4g, VR33BAccelerometerRange._8g, VR33BAccelerometerRange._16g
            };
            SetAccRangeComboBox.ItemsSource  = SetAccRangeComboBoxSource;
            SetSampleFrequencyComboBoxSource = new ObservableCollection <VR33BSampleFrequence>()
            {
                VR33BSampleFrequence._1Hz, VR33BSampleFrequence._4Hz, VR33BSampleFrequence._16Hz, VR33BSampleFrequence._64Hz, VR33BSampleFrequence._128Hz, VR33BSampleFrequence._256Hz
            };
            SetSampleFrequencyComboBox.ItemsSource = SetSampleFrequencyComboBoxSource;


            TestTable = new ObservableCollection <VR33BSampleValue>();
            TestTable.Add(new VR33BSampleValue());
            TestTable.Add(new VR33BSampleValue());
            //SampleDataListView.DataContext = TestTable;
            SampleDataListView.ItemsSource = TestTable;
            //TestTable.CollectionChanged += TestTable_CollectionChanged;

            VR33BTerminal = new VR33BTerminal(new VR33BSqliteStorage(), true);
            //VR33BTerminal.OnReceived += VR33BTerminal_OnReceived;

            VR33BTerminal.OnSerialPortSent += VR33BTerminal_OnSerialPortSent;
            //VR33BTerminal.OnVR33BSampleValueReceived += VR33BTerminal_OnVR33BSampleValueReceived;

            VR33BGraph.VR33BTerminal = VR33BTerminal;
        }
Example #2
0
 public VR33BSampleTimeDispatcher(VR33BTerminal terminal)
 {
     VR33BTerminal           = terminal;
     _SampleValuesBufferLock = new object();
     _SampleValuesBuffer     = new List <VR33BSampleValue>();
 }