Esempio n. 1
0
void Container::onRunLevelSetup()
{
	CliArguments &args = CliArguments::getInstance();
	
	// Load the library containing the plugin
	m_pluginFile = new SharedLib(m_servicePath);
	m_pluginFile->load();
	
	// Settings settup
#ifdef WIN32
	Settings settings("OpenIHS.org", "JSONBus::" + serviceNs + "." + serviceName, QSettings::NativeFormat);
#else
	QString confPath = args.getValue("config").toString();
	if (confPath.isEmpty()) {
		confPath = "/etc/jsonbus/services/" + m_serviceNs + "/" + m_serviceName + ".conf";
	}
	Settings settings(confPath, QSettings::NativeFormat);
#endif
	
	// Get the plugin instance
	m_plugin = (*(Plugin*(*)())(m_pluginFile->getSymbol("getSingleton")))();
	
	// Plugin initialization
	m_plugin->onInit(settings);
	if (args.isEnabled("edit-settings")) {
		settings.setup();
		throw ExitApplicationException();
	}
	
	SlaveApplication::onRunLevelSetup();
	
	// Plugin load
	m_plugin->onLoad(settings);
	connect(m_plugin, SIGNAL(resultAvailable(QVariant)), this, SLOT(onResultAvailable(QVariant)));
}
QxrdDataProcessorThreaded::QxrdDataProcessorThreaded(QcepSettingsSaverWPtr saver,
    QxrdExperimentWPtr    doc,
    QxrdAcquisitionWPtr   acq,
    QxrdFileSaverWPtr filesaver)
  : QxrdDataProcessorBase(saver, doc, acq, filesaver),
    m_CorrectedImages(prop_CorrectionQueueLength()),
    m_IntegratedData(prop_IntegrationQueueLength())
{
  connect(&m_CorrectedImages, SIGNAL(resultAvailable()), this, SLOT(onCorrectedImageAvailable()));
  connect(&m_IntegratedData,  SIGNAL(resultAvailable()), this, SLOT(onIntegratedDataAvailable()));
  connect(&m_ROIData,         SIGNAL(resultAvailable()), this, SLOT(onROIDataAvailable()));
  connect(&m_HistogramData,   SIGNAL(resultAvailable()), this, SLOT(onHistogramDataAvailable()));

//  prop_CorrectionQueueLength()->setDebug(true);
//  prop_IntegrationQueueLength()->setDebug(true);
}
Esempio n. 3
0
void Query::wait(const std::chrono::duration<int, std::nano> & timeout) const
{
    std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();

    std::chrono::high_resolution_clock::time_point current;
    while (!resultAvailable() && start + timeout > current)
    {
        current = std::chrono::high_resolution_clock::now();
    }
}
Esempio n. 4
0
void TagFetcher::mbidFound(int index, const QString& mbid) {
    if (index >= m_tracks.count()) {
        return;
    }

    const TrackPointer pTrack = m_tracks[index];

    if (mbid.isEmpty()) {
        emit(resultAvailable(pTrack, QList<TrackPointer>()));
        return;
    }

    emit fetchProgress(tr("Downloading Metadata"));
    //qDebug() << "start to fetch tags from MB";
    m_MusicbrainzClient.start(index, mbid);
}
Esempio n. 5
0
void TagFetcher::fingerprintFound(int index) {
    QFutureWatcher<QString>* watcher = reinterpret_cast<QFutureWatcher<QString>*>(sender());
    if (!watcher || index >= m_tracks.count()) {
        return;
    }

    const QString fingerprint = watcher->resultAt(index);
    const TrackPointer ptrack = m_tracks[index];

    if (fingerprint.isEmpty()) {
        emit(resultAvailable(ptrack, QList<TrackPointer>()));
        return;
    }

    emit(fetchProgress(tr("Identifying track")));
    // qDebug() << "start to look up the MBID";
    m_AcoustidClient.start(index, fingerprint, ptrack->getDurationInt());
}
Esempio n. 6
0
QxrdResultSerializer<T>::QxrdResultSerializer(QcepIntProperty *ctr, QObject *parent)
 : QxrdResultSerializerBase(parent),
   m_Counter(ctr)
{
  connect(&m_Watcher, SIGNAL(finished()), this, SIGNAL(resultAvailable()));
}
Esempio n. 7
0
void Query::wait() const
{
    while (!resultAvailable());
}
Esempio n. 8
0
QMLContact::QMLContact(QObject *parent)
    :QObject(parent),
    m_contactMap(0)
{
   connect(&m_saveRequest, SIGNAL(resultAvailable()), this, SLOT(onContactSaved()));
}