终端一体化运控平台
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.
 
 
 

53 regels
1.4 KiB

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