TSingleDetail.cs 4.3 KB

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