nasa / fpp

F Prime Prime: A modeling language for F Prime
https://fprime.jpl.nasa.gov
Apache License 2.0
46 stars 31 forks source link

ComponentTester.cpp from-port handlers not implemented #397

Closed thomas-bc closed 4 months ago

thomas-bc commented 5 months ago

We have seen reports of an issue (https://github.com/fprime-community/fprime-tutorial-math-component/issues/26) in the MathComponent tutorial where the handler for Tester::from_mathOpOut_handler() is still marked as TODO after following the tutorial.

After some investigation, I have found that the Python autocoders used to implement that handler

  void Tester ::
    from_mathOpOut_handler(
        const NATIVE_INT_TYPE portNum,
        F32 val1,
        const MathModule::MathOp &op,
        F32 val2
    )
  {
    this->pushFromPortEntry_mathOpOut(val1, op, val2);
  }

Where fpp-to-cpp autocodes

  void Tester ::
    from_mathOpOut_handler(
        const NATIVE_INT_TYPE portNum,
        F32 val1,
        const MathModule::MathOp &op,
        F32 val2
    )
  {
    // TODO
  }

Is this something we can get fpp-to-cpp to do as well?

bocchino commented 5 months ago

Yes, we should fix this. Also, we should get that code out of the user-edited template and into the auto-generated code.