终端一体化运控平台
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

112 Zeilen
4.1 KiB

  1. using BPASmartClient.Helper;
  2. using BPASmartClient.JXJFoodBigStation.Model.Siemens;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Collections.ObjectModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace BPASmartClient.JXJFoodBigStation.Model
  10. {
  11. public class TestData
  12. {
  13. public volatile static TestData Instance;
  14. public static TestData GetInstance => Instance ?? (Instance = new TestData());
  15. public ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();
  16. public TestData()
  17. {
  18. string recipeName = "配方1";
  19. long recipeCode = 10001;
  20. int Traycode = 1;
  21. double RawmaterialWeight = 10;
  22. int RawMaterialbarrelNum = 1;
  23. int RawMaterialLocation = 5;
  24. double RawmaterialWeight1 = 20;
  25. int RawMaterialbarrelNum1 = 2;
  26. int RawMaterialLocation1 = 7;
  27. double RawmaterialWeight2 = 30;
  28. int RawMaterialbarrelNum2 = 3;
  29. int RawMaterialLocation2 = 9;
  30. RawMaterials.Add(new RemoteRecipeRawMaterial()
  31. {
  32. DeviceIp = RawMaterials.Count + 1,
  33. RawMaterialWeight = RawmaterialWeight,
  34. RawMaterialBarrelNum = RawMaterialbarrelNum,
  35. RawMaterialLocation = RawMaterialLocation
  36. });
  37. RawMaterials.Add(new RemoteRecipeRawMaterial()
  38. {
  39. DeviceIp = RawMaterials.Count + 1,
  40. RawMaterialWeight = RawmaterialWeight1,
  41. RawMaterialBarrelNum = RawMaterialbarrelNum1,
  42. RawMaterialLocation = RawMaterialLocation1
  43. });
  44. RawMaterials.Add(new RemoteRecipeRawMaterial()
  45. {
  46. DeviceIp = RawMaterials.Count + 1,
  47. RawMaterialWeight = RawmaterialWeight2,
  48. RawMaterialBarrelNum = RawMaterialbarrelNum2,
  49. RawMaterialLocation = RawMaterialLocation2
  50. });
  51. Json<RemoteRecipeDataColl>.Data.Recipes.Add(new Model.RemoteRecipeData()
  52. {
  53. RecipeName = recipeName,
  54. RecipeCode = recipeCode,
  55. TrayCode = Traycode,
  56. RawMaterial = RawMaterials
  57. });
  58. RawMaterials.Clear();
  59. string recipeName_2 = "配方2";
  60. long recipeCode_2 = 20001;
  61. int Traycode_2 = 3;
  62. double RawmaterialWeight_2 = 10;
  63. int RawMaterialbarrelNum_2 = 1;
  64. int RawMaterialLocation_2 = 5;
  65. double RawmaterialWeight1_2 = 20;
  66. int RawMaterialbarrelNum1_2 = 2;
  67. int RawMaterialLocation1_2 = 7;
  68. double RawmaterialWeight2_2 = 30;
  69. int RawMaterialbarrelNum2_2 = 3;
  70. int RawMaterialLocation2_2 = 9;
  71. RawMaterials.Add(new RemoteRecipeRawMaterial()
  72. {
  73. DeviceIp = RawMaterials.Count + 1,
  74. RawMaterialWeight = RawmaterialWeight_2,
  75. RawMaterialBarrelNum = RawMaterialbarrelNum_2,
  76. RawMaterialLocation = RawMaterialLocation_2
  77. });
  78. RawMaterials.Add(new RemoteRecipeRawMaterial()
  79. {
  80. DeviceIp = RawMaterials.Count + 1,
  81. RawMaterialWeight = RawmaterialWeight1_2,
  82. RawMaterialBarrelNum = RawMaterialbarrelNum1_2,
  83. RawMaterialLocation = RawMaterialLocation1_2
  84. });
  85. RawMaterials.Add(new RemoteRecipeRawMaterial()
  86. {
  87. DeviceIp = RawMaterials.Count + 1,
  88. RawMaterialWeight = RawmaterialWeight2_2,
  89. RawMaterialBarrelNum = RawMaterialbarrelNum2_2,
  90. RawMaterialLocation = RawMaterialLocation2_2
  91. });
  92. Json<RemoteRecipeDataColl>.Data.Recipes.Add(new Model.RemoteRecipeData()
  93. {
  94. RecipeName = recipeName_2,
  95. RecipeCode = recipeCode_2,
  96. TrayCode = Traycode_2,
  97. RawMaterial = RawMaterials
  98. });
  99. }
  100. }
  101. }