Пример #1
0
void ireTask::Initialize(void)
{
    EnableDynamicComponentManagement();
    // For receiving system-wide logs
    mtsInterfaceRequired * required = AddInterfaceRequired(
        mtsManagerComponentBase::InterfaceNames::InterfaceSystemLoggerRequired,
        MTS_OPTIONAL);
    if (required) {
        required->AddEventHandlerWrite(&ireTask::Log, this, 
                                       mtsManagerComponentBase::EventNames::PrintLog);
    }
    SetInitializationDelay(30.0);  // Allow up to 30 seconds for it to start
}
Пример #2
0
mtsComponentViewer::mtsComponentViewer(const std::string & name) :
    mtsTaskFromSignal(name),
    UDrawPipeConnected(false),
    UDrawResponse(""),
    ShowProxies(false),
    ConnectionStarted(false),
    WaitingForResponse(false)
{
    SetInitializationDelay(30.0);  // Allow up to 30 seconds for it to start
    mtsInterfaceRequired * required = EnableDynamicComponentManagement();
    if (required) {
        ManagerComponentServices->AddComponentEventHandler(&mtsComponentViewer::AddComponentHandler, this);
        ManagerComponentServices->ChangeStateEventHandler(&mtsComponentViewer::ChangeStateHandler, this);
        ManagerComponentServices->AddConnectionEventHandler(&mtsComponentViewer::AddConnectionHandler, this);
        ManagerComponentServices->RemoveConnectionEventHandler(&mtsComponentViewer::RemoveConnectionHandler, this);
    } else {
        cmnThrow(std::runtime_error("mtsComponentViewer constructor: failed to enable dynamic component composition"));
    }
}