终端一体化运控平台
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.
 
 
 

43 lines
1.5 KiB

  1. using BPA.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<RecipeData> Recipes { get; set; } = new ObservableCollection<RecipeData>();
  16. public ObservableCollection<RawMaterial> RawMaterials { get; set; } = new ObservableCollection<RawMaterial>();
  17. public TestData()
  18. {
  19. for (int i = 0; i < 5; i++)
  20. {
  21. for (int j = 0; j < 10; i++)
  22. {
  23. RawMaterials.Add(new RawMaterial()
  24. {
  25. DeviceIp = RawMaterials.Count + 1,
  26. RawMaterialWeight = new Random().Next(),
  27. RawMaterialBarrelNum = j,
  28. RawMaterialLocation = j
  29. });
  30. }
  31. Recipes.Add(new Model.RecipeData()
  32. {
  33. RecipeName = "配方" + i,
  34. RecipeCode = new Random().Next(1000,9999) + "",
  35. TrayCode = new Random().Next(1,3),
  36. RawMaterial = RawMaterials
  37. });
  38. }
  39. }
  40. }
  41. }