终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

55 行
1.7 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Microsoft.Toolkit.Mvvm.ComponentModel;
  7. namespace BPASmartClient.Device
  8. {
  9. public class VariableMonitor : ObservableObject
  10. {
  11. public int Id { get { return _mId; } set { _mId = value; OnPropertyChanged(); } }
  12. private int _mId;
  13. public string VarName { get { return _mVarName; } set { _mVarName = value; OnPropertyChanged(); } }
  14. private string _mVarName;
  15. public string PLCAddress { get { return _mPLCAddress; } set { _mPLCAddress = value; OnPropertyChanged(); } }
  16. private string _mPLCAddress;
  17. public string Notes { get { return _mNotes; } set { _mNotes = value; OnPropertyChanged(); } }
  18. private string _mNotes;
  19. public string ModbusTcpAddress { get { return _mModbusTcpAddress; } set { _mModbusTcpAddress = value; OnPropertyChanged(); } }
  20. private string _mModbusTcpAddress;
  21. public string CurrentValue
  22. {
  23. get { return _mCurrentValue; }
  24. set
  25. {
  26. _mCurrentValue = value;
  27. OnPropertyChanged();
  28. if (_mCurrentValue == "False" || _mCurrentValue == "True")
  29. {
  30. if (_mCurrentValue == "True")
  31. StatusColor = new { r = 51, g = 232, b = 34, a = 1 };
  32. else
  33. StatusColor = new { r = 255, g = 0, b = 0, a = 1 };
  34. }
  35. else
  36. StatusColor = new { r = 51, g = 232, b = 34, a = 1 };
  37. }
  38. }
  39. private string _mCurrentValue;
  40. public object StatusColor { get; set; }
  41. }
  42. }