TSingleDetail.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 TSingleDetail()
  29. {
  30. SingleDetailId = string.Empty;
  31. CreateTime = string.Empty;
  32. SrcImage = string.Empty;
  33. RunFlag = 0;
  34. RunTime = string.Empty;
  35. DstImage = string.Empty;
  36. MeterType = 0;
  37. DigitCount = 0;
  38. PointerCount = 0;
  39. LastUnit = string.Empty;
  40. ResultType = 0;
  41. RawValue = string.Empty;
  42. FinalValue = string.Empty;
  43. AiVer = string.Empty;
  44. DebugInfo = string.Empty;
  45. LogPath = string.Empty;
  46. Memo = string.Empty;
  47. }
  48. public TSingleDetail(SingleDetailItem singleDetail,ResultModel resultModel)
  49. {
  50. SingleDetailId = singleDetail.SingleDetailId;
  51. CreateTime = singleDetail.CreateTime;
  52. SrcImage = singleDetail.SrcImage;
  53. RunFlag = 1;
  54. RunTime = ThisApp.GetNowTime_yyyyMMddHHmmss();
  55. DstImage = resultModel.DstImage;
  56. MeterType = resultModel.MeterType;
  57. DigitCount = resultModel.DigitCount;
  58. PointerCount = resultModel.PointerCount;
  59. LastUnit = resultModel.SLastUnit;
  60. ResultType = resultModel.ResultType;
  61. RawValue = resultModel.SRawValue;
  62. FinalValue = resultModel.sFinalValue;
  63. AiVer = resultModel.AiVer;
  64. LogPath = resultModel.LogPath;
  65. // 使用 LINQ 进行转换和条件判断,并过滤掉空字符串
  66. //var formattedBytes = resultModel.DebugInfoBytes.Select(b => b == 88 ? "" : b.ToString())
  67. // .Where(s => !string.IsNullOrEmpty(s));
  68. // 使用 string.Join 将结果连接成逗号分割的字符串
  69. //DebugInfo = string.Join(",", formattedBytes);
  70. //DebugInfo = string.Join(",", resultModel.DebugInfoBytes.Select(b => b.ToString())); // 默认是十进制
  71. // 使用 LINQ 进行转换和条件判断
  72. var formattedBytes = resultModel.DebugInfoBytes.Select(b => b == 88 ? "" : b.ToString());
  73. DebugInfo = string.Join(",", formattedBytes);
  74. }
  75. /////////////////////////////////////////////////////////
  76. }
  77. }