浏览代码

单图识别的界面

djs 5 月之前
父节点
当前提交
90fe6d4588

+ 8 - 19
MeterVision/Dlg/EditStationDlg2.xaml.cs

@@ -66,14 +66,10 @@ namespace MeterVision.Dlg
             //txtLastNumUnit.Text = stationItem.LastNumUnit.ToString();
             //txtLastIndUnit.Text = stationItem.LastIndUnit.ToString();
             txtDialRegion.Text = stationItem.DialRegion;
-            if (stationItem.MeterType == 1 || stationItem.MeterType == 3)
+            if (stationItem.MeterType == 1 || stationItem.MeterType == 3 || stationItem.MeterType == 2)
             {
-                cmbLastUnit.SelectedValue = stationItem.LastNumUnit;
-                txtFeatureRegion.Text = stationItem.NumRegion;
-            }
-            else if(stationItem.MeterType == 2){
-                cmbLastUnit.SelectedValue = stationItem.LastIndUnit;
-                txtFeatureRegion.Text = stationItem.HtRegion;
+                cmbLastUnit.SelectedValue = stationItem.LastUnit;
+                txtFeatureRegion.Text = stationItem.FeatureRegion;
             }
                     
             txtLastValue.Text = string.IsNullOrEmpty(stationItem.LastTime) ? "" : stationItem.LastValue.ToString();
@@ -181,19 +177,12 @@ namespace MeterVision.Dlg
             mStationItem.BrightVal = brightVal;
             mStationItem.NumCount = numCount;
             mStationItem.IndCount = indCount;
-            mStationItem.LastNumUnit = 0;   // lastNumUnit;
-            mStationItem.LastIndUnit = 0;   // lastIndUnit;
-            mStationItem.NumRegion = "";   //numRegion;
-            mStationItem.HtRegion = "";    //htRegion;
-            if (meterType == 1 || meterType == 3)
-            {
-                mStationItem.LastNumUnit = lastUnit;
-                mStationItem.NumRegion = featureRegion;
-            }
-            else if(meterType == 2)
+            mStationItem.LastUnit = 0;   
+            mStationItem.FeatureRegion = "";   
+            if (meterType == 1 || meterType == 3 || meterType == 2)
             {
-                mStationItem.LastIndUnit = lastUnit;
-                mStationItem.HtRegion = featureRegion;
+                mStationItem.LastUnit = lastUnit;
+                mStationItem.FeatureRegion = featureRegion;
             }
 
             mStationItem.DialRegion = dialRegion;

+ 15 - 27
MeterVision/Single/UCSingleGrid.xaml

@@ -147,21 +147,6 @@
                     </DataGridTemplateColumn.CellTemplate>
                 </DataGridTemplateColumn>
 
-                <DataGridTemplateColumn Header="识别信息" Width="140">
-                    <DataGridTemplateColumn.CellTemplate>
-                        <DataTemplate>
-                            <StackPanel Visibility="{Binding ResultVisiable}" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,0,0,0">
-                                <TextBlock FontSize="14px" Text="{Binding MeterTypeName}" 
-                                           Foreground="#000000" Margin="0 0 0 5" HorizontalAlignment="Center"/>
-                                <TextBlock FontSize="14px" Text="{Binding NumCountName}" 
-                                           Foreground="#000000" Margin="0 0 0 5" HorizontalAlignment="Center" />
-                                <TextBlock FontSize="14px" HorizontalAlignment="Center"  Margin="0 0 0 5"
-                                           Text="{Binding LastUnitName,Mode=OneWay}" Foreground="#000000"/>
-                            </StackPanel>
-                        </DataTemplate>
-                    </DataGridTemplateColumn.CellTemplate>
-                </DataGridTemplateColumn>
-
                 <DataGridTemplateColumn Header="识别结果" Width="150">
                     <DataGridTemplateColumn.CellTemplate>
                         <DataTemplate>
@@ -328,32 +313,35 @@
                     </DataGridTemplateColumn.CellTemplate>
                 </DataGridTemplateColumn>
 
-                <DataGridTemplateColumn Header="备注" Width="200">
+                <!--<DataGridTemplateColumn Header="备注" Width="200">
                     <DataGridTemplateColumn.CellTemplate>
                         <DataTemplate>
                             <Border Background="Transparent" Padding="5" PreviewMouseLeftButtonDown="Memo_PreviewMouseLeftButtonDown">
                                 <TextBlock FontSize="14px" Text="{Binding Memo}" TextWrapping="Wrap"                                   
                                    Foreground="#000000" Margin="0" HorizontalAlignment="Left"/>
