Sfoglia il codice sorgente

新增界面图像可选显示,修改界面显示

KWD 5 mesi fa
parent
commit
c8d8c5d444

+ 2 - 2
TeamAAS-VM/Core/Management.cs

@@ -2532,12 +2532,12 @@ namespace TeamAAS_VP.Core
                                         DFC.Clear();//CTQ数据集合
 
                                         //获取当前工位的配置
-                                        var stationConfig = _configService.GetDeviceInfo(0);
+                                        var stationConfig = _configService.GetDeviceInfo(i);
                                         SendTaskMessage($"收到{i}:{stationConfig.DeviceName}上传本站数据请求...", MessageLevel.Debug);
                                         //从服务器中获取当前时间
                                         LogHelper.WriteLogMes($"【从服务器中获取当前时间】");
                                         SendTaskMessage($"从服务器中获取当前时间", MessageLevel.Info);
-                                        var serverTimeResult = await _mesService.GetServerTimeAsync(i, code, 2);
+                                        var serverTimeResult = await _mesService.GetServerTimeAsync(i, ProductMainSN[i], 2);
 
                                         //这里缺少上传MES的本站数据结果及开始和结束时间,需要补充
 

+ 10 - 0
TeamAAS-VM/Models/Product/ProcedureModel.cs

@@ -234,6 +234,16 @@ namespace TeamAAS_VP.Models
             set { SetProperty(ref _IsExcludeNearPoint, value); }
         }
 
+        private bool _IsImageVisibility = true;
+        /// <summary>
+        /// 是否剔除本次识别到的物料与上一次识别到的物料位置过近的点
+        /// </summary>
+        public bool IsImageVisibility
+        {
+            get { return _IsImageVisibility; }
+            set { SetProperty(ref _IsImageVisibility, value); }
+        }
+
         private double _ExcludeNearPointThreshol = 1;
         /// <summary>
         /// 物料位置过近阈值

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

@@ -768,8 +768,8 @@ namespace TeamAAS_VP.Services
             string url = "";
             url = $"{device.MesUrl}?c=QUERY_RECORD&line={device.Line}&station={device.Station}&fixtureid={device.FixtureId}&sn={sn}&p=mes_server_time";
 
-            LogHelper.WriteLogMes($"【询问URL】{url}");
-            SendTaskMessage($"【询问URL】{url}", MessageLevel.Info);
+            LogHelper.WriteLogMes($"【询问MES Time】{url}");
+            SendTaskMessage($"【询问MES Time】{url}", MessageLevel.Info);
             (bool IsSuccess, DateTime Now) result = (false, DateTime.Now);
 
             for (int i = 0; i < 3; i++)
