Pseudo code pour Module Algo
- NOMENMAJUSCULE : partie a remplacer via generation de code
-
__foreach xxxxx___
traitement a faire en boucle via generation de code
- Exemple de fichier genere
Fichier module_NOMMODULEALGO.h
//----------------------------------------------------------
// Module NOMMODULEALGO
//----------------------------------------------------------
#ifndef __orc_Mod_NOMMODULEALGO_h
#define __orc_Mod_NOMODULEALGO_h
#include "Exec/mt.h"
#include "Exec/rt.h"
#include "Exec/module.h"
class orc_Mod_NOMMODULEALGO: public ModuleAlgo {
protected:
// Internal Variables
public:
orc_Mod_NOMMODULEALGO(ModuleTask *mt,int indexclk):
ModuleAlgo("orc_Mod_NOMMODULEALGO",mt,indexclk) {};
~orc_Mod_NOMMODULEALGO() {};
// Output Ports declaration
__foreach output port write declaration as : typename OUTPUTPORTVARNAME;__
// Output Event Ports declaration
__foreach output port write declaration as : int EVENTPORTVARNAME;__
// Input/Output param Ports declaration
__foreach input/output param port write declaration as : typename OUTPUTPARAMVARNAME;__
// Methods of computation
void init(
__foreach input port write method parameter as : const typename &INPUTPORTVARNAME,__
);
void param();
void reparam();
void compute(
__foreach input port write method parameter as : const typename &INPUTPORTVARNAME,__
);
void end();
};
#endif
// End of class orc_Mod_NOMMODULEALGO
Fichier module_NOMMODULEALGO.cpp
//----------------------------------------------------------
// Module NOMMODULEALGO
//----------------------------------------------------------
#include "module_NOMNODULEALGO.h"
#include "Exec/prr.h"
//
// Orccad Version: ORCCADVERSION
// Module : NOMMODULEALGO
// Initialisation File
//
// Module Ports :
// __foreach input data port write method parameter as : input typename INPUTPORTVARNAME,__
// __foreach output data port write method parameter as : output typename OUTPUTPORTVARNAME,__
// __foreach input/output param port write method parameter as : param typename INPUTOUTPUTPARAMPORTVARNAME,__
// __foreach output event port write method parameter as : output event OUTPUTEVENTVARNAME,__
//
// Time Methods usable in module files:
// GetLocalTime(): return relative period time as double value
// GetCurrentTime(): return global period time as double value
//
// Date of creation : DATEOFREATION
//
void orc_Mod_NOMMODULEALGO::init(
__foreach input port write method parameter as : const typename &INPUTPORTVARNAME,__
)
{
__Add code specified by user if any ?__
}
void orc_Mod_NOMMODULEALGO::param()
{
plugParam();
// Init Input Param -> to be checked
__foreach input/output param port write : PARAMVARNAME = INITVALUE;
}
void orc_Mod_NOMMODULEALGO::reparam()
{
__Add code specified by user if any ?__
}
//
// Orccad Version: ORCCADVERSION
// Module : NOMMODULEALGO
// Computation File
//
// Module Ports :
// __foreach input data port write method parameter as : input typename INPUTPORTVARNAME,__
// __foreach output data port write method parameter as : output typename OUTPUTPORTVARNAME,__
// __foreach input/output param port write method parameter as : param typename INPUTOUTPUTPARAMPORTVARNAME,__
// __foreach output event port write method parameter as : output event OUTPUTEVENTVARNAME,__
//
// Time Methods usable in module files:
// GetLocalTime(): return relative period time as double value
// GetCurrentTime(): return global period time as double value
//
// Date of creation : DATEOFREATION
//
void orc_Mod_NOMMODULEALGO::compute(
__foreach input port write method parameter as : const typename &INPUTPORTVARNAME,__
)
{
__Add code specified by user if any ?__
}
//
// Orccad Version: ORCCADVERSION
// Module : NOMMODULEALGO
// End File
//
// Module Ports :
// __foreach input data port write method parameter as : input typename INPUTPORTVARNAME,__
// __foreach output data port write method parameter as : output typename OUTPUTPORTVARNAME,__
// __foreach input/output param port write method parameter as : param typename INPUTOUTPUTPARAMPORTVARNAME,__
// __foreach output event port write method parameter as : output event OUTPUTEVENTVARNAME,__
//
// Time Methods usable in module files:
// GetLocalTime(): return relative period time as double value
// GetCurrentTime(): return global period time as double value
//
// Date of creation : DATEOFREATION
//
void orc_Mod_ManualCmd::end()
{
__Add code specified by user if any ?__
}
// End of class orc_Mod_NOMMODULEALGO
--
SorayaArias - 09 Mar 2010