Przeglądaj źródła

MES未启用返回false,减少判断if

844184169 6 miesięcy temu
rodzic
commit
e2101c884b

+ 3 - 4
TeamAAS-VM/Core/Management.cs

@@ -2677,14 +2677,13 @@ namespace TeamAAS_VP.Core
                                     //读取产品结果
                                     Int16 resultIndex = plc.ReadNode<Int16>(string.Format(addressConfig.In_Result.Address, i));
                                     resultIndex = 1;
-                                    //读取压力值
-                                    float pressure = plc.ReadNode<float>(string.Format(addressConfig.In_PressureValue.Address, i));
+
                                     AssemblyRecord assemblyRecord = new AssemblyRecord();
                                     assemblyRecord.ProductSN = code;
                                     assemblyRecord.RecipeName = currentProduct.Name;
                                     assemblyRecord.PartSN = PartSN;
                                     assemblyRecord.AssemblyDurationSeconds = ct;
-                                    assemblyRecord.AssemblyPressure = pressure;
+                                    assemblyRecord.AssemblyPressure = currentPressure[i];
                                     assemblyRecord.DeviceId = i;
                                     assemblyRecord.DeviceName = stationConfig.DeviceName;
                                     assemblyRecord.OperatorName = _systemDatabaseService.GetCurrentUser().UserName;
@@ -2894,7 +2893,7 @@ namespace TeamAAS_VP.Core
                                     }
                                     //gap-复检gap参数, press-保压站实际压力值, presstime-保压站保压时间, assypress-组装站实际压力值
                                     (bool isSuccess, string response) = await _mesService.SubmitGetAsync(i, code, comp, resultIndex == 1 ? true : false, data, _LastMesCheckTime[i], serverTimeResult.Now);
-                                    if (isSuccess)
+                                    if (!stationConfig.EnableMES || isSuccess)
                                     {
                                         LogHelper.WriteLogMes($"上传mes成功");
                                         SendTaskMessage($"上传mes成功", MessageLevel.Debug);

+ 2 - 2
TeamAAS-VM/Services/CalibrationService.cs

@@ -296,7 +296,7 @@ namespace TeamAAS_VP.Services
         /// - X, Y: 转换后的机器人坐标(单位同 calib 所用单位)
         /// - U: 角度(经过可能的符号调整)
         /// </returns>
-        public (bool IsSucceed,double X, double Y, double U) ConvertPixelToPosition((double X, double Y, double angle) pixelCoord, double[] robotCoord, CalibrationInfo calib, RobotBrand robotBrand = RobotBrand.Default)
+        public (bool IsSucceed, double X, double Y, double U) ConvertPixelToPosition((double X, double Y, double angle) pixelCoord, double[] robotCoord, CalibrationInfo calib, RobotBrand robotBrand = RobotBrand.Default)
         {
             double angle = pixelCoord.angle;
 
@@ -304,7 +304,7 @@ namespace TeamAAS_VP.Services
             Matrix<double> matrix = Matrix<double>.Build.DenseOfArray(calib.AffineTransformationMaterial);
 
             // 某些安装方式需要取反角度以匹配机器人坐标系定义
-            if (calib.CameraMount == CameraMount.FixedDown || calib.CameraMount == CameraMount.MobileJ2 || calib.CameraMount == CameraMount.MobileJ4)
+            if (calib.CameraMount == CameraMount.FixedDown || calib.CameraMount == CameraMount.MobileJ2 || calib.CameraMount == CameraMount.MobileJ4 || calib.CameraMount == CameraMount.MobileDown_XYPlatform || calib.CameraMount == CameraMount.MobileDown_IndependentXYPlatform)
             {
                 angle *= -1;
             }

+ 1 - 1
TeamAAS-VM/Services/MesService.cs

@@ -375,7 +375,7 @@ namespace TeamAAS_VP.Services
                 device = _configService.GetDeviceInfo();
             if (device == null || !device.EnableMES)
             {
-                return (true, "MES¹¦ÄÜδÆôÓÃ!");
+                return (false, "MES¹¦ÄÜδÆôÓÃ!");
             }
             if (string.IsNullOrWhiteSpace(device.MesUrl))
                 return (false, "Missing MES submit URL");

+ 2 - 2
TeamAAS-VM/ViewModels/Product/TestProductPageViewModel.cs

@@ -414,7 +414,7 @@ namespace TeamAAS_VP.ViewModels.Product
                 var campos = await Photo(SelectProcedure, Camera);
 
                 double angle = campos.Item3;
-                if (calib.CameraMount == CameraMount.FixedDown || calib.CameraMount == CameraMount.MobileJ2 || calib.CameraMount == CameraMount.MobileJ4)
+                if (calib.CameraMount == CameraMount.FixedDown || calib.CameraMount == CameraMount.MobileJ2 || calib.CameraMount == CameraMount.MobileJ4 || calib.CameraMount == CameraMount.MobileDown_XYPlatform || calib.CameraMount == CameraMount.MobileDown_IndependentXYPlatform)
                 {
                     angle *= -1;
                 }
@@ -495,7 +495,7 @@ namespace TeamAAS_VP.ViewModels.Product
                 var campos = await Photo(SelectProcedure1, Camera1);
 
                 double angle = campos.Item3;
-                if (calib.CameraMount == CameraMount.FixedDown || calib.CameraMount == CameraMount.MobileJ2 || calib.CameraMount == CameraMount.MobileJ4)
+                if (calib.CameraMount == CameraMount.FixedDown || calib.CameraMount == CameraMount.MobileJ2 || calib.CameraMount == CameraMount.MobileJ4 || calib.CameraMount == CameraMount.MobileDown_XYPlatform || calib.CameraMount == CameraMount.MobileDown_IndependentXYPlatform)
                 {
                     angle *= -1;
                 }