Here is a list of convention our FT Optix technicians uses when creating new projects, feel free to choose if this can apply to your project
-
Use significative names for every project element (no default names)
- Exception is made when creating object types, still remember to give meaningful name if possible
- Avoid using number at the end of item name
- Avoid abbreviations in object names to improve readability
- Examples:
Templates/SpinBox (Type)
-> BADTemplates/SpinBoxWithGreenBorder (Type)
-> GOODMainWindow/SpinBox1
-> BADMainWindow/MotorSpeed_SpinBox
-> GOODMainWindow/MotorSP_SB
-> BAD
-
Nice to use same EmbeddedDatabase for every item to be stored
- Multiple tables can be used in same EmbeddedDatabase with different settings (RecordLimit, Names, etc)
-
Use
PascalCase
for object names -
Use
camelCase
for variable names (Model, Session and Local variables) -
All graphical elements should be in
UI
folder- Here you can create standard folders to organize your work, such as:
UI/Templates
-> Contains all custom types used to create objectsUI/Screens
-> Contains the different pages that are used in the project
- Both subfolder can have children subfolder to organize elements if needed
- Example:
UI/Templates/MotorWidgets
UI/Templates/PumpsWidgets
UI/Screens/Filler
UI/Screens/Settings
- Example:
- Nice to use Templates folder in any first level project folder (e.g. UI, Model, Converters, etc...) when creating custom types
- Here you can create standard folders to organize your work, such as:
-
Global variables should be created in the
Model
folder (and subfolder) -
Nice to use HTML color palette if no special need for custom coloring
- Example:
red
-> GOOD#FFA1C8
-> BAD
- Example:
-
Object names and LocalizationDictionary keys should be in English
-
Nice to sort items by their type in project tree
- Exception is made when defining layers is necessary to build final interface (bottom most element is highest layer)
-
When creating a new page/container, avoid using a
Panel
with aRectangle
as coloured background to avoid doubling project nodes- Use instead:
Screen
if the object is a whole screen that is going to be displayed in the HMIRectangle
if coloured background is neededPanel
if background should be transparent (usually to group elements)
- Use instead:
-
Nice to group items using Panel
- This is useful to reduce project complexity when assigning groups-based permissions and/or to trigger specific visual logics (enabling, visibility, etc)
-
Nice to use same
Label
name andLocalizationDictionary
item key -
Nice to use keyword in controls names to identify which variable/object is referring to
- Example:
VoltageText
-> Label that shows the translation key for the Voltage elementVoltageValue
-> Name for a LinearGauge controlling Voltage value
- Example: