终端一体化运控平台
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

106 linhas
4.0 KiB

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