ソースを参照

增加另外三种国别相邻键关系,增加jmp数据保存

zly 4 ヶ月 前
コミット
f745f03e87

ファイルの差分が大きいため隠しています
+ 628 - 160
TeamAAS-VM/Core/Management.cs


+ 6 - 0
TeamAAS-VM/Models/DeviceInfo.cs

@@ -85,6 +85,12 @@ namespace TeamAAS_VP.Models
         /// </summary>
         public bool SaveCsv { get => _saveCsv; set => SetProperty(ref _saveCsv, value); }
 
+        private bool _saveCsvJmp;
+        /// <summary>
+        /// 是否保存键盘格JMP数据,默认不保存
+        /// </summary>
+        public bool SaveCsvJmp { get => _saveCsvJmp; set => SetProperty(ref _saveCsvJmp, value); }
+
         private bool _saveCsvPPID;
         /// <summary>
         /// 是否保存CSV文件的PPID,默认不保存

+ 9 - 0
TeamAAS-VM/Models/ProductWithMes.cs

@@ -37,6 +37,15 @@ namespace TeamAAS_VP.Models
             set { SetProperty(ref _ProductCode, value); }
         }
 
+        private string _ProductKBSN;
+        /// <summary>
+        /// 产品编码
+        /// </summary>
+        public string ProductKBSN
+        {
+            get { return _ProductKBSN; }
+            set { SetProperty(ref _ProductKBSN, value); }
+        }
 
         private string _ProductColor = "";
         /// <summary>

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

@@ -101,11 +101,11 @@ namespace TeamAAS_VP.Services
             string url = "";
             if (device.F == "PTL")
             {
-                url = $"{device.MesUrl}?c=QUERY_RECORD&line={device.Line}&station={device.Station}&fixtureid={device.FixtureId}&sn={sn}&comp={device.comp}:{comp}&p=unit_process_check,message,model,sn,wo,model_num,color,ppid,stage";
+                url = $"{device.MesUrl}?c=QUERY_RECORD&line={device.Line}&station={device.Station}&fixtureid={device.FixtureId}&sn={sn}&comp={device.comp}:{comp}&p=unit_process_check,message,model,sn,wo,model_num,color,ppid,stage,KB";
             }
             else
             {
-                url = $"{device.MesUrl}?c=QUERY_RECORD&line={device.Line}&station={device.Station}&fixtureid={device.FixtureId}&sn={sn}&p=unit_process_check,message,model,sn,wo,model_num,color,ppid,stage";
+                url = $"{device.MesUrl}?c=QUERY_RECORD&line={device.Line}&station={device.Station}&fixtureid={device.FixtureId}&sn={sn}&p=unit_process_check,message,model,sn,wo,model_num,color,ppid,stage,KB";
             }
 
             LogHelper.WriteLogMes($"¡¾Ñ¯ÎÊURL¡¿{url}");

+ 64 - 64
TeamAAS-VM/Services/RemoteCommandService.cs

@@ -2211,22 +2211,22 @@ namespace TeamAAS_VP.Services
                     {
                         if (i == 1)
                         {
-                            //bool isSucceed = false;
-                            //isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(0, procedure.Photo1Light1);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道1亮度{procedure.Photo1Light1}失败!");
-                            //}
-                            //isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(1, procedure.Photo1Light2);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道2亮度{procedure.Photo1Light2}失败!");
-                            //}
-                            //isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(2, procedure.Photo1Light3);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道3亮度{procedure.Photo1Light3}失败!");
-                            //}
+                            bool isSucceed = false;
+                            isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(0, procedure.Photo1Light1);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道1亮度{procedure.Photo1Light1}失败!");
+                            }
+                            isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(1, procedure.Photo1Light2);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道2亮度{procedure.Photo1Light2}失败!");
+                            }
+                            isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(2, procedure.Photo1Light3);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道3亮度{procedure.Photo1Light3}失败!");
+                            }
                             bool succed = camera.SetExposureTime(procedure.ExposureTime);
                             if (!succed)
                             {
@@ -2238,41 +2238,41 @@ namespace TeamAAS_VP.Services
                                 SendTaskMessage($"相机增益设置失败!", MessageLevel.Error);
                             }
                             image = camera.Grab();
