A data type node may have attributes as extra constrains, or optimization of user interface.
For example, if a “Number” type has 2 attributes:
- Min = 0
- Step = 1
It’s value will be limited to a positive integer or 0. Although a number can be any real number, a minimum 0 with step of 1 adds additional constraints.
Those constraints are enforced in client user interface (Users’ Smartphone).
Following attributes applies to Number type. These attributes will affect the input normalization and validation on client UI (e.g. Smartphone).
- Min - A number represents the minimum acceptable value.
- Max - A number represents the maximum acceptable value.
- Step - A number constraints the minimum precision. Must be used with “Min” or “Max” or both.
- Default - Default value initialized.
- ShowPercentage - Only valid with “Min”, “Max” and “Step” are all specified. A percentage indicator (0%-100%) will be displayed along with value on users’ screen.
- Physical Quantity - The number represents a physical quantity. Physical quantity has following properties:
- Quantity Type - Type of physical quantity.
- Units of Measure - The unit of measure of this value, which is defined in “The Unified Code for Units of Measure” (look for the “c/s” field).
- “Cel” - Temperature degree Celsius
- “[degF]” - Temperature degree Fahrenheit
- “m” - Meter
- “km” - Kilometer
- “cm” - Centimeter
- “mm” - Millimeter
- “mil” - Mil
- “[in_i]” - Inch
- “[ft_i]” - Foot
- “[yd_i]” - Yard
- “[mi_i]” - Mile
- “g” - Gram
- “kg” - Gram
- “[gr]” - Grain
- “[lb_av]” - Pound
- “[oz_av]” - Ounce
- Quantity Type - Type of physical quantity.
On user’s screen, the input UI can be optimized based on attributes. For example, a wheel can be used to facilitate the steps. A percentage value can also be displayed along with actual value.
For example, the level for lighting is 0-255. A percentage value will give regular user better understanding.
Number Editor with Percentage, Step Wheel and Value Input.
Number Editor with Value Input only.
Display Percentage along with Value
A “Physical Quantity” field is required to define a “Target Unit” and a list of “Alternative Lists”.
For example, a “Temperature Field” may be defined as below:
“Target Unit” and “Alternative Units” can be further customized:
“Target Unit” is the unit used as input of the App code. In example above,
- “Target Unit” is in Celsius
- The value ranges between 7°C and 32°C, with a step of 0.1°.
“Alternative Units” defines a list of units that affects user interface (on Smartphone). In example above,
- Alternative Units defines both Celsius (°C) and Fahrenheit (°F).
- Note Celsius is defined again with a different step value (precision) of 0.5°C.
- Fahrenheit defines a range that is close to the range of Celsius (between 45°F and 89°F).
Right now Fahrenheit is only in United States and its island territory. The Smartphone will automatically adopt correct input UI based on the Regional Settings of the phone.
For example, both British and United States use English language. However, on a phone with British region, the UI will accept Celsius (°C), while on phones with United States region, Fahrenheit (°F) will be used.
No matter what unit is used in the UI, the user input will be automatically converted into “Target Unit”, which is Celsius with 0.1 °C of precision (step value).
The screenshots below demonstrates the presentation of a task, with different region settings (United States and China).
Note the UI is automatically translated and temperature Units are automatically adjusted.
Note: With current release only temperature conversion is supported. More unit conversion will be implemented in the future.
Boolean, String and Enumeration Attributes
Percentage value can be displayed along with value on users’ screen, if “ShowPercentage” attribute is specified.
- Default - Default value when first initialized.
Device must have additional constraints. This rule is enforce by Signature Editor UI.
Device type constraints can have more than 1 entries. Entries are “or”ed together.
For example, below represents “On/off Load” or “Level Control Load” devices.
Each individual entrie may have more than one “capabilities” and together.
For example, in the UI below, more “capabilities” can be added along with “On/off”.
Other Attributes on Device
- Exclusive Write - Only one task is allowed to write (control) the device.
- Readonly - Device can only be read by App
If one task with “Exclusive Write” on a device is started. Only tasks with “Readonly” on same device is allowed to run.
Virtual Device Attribute
Virtual device is force to have an attribute with the following information.
- Load Types
- Device Type
- Capabilities (1 or more is allowed)
If a node has “Nullable” attribute, the node can be a special “Null”. “Nullable” applies to any type, except for List (array) item. In another word, List can not have “Null” member item.
Nullable type will be displayed with a “Create” button on users’ screen.
User click “Create” button to create a default value for nullable type. For example, a boolean value.
User can also “delete” a nullable value. Once deleted the value will be reset to “null” again.
Table Member Attributes
- Header - Applies to certain primitive type of a direct member of table type.
This attribute affects the user interface optimization on client (e.g. users’ Smartphone).
For example, in our “Light Show” example, the “Light” field has “Header” attribute.
If the attribute is removed, the difference is show in the two screenshots below.
Note, the array member line is replaced by a device node, which is, still unique by design and visually much cleaner.
- Minimum Size - Minimum allowed size.
- Maximum Size - Maximum allowed size.
- Unordered Set - The order of the member items is not important. This allows UI optimization.
“Unique” Attribute on Array Members
The attributes below can be applied to array member of certain types (Enumeration, User, Device).
- Unique - The value has to be unique among other members of the array.
Combining “Unordered Set” on a List and “Unique” on member allows powerful UI optimization, on “Enumeration”, “Device” and “User” type. It will turn a list (array) into a multi-select check dialog.
Note the beauty of this “Unique” attribute is that, it doesn’t limit to direct child type of an array. It can be a child type of array member type.
Task Related Attributes
- Singleton - Only one task instance of this function (regardless of which version of App) is allowed to run.
Security Related Attributes
This will be supported in the future.
- URL - External URL access request
Work in Progress
More attributes will be introduced in the future.
The related technology has been granted US patent.