844184169 5 сар өмнө
parent
commit
166fc92b22

+ 61 - 9
TeamAAS-VM/Core/Management.cs

@@ -1894,23 +1894,30 @@ namespace TeamAAS_VP.Core
                             var visionResult = await _remoteCommandService.ExecutePhotoGetDistance(1, process, null, new double[] { currentPosition.X, currentPosition.Y, currentPosition.U }, _cts.Token, cameraIndex, null);
                             if (visionResult.IsSucceed)
                             {
+                                if (mes_cc.ContainsKey(visionResult.distance.Split(',')[0]))
+                                {
+                                    mes_cc[visionResult.distance.Split(',')[0]] = visionResult.distance.Split(',')[1];
+                                }
+                                else
+                                {
+                                    mes_cc.Add(visionResult.distance.Split(',')[0], visionResult.distance.Split(',')[1]);
+                                }
                                 await plc.WriteNodeAsync(addressConfig.Out_UPCameracheckStatus.Address, (Int16)1);
                                 SendTaskMessage($"点位{cameraIndex}检测OK", MessageLevel.Debug);
                             }
                             else
                             {
+                                if (mes_cc.ContainsKey(visionResult.distance.Split(',')[0]))
+                                {
+                                    mes_cc[visionResult.distance.Split(',')[0]] = visionResult.distance.Split(',')[1];
+                                }
+                                else
+                                {
+                                    mes_cc.Add(visionResult.distance.Split(',')[0], visionResult.distance.Split(',')[1]);
+                                }
                                 await plc.WriteNodeAsync(addressConfig.Out_UPCameracheckStatus.Address, (Int16)2);
                                 SendTaskMessage($"点位{cameraIndex}检测NG", MessageLevel.Error);
                             }
-                            if (mes_cc.ContainsKey(visionResult.distance.Split(',')[0]))
-                            {
-                                mes_cc[visionResult.distance.Split(',')[0]] = visionResult.distance.Split(',')[1];
-                            }
-                            else
-                            {
-                                mes_cc.Add(visionResult.distance.Split(',')[0], visionResult.distance.Split(',')[1]);
-                            }
-                            await plc.WriteNodeAsync(addressConfig.Out_UPCameracheckStatus.Address, (Int16)1);
                         }
                         else
                         {
@@ -2554,6 +2561,9 @@ namespace TeamAAS_VP.Core
                                     SendTaskMessage($"mes开始ADD", MessageLevel.Info);
                                     string assypress = ""; string cc = "";
                                     cc = string.Join(",", mes_cc.OrderBy(kv => kv.Key, StringComparer.Ordinal).Select(kv => kv.Value));
+                                    //data.Add("CC1", mes_cc["1"]);
+                                    //data.Add("CC1", mes_cc["2"]);
+                                    //SendTaskMessage($"CC1:{mes_cc["1"]},CC2:{mes_cc["2"]}", MessageLevel.Info);
                                     assypress = currentPressure[i].ToString("F2");
                                     SendTaskMessage($"cc:{cc},组装压力:{assypress}", MessageLevel.Debug);
 
@@ -2607,6 +2617,48 @@ namespace TeamAAS_VP.Core
                                                     ERROR_MESSAGE = assyPress ? "" : "CC OOS",
                                                 });
                                             }
