终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

50 lines
1.5 KiB

  1. using BPA.Helper;
  2. using BPASmartClient.CustomResource.Pages.Model;
  3. namespace BPASmartClient.DosingSystem
  4. {
  5. public class ConveyerBeltModel : NotifyBase
  6. {
  7. public string Name { get { return _mName; } set { _mName = value; OnPropertyChanged(); } }
  8. private string _mName;
  9. public int Num { get { return _mNum; } set { _mNum = value; OnPropertyChanged(); } }
  10. private int _mNum;
  11. public int Speed
  12. {
  13. get { return _mSpeed; }
  14. set
  15. {
  16. _mSpeed = value;
  17. SiemensDevice.GetInstance.MySiemens.Write($"DB4.DBW{Num * 2 + 132}", (short)value);
  18. //SiemensDevice.GetInstance.MySiemens.WriteInt16(4, (short)value, (Num * 2 + 132));
  19. MessageNotify.GetInstance.ShowRunLog($"DB4.DBW{Num * 2 + 132},{value}");
  20. OnPropertyChanged();
  21. }
  22. }
  23. private int _mSpeed;
  24. public bool ConveyerBeltWork
  25. {
  26. get { return _mConveyerBeltWork; }
  27. set
  28. {
  29. _mConveyerBeltWork = value;
  30. if (Num >= 1 && Num <= 32)
  31. {
  32. var add = SiemensDevice.GetInstance.GetSiemensBitSingleAdd("DB5.DBX", Num, 6);
  33. SiemensDevice.GetInstance.MySiemens.Write(add, value);
  34. MessageNotify.GetInstance.ShowRunLog($"{add},{value}");
  35. }
  36. OnPropertyChanged();
  37. }
  38. }
  39. private bool _mConveyerBeltWork;
  40. public bool Control { get; set; }
  41. }
  42. }