Esempio n. 1
0
/*!
 * \brief Thread loop processing messages received from module.
 * \note This function is called when interface is started. Once new data has arrived, module non-specific signals are emitted.
 * \note After that, virtual processPortData function is called, which processes module-specific data and emits signals.
 */
void Interface::run()
{
    while(isRunning())
    {
        //read data from module
        if(inputPort.read(receivedBottle))
        {
            //process module-non-specific data
            if(receivedBottle.get(0).asString()=="gpuList")
            {
                processGpuList();
            }
            else if(receivedBottle.get(0).asString()=="message")
            {
                printMessage();
            }
            else if(receivedBottle.get(0).asString()=="status")
            {
                emit statusReceived(receivedBottle.get(1).asInt());
            }
            else if(receivedBottle.get(0).asString()=="progress")
            {
                emit progressReceived(receivedBottle.get(1).asInt());
            }

            //process module-specific data - this should be overridden by inheriting classes
            processPortData();
        }
        else
        {
            qDebug(" - %s_gui(%i): leaving interface event loop", module->binary.toStdString().c_str(), module->instance);
            break;
        }
    }
}
Esempio n. 2
0
void wavrNetwork::tcp_receiveProgress(QString* lpszUserId, QString* lpszData) {
    emit progressReceived(lpszUserId, lpszData);
}