示例#1
0
MainThread::MainThread( const orcaice::Context &context ) 
: orcaice::SubsystemThread( context.tracer(), context.status(), "MainThread" )
, context_(context)
, descr_(new orca::ImageDescription())
, config_()
{
}
示例#2
0
MainThread::MainThread( const orcaice::Context& context ) : 
    SubsystemThread( context.tracer(), context.status(), "MainThread" ),
    context_(context)
{
    // this subsystem will initialise and exit, but the component will continue running.
    setSubsystemType( gbxutilacfr::SubsystemEarlyExit );
}
示例#3
0
MainThread::MainThread( const orcaice::Context &context ) 
    : SubsystemThread( context.tracer(), context.status(), "MainThread" ),
      context_(context)
{    
    // this subsystem is designed to terminate early (before the component itself)
    // we have to let Status know so it can use this info in summarizing the component's
    // state.
    setSubsystemType( gbxutilacfr::SubsystemEarlyExit );
}
示例#4
0
HwThread::HwThread( const orcaice::Context &context ) :
    SubsystemThread( context.tracer(), context.status(), "HwThread" ),
    context_(context)
{
    setMaxHeartbeatInterval( 10.0 );

    //
    // Read settings
    //
    Ice::PropertiesPtr prop = context_.properties();
    std::string prefix = context_.tag() + ".Config.";

    isMotionEnabled_ = (bool)orcaice::getPropertyAsIntWithDefault( prop, prefix+"EnableMotion", 1 );

    // Dynamically load the library and find the factory
    std::string driverLibName = 
        orcaice::getPropertyWithDefault( prop, prefix+"DriverLib", "libHydroBicyclePlayerClient.so" );
    context_.tracer().debug( "HwThread: Loading driver library "+driverLibName, 4 );
    // The factory which creates the driver
    std::auto_ptr<hydrointerfaces::BicycleFactory> driverFactory;
    try {
        driverLib_.reset( new hydrodll::DynamicallyLoadedLibrary(driverLibName) ); 
        driverFactory.reset(  
            hydrodll::dynamicallyLoadClass<hydrointerfaces::BicycleFactory,BicycleDriverFactoryMakerFunc>
            ( *driverLib_, "createBicycleDriverFactory" ) );
    }
    catch (hydrodll::DynamicLoadException &e)
    {
        context_.tracer().error( e.what() );
        throw;
    }

    // create the driver
    try {
        context_.tracer().info( "HwThread: Creating driver..." );
        driver_.reset( driverFactory->createDriver( context_.toHydroContext() ) );
    }
    catch ( ... )
    {
        stringstream ss;
        ss << "HwThread: Caught unknown exception while creating driver";
        context_.tracer().error( ss.str() );
        throw;
    }  
}
示例#5
0
ReplayConductor::ReplayConductor( orcalog::MasterFileReader       &masterFileReader,
                                  std::vector<orcalog::Replayer*> &replayers,
                                  const IceUtil::Time             &beginTime,
                                  double                           replayRate,
                                  const orcaice::Context          &context )
    : SubsystemThread( context.tracer(), context.status() ),
      isPlaying_(false),
      isPlayingOrAboutToStart_(false),
      masterFileReader_(masterFileReader),
      replayers_(replayers),
      context_(context)
{
    clock_.setReplayRate(replayRate);

    bool cursorValid = masterFileReader_.getCursorTime( firstItemSec_, firstItemUsec_ );
    assert( cursorValid );

    // Fast-forward if non-zero beginTime
    if ( beginTime > orcalog::iceUtilTime(0,0) )
    {
        fastForward( beginTime );
    }
}
示例#6
0
MainThread::MainThread( const orcaice::Context &context ) :
    orcaice::SubsystemThread( context.tracer(), context.status(), "MainThread" ),
    context_(context)
{
}
示例#7
0
MainThread::MainThread( const orcaice::Context& context ) :
    SubsystemThread( context.tracer(), context.status(), "MainThread" ),
    context_(context)
{
    setMaxHeartbeatInterval( 20.0 );
}
示例#8
0
TestThread::TestThread( Config config, const orcaice::Context &context ) :
    orcaice::SubsystemThread( context.tracer(), context.status() ),
    config_( config ),
    context_(context)
{
}