Pseudo code pour Module Capteur

  • NOMENMAJUSCULE : partie a remplacer via generation de code
  • __foreach xxxxx___
    traitement a faire en boucle via generation de code

  • Exemple de fichier genere
    • ATTENTION les commentaires presents dans ce code sont anciens et ne correspondent pas a ce qui est indique dans le pseudo code

Fichier PhRSensor_NOMMODULESENSOR.h

//----------------------------------------------------------
// Module Sensor NOMMODULESENSOR
//----------------------------------------------------------

#ifndef __orc_PhRSensor_NOMMODULESENSOR_h
#define __orc_PhRSensor_NOMMODULESENSOR_h

#include "Exec/phr.h"


class orc_PhRSensor_NOMMODULESENSOR : public PhRSensor {
private:

public: 
   orc_PhRSensor_NOMMODULESENSOR(ProcedureRobot *prr) : PhRSensor (prr, "NOMMODULESENSOR") {};
   ~orc_PhRSensor_NOMMODULESENSOR();

    // Output Ports declaration
    __foreach output port write declaration as : typename OUTPUTPORTVARNAME;__
    // Event Ports declaration
    __foreach output port write declaration as : int EVENTPORTVARNAME;__
    // Methods to call functions driver
    __foreach input port write declaration as : void PUT_INPUTPORTVARNAME(const typename &INPUTPORTVARNAME);__
    __foreach output port write declaration as : void GET_OUTPUTPORTVARNAME();__
    // Methods to control the driver mode
    void reinit(); 
    void param(); 
    int Init(); 
    int Close(); 
};

#endif 
// End of Module Sensor NOMMODULEPHYS

Fichier PhR_NOMMODULESENSOR.cpp

//----------------------------------------------------------
// Module Sensor NOMMODULESENSOR
//----------------------------------------------------------

#include "PhRSensor_NOMNODULESensor.h"

__foreach input port write definition as :
// 
// Orccad Version: ORCCADVERSION
// Driver Call
// Module : PUT_INPUTPORTVARNAME
// Call Driver File for variable: 
//     input typename INPUTPORTVARNAME
// Date of creation : DATEOFREATION
//
void orc_PhR_NOMMODULESENSOR::PUT_INPUTPORTVARNAME(const typename &INPUTPUTPORTVARNAME)
)
{
__Add code specified by user if any ?__
}
__

_foreach output port write definition as :
// 
// Orccad Version: ORCCADVERSION
// Driver Call
// Module : GET_OUTPUTPORTVARNAME
// Call Driver File for variable: 
//     output typename OUTPUTPORTVARNAME
// Date of creation : DATEOFREATION
//
void orc_PhR_NOMMODULESENSOR::GET_OUTPUTPORTVARNAME()
)
{
__Add code specified by user if any ?__
}
__

// 
// Orccad Version: ORCCADVERSION
// Module : NOMMODULESENSOR
// Initialisation Driver File
// 
// Driver Ports : 
//    __foreach input port write declaration as : input typename INPUTPORTVARNAME__
//    __foreach output port write declaration as : output typename OUTPUTPORTVARNAME__
// Date of creation : DATEOFREATION
//
void orc_PhR_NOMMODULESENSOR::Init()
{
__Add code specified by user if any ?__
} 

//
// Orccad Version: ORCCADVERSION
// Module : NOMMODULESENSOR
// End File 
// 
// Driver Ports : 
//    __foreach input port write declaration as : input typename INPUTPORTVARNAME__
//    __foreach output port write declaration as : output typename OUTPUTPORTVARNAME__
// Date of creation : DATEOFREATION
//
void orc_PhR_NOMMODULESENSOR::Close()
{
__Add code specified by user if any ?__
} 

//
// Orccad Version: ORCCADVERSION
// Module : NOMMODULESENSOR
// End File 
// 
// Driver Ports : 
//      __foreach input port write declaration as : input typename OUTPUTPORTVARNAME__ 
//      __foreach output port write declaration as : output typename OUTPUTPORTVARNAME__
// Date of creation : DATEOFREATION
//
void orc_PhR_NOMMODULESENSOR::reinit()
{
__Add code specified by user if any ?__
} 

//
// Orccad Version: ORCCADVERSION
// Module : NOMMODULESENSOR
// End File 
// 
// Driver Ports : 
//      __foreach input port write declaration as : input typename OUTPUTPORTVARNAME__
//      __foreach output port write declaration as : output typename OUTPUTPORTVARNAME__
// Date of creation : DATEOFREATION
//
void orc_PhR_NOMMODULESENSOR::param()
{
__Add code specified by user if any ?__
} 

// End of class orc_PhRSensor_NOMMODULESENSOR

-- SorayaArias - 07 Apr 2010
Topic revision: r1 - 07 Apr 2010, SorayaArias
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding SedWiki? Send feedback