Previous Topic

Next Topic

Book Contents

Book Index

Setup Guide

Installation

There are two approaches for installing the desired module components in the OSGi environment: automated and manual installation.

Automated Scripted Installation

The installation of the Units of Measurement Framework module can be performed through execution of a Kit Manager installation script found in ../bin/pscripts/units.txt file.

The Kit Manager is a utility that enables you to automatically install a component or a group of components by executing a predefined install script.

To use the Kit Manager to install a component:

  1. Go to the text console and make sure the Kit Manager bundle is available on your runtime.
  2. To initiate the installation, type:

    kitman.install "Units of Measurement"

To enable Functional Item TypeFactory for Units and for Quantities, execute the installation script "Units of Measurement FIM" found in units.fim.txt file:

kitman.i "Units of Measurement FIM"

To enable the management of the Units of Measurement Framework via web console, execute the installation script "Units of Measurement FIM Web" found in units.fim.web.txt file:

kitman.i "Units of Measurement FIM Web"

If you want to view or edit the content of a script you can find its text file in the <sdk_home>/runtime/osgi/bin/pscripts directory.

Manual Installation

If you want to install the Units of Measurement Framework module without using the provided Kit Manager installation scripts, you have to install the bundles for each module it depends on.

For manual installation of the Units of Measurement Framework module:

To enable Functional Item type factory for Units and for Quantities:

In this case the order is important since the FIM annotations are optionally used.

To enable web console management:

The list of the required bundles is located in the text file of each script in <sdk_home>/runtime/osgi/bin/pscripts folder.

System Properties

The Units of Measurement Framework module has the following system properties:

Property

Type

Default Value

Description

mbs.units.log.debug

boolean

not set

"True" value means "enabled debug" for com.prosyst.mbs.units.api.jar bundle. There is no default value, which is the same as "false" value.

mbs.units.log.console

boolean

not set

"True" value means print log messages on the standard streams if the logger is not initialized. It is useful if the API bundle is not started. There is no default value, which is same as "true" value.

mbs.units.number.type

string

not set

By default, the Units of Measurement framework is working with Java double numbers. This property can be set to "BigDecimal" to switch to java.math.BigDecimal numbers. That means good precision and bad performance.

mbs.units.use.precision

boolean

not set

If this property is set and mbs.units.number.type=BigDecimal, then calculation rounding is according to mbs.units.use.precision and mbs.units.rounding.mode.

mbs.units.precision

int

17

According to javadoc of java.math.MathContext: the number of digits to be used for an operation; results are rounded to this precision.

mbs.units.divide.scale

int

18

See javadoc of java.math.BigDecimal.divide(BigDecimal, int, int).

mbs.units.rounding.mode

string

not set

Possible values are: up, down, ceiling, floor, half_up, half_down, half_even and unnecessary. The definitions are available as part of the java.math.RoundingMode javadoc.

mbs.units.strip.trailing.zeros

boolean

not set

By default, the property is not set. In this case, it is read as "true", i.e. triling zeros will be removed. This is valid only if mbs.units.number.type=BigDecimal is used.

mbs.units.fim.log.debug

boolean

not set

"True" value means "enabled debug" for com.prosyst.mbs.units.fim.jar bundle. There is no default value, which is the same as "false" value.

mbs.units.fim.log.console

boolean

not set

This property is used by com.prosyst.mbs.units.fim.jar bundle. "True" value means print log messages on the standard streams if the logger is not initialized. There is no default value, which is the same as "true" value.