¶ How to standardise my code?
Standardising code in AutomationView requires a shift in mindset: you must think in terms of modularity, reusability, and separation of concerns. Instead of writing hardcoded logic for every component, aim to create generic structures that can be instantiated for multiple pieces of equipment.
¶ The Standardisation Mindset
- Think Generic: Design your logic so that it isn't tied to a specific variable address but rather to a functional role (e.g., "Motor", "Valve").
- Encapsulate: Group related actions and steps into reusable blocks.
- Consistency: Use consistent naming conventions for your variables and sequences across your entire project.
AutomationView provides two primary mechanisms to help you achieve this:
- The Templating System: For inserting reusable snippets of logic across different sequences.
- Base Classes & Dynamic Sequences: For creating object-oriented structures where updates to a Base Class automatically propagate to all instances (Dynamic Sequences).