TSingleDetail.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. using MeterVision.model;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace MeterVision.db
  8. {
  9. public class TSingleDetail
  10. {
  11. public string SingleDetailId { get; set; }
  12. public string CreateTime { get; set; }
  13. public string SrcImage { get; set; } // SRC_IMAGE
  14. public int RunFlag { get; set; } // RUN_FLAG
  15. public string RunTime { get; set; } // RUN_TIME
  16. public string DstImage { get; set; } // DST_IMAGE
  17. public int MeterType { get; set; } // METER_TYPE
  18. public int DigitCount { get; set; } // DIGIT_COUNT
  19. public int PointerCount { get; set; } // POINTER_COUNT
  20. public string LastUnit { get; set; } // LAST_UNIT
  21. public int ResultType { get; set; } // RESULT_TYPE
  22. public string RawValue { get; set; } // STAND_VALUE
  23. public string FinalValue { get; set; } // RESULT_VALUE
  24. public string AiVer { get; set; } // AI_VER
  25. public string DebugInfo { get; set; } // DEBUG_INFO
  26. public string LogPath { get; set; } // LOG_PATH
  27. public string Memo { get; set; }
  28. public double BrightVal { get; set; }
  29. public int FlowRate { get; set; }
  30. public string MeterRegion { get; set; }
  31. public string FeatureRegion { get; set; }
  32. public double LastValue { get; set; }
  33. public string LastTime { get; set; }
  34. public TSingleDetail()
  35. {
  36. SingleDetailId = string.Empty;
  37. CreateTime = string.Empty;
  38. SrcImage = string.Empty;
  39. RunFlag = 0;
  40. RunTime = string.Empty;
  41. DstImage = string.Empty;
  42. MeterType = 0;
  43. DigitCount = 0;
  44. PointerCount = 0;
  45. LastUnit = string.Empty;
  46. ResultType = 0;
  47. RawValue = string.Empty;
  48. FinalValue = string.Empty;
  49. AiVer = string.Empty;
  50. DebugInfo = string.Empty;
  51. LogPath = string.Empty;
  52. Memo = string.Empty;
  53. BrightVal = 1.20;
  54. MeterRegion = string.Empty;
  55. FeatureRegion = string.Empty;
  56. LastValue = 0;
  57. LastTime = string.Empty;
  58. }
  59. public TSingleDetail(SingleDetailItem singleDetail,ResultModel resultModel)
  60. {
  61. SingleDetailId = singleDetail.SingleDetailId;
  62. CreateTime = singleDetail.CreateTime;
  63. SrcImage = singleDetail.SrcImage;
  64. RunFlag = 1;
  65. RunTime = ThisApp.GetNowTime_yyyyMMddHHmmss();
  66. DstImage = resultModel.DstImage;
  67. //MeterType = resultModel.MeterType;
  68. //DigitCount = resultModel.DigitCount;
  69. //PointerCount = resultModel.PointerCount;
  70. //LastUnit = resultModel.SLastUnit;
  71. ResultType = resultModel.ResultType;
  72. RawValue = resultModel.SRawValue;
  73. FinalValue = resultModel.sFinalValue;
  74. AiVer = resultModel.AiVer;
  75. LogPath = resultModel.LogPath;
  76. // 使用 LINQ 进行转换和条件判断,并过滤掉空字符串
  77. //var formattedBytes = resultModel.DebugInfoBytes.Select(b => b == 88 ? "" : b.ToString())
  78. // .Where(s => !string.IsNullOrEmpty(s));
  79. // 使用 string.Join 将结果连接成逗号分割的字符串
  80. //DebugInfo = string.Join(",", formattedBytes);
  81. //DebugInfo = string.Join(",", resultModel.DebugInfoBytes.Select(b => b.ToString())); // 默认是十进制
  82. // 使用 LINQ 进行转换和条件判断
  83. var formattedBytes = resultModel.DebugInfoBytes.Select(b => b == 88 ? "" : b.ToString());
  84. DebugInfo = string.Join(",", formattedBytes);
  85. }
  86. /////////////////////////////////////////////////////////
  87. }
  88. }