+                                            //DFC.Add(new DataFormCtq
+                                            //{
+                                            //    PPID = ProductMainSN[i],
+                                            //    PROCESS_NAME = stationConfig.DataInfo.PROCESS_NAME,
+                                            //    PROCESS_START_TIME = _LastMesCheckTime[i].ToString(),
+                                            //    CTQ_NAME = "CC1",
+                                            //    CTQ_VALUE = mes_cc["1"],
+                                            //    CTQ_LSL = currentProduct.GlobalParamEx.CC1DownLimit.ToString("F3"),
+                                            //    CTQ_USL = currentProduct.GlobalParamEx.CC1UpLimit.ToString("F3"),
+                                            //    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 = assyPress ? "Pass" : "Fail",
+                                            //    PROCESS_MACHINE_ID = stationConfig.DataInfo.PROCESS_MACHINE_ID,
+                                            //    CTQ_UNIT_OF_MEASURE = "mm",
+                                            //    ERROR_MESSAGE = assyPress ? "" : "CC OOS",
+                                            //});
+                                            //DFC.Add(new DataFormCtq
+                                            //{
+                                            //    PPID = ProductMainSN[i],
+                                            //    PROCESS_NAME = stationConfig.DataInfo.PROCESS_NAME,
+                                            //    PROCESS_START_TIME = _LastMesCheckTime[i].ToString(),
+                                            //    CTQ_NAME = "CC2",
+                                            //    CTQ_VALUE = mes_cc["2"],
+                                            //    CTQ_LSL = currentProduct.GlobalParamEx.CC2DownLimit.ToString("F3"),
+                                            //    CTQ_USL = currentProduct.GlobalParamEx.CC2UpLimit.ToString("F3"),
+                                            //    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 = assyPress ? "Pass" : "Fail",
+                                            //    PROCESS_MACHINE_ID = stationConfig.DataInfo.PROCESS_MACHINE_ID,
+                                            //    CTQ_UNIT_OF_MEASURE = "mm",
+                                            //    ERROR_MESSAGE = assyPress ? "" : "CC OOS",
+                                            //});
                                             DFC.Add(new DataFormCtq
                                             {
                                                 PPID = code,

+ 40 - 0
TeamAAS-VM/Models/Product/ProductGlobalParamEx.cs

@@ -13,5 +13,45 @@ namespace TeamAAS_VP.Models.Product
             get { return _DownPressure; }
             set { SetProperty(ref _DownPressure, value); }
         }
+
+        private float _CC1UpLimit = 0;
+        /// <summary>
+        /// CC1上限
+        /// </summary>
+        public float CC1UpLimit
+        {
+            get { return _CC1UpLimit; }
+            set { SetProperty(ref _CC1UpLimit, value); }
+        }
+
+        private float _CC1DownLimit = 0;
+        /// <summary>
+        /// CC1下限
+        /// </summary>
+        public float CC1DownLimit
+        {
+            get { return _CC1DownLimit; }
+            set { SetProperty(ref _CC1DownLimit, value); }
+        }
+
+        private float _CC2UpLimit = 0;
+        /// <summary>
+        /// CC2上限
+        /// </summary>
+        public float CC2UpLimit
+        {
+            get { return _CC2UpLimit; }
+            set { SetProperty(ref _CC2UpLimit, value); }
+        }
+
+        private float _CC2DownLimit = 0;
+        /// <summary>
+        /// CC2下限
+        /// </summary>
+        public float CC2DownLimit
+        {
+            get { return _CC2DownLimit; }
+            set { SetProperty(ref _CC2DownLimit, value); }
+        }
     }
 }

+ 65 - 0
TeamAAS-VM/Views/Product/ProductParams.xaml

@@ -198,6 +198,71 @@
                                                HorizontalAlignment="Right" />
                                 </Grid>
                             </GroupBox>
+                            <GroupBox Header="复检配置"
+                                      Margin="5"
+                                      Width="200">
+                                <Grid Margin="10">
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition Width="auto" />
+                                        <ColumnDefinition Width="*" />
+                                        <ColumnDefinition Width="auto" />
+                                    </Grid.ColumnDefinitions>
+                                    <Grid.RowDefinitions>
+                                        <RowDefinition Height="Auto" />
+                                        <RowDefinition Height="Auto" />
+                                        <RowDefinition Height="Auto" />
+                                        <RowDefinition Height="Auto" />
+                                    </Grid.RowDefinitions>
+                                    <TextBlock Text="CC1上限"
+                                               Grid.Row="0"
+                                               Grid.Column="0"
+                                               HorizontalAlignment="Right" />
+                                    <TextBox Text="{Binding SelectProduct.GlobalParamEx.CC1UpLimit,Mode=TwoWay}"
+                                             Grid.Row="0"
+                                             Grid.Column="1"
+                                             Margin="6,0" />
+                                    <TextBlock Text="mm"
+                                               Grid.Row="0"
+                                               Grid.Column="2"
+                                               HorizontalAlignment="Right" />
+                                    <TextBlock Text="CC1下限"
+                                               Grid.Row="1"
+                                               Grid.Column="0"
+                                               HorizontalAlignment="Right" />
+                                    <TextBox Text="{Binding SelectProduct.GlobalParamEx.CC1DownLimit,Mode=TwoWay}"
+                                             Grid.Row="1"
+                                             Grid.Column="1"
+                                             Margin="6,0" />
+                                    <TextBlock Text="mm"
+                                               Grid.Row="1"
+                                               Grid.Column="2"
+                                               HorizontalAlignment="Right" />
+                                    <TextBlock Text="CC2上限"
+                                               Grid.Row="2"
+                                               Grid.Column="0"
+                                               HorizontalAlignment="Right" />
+                                    <TextBox Text="{Binding SelectProduct.GlobalParamEx.CC2UpLimit,Mode=TwoWay}"
+                                             Grid.Row="2"
+                                             Grid.Column="1"
+                                             Margin="6,0" />
+                                    <TextBlock Text="mm"
+                                               Grid.Row="2"
+                                               Grid.Column="2"
+                                               HorizontalAlignment="Right" />
+                                    <TextBlock Text="CC2下限"
+                                               Grid.Row="3"
+                                               Grid.Column="0"
+                                               HorizontalAlignment="Right" />
+                                    <TextBox Text="{Binding SelectProduct.GlobalParamEx.CC2DownLimit,Mode=TwoWay}"
+                                             Grid.Row="3"
+                                             Grid.Column="1"
+                                             Margin="6,0" />
+                                    <TextBlock Text="mm"
+                                               Grid.Row="3"
+                                               Grid.Column="2"
+                                               HorizontalAlignment="Right" />
+                                </Grid>
+                            </GroupBox>
                         </StackPanel>
                     </ScrollViewer>
                 </Grid>