The Units Conversion interface helps convert different metrics, units, and measurement systems. This interface is equipped with a user-friendly layout and includes tabs for both MetricToImperial and ImperialToMetric conversions. It features a navigation panel for additional functionalities, a description box displaying the last update of the conversion table, and a detailed unit conversion table.
On this page:
Understanding Units Conversion
Definition
Units Conversion is a software interface that enables users to convert units from metric to imperial and vice versa.
Purpose
The purpose of Units Conversion is to provide a reliable tool for accurate and quick conversions between different measurement systems.
Function
Units Conversion functions through a structured table that lists base units, new units, divisors, and additional numbers for conversions across various measurement types like area, volume, mass, and temperature.
Operation
Users operate the Units Conversion interface by selecting the conversion direction from the tabs, navigating through the panel for different actions, and utilizing the conversion table to obtain the desired unit conversions.
Application
Units Conversion finds application in fields like engineering, construction, and science, where precise conversions between metric and imperial units are necessary for calculations and measurements.
Usage
To use Units Conversion, users select the appropriate tab for their conversion direction, locate the required units in the table, and apply the provided factors for accurate conversion results. The search button aids in finding specific units or conversion factors quickly.
Configuring Units Conversion
Go to Displays→ Units Conversion.
Creating Units Conversion
Working with Units Conversion
Using Units Conversion
Properties Reference
Units Conversion properties
Localization
You can localize the text in your application in as many languages as needed. To do this, create a dictionary for each language.
To localize the user interface text, be sure to select the Localizable option (Dynamics Configuration window, TextOutput options) for each display component that you need to localize.
To create a Units Conversion dictionary:
- Go to Displays → Units Conversion.
- Click New.
- The Create New Localization Dictionary window will display.
- Enter a name for the dictionary.
- Click OK.
- Click Load Strings to populate the table with all the controls that have strings that are set to Localizable. In the TranslatedText column, enter the text in the dictionary language.
- Create controls in a display or write a script to use the object called
Client.Dictionary
to configure the dictionary or dictionary options for the user. When the dictionary changes, the language changes throughout the application.
The alarm messages can also be included in the localization if the related check-box is set.
On Solution Settings → General, you can define the default Culture Information that the application is using. The runtime property Client.CultureInfo
allows you to change it during runtime. Some display controls may get the Culture Info directly from the Operating System. In this situation, the correct procedure is for both the Operating System settings and the solution settings to have the application's target culture.
Find Detailed Docs Here: Themes
Language Switching Example
This particular example is a special case of language switching because it involves language change linked with reference tags.
- Reference Tags function in the same way as the Tag being referenced, regardless of receiving different objects, with different descriptions and different enumeration sets. To ensure that the conversion will occur correctly in the FullDescription and ValueAsString properties, you must ensure that the Reference Tag is pointing to the desired object. You can use the syntax below in DisplayOpening in CodeBehind:
@Tag.
<ReferenceTagName>. Link = @Tag.<TagName>
. GetName()
; - In texts marked as Locatable in Symbols that are appearing in Dictionaries > Location, you should make sure that the texts are being passed for translation.
To add to the Dictionary the properties of all tags that can be associated with the reference tag that is being used in the display, follow the practical example.
If the reference tag is not automatically loaded in the Dictionary when clicking on the Locatable option and is not being translated from one language to another on the screen, follow the steps below:
- Add the method
Client.Locale(Tag.xxx)
on the Expression field of your TextBlock, to translate it to the currentClient.Localization
:
On the En_US dictionary, create one row for each TextBox you want to translate, containing the original text(in Spanish) and the Translated Text(in English).
This procedure should work for every reference tag you have in your solution.
Translate the column title of the DataGridWindow component
To translate the column title of the DataGridWindow component, it's noticed that this field does not have the locatable option and does not recognize Client.Locale()
as a function.
To translate column titles in a DataGrid, a script must be created.
The method below iterates for each column in the data grid and applies the @Client.Locale
function to them. After the loop, the DataGrid is updated.
public void gridcolumntitle(){ TDataGridWindow grid = this.CurrentDisplay.GetDataGrid("grid") as TDataGridWindow; foreach (GridColumn col in grid.Columns) { col.Title = @Client.Locale(col.Title); } grid.DoRefresh(); }
To avoid overloading the client and maintain efficiency, the gridcolumntitle()
method should only be called if the @Client.Localization
has changed:
public void DisplayIsOpen() { if(!@Client.Localization.Equals(aux)){ gridcolumntitle(); aux = @Client.Localization; } }
In this section: