void NewVisit::patientChanged(int id) { if(id==-1) { setReady(0, false); patient_id = 0; } else { setReady(0, true); patient_id = id; } }
void NewVisit::therapyChanged(int id) { if(id==-1) { setReady(1, false); therapy_id = 0; } else { setReady(1, true); therapy_id = id; } }
void IniFile::loadFile() { QFile file(m_filename); if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) { qDebug() << "Could not open " << m_filename; return; } QString content(file.readAll()); QStringList lines = content.split("\n"); for(QString line : lines) { line = line.trimmed(); if(line.startsWith("#")) continue; // skip comment lines if(!line.contains("=")) continue; // We need something = yeahbuddy QStringList splittedLine = line.split("="); QString key = splittedLine[0].trimmed(); QString value = splittedLine[1].trimmed(); if(key.split(" ").count() > 1) { qDebug() << "Error, key " << key << " contains whitespaces."; exit(1); } m_keyValuePairs.insert(key, value); } file.close(); setReady(true); }
void set_ready(bool ready) { if(ready) setReady(); else setUnReady("TestBaseLoggerFoundation"); };
int Loader::load(QString program, QString workpath, QStringList args) { this->program = program; this->workpath = workpath; stop(); connect(process, SIGNAL(readyReadStandardOutput()),this,SLOT(procReadyRead())); connect(process, SIGNAL(started()),this,SLOT(procStarted())); connect(process, SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(procFinished(int,QProcess::ExitStatus))); connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(procError(QProcess::ProcessError))); process->setProcessChannelMode(QProcess::MergedChannels); process->setWorkingDirectory(this->workpath); #if 0 this->port = ""; for(int n = 0; n < args.length(); n++) { QString arg = args.at(n); if(arg.contains("-p", Qt::CaseInsensitive)){ this->port = args.at(n+1); break; } } #endif this->setPlainText(""); setReady(false); setDisableIO(false); process->start(this->program,args); while(running == false) QApplication::processEvents(); return process->exitCode(); }
void DeckView::loadDeck(QString lines, QString _name, bool local) { if(waiting) { return; } int load = ++timestamp; makeSnapshot(false); mainDeck->clearDeck(); extraDeck->clearDeck(); sideDeck->clearDeck(); deckStatus.name = _name; deckStatus.isLocal = local; deckStatus.modified = !local; waiting = true; setReady(false); auto thread = new ItemThread(load, lines, this); connect(thread, &ItemThread::finishLoad, this, &DeckView::loadFinished); connect(thread, &ItemThread::finished, thread, &ItemThread::deleteLater); connect(this, &DeckView::destroyed, thread, &ItemThread::quit); thread->start(); }
void TeamManager::playerRequest_ready(const PlayerID player_id) { setReady(player_id); PlayerReadyUpdate msg; msg.player_id = player_id; SERVER->broadcastMessage( &msg, sizeof(msg)); }
void Arrow::release() { if ( ! isReady() ) return; _current_ball->setState(Ball::Moving); setReady(false); setCurrent(true); }
void Loader::stop() { if(running) { process->kill(); //delete process; // can't just delete on Mac } setRunning(false); setReady(false); setDisableIO(true); }
void Loader::procReadyRead() { if(this->disableIO) return; QTextCursor cur; QByteArray s = process->readAll(); if(ready != true) { /* propeller-load -t message: * [ Entering terminal mode. Type ESC or Control-C to exit. ]\r\n */ if(QString(s).contains(". ]", Qt::CaseInsensitive)) { setReady(true); status->setText(status->text()+" Loader done."); progress->setValue(100); Sleeper::ms(250); progress->hide(); s = s.mid(s.indexOf("]")+1); } } if(ready) { /* Just doing insertPlainText(s) don't get it. * Also we need to add character enable filters simiar to PST */ for(int n = 0; n < s.length();n++) { char ch = QChar(s.at(n)).toAscii(); //this->insertPlainText(QString(" %1").arg(ch, 2, 16, QChar('0'))); if(ch == '\0') continue; // for now ignore 0's if(ch == '\r') continue; // for now ignore \r if(ch == '\b') { QString text = this->toPlainText(); this->setPlainText(text.mid(0,text.length()-1)); n+=2; continue; } this->insertPlainText(QString(ch)); } cur = this->textCursor(); cur.movePosition(QTextCursor::End, QTextCursor::MoveAnchor); this->setTextCursor(cur); } else { /* insertPlainText OK here - it's not too critical */ compiler->insertPlainText(s); cur = compiler->textCursor(); cur.movePosition(QTextCursor::End, QTextCursor::MoveAnchor); compiler->setTextCursor(cur); } }
void LayerBaCayAvatar::setUnReadyAllUser() { setReady(kuser0, false); setReady(kuser1, false); setReady(kuser2, false); setReady(kuser3, false); setReady(kuser4, false); setReady(kuser5, false); setReady(kuser6, false); }
licensePage::licensePage(QWidget *parent) : pageBase(parent) { setupUi(this); agreeCheckBox->setDisabled(true); licenseTextEdit->setReadOnly(true); connect(agreeCheckBox, SIGNAL(clicked()), this, SLOT(setReady())); //initAll(); }
void rice::pastry::standard::ConsistentJoinProtocol::otherNodesMaySuspectFaulty(int32_t timeNotScheduled) { if(npc(logger)->level <= ::rice::environment::logging::Logger::WARNING) npc(logger)->log(::java::lang::StringBuilder().append(u"WARNING: CJP.otherNodesMaySuspectFaulty("_j)->append(timeNotScheduled) ->append(u")"_j)->toString()); npc(nextReadyStrategy)->stop(); npc(thePastryNode)->setReadyStrategy(npc(thePastryNode)->getDefaultReadyStrategy()); tryingToGoReady = false; npc(thePastryNode)->notifyReadyObservers(); setReady(); }
void Cluster::ready(const MemberId& id, const std::string& url, Lock& l) { try { if (map.ready(id, Url(url))) memberUpdate(l); if (state == CATCHUP && id == self) { setReady(l); QPID_LOG(notice, *this << " caught up."); } } catch (const Url::Invalid& e) { QPID_LOG(error, "Invalid URL in cluster ready command: " << url); } // Update management on every ready event to be consistent across cluster. setMgmtStatus(l); updateMgmtMembership(l); }
void MainWindow::startgame(){ //設定視窗 scene = new QGraphicsScene(0,0,width(),height()); scene->setBackgroundBrush(QPixmap(":/bg.jpg").scaled(width(),height())); ui->graphicsView->setGeometry(0,0,960,540); ui->graphicsView->setScene(scene); ui->graphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); ui->graphicsView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); //環境設定,g=-9.8,1像素=30公尺 world = new b2World(b2Vec2(0.0, -9.8)); GameItem::setGlobalSize(QSizeF(32,18),size()); //設定場景 land = new Land(16,1.5,32,3,QPixmap(":/ground.png").scaled(width(),height()/6.0),world,scene); ui->shooter->setGeometry(100,330,50,125); ui->score->setGeometry(50,30,150,80); ui->nowscore->setGeometry(200,30,150,80); ui->nowscore->setText(QString::number(score)); ui->restart->setGeometry(550,30,100,100); ui->exit->setGeometry(800,30,100,100); ui->win->setGeometry((width()/2)-150,(height()/2)-150,300,300); ui->win->setPixmap(QPixmap(":/win.png").scaled(300,300)); ui->win->hide(); ui->lose->setGeometry((width()/2)-150,(height()/2)-150,300,300); ui->lose->setPixmap(QPixmap(":/lose.png").scaled(300,300)); ui->lose->hide(); setBird(); setWood(); setPig(); QTimer::singleShot(1000,this,SLOT(setReady())); //1秒後可進行計分 music->stop(); music->play(); //設定資料 isPressed = false; isFired = false; skillUsed = false; done = false; alldone = false; isReady = false; birdnum = 0; score = 0; die0 = false; die1 = false; die2 = false; die3 = false; die4 = false; std::cout<<"gamestart"<<std::endl; }
int WallpaperImage::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { typedef bb::cascades::ImageView QMocSuperClass; _id = QMocSuperClass::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 13) qt_static_metacall(this, _c, _id, _a); _id -= 13; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QUrl*>(_v) = url(); break; case 1: *reinterpret_cast< QString*>(_v) = imageID(); break; case 2: *reinterpret_cast< float*>(_v) = loading(); break; case 3: *reinterpret_cast< QUrl*>(_v) = defaultImage(); break; case 4: *reinterpret_cast< bool*>(_v) = ready(); break; } _id -= 5; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setUrl(*reinterpret_cast< QUrl*>(_v)); break; case 1: setImageID(*reinterpret_cast< QString*>(_v)); break; case 2: setLoading(*reinterpret_cast< float*>(_v)); break; case 3: setDefaultImage(*reinterpret_cast< QUrl*>(_v)); break; case 4: setReady(*reinterpret_cast< bool*>(_v)); break; } _id -= 5; } else if (_c == QMetaObject::ResetProperty) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 5; } #endif // QT_NO_PROPERTIES return _id; }
void Output::begin() { Serial.println("Starting Output config"); _matrix = Adafruit_7segment(); _lcd.begin(20,4); _matrix.begin(0x70); Serial.print("DEBUG:redPin:");Serial.println(_redPin); Serial.print("DEBUG:yellowPin:");Serial.println(_yellowPin); Serial.print("DEBUG:greenPin:");Serial.println(_greenPin); Serial.print("DEBUG:speakerPin:");Serial.println(_speakerPin); setReady(); clearTime(); Serial.println("Completed Output config"); noTone(_speakerPin); }
void MainView::initQuestions( const QuestionSet::List &questionSets ) { mQuestions.clear(); QuestionSet::List::ConstIterator it; for( it = questionSets.begin(); it != questionSets.end(); ++it ) { QuestionSet *set = *it; set->initQuestions( mQuestions ); } mResultView->initialize( mQuestions ); setReady(); mOkButton->setEnabled( true ); mAnswerEdit->setEnabled( true ); }
void FramebufferBackend::openFrameBuffer() { VirtualTerminal::self()->init(); int fd = LogindIntegration::self()->takeDevice(deviceIdentifier().constData()); if (fd < 0) { qCWarning(KWIN_FB) << "Failed to open frame buffer device through logind, trying without"; } fd = open(deviceIdentifier().constData(), O_RDWR | O_CLOEXEC); if (fd < 0) { qCWarning(KWIN_FB) << "failed to open frame buffer device"; return; } m_fd = fd; queryScreenInfo(); setReady(true); emit screensQueried(); }
void CGameObject::net_Destroy () { #ifdef DEBUG if (psAI_Flags.test(aiDestroy)) Msg ("Destroying client object [%d][%s][%x]",ID(),*cName(),this); #endif VERIFY (m_spawned); if( m_anim_mov_ctrl ) destroy_anim_mov_ctrl (); xr_delete (m_ini_file); m_script_clsid = -1; if (Visual() && smart_cast<IKinematics*>(Visual())) smart_cast<IKinematics*>(Visual())->Callback (0,0); inherited::net_Destroy (); setReady (FALSE); if (Level().IsDemoPlayStarted() && ID() == u16(-1)) { Msg("Destroying demo_spectator object"); } else { g_pGameLevel->Objects.net_Unregister (this); } if (this == Level().CurrentEntity()) { if (!Level().IsDemoPlayStarted()) { Level().SetControlEntity (0); } Level().SetEntity (0); // do not switch !!! } Level().RemoveObject_From_4CrPr(this); //. Parent = 0; CScriptBinder::net_Destroy (); xr_delete (m_lua_game_object); m_spawned = false; }
void Device::isLaptopFetched(QDBusPendingCallWatcher* watcher) { const QDBusPendingReply<QVariant> reply = *watcher; if (reply.isError()) { qCDebug(KSCREEN_KDED) << "Couldn't get if the device is a laptop: " << reply.error().message(); return; } m_isLaptop = reply.value().toBool(); watcher->deleteLater(); if (!m_isLaptop) { setReady(); return; } fetchLidIsClosed(); }
MainView::MainView( QWidget *parent ) : QWidget( parent ) { QGridLayout *topLayout = new QGridLayout( this ); topLayout->setSpacing( 8 ); topLayout->setMargin( 8 ); QLabel *label = new QLabel( i18n("Question:"), this ); topLayout->addWidget( label, 0, 0 ); mQuestionLabel = new QLabel( this ); QFont f = mQuestionLabel->font(); f.setPointSize( 30 ); mQuestionLabel->setFont( f ); mQuestionLabel->setAlignment( AlignCenter ); topLayout->addWidget( mQuestionLabel, 1, 0 ); label = new QLabel( i18n("Answer:"), this ); topLayout->addWidget( label, 2, 0 ); mAnswerEdit = new QLineEdit( this ); topLayout->addWidget( mAnswerEdit, 3, 0 ); connect( mAnswerEdit, SIGNAL( returnPressed() ), SLOT( checkAnswer() ) ); mAnswerEdit->setAlignment( AlignCenter ); mOkButton = new QPushButton( i18n("Ok"), this ); topLayout->addWidget( mOkButton, 4, 0 ); connect( mOkButton, SIGNAL( clicked() ), SLOT( checkAnswer() ) ); mFeedbackText = new QLabel( this ); topLayout->addWidget( mFeedbackText, 5, 0 ); mFeedbackText->setFrameStyle( QFrame::Panel | QFrame::Plain ); mFeedbackText->setLineWidth( 2 ); mFeedbackText->setAlignment( AlignCenter ); QFontMetrics fm( mFeedbackText->font() ); mFeedbackText->setFixedHeight( fm.height() * 3 + 6 ); // mResultView = new ResultViewText( this ); mResultView = new ResultViewPic( this ); topLayout->addMultiCellWidget( mResultView, 0, 5, 1, 1 ); connect( &mReadyTimer, SIGNAL( timeout() ), SLOT( setReady() ) ); }
void Cluster::retractOffer(const MemberId& updater, uint64_t updateeInt, Lock& l) { // An offer was received while handling an error, and converted to a retract. // Behavior is very similar to updateOffer. if (state == LEFT) return; MemberId updatee(updateeInt); boost::optional<Url> url = map.updateOffer(updater, updatee); if (updater == self) { assert(state == OFFER); if (url) { // My offer was first. if (updateThread) updateThread.join(); // Join the previous updateThread to avoid leaks. updateThread = Thread(new RetractClient(*url, connectionSettings(settings))); } setReady(l); makeOffer(map.firstJoiner(), l); // Maybe make another offer. // Don't unstall the event queue, that was already done in deliveredFrame } QPID_LOG(debug,*this << " retracted offer " << updater << " to " << updatee); }
int Loader::reload(QString port) { QStringList args; if(this->program.length() == 0) { QSettings settings(publisherKey, ASideGuiKey,this); QVariant incv = settings.value(includesKey); if(incv.canConvert(QVariant::String)) { QString s = incv.toString(); s = QDir::fromNativeSeparators(s); this->program = s + "propeller-load"; #if defined(Q_WS_WIN32) this->program+=".exe"; #endif } } stop(); connect(process, SIGNAL(readyReadStandardOutput()),this,SLOT(procReadyRead())); connect(process, SIGNAL(started()),this,SLOT(procStarted())); connect(process, SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(procFinished(int,QProcess::ExitStatus))); connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(procError(QProcess::ProcessError))); process->setProcessChannelMode(QProcess::MergedChannels); process->setWorkingDirectory(this->workpath); if(port.length() > 0) { args.append("-p"); args.append(port); args.append("-t"); } setReady(false); setDisableIO(false); process->start(this->program,args); while(running == false) QApplication::processEvents(); return process->exitCode(); }
/* * Bind the framebuffer to the specified layer of the texture array. * Create the framebuffer and layered texture if necessary. * This function must be called from the GL thread. */ bool RenderTextureArray::bindFrameBuffer(int layerIndex) { int fbid = getId(); if (!isReady()) { if (renderTexture_gl_frame_buffer_ == nullptr) { renderTexture_gl_frame_buffer_ = new GLFrameBuffer(); } glBindTexture(GL_TEXTURE_2D_ARRAY, fbid); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); // glTexImage3D(GL_TEXTURE_2D_ARRAY,0,GL_RGB8, width,height,depth,0,GL_RGB, GL_UNSIGNED_BYTE,NULL); // glTexImage3D(GL_TEXTURE_2D_ARRAY,0,GL_R16F, width,height,depth,0,GL_RED, GL_HALF_FLOAT,NULL); // does not work for S6 edge // glTexImage3D(GL_TEXTURE_2D_ARRAY,0,GL_RGB10_A2, width,height,depth,0,GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV,NULL); glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA8, width(), height(), mNumLayers, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glBindTexture(GL_TEXTURE_2D_ARRAY, 0); setReady(fbid > 0); checkGLError("create RenderTextureArray"); } bind(); glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, fbid, 0, layerIndex); checkGLError("RenderTextureArray::bindFrameBuffer"); int fboStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (fboStatus != GL_FRAMEBUFFER_COMPLETE) { LOGE("RenderTextureArray::bindFrameBuffer Could not bind framebuffer: %d", fboStatus); switch (fboStatus) { case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT : LOGE("GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"); break; case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: LOGE("GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"); break; case GL_FRAMEBUFFER_UNSUPPORTED: LOGE("GL_FRAMEBUFFER_UNSUPPORTED"); break; } return false; } return true; }
void GpsModeller::searchElement(xmlNode *node) { xmlNode *cur_node = NULL; for (cur_node = node; cur_node; cur_node = cur_node->next) { if (cur_node->type == XML_ELEMENT_NODE && strcmp((const char*)cur_node->name,"trkpt")==0) { xmlNode *time = NULL; for(xmlNode *s = cur_node->children; s; s = s->next) { if(s->type == XML_ELEMENT_NODE && strcmp((const char*)s->name,"time")==0) { time = s; } } if(!time) { // epic fail!!! We did not find time for point... Skep this point continue; } xmlChar *lon = xmlGetProp(cur_node, (xmlChar*)"lon"); xmlChar *lat = xmlGetProp(cur_node, (xmlChar*)"lat"); xmlChar *stime = xmlNodeGetContent(time); currentModellerTime = QDateTime::fromString((const char*)stime); if(!begin.isValid()) begin=currentModellerTime; std::stringstream s; s << (const char *)lon << " " << (const char *) lat; setReady(true); s >> m_longitude >> m_latitude; // This code doesnt used by service //QThread::msleep(begin.msecsTo(currentModellerTime)); QThread::msleep(begin.secsTo(currentModellerTime)*1000); begin=currentModellerTime; } searchElement(cur_node->children); }
/** * @brief * * @param frame */ void FeedProvider::distributeFrame( const FramePtr &frame ) { setReady(); mConsumerMutex.lock(); ConsumerList badConsumers; for ( ConsumerMap::iterator iter = mConsumers.begin(); iter != mConsumers.end(); iter++ ) { if ( iter->second.isQueued() ) if ( !iter->second.hasComparators() || iter->second.compare( frame, iter->first ) ) if ( !iter->first->queueFrame( frame, this ) ) badConsumers.push_back( iter->first ); } mConsumerMutex.unlock(); for ( ConsumerList::iterator iter = badConsumers.begin(); iter != badConsumers.end(); iter++ ) deregisterConsumer( *(*iter) ); if ( mCanPoll ) { mFrameMutex.lock(); mLastFrame = frame; mFrameMutex.unlock(); } }
void X11WindowedBackend::init() { int screen = 0; xcb_connection_t *c = nullptr; Display *xDisplay = XOpenDisplay(deviceIdentifier().constData()); if (xDisplay) { c = XGetXCBConnection(xDisplay); XSetEventQueueOwner(xDisplay, XCBOwnsEventQueue); screen = XDefaultScreen(xDisplay); } if (c && !xcb_connection_has_error(c)) { m_connection = c; m_screenNumber = screen; m_display = xDisplay; for (xcb_screen_iterator_t it = xcb_setup_roots_iterator(xcb_get_setup(m_connection)); it.rem; --screen, xcb_screen_next(&it)) { if (screen == m_screenNumber) { m_screen = it.data; } } XRenderUtils::init(m_connection, m_screen->root); createWindow(); startEventReading(); connect(this, &X11WindowedBackend::cursorChanged, this, [this] { createCursor(softwareCursor(), softwareCursorHotspot()); } ); setReady(true); waylandServer()->seat()->setHasPointer(true); waylandServer()->seat()->setHasKeyboard(true); emit screensQueried(); } else { emit initFailed(); } }
void Cluster::updateOffer(const MemberId& updater, uint64_t updateeInt, Lock& l) { // NOTE: deliverEventQueue has been stopped at the update offer by // deliveredEvent in case an update is required. if (state == LEFT) return; MemberId updatee(updateeInt); boost::optional<Url> url = map.updateOffer(updater, updatee); if (updater == self) { assert(state == OFFER); if (url) // My offer was first. updateStart(updatee, *url, l); else { // Another offer was first. QPID_LOG(info, *this << " cancelled offer to " << updatee << " unstall"); setReady(l); makeOffer(map.firstJoiner(), l); // Maybe make another offer. deliverEventQueue.start(); // Go back to normal processing } } else if (updatee == self && url) { assert(state == JOINER); state = UPDATEE; acl = broker.getAcl(); broker.setAcl(0); // Disable ACL during update QPID_LOG(notice, *this << " receiving update from " << updater); checkUpdateIn(l); } else { QPID_LOG(info, *this << " unstall, ignore update " << updater << " to " << updatee); deliverEventQueue.start(); // Not involved in update. } if (updatee != self && url) { QPID_LOG(debug, debugSnapshot()); if (mAgent) mAgent->clusterUpdate(); // Updatee will call clusterUpdate() via checkUpdateIn() when update completes } }
void TeamManager::handlePlayerReadyUpdate(const PlayerID player_id) { setReady(player_id); }