Преглед изворни кода

修改OPT相机适配的一些问题

徐孝锋 пре 8 месеци
родитељ
комит
dee34dc7bb

+ 6 - 6
TeamAAS-VM/Core/Cameras/OptCamera.cs

@@ -108,7 +108,7 @@ namespace TeamAAS_VP.Core.Cameras
             IsFindByIp = isFindByIp;
             mvCameraAcq = new SciCam();
             SciCam.SCI_DEVICE_INFO_LIST stDeviceList = new SciCam.SCI_DEVICE_INFO_LIST();    //设备列表
-            uint nReVal = SciCam.DiscoveryDevices(ref stDeviceList, (uint)(SciCam.SciCamTLType.SciCam_TLType_CL));
+            uint nReVal = SciCam.DiscoveryDevices(ref stDeviceList, (uint)(SciCam.SciCamTLType.SciCam_TLType_Gige));
             if (nReVal != SciCam.SCI_CAMERA_OK)
             {
                 return;
@@ -174,12 +174,12 @@ namespace TeamAAS_VP.Core.Cameras
             {
                 if (!CheckSoftwareInstalled().isInstalled)
                 {
-                    LogHelper.WriteLogInfo("未安装MVS");
+                    LogHelper.WriteLogInfo("未安装OPT");
                     return cameras.ToArray();
                 }
 
                 SciCam.SCI_DEVICE_INFO_LIST stDeviceList = new SciCam.SCI_DEVICE_INFO_LIST();    //设备列表
-                uint nReVal = SciCam.DiscoveryDevices(ref stDeviceList, (uint)(SciCam.SciCamTLType.SciCam_TLType_CL));
+                uint nReVal = SciCam.DiscoveryDevices(ref stDeviceList, (uint)(SciCam.SciCamTLType.SciCam_TLType_Gige));
                 if (nReVal != SciCam.SCI_CAMERA_OK)
                 {
                     return cameras.ToArray();
@@ -228,8 +228,8 @@ namespace TeamAAS_VP.Core.Cameras
         /// <returns></returns>
         public static (bool isInstalled, string version) CheckSoftwareInstalled()
         {
-            //string softwareName = "MVS";
-            //string softwareVersion = "4.4.0";
+            //string softwareName = "OPT Camera Viewer";
+            //string softwareVersion = "4.0.0.3";
             //string[] registryPaths = new[]
             //{
             //    @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",
@@ -283,7 +283,7 @@ namespace TeamAAS_VP.Core.Cameras
                 {
                     mvCameraAcq = new SciCam();
                     SciCam.SCI_DEVICE_INFO_LIST stDeviceList = new SciCam.SCI_DEVICE_INFO_LIST();    //设备列表
-                    nReVal = SciCam.DiscoveryDevices(ref stDeviceList, (uint)(SciCam.SciCamTLType.SciCam_TLType_CL));
+                    nReVal = SciCam.DiscoveryDevices(ref stDeviceList, (uint)(SciCam.SciCamTLType.SciCam_TLType_Gige));
                     if (nReVal != SciCam.SCI_CAMERA_OK)
                     {
                         return false;

+ 4 - 0
TeamAAS-VM/ViewModels/Setting/AddCameraViewModel.cs

@@ -164,6 +164,10 @@ namespace TeamAAS_VP.ViewModels.Setting
             {
                 cameras = GalaxyCamera.GetDevices();
             }
+            else if (cameraBrand == CameraBrand.Opt)
+            {
+                cameras = OptCamera.GetDevices();
+            }
             CameraList.Clear();
             if (cameras != null)
             {

+ 4 - 0
TeamAAS-VM/ViewModels/Setting/EditCameraViewModel.cs

@@ -151,6 +151,10 @@ namespace TeamAAS_VP.ViewModels.Setting
             {
                 cameras = GalaxyCamera.GetDevices();
             }
+            else if (cameraBrand == CameraBrand.Opt)
+            {
+                cameras = OptCamera.GetDevices();
+            }
             CameraList.Clear();
             if (cameras != null)
             {

+ 8 - 0
TeamAAS-VM/ViewModels/SettingViewModel.cs

@@ -577,6 +577,10 @@ namespace TeamAAS_VP.ViewModels
                     softwarename = "Galaxy Viewer";
                     result = GalaxyCamera.CheckSoftwareInstalled();
                     break;
+                case CameraBrand.Opt:
+                    softwarename = "OPT Camera Viewer";
+                    result = OptCamera.CheckSoftwareInstalled();
+                    break;
                 default:
                     break;
             }
@@ -675,6 +679,10 @@ namespace TeamAAS_VP.ViewModels
                     softwarename = "Galaxy Viewer";
                     result = GalaxyCamera.CheckSoftwareInstalled();
                     break;
+                case CameraBrand.Opt:
+                    softwarename = "OPT Camera Viewer";
+                    result = OptCamera.CheckSoftwareInstalled();
+                    break;
                 default:
                     break;
             }

+ 1 - 0
TeamAAS-VM/Views/Setting/AddCamera.xaml

@@ -134,6 +134,7 @@
                                 <RowDefinition Height="auto" />
                                 <RowDefinition Height="auto" />
                                 <RowDefinition Height="auto" />
+                                <RowDefinition Height="auto" />
                             </Grid.RowDefinitions>
                             <materialDesign:PackIcon Kind="CameraOutline"
                                                      Grid.Row="0"