PlcParameterModel.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace MvvmScaffoldFrame48.Model.StorageModel.PlcParameter
  7. {
  8. public class PlcParameterModel
  9. {
  10. //public string Name { get; set; }
  11. /// <summary>
  12. /// 1:ValueBit
  13. /// 2:Int32
  14. /// 3:Double
  15. /// </summary>
  16. public int Type { get; set; } = -1;
  17. public int Length { get; set; } = 1;
  18. public int Address { get; set; }
  19. }
  20. public class PlcValueBitParameterModel: PlcParameterModel
  21. {
  22. public int bitAddress { get; set; }
  23. public PlcValueBitParameterModel(int Address,int bitAddress)
  24. {
  25. this.Type = 1;
  26. this.Address = Address;
  27. this.bitAddress = bitAddress;
  28. }
  29. }
  30. public class PlcInt32ParameterModel:PlcParameterModel
  31. {
  32. public int MaxValue { get; set; }
  33. public int MinValue { get; set; }
  34. public PlcInt32ParameterModel(int Address)
  35. {
  36. this.Type = 2;
  37. this.Address = Address;
  38. this.Length = 2;
  39. this.MaxValue = Int32.MaxValue;
  40. this.MinValue = Int32.MinValue;
  41. }
  42. public PlcInt32ParameterModel(int Address,int MaxValue,int MinValue)
  43. {
  44. this.Type = 2;
  45. this.Address = Address;
  46. this.Length = 2;
  47. this.MaxValue = MaxValue;
  48. this.MinValue = MinValue;
  49. }
  50. }
  51. public class PlcDouble64ParameterModel : PlcParameterModel
  52. {
  53. public double MaxValue { get; set; }
  54. public double MinValue { get; set; }
  55. public PlcDouble64ParameterModel(int Address)
  56. {
  57. this.Type = 3;
  58. this.Address = Address;
  59. this.Length = 4;
  60. this.MaxValue = double.MaxValue;
  61. this.MinValue = double.MinValue;
  62. }
  63. public PlcDouble64ParameterModel(int Address,double MaxValue,double MinValue)
  64. {
  65. this.Type = 3;
  66. this.Address = Address;
  67. this.Length = 4;
  68. this.MaxValue = double.MaxValue;
  69. this.MinValue = double.MinValue;
  70. }
  71. }
  72. }