PlcAddress.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Prism.Mvvm;
  2. using System;
  3. namespace TeamAAS_VP.Models
  4. {
  5. /// <summary>
  6. /// Represent a PLC address entry mapping a variable name to its node/address string and type.
  7. /// </summary>
  8. public class PlcAddress : BindableBase
  9. {
  10. private string _Address;
  11. /// <summary>
  12. /// Address or node string used to access PLC (e.g. OP-UA node id or Modbus address)
  13. /// </summary>
  14. public string Address { get => _Address; set => SetProperty(ref _Address, value); }
  15. private string _DataType;
  16. /// <summary>
  17. /// Data type string (e.g. "Bool","Int32","Float","String")
  18. /// </summary>
  19. public string DataType { get => _DataType; set => SetProperty(ref _DataType, value); }
  20. private string _Description;
  21. public string Description { get => _Description; set => SetProperty(ref _Description, value); }
  22. public PlcAddress()
  23. {
  24. Address = string.Empty;
  25. DataType = "Float";
  26. Description = "PLCµØÖ·";
  27. }
  28. public PlcAddress(string address, string dataType, string description)
  29. {
  30. Address = address;
  31. DataType = dataType;
  32. Description = description;
  33. }
  34. }
  35. }