-                                <!--PreviewMouseLeftButtonDown="Memo_PreviewMouseLeftButtonDown"-->
                             </Border>
-                            <!--<TextBlock FontSize="14px" Text="{Binding Memo}" TextWrapping="Wrap"
-                                       PreviewMouseLeftButtonDown="Memo_PreviewMouseLeftButtonDown"
-                                       Foreground="#000000" Margin="5 5 5 0" HorizontalAlignment="Left"/>-->
                         </DataTemplate>
                     </DataGridTemplateColumn.CellTemplate>
-                </DataGridTemplateColumn>
+                </DataGridTemplateColumn>-->
 
-                <!--删除按钮--><!--
-                <DataGridTemplateColumn Header="删除" Width="80">
+
+                <DataGridTemplateColumn Header="识别信息" Width="140">
                     <DataGridTemplateColumn.CellTemplate>
                         <DataTemplate>
-                            <Button Width="Auto" FontSize="13px" Content="删除" Foreground="DodgerBlue" VerticalAlignment="Center"
-                    BorderBrush="DodgerBlue" BorderThickness="0 0 0 0" Background="Transparent" />
+                            <StackPanel Visibility="{Binding ResultVisiable}" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,0,0,0">
+                                <TextBlock FontSize="14px" Text="{Binding MeterTypeName}" 
+                                           Foreground="#000000" Margin="0 0 0 5" HorizontalAlignment="Center"/>
+                                <TextBlock FontSize="14px" Text="{Binding NumCountName}" 
+                                           Foreground="#000000" Margin="0 0 0 5" HorizontalAlignment="Center" />
+                                <TextBlock FontSize="14px" HorizontalAlignment="Center"  Margin="0 0 0 5"
+                                           Text="{Binding LastUnitName,Mode=OneWay}" Foreground="#000000"/>
+                            </StackPanel>
                         </DataTemplate>
                     </DataGridTemplateColumn.CellTemplate>
-                </DataGridTemplateColumn>-->
+                </DataGridTemplateColumn>
 
-                <!--<DataGridTextColumn Width="*" Header="" IsReadOnly="True" />-->
+                
+                
 
             </DataGrid.Columns>
         </DataGrid>

+ 1 - 1
MeterVision/Single/UCSingleGrid.xaml.cs

@@ -819,7 +819,7 @@ namespace MeterVision.Single
                         }
                         else
                         {
-                            blOpration = DBSingle.UpdateSingleDetail(newSingleDetail);
+                            blOpration = DBSingle.UpdateSingleDetailByResult(newSingleDetail);
                         }
                         
                         return blOpration;

+ 3 - 33
MeterVision/Stand/UCStandMain.xaml

@@ -432,39 +432,9 @@
 
                         <TabControl Grid.Row="1" Margin="5" BorderBrush="#D3D3D3" BorderThickness="1">
                             <TabItem Header="图片信息" FontSize="14px" Margin="0" Padding="10 5 10 5">
