BgSfisConfig.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using Prism.Mvvm;
  2. using System;
  3. using TeamAAS_VP.Core.PLCs;
  4. using TeamAAS_VP.Core.Sfis;
  5. namespace TeamAAS_VP.Models
  6. {
  7. public class BgSfisConfig : BindableBase
  8. {
  9. private bool _IsEnabled;
  10. public bool IsEnabled
  11. {
  12. get { return _IsEnabled; }
  13. set { SetProperty(ref _IsEnabled, value); }
  14. }
  15. private bool _DryRun = true;
  16. public bool DryRun
  17. {
  18. get { return _DryRun; }
  19. set { SetProperty(ref _DryRun, value); }
  20. }
  21. public string ServiceUrl { get; set; } = string.Empty;
  22. public string SoapNamespace { get; set; } = "http://tempuri.org/";
  23. public string ProgramId { get; set; } = string.Empty;
  24. public string ProgramPassword { get; set; } = string.Empty;
  25. public string Device { get; set; } = "780546";
  26. public string OperatorId { get; set; } = string.Empty;
  27. public string OperatorPassword { get; set; } = string.Empty;
  28. public string TspName { get; set; } = "TeamAAS-VP";
  29. private bool _PassEnabled = true;
  30. public bool PassEnabled
  31. {
  32. get { return _PassEnabled; }
  33. set { SetProperty(ref _PassEnabled, value); }
  34. }
  35. private bool _UploadEnabled;
  36. public bool UploadEnabled
  37. {
  38. get { return _UploadEnabled; }
  39. set { SetProperty(ref _UploadEnabled, value); }
  40. }
  41. public string PlcSfisPassSignalDevice { get; set; } = "M104";
  42. public string PlcSfisUploadSignalDevice { get; set; } = "M105";
  43. public string PlcSfisPassOkBitDevice { get; set; } = "M106";
  44. public string PlcSfisPassNgBitDevice { get; set; } = "M107";
  45. public string PlcSfisPassReceiveBitDevice { get; set; } = "M108";
  46. public string PlcSfisUploadOkBitDevice { get; set; } = "M109";
  47. public string PlcSfisUploadNgBitDevice { get; set; } = "M110";
  48. public string PlcSfisUploadReceiveBitDevice { get; set; } = "M111";
  49. public int CheckRouteType { get; set; } = 1;
  50. public string GetVersionType { get; set; } = "1";
  51. public string GetVersionChkData { get; set; }
  52. public string GetVersionChkData2 { get; set; }
  53. public int ResultStatus { get; set; } = 1;
  54. public string InputDataPassType { get; set; } = "EF-MO_WEB";
  55. public string InputDataAoiLocTag { get; set; } = "EF-AOILOC-0";
  56. public int InputDataType { get; set; } = 1;
  57. public string DefaultMoNumber { get; set; } = string.Empty;
  58. public int TimeoutMs { get; set; } = 30000;
  59. public bool AutoLogin { get; set; } = true;
  60. public bool AutoLogoutOnExit { get; set; } = true;
  61. public SfisConfig ToSfisConfig()
  62. {
  63. return new SfisConfig
  64. {
  65. Enabled = IsEnabled,
  66. DryRun = DryRun,
  67. ServiceUrl = ServiceUrl ?? string.Empty,
  68. SoapNamespace = SoapNamespace ?? "http://tempuri.org/",
  69. ProgramId = ProgramId ?? string.Empty,
  70. ProgramPassword = ProgramPassword ?? string.Empty,
  71. Device = Device ?? string.Empty,
  72. OperatorId = OperatorId ?? string.Empty,
  73. OperatorPassword = OperatorPassword ?? string.Empty,
  74. TspName = TspName ?? "TeamAAS-VP",
  75. PassEnabled = PassEnabled,
  76. UploadEnabled = UploadEnabled,
  77. CheckRouteType = CheckRouteType,
  78. GetVersionType = GetVersionType ?? "1",
  79. GetVersionChkData = GetVersionChkData,
  80. GetVersionChkData2 = GetVersionChkData2,
  81. ResultStatus = ResultStatus,
  82. InputDataPassType = InputDataPassType ?? "EF-MO_WEB",
  83. InputDataAoiLocTag = InputDataAoiLocTag ?? "EF-AOILOC-0",
  84. InputDataType = InputDataType,
  85. DefaultMoNumber = DefaultMoNumber,
  86. TimeoutMs = TimeoutMs,
  87. AutoLogin = AutoLogin,
  88. AutoLogoutOnExit = AutoLogoutOnExit
  89. };
  90. }
  91. public PlcSfisFeedback ToPlcSfisFeedback()
  92. {
  93. return new PlcSfisFeedback
  94. {
  95. PassOkBitDevice = PlcSfisPassOkBitDevice,
  96. PassNgBitDevice = PlcSfisPassNgBitDevice,
  97. PassReceiveBitDevice = PlcSfisPassReceiveBitDevice,
  98. UploadOkBitDevice = PlcSfisUploadOkBitDevice,
  99. UploadNgBitDevice = PlcSfisUploadNgBitDevice,
  100. UploadReceiveBitDevice = PlcSfisUploadReceiveBitDevice
  101. };
  102. }
  103. }
  104. }