| 1 |
706 |
jeremybenn |
------------------------------------------------------------------------------
|
| 2 |
|
|
-- --
|
| 3 |
|
|
-- GNAT RUN-TIME COMPONENTS --
|
| 4 |
|
|
-- --
|
| 5 |
|
|
-- S Y S T E M . D I M . M K S --
|
| 6 |
|
|
-- --
|
| 7 |
|
|
-- S p e c --
|
| 8 |
|
|
-- --
|
| 9 |
|
|
-- Copyright (C) 2011-2012, Free Software Foundation, Inc. --
|
| 10 |
|
|
-- --
|
| 11 |
|
|
-- GNAT is free software; you can redistribute it and/or modify it under --
|
| 12 |
|
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
| 13 |
|
|
-- ware Foundation; either version 3, or (at your option) any later ver- --
|
| 14 |
|
|
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
|
| 15 |
|
|
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
|
| 16 |
|
|
-- or FITNESS FOR A PARTICULAR PURPOSE. --
|
| 17 |
|
|
-- --
|
| 18 |
|
|
-- As a special exception under Section 7 of GPL version 3, you are granted --
|
| 19 |
|
|
-- additional permissions described in the GCC Runtime Library Exception, --
|
| 20 |
|
|
-- version 3.1, as published by the Free Software Foundation. --
|
| 21 |
|
|
-- --
|
| 22 |
|
|
-- You should have received a copy of the GNU General Public License and --
|
| 23 |
|
|
-- a copy of the GCC Runtime Library Exception along with this program; --
|
| 24 |
|
|
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
|
| 25 |
|
|
-- <http://www.gnu.org/licenses/>. --
|
| 26 |
|
|
-- --
|
| 27 |
|
|
-- GNAT was originally developed by the GNAT team at New York University. --
|
| 28 |
|
|
-- Extensive contributions were provided by Ada Core Technologies Inc. --
|
| 29 |
|
|
-- --
|
| 30 |
|
|
------------------------------------------------------------------------------
|
| 31 |
|
|
|
| 32 |
|
|
-- Defines the MKS dimension system which is the SI system of units
|
| 33 |
|
|
|
| 34 |
|
|
-- Some other prefixes of this system are defined in a child package (see
|
| 35 |
|
|
-- System.Dim_Mks.Other_Prefixes) in order to avoid too many constant
|
| 36 |
|
|
-- declarations in this package.
|
| 37 |
|
|
|
| 38 |
|
|
-- The dimension terminology is defined in System.Dim_IO package
|
| 39 |
|
|
|
| 40 |
|
|
with Ada.Numerics;
|
| 41 |
|
|
|
| 42 |
|
|
package System.Dim.Mks is
|
| 43 |
|
|
|
| 44 |
|
|
e : constant := Ada.Numerics.e;
|
| 45 |
|
|
Pi : constant := Ada.Numerics.Pi;
|
| 46 |
|
|
|
| 47 |
|
|
-- Dimensioned type Mks_Type
|
| 48 |
|
|
|
| 49 |
|
|
type Mks_Type is new Long_Long_Float
|
| 50 |
|
|
with
|
| 51 |
|
|
Dimension_System => ((Meter, 'm'),
|
| 52 |
|
|
(Kilogram, "kg"),
|
| 53 |
|
|
(Second, 's'),
|
| 54 |
|
|
(Ampere, 'A'),
|
| 55 |
|
|
(Kelvin, 'K'),
|
| 56 |
|
|
(Mole, "mol"),
|
| 57 |
|
|
(Candela, "cd"));
|
| 58 |
|
|
|
| 59 |
|
|
-- SI Base dimensioned subtype
|
| 60 |
|
|
|
| 61 |
|
|
subtype Length is Mks_Type
|
| 62 |
|
|
with
|
| 63 |
|
|
Dimension => ('m',
|
| 64 |
|
|
Meter => 1,
|
| 65 |
|
|
others => 0);
|
| 66 |
|
|
subtype Mass is Mks_Type
|
| 67 |
|
|
with
|
| 68 |
|
|
Dimension => ("kg",
|
| 69 |
|
|
Kilogram => 1,
|
| 70 |
|
|
others => 0);
|
| 71 |
|
|
subtype Time is Mks_Type
|
| 72 |
|
|
with
|
| 73 |
|
|
Dimension => ('s',
|
| 74 |
|
|
Second => 1,
|
| 75 |
|
|
others => 0);
|
| 76 |
|
|
subtype Electric_Current is Mks_Type
|
| 77 |
|
|
with
|
| 78 |
|
|
Dimension => ('A',
|
| 79 |
|
|
Ampere => 1,
|
| 80 |
|
|
others => 0);
|
| 81 |
|
|
subtype Thermodynamic_Temperature is Mks_Type
|
| 82 |
|
|
with
|
| 83 |
|
|
Dimension => ('K',
|
| 84 |
|
|
Kelvin => 1,
|
| 85 |
|
|
others => 0);
|
| 86 |
|
|
subtype Amount_Of_Substance is Mks_Type
|
| 87 |
|
|
with
|
| 88 |
|
|
Dimension => ("mol",
|
| 89 |
|
|
Mole => 1,
|
| 90 |
|
|
others => 0);
|
| 91 |
|
|
subtype Luminous_Intensity is Mks_Type
|
| 92 |
|
|
with
|
| 93 |
|
|
Dimension => ("cd",
|
| 94 |
|
|
Candela => 1,
|
| 95 |
|
|
others => 0);
|
| 96 |
|
|
|
| 97 |
|
|
-- SI Base units
|
| 98 |
|
|
|
| 99 |
|
|
m : constant Length := 1.0;
|
| 100 |
|
|
kg : constant Mass := 1.0;
|
| 101 |
|
|
s : constant Time := 1.0;
|
| 102 |
|
|
A : constant Electric_Current := 1.0;
|
| 103 |
|
|
K : constant Thermodynamic_Temperature := 1.0;
|
| 104 |
|
|
mol : constant Amount_Of_Substance := 1.0;
|
| 105 |
|
|
cd : constant Luminous_Intensity := 1.0;
|
| 106 |
|
|
|
| 107 |
|
|
-- SI Derived dimensioned subtypes
|
| 108 |
|
|
|
| 109 |
|
|
subtype Angle is Mks_Type
|
| 110 |
|
|
with
|
| 111 |
|
|
Dimension => ("rad",
|
| 112 |
|
|
others => 0);
|
| 113 |
|
|
|
| 114 |
|
|
subtype Solid_Angle is Mks_Type
|
| 115 |
|
|
with
|
| 116 |
|
|
Dimension => ("sr",
|
| 117 |
|
|
others => 0);
|
| 118 |
|
|
|
| 119 |
|
|
subtype Frequency is Mks_Type
|
| 120 |
|
|
with
|
| 121 |
|
|
Dimension => ("Hz",
|
| 122 |
|
|
Second => -1,
|
| 123 |
|
|
others => 0);
|
| 124 |
|
|
subtype Force is Mks_Type
|
| 125 |
|
|
with
|
| 126 |
|
|
Dimension => ('N',
|
| 127 |
|
|
Meter => 1,
|
| 128 |
|
|
Kilogram => 1,
|
| 129 |
|
|
Second => -2,
|
| 130 |
|
|
others => 0);
|
| 131 |
|
|
subtype Pressure is Mks_Type
|
| 132 |
|
|
with
|
| 133 |
|
|
Dimension => ("Pa",
|
| 134 |
|
|
Meter => -1,
|
| 135 |
|
|
Kilogram => 1,
|
| 136 |
|
|
Second => -2,
|
| 137 |
|
|
others => 0);
|
| 138 |
|
|
subtype Energy is Mks_Type
|
| 139 |
|
|
with
|
| 140 |
|
|
Dimension => ('J',
|
| 141 |
|
|
Meter => 2,
|
| 142 |
|
|
Kilogram => 1,
|
| 143 |
|
|
Second => -2,
|
| 144 |
|
|
others => 0);
|
| 145 |
|
|
subtype Power is Mks_Type
|
| 146 |
|
|
with
|
| 147 |
|
|
Dimension => ('W',
|
| 148 |
|
|
Meter => 2,
|
| 149 |
|
|
Kilogram => 1,
|
| 150 |
|
|
Second => -3,
|
| 151 |
|
|
others => 0);
|
| 152 |
|
|
subtype Electric_Charge is Mks_Type
|
| 153 |
|
|
with
|
| 154 |
|
|
Dimension => ('C',
|
| 155 |
|
|
Second => 1,
|
| 156 |
|
|
Ampere => 1,
|
| 157 |
|
|
others => 0);
|
| 158 |
|
|
subtype Electric_Potential_Difference is Mks_Type
|
| 159 |
|
|
with
|
| 160 |
|
|
Dimension => ('V',
|
| 161 |
|
|
Meter => 2,
|
| 162 |
|
|
Kilogram => 1,
|
| 163 |
|
|
Second => -3,
|
| 164 |
|
|
Ampere => -1,
|
| 165 |
|
|
others => 0);
|
| 166 |
|
|
subtype Electric_Capacitance is Mks_Type
|
| 167 |
|
|
with
|
| 168 |
|
|
Dimension => ('F',
|
| 169 |
|
|
Meter => -2,
|
| 170 |
|
|
Kilogram => -1,
|
| 171 |
|
|
Second => 4,
|
| 172 |
|
|
Ampere => 2,
|
| 173 |
|
|
others => 0);
|
| 174 |
|
|
subtype Electric_Resistance is Mks_Type
|
| 175 |
|
|
with
|
| 176 |
|
|
Dimension => ("Ω",
|
| 177 |
|
|
Meter => 2,
|
| 178 |
|
|
Kilogram => 1,
|
| 179 |
|
|
Second => -3,
|
| 180 |
|
|
Ampere => -2,
|
| 181 |
|
|
others => 0);
|
| 182 |
|
|
subtype Electric_Conductance is Mks_Type
|
| 183 |
|
|
with
|
| 184 |
|
|
Dimension => ('S',
|
| 185 |
|
|
Meter => -2,
|
| 186 |
|
|
Kilogram => -1,
|
| 187 |
|
|
Second => 3,
|
| 188 |
|
|
Ampere => 2,
|
| 189 |
|
|
others => 0);
|
| 190 |
|
|
subtype Magnetic_Flux is Mks_Type
|
| 191 |
|
|
with
|
| 192 |
|
|
Dimension => ("Wb",
|
| 193 |
|
|
Meter => 2,
|
| 194 |
|
|
Kilogram => 1,
|
| 195 |
|
|
Second => -2,
|
| 196 |
|
|
Ampere => -1,
|
| 197 |
|
|
others => 0);
|
| 198 |
|
|
subtype Magnetic_Flux_Density is Mks_Type
|
| 199 |
|
|
with
|
| 200 |
|
|
Dimension => ('T',
|
| 201 |
|
|
Kilogram => 1,
|
| 202 |
|
|
Second => -2,
|
| 203 |
|
|
Ampere => -1,
|
| 204 |
|
|
others => 0);
|
| 205 |
|
|
subtype Inductance is Mks_Type
|
| 206 |
|
|
with
|
| 207 |
|
|
Dimension => ('H',
|
| 208 |
|
|
Meter => 2,
|
| 209 |
|
|
Kilogram => 1,
|
| 210 |
|
|
Second => -2,
|
| 211 |
|
|
Ampere => -2,
|
| 212 |
|
|
others => 0);
|
| 213 |
|
|
subtype Celsius_Temperature is Mks_Type
|
| 214 |
|
|
with
|
| 215 |
|
|
Dimension => ("°C",
|
| 216 |
|
|
Kelvin => 1,
|
| 217 |
|
|
others => 0);
|
| 218 |
|
|
subtype Luminous_Flux is Mks_Type
|
| 219 |
|
|
with
|
| 220 |
|
|
Dimension => ("lm",
|
| 221 |
|
|
Candela => 1,
|
| 222 |
|
|
others => 0);
|
| 223 |
|
|
subtype Illuminance is Mks_Type
|
| 224 |
|
|
with
|
| 225 |
|
|
Dimension => ("lx",
|
| 226 |
|
|
Meter => -2,
|
| 227 |
|
|
Candela => 1,
|
| 228 |
|
|
others => 0);
|
| 229 |
|
|
subtype Radioactivity is Mks_Type
|
| 230 |
|
|
with
|
| 231 |
|
|
Dimension => ("Bq",
|
| 232 |
|
|
Second => -1,
|
| 233 |
|
|
others => 0);
|
| 234 |
|
|
subtype Absorbed_Dose is Mks_Type
|
| 235 |
|
|
with
|
| 236 |
|
|
Dimension => ("Gy",
|
| 237 |
|
|
Meter => 2,
|
| 238 |
|
|
Second => -2,
|
| 239 |
|
|
others => 0);
|
| 240 |
|
|
subtype Equivalent_Dose is Mks_Type
|
| 241 |
|
|
with
|
| 242 |
|
|
Dimension => ("Sv",
|
| 243 |
|
|
Meter => 2,
|
| 244 |
|
|
Second => -2,
|
| 245 |
|
|
others => 0);
|
| 246 |
|
|
subtype Catalytic_Activity is Mks_Type
|
| 247 |
|
|
with
|
| 248 |
|
|
Dimension => ("kat",
|
| 249 |
|
|
Second => -1,
|
| 250 |
|
|
Mole => 1,
|
| 251 |
|
|
others => 0);
|
| 252 |
|
|
|
| 253 |
|
|
rad : constant Angle := 1.0;
|
| 254 |
|
|
sr : constant Solid_Angle := 1.0;
|
| 255 |
|
|
Hz : constant Frequency := 1.0;
|
| 256 |
|
|
N : constant Force := 1.0;
|
| 257 |
|
|
Pa : constant Pressure := 1.0;
|
| 258 |
|
|
J : constant Energy := 1.0;
|
| 259 |
|
|
W : constant Power := 1.0;
|
| 260 |
|
|
C : constant Electric_Charge := 1.0;
|
| 261 |
|
|
V : constant Electric_Potential_Difference := 1.0;
|
| 262 |
|
|
F : constant Electric_Capacitance := 1.0;
|
| 263 |
|
|
Ohm : constant Electric_Resistance := 1.0;
|
| 264 |
|
|
Si : constant Electric_Conductance := 1.0;
|
| 265 |
|
|
Wb : constant Magnetic_Flux := 1.0;
|
| 266 |
|
|
T : constant Magnetic_Flux_Density := 1.0;
|
| 267 |
|
|
H : constant Inductance := 1.0;
|
| 268 |
|
|
dC : constant Celsius_Temperature := 273.15;
|
| 269 |
|
|
lm : constant Luminous_Flux := 1.0;
|
| 270 |
|
|
lx : constant Illuminance := 1.0;
|
| 271 |
|
|
Bq : constant Radioactivity := 1.0;
|
| 272 |
|
|
Gy : constant Absorbed_Dose := 1.0;
|
| 273 |
|
|
Sv : constant Equivalent_Dose := 1.0;
|
| 274 |
|
|
kat : constant Catalytic_Activity := 1.0;
|
| 275 |
|
|
|
| 276 |
|
|
-- SI prefixes for Meter
|
| 277 |
|
|
|
| 278 |
|
|
um : constant Length := 1.0E-06; -- micro (u)
|
| 279 |
|
|
mm : constant Length := 1.0E-03; -- milli
|
| 280 |
|
|
cm : constant Length := 1.0E-02; -- centi
|
| 281 |
|
|
dm : constant Length := 1.0E-01; -- deci
|
| 282 |
|
|
dam : constant Length := 1.0E+01; -- deka
|
| 283 |
|
|
hm : constant Length := 1.0E+02; -- hecto
|
| 284 |
|
|
km : constant Length := 1.0E+03; -- kilo
|
| 285 |
|
|
Mem : constant Length := 1.0E+06; -- mega
|
| 286 |
|
|
|
| 287 |
|
|
-- SI prefixes for Kilogram
|
| 288 |
|
|
|
| 289 |
|
|
ug : constant Mass := 1.0E-09; -- micro (u)
|
| 290 |
|
|
mg : constant Mass := 1.0E-06; -- milli
|
| 291 |
|
|
cg : constant Mass := 1.0E-05; -- centi
|
| 292 |
|
|
dg : constant Mass := 1.0E-04; -- deci
|
| 293 |
|
|
g : constant Mass := 1.0E-03; -- gram
|
| 294 |
|
|
dag : constant Mass := 1.0E-02; -- deka
|
| 295 |
|
|
hg : constant Mass := 1.0E-01; -- hecto
|
| 296 |
|
|
Meg : constant Mass := 1.0E+03; -- mega
|
| 297 |
|
|
|
| 298 |
|
|
-- SI prefixes for Second
|
| 299 |
|
|
|
| 300 |
|
|
us : constant Time := 1.0E-06; -- micro (u)
|
| 301 |
|
|
ms : constant Time := 1.0E-03; -- milli
|
| 302 |
|
|
cs : constant Time := 1.0E-02; -- centi
|
| 303 |
|
|
ds : constant Time := 1.0E-01; -- deci
|
| 304 |
|
|
das : constant Time := 1.0E+01; -- deka
|
| 305 |
|
|
hs : constant Time := 1.0E+02; -- hecto
|
| 306 |
|
|
ks : constant Time := 1.0E+03; -- kilo
|
| 307 |
|
|
Mes : constant Time := 1.0E+06; -- mega
|
| 308 |
|
|
|
| 309 |
|
|
-- Other constants for Second
|
| 310 |
|
|
|
| 311 |
|
|
min : constant Time := 60.0 * s;
|
| 312 |
|
|
hour : constant Time := 60.0 * min;
|
| 313 |
|
|
day : constant Time := 24.0 * hour;
|
| 314 |
|
|
year : constant Time := 365.25 * day;
|
| 315 |
|
|
|
| 316 |
|
|
-- SI prefixes for Ampere
|
| 317 |
|
|
|
| 318 |
|
|
mA : constant Electric_Current := 1.0E-03; -- milli
|
| 319 |
|
|
cA : constant Electric_Current := 1.0E-02; -- centi
|
| 320 |
|
|
dA : constant Electric_Current := 1.0E-01; -- deci
|
| 321 |
|
|
daA : constant Electric_Current := 1.0E+01; -- deka
|
| 322 |
|
|
hA : constant Electric_Current := 1.0E+02; -- hecto
|
| 323 |
|
|
kA : constant Electric_Current := 1.0E+03; -- kilo
|
| 324 |
|
|
MeA : constant Electric_Current := 1.0E+06; -- mega
|
| 325 |
|
|
|
| 326 |
|
|
end System.Dim.Mks;
|