123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- using MeterVision.model;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace MeterVision.db
- {
- public class TSingleDetail
- {
- public string SingleDetailId { get; set; }
- public string CreateTime { get; set; }
- public string SrcImage { get; set; } // SRC_IMAGE
- public int RunFlag { get; set; } // RUN_FLAG
- 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 ResultType { get; set; } // RESULT_TYPE
- public string RawValue { get; set; } // STAND_VALUE
- public string FinalValue { get; set; } // RESULT_VALUE
- public string AiVer { get; set; } // AI_VER
- public string DebugInfo { get; set; } // DEBUG_INFO
- public string LogPath { get; set; } // LOG_PATH
- public string Memo { get; set; }
- public TSingleDetail()
- {
- SingleDetailId = string.Empty;
- CreateTime = string.Empty;
- SrcImage = string.Empty;
- RunFlag = 0;
- RunTime = string.Empty;
- DstImage = string.Empty;
- MeterType = 0;
- DigitCount = 0;
- PointerCount = 0;
- LastUnit = string.Empty;
- ResultType = 0;
- RawValue = string.Empty;
- FinalValue = string.Empty;
- AiVer = string.Empty;
- DebugInfo = string.Empty;
- LogPath = string.Empty;
- Memo = string.Empty;
- }
- public TSingleDetail(SingleDetailItem singleDetail,ResultModel resultModel)
- {
- SingleDetailId = singleDetail.SingleDetailId;
- CreateTime = singleDetail.CreateTime;
- SrcImage = singleDetail.SrcImage;
- RunFlag = 1;
- RunTime = ThisApp.GetNowTime_yyyyMMddHHmmss();
- DstImage = resultModel.DstImage;
- MeterType = resultModel.MeterType;
- DigitCount = resultModel.DigitCount;
- PointerCount = resultModel.PointerCount;
- LastUnit = resultModel.SLastUnit;
- ResultType = resultModel.ResultType;
- RawValue = resultModel.SRawValue;
- FinalValue = resultModel.sFinalValue;
- AiVer = resultModel.AiVer;
- LogPath = resultModel.LogPath;
- // 使用 LINQ 进行转换和条件判断,并过滤掉空字符串
- //var formattedBytes = resultModel.DebugInfoBytes.Select(b => b == 88 ? "" : b.ToString())
- // .Where(s => !string.IsNullOrEmpty(s));
- // 使用 string.Join 将结果连接成逗号分割的字符串
- //DebugInfo = string.Join(",", formattedBytes);
- //DebugInfo = string.Join(",", resultModel.DebugInfoBytes.Select(b => b.ToString())); // 默认是十进制
- // 使用 LINQ 进行转换和条件判断
- var formattedBytes = resultModel.DebugInfoBytes.Select(b => b == 88 ? "" : b.ToString());
- DebugInfo = string.Join(",", formattedBytes);
- }
- /////////////////////////////////////////////////////////
- }
- }
|