-                                <Grid>
-                                    <Grid.RowDefinitions>
-                                        <RowDefinition Height="*" />
-                                        <RowDefinition Height="*" />
-                                    </Grid.RowDefinitions>
-                                    <Border x:Name="pnlImage" Grid.Row="0" BorderThickness="1" BorderBrush="Transparent">
-                                        <img:UCImage x:Name="ucImageSource" />
-                                    </Border>
-                                    <Border x:Name="pnlResult" Visibility="Hidden" Grid.Row="1" BorderBrush="#D3D3D3" BorderThickness="1" Margin="3 10 4 10" >
-                                        <StackPanel Orientation="Horizontal" Margin="10" VerticalAlignment="Top">
-                                            <TextBlock Text="标准答案:" FontSize="14px" Foreground="#333333" VerticalAlignment="Center" Visibility="Visible"/>
-                                            <TextBox x:Name="txtRightResult" 
-                                             Text="" Padding="5" FontSize="15px" Foreground="Black" Width="100" 
-                                        PreviewTextInput="TxtRightResult_PreviewTextInput"
-                                         IsEnabled="{Binding IsResultEditing}" VerticalAlignment="Center" />
-                                            <Button x:Name="btnEditRightResult"
-                                        Content="✎" FontSize="20px" Width="30" Height="30"
-                                        Click="BtnEditRightResult_Click"
-                                        Visibility="{Binding IsResultEditing, Converter={StaticResource InverseBoolToVisibilityConverter}, ConverterParameter={x:Static Visibility.Hidden}}"
-                                        Margin="10 5 10 5" Padding="0" Foreground="White" Background="DarkBlue" />
-
-                                            <Button x:Name="btnSubmitRightResult" Content="✔️" FontSize="20px" Width="30" Height="30" 
-                                        Click="BtnSubmitRightResult_Click" 
-                                        Visibility="{Binding IsResultEditing, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource AncestorType=UserControl}}"
-                                        Margin="10 5 10 5" Padding="0" Foreground="White" Background="DarkGreen" />
-                                            <Button x:Name="btnCancelRightResult" Content="✖️" FontSize="20px" Width="30" Height="30" 
-                                        Click="BtnCancelRightResult_Click" 
-                                        Visibility="{Binding IsResultEditing, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource AncestorType=UserControl}}"
-                                        Margin="10 5 10 5" Padding="0" Foreground="White" Background="DarkRed" />
-                                        </StackPanel>
-                                    </Border>
-
-                                </Grid>
+                                <Border x:Name="pnlImage" Grid.Row="0" BorderThickness="1" BorderBrush="Transparent">
+                                    <img:UCImage x:Name="ucImageSource" />
+                                </Border>
                             </TabItem>
                         </TabControl>
                     </Grid>

+ 2 - 2
MeterVision/Stand/UCStandMain.xaml.cs

@@ -125,7 +125,7 @@ namespace MeterVision.Stand
         {
             pnlImage.Visibility = txtRightItemIndex.Visibility =
                 standDetailsItem == null ? Visibility.Collapsed : Visibility.Visible;
-            pnlResult.Visibility = Visibility.Hidden;
+            //pnlResult.Visibility = Visibility.Hidden;
         }
 
 
@@ -296,7 +296,7 @@ namespace MeterVision.Stand
             {
                 ucImageSource.ImageSource = e.SelectedDataItem.SrcImage;
                 ucImageSource.ImageName = "原始图片";
-                txtRightResult.Text = e.SelectedDataItem.StandValue;
+                //txtRightResult.Text = e.SelectedDataItem.StandValue;
                 IsResultEditing = false;
 
                 if(SelectedStandItem != null)

+ 48 - 12
MeterVision/db/DBSingle.cs

@@ -80,8 +80,46 @@ namespace MeterVision.db
             return SQLiteHelper.ExecuteNonQuery(sql, parameters) > 0;
         }
 
