Пример #1
0
        public FormChildTexture(FormMDIParent form)
        {
            myParentForm = form;
            myUart       = form.myUart;
            myConfig     = form.myConfig;
            myApi        = form.myApi;

            timerHighVoltage_10min           = new System.Timers.Timer(1000 * 60 * 10); // 10min
            timerHighVoltage_10min.Elapsed  += new System.Timers.ElapsedEventHandler(timerHighVoltage_10min_Timeout);
            timerHighVoltage_10min.AutoReset = true;
            timerHighVoltage_10min.Enabled   = false;

            // timer
            timerUartRecv           = new System.Timers.Timer(10000);
            timerUartRecv.Elapsed  += new System.Timers.ElapsedEventHandler(timerUartRecv_Timeout);
            timerUartRecv.AutoReset = true;
            timerUartRecv.Enabled   = false;

            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;

            if (myUart.port_UART.IsOpen)
            {
                deviceStateBackup  = myUart.DeviceState;
                myUart.DeviceState = DEVICE_STATE.TEXTURE;
                myUart.RegControl(this, UartRecv_Texture, DEVICE_STATE.TEXTURE);
            }
        }
Пример #2
0
        public FormShortcutHighVoltage(FormMDIParent form)
        {
            myParentForm = form;
            myUart       = form.myUart;
            myConfig     = form.myConfig;
            myApi        = form.myApi;
            // timer
            timerUartRecv           = new System.Timers.Timer(10000);
            timerUartRecv.Elapsed  += new System.Timers.ElapsedEventHandler(timerUartRecv_Timeout);
            timerUartRecv.AutoReset = true;
            timerUartRecv.Enabled   = false;

            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;

            if (myUart.port_UART.IsOpen)
            {
                deviceStateBackup  = myUart.DeviceState;
                myUart.DeviceState = DEVICE_STATE.SHORTCUT_HIGH_VOLTAGE;
                myUart.RegControl(this, UartRecv_HighVoltage, DEVICE_STATE.SHORTCUT_HIGH_VOLTAGE);
            }
            else
            {
            }
        }
Пример #3
0
        public FormDeviceInit(FormMDIParent form)
        {
            myUart   = form.myUart;
            myConfig = form.myConfig;
            myTCP    = new TCPClient(myUart, null, ServerIP, ServerPort);
            myApi    = new MeasureApi(this);
            // timer
            timerUartRecv           = new System.Timers.Timer(10000);
            timerUartRecv.Elapsed  += new System.Timers.ElapsedEventHandler(timerUartRecv_Timeout);
            timerUartRecv.AutoReset = true;
            timerUartRecv.Enabled   = false;

            // timer
            timerTCPRecv           = new System.Timers.Timer(10000);
            timerTCPRecv.Elapsed  += new System.Timers.ElapsedEventHandler(timerTCPRecv_Timeout);
            timerTCPRecv.AutoReset = true;
            timerTCPRecv.Enabled   = false;

            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;

            if (myUart.port_UART.IsOpen)
            {
                deviceStateBackup  = myUart.DeviceState;
                myUart.DeviceState = DEVICE_STATE.DEVICE_INIT;
                myUart.RegControl(this, UartRecv_DeviceInit, DEVICE_STATE.DEVICE_INIT);

                myTCP.DeviceState = DEVICE_STATE.DEVICE_INIT;
                myTCP.RegControl(this, TCPRecv_DeviceInit, DEVICE_STATE.DEVICE_INIT);
            }
            else
            {
            }
        }
Пример #4
0
        public FormChildCurveFitting(FormMDIParent form)
        {
            myParentForm = form;
            myConfig     = form.myConfig;


            InitializeComponent();
        }
Пример #5
0
        public FormChildDevParam(FormMDIParent form)
        {
            myParentForm = form;
            myUart       = form.myUart;
            myConfig     = form.myConfig;
            myApi        = form.myApi;

            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;
        }
Пример #6
0
        public FormChildDeviceParam(FormMDIParent form)
        {
            myParentForm = form;
            myUart       = form.myUart;
            myConfig     = form.myConfig;
            myApi        = form.myApi;

            iniE.IniEditConfig("数据字典.ini");
            iniE1.IniEditConfig("参数设置.ini");
            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;
        }
Пример #7
0
        private void buttonSkip_Click(object sender, EventArgs e)
        {
            try
            {
                if (radioButtonTargetType1.Checked)
                {
                    myApi.TargetType = 0;
                }
                else if (radioButtonTargetType2.Checked)
                {
                    myApi.TargetType = 1;
                }
                else
                {
                    myApi.TargetType = 0;
                }

                if (radioButtonDetectorType1.Checked)
                {
                    myApi.DetectorType = 0;
                }
                else if (radioButtonDetectorType2.Checked)
                {
                    myApi.DetectorType = 1;
                }
                else
                {
                    myApi.DetectorType = 0;
                }

                SaveToConfig();

                myConfig.SaveDeviceInit();

                myUart.Pack_Debug_out(null, "[DeviceInit] Init Skip");

                this.Hide();

                FormMDIParent mdi = new FormMDIParent(this);
                mdi.StartPosition = FormStartPosition.CenterScreen;
                //mdi.ShowDialog();
                mdi.Show();
            }
            catch (Exception ex)
            {
                myUart.Pack_Debug_out(null, "Exception" + "[" + ex.ToString() + "]");
            }
        }
Пример #8
0
        private void DetectorInitFinish()
        {
            try
            {
                myUart.Pack_Debug_out(null, "[DeviceInit] Init Finish");

                this.Hide();

                FormMDIParent mdi = new FormMDIParent(this);
                mdi.StartPosition = FormStartPosition.CenterScreen;
                // mdi.ShowDialog();
                mdi.Show();
            }
            catch (Exception ex)
            {
                myUart.Pack_Debug_out(null, "Exception" + "[" + ex.ToString() + "]");
            }
        }
Пример #9
0
        public FormChildAccessPort(FormMDIParent form)
        {
            myUart = form.myUart;
            myApi  = form.myApi;
            // timer
            timerUartRecv           = new System.Timers.Timer(10000);
            timerUartRecv.Elapsed  += new System.Timers.ElapsedEventHandler(timerUartRecv_Timeout);
            timerUartRecv.AutoReset = true;
            timerUartRecv.Enabled   = false;

            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;

            //注册事件
            if (myUart.port_UART.IsOpen)
            {
                deviceStateBackup  = myUart.DeviceState;
                myUart.DeviceState = DEVICE_STATE.DEVICE_DEBUG;
                myUart.RegControl(this, UartRecv_AccessPort, DEVICE_STATE.DEVICE_DEBUG);
            }
        }
Пример #10
0
        public FormShortcutAutoFocus(FormMDIParent form)
        {
            myUart          = form.myUart;
            myApi           = form.myApi;
            myApi.AutoFocus = form.myConfig.AutoFocus;
            // timer
            timerUartRecv           = new System.Timers.Timer(10000);
            timerUartRecv.Elapsed  += new System.Timers.ElapsedEventHandler(timerUartRecv_Timeout);
            timerUartRecv.AutoReset = true;
            timerUartRecv.Enabled   = false;

            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;

            if (myUart.port_UART.IsOpen)
            {
                deviceStateBackup  = myUart.DeviceState;
                myUart.DeviceState = DEVICE_STATE.SHORTCUT_AUTO_FOCUS;
                myUart.RegControl(this, UartRecv_AutoFocus, DEVICE_STATE.SHORTCUT_AUTO_FOCUS);
            }
            else
            {
            }
        }