|
1 | 1 | package ISQ { |
| 2 | + import ScalarValues::Real; |
| 3 | + import UnitsAndScales::*; |
2 | 4 |
|
3 | | - // Base Quantity Kinds |
4 | | - class LengthUnit specializes Quantities::SimpleUnit { } |
5 | | - class MassUnit specializes Quantities::SimpleUnit { } |
6 | | - class TimeUnit specializes Quantities::SimpleUnit { } |
7 | | - class ElectricCurrentUnit specializes Quantities::SimpleUnit { } |
8 | | - class TemperatureUnit specializes Quantities::SimpleUnit { } |
9 | | - class AmountOfSubstanceUnit specializes Quantities::SimpleUnit { } |
10 | | - class LuminousIntensityUnit specializes Quantities::SimpleUnit { } |
| 5 | + // Seven base quantities defined as abstract base units that span the power space of the ISO/IEC 80000 system of quantities |
| 6 | + class LengthUnit specializes UnitsAndScales::SimpleUnit { |
| 7 | + feature unitPowerFactor redefines UnitsAndScales::SimpleUnit::unitPowerFactor { |
| 8 | + feature unit: LengthUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 9 | + } |
| 10 | + } |
| 11 | + class MassUnit specializes UnitsAndScales::SimpleUnit { |
| 12 | + feature unitPowerFactor redefines UnitsAndScales::SimpleUnit::unitPowerFactor { |
| 13 | + feature unit: MassUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 14 | + } |
| 15 | + } |
| 16 | + class TimeUnit specializes UnitsAndScales::SimpleUnit { |
| 17 | + feature unitPowerFactor redefines UnitsAndScales::SimpleUnit::unitPowerFactor { |
| 18 | + feature unit: TimeUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 19 | + } |
| 20 | + } |
| 21 | + class ElectricCurrentUnit specializes UnitsAndScales::SimpleUnit { |
| 22 | + feature unitPowerFactor redefines UnitsAndScales::SimpleUnit::unitPowerFactor { |
| 23 | + feature unit: ElectricCurrentUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 24 | + } |
| 25 | + } |
| 26 | + class TemperatureUnit specializes UnitsAndScales::SimpleUnit { |
| 27 | + feature unitPowerFactor redefines UnitsAndScales::SimpleUnit::unitPowerFactor { |
| 28 | + feature unit: TemperatureUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 29 | + } |
| 30 | + } |
| 31 | + class AmountOfSubstanceUnit specializes UnitsAndScales::SimpleUnit { |
| 32 | + feature unitPowerFactor redefines UnitsAndScales::SimpleUnit::unitPowerFactor { |
| 33 | + feature unit: AmountOfSubstanceUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 34 | + } |
| 35 | + } |
| 36 | + class LuminousIntensityUnit specializes UnitsAndScales::SimpleUnit { |
| 37 | + feature unitPowerFactor redefines UnitsAndScales::SimpleUnit::unitPowerFactor { |
| 38 | + feature unit: LuminousIntensityUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 39 | + } |
| 40 | + } |
11 | 41 |
|
12 | | - // Derived Quantity Kinds |
13 | | - class ForceUnit specializes Quantities::DerivedUnit { |
14 | | - unitFactor1 subsets Quantities::DerivedUnit::unitFactor { |
15 | | - unit: MassUnit redefines Quantities::MeasurementUnitPowerFactor::unit; |
16 | | - exponent redefines Quantities::MeasurementUnitPowerFactor::exponent = 1; |
| 42 | + // Derived Quantity Kinds |
| 43 | + class ForceUnit specializes UnitsAndScales::DerivedUnit { |
| 44 | + feature unitPowerFactor1 subsets UnitsAndScales::MeasurementUnit::unitPowerFactor { |
| 45 | + unit: MassUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 46 | + exponent redefines UnitsAndScales::UnitPowerFactor::exponent = 1; |
17 | 47 | } |
18 | | - unitFactor2 subsets Quantities::DerivedUnit::unitFactor { |
19 | | - unit: LengthUnit redefines Quantities::MeasurementUnitPowerFactor::unit; |
20 | | - exponent redefines Quantities::MeasurementUnitPowerFactor::exponent = 1; |
| 48 | + unitPowerFactor2 subsets UnitsAndScales::MeasurementUnit::unitPowerFactor { |
| 49 | + unit: LengthUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 50 | + exponent redefines UnitsAndScales::UnitPowerFactor::exponent = 1; |
21 | 51 | } |
22 | | - unitFactor3 subsets Quantities::DerivedUnit::unitFactor { |
23 | | - unit: TimeUnit redefines Quantities::MeasurementUnitPowerFactor::unit; |
24 | | - exponent redefines Quantities::MeasurementUnitPowerFactor::exponent = -2; |
| 52 | + unitPowerFactor3 subsets UnitsAndScales::MeasurementUnit::unitPowerFactor { |
| 53 | + unit: TimeUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 54 | + exponent redefines UnitsAndScales::UnitPowerFactor::exponent = -2; |
25 | 55 | } |
26 | 56 | } |
27 | 57 |
|
| 58 | + class SpeedUnit specializes UnitsAndScales::DerivedUnit { |
| 59 | + feature unitPowerFactor1 subsets UnitsAndScales::MeasurementUnit::unitPowerFactor { |
| 60 | + unit: LengthUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 61 | + exponent redefines UnitsAndScales::UnitPowerFactor::exponent = 1; |
| 62 | + } |
| 63 | + unitPowerFactor2 subsets UnitsAndScales::MeasurementUnit::unitPowerFactor { |
| 64 | + unit: TimeUnit redefines UnitsAndScales::UnitPowerFactor::unit; |
| 65 | + exponent redefines UnitsAndScales::UnitPowerFactor::exponent = -1; |
| 66 | + } |
| 67 | + } |
| 68 | + |
28 | 69 | // ... |
29 | 70 |
|
30 | 71 | // Base Quantities |
31 | | - class Length specializes Quantities::Quantity { |
32 | | - unit: LengthUnit redefines Quantities::Quantity::unit; |
33 | | - } |
34 | | - class Mass specializes Quantities::Quantity { |
35 | | - unit: MassUnit redefines Quantities::Quantity::unit; |
36 | | - } |
37 | | - class Time specializes Quantities::Quantity { |
38 | | - unit: TimeUnit redefines Quantities::Quantity::unit; |
39 | | - } |
40 | | - class ElectricCurrent specializes Quantities::Quantity { |
41 | | - unit: ElectricCurrentUnit redefines Quantities::Quantity::unit; |
| 72 | + class LengthValue specializes Quantities::QuantityValue { |
| 73 | + magnitude: Real redefines Quantities::QuantityValue::magnitude; |
| 74 | + scale: LengthUnit redefines Quantities::QuantityValue::scale; |
42 | 75 | } |
43 | | - class Temperature specializes Quantities::Quantity { |
44 | | - unit: TemperatureUnit redefines Quantities::Quantity::unit; |
45 | | - } |
46 | | - class AmountOfSubstance specializes Quantities::Quantity { |
47 | | - unit: AmountOfSubstanceUnit redefines Quantities::Quantity::unit; |
48 | | - } |
49 | | - class LuminousIntensity specializes Quantities::Quantity { |
50 | | - unit: LuminousIntensityUnit redefines Quantities::Quantity::unit; |
| 76 | + feature length: LengthValue; |
| 77 | + |
| 78 | + class MassValue specializes Quantities::QuantityValue { |
| 79 | + magnitude: Real redefines Quantities::QuantityValue::magnitude; |
| 80 | + scale: MassUnit redefines Quantities::QuantityValue::scale; |
| 81 | + } |
| 82 | + feature mass: MassValue; |
| 83 | + |
| 84 | + class TimeValue specializes Quantities::QuantityValue { |
| 85 | + magnitude: Real redefines Quantities::QuantityValue::magnitude; |
| 86 | + scale: TimeUnit redefines Quantities::QuantityValue::scale; |
| 87 | + } |
| 88 | + feature time: TimeValue; |
| 89 | + |
| 90 | + class ElectricCurrentValue specializes Quantities::QuantityValue { |
| 91 | + magnitude: Real redefines Quantities::QuantityValue::magnitude; |
| 92 | + scale: ElectricCurrentUnit redefines Quantities::QuantityValue::scale; |
| 93 | + } |
| 94 | + feature electricCurrent: ElectricCurrentValue; |
| 95 | + |
| 96 | + class TemperatureValue specializes Quantities::QuantityValue { |
| 97 | + magnitude: Real redefines Quantities::QuantityValue::magnitude; |
| 98 | + scale: TemperatureUnit redefines Quantities::QuantityValue::scale; |
| 99 | + } |
| 100 | + feature temperature: TemperatureValue; |
| 101 | + |
| 102 | + class AmountOfSubstanceValue specializes Quantities::QuantityValue { |
| 103 | + magnitude: Real redefines Quantities::QuantityValue::magnitude; |
| 104 | + scale: AmountOfSubstanceUnit redefines Quantities::QuantityValue::scale; |
| 105 | + } |
| 106 | + feature amountOfSubstance: AmountOfSubstanceValue; |
| 107 | + |
| 108 | + class LuminousIntensityValue specializes Quantities::QuantityValue { |
| 109 | + magnitude: Real redefines Quantities::QuantityValue::magnitude; |
| 110 | + scale: LuminousIntensityUnit redefines Quantities::QuantityValue::scale; |
51 | 111 | } |
| 112 | + feature luminousIntensity: LuminousIntensityValue; |
52 | 113 |
|
53 | 114 | // Derived Quantities |
54 | | - class Force specializes Quantities::Quantity { |
55 | | - unit: ForceUnit redefines Quantities::Quantity::unit; |
| 115 | + class ForceValue specializes Quantities::QuantityValue { |
| 116 | + magnitude: Real redefines Quantities::QuantityValue::magnitude; |
| 117 | + scale: ForceUnit redefines Quantities::QuantityValue::scale; |
56 | 118 | } |
| 119 | + feature force: ForceValue; |
57 | 120 |
|
58 | 121 | // ... |
59 | 122 |
|
|
0 commit comments