You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

117 lines
3.5 KiB

  1. using HBLDevice.ICChip;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace HBLConsole.MORKIC
  8. {
  9. internal enum GOODS_TYPE
  10. {
  11. NEITHER,
  12. COFFEE,
  13. ICECREAM,
  14. }
  15. internal enum BATCHING_CLASS
  16. {
  17. HOLDER,
  18. MAIN_MATERIAL,
  19. }
  20. internal class PolymerBatching
  21. {
  22. internal const string ICE_MAIN_BATCHIN1_LOC = "52";
  23. internal const string ICE_MAIN_BATCHIN2_LOC = "53";
  24. internal const string ICE_MAIN_BATCHIN3_LOC = "54";
  25. public static Dictionary<string, GOODS_TYPE> GOODS_TYPES = new Dictionary<string, GOODS_TYPE>() {
  26. {"1", GOODS_TYPE.COFFEE},
  27. {"2", GOODS_TYPE.COFFEE},
  28. {"3", GOODS_TYPE.COFFEE},
  29. {"4", GOODS_TYPE.COFFEE},
  30. {"5", GOODS_TYPE.COFFEE},
  31. {"6", GOODS_TYPE.COFFEE},
  32. {"7", GOODS_TYPE.COFFEE},
  33. {"8", GOODS_TYPE.COFFEE},
  34. {"9", GOODS_TYPE.COFFEE},
  35. {"10",GOODS_TYPE.COFFEE},
  36. {"11",GOODS_TYPE.COFFEE},
  37. {"12",GOODS_TYPE.COFFEE},
  38. {"13",GOODS_TYPE.COFFEE},
  39. {"14",GOODS_TYPE.COFFEE},
  40. {"15",GOODS_TYPE.COFFEE},
  41. {"16",GOODS_TYPE.COFFEE},
  42. {"17",GOODS_TYPE.COFFEE},
  43. {"18",GOODS_TYPE.COFFEE},
  44. {"19",GOODS_TYPE.COFFEE},
  45. {"20",GOODS_TYPE.COFFEE},
  46. {"21",GOODS_TYPE.COFFEE},
  47. {"22",GOODS_TYPE.COFFEE},
  48. {"23",GOODS_TYPE.COFFEE},
  49. {"24",GOODS_TYPE.COFFEE},
  50. {"25",GOODS_TYPE.COFFEE},
  51. {"30",GOODS_TYPE.COFFEE},
  52. {"51",GOODS_TYPE.ICECREAM},
  53. {ICE_MAIN_BATCHIN1_LOC,GOODS_TYPE.ICECREAM},
  54. {ICE_MAIN_BATCHIN2_LOC,GOODS_TYPE.ICECREAM},
  55. {ICE_MAIN_BATCHIN3_LOC,GOODS_TYPE.ICECREAM},
  56. };
  57. public GOODS_TYPE GoodsType { get; set; }
  58. public BATCHING_CLASS BatchingClass { get; set; }
  59. private string loc;
  60. public string Loc
  61. {
  62. get { return loc; }
  63. set
  64. {
  65. loc = value;
  66. if (GOODS_TYPES.ContainsKey(loc))
  67. GoodsType = GOODS_TYPES[loc];
  68. switch (loc)
  69. {
  70. case "30":
  71. case "51":
  72. case "52":
  73. BatchingClass = BATCHING_CLASS.HOLDER;
  74. break;
  75. default:
  76. BatchingClass = BATCHING_CLASS.MAIN_MATERIAL;
  77. break;
  78. }
  79. }
  80. }
  81. internal static Dictionary<string, PolymerBatching> BuildAll()
  82. {
  83. Dictionary<string, PolymerBatching> temp = new Dictionary<string, PolymerBatching>();
  84. foreach (var item in GOODS_TYPES)
  85. {
  86. temp.Add(item.Key, new PolymerBatching() { Loc = item.Key });
  87. }
  88. return temp;
  89. }
  90. internal static IC_SE GetIceCreamSE(string loc,out int sence)
  91. {
  92. switch (loc)
  93. {
  94. case ICE_MAIN_BATCHIN1_LOC:
  95. sence = 10008;
  96. return IC_SE.SE_1;
  97. case ICE_MAIN_BATCHIN2_LOC:
  98. sence = 10013;
  99. return IC_SE.SE_3;
  100. case ICE_MAIN_BATCHIN3_LOC:
  101. sence = 10009;
  102. return IC_SE.SE_2;
  103. default:
  104. sence = 10011;
  105. return IC_SE.SE_2;
  106. }
  107. }
  108. }
  109. }