终端一体化运控平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ConveyerBeltModel.cs 1.7 KiB

2 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using BPA.Helper;
  2. using BPASmartClient.CustomResource.Pages.Model;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace BPASmartClient.DosingSystemSingle
  9. {
  10. public class ConveyerBeltModel : NotifyBase
  11. {
  12. public string Name { get { return _mName; } set { _mName = value; OnPropertyChanged(); } }
  13. private string _mName;
  14. public int Num { get { return _mNum; } set { _mNum = value; OnPropertyChanged(); } }
  15. private int _mNum;
  16. public int Speed
  17. {
  18. get { return _mSpeed; }
  19. set
  20. {
  21. _mSpeed = value;
  22. SiemensDevice.GetInstance.MySiemens.Write($"DB4.DBW{Num * 2 + 132}", (short)value);
  23. //SiemensDevice.GetInstance.MySiemens.WriteInt16(4, (short)value, (Num * 2 + 132));
  24. MessageNotify.GetInstance.ShowRunLog($"DB4.DBW{Num * 2 + 132},{value}");
  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. MessageNotify.GetInstance.ShowRunLog($"{add},{value}");
  40. }
  41. OnPropertyChanged();
  42. }
  43. }
  44. private bool _mConveyerBeltWork;
  45. public bool Control { get; set; }
  46. }
  47. }