示例#1
0
        private void gas_data_update(DataGrid grid, List <UIDataGrid> list, MonitorChart chart1,
                                     string time, int data1, float data2, float data3, float data4, float data5, float data6, int data7, float data8,
                                     uint data9, uint data10, byte data11, float data12, float data13, float data14, float data15)
        {
            gridRowMax = (int)tUpdown_NumReadings.Value;

            if (grid.Items.Count >= gridRowMax)
            {
                list.RemoveAt(0);
            }

            list.Add(new UIDataGrid(time, string.Format("{0}", data1), string.Format("{0:f4}", data2),
                                    string.Format("{0:f4}", data3), string.Format("{0:f4}", data4),
                                    string.Format("{0:f4}", data5), string.Format("{0:f1}", data6),
                                    string.Format("{0}", data7), string.Format("{0}", data8),
                                    string.Format("{0}", data9), string.Format("{0}", data10),
                                    string.Format("{0}", data11), string.Format("{0}", data12),
                                    string.Format("{0}", data13), string.Format("{0}", data14),
                                    string.Format("{0:f4}", data15)
                                    ));

            chart1.AddData(0, time, data1);
            chart1.AddData(1, time, data2);
            chart1.AddData(2, time, data3);
            chart1.AddData(3, time, data4);
            chart1.AddData(4, time, data5);

            grid.Items.Refresh();

            if (grid.Items.Count > 0)
            {
                grid.ScrollIntoView(grid.Items[grid.Items.Count - 1]);
            }
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();

            orginalWidth   = Width;
            originalHeight = Height;

            scale    = new ScaleTransform();
            logFiles = new LogToFile("Incom_Gas_data", "csv");
            m_chart1 = new MonitorChart(this, chart_1);

            Win_Make(ref winCommLog);
            Win_Make(ref winMonitorDeviceStatus);
            Win_Make(ref winCommunication);
            Win_Make(ref winBLEInfo);
            Win_Make(ref winDeviceInfo);
            Win_Make(ref winViewLogs);
            Win_Make(ref winRawData);
            Win_Make(ref winSensorData);
            Win_Make(ref winInstrumentSetting);
            Win_Make(ref winSecuritySetup);

            Win_Make(ref winGasCalibration);
            winGasCalibration.Closing += (win, t) =>
            {
                QuattroProtocol.isMessageboxWortk = false;
                winGasCalibration.releaseOutput();
                winGasCalibration.zeroCalibrationStop();
                winGasCalibration.spanCalibrationStop();
                QuattroProtocol.isMessageboxWortk = true;
            };

            Win_Make(ref winCalAnalogueOutput);
            winCalAnalogueOutput.Closing += (win, t) =>
            {
                QuattroProtocol.isMessageboxWortk = false;
                winCalAnalogueOutput.spanCalibrateStop();
                winCalAnalogueOutput.zeroCalibrateStop();
                QuattroProtocol.isMessageboxWortk = true;
            };
            Win_Make(ref winCalVoltageOutput);
            winCalVoltageOutput.Closing += (win, t) =>
            {
                QuattroProtocol.isMessageboxWortk = false;
                winCalVoltageOutput.spanCalibrateStop();
                winCalVoltageOutput.zeroCalibrateStop();
                QuattroProtocol.isMessageboxWortk = true;
            };
            Win_Make(ref winCalCellDrive);
            {
                QuattroProtocol.isMessageboxWortk = false;
                winCalCellDrive.calibrationStop();
                QuattroProtocol.isMessageboxWortk = true;
            }
            Win_Make(ref winHardwareTest);
            Win_Make(ref winCommLog);
            Win_Make(ref winDebug);

            gas_monitor_init();
        }