+        public static bool UpdateSingleDetailByConfig(TSingleDetail detail)
+        {
+            // 定义 SQL 更新语句
+            string sql = @"
+                UPDATE t_single_detail                 
+                SET meter_type = @MeterType,
+                    digit_count = @DigitCount,
+                    pointer_count = @PointerCount,
+                    last_unit = @LastUnit,
+                    bright_val = @BrightVal,
+                    flow_rate = @FlowRate,
+                    meter_region = @MeterRegion,
+                    feature_region = @FeatureRegion,
+                    last_value = @LastValue,
+                    last_time = @LastTime
+                WHERE single_detail_id = @SingleDetailId;";
 
-        public static bool UpdateSingleDetail(TSingleDetail detail)
+            // 创建 SQL 参数
+            SQLiteParameter[] parameters = new SQLiteParameter[]
+            {
+                new SQLiteParameter("@SingleDetailId", detail.SingleDetailId),
+                new SQLiteParameter("@MeterType", detail.MeterType),
+                new SQLiteParameter("@DigitCount", detail.DigitCount),
+                new SQLiteParameter("@PointerCount", detail.PointerCount),
+                new SQLiteParameter("@LastUnit", detail.LastUnit),
+                new SQLiteParameter("@BrightVal", detail.BrightVal),
+                new SQLiteParameter("@FlowRate", detail.FlowRate),
+                new SQLiteParameter("@MeterRegion", detail.MeterRegion),
+                new SQLiteParameter("@FeatureRegion", detail.FeatureRegion),
+                new SQLiteParameter("@LastValue", detail.LastValue),
+                new SQLiteParameter("@LastTime", detail.LastTime)
+            };
+
+            // 执行更新操作并返回受影响的行数
+            return SQLiteHelper.ExecuteNonQuery(sql, parameters) > 0;
+        }
+
+
+        //识别结果引发的更改
+        public static bool UpdateSingleDetailByResult(TSingleDetail detail)
         {
             // 定义 SQL 更新语句
             string sql = @"
@@ -89,10 +127,6 @@ namespace MeterVision.db
                 SET run_flag = @RunFlag,
                     run_time = @RunTime,
                     dst_image = @DstImage,
-                    meter_type = @MeterType,
-                    digit_count = @DigitCount,
-                    pointer_count = @PointerCount,
-                    last_unit = @LastUnit,
                     result_type = @ResultType,
                     raw_value = @RawValue,
                     final_value = @FinalValue,
@@ -105,14 +139,9 @@ namespace MeterVision.db
             SQLiteParameter[] parameters = new SQLiteParameter[]
             {
                 new SQLiteParameter("@SingleDetailId", detail.SingleDetailId),
-                //new SQLiteParameter("@CreateTime", detail.CreateTime),
-                //new SQLiteParameter("@SrcImage", detail.SrcImage),
                 new SQLiteParameter("@RunFlag", detail.RunFlag),
                 new SQLiteParameter("@RunTime", detail.RunTime),
                 new SQLiteParameter("@DstImage", detail.DstImage),
-                new SQLiteParameter("@MeterType", detail.MeterType),
-                new SQLiteParameter("@DigitCount", detail.DigitCount),
-                new SQLiteParameter("@PointerCount", detail.PointerCount),
                 new SQLiteParameter("@LastUnit", detail.LastUnit),
                 new SQLiteParameter("@ResultType", detail.ResultType),
                 new SQLiteParameter("@RawValue", detail.RawValue),
@@ -156,7 +185,8 @@ namespace MeterVision.db
             string sql = @"
                 SELECT single_detail_id, create_time, src_image, run_flag, run_time,
                        dst_image, meter_type, digit_count, pointer_count, last_unit,
-                       result_type, raw_value, final_value, ai_ver, debug_info, log_path, memo
+                       result_type, raw_value, final_value, ai_ver, debug_info, log_path, memo,
+                       bright_val,flow_rate,meter_region,feature_region,last_value,last_time
                 FROM t_single_detail
                 ORDER BY create_time DESC
                 LIMIT @PageSize OFFSET @Offset;";
@@ -193,7 +223,13 @@ namespace MeterVision.db
                         AiVer = reader.GetString(reader.GetOrdinal("ai_ver")),
                         DebugInfo = reader.GetString(reader.GetOrdinal("debug_info")),
                         LogPath = reader.GetString(reader.GetOrdinal("log_path")),
-                        Memo = reader.GetString(reader.GetOrdinal("memo"))
+                        Memo = reader.GetString(reader.GetOrdinal("memo")),
+                        BrightVal = reader.GetDouble(reader.GetOrdinal("bright_val")),
+                        FlowRate = reader.GetInt32(reader.GetOrdinal("flow_rate")),
+                        MeterRegion = reader.GetString(reader.GetOrdinal("meter_region")),
+                        FeatureRegion = reader.GetString(reader.GetOrdinal("feature_region")),
+                        LastValue = reader.GetDouble(reader.GetOrdinal("last_value")),
+                        LastTime = reader.GetString(reader.GetOrdinal("last_time"))
                     };
                     details.Add(detail);
                 }

+ 17 - 27
MeterVision/db/DBStation.cs

