예제 #1
0
        public static void AddPlainEnumProprety(Driver driver, byte no, string propertyName, byte offset, string parameter1Name, string parameter2Name, int startValue = 0,
			int minBit = 0, int maxBit = 0, bool useMask = false, bool highByte = false, bool mptHighByte = false, bool mptLowByte = false)
        {
            var property = new DriverProperty()
            {
                IsAUParameter = true,
                No = no,
                Name = propertyName,
                Caption = propertyName,
                Default = "0",
                BitOffset = offset,
                MinBit = minBit,
                MaxBit = maxBit,
                UseMask = useMask,
                HighByte = highByte,
                MptHighByte = mptHighByte,
                MptLowByte = mptLowByte
            };
            var parameter1 = new DriverPropertyParameter()
            {
                Name = parameter1Name,
                Value = startValue.ToString()
            };
            var parameter2 = new DriverPropertyParameter()
            {
                Name = parameter2Name,
                Value = (startValue + 1).ToString()
            };
            property.Parameters.Add(parameter1);
            property.Parameters.Add(parameter2);
            driver.Properties.Add(property);
        }
예제 #2
0
 public static void AddPropertyParameter(DriverProperty property, string name, int value)
 {
     var parameter = new DriverPropertyParameter()
     {
         Name = name,
         Value = value.ToString(),
     };
     property.Parameters.Add(parameter);
 }