KnowledgeInterfaces Interface CATICkeUnit

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATICkeUnit

Interface dedicated to unit management.
Role: This interface gives access to unit properties.
This interface is based on the International System Magnitude Management called MKS.
Each magnitude has a default unit corresponding to the MKS System
for example : the default unit for length is meter
the default unit for weight is kilogram
etc...
All conversion methods are working with this MKS unit on one side

This interface is mono implemented.

See also:


Method Index


o Convert(double)
Converts a real in this unit to MKS.
o DecodeReal(CATUnicodeString&,double&)
Tries to decode a string (prefixed with unit or not) to a real.
o GetMagnitude()
Returns the magnitude of the unit.
o InternalName()
Returns the internal name of this unit.
o Name()
Returns the NLS name of this unit.
o Show(double,int)
Returns a string showing a real (in MKS) in this unit.
o ShowIso(double,int)
Returns the value of the parameter in the current unit while respecting the ISO standard.
o Symbol()
Returns the symbol of this unit.
o Value(double)
Converts a real in MKS to this unit.

Methods


o Convert
public virtual Convert( const iValueInThisUnit)
Converts a real in this unit to MKS.
Parameters:
iValueInThisUnit
value in this unit
Returns:
value converted in MKS
o DecodeReal
public virtual DecodeReal( const iStringToDecode,
oValueInMKS)
Tries to decode a string (prefixed with unit or not) to a real. Example: Decode "3mm"
Parameters:
iStringToDecode
string to be decoded.
oValueInMKS
the double in output is in MKS
Returns:

Legal values: the test can be either 1 if successful in decoding. 0 if it isn't.
o GetMagnitude
public virtual GetMagnitude()
Returns the magnitude of the unit. It may happen that a unit participate to several magnitudes.
In this case, only the first found will be returned.
Returns:
the magnitude of the unit
o InternalName
public virtual InternalName()
Returns the internal name of this unit. Example: "Millimeter".
o Name
public virtual Name()
Returns the NLS name of this unit. Example: "Millimeter".
o Show
public virtual Show( const iValueInMKS,
const iNbDecimals= 0)
Returns a string showing a real (in MKS) in this unit. Example: "2 cm".
Parameters:
iValueInMKS
double in input is in MKS
iNbDecimals
number of decimals to use to show the number. If equal to zero, default nb of decimals
Returns:
the string to show the real in MKS
o ShowIso
public virtual ShowIso( const iValue,
const iNbDecimals= 0)
Returns the value of the parameter in the current unit while respecting the ISO standard.
Parameters:
iValue
Value of the parameter.
iNbDecimals
Number of decimals to use to show the number. If equal to zero, the setting is used.
Returns:
The value of the parameter in the current unit while respecting the ISO standard,
i.e. : if the setting called "Decimal places for read/write numbers" (used for the display of units) = 3
and if the parameter's value in current unit (e.g. mm) = 0.001,
returns "0mm"
otherwise, if parameter's value in current unit (e.g. mm) = 0.001,
returns "0.001mm".
o Symbol
public virtual Symbol()
Returns the symbol of this unit. Example: "mm"
o Value
public virtual Value( const iValueInMKS)
Converts a real in MKS to this unit.
Parameters:
iValueInMKS
value in this unit
Returns:
value converted in this unit

This object is included in the file: CATICkeUnit.h
If needed, your Imakefile.mk should include the module: KnowledgeItf

Copyright © 1999-2015, Dassault Systèmes. All rights reserved.