Esempio n. 1
0
        public override string ToString()
        {
            //If we know the unit
            if (Unit.Symbol is object && Unit.Symbol != "")
            {
                return($"{ValueLocalUnit} {Unit}");
            }



            //Check if we have the unit in the list
            foreach (var item in PowerUnit.List())
            {
                //Debug.Print($"{this.Unit.GetTotalFactor()} == {item.Unit.GetTotalFactor()}");

                if (this.Unit.GetTotalFactor() == item.Unit.GetTotalFactor())
                {
                    return($"{As(Unit)} {item.Unit}");
                }
            }


            //Return unit in SI
            return($"{As(PowerUnit.SI)} {PowerUnit.SI.Unit}");
        }
Esempio n. 2
0
        public PowerUnit(PreFix SI, PowerUnit unit)
        {
            Name = "Power";
            Unit = unit.Unit.Copy();

            SetCombined(SI);
            SetNewSymbol(SI);
        }
Esempio n. 3
0
        public HeatTransferCoefficientUnit(PowerUnit power, AreaUnit area, TemperatureUnit temperature, string NewSymbol = "Empty", decimal correction = 1)
        {
            Name = "HeatTransferCoefficienth";
            Unit = power.Unit / (area.Unit * temperature.Unit);

            SetCombined(correction);
            SetNewSymbol(NewSymbol, $"{power}/{area}{temperature}");
        }
        public ThermalResistanceUnit(AreaUnit area, TemperatureUnit temperature, PowerUnit power, string NewSymbol = "Empty", decimal correction = 1)
        {
            Name = "ThermalResistanceh";
            Unit = (area.Unit * temperature.Unit) / power.Unit;

            SetCombined(correction);
            SetNewSymbol(NewSymbol, $"{area}{temperature}/{power}");
        }
Esempio n. 5
0
        public EnergyUnit(PowerUnit power, DurationUnit duration, string NewSymbol = "Empty", decimal correction = 1)
        {
            Name = "Energy";
            Unit = power.Unit * duration.Unit;

            SetCombined(correction);
            SetNewSymbol(NewSymbol, $"{power}{duration}");
        }
        public static ThermalConductivityUnit BtuPerHourFootFahrenheit = new ThermalConductivityUnit(PowerUnit.BritishThermalUnitPerHour, LengthUnit.Foot, TemperatureUnit.DegreeRankine, "BTU/h·ft·°F"); //Not sure this is correct in UnitNets



        public ThermalConductivityUnit(PowerUnit power, LengthUnit length, TemperatureUnit temperature, string NewSymbol = "Empty", decimal correction = 1)
        {
            Name = "ThermalConductivity";
            Unit = power.Unit / (length.Unit * temperature.Unit);

            SetCombined(correction);
            SetNewSymbol(NewSymbol, $"{power}/{length}·{temperature}");
        }
Esempio n. 7
0
 public Power ToUnit(PowerUnit selectedUnit) => new Power(ToTheOutSide(selectedUnit.Unit), selectedUnit);
Esempio n. 8
0
 public double As(PowerUnit ReturnInThisUnit) => (double)ToTheOutSide(ReturnInThisUnit.Unit);
Esempio n. 9
0
 public static Power From(double value, PowerUnit unit) => new Power(value, unit);
Esempio n. 10
0
 public Power(int value, PowerUnit selectedUnit) : base(value, selectedUnit.Unit)
 {
 }
Esempio n. 11
0
 public Power(double value, PowerUnit selectedUnit) : base(value, selectedUnit.Unit)
 {
 }
Esempio n. 12
0
 public Power(decimal value, PowerUnit selectedUnit) : base(value, selectedUnit.Unit)
 {
 }