for_developers:simulator
Extending the Simulator
How to add a new device type to sim-eeros?
- create class derived from SimBehaviour.hpp
- implement member functions according to your needs
- constructor: create your simulation channels
- run() : implement your desired simulation function → will be called from SimDevice::run()
- getInChannel(): return shared_ptr to input channel of your device
- getOutChannel(): return shared_ptr to output channel of your device
- add newly created device type as member object to SimDevice.hpp (for example see sim::Reflect reflectDigOut)
- call run() of your newly added channels in SimDevice::run(): only with this your device run() is executed
- add identifier string to available simFeatures in SimDevice.hpp
- add entries to SubDeviceNumber-Enum in SimDevice.hpp with your desired subdevice number for your sim-device
- add getInChannel() and getOutChannel() of your device type to getLogicChannel() or getRealChannel() in SimDevice.cpp accordingly
for_developers/simulator.txt · Last modified: 2017/05/04 08:58 by 127.0.0.1