| 24 | virtual ~IgnitionModuleNode() { /* void */ } |
| 25 | |
| 26 | void generate(Engine *engine, EngineContext *context) const { |
| 27 | IgnitionModule::Parameters params; |
| 28 | params.Crankshaft = engine->getCrankshaft(0); |
| 29 | params.CylinderCount = engine->getCylinderCount(); |
| 30 | params.RevLimit = m_revLimit; |
| 31 | params.TimingCurve = m_timingCurve->generate(context); |
| 32 | params.CylinderCount = engine->getCylinderCount(); |
| 33 | params.LimiterDuration = m_limiterDuration; |
| 34 | engine->getIgnitionModule()->initialize(params); |
| 35 | |
| 36 | for (const Post &post : m_posts) { |
| 37 | std::set<IgnitionWireNode::Connection> connections = |
| 38 | post.wire->getConnections(); |
| 39 | for (const IgnitionWireNode::Connection &connection : connections) { |
| 40 | const int index = context->getCylinderIndex( |
| 41 | connection.first, |
| 42 | connection.second |
| 43 | ); |
| 44 | |
| 45 | engine->getIgnitionModule()->setFiringOrder(index, post.angle); |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | void connect(IgnitionWireNode *wire, double angle) { |
| 51 | m_posts.push_back({ wire, angle }); |
nothing calls this directly
no test coverage detected