终端一体化运控平台
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

113 lignes
4.2 KiB

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