本文整理汇总了C++中setRunning函数的典型用法代码示例。如果您正苦于以下问题:C++ setRunning函数的具体用法?C++ setRunning怎么用?C++ setRunning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setRunning函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setRunning
void KviThread::internalThreadRun_doNotTouchThis()
{
// we're on the slave thread here!
//qDebug(">> KviThread::internalRun (this=%d)",this);
setRunning(true);
setStartingUp(false);
kvi_threadInitialize();
run();
setRunning(false);
//qDebug("<< KviThread::internalRun (this=%d",this);
}
示例2: setNotRunning
void ItemUser::updateValues( af::Node *node, int type)
{
af::User * user = (af::User*)node;
permanent = user->isPermanent();
if( numrunningtasks ) setRunning();
else setNotRunning();
priority = user->getPriority();
annotation = afqt::stoq( user->getAnnontation());
hostname = afqt::stoq( user->getHostName());
numjobs = user->getNumJobs();
numrunningtasks = user->getRunningTasksNumber();
maxrunningtasks = user->getMaxRunningTasks();
hostsmask = afqt::stoq( user->getHostsMask());
hostsmask_exclude = afqt::stoq( user->getHostsMaskExclude());
errors_avoidhost = user->getErrorsAvoidHost();
errors_tasksamehost = user->getErrorsTaskSameHost();
errors_retries = user->getErrorsRetries();
errors_forgivetime = user->getErrorsForgiveTime();
jobs_lifetime = user->getJobsLifeTime();
if( numrunningtasks ) setRunning();
else setNotRunning();
strLeftTop = QString("%1-%2").arg(name).arg( priority);
if( false == permanent ) strLeftTop = QString("(%1)").arg( strLeftTop);
if( isLocked()) strLeftTop = "(LOCK) " + strLeftTop;
strLeftBottom = 'j' + QString::number( numjobs) + '/' + QString::number( user->getNumRunningJobs());
strHCenterTop.clear();
if( maxrunningtasks != -1) strHCenterTop = QString("m%1").arg( maxrunningtasks );
if( false == hostsmask.isEmpty() ) strHCenterTop += QString(" H(%1)").arg( hostsmask );
if( false == hostsmask_exclude.isEmpty()) strHCenterTop += QString(" E(%1)").arg( hostsmask_exclude );
strHCenterTop += QString(" %1").arg( user->generateErrorsSolvingString().c_str());
if( jobs_lifetime > 0 ) strHCenterTop += QString(" L%1").arg( af::time2strHMS( jobs_lifetime, true).c_str());
strRightTop = hostname;
if( user->solveJobsParallel())
{
strRightBottom = "Par";
}
else
{
strRightBottom = "Ord";
}
tooltip = user->generateInfoString( true).c_str();
calcHeight();
}
示例3: stop
bool BtDeviceController::start(){
stop();
setRunning(true);
if (pthread_create(&thread, NULL, run, this) != 0) {
setRunning(false);
}
pthread_detach(thread);
return isRunning();
}
示例4: setRunning
MyWindow::MyWindow(const char *title, int width, int height)
{
window = NULL;
renderer = NULL;
setRunning(false);
window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_SHOWN);
if (window != NULL) {
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
setRunning(true);
}
}
示例5: setRunning
void QFEFCSSimScriptTab::cancelExecution()
{
if (!isRunning()) {
setRunning(false);
return;
}
if (proc ) {
proc->close();
proc->deleteLater();
}
setRunning(false);
}
示例6: KviMutex
KviThread::KviThread()
{
g_pThreadManager->registerSlaveThread(this);
m_pRunningMutex = new KviMutex();
setRunning(false);
setStartingUp(false);
}
示例7: OTSYS_TIME
void Raids::checkRaids()
{
if(!getRunning()){
uint64_t now = OTSYS_TIME();
for(RaidList::iterator it = raidList.begin(); it != raidList.end(); ++it){
if(now >= (getLastRaidEnd() + (*it)->getMargin())){
if(MAX_RAND_RANGE*CHECK_RAIDS_INTERVAL/(*it)->getInterval() >= (uint32_t)random_range(0, MAX_RAND_RANGE)){
#ifdef __DEBUG_RAID__
char buffer[32];
time_t tmp = time(NULL);
formatDate(tmp, buffer);
std::cout << buffer << " [Notice] Raids: Starting raid " << (*it)->getName() << std::endl;
#endif
setRunning(*it);
(*it)->startRaid();
break;
}
}
}
}
checkRaidsEvent = Scheduler::getScheduler().addEvent(createSchedulerTask(CHECK_RAIDS_INTERVAL*1000,
boost::bind(&Raids::checkRaids, this)));
}
示例8: while
void Server::start()
{
int findingPort = 50;
while (findingPort) {
try {
startServer();
setRunning(true);
findingPort = 0;
qDebug() << "Connected to port" << m_port;
if (m_mainWindow) {
m_mainWindow->notify("Server Started", "Port set to " + QString::number(m_port));
}
}
catch (const nzmqt::ZMQException& ex) {
if (ex.num() == 48) {
findingPort--;
setPort(m_port + 1);
} else {
qWarning() << Q_FUNC_INFO << "Exception:" << ex.num() << ex.what();
findingPort = 0;
emit failure(ex.what());
emit finished();
}
}
}
}
示例9: setRunning
void ScriptEditorWidget::onScriptFinished(const QString& scriptPath) {
_scriptEngine = NULL;
if (_isRestarting) {
_isRestarting = false;
setRunning(true);
}
}
示例10: tr
void ScriptEditorWidget::onWindowActivated() {
if (!_isReloading) {
_isReloading = true;
if (QFileInfo(_currentScript).lastModified() > _currentScriptModified) {
if (static_cast<ScriptEditorWindow*>(this->parent()->parent()->parent())->autoReloadScripts()
|| QMessageBox::warning(this, _currentScript,
tr("This file has been modified outside of the Interface editor.") + "\n\n"
+ (isModified()
? tr("Do you want to reload it and lose the changes you've made in the Interface editor?")
: tr("Do you want to reload it?")),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
loadFile(_currentScript);
if (_scriptEditorWidgetUI->onTheFlyCheckBox->isChecked() && isRunning()) {
_isRestarting = true;
setRunning(false);
// Script is restarted once current script instance finishes.
}
}
}
_isReloading = false;
}
}
示例11: qDebug
void UsbWidget::deviceError() {
qDebug("[usb] %s",usb_strerror());
usb_close(handle);
handle = NULL;
setRunning( false );
}
示例12: QDialog
FingerprinterProgressBar::FingerprinterProgressBar( QWidget* parent, Qt::WindowFlags f )
: QDialog( parent, f | Qt::Sheet ),
m_stopped( false )
{
ui.setupUi( this );
setModal( true );
setRunning( false );
m_totalTracks = m_tracksFingerprinted = m_tracksSkipped = m_tracksWithErrors = 0;
m_timer.setInterval( 1000 );
connect(&m_timer, SIGNAL(timeout()), this, SLOT(update()));
connect(ui.fingerprintProgressBar, SIGNAL( valueChanged( int ) ), this, SLOT( progressBarChanged( int ) ) );
m_timeElapsed = m_etaCounter = m_timeRemaining = 0;
setFixedHeight( sizeHint().height() );
ui.okButton->setVisible( false );
connect( ui.okButton, SIGNAL( clicked() ),
this, SLOT( onOkClicked() ) );
connect( ui.stopButton, SIGNAL( clicked() ),
this, SLOT( onCancelClicked() ) );
}
示例13: satellitesInViewUpdated
void SatelliteModel::updateDemoData()
{
static bool flag = true;
QList<QGeoSatelliteInfo> satellites;
if (flag) {
for (int i = 0; i<5; i++) {
QGeoSatelliteInfo info;
info.setSatelliteIdentifier(i);
info.setSignalStrength(20 + 20*i);
satellites.append(info);
}
} else {
for (int i = 0; i<9; i++) {
QGeoSatelliteInfo info;
info.setSatelliteIdentifier(i*2);
info.setSignalStrength(20 + 10*i);
satellites.append(info);
}
}
satellitesInViewUpdated(satellites);
flag ? satellitesInUseUpdated(QList<QGeoSatelliteInfo>() << satellites.at(2))
: satellitesInUseUpdated(QList<QGeoSatelliteInfo>() << satellites.at(3));
flag = !flag;
emit errorFound(flag);
if (isSingleRequest() && !singleRequestServed) {
singleRequestServed = true;
setRunning(false);
}
}
示例14: QSF_TRANSLATE_CONTEXTSTRING
//[-------------------------------------------------------]
//[ Public virtual em5::FreeplayEvent methods ]
//[-------------------------------------------------------]
bool BMAFireEvent::onStartup()
{
BMAComponent* bma = mTargetBMA->getComponent<flo11::BMAComponent>();
//No nullptr check, EventFactory did that already
qsf::Entity* targetEntity = QSF_MAINMAP.getEntityById(bma->getTargetId());
if (targetEntity != nullptr) {
// Mark the entity so it wont get effected by other events
em5::EventIdComponent& eventIdComponent = targetEntity->getOrCreateComponentSafe<em5::EventIdComponent>();
eventIdComponent.setEvent(*this, em5::eventspreadreason::NO_REASON);
}
std::string eventName = QSF_TRANSLATE_CONTEXTSTRING("flo11::BMAFireEvent", "ID_BMA_FIRE_EVENT_NAME");
eventName.append(": ");
eventName.append(bma->getName());
this->setEventName(eventName);
this->setNormalPointGain(500);
bma->detectFire(); //BMA AUslösen
mMessageProxy.registerAt(qsf::MessageConfiguration("flo11::BMAResetActionFinished"), boost::bind(&BMAFireEvent::onResetBMAFinished, this, _1));
mTargetBurningMessageProxy.registerAt(qsf::MessageConfiguration(em5::Messages::EM5_OBJECT_STOP_BURNING, bma->getTargetId()), boost::bind(&BMAFireEvent::onTargetStopBurning, this, _1));
mInvestigatingMessageProxy.registerAt(qsf::MessageConfiguration("flo11::BMAInvestigationFinished", bma->getEntityId()), boost::bind(&BMAFireEvent::onInvestigationFinished, this, _1));
setRunning();
// Done
return true;
}
示例15: NetworkException
void NetworkService::stop() { //throw (NetworkException*) {
if (_log->isInfo()) _log->info("Shutting down the network service");
if (!_running) {
throw new NetworkException(new string("The network service is not running. Try starting it first"));
}
if (processing > 0) {
cout << "Stop requested but still working" << endl;
}
int i = 0;
while (processing > 0) {
Thread::sleep(1000);
i++;
// if the time exceeded then shutdown anyway
if (i > 10) {
break;
}
}
delete _transactionManager;
delete _baseTransaction;
__dbController->shutdown();
setRunning(false);
_ntserver->stop();
delete __dbController;
}