@@ -15,10 +15,10 @@ namespace MeterVision.db
         {
             // 构建插入的 SQL 语句
             string sql = "INSERT INTO t_station (id,station_id, station_name, device_sn,meter_type, bright_val, flow_rate, " +
-                         "dial_region, num_count, ind_count, num_region, ht_region, last_num_unit, last_ind_unit, " +
+                         "dial_region, num_count, ind_count, feature_region, last_unit, " +
                          "last_value, last_time, create_time, stand_id) " +
                          "VALUES (@StationId, @StationName, @DeviceSn, @MeterType, @BrightVal, @FlowRate, " +
-                         "@DialRegion, @NumCount, @IndCount, @NumRegion, @HtRegion, @LastNumUnit, @LastIndUnit, " +
+                         "@DialRegion, @NumCount, @IndCount, @FeatureRegion, @LastUnit, " +
                          "@LastValue, @LastTime, @CreateTime, @StandId)";
 
             // 创建参数数组
@@ -34,10 +34,8 @@ namespace MeterVision.db
                 new SQLiteParameter("@DialRegion", tStation.DialRegion),
                 new SQLiteParameter("@NumCount", tStation.NumCount),
                 new SQLiteParameter("@IndCount", tStation.IndCount),
-                new SQLiteParameter("@NumRegion", tStation.NumRegion),
-                new SQLiteParameter("@HtRegion", tStation.HtRegion),
-                new SQLiteParameter("@LastNumUnit", tStation.LastNumUnit),
-                new SQLiteParameter("@LastIndUnit", tStation.LastIndUnit),
+                new SQLiteParameter("@FeatureRegion", tStation.FeatureRegion),               
+                new SQLiteParameter("@LastUnit", tStation.LastUnit),
                 new SQLiteParameter("@LastValue", tStation.LastValue),
                 new SQLiteParameter("@LastTime", tStation.LastTime),
                 new SQLiteParameter("@CreateTime", tStation.CreateTime),
@@ -63,8 +61,8 @@ namespace MeterVision.db
         public static bool InsertTStations(List<StationInfo> stationInfos)
         {
             string sql = @"
-                INSERT INTO t_station (id, stand_id,create_time, station_id, device_sn, num_count, last_num_unit)
-                VALUES (@Id, @StandId, @CreateTime, @StationId, @DeviceSn, @NumCount, @LastNumUnit);";
+                INSERT INTO t_station (id, stand_id,create_time, station_id, device_sn, num_count, last_unit)
+                VALUES (@Id, @StandId, @CreateTime, @StationId, @DeviceSn, @NumCount, @LastUnit);";
 
             try
             {
@@ -85,7 +83,7 @@ namespace MeterVision.db
                                 new SQLiteParameter("@StationId", stationInfo.StationId),
                                 new SQLiteParameter("@DeviceSn", stationInfo.DeviceSn),
                                 new SQLiteParameter("@NumCount", stationInfo.NumCount),
-                                new SQLiteParameter("@LastNumUnit", stationInfo.LastUnit2)
+                                new SQLiteParameter("@LastUnit", stationInfo.LastUnit2)
                             };
 
                             // 执行插入操作
@@ -115,7 +113,7 @@ namespace MeterVision.db
             // 定义 SQL 查询语句的基础部分
             string sql = @"
                 SELECT id,station_id, station_name, device_sn,meter_type, bright_val, flow_rate, dial_region,
-                       num_count, ind_count, num_region, ht_region, last_num_unit, last_ind_unit,
+                       num_count, ind_count, feature_region, last_unit,
                        last_value, last_time, create_time,stand_id                
                 FROM t_station ";
 
@@ -160,10 +158,8 @@ namespace MeterVision.db
                         DialRegion = reader.GetString(reader.GetOrdinal("dial_region")),
                         NumCount = reader.GetInt32(reader.GetOrdinal("num_count")),
                         IndCount = reader.GetInt32(reader.GetOrdinal("ind_count")),
-                        NumRegion = reader.GetString(reader.GetOrdinal("num_region")),
-                        HtRegion = reader.GetString(reader.GetOrdinal("ht_region")),
-                        LastNumUnit = reader.GetDouble(reader.GetOrdinal("last_num_unit")),
-                        LastIndUnit = reader.GetDouble(reader.GetOrdinal("last_ind_unit")),
+                        FeatureRegion = reader.GetString(reader.GetOrdinal("feature_region")),
+                        LastUnit = reader.GetDouble(reader.GetOrdinal("last_unit")),
                         LastValue = reader.GetDouble(reader.GetOrdinal("last_value")),
                         LastTime = reader.GetString(reader.GetOrdinal("last_time")),
                         CreateTime = reader.GetString(reader.GetOrdinal("create_time")),
@@ -286,7 +282,7 @@ namespace MeterVision.db
             // 查询分页数据
             string sql = $@"
                 SELECT id, station_id, station_name, device_sn, meter_type, bright_val, flow_rate, dial_region,
-                       num_count, ind_count, num_region, ht_region, last_num_unit, last_ind_unit,
+                       num_count, ind_count, feature_region, last_unit,
                        last_value, last_time, create_time, stand_id
                 {baseSql}
                 ORDER BY station_id ASC
@@ -327,10 +323,8 @@ namespace MeterVision.db
                         DialRegion = reader.GetString(reader.GetOrdinal("dial_region")),
                         NumCount = reader.GetInt32(reader.GetOrdinal("num_count")),
                         IndCount = reader.GetInt32(reader.GetOrdinal("ind_count")),
-                        NumRegion = reader.GetString(reader.GetOrdinal("num_region")),
-                        HtRegion = reader.GetString(reader.GetOrdinal("ht_region")),
-                        LastNumUnit = reader.GetDouble(reader.GetOrdinal("last_num_unit")),
-                        LastIndUnit = reader.GetDouble(reader.GetOrdinal("last_ind_unit")),
+                        FeatureRegion = reader.GetString(reader.GetOrdinal("feature_region")),
+                        LastUnit = reader.GetDouble(reader.GetOrdinal("last_unit")),
                         LastValue = reader.GetDouble(reader.GetOrdinal("last_value")),
                         LastTime = reader.GetString(reader.GetOrdinal("last_time")),
                         CreateTime = reader.GetString(reader.GetOrdinal("create_time")),
@@ -391,10 +385,8 @@ namespace MeterVision.db
                     dial_region = @DialRegion,
                     num_count = @NumCount,
                     ind_count = @IndCount,
-                    num_region = @NumRegion,
-                    ht_region = @HtRegion,
-                    last_num_unit = @LastNumUnit,
-                    last_ind_unit = @LastIndUnit,
+                    feature_region = @FeatureRegion,
+                    last_unit = @LastUnit,
                     last_value = @LastValue,
                     last_time = @LastTime
                 WHERE id = @Id";
@@ -411,10 +403,8 @@ namespace MeterVision.db
                 new SQLiteParameter("@DialRegion", tStation.DialRegion),
                 new SQLiteParameter("@NumCount", tStation.NumCount),
                 new SQLiteParameter("@IndCount", tStation.IndCount),
-                new SQLiteParameter("@NumRegion", tStation.NumRegion),
-                new SQLiteParameter("@HtRegion", tStation.HtRegion),
-                new SQLiteParameter("@LastNumUnit", tStation.LastNumUnit),
-                new SQLiteParameter("@LastIndUnit", tStation.LastIndUnit),
+                new SQLiteParameter("@FeatureRegion", tStation.FeatureRegion),
+                new SQLiteParameter("@LastUnit", tStation.LastUnit),
                 new SQLiteParameter("@LastValue", tStation.LastValue),
                 new SQLiteParameter("@LastTime", tStation.LastTime)
             };

+ 21 - 7
MeterVision/db/TSingleDetail.cs

@@ -18,9 +18,9 @@ namespace MeterVision.db
         public string RunTime { get; set; }         // RUN_TIME
         public string DstImage { get; set; }        // DST_IMAGE
         public int MeterType { get; set; }       // METER_TYPE
-        public int DigitCount { get; set; }      // DIGIT_COUNT
-        public int PointerCount { get; set; }    // POINTER_COUNT
-        public string LastUnit { get; set; }        // LAST_UNIT
+        public int DigitCount { get; set; }             // DIGIT_COUNT
+        public int PointerCount { get; set; }           // POINTER_COUNT
+        public string LastUnit { get; set; }            // LAST_UNIT
         public int ResultType { get; set; }         // RESULT_TYPE
         public string RawValue { get; set; }      // STAND_VALUE
         public string FinalValue { get; set; }     // RESULT_VALUE
@@ -28,6 +28,15 @@ namespace MeterVision.db
         public string DebugInfo { get; set; }       // DEBUG_INFO
         public string LogPath { get; set; }         // LOG_PATH
         public string Memo { get; set; }
+
+        public double BrightVal { get; set; }
+        public int FlowRate { get; set; }
+        public string MeterRegion { get; set; }
+        public string FeatureRegion { get; set; }
+        public double LastValue { get; set; }
+        public string LastTime { get; set; }
+
+
         public TSingleDetail()
         {
             SingleDetailId = string.Empty;
@@ -47,6 +56,11 @@ namespace MeterVision.db
             DebugInfo = string.Empty;
             LogPath = string.Empty;
             Memo = string.Empty;
+            BrightVal = 1.20;
+            MeterRegion = string.Empty;
+            FeatureRegion = string.Empty;
+            LastValue = 0;
+            LastTime = string.Empty;
         }
 
         public TSingleDetail(SingleDetailItem singleDetail,ResultModel resultModel)
@@ -58,10 +72,10 @@ namespace MeterVision.db
             RunFlag = 1;
             RunTime = ThisApp.GetNowTime_yyyyMMddHHmmss();
             DstImage = resultModel.DstImage;
-            MeterType = resultModel.MeterType;
-            DigitCount = resultModel.DigitCount;
-            PointerCount = resultModel.PointerCount;
-            LastUnit = resultModel.SLastUnit;
+            //MeterType = resultModel.MeterType;
+            //DigitCount = resultModel.DigitCount;
+            //PointerCount = resultModel.PointerCount;
+            //LastUnit = resultModel.SLastUnit;
             ResultType = resultModel.ResultType;
             RawValue = resultModel.SRawValue;
             FinalValue = resultModel.sFinalValue;

+ 4 - 8
MeterVision/db/TStation.cs

@@ -22,10 +22,8 @@ namespace MeterVision.db
         public string DialRegion { get; set; }
         public int NumCount { get; set; }
         public int IndCount { get; set; }
-        public string NumRegion { get; set; }
-        public string HtRegion { get; set; }
-        public double LastNumUnit { get; set; }
-        public double LastIndUnit { get; set; }
+        public string FeatureRegion { get; set; }
+        public double LastUnit { get; set; }
         public double LastValue { get; set; }
         public string LastTime { get; set; }
 
@@ -43,10 +41,8 @@ namespace MeterVision.db
             DialRegion = string.Empty;
             NumCount = 0;
             IndCount = 0;
-            NumRegion = string.Empty;
-            HtRegion = string.Empty;
-            LastNumUnit = 0.0;
-            LastIndUnit = 0.0;
+            FeatureRegion = string.Empty;
+            LastUnit = 0.0;
             LastValue = 0.0;
             LastTime = string.Empty;
             CreateTime = string.Empty;

+ 89 - 2
MeterVision/model/SingleDetailItem.cs

@@ -313,6 +313,90 @@ namespace MeterVision.model
             }
         }
 