-                            //isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(0);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道0关闭失败!");
-                            //}
-                            //isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(1);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道1关闭失败!");
-                            //}
-                            //isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(2);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道2关闭失败!");
-                            //}
+                            isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(0);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道0关闭失败!");
+                            }
+                            isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(1);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道1关闭失败!");
+                            }
+                            isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(2);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道2关闭失败!");
+                            }
 
                         }
                         else if (i == 2)
                         {
-                            //bool isSucceed = false;
-                            //isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(0, procedure.Photo2Light1);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道1亮度{procedure.Photo2Light1}失败!");
-                            //}
-                            //isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(1, procedure.Photo2Light2);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道2亮度{procedure.Photo2Light2}失败!");
-                            //}
-                            //isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(2, procedure.Photo2Light3);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道3亮度{procedure.Photo2Light3}失败!");
-                            //}
+                            bool isSucceed = false;
+                            isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(0, procedure.Photo2Light1);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道1亮度{procedure.Photo2Light1}失败!");
+                            }
+                            isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(1, procedure.Photo2Light2);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道2亮度{procedure.Photo2Light2}失败!");
+                            }
+                            isSucceed = await _lightManagerService.SetGlobalChannelBrightnessAsync(2, procedure.Photo2Light3);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道3亮度{procedure.Photo2Light3}失败!");
+                            }
                             SendTaskMessage($"开始设置相机曝光!", MessageLevel.Info);
                             bool succed = camera.SetExposureTime(procedure.ExposureTime2);
                             if (!succed)
@@ -2286,22 +2286,22 @@ namespace TeamAAS_VP.Services
                                 SendTaskMessage($"相机增益设置失败!", MessageLevel.Error);
                             }
                             image2 = camera.Grab();
-                            
-                            //isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(0);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道0关闭失败!");
-                            //}
-                            //isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(1);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道1关闭失败!");
-                            //}
-                            //isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(2);
-                            //if (!isSucceed)
-                            //{
-                            //    LogHelper.WriteLogInfo($"设置光源通道2关闭失败!");
-                            //}
+
+                            isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(0);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道0关闭失败!");
+                            }
+                            isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(1);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道1关闭失败!");
+                            }
+                            isSucceed = await _lightManagerService.TurnOffGlobalChannelAsync(2);
+                            if (!isSucceed)
+                            {
+                                LogHelper.WriteLogInfo($"设置光源通道2关闭失败!");
+                            }
                         }
 
                     }
@@ -2445,7 +2445,7 @@ namespace TeamAAS_VP.Services
                     string[] PhotoRes = new string[100];
                     for (int k = 1; k <= Count; k++)
                     {
-
+                       
                         PhotoRes[k] = (string)(outputCollection[$"dis{k}"].Value);
                         //PhotoRes[k] = "222";
                     }

+ 1 - 1
TeamAAS-VM/ViewModels/HomeViewModel.cs

@@ -63,7 +63,7 @@ namespace TeamAAS_VP.ViewModels
             set { SetProperty(ref _IsNoCode, value); }
         }
 
-        private bool _IsResultTrue = false;
+        private bool _IsResultTrue = true;
         /// <summary>
         /// 检测结果为1
         /// </summary>

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

@@ -1804,12 +1804,14 @@ namespace TeamAAS_VP.ViewModels
             {
                 ProMesInfo.ProductCode = "";
                 ProMesInfo.ProductColor = "";
+                ProMesInfo.ProductKBSN = "";
                 ProMesInfo.ProductLoadMode = 0;
             }
             else
             {
                 ProMesInfo.ProductCode = v.ProductCode;
                 ProMesInfo.ProductColor = v.ProductColor;
+                ProMesInfo.ProductKBSN = v.ProductKBSN;
                 ProMesInfo.ProductLoadMode = v.ProductLoadMode;
             }
         }
@@ -1825,6 +1827,7 @@ namespace TeamAAS_VP.ViewModels
                 {
                     ProMesInfo.ProductCode = "";
                     ProMesInfo.ProductColor = "";
+                    ProMesInfo.ProductKBSN = "";
                     ProMesInfo.ProductLoadMode = 0;
                 }
             }

+ 0 - 57
TeamAAS-VM/Views/HomeView.xaml

@@ -173,63 +173,6 @@
                                 Orientation="Vertical"
                                 HorizontalAlignment="Center"
                                 Visibility="{Binding DataContext.IsShowLabel,ElementName=zzz, Converter={StaticResource BooleanToVisibilityConverter}}">
