wanghan 6 mesi fa
parent
commit
8c5ba7da24
2 ha cambiato i file con 50 aggiunte e 66 eliminazioni
  1. 48 64
      TeamAAS-VM/Core/Management.cs
  2. 2 2
      TeamAAS-VM/Views/SettingView.xaml

+ 48 - 64
TeamAAS-VM/Core/Management.cs

@@ -2191,14 +2191,31 @@ namespace TeamAAS_VP.Core
                                 SendTaskMessage($"流程3结果:{visionResults[2].distance}", MessageLevel.Debug);
                                 SendTaskMessage($"流程4结果:{visionResults[3].distance}", MessageLevel.Debug);
 
-                                gapString = $"1-{visionResults[0].distance.Split(',')[1]},2-{visionResults[1].distance.Split(',')[1]},3-{visionResults[2].distance.Split(',')[1]},4-{visionResults[3].distance.Split(',')[1]}";
+                                gapString = $"{visionResults[0].distance.Split(',')[1]},{visionResults[1].distance.Split(',')[1]},{visionResults[2].distance.Split(',')[1]},{visionResults[3].distance.Split(',')[1]}";
                                 await plc.WriteNodeAsync(addressConfig.Out_FixedCameracheckStatus.Address, (Int16)1);
                                 return;
                             }
                             else
                             {
+                                string res1="", res2 = "", res3 = "", res4 = "";
+                                if(visionResults[0].IsSucceed)
+                                {
+                                    res1 = visionResults[0].distance.Split(',')[1];
+                                }
+                                if (visionResults[1].IsSucceed)
+                                {
+                                    res2 = visionResults[1].distance.Split(',')[1];
+                                }
+                                if (visionResults[2].IsSucceed)
+                                {
+                                    res3 = visionResults[2].distance.Split(',')[1];
+                                }
+                                if (visionResults[3].IsSucceed)
+                                {
+                                    res4 = visionResults[3].distance.Split(',')[1];
+                                }
                                 SendTaskMessage($"固定相机检测NG", MessageLevel.Error);
-                                gapString = $"1-0,2-0,3-0,4-0";
+                                gapString = $"{res1},{res2},{res3},{res4}";
                                 await plc.WriteNodeAsync(addressConfig.Out_FixedCameracheckStatus.Address, (Int16)2);
                                 return;
                             }
@@ -2504,10 +2521,6 @@ namespace TeamAAS_VP.Core
                                         }
                                         else
                                         {
-                                            //产品发生改变并且供料器发生了变化时,需要通知PLC进行取料更改
-                                            await plc.WriteNodeAsync(addressConfig.Out_ScrewFeederIsChanged.Address, (Int16)1); //不发生改变
-                                            await plc.WriteNodeAsync(string.Format(addressConfig.Out_MesStatus.Address, i), (Int16)2);
-
                                             LogHelper.WriteLogMes($"询问mes失败");
                                             SendTaskMessage($"询问mes失败:{response}", MessageLevel.Error);
 
@@ -2687,27 +2700,35 @@ namespace TeamAAS_VP.Core
                                         }
                                         else assyPresRes = false;
                                         DFC.Clear();
