Ejemplo n.º 1
0
        void RefreshWindowsInterface(int msgID)
        {
            if (msgID == -2)
            {
                labelProgressInfo.Text = "";
            }
            else
            {
                labelProgressInfo.Text = ImgCapture.PopWinMessage(msgID);
            }
            if (labelProgressInfo.Text == "Preparing irradiation...")
            {
                labelProgressInfo.ForeColor = Color.Green;

                #region 测试软件控制触发信号

                return;

                if (trigger == null)
                {
                    trigger = new TriggerCOM();
                    trigger.Open();
                }

                Console.Clear();
                byte[] triggerdata = new byte[14];
                triggerdata[0]  = 0x55;
                triggerdata[1]  = 0x66;
                triggerdata[2]  = 0x77;
                triggerdata[3]  = 0x88;
                triggerdata[4]  = 0x02;
                triggerdata[5]  = 0x00;
                triggerdata[6]  = 0x00;
                triggerdata[7]  = 0x00;
                triggerdata[8]  = 0x00;
                triggerdata[9]  = 0x00;
                triggerdata[10] = 0x00;
                triggerdata[11] = 0x00;
                triggerdata[12] = 0x00;

                //byte Xor = 0x00;
                //for (int i = 0; i < 13; i++)
                //{
                //    Xor = (byte)(Xor ^ triggerdata[i]);
                //}
                //triggerdata[13] = Xor;
                triggerdata[13] = (byte)(0xFF - triggerdata[12]);

                trigger.SendCMD(triggerdata);

                TriggerNumber++;

                labelTriggerNumber.Text = TriggerNumber.ToString();
                #endregion
            }
            else
            {
                labelProgressInfo.ForeColor = Color.Black;
            }
        }
 public TriggerSettingForm(TriggerCOM trigger)
 {
     InitializeComponent();
     TrigCOM = trigger;
     comboBox1.SelectedIndex = 1;
 }