Configuring Units of Measurement in VISUAL*eyes

advertisement
Configuring Units of Measurement in VISUAL*eyes
The following document outlines how to
1) Add a new measurement unit for an existing data type, and
2) Add a new measurement type
1) Adding a new measurement unit for an existing data type:
To add a new measurement to an existing data type, you need to add one entry in the file
UOM_SI.csv
As an example, follow these steps to create a new “Area” measurement unit named
“square_decimeter”.
a) Open UOM_SI.csv and add a new row
b) In column A, add the existing data type name
(See UOM_SI_Types.csv - column A)
c) In column B, add the description for the new measurement unit.
In this case: square_decimeter
*It cannot exist twice for the same data type.
d) In column C, add a symbol for the new measurement unit.
For example, dc2
*It cannot exist twice for the same data type.
e) Columns D and E represent parameters in the formula:
quantityOfDefaultUnitResult = (quantityOfNewUnit * factor) + constant
where,
quantityOfDefaultUnitResult = unit of measurement of factor 1 and constant 0
(default measurement)
quantityOfNewUnit = the new unit of measurement
factor = value of column D (factor from)
constant= value of column E (constant)
Example Set:
Example 1
Length - the default unit of measurement is meter.
1 km equals to 1000 m
Therefore, to convert km to m:
quantityOfMeters = quantityOfKm * 1000 + 0.
"factor from" is 1000
“constant” is 0
Example 2
Temperature - default unit of measurement if Celsius.
To get the parameters for Kelvin, use the formula: "C = 1K - 273.5"
"factor from" is 1
“constant” is -273.5
Example 3
Temperature - default unit of measurement if Celsius.
To get the parameters for Kelvin, use the formula: "C = 0.5555556 * F - 17.7777778"
"factor from" is 0.5555556
“constant” is -17.7777778
Example 4
Area - default unit of measurement if square meter.
1 square_decimeter equals to 0.01 square_meters.
Therefore, to want to convert dm2 to m2:
quantityOfSquareMeters = quantityOfSquareDecimeters * 0.01 + 0.
"factor from" is 0.01
“constant” is 0
***Important: All columns are case sensitive.
For example, data type "area” and "Area" are NOT the same.
2) Adding a new measurement type:
To add a new measurement type you are required to edit all four files.
a) Open the file "UOM_SI.Types and add a new row for the new Data Type.
b) In column A, enter the data type’s Id.
Note: this column is case sensitive.
c) In column B, enter a description for the data type
This is the column that will be displayed in VISUAL*eyes.
d) Open the UOM_SI.csv and add the units of measurement.
Refer to the above section entitled “Adding a new measurement unit for an
existing data type".
Note: You must set one unit of measurement as the "default" unit
To do this, set
"factor from" = 1
"constant" = 0
e) Open the UOM_SI_MULT_CONV.csv to set the resulting conversion data type
(the resulting data type when you multiply this new data type by another data
type).
As an example, if you had a data type called "newDataType", to create a
conversion, follow these steps:
Column A (Result Type) = newDataType
Column B (operand types) = number*newDataType
This means that when you multiply your new data type by a number, the resulting
data type is also of type "newDataType".
The order is not important, so if you've added the rule
number*newDataType = newDataType,
it is unnecessary to add
newDataType*number = newDataType
f) Open UOM_SI_DIV_CONV.csv to set the resulting conversion data type (the
resulting data type when you divide this new data type by another data type).
As an example, to create a conversion using datatype "newDataType"
Column A (Result Type) = newDataType
Column B (operand types) = newDataType/number
This means that when you divide the new data type by a number, the resulting data
type is also of type "newDataType".
Download