+        private string _brightVal;
+        public string BrightVal
+        {
+            get => _brightVal;
+            set
+            {
+                if(_brightVal != value)
+                {
+                    _brightVal = value;
+                    OnPropertyChanged(nameof(BrightVal));
+                }
+            }
+        }
+
+        private int _flowRate;
+        public int FlowRate
+        {
+            get => _flowRate;
+            set
+            {
+                if(_flowRate != value)
+                {
+                    _flowRate = value;
+                    OnPropertyChanged(nameof(FlowRate));
+                }
+            }
+        }
+
+        private string _meterRegion;
+        public string MeterRegion
+        {
+            get => _meterRegion;
+            set
+            {
+                if(_meterRegion != value)
+                {
+                    _meterRegion = value;
+                    OnPropertyChanged(nameof(MeterRegion));
+                }
+            }
+        }
+
+        private string _featureRegion;
+        public string FeatureRegion
+        {
+            get => _featureRegion;
+            set
+            {
+                if(_featureRegion != value)
+                {
+                    _featureRegion = value;
+                    OnPropertyChanged(nameof(FeatureRegion));
+                }
+            }
+        }
+
+        private double _lastValue;
+        public double LastValue
+        {
+            get => _lastValue;
+            set
+            {
+                if(_lastValue != value)
+                {
+                    _lastValue = value;
+                    OnPropertyChanged(nameof(LastValue));
+                }
+            }
+        }
+
+        private string _lastTime;
+        public string LastTime
+        {
+            get => _lastTime;
+            set
+            {
+                if(_lastTime != value)
+                {
+                    _lastTime = value;
+                    OnPropertyChanged(nameof(LastTime));
+                }
+            }
+        }
+
 
         public Visibility ResultVisiable => (RunFlag == 1) ? Visibility.Visible : Visibility.Hidden;
 
