User Tools

Site Tools


for_developers:simulator

Extending the Simulator

How to add a new device type to sim-eeros?

  1. create class derived from SimBehaviour.hpp
  2. 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
  3. add newly created device type as member object to SimDevice.hpp (for example see sim::Reflect reflectDigOut)
  4. call run() of your newly added channels in SimDevice::run(): only with this your device run() is executed
  5. add identifier string to available simFeatures in SimDevice.hpp
  6. add entries to SubDeviceNumber-Enum in SimDevice.hpp with your desired subdevice number for your sim-device
  7. 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