ProductionBoard.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Prism.Commands;
  2. namespace SKMC.Api.Product.Record
  3. {
  4. /// <summary>
  5. /// 简单的生产数据统计工具
  6. /// </summary>
  7. public class ProductionBoard
  8. {
  9. private static ProductionBoard instance;
  10. public DelegateCommand ClearDataCommand { get; set; }
  11. private ProductionBoard()
  12. {
  13. ClearDataCommand = new DelegateCommand(() => Clear());
  14. }
  15. public static ProductionBoard Instance()
  16. {
  17. if (instance == null) instance = new ProductionBoard();
  18. return instance;
  19. }
  20. public ProductionRecord ProductionRecord { get; set; } = new ProductionRecord();
  21. /// <summary>
  22. /// 清空生产统计数据
  23. /// </summary>
  24. public void Clear()
  25. {
  26. ProductionRecord.ConsumeAll = 0;
  27. ProductionRecord.Total = 0;
  28. ProductionRecord.NumNG = 0;
  29. ProductionRecord.NumOK = 0;
  30. ProductionRecord.Yield = 0;
  31. ProductionRecord.Uph = 0;
  32. }
  33. }
  34. }