|
FhSim
3.1.0
Marine systems simulation
|
The <OBJECTS> section declares the SimObjects that participate in the simulation. Each SimObject is loaded from a shared library at runtime.
Each SimObject is specified by a <Lib /> tag with the following attributes:
| Attribute | Required | Description |
|---|---|---|
LibName | Yes | Name of the shared library containing the SimObject implementation (without platform-specific prefix/suffix). |
SimObject | Yes | The type name of the SimObject within the library. |
Name | Yes | A unique instance name for this SimObject. Used to reference it in other sections. |
| *(any other)* | No | SimObject-specific parameters. Names and types must match the implementation. |
<Lib> is the only element type the object loader understands. Any other element inside <OBJECTS> is read and then rejected with "The simulation object
of class ... was not found."Mass, then Mass="20.0" is valid. Parameters with a default value in the implementation can be omitted. A parameter given twice on the same element keeps the last value and logs a warning.LibName and Name included — goes through $Variable substitution and then the arithmetic evaluator, so Mass="2*1000" is valid. See VARIABLES section and Arithmetic in attribute values for the exact rules.LibName is not searched for on a system library path. It is turned into a relative file path and looked up against the working directory, which is the directory FhSim has selected at startup — see Path resolution.
LibName contains a / or \, everything before the last one is used as the directory. Otherwise the directory is the literal subdirectory SimObjectLibraries..dll (Windows) or .so (Linux). The build configuration appends, in order: Vis for a visualisation build, _static for a static build, _d for a debug build, and then the platform extension. On Linux the prefix lib is added.fhsim_ inserted before it. If neither exists the run stops with an error naming both paths tried.Because of step 3, LibName="base" and LibName="fhsim_base" both find the same library: a release Linux build without visualisation tries SimObjectLibraries/libbase.so and then SimObjectLibraries/libfhsim_base.so. The examples in this manual use the full fhsim_base spelling.
LibName="fhsim_base" resolves to fhsim_baseVis_d.dll from a debug visualisation build, fhsim_baseVis.dll from a release visualisation build and fhsim_base.dll from a release build without visualisation. Mixing variants in one installation does not work.