コード例 #1
0
        public PhotoModeUI(CogAcqFifoTool acqFifoTool1, MyDisPlayUI myDisPlayUI1, CogAcqFifoTool acqFifoTool2, MyDisPlayUI myDisPlayUI2, string name1, string name2)
        {
            InitializeComponent();

            rdoAutoRun1.Checked = true;
            rdoAutoRun2.Checked = true;

            Camera1ImageQueue = new Queue <CogImage8Grey>();
            Camera2ImageQueue = new Queue <CogImage8Grey>();
            AcqFifoTool1      = acqFifoTool1;
            AcqFifoTool2      = acqFifoTool2;
            if (acqFifoTool1.Operator != null)
            {
                AcqTriggerMode1 = acqFifoTool1.Operator.OwnedTriggerParams;
            }
            if (acqFifoTool2.Operator != null)
            {
                AcqTriggerMode2 = acqFifoTool2.Operator.OwnedTriggerParams;
            }
            MyDisPlayUI1 = myDisPlayUI1;
            MyDisPlayUI2 = myDisPlayUI2;
            ReLoadLanguage(name1, name2);
        }
コード例 #2
0
 private void btnLiveVideo2_Click(object sender, EventArgs e)
 {
     if (rdoManualRun2.Checked == true)
     {
         if (!this.IsReal_timeDisplay2)
         {
             try
             {
                 this.AcqTriggerMode2.TriggerEnabled = false;
                 this.rdoAutoRun2.Checked            = false;
                 this.AcqFifoTool2.Operator.Flush();
                 this.AcqTriggerMode2.TriggerModel   = CogAcqTriggerModelConstants.Manual;
                 this.AcqTriggerMode2.TriggerEnabled = true;
                 Thread.Sleep(20);
                 MyDisPlayUI    mydisplaypenal  = this.MyDisPlayUI2;
                 CogAcqFifoTool cogAcqFifoTool  = this.AcqFifoTool2;
                 CogAcqFifoTool cogAcqFifoTool2 = cogAcqFifoTool;
                 object         @operator       = cogAcqFifoTool.Operator;
                 mydisplaypenal.StartLiveDisplay(ref @operator, false);
                 cogAcqFifoTool2.Operator = (ICogAcqFifo)@operator;
                 Application.DoEvents();
                 this.rdoAutoRun2.Enabled   = false;
                 this.rdoManualRun2.Enabled = false;
                 this.lblMsg2.Text          = LanguageHelper.GetString("pm_Msg1");
                 this.btnLiveVideo2.Text    = LanguageHelper.GetString("pm_SR");
                 this.IsReal_timeDisplay2   = true;
             }
             catch (CogException cogException)
             {
                 ProjectData.SetProjectError(cogException);
                 CogException cogex = cogException;
                 MessageBox.Show(cogException.Message, LanguageHelper.GetString("common_Info"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                 ProjectData.ClearProjectError();
             }
         }
         else if (this.IsReal_timeDisplay2)
         {
             try
             {
                 this.rdoAutoRun2.Enabled            = true;
                 this.rdoManualRun2.Enabled          = true;
                 this.AcqTriggerMode2.TriggerEnabled = false;
                 //DateTime now = DateTime.Now;
                 //this.Str = string.Concat(now.ToString("HH:mm:ss.fff"), "1  ");
                 this.AcqFifoTool2.Operator.Flush();
                 this.AcqTriggerMode2.TriggerEnabled = true;
                 Thread.Sleep(20);
                 this.MyDisPlayUI2.StopLiveDisplay();
                 //now = DateTime.Now;
                 //this.str1 = string.Concat(now.ToString("HH:mm:ss.fff"), "2  ");
                 Thread.Sleep(20);
                 Application.DoEvents();
                 this.lblMsg2.Text        = "";
                 this.btnLiveVideo2.Text  = LanguageHelper.GetString("pm_RTD");
                 this.IsReal_timeDisplay2 = false;
             }
             catch (CogException cogException2)
             {
                 ProjectData.SetProjectError(cogException2);
                 CogException cogex = cogException2;
                 this.lblMsg2.Text       = "";
                 this.btnLiveVideo2.Text = LanguageHelper.GetString("pm_RTD");
                 MessageBox.Show(cogException2.Message, LanguageHelper.GetString("common_Info"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                 ProjectData.ClearProjectError();
             }
         }
     }
 }