User avatar
Henrik
GpsGate
Posts: 229
Joined: Thu Jul 26, 2007 8:41 pm
Location: Sweden
Contact: Website

Use customized units in GpsGate Server

Mon Jul 06, 2009 4:00 pm

</br>
<font face="verdana" size="2">
<p>
<font face="verdana" size="3" color="#ffb443"><strong>Customized units in GpsGate Server</strong></font></br>
</p>

<p>
With version 2.2 (and later) of GpsGate Server it is possible to customize the units used in your installation by editing or adding new measurement files. The GpsGate Server has a default measurement setting per server and each user can also have individual measurement settings. Any number of measurement files can be installed on one server. This is a step by step-instruction how to do this
</p>

<p>
<strong>1. Getting started:</strong> The default measurement setting in GpsGate Server is metric (English-US and nautic measurement files are also available). In order to add your own measurements you need to edit an existing measurement file or create a new one.
</br>
</br>

a) If You have a server hosted on GpsGate.com, please find sample measurement files to use as templates here: <a href="/gpsgateserver/download.asp">Download measurement files</a>. Download the measurement files and send the customized file to GpsGate Support for installation on your hosted server.
</br>
</br>

b) If you have your own GpsGate Server installation put the customized measurement file in YourInstallPath/Resources/Languages
</br>
</br>

<strong>Note:</strong> The text editor you use should support UTF-8. And do remember to save the file as UTF-8
</p>

<p>
<strong>2. Creating a new measurement file:</strong> Copy an existing measurement file in the Resources-folder, select the one that is "closest" to your requirements. Open the copy with a program such as Notepad. All GpsGate measure names are listed in the measurement file with their current conversion settings. Do the following for each measurement to change the units used in your installation:
</br>
</br>

a) Change the MeasurementTable Name, this is what identifies your measurement file in the user interface
</br>
</br>

b) Select a TargetUnit Name, Symbol and Plural language keys
</br>
</br>

c) Set the conversion factor for your TargetUnit
</br>
</br>

d) If you add a new TargetUnit, remember to add the new language keys to your language files
</p>

<p>
<strong>3. Customization sample:</strong> To show the altitude in feet in your metric installation you should create a new measurement file with the altitude changed from meter to feet
</br>
</br>

a) Copy the file Metric.measure to a second file called Metric_2.measure. Open Metric_2.measure in Notepad.
</br>
</br>

b) Give the measurement table a unique name. Change the line <MeasurementTable Name="metric"> to <MeasurementTable Name="metric 2">
</br>
</br>

c) Find the measure "POS_ALTITUDE" in the template file:</br></br>
<Measure Name="POS_ALTITUDE"><br/>
  <SourceUnit Name="UNIT_NAME_METER" Symbol="UNIT_SYMBOL_METER" Plural="UNIT_PLURAL_METER" /><br/>
  <TargetUnit Name="UNIT_NAME_METER" Symbol="UNIT_SYMBOL_METER" Plural="UNIT_PLURAL_METER" /><br/>
  <Converter Type="Linear" Factor="1" Delta="0" /><br/>
  <Format Format="0.0" /><br/>
</Measure><br/><br/>

d) Change the TargetUnit names and conversion factor. Check your language files for existing "UNIT_" language keys, if you are adding a unit not yet present you need to add language keys to the language file. Calculate your conversion factor, the conversion factor from meter to feet is 1/0.3048 = 3.280839895013. The new file is shown below:</br></br>
<Measure Name="POS_ALTITUDE"><br/>
  <SourceUnit Name="UNIT_NAME_METER" Symbol="UNIT_SYMBOL_METER" Plural="UNIT_PLURAL_METER" /><br/>
  <TargetUnit Name="UNIT_NAME_FOOT" Symbol="UNIT_SYMBOL_FOOT" Plural="UNIT_PLURAL_FOOT" /><br/>
  <Converter Type="Linear" Factor="3.280839895013" Delta="0" /><br/>
  <Format Format="0.0" /><br/>
</Measure><br/></br>

e) Save the file in UTF-8 format
</br>
</br>

f) Open your language files and verify that the "UNIT_" language keys used for your TargetUnit are present, if not you must add the phrase keys (please look at the guide about language files for language file editing). These phrase keys need to be present in the language files:</br></br>
<Phrase key="UNIT_NAME_FOOT">foot</Phrase><br/>
<Phrase key="UNIT_SYMBOL_FOOT">ft</Phrase><br/>
<Phrase key="UNIT_PLURAL_FOOT">feet</Phrase><br/>
</p>

<p>
4. When you have done this, Logon as the SiteAdmin and go to the Settings-window, select the default measurement of your choice and click the Save-button and then click on the “Rescan languages and measurements” button, this will force the GUI to use your selected .measure file instead of using cached measurements.
</p>

<p>
If you have any questions we recommend you to visit our forum for GpsGate Server <a href="http://franson.com/forum/forum.asp?FORU ... m/forum</a>
</p>

<p>
<strong>The measurement file does not show up in the drop down! - Common errors</strong>
</br>
</br>

a. Check that the XML syntax is correct. Make a copy of your .measure file, change the extension to .xml and open it in Internet Explorer by double clicking on it. Internet Explorer will now verify the file, and display any errors.
</br>
</br>

b. Check the rights on the file. When you copy the file to the web folder, make sure the web server has right to read the file.
</p>

/ With regards GpsGate support

Return to “GpsGate Server - How to setup and use”