MockData.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. using AmrControl.ADS;
  2. using AmrControl.Dto;
  3. using System.Text;
  4. namespace AmrControl.Common
  5. {
  6. /// <summary>
  7. /// 测试数据
  8. /// </summary>
  9. public class MockData
  10. {
  11. /// <summary>
  12. /// 车的初始化
  13. /// </summary>
  14. /// <returns></returns>
  15. public static List<JGR_Tc_Model> getJgrs()
  16. {
  17. List<JGR_Tc_Model> ls = new List<JGR_Tc_Model>();
  18. //todo:补上数据接口
  19. JGR_Tc_Model jGR_Tc_Model = new JGR_Tc_Model();
  20. jGR_Tc_Model.jgrSN = "JGR-23001";
  21. jGR_Tc_Model.jgrType = (byte)JgrType.StorageCar; //仓储车
  22. jGR_Tc_Model.jgrID = 001;
  23. jGR_Tc_Model.isOnline = 1;
  24. jGR_Tc_Model.currLocation_X = 3;
  25. jGR_Tc_Model.currLocation_Y = 2;
  26. jGR_Tc_Model.electricity = 80;
  27. jGR_Tc_Model.displayX = 38;
  28. jGR_Tc_Model.displayY = 2;
  29. ls.Add(jGR_Tc_Model);
  30. jGR_Tc_Model = new JGR_Tc_Model();
  31. jGR_Tc_Model.jgrSN = "JGR-23101";
  32. jGR_Tc_Model.rfid = "230105";
  33. jGR_Tc_Model.jgrType = (byte)JgrType.RailCar;//轨道车
  34. jGR_Tc_Model.jgrID = 002;
  35. jGR_Tc_Model.isOnline = 1;
  36. jGR_Tc_Model.currLocation_X = 2;
  37. jGR_Tc_Model.currLocation_Y = 1;
  38. jGR_Tc_Model.displayX = 2;
  39. jGR_Tc_Model.displayY = 2;
  40. jGR_Tc_Model.electricity = 30;
  41. ls.Add(jGR_Tc_Model);
  42. return ls;
  43. }
  44. /// <summary>
  45. /// 充电桩初始化
  46. /// </summary>
  47. /// <returns></returns>
  48. public static List<ChargingStationDataModel> getChargingStations()
  49. {
  50. List<ChargingStationDataModel> ls = new List<ChargingStationDataModel>();
  51. //todo:补上数据接口
  52. ChargingStationDataModel jGR_Tc_Model = new ChargingStationDataModel();
  53. jGR_Tc_Model.csSN = "JGP-23101";
  54. jGR_Tc_Model.csType = (byte)JgrType.StorageCharging; //仓储的充电器
  55. jGR_Tc_Model.csID = 001;
  56. jGR_Tc_Model.isOnline = 1;
  57. jGR_Tc_Model.positionX = 1;
  58. jGR_Tc_Model.positionX = 1;
  59. jGR_Tc_Model.displayX = 36;
  60. jGR_Tc_Model.displayY = 1;
  61. ls.Add(jGR_Tc_Model);
  62. jGR_Tc_Model = new ChargingStationDataModel();
  63. jGR_Tc_Model.csSN = "JGP-23102";
  64. jGR_Tc_Model.csType = (byte)JgrType.RailCharging; //轨道的充电器
  65. jGR_Tc_Model.csID = 002;
  66. jGR_Tc_Model.isOnline = 1;
  67. jGR_Tc_Model.positionX = 33;
  68. jGR_Tc_Model.positionY = 1;
  69. jGR_Tc_Model.displayX = 33;
  70. jGR_Tc_Model.displayY = 2;
  71. ls.Add(jGR_Tc_Model);
  72. return ls;
  73. }
  74. /// <summary>
  75. /// 工位的初始化
  76. /// </summary>
  77. /// <returns></returns>
  78. public static List<StationDataModel> getStations()
  79. {
  80. List<StationDataModel> ls = new List<StationDataModel>();
  81. //todo:补上数据接口
  82. StationDataModel station = new StationDataModel();
  83. station.stationID = "JGS-ZP-23201";
  84. station.stationType = StationType.WS_CWCS;
  85. station.displayName = "常温测试";
  86. station.userOnPosition = false;
  87. station.isPowerOn = true;
  88. station.positionX = 1;
  89. station.positionY = 5;
  90. station.displayX = 1;
  91. station.displayY = 5;
  92. station.taskCount = 8;
  93. station.finishedCount = 3;
  94. ls.Add(station);
  95. station = new StationDataModel();
  96. station.stationID = "JGS-SPTS-23202";
  97. station.stationType = StationType.WS_SPTS;
  98. station.displayName = "射频调试工位1";
  99. station.userOnPosition = false;
  100. station.isPowerOn = true;
  101. station.positionX = 4;
  102. station.positionY = 5;
  103. station.displayX = 4;
  104. station.displayY = 5;
  105. station.taskCount = 8;
  106. station.finishedCount = 3;
  107. ls.Add(station);
  108. station = new StationDataModel();
  109. station.stationID = "JGS-SPTS-23203";
  110. station.stationType = StationType.WS_SPTS;
  111. station.displayName = "射频调试工位2";
  112. station.userOnPosition = false;
  113. station.isPowerOn = true;
  114. station.positionX = 7;
  115. station.positionY = 5;
  116. station.displayX = 7;
  117. station.displayY = 5;
  118. station.taskCount = 8;
  119. station.finishedCount = 3;
  120. ls.Add(station);
  121. station = new StationDataModel();
  122. station.stationID = "JGS-ZP-23204";
  123. station.stationType = StationType.WS_ZP;
  124. station.displayName = "装配工位1";
  125. station.userOnPosition = false;
  126. station.isPowerOn = true;
  127. station.positionX = 10;
  128. station.positionY = 5;
  129. station.displayX = 10;
  130. station.displayY = 5;
  131. station.taskCount = 8;
  132. station.finishedCount = 3;
  133. ls.Add(station);
  134. station = new StationDataModel();
  135. station.stationID = "JGS-ZP-23205";
  136. station.stationType = StationType.WS_ZP;
  137. station.displayName = "装配工位2";
  138. station.userOnPosition = false;
  139. station.isPowerOn = true;
  140. station.positionX = 13;
  141. station.positionY = 5;
  142. station.displayX = 13;
  143. station.displayY = 5;
  144. station.taskCount = 8;
  145. station.finishedCount = 3;
  146. ls.Add(station);
  147. station = new StationDataModel();
  148. station.stationID = "JGS-ZP-23206";
  149. station.stationType = StationType.WS_ZP;
  150. station.displayName = "装配工位3";
  151. station.userOnPosition = false;
  152. station.isPowerOn = true;
  153. station.positionX = 16;
  154. station.positionY = 5;
  155. station.displayX = 16;
  156. station.displayY = 5;
  157. station.taskCount = 8;
  158. station.finishedCount = 3;
  159. ls.Add(station);
  160. station = new StationDataModel();
  161. station.stationID = "JGS-ZP-23207";
  162. station.stationType = StationType.WS_ZP;
  163. station.displayName = "装配工位4";
  164. station.userOnPosition = false;
  165. station.isPowerOn = true;
  166. station.positionX = 19;
  167. station.positionY = 5;
  168. station.displayX = 19;
  169. station.displayY = 5;
  170. station.taskCount = 8;
  171. station.finishedCount = 3;
  172. ls.Add(station);
  173. station = new StationDataModel();
  174. station.stationID = "JGS-YCL-23208";
  175. station.stationType = StationType.WS_YCL;
  176. station.displayName = "预处理工位1";
  177. station.userOnPosition = false;
  178. station.isPowerOn = true;
  179. station.positionX = 22;
  180. station.positionY = 5;
  181. station.displayX = 22;
  182. station.displayY = 5;
  183. station.taskCount = 8;
  184. station.finishedCount = 3;
  185. ls.Add(station);
  186. station = new StationDataModel();
  187. station.stationID = "JGS-CC-JL-23301";
  188. station.stationType = StationType.WS_CC_JL;
  189. station.displayName = "捡料工位";
  190. station.userOnPosition = false;
  191. station.isPowerOn = true;
  192. station.positionX = 26;
  193. station.positionY = 8;
  194. station.displayX = 26;
  195. station.displayY = 8;
  196. station.taskCount = 8;
  197. station.finishedCount = 3;
  198. ls.Add(station);
  199. station = new StationDataModel();
  200. station.stationID = "JGS-CC-PF-23302";
  201. station.stationType = StationType.WS_CC_PF;
  202. station.displayName = "派发工位";
  203. station.userOnPosition = false;
  204. station.isPowerOn = true;
  205. station.positionX = 27;
  206. station.positionY = 8;
  207. station.displayX = 27;
  208. station.displayY = 8;
  209. station.taskCount = 8;
  210. station.finishedCount = 3;
  211. ls.Add(station);
  212. return ls;
  213. }
  214. public static List<IssueNoteDto> getIssueNodeDto()
  215. {
  216. List<IssueNoteDto> issueNodeDtos = new List<IssueNoteDto>();
  217. IssueNoteDto node = new IssueNoteDto();
  218. node.StationID = "JGS-ZP-23207";
  219. node.ID = "ID230501";
  220. node.MesTaskID = "mesid230501";
  221. RequireRawBom bom = new RequireRawBom();
  222. bom.MaterialID = "pcba-i001";
  223. bom.MaterialType = "PCBA";
  224. bom.MaterialName = "PCBA板";
  225. bom.DemandQuantity = 2;
  226. bom.ReleaseQuantity = 0;
  227. node.RawBoms.Add(bom);
  228. bom = new RequireRawBom();
  229. bom.MaterialID = "j30j29k-i022";
  230. bom.MaterialName = "J30J-29K接头";
  231. bom.MaterialType = "J30J";
  232. bom.DemandQuantity = 5;
  233. bom.ReleaseQuantity = 0;
  234. node.RawBoms.Add(bom);
  235. issueNodeDtos.Add(node);
  236. return issueNodeDtos;
  237. }
  238. /// <summary>
  239. /// 根据物料号获取储位信息
  240. /// </summary>
  241. /// <param name="materialid"></param>
  242. /// <returns></returns>
  243. public static List<StorageBox> getStorageBox()
  244. {
  245. List<StorageBox> boxs = new List<StorageBox>();
  246. StorageBox storageBox = new StorageBox();
  247. storageBox.BoxRFID = "rfid001";
  248. storageBox.PositionX = 1;
  249. storageBox.PositionY = 1;
  250. storageBox.PositionZ = 1;
  251. RawBom bom = new RawBom();
  252. bom.MaterialID = "pcba-i001";
  253. bom.MaterialName = "PCBA板";
  254. bom.MaterialType = "PCBA";
  255. bom.Quantity = 10;
  256. storageBox.RawBoms.Add(bom);
  257. boxs.Add(storageBox);
  258. storageBox = new StorageBox();
  259. storageBox.BoxRFID = "rfid002";
  260. storageBox.PositionX = 2;
  261. storageBox.PositionY = 2;
  262. storageBox.PositionZ = 1;
  263. bom = new RawBom();
  264. bom.MaterialID = "j30j29k-i022";
  265. bom.MaterialName = "J30J-29K接头";
  266. bom.MaterialType = "J30J";
  267. bom.Quantity = 20;
  268. storageBox.RawBoms.Add(bom);
  269. boxs.Add(storageBox);
  270. return boxs;
  271. }
  272. public static List<StorageBox> getStorageBox(int x , int y)
  273. {
  274. List<StorageBox> boxs = new List<StorageBox>();
  275. StorageBox storageBox = new StorageBox();
  276. if(x ==1 && y==1)
  277. {
  278. storageBox.BoxRFID = "rfid001";
  279. storageBox.PositionX = 1;
  280. storageBox.PositionY = 1;
  281. storageBox.PositionZ = 1;
  282. RawBom bom = new RawBom();
  283. bom.MaterialID = "pcba-i001";
  284. bom.MaterialName = "PCBA板";
  285. bom.MaterialType = "PCBA";
  286. bom.Quantity = 10;
  287. storageBox.RawBoms.Add(bom);
  288. boxs.Add(storageBox);
  289. }
  290. else if(x == 2 && y == 2)
  291. {
  292. storageBox = new StorageBox();
  293. storageBox.BoxRFID = "rfid002";
  294. storageBox.PositionX = 2;
  295. storageBox.PositionY = 2;
  296. storageBox.PositionZ = 1;
  297. RawBom bom = new RawBom();
  298. bom.MaterialID = "j30j29k-i022";
  299. bom.MaterialName = "J30J-29K接头";
  300. bom.MaterialType = "J30J";
  301. bom.Quantity = 20;
  302. storageBox.RawBoms.Add(bom);
  303. boxs.Add(storageBox);
  304. }
  305. return boxs;
  306. }
  307. }
  308. }