| | |
| | | using LB_VisionControls; |
| | | using LB_SmartVisionCameraDevice.PHM6000; |
| | | using LB_SmartVisionCommon; |
| | | using LB_VisionControls; |
| | | using LB_VisionProcesses.Cameras; |
| | | using LB_VisionProcesses.Cameras.HikCameras; |
| | | using LB_VisionProcesses.Cameras.HRCameras; |
| | |
| | | using LB_VisionProcesses.Cameras.MindCameras; |
| | | using ReaLTaiizor.Forms; |
| | | using System; |
| | | using System.Collections.Concurrent; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Data; |
| | |
| | | { |
| | | uiComboBoxBrand.SelectedIndex = uiComboBoxBrand.FindString(typeof(LBCamera).Name); |
| | | } |
| | | else if(camera is LocalCamera) |
| | | else if (camera is LocalCamera) |
| | | { |
| | | uiComboBoxBrand.SelectedIndex = uiComboBoxBrand.FindString(typeof(LocalCamera).Name); |
| | | } |
| | |
| | | |
| | | //加载回调函数 |
| | | Subscribe(); |
| | | uiButtonStartHardGrab.ForeColor = Color.White; |
| | | } |
| | | |
| | | private void CameraForm_FormClosing(object sender, FormClosingEventArgs e) |
| | |
| | | { |
| | | camera.StopGrabbing(); |
| | | camera.SetTriggerMode(TriggerMode.On, TriggerSource.Software); |
| | | camera.StartGrabbing(); |
| | | //camera.StartGrabbing(); |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | private void cob_Brand_SelectedIndexChanged(object sender, EventArgs e) |
| | | { |
| | | if (uiComboBoxBrand.Text == "MindCamera") |
| | | if (uiComboBoxBrand.Text == "MindCamera" || uiComboBoxBrand.Text == "LBCamera") |
| | | { |
| | | btnSetting.Visible = true; |
| | | } |
| | |
| | | { |
| | | localCamera.SetSetting(); |
| | | } |
| | | else |
| | | { |
| | | using (Form editForm = new Form()) |
| | | { |
| | | editForm.Text = "高级参数设置 - " + camera.SN; |
| | | editForm.Size = new System.Drawing.Size(400, 500); |
| | | editForm.StartPosition = FormStartPosition.CenterParent; |
| | | editForm.FormBorderStyle = FormBorderStyle.SizableToolWindow; |
| | | |
| | | PropertyGrid pg = new PropertyGrid(); |
| | | pg.Dock = DockStyle.Fill; |
| | | |
| | | if (camera is LBCamera phmCamera) |
| | | { |
| | | pg.SelectedObject = phmCamera.GetSensorConfig(); |
| | | pg.PropertyValueChanged += (s, ev) => |
| | | { |
| | | phmCamera.UpdateSensorConfig((PHM6000SensorConfig)pg.SelectedObject); |
| | | //相机参数保存到本地 |
| | | if (GlobalVar.allLBCameras.Keys.Contains(phmCamera.SN)) |
| | | { |
| | | GlobalVar.allLBCameras[phmCamera.SN] = (PHM6000SensorConfig)pg.SelectedObject; |
| | | } |
| | | else |
| | | { |
| | | GlobalVar.allLBCameras.TryAdd(phmCamera.SN, (PHM6000SensorConfig)pg.SelectedObject); |
| | | } |
| | | ConfigManager<ConcurrentDictionary<string, PHM6000SensorConfig>>.SaveConfig<ConcurrentDictionary<string, PHM6000SensorConfig>>(GlobalVar.allLBCameras, GlobalVar.allCamerasLBPath); |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | pg.SelectedObject = new CameraAdvancedSettings(camera); |
| | | } |
| | | editForm.Controls.Add(pg); |
| | | editForm.ShowDialog(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |