| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using Prism.Mvvm;
- namespace SKMC.Api.Product.Record
- {
- /// <summary>
- /// 生产数据记录
- /// </summary>
- public class ProductionRecord : BindableBase
- {
- private int _total;
- public int Total
- {
- get { return _total; }
- set { _total = value; RaisePropertyChanged(); }
- }
- private long _consumeAll;
- public long ConsumeAll
- {
- get { return _consumeAll; }
- set { _consumeAll = value; }
- }
- private int _numOK;
- public int NumOK
- {
- get { return _numOK; }
- set { _numOK = value; RaisePropertyChanged(); }
- }
- private int _numNG;
- public int NumNG
- {
- get { return _numNG; }
- set { _numNG = value; RaisePropertyChanged(); }
- }
- private float _yield;
- public float Yield
- {
- get { return _yield; }
- set { _yield = value; RaisePropertyChanged(); }
- }
- public float GetYield() => (_numOK + _numNG == 0) ? 0 : (float)_numOK / (float)(_numOK + _numNG);
- private float _uph;
- public float Uph
- {
- get { return _uph; }
- set { _uph = value; RaisePropertyChanged(); }
- }
- public float GetUph() => (float)Total * 3600 / (float)(_consumeAll / 10000000);
- public override string ToString() => $"numOK: {NumOK}, numNG: {NumNG}, total: {Total}, yield: {Yield}, UPH: {Uph}";
- }
- }
|