@@ -779,8 +779,8 @@ namespace TeamAAS_VP.Services
                     using (var rsp = await _httpClient.GetAsync(url))
                     {
                         var text = await rsp.Content.ReadAsStringAsync();
-                        LogHelper.WriteLogMes($"【HTTP接收】{text}");
-                        SendTaskMessage($"【HTTP接收】{text}", MessageLevel.Info);
+                        LogHelper.WriteLogMes($"【HTTP接收MES Time】{text}");
+                        SendTaskMessage($"【HTTP接收MES Time】{text}", MessageLevel.Info);
 
                         // "SFC_OK" 代表和 MES 连接成功
                         if (text.Contains("SFC_OK"))

+ 4 - 1
TeamAAS-VM/ViewModels/MainWindowViewModel.cs

@@ -380,7 +380,10 @@ namespace TeamAAS_VP.ViewModels
                 {
                     foreach (var item2 in item1.ProcedureModels)
                     {
-                        management.Renders.Add(new ShowRender() { Id = item2.Id, ProceductName = item2.Name });
+                        if (item2.IsImageVisibility)
+                        {
+                            management.Renders.Add(new ShowRender() { Id = item2.Id, ProceductName = item2.Name });
+                        }
                     }
                 }
                 _container.Resolve<ShowVisionRenderViewModel>().Renders = management.Renders;

+ 18 - 5
TeamAAS-VM/Views/HomeView.xaml

@@ -35,24 +35,25 @@
         <Grid Grid.Row="0">
             <Grid.RowDefinitions>
                 <RowDefinition Height="0.65*" />
-                <RowDefinition Height="0.4*" />
+                <!--<RowDefinition Height="0.4*" />-->
             </Grid.RowDefinitions>
             <!--图像-->
             <local:ShowVisionRender Grid.Row="0"
                                     Grid.Column="0" />
             <!--曲线图-->
-            <oxy:PlotView Grid.Row="1"
+            <!--<oxy:PlotView Grid.Row="1"
                           Grid.Column="0"
                           Model="{Binding LockCurvePlotModel}"
                           Background="Transparent"
-                          Margin="10" />
+                          Margin="10" />-->
         </Grid>
         <Grid Grid.Row="1"
               Grid.Column="1">
             <Grid.RowDefinitions>
-                <RowDefinition Height="60*" />
+                <RowDefinition Height="50*" />
                 <RowDefinition Height="5*" />
-                <RowDefinition Height="35*" />
+                <RowDefinition Height="40*" />
+                <RowDefinition Height="30*" />
             </Grid.RowDefinitions>
             <Grid>
                 <Grid.RowDefinitions>
@@ -513,6 +514,18 @@
             </materialDesign:Card>
 
             <materialDesign:Card Grid.Row="2"
+                     UniformCornerRadius="10"
+                     BorderBrush="LightGray"
+                     BorderThickness="1"
+                     Margin="0,0,0,2">
+                <oxy:PlotView Grid.Row="1"
+                Grid.Column="0"
+                Model="{Binding LockCurvePlotModel}"
+                Background="Transparent"
+                Margin="10" />
+            </materialDesign:Card>
+
+            <materialDesign:Card Grid.Row="3"
                                  UniformCornerRadius="10"
                                  BorderBrush="LightGray"
                                  BorderThickness="1"

+ 35 - 28
TeamAAS-VM/Views/Product/ProcedureParams.xaml

@@ -308,11 +308,18 @@
                               Grid.Column="1"
                               Margin="0,2,0,0"
                               IsChecked="{Binding SelectProcedure.IsExcludeNearPoint,Mode=TwoWay}" />
-                    <!--点位输出的模式-->
                     <TextBlock Grid.Row="4"
+                               Grid.Column="0"
+                               Text="是否启用当前流程界面显示" />
+                    <CheckBox Grid.Row="4"
+                              Grid.Column="1"
+                              Margin="0,2,0,0"
+                              IsChecked="{Binding SelectProcedure.IsImageVisibility,Mode=TwoWay}" />
+                    <!--点位输出的模式-->
+                    <TextBlock Grid.Row="5"
                                Grid.Column="0"
                                Text="{lex:Loc 点位输出的模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
-                    <ComboBox Grid.Row="4"
+                    <ComboBox Grid.Row="5"
                               Grid.Column="1"
                               SelectedItem="{Binding SelectProcedure.OutputPointMode,Mode=TwoWay}"
                               ItemsSource="{ext:EnumBindingSource EnumType=enums:OutputPointMode}"
@@ -320,10 +327,10 @@
                               BorderThickness="1"
                               Margin="0,2,0,0" />
                     <!--视觉引导模式(先拍再振/先振再拍)-->
-                    <TextBlock Grid.Row="5"
+                    <TextBlock Grid.Row="6"
                                Grid.Column="0"
                                Text="{lex:Loc 视觉引导模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
-                    <ComboBox Grid.Row="5"
+                    <ComboBox Grid.Row="6"
                               Grid.Column="1"
                               SelectedItem="{Binding SelectProcedure.VibrationModel,Mode=TwoWay}"
                               ItemsSource="{ext:EnumBindingSource EnumType=enums:VibrationModel}"
@@ -331,30 +338,30 @@
                               BorderThickness="1"
                               Margin="0,2,0,0" />
                     <!--拍照失败Feeder振动最大次数-->
-                    <TextBlock Grid.Row="6"
+                    <TextBlock Grid.Row="7"
                                Grid.Column="0"
                                Text="{lex:Loc Feeder最大振动拍照次数,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
-                    <mah:NumericUpDown Grid.Row="6"
+                    <mah:NumericUpDown Grid.Row="7"
                                        Grid.Column="1"
                                        Maximum="100"
                                        Minimum="1"
                                        StringFormat="{}{0:N0}"
                                        Value="{Binding SelectProcedure.FeederFailLimit,Mode=TwoWay}" />
                     <!--每次发送给机器人的点数最大值-->
-                    <TextBlock Grid.Row="7"
+                    <TextBlock Grid.Row="8"
                                Grid.Column="0"
                                Text="{lex:Loc 发送给机器人的最大点位数量,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
-                    <mah:NumericUpDown Grid.Row="7"
+                    <mah:NumericUpDown Grid.Row="8"
                                        Grid.Column="1"
                                        Maximum="100"
                                        Minimum="1"
                                        StringFormat="{}{0:N0}"
                                        Value="{Binding SelectProcedure.OutputPointCountMax,Mode=TwoWay}" />
                     <!--视觉流程输出项之间的分割符-->
-                    <TextBlock Grid.Row="8"
+                    <TextBlock Grid.Row="9"
                                Grid.Column="0"
                                Text="{lex:Loc 视觉流程输出项之间的分割符,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
-                    <TextBox Grid.Row="8"
+                    <TextBox Grid.Row="9"
                              Grid.Column="1"
                              Text="{Binding SelectProcedure.OutputSeparator,Mode=TwoWay}"
                              BorderThickness="1"
@@ -362,44 +369,44 @@
                              HorizontalAlignment="Stretch"
                              Margin="0,2,0,0" />
                     <!--保存图像-->
-                    <TextBlock Grid.Row="9"
+                    <TextBlock Grid.Row="10"
                                Grid.Column="0"
                                Text="{lex:Loc 保存图像,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
                     <CheckBox x:Name="chbSaveImage"
-                              Grid.Row="9"
+                              Grid.Row="10"
                               Grid.Column="1"
                               d:IsChecked="True"
                               Content="{lex:Loc 是否保存,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
                               IsChecked="{Binding SelectProcedure.IsSaveImage,Mode=TwoWay}"
                               Style="{StaticResource MaterialDesignLightCheckBox}" />
                     <!--保存图像模式-->
-                    <TextBlock Grid.Row="10"
+                    <TextBlock Grid.Row="11"
                                Grid.Column="0"
                                Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
                                Text="{lex:Loc 图像存储模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
-                    <ComboBox Grid.Row="10"
+                    <ComboBox Grid.Row="11"
                               Grid.Column="1"
                               Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
                               materialDesign:HintAssist.Hint="{lex:Loc 图像存储模式}"
                               SelectedItem="{Binding SelectProcedure.SaveImageModel,Mode=TwoWay}"
                               ItemsSource="{ext:EnumBindingSource EnumType=enums:ProcedureSaveImageModel}" />
                     <!--保存图像路径存放模式-->
-                    <TextBlock Grid.Row="11"
+                    <TextBlock Grid.Row="12"
                                Grid.Column="0"
                                Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
                                Text="{lex:Loc 图像路径存储方式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
-                    <ComboBox Grid.Row="11"
+                    <ComboBox Grid.Row="12"
                               Grid.Column="1"
                               Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
                               materialDesign:HintAssist.Hint="{lex:Loc 图像路径存储方式}"
                               SelectedItem="{Binding SelectProcedure.SaveImagePathModel,Mode=TwoWay}"
                               ItemsSource="{ext:EnumBindingSource EnumType=enums:ProcedureSaveImagePathModel}" />
                     <!--保存路径-->
-                    <TextBlock Grid.Row="12"
+                    <TextBlock Grid.Row="13"
                                Grid.Column="0"
                                Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
                                Text="{lex:Loc 保存路径,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
-                    <Grid Grid.Row="12"
+                    <Grid Grid.Row="13"
                           Grid.Column="1"
                           Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
                         <Grid.ColumnDefinitions>
@@ -421,40 +428,40 @@
                         </Button>
                     </Grid>
                     <!--是否压缩图像-->
-                    <TextBlock Grid.Row="13"
+                    <TextBlock Grid.Row="14"
                                Grid.Column="0"
                                Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
                                Text="{lex:Loc 压缩图像,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
-                    <CheckBox Grid.Row="13"
+                    <CheckBox Grid.Row="14"
                               Grid.Column="1"
                               Content="{lex:Loc 是否压缩}"
                               Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
                               IsChecked="{Binding SelectProcedure.IsCompress,Mode=TwoWay}"
                               Style="{StaticResource MaterialDesignLightCheckBox}" />
                     <!--是否延迟保存图片-->
-                    <TextBlock Grid.Row="14"
+                    <TextBlock Grid.Row="15"
                                Grid.Column="0"
                                Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
                                Text="{lex:Loc 延迟保存图片,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
-                    <CheckBox Grid.Row="14"
+                    <CheckBox Grid.Row="15"
                               Grid.Column="1"
                               Content="{lex:Loc 是否延迟保存图片}"
                               Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
                               IsChecked="{Binding SelectProcedure.IsDelaySaveImage,Mode=TwoWay}"
                               Style="{StaticResource MaterialDesignLightCheckBox}" />
                     <!--图片名称格式-->
-                    <TextBlock Grid.Row="15"
+                    <TextBlock Grid.Row="16"
                                Grid.Column="0"
                                Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
                                Text="图片名称格式:" />
-                    <TextBox Grid.Row="15"
+                    <TextBox Grid.Row="16"
                              Grid.Column="1"
                              HorizontalAlignment="Stretch"
                              Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
                              Text="{Binding SelectProcedure.ImageFileNameFormat,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                     </TextBox>
                     <!--示例-->
-                    <StackPanel Grid.Row="16"
+                    <StackPanel Grid.Row="17"
                                 Grid.Column="0"
                                 Grid.ColumnSpan="2"
                                 Orientation="Vertical"
@@ -477,7 +484,7 @@
                     </StackPanel>
 
                     <!--自定义参数-->
-                    <GroupBox Grid.Row="17"
+                    <GroupBox Grid.Row="18"
                               Grid.Column="0"
                               Grid.ColumnSpan="2"
                               HorizontalAlignment="Stretch"
@@ -547,10 +554,10 @@
                             </DataGrid>
                         </DockPanel>
                     </GroupBox>
-                    <TextBlock Grid.Row="18"
+                    <TextBlock Grid.Row="19"
                                Grid.Column="0"
                                Text="{lex:Loc 重写视觉处理逻辑}" />
-                    <Button Grid.Row="18"
+                    <Button Grid.Row="19"
                             Grid.Column="1"
                             Margin="0,2,0,0"
                             Command="{Binding OverrideVisionTaskCommand}">