-                                        DFC.Add(new DataFormCtq
+
+                                        int itemIndex = 0;
+                                        var gaps = gap.Split(',');
+                                        foreach (var item in gaps)
                                         {
-                                            PPID = ProductMainSN[i],
-                                            PROCESS_NAME = stationConfig.DataInfo.PROCESS_NAME,
-                                            PROCESS_START_TIME = _LastMesCheckTime[i].ToString(),
-                                            CTQ_NAME = "Gap",
-                                            CTQ_VALUE = gap,
-                                            CTQ_LSL = "",
-                                            CTQ_USL = "",
-                                            PROCESS_END_TIME = serverTimeResult.Now.ToString(),
-                                            SUPPLIER_NAME = stationConfig.DataInfo.SUPPLIER_NAME,
-                                            COMMODITY_TYPE = stationConfig.DataInfo.COMMODITY_TYPE,
-                                            REVISION = stationConfig.DataInfo.REVISION,
-                                            WO = wo[i],
-                                            MFG_LOT = stationConfig.DataInfo.MFG_LOT,
-                                            MFG_ASSY_LINE = stationConfig.DataInfo.MFG_ASSY_LINE,
-                                            PROCESS_OUTCOME = "PASS",
-                                            PROCESS_MACHINE_ID = stationConfig.DataInfo.PROCESS_MACHINE_ID,
-                                            CTQ_UNIT_OF_MEASURE = "string",
-                                            ERROR_MESSAGE = ""
-                                        });
+                                            itemIndex++;
+                                            DFC.Add(new DataFormCtq
+                                            {
+                                                PPID = ProductMainSN[i],
+                                                PROCESS_NAME = stationConfig.DataInfo.PROCESS_NAME,
+                                                PROCESS_START_TIME = _LastMesCheckTime[i].ToString(),
+                                                CTQ_NAME = $"Gap{itemIndex}",
+                                                CTQ_VALUE = item,
+                                                CTQ_LSL = "",
+                                                CTQ_USL = "",
+                                                PROCESS_END_TIME = serverTimeResult.Now.ToString(),
+                                                SUPPLIER_NAME = stationConfig.DataInfo.SUPPLIER_NAME,
+                                                COMMODITY_TYPE = stationConfig.DataInfo.COMMODITY_TYPE,
+                                                REVISION = stationConfig.DataInfo.REVISION,
+                                                WO = wo[i],
+                                                MFG_LOT = stationConfig.DataInfo.MFG_LOT,
+                                                MFG_ASSY_LINE = stationConfig.DataInfo.MFG_ASSY_LINE,
+                                                PROCESS_OUTCOME = "PASS",
+                                                PROCESS_MACHINE_ID = stationConfig.DataInfo.PROCESS_MACHINE_ID,
+                                                CTQ_UNIT_OF_MEASURE = "mm",
+                                                ERROR_MESSAGE = ""
+                                            });
+                                        }
+                                        
                                         DFC.Add(new DataFormCtq
                                         {
                                             PPID = ProductMainSN[i],
@@ -2906,12 +2927,7 @@ namespace TeamAAS_VP.Core
                                 if (state == 1)
                                 {
                                     SendTaskMessage($"收到停止压力信号[{i}]...", MessageLevel.Debug);
-                                    //获取当前锁付点
-                                    //var screwPoint = currentProduct.ScrewPoints.FirstOrDefault(p => p.Number == positionIndex);
-                                    ////获取当前的机器人点位
-                                    //var robot = _robotService.GetAllRobots().FirstOrDefault();
-                                    //var currentPosition = robot.GetRobotPos();
-                                    ////读取压力值
+                                    //读取压力值
                                     //float pressure = plc.ReadNode<float>(addressConfig.In_PressureValue.Address);
                                     //读取压力值
                                     float pressure = plc.ReadNode<float>(string.Format(addressConfig.In_PressureValue.Address, i));
@@ -2919,38 +2935,6 @@ namespace TeamAAS_VP.Core
                                     SendTaskMessage($"[{i}]压力:{pressure}", MessageLevel.Info);
 
                                     //await Task.Delay(60);
-                                    ////获取电批结果
-                                    //bool isSucced = ScrewDriver.GetData();
-                                    //LockResult lockResult = new LockResult();
-                                    //lockResult.ScrewdriverGetDataSucceed = isSucced;
-                                    //lockResult.Number = positionIndex;
-                                    //lockResult.LockPassed = ScrewDriver.Success;
-                                    //lockResult.ProductNumber = _productService.CurrentProductCode;
-                                    //lockResult.LockTurns = (float)ScrewDriver.Truns;
-                                    //lockResult.LockTorque = (float)ScrewDriver.TorqueValue;
-                                    //lockResult.LockDuration = (float)ScrewDriver.FinalTime;
-                                    //lockResult.ScrewdriverProgramNumber = ScrewDriver.ProgramNumber;
-                                    //lockResult.ResultDetails = ScrewDriver.ErrorInfo;
-                                    //lockResult.Pressure = pressure;
-                                    //lockResult.TargetTorque = ScrewDriver.TargetTorque;
-                                    //lockResult.TargetTurnsUpperLimit = ScrewDriver.TargetTurnsUpperLimit;
-                                    //lockResult.TargetTurnsLowerLimit = ScrewDriver.TargetTurnsLowerLimit;
-                                    //lockResult.TargetLockSpeed = ScrewDriver.TargetLockSpeed;
-                                    //lockResult.StartPositionX = currentPosition.X;
-                                    //lockResult.StartPositionY = currentPosition.Y;
-                                    //lockResult.StartPositionZ = screwPoint.Z_Position_Start;
-                                    //lockResult.EndPositionZ = currentPosition.Z;
-                                    //lockResult.LockDescentSpeed = screwPoint.Z_Velocity_Stop;
-                                    //lockResult.FeederNumber = screwPoint != null ? screwPoint.Feeder : 0;
-                                    //lockResult.NozzleNumber = "";
-                                    //lockResult.OperatorName = _systemDatabaseService.GetCurrentUser().UserName;
-                                    //lockResult.ProductImagePath = "";
-                                    //lockResult.WaveDatas = ScrewDriver.WaveDatas;
-                                    //App.Current.Dispatcher.Invoke(() =>
-                                    //{
-                                    //    _eventAggregator.GetEvent<LockFinishNotification>().Publish(lockResult);
-                                    //});
-                                    //await _systemDatabaseService.RecordLockResultAsync(lockResult);
                                     await plc.WriteNodeAsync(addressConfig.In_WorkDone.Address, (Int16)0);
                                     var code = plc.ReadNode<string>(string.Format(addressConfig.In_Code.Address, i));
                                     // 停止采集压力并保存

+ 2 - 2
TeamAAS-VM/Views/SettingView.xaml

@@ -2878,7 +2878,7 @@
                                              Grid.Row="0"
                                              Grid.Column="1"
                                              Margin="6,0" />
-                                    <TextBlock Text="ms"
+                                    <TextBlock Text="s"
                                                Grid.Row="0"
                                                Grid.Column="2"
                                                HorizontalAlignment="Right" />
@@ -2957,7 +2957,7 @@
                                              Grid.Row="0"
                                              Grid.Column="1"
                                              Margin="6,0" />
-                                    <TextBlock Text="ms"
+                                    <TextBlock Text="s"
                                                Grid.Row="0"
                                                Grid.Column="2"
                                                HorizontalAlignment="Right" />