void TestabilityService::sendRegisterMessage()
{  
    disconnect(mServerConnection, SIGNAL(connected()), this, SLOT(sendRegisterMessage()));

    QMap<QString, QString> attrs;
    attrs[PLUGIN_ID] = mPluginId;
    attrs[PLUGIN_NAME] = TestabilityUtils::getApplicationName();
    attrs[PLUGIN_TYPE] = TAS_PLUGIN;
#ifdef Q_OS_SYMBIAN
    quintptr uid = CEikonEnv::Static()->EikAppUi()->Application()->AppDllUid().iUid;
    attrs[APP_UID] = QString::number(uid);
#endif        
    QString message = makeReqisterMessage(COMMAND_REGISTER, attrs);

    mSocket->setResponseHandler(this);

    TasLogger::logger()->info("TestabilityService::reqisterServicePlugin send register message."); 
    mMessageId++;
    if(!mSocket->sendRequest(mMessageId, message)){
        TasLogger::logger()->error("TestabilityService::reqisterServicePlugin registering failed"); 
        mRegisterTime.stop();
        mSocket->closeConnection();
        connectionClosed();
    }
}
Пример #2
0
void VRRegisterSceneGraph::registerNode(osg::Node *node, string parent)
{
    if (blocked)
        return;
    //fprintf(stderr, "VRRegisterSceneGraph::registerNode %s\n", node->getName().c_str());
    whole_message = "SCENEGRAPH: \t";
    createRegisterMessage(node, parent);
    sendRegisterMessage();
    transparency_message = "SCENEGRAPHPARAMS: \t";
    createTransparencyMessage(node);
    sendTransparencyMessage();
}
/*!
     
    Register the TestabilityServiceable plugin to use the service.
    A register message is sent to the TasServer. The reqister
    message will include connection indentification that allows
    the server to send requests to the service and through to 
    the actual plugin.
    The sequence when registering is:
    1. Connect 
    2. Connected slot (listend to connected from socket) called send register
    3. emit registered
 
 */
void TestabilityService::registerPlugin()
{
    //close requested so do not register again
    QVariant prop = qApp->property(CLOSE_REQUESTED);
    if(prop.isValid() && prop.toBool()){
        return;
    }

    //remove paint tracking, paint tracking only on startup after this rely on the watchdog
    qApp->removeEventFilter(this);

    if(!mRegistered && !mRegisterTime.isActive()){
        TasLogger::logger()->info("TestabilityService::registerPlugin not registered begin register process..."); 
        mRegisterWatchDog.stop();
        mRegisterTime.start(SERVER_REGISTRATION_TIMEOUT);
        connect(mServerConnection, SIGNAL(connected()), this, SLOT(sendRegisterMessage()));
#if defined(TAS_NOLOCALSOCKET)
        mServerConnection->connectToHost(QT_SERVER_NAME, QT_SERVER_PORT);
#else
        mServerConnection->connectToServer(LOCAL_SERVER_NAME);
#endif   
    }
}