Custom localization units

Customized units can be used either as default or custom variables in GpsGate and they will be displayed in the GUI and for reports. Unit Localization Keys are only available for Double variable types.

Example

For this example a device will be sending a volume signal in liters, but we will be creating a new variable and a new unit to display that signal in milliliters. First step is creating a new variable in SiteAdmin/Devices/Variables.

create

We can assign the SIGNAL_VOLUME unit but that will display the value in liters instead of milliliters. The Status tab can be used to make sure the unit that will be created is working as expected.

wrong

Create a new .measure file

Follow these steps to create the correct unit so it can be assigned to the variable VolumeMilliliters

    • 1. Log in to the server where GpsGate Server is installed
    • 2. Go to the path where GpsGate Server is installed and look for the Languages folder, usually C:\GpsGateServer\IIS\Resources\Languages .
    • 3. Create a new .measure file by creating a blank text file.
    • 4. Edit the file to include the new keys. In order to use the milliliter unit for the example used above the file has to look exactly like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
    <?xml version="1.0" encoding="utf-8" ?>
<MeasurementTable Name="metric">
  <Measurements>
 
    <Measure Name="Milliliter">
      <SourceUnit Name="UNIT_NAME_LITER" Symbol="UNIT_NAME_LITER" Plural="UNIT_NAME_LITER"
/>
      <TargetUnit Name="UNIT_NAME_MILLILITER" Symbol="ml" Plural="UNIT_NAME_MILLILITER" />
      <Converter Type="Linear" Factor="1000" Delta="0" />
      <Format Format="0.#" />
    </Measure>
 
  </Measurements>
</MeasurementTable>

After creating the new measurement file it is needed to rescan the files. Go to SiteAdmin/Settings/Localization and click the “Rescan languages and measurements” button. After this the custom variable can be created using the new unit “Milliliter” changeLastly check that the unit displayed in the Status tab is correct nowright

Measure file sections

These are the different sections that might be edited in the .measure file.

  • 1. MeasurementTable – Name: depending on the system of measurement it can be “metric”, “en-us”, “nautic”.
  • 2. Measurement – Name: this will be the name displayed on the list of units.
  • 3. SourceUnit: unit used for the received signal.
  • 4. TargetUnit: unit displayed in GpsGate Server.
  • 5. Converter – Factor: value applied to incoming signals to convert them into the desired unit.
  • 6. Format: format for the value displayed (with or without decimals, number of decimals, ...) this only applies to reports and not on the Status tab that will always display 2 decimals.

This can be used as template to create different units for the metric system:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0" encoding="utf-8" ?>
<MeasurementTable Name="metric">
  <Measurements>
 
    <Measure Name="Test1">
      <SourceUnit Name="UNIT_RECEIVED" Symbol="UNIT_RECEIVED" Plural="UNIT_RECEIVED" />
      <TargetUnit Name="UNIT_DISPLAYED" Symbol="UNIT_DISPLAYED" Plural="UNIT_DISPLAYED" />
      <Converter Type="Linear" Factor="1" Delta="0" />
      <Format Format="0.#" />
    </Measure>
 
    <Measure Name="Test2">
      <SourceUnit Name="UNIT_RECEIVED" Symbol="UNIT_RECEIVED" Plural="UNIT_RECEIVED" />
      <TargetUnit Name="UNIT_DISPLAYED" Symbol="UNIT_DISPLAYED" Plural="UNIT_DISPLAYED" />
      <Converter Type="Linear" Factor="1" Delta="0" />
      <Format Format="0.#" />
    </Measure>
 
  </Measurements>
</MeasurementTable>