示例#1
0
        public MainPage()
        {
            this.usbDevices    = new List <UsbDeviceInfo>();
            this.serialDevices = new List <SerialDeviceInfo>();

            this.InitializeComponent();

            SetupControls();
            //CreateNewCSVFile(); // Needs to be done per experiment in the UI
            //SensorsLive.DataContext = CurrentRecordCache;

            IoTHubSetup();

            ExperimentCharts.SetCache(ref Cache);
            RPMGauge.SetCache(ref Cache);

            // Start concurrent queue listener
            Task.Run(StartBackgroundLoop);

            // Start/Stop data read
            lock (lockObj)
            {
                this.bPauseDataRead = !this.bPauseDataRead;
            }

            if (this.bPauseDataRead)
            {
                this.state.serialWire.Update(DataFlow.Stopped);
            }
            else
            {
            }
        }
 public void setRPMGauge(int rpmVal)
 {
     if (RPMGauge.InvokeRequired)
     {
         RPMGauge.Invoke(new EventHandler(
                             delegate
         {
             RPMGauge.Value = rpmVal;
         }));
     }
     else
     {
         RPMGauge.Value = rpmVal;
     }
     RPMGauge.Value    = rpmVal;
     RPMGauge.DialText = "RPM X 100";
 }