| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace MvvmScaffoldFrame48.Model.StorageModel.PlcParameter
- {
- public enum PlcDataType
- {
- None = 0,
- ValueBit = 1,
- Int32 = 2,
- Double = 3
- }
- public class PlcParameterModel
- {
- //public string Name { get; set; }
- /// <summary>
- /// 1:ValueBit
- /// 2:Int32
- /// 3:Double
- /// </summary>
- public PlcDataType Type { get; set; } = PlcDataType.None;
- public int Length { get; set; } = 1;
- public int Address { get; set; }
- }
- public class PlcValueBitParameterModel: PlcParameterModel
- {
- public int bitAddress { get; set; }
- public PlcValueBitParameterModel(int Address,int bitAddress)
- {
- this.Type = PlcDataType.ValueBit;
- this.Address = Address;
- this.bitAddress = bitAddress;
- }
- }
- public class PlcInt32ParameterModel:PlcParameterModel
- {
- public int MaxValue { get; set; }
- public int MinValue { get; set; }
- public PlcInt32ParameterModel(int Address)
- {
- this.Type = PlcDataType.Int32;
- this.Address = Address;
- this.Length = 2;
- this.MaxValue = Int32.MaxValue;
- this.MinValue = Int32.MinValue;
- }
- public PlcInt32ParameterModel(int Address,int MaxValue,int MinValue)
- {
- this.Type = PlcDataType.Int32;
- this.Address = Address;
- this.Length = 2;
- this.MaxValue = MaxValue;
- this.MinValue = MinValue;
- }
- }
- public class PlcDouble64ParameterModel : PlcParameterModel
- {
- public double MaxValue { get; set; }
- public double MinValue { get; set; }
- public PlcDouble64ParameterModel(int Address)
- {
- this.Type = PlcDataType.Double;
- this.Address = Address;
- this.Length = 4;
- this.MaxValue = double.MaxValue;
- this.MinValue = double.MinValue;
- }
- public PlcDouble64ParameterModel(int Address,double MaxValue,double MinValue)
- {
- this.Type = PlcDataType.Double;
- this.Address = Address;
- this.Length = 4;
- this.MaxValue = MaxValue;
- this.MinValue = MinValue;
- }
- }
- }
|