1 -- File: Quantity_Convert.cdl
2 -- Created: Tue Jul 19 16:36:20 1994
3 -- Author: Guest Kernel
5 ---Copyright: Matra Datavision 1994
8 class Convert from Quantity
10 ---Purpose: Services to manage units conversion between Front-ends and Engines.
11 -- This conversion is managed by a table of correspondance between the quantities
12 -- and their "conversion coefficient".
13 -- This table is implemented like an external array (TCollection_Array1) regarding
14 -- to the quantities enumeration.
17 AsciiString from TCollection,
18 PhysicalQuantity from Quantity,
19 Coefficient from Quantity
23 Create returns Convert from Quantity;
24 ---Purpose: Creates an object;
27 aQuantity : PhysicalQuantity from Quantity ;
28 aCoef: Coefficient from Quantity);
29 ---Purpose: Updates the conversion table (correspondances between
30 -- Quantities and conversion coefficients).
33 ConvertUserToSI(myclass ;
34 aQuantity : PhysicalQuantity from Quantity ;
35 aVal : Real from Standard)
36 returns Real from Standard;
37 ---Purpose: Converts, from the conversion table, the value <aVal>
38 -- from the user system to the SI system.
41 ConvertSIToUser(myclass ;
42 aQuantity : PhysicalQuantity from Quantity ;
43 aVal : Real from Standard)
44 returns Real from Standard;
45 ---Purpose: Converts, from the conversion table, the value <aVal>
46 -- from the SI system to the user system.
49 IsPhysicalQuantity(myclass;
50 aTypeName : AsciiString from TCollection ;
51 anEnum : in out AsciiString from TCollection)
52 returns Boolean from Standard;
54 -- if (aType is a physical quantity)
55 -- returns True and the name of the associated PhysicalQuantity .
59 end Convert from Quantity;