Yield.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using Prism.Mvvm;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace TeamAAS_VP.Models
  8. {
  9. public class Yield : BindableBase
  10. {
  11. private int _OK;
  12. public int OK
  13. {
  14. get { return _OK; }
  15. set { SetProperty(ref _OK,value); Update(); }
  16. }
  17. private int _NG;
  18. public int NG
  19. {
  20. get { return _NG; }
  21. set { SetProperty(ref _NG, value); Update(); }
  22. }
  23. private int _Throw;
  24. public int Throw
  25. {
  26. get { return _Throw; }
  27. set { SetProperty(ref _Throw, value); }
  28. }
  29. private int _Total;
  30. public int Total
  31. {
  32. get { return _Total; }
  33. set { SetProperty(ref _Total, value); }
  34. }
  35. private double _Ratio;
  36. public double Ratio
  37. {
  38. get { return _Ratio; }
  39. set { SetProperty(ref _Ratio, value); }
  40. }
  41. private void Update()
  42. {
  43. Total = _OK + _NG;
  44. Ratio = (double)_OK / (double)(Total);
  45. }
  46. }
  47. }