Beispiel #1
0
        public void QUShortTest1()
        {
            qushort qs = new qushort("4.8", 0.5);
            Assert.AreEqual(4, qs.IntegerBitCount);
            Assert.AreEqual(8, qs.FractionalBitCount);
            Assert.AreEqual(0.5, qs.Value);
            Assert.AreEqual(128, qs.RawValue);

            qs.Value = 9.375;
            Assert.AreEqual(9.375, qs.Value);
            Assert.AreEqual(2400, qs.RawValue);

            qs.Value = 0.50000001;
            Assert.AreEqual(0.5, qs.Value);
        }
Beispiel #2
0
        public TileDescriptor(byte tileNum)
        {
            On = false;

            Tile = tileNum;

            ULS = new qushort("10.2", 0);
            ULT = new qushort("10.2", 0);
            LRS = new qushort("10.2", 0);
            LRT = new qushort("10.2", 0);
        }
Beispiel #3
0
 public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
 {
     if (destinationType == typeof(string) && value.GetType() == typeof(qushort))
     {
         QUShort = (qushort)value;
         return QUShort.Value.ToString();
     }
     else
     {
         return base.ConvertTo(context, culture, value, destinationType);
     }
 }