Пример #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="ev">Reference to EV2300 board</param>
        public GaugeInfo(EV23K ev)
        {
            EV23KBoard   = ev;
            sbsItems     = new SbsItems(@"4800_0_02-bq40z80.bqz");
            bcfgItems    = new BcfgItems(@"4800_0_02_03-bq40z80.bcfgx");
            cancelSource = new CancellationTokenSource();
            cancelToken  = cancelSource.Token;

            WriteDevice("DEVICE_NUMBER");
            WriteDevice("HW_VERSION");
            WriteDevice("FW_VERSION");
            WriteDevice("FW_BUILD");
            WriteDevice("CHEM_ID");
            ReadDevice("Device Name");

            StartPolling();
        }
Пример #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            plot        = new PlotViewModel();
            DataContext = plot;

            Title = "BQEV2300 - v1.0 by Mictronics";
            System.Windows.Forms.Integration.WindowsFormsHost host;
            board          = new EV23K(out host);
            host.Width     = host.Height = 0;
            host.IsEnabled = false;
            MainGrid.Children.Add(host);
            timerUpdateGUI          = new DispatcherTimer();
            timerUpdateGUI.Tick    += new EventHandler(UpdateGui);
            timerUpdateGUI.Interval = new TimeSpan(0, 0, 0, 0, 500);
            timerUpdateGUI.Start();

            timerUpdatePlot          = new DispatcherTimer();
            timerUpdatePlot.Tick    += new EventHandler(UpdatePlot);
            timerUpdatePlot.Interval = new TimeSpan(0, 0, 0, 5, 0);
        }