StepItem.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace EPD.Data
  8. {
  9. public class StepItem: NotifyObject
  10. {
  11. private string index;
  12. public string Index { get => index; set => Set(ref index, value, "Index"); }
  13. private bool running = false;
  14. public bool Running { get => running; set => Set(ref running, value, "Running"); }
  15. public string Name { get; set; }
  16. public int SelectedEndByIndex { get; set; }
  17. private List<string> configs;
  18. public List<string> Configs { get => configs; set => Set(ref configs, value, "Configs"); }
  19. public string SelectedConfig { get; set; }
  20. private double currentTime;
  21. public double CurrentTime { get => currentTime; set => Set(ref currentTime, value, "CurrentTime"); }
  22. public string MaxTime { get; set; }
  23. public string Time { get; set; }
  24. public bool ErrorIfNoEPD { get; set; }
  25. private int epdStatus;
  26. public int EPDStatus { get => epdStatus; set => Set(ref epdStatus, value, "EPDStatus"); }
  27. public StepItem(string name)
  28. {
  29. Name = name;
  30. SelectedEndByIndex = 0;
  31. MaxTime = "10";
  32. }
  33. public static void Sort(Collection<StepItem> items)
  34. {
  35. for (int i = 0; i < items.Count; i++)
  36. items[i].Index = $"Step {i + 1}";
  37. }
  38. public static void UpdateConfigs(Collection<StepItem> items, List<string> configs)
  39. {
  40. for (int i = 0; i < items.Count; i++)
  41. items[i].Configs = configs;
  42. }
  43. }
  44. }