Example #1
0
void MainWindow::setupConnections()
{
    // connect signals for menu actions
    connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveClicked()));
    connect(ui->actionLoad, SIGNAL(triggered()), this, SLOT(loadClicked()));
    connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(close()));
    connect(ui->actionShowTable, SIGNAL(triggered()), _pointsWidget, SLOT(show()));

    // connect signals to control calculation process (start, stop, pause, processed, ...)
    connect(this, SIGNAL(startProcessing()), _plotBuilder, SLOT(start()));
    connect(ui->stopButton, SIGNAL(clicked()), _plotBuilder, SLOT(stop()));
    connect(this, SIGNAL(pauseProcessing()), _plotBuilder, SLOT(pause()));
    connect(this, SIGNAL(resumeProcessing()), _plotBuilder, SLOT(resume()));

    // connect signals to intercept and display calculation results
    connect(_plotBuilder, SIGNAL(finished()), this, SLOT(processingFinished()));
    connect(_plotBuilder, SIGNAL(processed(double, double, double)), this, SLOT(valueProcessed(double, double, double)));

    // connect signals to populate or clear points collection
    connect(_plotBuilder, SIGNAL(processed(double, double, double)), _points, SLOT(addPoint(double, double)));
    connect(_plotBuilder, SIGNAL(started()), _points, SLOT(clear()));

    // connect signals to update widget that displays points collection
    connect(this, SIGNAL(startProcessing()), _pointsWidget, SLOT(updatePage()));
    connect(this, SIGNAL(pauseProcessing()), _pointsWidget, SLOT(updatePage()));
    connect(_plotBuilder, SIGNAL(finished()), _pointsWidget, SLOT(updatePage()));
}
bool UIWizardNewVMPageBasic3::validatePage()
{
    /* Initial result: */
    bool fResult = true;

    /* Ensure unused virtual-disk is deleted: */
    if (m_pDiskSkip->isChecked() || m_pDiskCreate->isChecked() || (!m_virtualDisk.isNull() && m_strVirtualDiskId != m_virtualDisk.GetId()))
        ensureNewVirtualDiskDeleted();

    if (m_pDiskSkip->isChecked())
    {
        /* Ask user about disk-less machine: */
        fResult = msgCenter().confirmHardDisklessMachine(this);
    }
    else if (m_pDiskCreate->isChecked())
    {
        /* Show the New Virtual Hard Drive wizard: */
        fResult = getWithNewVirtualDiskWizard();
    }

    if (fResult)
    {
        /* Lock finish button: */
        startProcessing();

        /* Try to create VM: */
        fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM();

        /* Unlock finish button: */
        endProcessing();
    }

    /* Return result: */
    return fResult;
}
Example #3
0
BOOL uninstall(PINSTALLDATA pid, HWND hprgs) {
   BOOL rc = FALSE;
   ULONG csteps;
   ULONG i = 0;
   // inizializza file log
   startProcessing(pid, hprgs);
   // calcola numero passi da eseguire
   if (!(csteps = instuninstcsteps(pid, hprgs))) goto end;
   // se programma preferenze aperto lo chiude
   if (!instcloseprefapp(pid, &i, hprgs, csteps)) goto end;
   // modifica os2.ini
   if (!instdelprfitems(pid, &i, hprgs, csteps)) goto end;
   // cancella albero bitmap
   if ((pid->fl & INSSEL_REMBMPS) && !instdeltree(pid, &i, hprgs, csteps))
      goto end;
   // cancella file, smartwin.dll e styler20.dll
   if (!instdelfiles(pid, &i, hprgs, csteps)) goto end;
   // distrugge oggetti
   if (!instdelobjs(pid, &i, hprgs, csteps)) goto end;
   // distrugge directory installazione e altri eventuali file (chiedendo
   // conferma)
   if (!instdelinstpath(pid, &i, hprgs, csteps)) goto end;
   rc = TRUE;
end:
   // scrive file log, mostra messaggio termine e riabilita controlli
   endProcessing(pid, hprgs, rc);
   return rc;
}
Example #4
0
bool UIWizardNewVDPageBasic3::validatePage()
{
    /* Initial result: */
    bool fResult = true;

    /* Make sure such file doesn't exists already: */
    QString strMediumPath(mediumPath());
    fResult = !QFileInfo(strMediumPath).exists();
    if (!fResult)
        msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this);

    if (fResult)
    {
        /* Lock finish button: */
        startProcessing();

        /* Try to create virtual hard drive file: */
        fResult = qobject_cast<UIWizardNewVD*>(wizard())->createVirtualDisk();

        /* Unlock finish button: */
        endProcessing();
    }

    /* Return result: */
    return fResult;
}
Example #5
0
BOOL install(PINSTALLDATA pid, HWND hprgs) {
   BOOL rc = FALSE;
   ULONG csteps;
   ULONG i = 0;
   // inizializza file log
   startProcessing(pid, hprgs);
   // calcola numero passi da eseguire
   if (!(csteps = instinstcsteps(pid))) goto end;
   // se programma preferenze aperto lo chiude
   if (!instcloseprefapp(pid, &i, hprgs, csteps)) goto end;
   // modifica os2.ini
   if (!instaddprfitems(pid, &i, hprgs, csteps)) goto end;
   // cancella file obsoleti
   if (!instdelobsolete(pid, &i, hprgs, csteps)) goto end;
   // copia file e smartwin.dll
   if (!instcopyfiles(pid, &i, hprgs, csteps)) goto end;
   // copia albero bitmap
   if (!instcopytree(pid, &i, hprgs, csteps)) goto end;
   // crea oggetti
   if (!instcreatobjs(pid, &i, hprgs, csteps)) goto end;
   // if needed update the ini file
   updateIni();
   rc = TRUE;
end:
   // scrive file log, mostra messaggio termine e riabilita controlli
   endProcessing(pid, hprgs, rc);
   return rc;
}
bool UIFirstRunWzdPage3::validatePage()
{
    startProcessing();
    bool fResult = insertDevice();
    endProcessing();
    return fResult;
}
Example #7
0
void Mixer::setAudioDevice( AudioDevice * _dev,
				const struct qualitySettings & _qs,
				bool _needs_fifo )
{
	// don't delete the audio-device
	stopProcessing();

	m_qualitySettings = _qs;
	m_oldAudioDev = m_audioDev;

	if( _dev == NULL )
	{
		printf( "param _dev == NULL in Mixer::setAudioDevice(...). "
					"Trying any working audio-device\n" );
		m_audioDev = tryAudioDevices();
	}
	else
	{
		m_audioDev = _dev;
	}

	emit qualitySettingsChanged();
	emit sampleRateChanged();

	startProcessing( _needs_fifo );
}
Example #8
0
void OnlinePlotter::eventOccured(Event *event) {
    if(event == 0) {
        return;
    }
    else if(event == mStartEvent) {

        if(mPlotterProgramValue->get() == ""
                || mPlotterProgramValue->get().contains("internal", Qt::CaseInsensitive))
        {
            mRunningCalculator = mActiveCalculatorValue->get();

            prepareData(mRunningCalculator);

            emit startProcessing();
        }

    }
    else if(event == mFinishEvent) {
        //if the calculator stopped running:

        if(mPlotterProgramValue->get() == ""
                || mPlotterProgramValue->get().contains("internal", Qt::CaseInsensitive))
        {
            emit finishedProcessing();
        }
    }
}
void CRTLXmlrpc::startEegServer (int port, int blockSize)
{
    if(eegmanager != NULL && started) {
        return;
    }

    eegmanager = new EEGManager();


    char buf[512];
    memset(buf, 0, 512);
    sprintf(buf, "--blocksize %d", blockSize);
    eegmanager->add_module("BPAcquisition", buf);
#ifdef __mac__
    memset(buf, 0, 512);
    eegmanager->add_module("FLOWRealtime", buf);
    memset(buf, 0, 512);
    sprintf(buf, "--port 51255");
    eegmanager->add_module("FLOWIpmarker", buf);
#endif
    memset(buf, 0, 512);
    sprintf(buf, "--port %d", port);
    eegmanager->add_module("NETOutput", buf);

    startProcessing();
}
AclEngine::Implementation::ChannelList::Channel::Receive::State AclEngine::Implementation::ChannelList::Channel::Receive::idle(const HCIACLPDU &pdu)
{
    switch (pdu.get_pbf())
    {
    case HCIACLPDU::start:
    case HCIACLPDU::start_not_auto_flush:
        return startProcessing(pdu);
    default:
        // Received what appears to be an isolated acl packet, not part of an l2cap packet.
        return callDefaultHandler(pdu);
    }
}
Example #11
0
void Mixer::setAudioOutputContext( AudioOutputContext * context )
{
	stopProcessing();

	m_audioOutputContext = context;

	//m_audioDev->applyQualitySettings();

	emit sampleRateChanged();

	startProcessing();
}
Example #12
0
void Mixer::changeQuality( const struct qualitySettings & _qs )
{
	// don't delete the audio-device
	stopProcessing();

	m_qualitySettings = _qs;
	m_audioDev->applyQualitySettings();

	emit sampleRateChanged();
	emit qualitySettingsChanged();

	startProcessing();
}
bool UICloneVMWizardPage3::validatePage()
{
    /* Start performing long-time operation: */
    startProcessing();
    /* Try to create the clone: */
    QString strName = field("cloneName").toString();
    bool fReinitMACs = field("reinitMACs").toBool();
    bool fResult = static_cast<UICloneVMWizard*>(wizard())->createClone(strName, cloneMode(), fReinitMACs);
    /* Finish performing long-time operation: */
    endProcessing();
    /* Return operation result: */
    return fResult;
}
Example #14
0
void Mixer::restoreAudioDevice()
{
	if( m_oldAudioDev != NULL )
	{
		stopProcessing();
		delete m_audioDev;

		m_audioDev = m_oldAudioDev;
		emit sampleRateChanged();

		m_oldAudioDev = NULL;
		startProcessing();
	}
}
bool UICloneVMWizardPage1::validatePage()
{
    if (isFinalPage())
    {
        /* Start performing long-time operation: */
        startProcessing();
        /* Try to create the clone: */
        bool fResult = static_cast<UICloneVMWizard*>(wizard())->createClone(cloneName(), KCloneMode_MachineState, isReinitMACsChecked());
        /* Finish performing long-time operation: */
        endProcessing();
        /* Return operation result: */
        return fResult;
    }else
        return true;
}
Example #16
0
BOOL refresh(PINSTALLDATA pid, HWND hprgs) {
   BOOL rc = FALSE;
   ULONG csteps;
   ULONG i = 0;
   // inizializza file log
   startProcessing(pid, hprgs);
   // calcola numero passi da eseguire
   csteps = instrfrshcsteps(pid);
   // crea oggetti
   if (!instcreatobjs(pid, &i, hprgs, csteps)) goto end;
   rc = TRUE;
end:
   // scrive file log, mostra messaggio termine e riabilita controlli
   endProcessing(pid, hprgs, rc);
   return rc;
}
bool NetworkDynamicsPlotterApplication::setupGui() {

	//Have to  be present before the GUI is constructed.
	StandardNeuralNetworkFunctions();
	StandardConstraintCollection();



	mMainWindow = new DynamicsPlotterMainWindow(mEnableSimulator, true);

	if(mMainWindow != 0) {
		new NetworkEditorCollection(mMainWindow->getMenu("Tools"), "Network &Editor", false);

		BoolValueSwitcherAction *runPlotterButton = new BoolValueSwitcherAction("&Run Plotters",
					DynamicsPlotConstants::VALUE_PLOTTER_EXECUTE);
		runPlotterButton->setShortcut(tr("Ctrl+r"));
		mMainWindow->getMenu("Control")->addAction(runPlotterButton);
	}

	connect(this, SIGNAL(showGui()), mMainWindow, SLOT(showWindow()));


	mTimer = new QTimer();
	mTimer->setInterval(2000);

	OnlinePlotter *op = new OnlinePlotter();
	//Core::getInstance()->addSystemObject(op);

	for(int i = 0; i < 6; ++i) {

		OnlinePlotterWindow *opw = new OnlinePlotterWindow(i);

		connect(op, SIGNAL(dataPrepared(QString, MatrixValue*, bool)), opw,
SLOT(printData(QString, MatrixValue*, bool)));
		connect(mTimer, SIGNAL(timeout()), opw, SLOT(updateData()));
		connect(opw, SIGNAL(timerStart()), mTimer, SLOT(start()));
		connect(op, SIGNAL(startProcessing()), opw, SLOT(processing()));
		connect(op, SIGNAL(finishedProcessing()), opw, SLOT(finishedProcessing()));
	}

	connect(op, SIGNAL(finishedProcessing()), mTimer, SLOT(stop()));

	//***/Till****//

	return true;
}
bool UIWizardExportAppPageExpert::validatePage()
{
    /* Initial result: */
    bool fResult = true;

    /* Lock finish button: */
    startProcessing();

    /* Try to export appliance: */
    fResult = qobject_cast<UIWizardExportApp*>(wizard())->exportAppliance();

    /* Unlock finish button: */
    endProcessing();

    /* Return result: */
    return fResult;
}
AclEngine::Implementation::ChannelList::Channel::Receive::State AclEngine::Implementation::ChannelList::Channel::Receive::continueProcessing(const HCIACL_L2CAP_PDU &pdu)
{
    switch(pdu.get_pbf())
    {
    case HCIACLPDU::start:
    case HCIACLPDU::start_not_auto_flush:
        // Previous l2cap packet ended prematurely
        reportL2CapPacketEndedPrematurely();
        return startProcessing(pdu);
    case HCIACLPDU::cont:
        return process(pdu);
    default:
        // Received a pdu with an invalid pbf
        reportL2CapPacketEndedPrematurely();
        return callDefaultHandler(pdu);
    }
}
Example #20
0
void PlainDictionary::load(std::istream & input, ControlInformation &ci, ProgressListener *listener)
{
    std::string line;
    unsigned char region = 1;

    startProcessing();

    std::string format = ci.getFormat();
    if(format!=getType()) {
        throw "Trying to read a PlainDictionary but the data is not PlainDictionary";
    }

    this->mapping = ci.getUint("mapping");
    this->sizeStrings = ci.getUint("sizeStrings");
    unsigned int numElements = ci.getUint("numEntries");
    unsigned int numLine = 0;

    IntermediateListener iListener(listener);
    iListener.setRange(0,25);
    while(region<5 && getline(input, line,'\1')) {
        //std::cout << line << std::endl;
        if(line!="") {
            if (region == 1) { //shared SO
                NOTIFYCOND(&iListener, "Dictionary loading shared area.", numLine, numElements);
                insert(line, SHARED_SUBJECT);
            } else if (region == 2) { //not shared Subjects
                NOTIFYCOND(&iListener, "Dictionary loading subjects.", numLine, numElements);
                insert(line, NOT_SHARED_SUBJECT);
                NOTIFYCOND(&iListener, "Dictionary loading objects.", numLine, numElements);
            } else if (region == 3) { //not shared Objects
                insert(line, NOT_SHARED_OBJECT);
                NOTIFYCOND(&iListener, "Dictionary loading predicates.", numLine, numElements);
            } else if (region == 4) { //predicates
                insert(line, NOT_SHARED_PREDICATE);
            }
        } else {
            region++;
        }

        numLine++;
    }

    // No stopProcessing() Needed. Dictionary already split and sorted in file.
    updateIDs();
}
bool UIWizardFirstRunPageBasic::validatePage()
{
    /* Initial result: */
    bool fResult = true;

    /* Lock finish button: */
    startProcessing();

    /* Try to insert chosen medium: */
    if (fResult)
        fResult = qobject_cast<UIWizardFirstRun*>(wizard())->insertMedium();

    /* Unlock finish button: */
    endProcessing();

    /* Return result: */
    return fResult;
}
bool UIWizardImportAppPageBasic2::validatePage()
{
    /* Initial result: */
    bool fResult = true;

    /* Lock finish button: */
    startProcessing();

    /* Try to import appliance: */
    if (fResult)
        fResult = qobject_cast<UIWizardImportApp*>(wizard())->importAppliance();

    /* Unlock finish button: */
    endProcessing();

    /* Return result: */
    return fResult;
}
bool UICloneVMWizardPage2::validatePage()
{
    if (isFinalPage())
    {
        /* Start performing long-time operation: */
        startProcessing();
        /* Try to create the clone: */
        QString strName = field("cloneName").toString();
        bool fReinitMACs = field("reinitMACs").toBool();
        bool fResult = static_cast<UICloneVMWizard*>(wizard())->createClone(strName, KCloneMode_MachineState, fReinitMACs, m_pLinkedCloneRadio->isChecked());
        /* Finish performing long-time operation: */
        endProcessing();
        /* Return operation result: */
        return fResult;
    }
    else
        return true;
}
Example #24
0
void MainWindow::on_buttStartStop_toggled( bool checked )
{
    if( checked )
    {
        if( ui->cmbValidBarcode->currentIndex() < 0 )
        {
            ui->buttStartStop->setChecked( false );
            QMessageBox::critical( nullptr, "Error", "No barcode selected." );
            return;
        }

        startProcessing();
    }
    else
    {
        imageSource->stop();
    }

    setEnableWidgetsRunStop( checked );
}
void CRTLXmlrpc::startLoopback (int acq_port, std::string acq_ip, int out_port)
{

    if(eegmanager != NULL) {
        stopEegServer();
    } else {
        eegmanager = new EEGManager();
    }

    char buf[512];
    memset(buf, 0, 512);
    sprintf(buf, "--host %s --port %d", acq_ip.c_str(), acq_port);
    eegmanager->add_module("NETAcquisition", buf);
    eegmanager->add_module("FLOWProcessor", "--devicename /dev/flow");
    memset(buf, 0, 512);
    sprintf(buf, "--port %d --blocking", out_port);
    eegmanager->add_module("NETOutput", buf);

    startProcessing();
}
void CRTLXmlrpc::startEegServer (std::string filename, int port, int blockSize)
{
    if(started) return;

    if(eegmanager == NULL) {
        eegmanager = new EEGManager();
    } else {
        if(eegmanager->isRunning()) stopEegServer();
    }

    char buf[512];
    memset(buf, 0, 512);
    sprintf(buf, "--filename %s --blocksize %d", filename.c_str(), blockSize);
    eegmanager->add_module("FILEAcquisition", buf);
    memset(buf, 0, 512);
    sprintf(buf, "--port %d --blocking", port);
    eegmanager->add_module("NETOutput", buf);

    startProcessing();
}
Example #27
0
void Mixer::setAudioDevice( AudioDevice * _dev )
{
	stopProcessing();

	m_oldAudioDev = m_audioDev;

	if( _dev == NULL )
	{
		printf( "param _dev == NULL in Mixer::setAudioDevice(...). "
					"Trying any working audio-device\n" );
		m_audioDev = tryAudioDevices();
	}
	else
	{
		m_audioDev = _dev;
	}

	emit sampleRateChanged();

	startProcessing();
}
Example #28
0
void MainWindow::startClicked()
{
    Function * function = _plotControlWidget->getSelectedFunction();
    if(function == NULL) {
        QMessageBox::warning(this, "Warning!", "Function is not defined");
        return;
    }

    QVector<double> params = _plotControlWidget->getFunctionParameters();
    if(params.size() != function->getParameters().size()) {
        QMessageBox::warning(this, "Warning!", "Unsupported number of function prameters provided");
        return;
    }

    double step = _plotControlWidget->getValueStep();
    if(step == 0) {
        QMessageBox::warning(this, "Warning!", "Step value must be greater than zero");
        return;
    }

    double from = _plotControlWidget->getValueFrom();
    double to = _plotControlWidget->getValueTo();
    if(from > to) {
        QMessageBox::warning(this, "Warning!", "End value must be greater than start value");
        return;
    }

    function->setParameters(params);

    _plotBuilder->setRange(from, to);
    _plotBuilder->setStep(step);
    _plotBuilder->setFunction(function);

    _plotControlWidget->setEnabled(false);
    ui->startButton->setEnabled(true);

    emit startProcessing();
}
bool UIWizardNewVMPageExpert::validatePage()
{
    /* Initial result: */
    bool fResult = true;

    /* Lock finish button: */
    startProcessing();

    /* Try to create machine folder: */
    if (fResult)
        fResult = createMachineFolder();

    /* Try to assign boot virtual-disk: */
    if (fResult)
    {
        /* Ensure there is no virtual-disk created yet: */
        Assert(m_virtualDisk.isNull());
        if (fResult)
        {
            if (m_pDiskCreate->isChecked())
            {
                /* Show the New Virtual Hard Drive wizard if necessary: */
                fResult = getWithNewVirtualDiskWizard();
            }
        }
    }

    /* Try to create VM: */
    if (fResult)
        fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM();

    /* Unlock finish button: */
    endProcessing();

    /* Return result: */
    return fResult;
}
Example #30
0
void proxy_t::messageReady(ProxyMessage::Type t, void* data) {
  switch (t) {
    case ProxyMessage::Type::REQUEST:
    {
      auto preq = reinterpret_cast<ProxyRequestContext*>(data);
      preq->startProcessing();
    }
    break;

    case ProxyMessage::Type::OLD_CONFIG:
    {
      auto oldConfig = reinterpret_cast<old_config_req_t*>(data);
      delete oldConfig;
    }
    break;

    case ProxyMessage::Type::SHUTDOWN:
      /*
       * No-op. We just wanted to wake this event base up so that
       * it can exit event loop and check router->shutdown
       */
      break;
  }
}