@@ -338,7 +422,8 @@ namespace MeterVision.model
                 case 5:
                     return "压力表";
                 default:
-                    return "非水表";
+                    return "";
+                    //return "非水表";
             }
         }
 
@@ -348,9 +433,11 @@ namespace MeterVision.model
             switch (MeterType)
             {
                 case 1:
-                    return $"数字: {DigitCount} 指针{PointerCount}";
+                    return $"数字: {DigitCount} 指针: {PointerCount}";
                 case 2:
                     return $"指针: {PointerCount}";
+                case 3:
+                    return $"数字: {DigitCount}";
                 default:
                     return string.Empty;
             }

+ 16 - 106
MeterVision/model/StationItem.cs

@@ -237,73 +237,28 @@ namespace MeterVision.model
 
 
 
-        private string _numRegion;
-        public string NumRegion
+        private string _featureRegion;
+        public string FeatureRegion
         {
-            get => _numRegion;
+            get => _featureRegion;
             set
             {
-                if(_numRegion != value)
+                if(_featureRegion != value)
                 {
-                    _numRegion = value;
-                    OnPropertyChanged(nameof(NumRegion));
-                    //OnPropertyChanged(nameof(NumRegionName));
+                    _featureRegion = value;
+                    OnPropertyChanged(nameof(FeatureRegion));
                     OnPropertyChanged(nameof(FeatureRegionName));
                 }
             }
         }
 
