BoatElevatorParametersViewModel.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using FurnaceUI.Models;
  8. namespace FurnaceUI.Views.Operations
  9. {
  10. public class BoatElevatorParametersViewModel : FurnaceUIViewModelBase
  11. {
  12. public int point1Count { get; set; }
  13. public int point2Count { get; set; }
  14. public int point3Count { get; set; }
  15. public int point4Count { get; set; }
  16. public int point5Count { get; set; }
  17. public int point6Count { get; set; }
  18. private bool _RecipeControl1;
  19. public bool RecipeControl1
  20. {
  21. get => _RecipeControl1;
  22. set
  23. {
  24. _RecipeControl1 = value;
  25. NotifyOfPropertyChange("RecipeControl1");
  26. }
  27. }
  28. private bool _RecipeControl2;
  29. public bool RecipeControl2
  30. {
  31. get => _RecipeControl2;
  32. set
  33. {
  34. _RecipeControl2 = value;
  35. NotifyOfPropertyChange("RecipeControl2");
  36. }
  37. }
  38. private bool _RecipeControl3;
  39. public bool RecipeControl3
  40. {
  41. get => _RecipeControl3;
  42. set
  43. {
  44. _RecipeControl3 = value;
  45. NotifyOfPropertyChange("RecipeControl3");
  46. }
  47. }
  48. private bool _RecipeControl4;
  49. public bool RecipeControl4
  50. {
  51. get => _RecipeControl4;
  52. set
  53. {
  54. _RecipeControl4 = value;
  55. NotifyOfPropertyChange("RecipeControl4");
  56. }
  57. }
  58. private bool _RecipeControl5;
  59. public bool RecipeControl5
  60. {
  61. get => _RecipeControl5;
  62. set
  63. {
  64. _RecipeControl5 = value;
  65. NotifyOfPropertyChange("RecipeControl5");
  66. }
  67. }
  68. private bool _RecipeControl6;
  69. public bool RecipeControl6
  70. {
  71. get => _RecipeControl6;
  72. set
  73. {
  74. _RecipeControl6 = value;
  75. NotifyOfPropertyChange("RecipeControl6");
  76. }
  77. }
  78. public void RecipeControlCheck(string value)
  79. {
  80. switch (value)
  81. {
  82. case "1":
  83. point1Count++;
  84. if (point1Count % 2 == 0)
  85. RecipeControl1 = false;
  86. else
  87. RecipeControl1 = true;
  88. break;
  89. case "2":
  90. point2Count++;
  91. if (point2Count % 2 == 0)
  92. RecipeControl2 = false;
  93. else
  94. RecipeControl2 = true;
  95. break;
  96. case "3":
  97. point3Count++;
  98. if (point3Count % 2 == 0)
  99. RecipeControl3 = false;
  100. else
  101. RecipeControl3 = true;
  102. break;
  103. case "4":
  104. point4Count++;
  105. if (point4Count % 2 == 0)
  106. RecipeControl4 = false;
  107. else
  108. RecipeControl4 = true;
  109. break;
  110. case "5":
  111. point5Count++;
  112. if (point5Count % 2 == 0)
  113. RecipeControl5 = false;
  114. else
  115. RecipeControl5 = true;
  116. break;
  117. case "6":
  118. point6Count++;
  119. if (point6Count % 2 == 0)
  120. RecipeControl6 = false;
  121. else
  122. RecipeControl6 = true;
  123. break;
  124. default:
  125. break;
  126. }
  127. }
  128. public void Close()
  129. {
  130. ((Window)GetView())?.Close();
  131. }
  132. }
  133. }