示例#1
0
 protected override void OnKeyDown(KeyEventArgs e)
 {
     if (DelegateClass.GetDelegate().VideoKeyDownHandler != null)
     {
         DelegateClass.GetDelegate().VideoKeyDownHandler(e);
     }
 }
示例#2
0
        private void NewObjectLense()
        {
            int factor = 0;

            Int32.TryParse(txtAdd.Text, out factor);
            if (factor != 0 && factor < 1000)
            {
                Lense lense = new Lense(factor);
                if (Program.SysConfig.AddLense(lense))
                {
                    LenseChangeHandler?.Invoke(null, null);
                    //this.richPictureBox.ZoomNewLense(1, factor);
                    this.rulerAdjustCtrl1.LabelValue = lense.FineAdjustment.ToString();
                    UpdateComBoxItemLense(lense);
                    //更新界面的刻度尺
                    DelegateClass.GetDelegate().UpdateLenseHandler?.Invoke(lense);
                    ShowRuler();
                    this.richPictureBox.Invalidate();
                    UpdateObjectLensesHandler?.Invoke(lense);
                }
            }
            else
            {
                //should input correct lense factor
                MessageBox.Show(Resources.StrLenseFactorInputError, Application.ProductName, MessageBoxButtons.OK);
                return;
            }
        }
示例#3
0
 private void Slider_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (DelegateClass.GetDelegate().VideoKeyDownHandler != null)
     {
         DelegateClass.GetDelegate().VideoKeyDownHandler(new System.Windows.Forms.KeyEventArgs(e.KeyCode));
     }
 }
示例#4
0
 public void LoadImage(string imageFile)
 {
     //判断视频是否开启,若开启则先关闭视频
     DelegateClass.GetDelegate().CheckCloseVideoHandler?.Invoke();
     this.Picture = Image.FromFile(imageFile);
     this.OffsetX = (this.Width - this.Image.Width) / 2;
     this.OffsetY = (this.Height - this.Image.Height) / 2 + 25;
     this.zoom    = 1;
     this.imageTracker.ScalePercent = zoom * 100;
     this.ImageTracker.Picture      = this.Picture;
     this.Invalidate();
 }
示例#5
0
 private void btnAlignLaser_Click(object sender, EventArgs e)
 {
     if (Program.SysConfig.LiveMode)
     {
         if (Program.SysConfig.LaserPortConected)
         {
             DelegateClass.GetDelegate().ClickDelegateHandler?.Invoke(sender, CtrlType.LaserAlignment);
         }
         else
         {
             MaterialSkin.MsgBox.Show(Properties.Resources.StrLaserNotConnect, Properties.Resources.StrWaring, MaterialSkin.MsgBox.Buttons.OK, MaterialSkin.MsgBox.Icon.Info);
         }
     }
     else
     {
         DelegateClass.GetDelegate().ClickDelegateHandler?.Invoke(sender, CtrlType.LaserAlignment);
     }
 }
示例#6
0
 private void btnSimulator_Click(object sender, EventArgs e)
 {
     if (this.btnSimulator.Text == CII.LAR.Properties.Resources.StrOpenSimulator)
     {
         //Turn on simulator
         updateCmbImage = false;
         int fileIndex = 0;
         if (cmbImage.SelectedIndex < 0)
         {
             cmbImage.SelectedIndex = 0;
         }
         else
         {
             fileIndex = cmbImage.SelectedIndex;
         }
         StartSimulator(GetSimulatorFileName(fileIndex));
         updateCmbImage = true;
     }
     else if (this.btnSimulator.Text == CII.LAR.Properties.Resources.StrCloseSimulator)
     {
         //Close simulator
         if (this.richPictureBox != null)
         {
             updateCmbImage = false;
             this.richPictureBox.Picture = null;
             this.richPictureBox.GraphicsList.DeleteAll();
             CtrlFactory.GetCtrlFactory().GetCtrlByType <StatisticsCtrl>(CtrlType.StatisticsCtrl).StatisticsListView.Items.Clear();
             cmbImage.SelectedIndex = -1;
             updateCmbImage         = true;
         }
         if (!string.IsNullOrEmpty(Program.SysConfig.DeviceName))
         {
             FilterInfo fileInfo = Program.SysConfig.EnumerateVideoDevices();
             if (fileInfo != null)
             {
                 DelegateClass.GetDelegate().CaptureDeviceHandler(fileInfo.MonikerString);
             }
         }
         simulatorOpen          = false;
         this.btnSimulator.Text = CII.LAR.Properties.Resources.StrOpenSimulator;
     }
     Program.EntryForm.ClearStatisticsListViewItems();
 }
示例#7
0
        private void listViewCamera_DoubleClick(object sender, EventArgs e)
        {
            if (listViewCamera.SelectedItems == null || listViewCamera.SelectedItems.Count == 0)
            {
                return;
            }

            string     selectedDevice = listViewCamera.SelectedItems[0].Text;
            string     deviceMoniker  = GetMonikerString(selectedDevice);
            FilterInfo filterInfo     = GetFilterInfo(selectedDevice);

            if (deviceMoniker != "" && DelegateClass.GetDelegate().CaptureDeviceHandler != null)
            {
                var videoDevice = Program.EntryForm.VideoDevice;
                if (videoDevice != null && videoDevice.IsRunning)
                {
                    this.Visible = false;
                    //return;
                }
                DelegateClass.GetDelegate().CaptureDeviceHandler(deviceMoniker);
                Program.SysConfig.DeviceName = filterInfo.Name;
            }
            this.Visible = false;
        }
示例#8
0
 private void btnLaserCtrl_Click(object sender, EventArgs e)
 {
     DelegateClass.GetDelegate().ClickDelegateHandler?.Invoke(sender, CtrlType.LaserCtrl);
 }
示例#9
0
 private void btnAppearance_Click(object sender, EventArgs e)
 {
     DelegateClass.GetDelegate().ClickDelegateHandler?.Invoke(sender, CtrlType.LaserAppreance);
 }