-        //public string NumRegionName
-        //{
-        //    get
-        //    {
-        //        if(MeterType == 1 || MeterType == 3)
-        //        {
-        //            return NumRegion;
-        //        }
-        //        return "";
-        //    }
-        //}
-
-
-        private string _htReigon;
-        public string HtRegion
-        {
-            get => _htReigon;
-            set
-            {
-                if(_htReigon != value)
-                {
-                    _htReigon = value;
-                    OnPropertyChanged(nameof(HtRegion));
-                    //OnPropertyChanged(nameof(HtRegionName));
-                    OnPropertyChanged(nameof(FeatureRegionName));
-                }
-            }
-        }
-
-        //public string HtRegionName
-        //{
-        //    get
-        //    {
-        //        if(MeterType == 2)
-        //        {
-        //            return HtRegion;
-        //        }
-        //        return "";
-        //    }                
-        //}
         public string FeatureRegionName
         {
             get
             {
-                if(MeterType == 1 || MeterType == 3)
-                {
-                    return NumRegion;
-                }
-                else if(MeterType == 2)
+                if(MeterType == 1 || MeterType == 3 || MeterType == 2)
                 {
-                    return HtRegion;
+                    return FeatureRegion;
                 }
                 else
                 {
@@ -313,73 +268,28 @@ namespace MeterVision.model
         }
 
 
-        private double _lastNumUnit;
-        public double LastNumUnit
+        private double _lastUnit;
+        public double LastUnit
         {
-            get => _lastNumUnit;
+            get => _lastUnit;
             set
             {
-                if(_lastNumUnit != value)
+                if(_lastUnit != value)
                 {
-                    _lastNumUnit = value;
-                    OnPropertyChanged(nameof(LastNumUnit));
-                    //OnPropertyChanged(nameof(LastNumUnitName));
+                    _lastUnit = value;
+                    OnPropertyChanged(nameof(LastUnit));
                     OnPropertyChanged(nameof(LastUnitName));
                 }
             }
         }
 
-        //public string LastNumUnitName
-        //{
-        //    get
-        //    {
-        //        if(MeterType == 1 || MeterType == 3)
-        //        {
-        //            return LastNumUnit + "";
-        //        }
-        //        return "";
-        //    }
-        //}
-
-
-        private double _lastIndUnit;
-        public double LastIndUnit
-        {
-            get => _lastIndUnit;
-            set
-            {
-                if(_lastIndUnit != value)
-                {
-                    _lastIndUnit = value;
-                    //OnPropertyChanged(nameof(LastIndUnit));
-                    //OnPropertyChanged(nameof(LastIndUnitName));
-                    OnPropertyChanged(nameof(LastUnitName));
-                }
-            }
-        }
-
-        //public string LastIndUnitName
-        //{
-        //    get
-        //    {
-        //        if(MeterType == 2)
-        //        {
-        //            return LastIndUnit + "";
-        //        }
-        //        return "";
-        //    }
-        //}
-
         public string LastUnitName
         {
             get
             {
-                if (MeterType == 1 || MeterType == 3)
-                {
-                    return LastNumUnit + "";
-                }else if(MeterType == 2)
+                if (MeterType == 1 || MeterType == 3 || MeterType == 2)
                 {
-                    return LastIndUnit + "";
+                    return LastUnit + "";
                 }
                 else
                 {