-                        <StackPanel Orientation="Vertical">
-                            <TextBlock Text="MES:"
-                                       FontWeight="Black"
-                                       FontSize="30" />
-                            <TextBlock FontSize="80"
-                                       FontWeight="Black">
-                                <TextBlock.Style>
-                                    <Style TargetType="TextBlock">
-                                        <Style.Triggers>
-                                            <DataTrigger Binding="{Binding management.ShowMes_Query}"
-                                                         Value="True">
-                                                <Setter Property="Text"
-                                                        Value="OK" />
-                                                <Setter Property="Background"
-                                                        Value="Green" />
-                                            </DataTrigger>
-                                            <DataTrigger Binding="{Binding management.ShowMes_Query}"
-                                                         Value="False">
-                                                <Setter Property="Text"
-                                                        Value="NG" />
-                                                <Setter Property="Background"
-                                                        Value="Red" />
-                                            </DataTrigger>
-                                        </Style.Triggers>
-                                    </Style>
-                                </TextBlock.Style>
-                            </TextBlock>
-                        </StackPanel>
-                        <StackPanel Orientation="Vertical"
-                                    Margin="0,40">
-                            <TextBlock Text="结果:"
-                                       FontWeight="Black"
-                                       FontSize="30" />
-                            <TextBlock FontSize="80"
-                                       FontWeight="Black">
-                                <TextBlock.Style>
-                                    <Style TargetType="TextBlock">
-                                        <Style.Triggers>
-                                            <DataTrigger Binding="{Binding management.ShowMes_Result}"
-                                                         Value="True">
-                                                <Setter Property="Text"
-                                                        Value="OK" />
-                                                <Setter Property="Background"
-                                                        Value="Green" />
-                                            </DataTrigger>
-                                            <DataTrigger Binding="{Binding management.ShowMes_Result}"
-                                                         Value="False">
-                                                <Setter Property="Text"
-                                                        Value="NG" />
-                                                <Setter Property="Background"
-                                                        Value="Red" />
-                                            </DataTrigger>
-                                        </Style.Triggers>
-                                    </Style>
-                                </TextBlock.Style>
-                            </TextBlock>
-                        </StackPanel>
                     </StackPanel>
                 </Grid>
 

+ 32 - 1
TeamAAS-VM/Views/SettingView.xaml

@@ -762,11 +762,20 @@
                               IsChecked="{Binding SelectDeviceInfo.EnableMES, Mode=TwoWay}"
                               Command="{Binding CheckStatusCommand}"
                               Margin="6,2" />
+                                <StackPanel Grid.Row="12"
+                             Grid.Column="1"
+                             Orientation="Horizontal">
                                 <CheckBox Grid.Row="12"
                               Grid.Column="1"
                               Content="是否启用两次产品编号"
                               IsChecked="{Binding SelectDeviceInfo.EnableDoubleMes, Mode=TwoWay}"
                               Margin="6,2" />
+                                <CheckBox Grid.Row="12"
+                                        Grid.Column="1"
+                                          Content="是否保存键盘格JMP数据"
+                                          IsChecked="{Binding SelectDeviceInfo.SaveCsvJmp, Mode=TwoWay}"
+                                          Margin="6,2" />
+                                </StackPanel>
                                 <StackPanel Grid.Row="13"
                                 Grid.Column="1"
                                 Orientation="Horizontal">
@@ -2903,6 +2912,7 @@
                                 <RowDefinition Height=" auto" />
                                 <RowDefinition Height=" auto" />
                                 <RowDefinition Height=" auto" />
+                                <RowDefinition Height=" auto" />
                             </Grid.RowDefinitions>
 
                             <TextBlock Margin="0,0,0,8"
@@ -2982,7 +2992,7 @@
                             <TextBlock Margin="0,0,0,8"
                            Grid.Row="3"
                            VerticalAlignment="Center"
-                           Text="产品类型:"
+                           Text="产品KB:"
                            FontSize="{DynamicResource Font.Size.Body3}"
                            HorizontalAlignment="Right" />
                             <TextBox Grid.Row="3"
@@ -2992,6 +3002,27 @@
                          FontSize="{DynamicResource Font.Size.Body3}"
                          TextAlignment="Center"
                          HorizontalAlignment="Left"
+                         VerticalAlignment="Center">
+                                <TextBox.Text>
+                                    <Binding Path="ProMesInfo.ProductKBSN"
+                                 Mode="TwoWay">
+                                    </Binding>
+                                </TextBox.Text>
+                            </TextBox>
+
+                            <TextBlock Margin="0,0,0,8"
+                           Grid.Row="4"
+                           VerticalAlignment="Center"
+                           Text="产品类型:"
+                           FontSize="{DynamicResource Font.Size.Body3}"
+                           HorizontalAlignment="Right" />
+                            <TextBox Grid.Row="4"
+                         Grid.Column="1"
+                         Margin="10,4"
+                         MinWidth="100"
+                         FontSize="{DynamicResource Font.Size.Body3}"
+                         TextAlignment="Center"
+                         HorizontalAlignment="Left"
                          VerticalAlignment="Center">
                                 <TextBox.Text>
                                     <Binding Path="ProMesInfo.ProductLoadMode"

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません