public override SIUnit Add(SIUnit x) { if(x is Area) return new Area(_value + x.Value); throw new UnitsException(GetType(), x.GetType()); }
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); }
public override dynamic Divide(SIUnit x) { if (x is Length) { return _value/x.Value; } throw new UnitsException(GetType(), x.GetType()); }
public override SIUnit Multiply(SIUnit x) { throw new NotImplementedException(); }
public override SIUnit Subtract(SIUnit x) { throw new NotImplementedException(); }
public override dynamic Divide(SIUnit x) { throw new NotImplementedException(); }
public override SIUnit Modulo(SIUnit x) { throw new NotImplementedException(); }
public abstract SIUnit Subtract(SIUnit x);
public static SIUnit Floor(SIUnit input) { return input.Floor(); }
public abstract SIUnit Add(SIUnit x);
public abstract SIUnit Modulo(SIUnit x);
public override SIUnit Multiply(SIUnit x) { throw new UnitsException(GetType(), x.GetType()); }
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()); }
public override SIUnit Modulo(SIUnit x) { if (x is Volume) { return new Volume(_value % x.Value); } throw new UnitsException(GetType(), x.GetType()); }
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()); }
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()); }
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(); }
public static SIUnit Round(SIUnit input) { return input.Round(); }
public abstract dynamic Divide(SIUnit x);
public override SIUnit Modulo(SIUnit x) { if(x is Length) return new Length(_value % x.Value); throw new UnitsException(GetType(), x.GetType()); }
public abstract SIUnit Multiply(SIUnit x);
public override SIUnit Multiply(SIUnit x) { if (x is Length) { return new Area(_value * x.Value); } throw new UnitsException(GetType(), x.GetType()); }
public override SIUnit Subtract(SIUnit x) { if(x is Length) return new Length(_value - x.Value); throw new UnitsException(GetType(), x.GetType()); }
public static SIUnit Ceiling(SIUnit input) { return input.Ceiling(); }