예제 #1
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
        public override SIUnit Add(SIUnit x)
        {
            if(x is Area)
                return new Area(_value + x.Value);

            throw new UnitsException(GetType(), x.GetType());
        }
예제 #2
0
        internal WatchItem ProcessThing(SIUnit unit, string tag, bool showRawData = true)
        {
            if (showRawData)
                return new WatchItem(unit.Value.ToString(dynSettings.Controller.PreferenceSettings.NumberFormat, CultureInfo.InvariantCulture), tag);

            return new WatchItem(unit.ToString(), tag);
        }
예제 #3
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
        public override dynamic Divide(SIUnit x)
        {
            if (x is Length)
            {
                return _value/x.Value;
            }

            throw new UnitsException(GetType(), x.GetType());
        }
예제 #4
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
 public override SIUnit Multiply(SIUnit x)
 {
     throw new NotImplementedException();
 }
예제 #5
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
 public override SIUnit Subtract(SIUnit x)
 {
     throw new NotImplementedException();
 }
예제 #6
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
 public override dynamic Divide(SIUnit x)
 {
     throw new NotImplementedException();
 }
예제 #7
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
 public override SIUnit Modulo(SIUnit x)
 {
     throw new NotImplementedException();
 }
예제 #8
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
 public abstract SIUnit Subtract(SIUnit x);
예제 #9
0
 public static SIUnit Floor(SIUnit input)
 {
     return input.Floor();
 }
예제 #10
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
 public abstract SIUnit Add(SIUnit x);
예제 #11
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
 public abstract SIUnit Modulo(SIUnit x);
예제 #12
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
 public override SIUnit Multiply(SIUnit x)
 {
     throw new UnitsException(GetType(), x.GetType());
 }
예제 #13
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
        public override SIUnit Multiply(SIUnit x)
        {
            if (x is Length)
            {
                //return a volume
                return new Volume(_value * x.Value);
            }

            throw new UnitsException(GetType(), x.GetType());
        }
예제 #14
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
        public override SIUnit Modulo(SIUnit x)
        {
            if (x is Volume)
            {
                return new Volume(_value % x.Value);
            }

            throw new UnitsException(GetType(), x.GetType());
        }
예제 #15
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
        public override dynamic Divide(SIUnit x)
        {
            if (x is Length)
            {
                return new Area(_value/x.Value);
            }
            else if (x is Area)
            {
                return new Length(_value/x.Value);
            }

            throw new UnitsException(GetType(), x.GetType());
        }
예제 #16
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
        public override dynamic Divide(SIUnit x)
        {
            if (x is Area)
            {
                //return a double
                return _value/x.Value;
            }

            if (x is Length)
            {
                //return length
                return new Length(_value/x.Value);
            }

            throw new UnitsException(GetType(), x.GetType());
        }
예제 #17
0
 protected UnitFromNumberBase()
 {
     _measure = new Units.Length(0.0);
     InPortData.Add(new PortData("value", "A number to be converted to a unit.", typeof(FScheme.Value.Number)));
     OutPortData.Add(new PortData("unit", "The unit. Stored internally as SI units.", typeof(FScheme.Value.Container)));
     RegisterAllPorts();
 }
예제 #18
0
 public static SIUnit Round(SIUnit input)
 {
     return input.Round();
 }
예제 #19
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
 public abstract dynamic Divide(SIUnit x);
예제 #20
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
        public override SIUnit Modulo(SIUnit x)
        {
            if(x is Length)
                return new Length(_value % x.Value);

            throw new UnitsException(GetType(), x.GetType());
        }
예제 #21
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
 public abstract SIUnit Multiply(SIUnit x);
예제 #22
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
        public override SIUnit Multiply(SIUnit x)
        {
            if (x is Length)
            {
                return new Area(_value * x.Value);
            }

            throw new UnitsException(GetType(), x.GetType());
        }
예제 #23
0
파일: Units.cs 프로젝트: Zhengzi/Dynamo
        public override SIUnit Subtract(SIUnit x)
        {
            if(x is Length)
                return new Length(_value - x.Value);

            throw new UnitsException(GetType(), x.GetType());
        }
예제 #24
0
 public static SIUnit Ceiling(SIUnit input)
 {
     return input.Ceiling();
 }