Working with HDevEngineπ
As the name suggests, HDevEngine is the βengineβ behind HDevelop. It allows you to execute complete HDevelop programs or individual procedures from a C++ or .NET application, and also from Python.
HDevEngine loads HDevelop code dynamically, which makes it possible to update the machine-vision part of an application without recompiling and relinking the application as long as the procedure signature is unchanged. This keeps the algorithm in HDevelop files while the surrounding application logic stays in C++, .NET, or Python.
What HDevEngine can doπ
HDevEngine can:
- Execute complete HDevelop programs
- Execute local or external HDevelop procedures
- Use the same HDevelop logic for prototyping and production
- Keep the HDevelop implementation separate from the surrounding application code
- Provide an application-specific implementation of internal
dev_*operators
What HDevEngine does not doπ
HDevEngine does not implement the full HDevelop user interface or all internal display operators.
In particular, it does not provide the complete visualization environment of HDevelop; operators such as dev_display must be redirected to your own implementation in the application.
This gives you precise control over where and how results are displayed.
Main conceptsπ
The HDevEngine concepts are the same regardless of the host language:
- A program is loaded as an
HDevProgramand executed via anHDevProgramCall. - A procedure is loaded as an
HDevProcedureand executed via anHDevProcedureCall. - The procedure path controls which HDevelop files are found.
- Engine settings and operator implementations are managed globally.
- Errors are reported via
clHDevEngineExceptionName(C++/C#) or the equivalent Python exception.
Main classesπ
The core classes are:
clHDevEngineNameclHDevProgramNameclHDevProgramCallNameclHDevProcedureNameclHDevProcedureCallNameclHDevOperatorImplNameclHDevEngineExceptionName
For a detailed overview, see About the main classes and methods of HDevEngine.
Typical application flowπ
The typical workflow is:
- Configure the engine and the procedure path.
- Load the HDevelop program or procedure.
- Create the matching call object.
- Set input parameters.
- Execute the program or procedure.
- Read output parameters and handle exceptions.
This is described in Creating an application with HDevEngine and in the example program.
Parallel programming and debuggingπ
HDevEngine is designed to be reentrant and thread-safe in the sense that multiple call instances can exist concurrently. However, global configuration such as the procedure path and the registered operator implementation is shared. For this reason, configure and load programs or procedures before parallel application threads are started, and synchronize access when shared state is modified.
For remote debugging, the engine can expose a debug server that can be attached from HDevelop. This is useful when debugging embedded HDevelop logic in a larger application.
.NET interfaceπ
The .NET interface follows the same concepts as the C++ and Python APIs. It is described in HDevEngine in .NET applications.
Python interfaceπ
The Python interface follows the same concepts as the C++ and .NET APIs. It is described in HDevEngine in Python applications.