Moving Data Scope Embedded C++

13 Ansichten (letzte 30 Tage)
Paul Guenette
Paul Guenette am 26 Mär. 2019
Hello everyone,
I'm trying to export C++ using Embedded Coder from a Simulink model and I'm having trouble getting the interface to look how I want. Right now, I have this:
typedef struct {
real32_T UnitDelay_DSTATE;
} CppTestModel_DW_t;
typedef struct {
real32_T In1;
real32_T In2;
} CppTestModel_ExtU_t;
typedef struct {
real32_T Out1;
} CppTestModel_ExtY_t;
class CppTestModelModelClass {
public:
void initialize();
void step();
CppTestModelModelClass();
void setIn1(real32_T localArgInput);
void setIn2(real32_T localArgInput);
real32_T getOut1() const;
protected:
CppTestModel_ExtU_t CppTestModel_U;
CppTestModel_ExtY_t CppTestModel_Y;
private:
CppTestModel_DW_t CppTestModel_DW;
};
But I want to move the _DW, ExtU, and ExtY struct definitions insde the class definition. There's no reason in my view that they should be at the scope they are...
  1. Is there an easy way to do that?
  2. Is there any reason why I shouldn't do that?

Antworten (0)

Kategorien

Mehr zu Simulink Coder finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by