protected override void OnKeyDown(KeyEventArgs e) { if (DelegateClass.GetDelegate().VideoKeyDownHandler != null) { DelegateClass.GetDelegate().VideoKeyDownHandler(e); } }
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; } }
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)); } }
public static DelegateClass GetDelegate() { if (dc == null) { dc = new DelegateClass(); } return(dc); }
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(); }
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); } }
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(); }
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; }
private void btnLaserCtrl_Click(object sender, EventArgs e) { DelegateClass.GetDelegate().ClickDelegateHandler?.Invoke(sender, CtrlType.LaserCtrl); }
private void btnAppearance_Click(object sender, EventArgs e) { DelegateClass.GetDelegate().ClickDelegateHandler?.Invoke(sender, CtrlType.LaserAppreance); }