[App] [Base] Add missing Property classes for all Units (#6717)
- Add missing Property classes for all Units - Add missing units to unit calculator, as well as some missing string representations - also change units used for dynamic viscosity to the customary Pa*s
This commit is contained in:
@@ -901,6 +901,12 @@ App.Units.HeatFlux = App.Units.Unit(0,1,-3,0,0)
|
||||
App.Units.DynamicViscosity = App.Units.Unit(-1,1,-1)
|
||||
App.Units.KinematicViscosity = App.Units.Unit(2,0,-1)
|
||||
App.Units.VacuumPermittivity = App.Units.Unit(-3,-1,4,2)
|
||||
App.Units.VolumeFlowRate = App.Units.Unit(3,0,-1)
|
||||
App.Units.DissipationRate = App.Units.Unit(2,0,-3)
|
||||
App.Units.InverseLength = App.Units.Unit(-1)
|
||||
App.Units.InverseArea = App.Units.Unit(-2)
|
||||
App.Units.InverseVolume = App.Units.Unit(-3)
|
||||
|
||||
|
||||
# Add an enum for the different unit schemes
|
||||
from enum import IntEnum
|
||||
|
||||
@@ -357,6 +357,66 @@ PropertyStiffness::PropertyStiffness()
|
||||
setUnit(Base::Unit::Stiffness);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyMass
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyMass, App::PropertyQuantity)
|
||||
|
||||
PropertyMass::PropertyMass()
|
||||
{
|
||||
setUnit(Base::Unit::Mass);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyDensity
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyDensity, App::PropertyQuantity)
|
||||
|
||||
PropertyDensity::PropertyDensity()
|
||||
{
|
||||
setUnit(Base::Unit::Density);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyTime
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyTime, App::PropertyQuantity)
|
||||
|
||||
PropertyTime::PropertyTime()
|
||||
{
|
||||
setUnit(Base::Unit::TimeSpan);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyTemperature
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyTemperature, App::PropertyQuantity)
|
||||
|
||||
PropertyTemperature::PropertyTemperature()
|
||||
{
|
||||
setUnit(Base::Unit::Temperature);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyElectricCurrent
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyElectricCurrent, App::PropertyQuantity)
|
||||
|
||||
PropertyElectricCurrent::PropertyElectricCurrent()
|
||||
{
|
||||
setUnit(Base::Unit::ElectricCurrent);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyVacuumPermittivity
|
||||
@@ -369,6 +429,342 @@ PropertyVacuumPermittivity::PropertyVacuumPermittivity()
|
||||
setUnit(Base::Unit::VacuumPermittivity);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyElectricCharge
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyElectricCharge, App::PropertyQuantity)
|
||||
|
||||
PropertyElectricCharge::PropertyElectricCharge()
|
||||
{
|
||||
setUnit(Base::Unit::ElectricCharge);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyMagneticFieldStrength
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyMagneticFieldStrength, App::PropertyQuantity)
|
||||
|
||||
PropertyMagneticFieldStrength::PropertyMagneticFieldStrength()
|
||||
{
|
||||
setUnit(Base::Unit::MagneticFieldStrength);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyMagneticFlux
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyMagneticFlux, App::PropertyQuantity)
|
||||
|
||||
PropertyMagneticFlux::PropertyMagneticFlux()
|
||||
{
|
||||
setUnit(Base::Unit::MagneticFlux);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyMagneticFluxDensity
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyMagneticFluxDensity, App::PropertyQuantity)
|
||||
|
||||
PropertyMagneticFluxDensity::PropertyMagneticFluxDensity()
|
||||
{
|
||||
setUnit(Base::Unit::MagneticFluxDensity);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyElectricalCapacitance
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyElectricalCapacitance, App::PropertyQuantity)
|
||||
|
||||
PropertyElectricalCapacitance::PropertyElectricalCapacitance()
|
||||
{
|
||||
setUnit(Base::Unit::ElectricalCapacitance);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyElectricalInductance
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyElectricalInductance, App::PropertyQuantity)
|
||||
|
||||
PropertyElectricalInductance::PropertyElectricalInductance()
|
||||
{
|
||||
setUnit(Base::Unit::ElectricalInductance);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyElectricalConductance
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyElectricalConductance, App::PropertyQuantity)
|
||||
|
||||
PropertyElectricalConductance::PropertyElectricalConductance()
|
||||
{
|
||||
setUnit(Base::Unit::ElectricalConductance);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyElectricalResistance
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyElectricalResistance, App::PropertyQuantity)
|
||||
|
||||
PropertyElectricalResistance::PropertyElectricalResistance()
|
||||
{
|
||||
setUnit(Base::Unit::ElectricalResistance);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyElectricalConductivity
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyElectricalConductivity, App::PropertyQuantity)
|
||||
|
||||
PropertyElectricalConductivity::PropertyElectricalConductivity()
|
||||
{
|
||||
setUnit(Base::Unit::ElectricalConductivity);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyAmountOfSubstance
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyAmountOfSubstance, App::PropertyQuantity)
|
||||
|
||||
PropertyAmountOfSubstance::PropertyAmountOfSubstance()
|
||||
{
|
||||
setUnit(Base::Unit::AmountOfSubstance);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyLuminousIntensity
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyLuminousIntensity, App::PropertyQuantity)
|
||||
|
||||
PropertyLuminousIntensity::PropertyLuminousIntensity()
|
||||
{
|
||||
setUnit(Base::Unit::LuminousIntensity);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyCompressiveStrength
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyCompressiveStrength, App::PropertyQuantity)
|
||||
|
||||
PropertyCompressiveStrength::PropertyCompressiveStrength()
|
||||
{
|
||||
setUnit(Base::Unit::CompressiveStrength);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyShearModulus
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyShearModulus, App::PropertyQuantity)
|
||||
|
||||
PropertyShearModulus::PropertyShearModulus()
|
||||
{
|
||||
setUnit(Base::Unit::ShearModulus);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyStress
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyStress, App::PropertyQuantity)
|
||||
|
||||
PropertyStress::PropertyStress()
|
||||
{
|
||||
setUnit(Base::Unit::Stress);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyUltimateTensileStrength
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyUltimateTensileStrength, App::PropertyQuantity)
|
||||
|
||||
PropertyUltimateTensileStrength::PropertyUltimateTensileStrength()
|
||||
{
|
||||
setUnit(Base::Unit::UltimateTensileStrength);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyYieldStrength
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyYieldStrength, App::PropertyQuantity)
|
||||
|
||||
PropertyYieldStrength::PropertyYieldStrength()
|
||||
{
|
||||
setUnit(Base::Unit::YieldStrength);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyYoungsModulus
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyYoungsModulus, App::PropertyQuantity)
|
||||
|
||||
PropertyYoungsModulus::PropertyYoungsModulus()
|
||||
{
|
||||
setUnit(Base::Unit::YoungsModulus);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyWork
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyWork, App::PropertyQuantity)
|
||||
|
||||
PropertyWork::PropertyWork()
|
||||
{
|
||||
setUnit(Base::Unit::Work);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyPower
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyPower, App::PropertyQuantity)
|
||||
|
||||
PropertyPower::PropertyPower()
|
||||
{
|
||||
setUnit(Base::Unit::Power);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertySpecificEnergy
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertySpecificEnergy, App::PropertyQuantity)
|
||||
|
||||
PropertySpecificEnergy::PropertySpecificEnergy()
|
||||
{
|
||||
setUnit(Base::Unit::SpecificEnergy);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyThermalConductivity
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyThermalConductivity, App::PropertyQuantity)
|
||||
|
||||
PropertyThermalConductivity::PropertyThermalConductivity()
|
||||
{
|
||||
setUnit(Base::Unit::ThermalConductivity);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyThermalExpansionCoefficient
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyThermalExpansionCoefficient, App::PropertyQuantity)
|
||||
|
||||
PropertyThermalExpansionCoefficient::PropertyThermalExpansionCoefficient()
|
||||
{
|
||||
setUnit(Base::Unit::ThermalExpansionCoefficient);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyVolumetricThermalExpansionCoefficient
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyVolumetricThermalExpansionCoefficient, App::PropertyQuantity)
|
||||
|
||||
PropertyVolumetricThermalExpansionCoefficient::PropertyVolumetricThermalExpansionCoefficient()
|
||||
{
|
||||
setUnit(Base::Unit::VolumetricThermalExpansionCoefficient);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertySpecificHeat
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertySpecificHeat, App::PropertyQuantity)
|
||||
|
||||
PropertySpecificHeat::PropertySpecificHeat()
|
||||
{
|
||||
setUnit(Base::Unit::SpecificHeat);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyThermalTransferCoefficient
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyThermalTransferCoefficient, App::PropertyQuantity)
|
||||
|
||||
PropertyThermalTransferCoefficient::PropertyThermalTransferCoefficient()
|
||||
{
|
||||
setUnit(Base::Unit::ThermalTransferCoefficient);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyHeatFlux
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyHeatFlux, App::PropertyQuantity)
|
||||
|
||||
PropertyHeatFlux::PropertyHeatFlux()
|
||||
{
|
||||
setUnit(Base::Unit::HeatFlux);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyDynamicViscosity
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyDynamicViscosity, App::PropertyQuantity)
|
||||
|
||||
PropertyDynamicViscosity::PropertyDynamicViscosity()
|
||||
{
|
||||
setUnit(Base::Unit::DynamicViscosity);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyKinematicViscosity
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyKinematicViscosity, App::PropertyQuantity)
|
||||
|
||||
PropertyKinematicViscosity::PropertyKinematicViscosity()
|
||||
{
|
||||
setUnit(Base::Unit::KinematicViscosity);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyVolume
|
||||
@@ -381,3 +777,63 @@ PropertyVolume::PropertyVolume()
|
||||
setUnit(Base::Unit::Volume);
|
||||
setConstraints(&LengthStandard);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyVolumeFlowRate
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyVolumeFlowRate, App::PropertyQuantity)
|
||||
|
||||
PropertyVolumeFlowRate::PropertyVolumeFlowRate()
|
||||
{
|
||||
setUnit(Base::Unit::VolumeFlowRate);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyDissipationRate
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyDissipationRate, App::PropertyQuantity)
|
||||
|
||||
PropertyDissipationRate::PropertyDissipationRate()
|
||||
{
|
||||
setUnit(Base::Unit::DissipationRate);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyInverseLength
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyInverseLength, App::PropertyQuantity)
|
||||
|
||||
PropertyInverseLength::PropertyInverseLength()
|
||||
{
|
||||
setUnit(Base::Unit::InverseLength);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyInverseArea
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyInverseArea, App::PropertyQuantity)
|
||||
|
||||
PropertyInverseArea::PropertyInverseArea()
|
||||
{
|
||||
setUnit(Base::Unit::InverseArea);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyInverseVolume
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TYPESYSTEM_SOURCE(App::PropertyInverseVolume, App::PropertyQuantity)
|
||||
|
||||
PropertyInverseVolume::PropertyInverseVolume()
|
||||
{
|
||||
setUnit(Base::Unit::InverseVolume);
|
||||
}
|
||||
|
||||
@@ -251,8 +251,8 @@ public:
|
||||
};
|
||||
|
||||
/** Pressure property
|
||||
* This is a property for representing acceleration. It is basically a float
|
||||
* property. On the Gui it has a quantity like m/s^2.
|
||||
* This is a property for representing pressure. It basically a float
|
||||
* property. On the Gui it has a quantity like Pa.
|
||||
*/
|
||||
class AppExport PropertyPressure: public PropertyQuantity
|
||||
{
|
||||
@@ -289,6 +289,452 @@ public:
|
||||
~PropertyStiffness() override = default;
|
||||
};
|
||||
|
||||
/** Mass property
|
||||
* This is a property for representing mass. It is basically a float
|
||||
* property. On the Gui it has a quantity like kg.
|
||||
*/
|
||||
class AppExport PropertyMass: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyMass(void);
|
||||
virtual ~PropertyMass(){}
|
||||
};
|
||||
|
||||
/** Density property
|
||||
* This is a property for representing density. It is basically a float
|
||||
* property which must not be negative. On the Gui it has a quantity like
|
||||
* kg/m^3.
|
||||
*/
|
||||
class AppExport PropertyDensity: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyDensity(void);
|
||||
virtual ~PropertyDensity(){}
|
||||
};
|
||||
|
||||
/** TimeSpan property
|
||||
* This is a property for representing time intervals. It is basically a float
|
||||
* property. On the Gui it has a quantity like s.
|
||||
*/
|
||||
class AppExport PropertyTime: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyTime(void);
|
||||
virtual ~PropertyTime(){}
|
||||
};
|
||||
|
||||
/** Velocity property
|
||||
* This is a property for representing velocities. It is basically a float
|
||||
* property. On the Gui it has a quantity like m/s.
|
||||
*/
|
||||
class AppExport PropertyVelocity: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyVelocity(void);
|
||||
virtual ~PropertyVelocity(){}
|
||||
};
|
||||
|
||||
/** Temperature property
|
||||
* This is a property for representing temperatures. It is basically a float
|
||||
* property which must not be negative. On the Gui it has a quantity like K.
|
||||
*/
|
||||
class AppExport PropertyTemperature: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyTemperature(void);
|
||||
virtual ~PropertyTemperature(){}
|
||||
};
|
||||
|
||||
/** ElectricCurrent property
|
||||
* This is a property for representing electric currents. It is basically a
|
||||
* float property. On the Gui it has a quantity like A.
|
||||
*/
|
||||
class AppExport PropertyElectricCurrent: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyElectricCurrent(void);
|
||||
virtual ~PropertyElectricCurrent(){}
|
||||
};
|
||||
|
||||
/** ElectricCharge property
|
||||
* This is a property for representing electric charge. It is basically a float
|
||||
* property. On the Gui it has a quantity like C.
|
||||
*/
|
||||
class AppExport PropertyElectricCharge: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyElectricCharge(void);
|
||||
virtual ~PropertyElectricCharge(){}
|
||||
};
|
||||
|
||||
/** MagneticFieldStrength property
|
||||
* This is a property for representing magnetic field strength. It is basically
|
||||
* a float property. On the Gui it has a quantity like Wb.
|
||||
*/
|
||||
class AppExport PropertyMagneticFieldStrength: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyMagneticFieldStrength(void);
|
||||
virtual ~PropertyMagneticFieldStrength(){}
|
||||
};
|
||||
|
||||
/** MagneticFlux property
|
||||
* This is a property for representing magnetic flux. It is basically a float
|
||||
* property. On the Gui it has a quantity like Wb.
|
||||
*/
|
||||
class AppExport PropertyMagneticFlux: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyMagneticFlux(void);
|
||||
virtual ~PropertyMagneticFlux(){}
|
||||
};
|
||||
|
||||
/** MagneticFluxDensity property
|
||||
* This is a property for representing magnetic flux density. It is basically a
|
||||
* float property. On the Gui it has a quantity like G or T.
|
||||
*/
|
||||
class AppExport PropertyMagneticFluxDensity: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyMagneticFluxDensity(void);
|
||||
virtual ~PropertyMagneticFluxDensity(){}
|
||||
};
|
||||
|
||||
/** ElectricalCapacitance property
|
||||
* This is a property for representing capacitance. It is basically a float
|
||||
* property. On the Gui it has a quantity like uF.
|
||||
*/
|
||||
class AppExport PropertyElectricalCapacitance: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyElectricalCapacitance(void);
|
||||
virtual ~PropertyElectricalCapacitance(){}
|
||||
};
|
||||
|
||||
/** ElectricalInductance property
|
||||
* This is a property for representing electrical inductance. It is basically a
|
||||
* float property. On the Gui it has a quantity like H.
|
||||
*/
|
||||
class AppExport PropertyElectricalInductance: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyElectricalInductance(void);
|
||||
virtual ~PropertyElectricalInductance(){}
|
||||
};
|
||||
|
||||
/** ElectricalConductance property
|
||||
* This is a property for representing electrical conductance. It is basically a
|
||||
* float property. On the Gui it has a quantity like S.
|
||||
*/
|
||||
class AppExport PropertyElectricalConductance: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyElectricalConductance(void);
|
||||
virtual ~PropertyElectricalConductance(){}
|
||||
};
|
||||
|
||||
/** ElectricalResistance property
|
||||
* This is a property for representing electrical resistance. It is basically a
|
||||
* float property. On the Gui it has a quantity like Ohm.
|
||||
*/
|
||||
|
||||
class AppExport PropertyElectricalResistance: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyElectricalResistance(void);
|
||||
virtual ~PropertyElectricalResistance(){}
|
||||
};
|
||||
|
||||
/** ElectricalConductivity property
|
||||
* This is a property for representing electrical conductivity. It is basically
|
||||
* a float property. On the Gui it has a quantity like S/m.
|
||||
*/
|
||||
class AppExport PropertyElectricalConductivity: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyElectricalConductivity(void);
|
||||
virtual ~PropertyElectricalConductivity(){}
|
||||
};
|
||||
|
||||
/** AmountOfSubstance property
|
||||
* This is a property for representing number of molecules. It is basically a
|
||||
* float property. On the Gui it has a quantity like mole.
|
||||
*/
|
||||
class AppExport PropertyAmountOfSubstance: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyAmountOfSubstance(void);
|
||||
virtual ~PropertyAmountOfSubstance(){}
|
||||
};
|
||||
|
||||
/** LuminousIntensity property
|
||||
* This is a property for representing luminous intensity. It is basically a
|
||||
* float property. On the Gui it has a quantity like cd.
|
||||
*/
|
||||
class AppExport PropertyLuminousIntensity: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyLuminousIntensity(void);
|
||||
virtual ~PropertyLuminousIntensity(){}
|
||||
};
|
||||
|
||||
/** CompressiveStrength property
|
||||
* This is a property for representing compressive strength. It is basically a
|
||||
* float property. On the Gui it has a quantity like Pa.
|
||||
*/
|
||||
class AppExport PropertyCompressiveStrength: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyCompressiveStrength(void);
|
||||
virtual ~PropertyCompressiveStrength(){}
|
||||
};
|
||||
|
||||
/** ShearModulus property
|
||||
* This is a property for representing shear modulus. It is basically a float
|
||||
* property. On the Gui it has a quantity like Pa.
|
||||
*/
|
||||
class AppExport PropertyShearModulus: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyShearModulus(void);
|
||||
virtual ~PropertyShearModulus(){}
|
||||
};
|
||||
|
||||
/** Stress property
|
||||
* This is a property for representing . It is basically a float
|
||||
* property. On the Gui it has a quantity like .
|
||||
*/
|
||||
class AppExport PropertyStress: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyStress(void);
|
||||
virtual ~PropertyStress(){}
|
||||
};
|
||||
|
||||
/** UltimateTensileStrength property
|
||||
* This is a property for representing ultimate tensile strength. It is
|
||||
* basically a float property. On the Gui it has a quantity like Pa.
|
||||
*/
|
||||
class AppExport PropertyUltimateTensileStrength: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyUltimateTensileStrength(void);
|
||||
virtual ~PropertyUltimateTensileStrength(){}
|
||||
};
|
||||
|
||||
/** YieldStrength property
|
||||
* This is a property for representing yield strength. It is basically a float
|
||||
* property. On the Gui it has a quantity like Pa.
|
||||
*/
|
||||
class AppExport PropertyYieldStrength: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyYieldStrength(void);
|
||||
virtual ~PropertyYieldStrength(){}
|
||||
};
|
||||
|
||||
/** YoungsModulus property
|
||||
* This is a property for representing Young's modulus. It is basically a float
|
||||
* property. On the Gui it has a quantity like Pa.
|
||||
*/
|
||||
class AppExport PropertyYoungsModulus: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyYoungsModulus(void);
|
||||
virtual ~PropertyYoungsModulus(){}
|
||||
};
|
||||
|
||||
/** Work property
|
||||
* This is a property for representing work. It is basically a float
|
||||
* property. On the Gui it has a quantity like Nm.
|
||||
*/
|
||||
class AppExport PropertyWork: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyWork(void);
|
||||
virtual ~PropertyWork(){}
|
||||
};
|
||||
|
||||
/** Power property
|
||||
* This is a property for representing power. It is basically a float
|
||||
* property. On the Gui it has a quantity like W.
|
||||
*/
|
||||
class AppExport PropertyPower: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyPower(void);
|
||||
virtual ~PropertyPower(){}
|
||||
};
|
||||
|
||||
/** SpecificEnergy property
|
||||
* This is a property for representing specific energy. It is basically a float
|
||||
* property. On the Gui it has a quantity like m^2/s^2.
|
||||
*/
|
||||
class AppExport PropertySpecificEnergy: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertySpecificEnergy(void);
|
||||
virtual ~PropertySpecificEnergy(){}
|
||||
};
|
||||
|
||||
/** ThermalConductivity property
|
||||
* This is a property for representing thermal conductivity. It is basically a
|
||||
* float property. On the Gui it has a quantity like W/m/K.
|
||||
*/
|
||||
class AppExport PropertyThermalConductivity: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyThermalConductivity(void);
|
||||
virtual ~PropertyThermalConductivity(){}
|
||||
};
|
||||
|
||||
/** ThermalExpansionCoefficient property
|
||||
* This is a property for representing a coefficient of thermal expansion. It
|
||||
* basically a float property. On the Gui it has a quantity like 1/K.
|
||||
*/
|
||||
class AppExport PropertyThermalExpansionCoefficient: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyThermalExpansionCoefficient(void);
|
||||
virtual ~PropertyThermalExpansionCoefficient(){}
|
||||
};
|
||||
|
||||
/** VolumetricThermalExpansionCoefficient property
|
||||
* This is a property for representing . It is basically a float
|
||||
* property. On the Gui it has a quantity like 1/K.
|
||||
*/
|
||||
class AppExport PropertyVolumetricThermalExpansionCoefficient: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyVolumetricThermalExpansionCoefficient(void);
|
||||
virtual ~PropertyVolumetricThermalExpansionCoefficient(){}
|
||||
};
|
||||
|
||||
/** SpecificHeat property
|
||||
* This is a property for representing specific heat capacity. It is basically a
|
||||
* float property. On the Gui it has a quantity like J/kg/K.
|
||||
*/
|
||||
class AppExport PropertySpecificHeat: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertySpecificHeat(void);
|
||||
virtual ~PropertySpecificHeat(){}
|
||||
};
|
||||
|
||||
/** ThermalTransferCoefficient property
|
||||
* This is a property for representing heat transfer coefficient. It is
|
||||
* basically a float property. On the Gui it has a quantity like W/m^2/K.
|
||||
*/
|
||||
class AppExport PropertyThermalTransferCoefficient: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyThermalTransferCoefficient(void);
|
||||
virtual ~PropertyThermalTransferCoefficient(){}
|
||||
};
|
||||
|
||||
/** HeatFlux property
|
||||
* This is a property for representing heat flux. It is basically a float
|
||||
* property. On the Gui it has a quantity like W/m^2.
|
||||
*/
|
||||
class AppExport PropertyHeatFlux: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyHeatFlux(void);
|
||||
virtual ~PropertyHeatFlux(){}
|
||||
};
|
||||
|
||||
/** DynamicViscosity property
|
||||
* This is a property for representing dynamic viscosity. It is basically a
|
||||
* float property which must not be negative. On the Gui it has a quantity like
|
||||
* Pa*s.
|
||||
*/
|
||||
class AppExport PropertyDynamicViscosity: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyDynamicViscosity(void);
|
||||
virtual ~PropertyDynamicViscosity(){}
|
||||
};
|
||||
|
||||
/** KinematicViscosity property
|
||||
* This is a property for representing kinematic viscosity. It is basically a
|
||||
* float property which must not be negative. On the Gui it has a quantity like
|
||||
* m^2/s^2.
|
||||
*/
|
||||
class AppExport PropertyKinematicViscosity: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyKinematicViscosity(void);
|
||||
virtual ~PropertyKinematicViscosity(){}
|
||||
};
|
||||
|
||||
/** VacuumPermittivity property
|
||||
* This is a property for representing vacuum permittivity. It is basically a float
|
||||
* property. On the Gui it has a quantity like s^4*A^2 / (m^3*kg).
|
||||
@@ -315,6 +761,75 @@ public:
|
||||
~PropertyVolume() override = default;
|
||||
};
|
||||
|
||||
/** VolumeFlowRate property
|
||||
* This is a property for representing volumetric flow rate. It is basically a
|
||||
* float property. On the Gui it has a quantity like l/s.
|
||||
*/
|
||||
class AppExport PropertyVolumeFlowRate: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyVolumeFlowRate(void);
|
||||
virtual ~PropertyVolumeFlowRate(){}
|
||||
};
|
||||
|
||||
/** DissipationRate property
|
||||
* This is a property for representing turbulent dissipation rate. It basically
|
||||
* a float property. On the Gui it has a quantity like m^2/s^3.
|
||||
*/
|
||||
class AppExport PropertyDissipationRate: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyDissipationRate(void);
|
||||
virtual ~PropertyDissipationRate(){}
|
||||
};
|
||||
|
||||
/** InverseLength property
|
||||
* This is a property for representing the reciprocal of length. It is basically
|
||||
* a float property which must not be negative. On the Gui it has a quantity
|
||||
* like 1/m.
|
||||
*/
|
||||
class AppExport PropertyInverseLength: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyInverseLength(void);
|
||||
virtual ~PropertyInverseLength(){}
|
||||
};
|
||||
|
||||
/** InverseArea property
|
||||
* This is a property for representing the reciprocal of area. It is basically a
|
||||
* float property which must not be negative. On the Gui it has a quantity like
|
||||
* 1/m^2.
|
||||
*/
|
||||
class AppExport PropertyInverseArea: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyInverseArea(void);
|
||||
virtual ~PropertyInverseArea(){}
|
||||
};
|
||||
|
||||
/** InverseVolume property
|
||||
* This is a property for representing the reciprocal of volume. It is basically
|
||||
* a float property. which must not be negative. On the Gui it has a quantity
|
||||
* like 1/m^3.
|
||||
*/
|
||||
class AppExport PropertyInverseVolume: public PropertyQuantity
|
||||
{
|
||||
TYPESYSTEM_HEADER();
|
||||
|
||||
public:
|
||||
PropertyInverseVolume(void);
|
||||
virtual ~PropertyInverseVolume(){}
|
||||
};
|
||||
|
||||
|
||||
}// namespace App
|
||||
|
||||
#endif// APP_PROPERTYUNITS_H
|
||||
|
||||
@@ -436,7 +436,9 @@ QString Unit::getTypeString() const
|
||||
return QString::fromLatin1("Mass");
|
||||
if (*this == Unit::Angle)
|
||||
return QString::fromLatin1("Angle");
|
||||
if (*this == Unit::Density)
|
||||
if(*this == Unit::AngleOfFriction )
|
||||
return QString::fromLatin1("AngleOfFriction");
|
||||
if(*this == Unit::Density)
|
||||
return QString::fromLatin1("Density");
|
||||
if (*this == Unit::TimeSpan)
|
||||
return QString::fromLatin1("TimeSpan");
|
||||
@@ -480,7 +482,17 @@ QString Unit::getTypeString() const
|
||||
return QString::fromLatin1("LuminousIntensity");
|
||||
if (*this == Unit::Pressure)
|
||||
return QString::fromLatin1("Pressure");
|
||||
if (*this == Unit::Force)
|
||||
if(*this == Unit::ShearModulus)
|
||||
return QString::fromLatin1("ShearModulus");
|
||||
if(*this == Unit::Stress)
|
||||
return QString::fromLatin1("Stress");
|
||||
if(*this == Unit::UltimateTensileStrength )
|
||||
return QString::fromLatin1("UltimateTensileStrength");
|
||||
if(*this == Unit::YieldStrength)
|
||||
return QString::fromLatin1("YieldStrength");
|
||||
if(*this == Unit::YoungsModulus)
|
||||
return QString::fromLatin1("YoungsModulus");
|
||||
if(*this == Unit::Force)
|
||||
return QString::fromLatin1("Force");
|
||||
if (*this == Unit::Work)
|
||||
return QString::fromLatin1("Work");
|
||||
@@ -508,6 +520,16 @@ QString Unit::getTypeString() const
|
||||
return QString::fromLatin1("KinematicViscosity");
|
||||
if (*this == Unit::VacuumPermittivity)
|
||||
return QString::fromLatin1("VacuumPermittivity");
|
||||
if (*this == Unit::VolumeFlowRate)
|
||||
return QString::fromLatin1("VolumeFlowRate");
|
||||
if (*this == Unit::DissipationRate)
|
||||
return QString::fromLatin1("DissipationRate");
|
||||
if (*this == Unit::InverseLength)
|
||||
return QString::fromLatin1("InverseLength");
|
||||
if (*this == Unit::InverseArea)
|
||||
return QString::fromLatin1("InverseArea");
|
||||
if (*this == Unit::InverseVolume)
|
||||
return QString::fromLatin1("InverseVolume");
|
||||
|
||||
return QString();
|
||||
|
||||
@@ -572,3 +594,9 @@ Unit Unit::HeatFlux (0,1,-3,0,0);
|
||||
Unit Unit::DynamicViscosity (-1,1,-1); // SI unit: kg/m/s
|
||||
Unit Unit::KinematicViscosity (2,0,-1); // SI unit: m^2/s, https://en.wikipedia.org/wiki/Viscosity#Kinematic_viscosity
|
||||
Unit Unit::VacuumPermittivity (-3,-1,4,2); // SI unit: A²*s⁴/kg/m³ https://en.wikipedia.org/wiki/Permittivity#Vacuum_permittivity
|
||||
Unit Unit::VolumeFlowRate (3,0,-1);
|
||||
Unit Unit::DissipationRate (2,0,-3); // SI unit: m^2/s^3 https://cfd-online.com/Wiki/Turbulence_dissipation_rate
|
||||
|
||||
Unit Unit::InverseLength (-1,0,0);
|
||||
Unit Unit::InverseArea (-2,0,0);
|
||||
Unit Unit::InverseVolume (-3,0,0);
|
||||
|
||||
@@ -148,6 +148,12 @@ public:
|
||||
static Unit DynamicViscosity;
|
||||
static Unit KinematicViscosity;
|
||||
static Unit VacuumPermittivity;
|
||||
static Unit VolumeFlowRate;
|
||||
static Unit DissipationRate;
|
||||
|
||||
static Unit InverseLength;
|
||||
static Unit InverseArea;
|
||||
static Unit InverseVolume;
|
||||
|
||||
//@}
|
||||
protected:
|
||||
|
||||
@@ -480,8 +480,8 @@ QString UnitsSchemaInternal::schemaTranslate(const Quantity &quant, double &fact
|
||||
factor = 1.0;
|
||||
}
|
||||
else if (unit == Unit::DynamicViscosity) {
|
||||
unitString = QString::fromLatin1("kg/(mm*s)");
|
||||
factor = 1.0;
|
||||
unitString = QString::fromLatin1("Pa*s");
|
||||
factor = 0.001;
|
||||
}
|
||||
else if (unit == Unit::KinematicViscosity) {
|
||||
if (UnitValue < 1e3) {
|
||||
@@ -493,6 +493,102 @@ QString UnitsSchemaInternal::schemaTranslate(const Quantity &quant, double &fact
|
||||
factor = 1e6;
|
||||
}
|
||||
}
|
||||
else if (unit == Unit::VolumeFlowRate) {
|
||||
if (UnitValue < 1e3) {
|
||||
unitString = QString::fromLatin1("mm^3/s");
|
||||
factor = 1.0;
|
||||
}
|
||||
else if (UnitValue < 1e6) {
|
||||
unitString = QString::fromLatin1("ml/s");
|
||||
factor = 1e3;
|
||||
}
|
||||
else if (UnitValue < 1e9) {
|
||||
unitString = QString::fromLatin1("l/s");
|
||||
factor = 1e6;
|
||||
}
|
||||
else {
|
||||
unitString = QString::fromLatin1("m^3/s");
|
||||
factor = 1e9;
|
||||
}
|
||||
}
|
||||
else if (unit == Unit::DissipationRate) {
|
||||
unitString = QString::fromLatin1("m^2/s^3");
|
||||
factor = 1e6;
|
||||
}
|
||||
else if (unit == Unit::InverseLength) {
|
||||
if (UnitValue < 1e-6) { // smaller than 0.001 1/km -> scientific notation
|
||||
unitString = QString::fromLatin1("1/mm");
|
||||
factor = 1;
|
||||
}
|
||||
else if (UnitValue < 1e-3) {
|
||||
unitString = QString::fromLatin1("1/km");
|
||||
factor = 1e-6;
|
||||
}
|
||||
else if (UnitValue < 1) {
|
||||
unitString = QString::fromLatin1("1/m");
|
||||
factor = 1e-3;
|
||||
}
|
||||
else if (UnitValue < 1e3) {
|
||||
unitString = QString::fromLatin1("1/mm");
|
||||
factor = 1;
|
||||
}
|
||||
else if(UnitValue < 1e6) {
|
||||
unitString = QString::fromUtf8("\xC2\xB5m");
|
||||
factor = 1e3;
|
||||
}
|
||||
else if(UnitValue < 1e9) {
|
||||
unitString = QString::fromLatin1("1/nm");
|
||||
factor = 1e6;
|
||||
}
|
||||
else { // bigger than 1000 1/nm -> scientific notation
|
||||
unitString = QString::fromLatin1("1/mm");
|
||||
factor = 1;
|
||||
}
|
||||
}
|
||||
else if (unit == Unit::InverseArea) {
|
||||
if (UnitValue < 1e-15) { // smaller than 0.001 1/km^2 -> scientific notation
|
||||
unitString = QString::fromLatin1("1/mm^2");
|
||||
factor = 1;
|
||||
}
|
||||
else if (UnitValue < 1e-9) {
|
||||
unitString = QString::fromLatin1("1/km^2");
|
||||
factor = 1e-12;
|
||||
}
|
||||
else if (UnitValue < 1e-3) {
|
||||
unitString = QString::fromLatin1("1/m^2");
|
||||
factor = 1e-6;
|
||||
}
|
||||
else if (UnitValue < 1e-1) {
|
||||
unitString = QString::fromLatin1("1/cm^2");
|
||||
factor = 1e-2;
|
||||
}
|
||||
else {
|
||||
unitString = QString::fromLatin1("1/mm^2");
|
||||
factor = 1;
|
||||
}
|
||||
}
|
||||
else if (unit == Unit::InverseVolume) {
|
||||
if (UnitValue < 1e-9) { // smaller than 0.001 1/m^3 -> scientific notation
|
||||
unitString = QString::fromLatin1("1/mm^3");
|
||||
factor = 1;
|
||||
}
|
||||
else if (UnitValue < 1e-6) {
|
||||
unitString = QString::fromLatin1("1/m^3");
|
||||
factor = 1e-9;
|
||||
}
|
||||
else if (UnitValue < 1e-3) {
|
||||
unitString = QString::fromLatin1("1/l^3");
|
||||
factor = 1e-6;
|
||||
}
|
||||
else if (UnitValue < 1) {
|
||||
unitString = QString::fromLatin1("1/ml");
|
||||
factor = 1e-3;
|
||||
}
|
||||
else {
|
||||
unitString = QString::fromLatin1("1/mm^3");
|
||||
factor = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// default action for all cases without special treatment:
|
||||
unitString = quant.getUnit().getString();
|
||||
|
||||
@@ -470,13 +470,117 @@ QString UnitsSchemaMKS::schemaTranslate(const Quantity &quant, double &factor, Q
|
||||
factor = 1000.0;
|
||||
}
|
||||
else if (unit == Unit::DynamicViscosity) {
|
||||
unitString = QString::fromLatin1("kg/(m*s)");
|
||||
unitString = QString::fromLatin1("Pa*s");
|
||||
factor = 0.001;
|
||||
}
|
||||
else if (unit == Unit::KinematicViscosity) {
|
||||
unitString = QString::fromLatin1("m^2/s");
|
||||
factor = 1e6;
|
||||
}
|
||||
else if (unit == Unit::VolumeFlowRate) {
|
||||
if (UnitValue < 1e-3) { // smaller than 0.001 mm^3/s -> scientific notation
|
||||
unitString = QString::fromLatin1("m^3/s");
|
||||
factor = 1e9;
|
||||
}
|
||||
else if (UnitValue < 1e3) {
|
||||
unitString = QString::fromLatin1("mm^3/s");
|
||||
factor = 1.0;
|
||||
}
|
||||
else if (UnitValue < 1e6) {
|
||||
unitString = QString::fromLatin1("ml/s");
|
||||
factor = 1e3;
|
||||
}
|
||||
else if (UnitValue < 1e9) {
|
||||
unitString = QString::fromLatin1("l/s");
|
||||
factor = 1e6;
|
||||
}
|
||||
else {
|
||||
unitString = QString::fromLatin1("m^3/s");
|
||||
factor = 1e9;
|
||||
}
|
||||
}
|
||||
else if (unit == Unit::DissipationRate) {
|
||||
unitString = QString::fromLatin1("m^2/s^3");
|
||||
factor = 1e6;
|
||||
}
|
||||
else if (unit == Unit::InverseLength) {
|
||||
if (UnitValue < 1e-6) { // smaller than 0.001 1/km -> scientific notation
|
||||
unitString = QString::fromLatin1("1/m");
|
||||
factor = 1e-3;
|
||||
}
|
||||
else if (UnitValue < 1e-3) {
|
||||
unitString = QString::fromLatin1("1/km");
|
||||
factor = 1e-6;
|
||||
}
|
||||
else if (UnitValue < 1) {
|
||||
unitString = QString::fromLatin1("1/m");
|
||||
factor = 1e-3;
|
||||
}
|
||||
else if (UnitValue < 1e3) {
|
||||
unitString = QString::fromLatin1("1/mm");
|
||||
factor = 1;
|
||||
}
|
||||
else if(UnitValue < 1e6) {
|
||||
unitString = QString::fromUtf8("\xC2\xB5m");
|
||||
factor = 1e3;
|
||||
}
|
||||
else if(UnitValue < 1e9) {
|
||||
unitString = QString::fromLatin1("1/nm");
|
||||
factor = 1e6;
|
||||
}
|
||||
else { // bigger than 1000 1/nm -> scientific notation
|
||||
unitString = QString::fromLatin1("1/m");
|
||||
factor = 1e-3;
|
||||
}
|
||||
}
|
||||
else if (unit == Unit::InverseArea) {
|
||||
if (UnitValue < 1e-15) { // smaller than 0.001 1/km^2 -> scientific notation
|
||||
unitString = QString::fromLatin1("1/m^2");
|
||||
factor = 1e-6;
|
||||
}
|
||||
else if (UnitValue < 1e-9) {
|
||||
unitString = QString::fromLatin1("1/km^2");
|
||||
factor = 1e-12;
|
||||
}
|
||||
else if (UnitValue < 1e-3) {
|
||||
unitString = QString::fromLatin1("1/m^2");
|
||||
factor = 1e-6;
|
||||
}
|
||||
else if (UnitValue < 1e-1) {
|
||||
unitString = QString::fromLatin1("1/cm^2");
|
||||
factor = 1e-2;
|
||||
}
|
||||
else if (UnitValue < 1e3) {
|
||||
unitString = QString::fromLatin1("1/mm^2");
|
||||
factor = 1;
|
||||
}
|
||||
else { // bigger than 1000 1/mm^2 -> scientific notation
|
||||
unitString = QString::fromLatin1("1/m^2");
|
||||
factor = 1e-6;
|
||||
}
|
||||
}
|
||||
else if (unit == Unit::InverseVolume) {
|
||||
if (UnitValue < 1e-6) {
|
||||
unitString = QString::fromLatin1("1/m^3");
|
||||
factor = 1e-9;
|
||||
}
|
||||
else if (UnitValue < 1e-3) {
|
||||
unitString = QString::fromLatin1("1/l^3");
|
||||
factor = 1e-6;
|
||||
}
|
||||
else if (UnitValue < 1) {
|
||||
unitString = QString::fromLatin1("1/ml");
|
||||
factor = 1e-3;
|
||||
}
|
||||
else if (UnitValue < 1e3) {
|
||||
unitString = QString::fromLatin1("1/mm^3");
|
||||
factor = 1;
|
||||
}
|
||||
else { // bigger than 1000 1/mm^3 -> scientific notation
|
||||
unitString = QString::fromLatin1("1/m^3");
|
||||
factor = 1e-9;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// default action for all cases without special treatment:
|
||||
unitString = quant.getUnit().getString();
|
||||
|
||||
@@ -78,6 +78,8 @@ DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WindowFlags fl )
|
||||
<< Base::Unit::Area
|
||||
<< Base::Unit::Density
|
||||
<< Base::Unit::CurrentDensity
|
||||
<< Base::Unit::DissipationRate
|
||||
<< Base::Unit::DynamicViscosity
|
||||
<< Base::Unit::ElectricalCapacitance
|
||||
<< Base::Unit::ElectricalInductance
|
||||
<< Base::Unit::ElectricalConductance
|
||||
@@ -86,10 +88,13 @@ DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WindowFlags fl )
|
||||
<< Base::Unit::ElectricCharge
|
||||
<< Base::Unit::ElectricCurrent
|
||||
<< Base::Unit::ElectricPotential
|
||||
<< Base::Unit::Frequency
|
||||
<< Base::Unit::Force
|
||||
<< Base::Unit::Stiffness
|
||||
<< Base::Unit::Frequency
|
||||
<< Base::Unit::HeatFlux
|
||||
<< Base::Unit::InverseArea
|
||||
<< Base::Unit::InverseLength
|
||||
<< Base::Unit::InverseVolume
|
||||
<< Base::Unit::KinematicViscosity
|
||||
<< Base::Unit::Length
|
||||
<< Base::Unit::LuminousIntensity
|
||||
<< Base::Unit::Mass
|
||||
@@ -97,16 +102,20 @@ DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WindowFlags fl )
|
||||
<< Base::Unit::MagneticFlux
|
||||
<< Base::Unit::MagneticFluxDensity
|
||||
<< Base::Unit::Magnetization
|
||||
<< Base::Unit::Pressure
|
||||
<< Base::Unit::Power
|
||||
<< Base::Unit::Pressure
|
||||
<< Base::Unit::SpecificEnergy
|
||||
<< Base::Unit::SpecificHeat
|
||||
<< Base::Unit::Stress
|
||||
<< Base::Unit::Stiffness
|
||||
<< Base::Unit::Temperature
|
||||
<< Base::Unit::ThermalConductivity
|
||||
<< Base::Unit::ThermalExpansionCoefficient
|
||||
<< Base::Unit::ThermalTransferCoefficient
|
||||
<< Base::Unit::TimeSpan
|
||||
<< Base::Unit::VacuumPermittivity
|
||||
<< Base::Unit::Velocity
|
||||
<< Base::Unit::VolumeFlowRate
|
||||
<< Base::Unit::VolumetricThermalExpansionCoefficient
|
||||
<< Base::Unit::Volume
|
||||
<< Base::Unit::Work;
|
||||
for (QList<Base::Unit>::iterator it = units.begin(); it != units.end(); ++it) {
|
||||
|
||||
Reference in New Issue
Block a user