There are a number of things you must know about the old module before you will be able to fit it into the new framework. Here is the list:
...
//----------------
// Constructors --
//----------------
StpanaModule::StpanaModule(
const char* const theName,
const char* const theDescription )
: AppModule( theName, theDescription ), // Pass args. to parent class
_CES_control("CES_region_enable", this, true ), // CES clustering on
_PES_control("PES_region_enable", this, false ) // PES clustering off
//
// The above will default regional central strip clustering on and
// full plug strip clustering off.
{
// Add talk-to parameters created above to list of command handlers
commands( )->append( &_CES_control );
commands( )->append( &_PES_control );
}
//--------------
// Destructor --
//--------------
StpanaModule::~StpanaModule( )
{
}
//--------------
// Operations --
//--------------
void
StpanaModule::begin( AppJob* )
{
cout << name( ) << " begin Job call spinit_" << endl;
spinit_();
}
AbsEvent*
StpanaModule::event( AbsEvent* anEvent, int )
{
// Update IW need banks from input argument anEvent
F77_readIntoIW( anEvent, "PESETOWE" );
// now call the event entry for stpana
spevnt_();
// this will write the output banks back to Trybos
F77_writeFromIW( anEvent, "CESSCASS" );
return (AbsEvent*)anEvent;
}
This is an abbreviated version of this code. The full file may be found in
the cdfsoft2 distribution as $PROJECT_DIR/cas/StpanaModule.cc
It is important that any job which uses an A_C module also include in its
definition (the equivalent of a build_job file) the F77InterfaceModule.
This is done for the stpana test with this file:...
AppUserBuild::AppUserBuild( AppFramework* theFramework )
: AppBuild( theFramework )
{
AppModule* aModule;
aModule = new F77InterfaceModule( "F77DefModule", "Default Fortran Interface" );
add( aModule );
aModule = new StpanaModule( "StpanaDefModule", "Default Instance of Stpana" );
add( aModule );
aModule = new UserExample( "DefUserExample", "Default Instance of UserExample" );
add( aModule );
}
...
Again the full file can be found in $PROJECT_DIR/cas/test/Stpana_test.cc