void SD_LED2(){ int blink; static uint32_t previousTime = 0; static State state = Initial; if(pressButton() == 1){ blink = 5; }else{ blink = 20; } switch(state){ case Initial: if(delay(blink,previousTime)){ turnOFFLED2(); state = STATE_A; previousTime = updateTimer(); } break; case STATE_A: if(delay(blink,previousTime)){ turnONLED2(); state = STATE_B; previousTime = updateTimer(); } break; case STATE_B: if(delay(blink,previousTime)){ turnOFFLED2(); state = STATE_A; previousTime = updateTimer(); } break; } }
void MainWindow::inicializarTimer(){ //nik: timer timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(updateTimer())); timer->start(); timeInicial = QTime::currentTime(); QTimer::singleShot(1000, this, SLOT(updateTimer())); }
void Emu::Cpu::exec() { uint8_t op = emu->mmu->rb(r.pc); r.m = 0; r.pc++; switch (Ops::opTable[op].argsize) { case 0: { Ops::opTable[op].pf(0); } break; case 1: { uint8_t arg = emu->mmu->rb(Cpu::r.pc); Cpu::r.pc++; Ops::opTable[op].pf(arg); } break; case 2: { uint16_t arg = emu->mmu->rw(Cpu::r.pc); Cpu::r.pc += 2; Ops::opTable[op].pf(arg); } break; } r.m += Ops::opTable[op].m; clock += r.m; frameClock += r.m; updateDivider(r.m); updateTimer(r.m); emu->gpu->exec(r.m); processInterrupts(); }
void Renderer::startMainloop() { Clock::setThread(); const float framerate = fltParam("local.framerate"); float fps = 1.f / framerate; FPSCalculator updateTimer(64); // render loop Clock::time_point last = Clock::now(); while (running_) { std::unique_lock<std::mutex> lock(mutex_); // Run 'posted' functions std::unique_lock<std::mutex> fqueueLock(funcMutex_); for (auto&& func : funcQueue_) { func(); } funcQueue_.clear(); fqueueLock.unlock(); if (controller_) { controller_->processInput(fps); } render(); lock.unlock(); Clock::dumpTimes(); // Regulate frame rate float delay = glm::clamp(2 * fps - Clock::secondsSince(last), 0.f, fps); last = Clock::now(); std::chrono::milliseconds delayms(static_cast<int>(1000 * delay)); std::this_thread::sleep_for(delayms); averageFPS_ = updateTimer.sample(); } }
Tomato::Tomato(QWidget *parent) : QDialog(parent), ui(new Ui::Tomato) { ui->setupUi(this); setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint); // remove "?" on dialog window focusDuration = focusDefault; restDuration = restDefault; elapsedSec = 0; state = IDLE; createActions(); createTrayIcon(); connect(trayIcon, &QSystemTrayIcon::activated, this, &Tomato::iconActivated); connect(trayIcon, &QSystemTrayIcon::messageClicked, this, &Tomato::iconMsgClicked); setIconState(IDLE); setWindowIcon(QIcon(":/sushi")); setWindowTitle(tr("Tomato です")); timer = new QTimer(this); connect(timer,SIGNAL(timeout()),this,SLOT(updateTimer())); verifyStartWithWindows(); QSettings settings("tomato.ini",QSettings::IniFormat); ui->checkInfinity->setChecked(settings.value("InfinityMode").toInt()); }
MainWindow::MainWindow(QWidget *parent):QMainWindow(parent),ui(new Ui::MainWindow) { ui->setupUi(this); ui->label_GenerationTime->setText("Current Generation Time: 00:00:00"); ui->progressBar->setValue(0); ui->progressBar->setAlignment(Qt::AlignRight); ui->list_LevelSet->setContextMenuPolicy(Qt::CustomContextMenu); ui->lineEdit_GeneratorSeed->setValidator(new QIntValidator(0,999999999,this)); ui->lineEdit_GeneratorSeed->setText(0000000000); ui->spin_TimeLimit->setValue(1.00); connect(&Generator, SIGNAL(changeProgressBar(float)), this, SLOT(changeProgressBar(float))); connect(&Generator, SIGNAL(addToList(int)), this, SLOT(addToList(int))); connect(&Generator, SIGNAL(regenFinished(int)), this, SLOT(displayLevel(int))); connect(&Generator, SIGNAL(regenFinished(int)), this, SLOT(displayLevelGenTime(int))); connect(&thread, SIGNAL(finished()), this, SLOT(stopTimer())); connect(&timer, SIGNAL(timeout()), this, SLOT(updateTimer())); connect(&Generator, SIGNAL(resetGUI()), this, SLOT(resetGUI())); connect(ui->list_LevelSet, SIGNAL(currentRowChanged(int)), this, SLOT(displayLevel(int))); connect(ui->combo_RoomH, SIGNAL(currentTextChanged(QString)), this, SLOT(disable3by3(QString))); connect(ui->combo_RoomW, SIGNAL(currentTextChanged(QString)), this, SLOT(disable3by3(QString))); connect(ui->list_LevelSet, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(rightClickMenu(QPoint))); connect(&Generator, SIGNAL(displayGenSeed()), this, SLOT(displayGenSeed())); scene = new QGraphicsScene(this); ui->graphicsView->setScene(scene); Generator.setupForThread(thread); Generator.moveToThread(&thread); }
void SessionBar::mousePressEvent(QMouseEvent * ev) { SegType mn=min(); SegType mx=max(); if (mx < mn) return; SegType total=mx-mn; double px=double(width()-5) / double(total); double sx,ex; QList<SBSeg>::iterator i; int cnt=0; for (i=segments.begin();i!=segments.end();++i) { Session * sess=(*i).session; sx=double(sess->first() - mn) * px; ex=double(sess->last() - mn) * px; if (ex>width()-5) ex=width()-5; //ex-=sx; if ((ev->x() > sx) && (ev->x() < ex) && (ev->y() > 0) && (ev->y() < height())) { (*i).session->setEnabled(!(*i).session->enabled()); emit toggledSession((*i).session); break; } cnt++; } if (timer.isActive()) timer.stop(); timer.singleShot(50,this, SLOT(updateTimer())); }
ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : QObject(parent), optionsModel(optionsModel), peerTableModel(0), cachedNumBlocks(0), cachedMasternodeCountString(""), cachedSystemnodeCountString(""), cachedReindexing(0), cachedImporting(0), numBlocksAtStartup(-1), pollTimer(0) { peerTableModel = new PeerTableModel(this); pollTimer = new QTimer(this); connect(pollTimer, SIGNAL(timeout()), this, SLOT(updateTimer())); pollTimer->start(MODEL_UPDATE_DELAY); pollMnTimer = new QTimer(this); connect(pollMnTimer, SIGNAL(timeout()), this, SLOT(updateMnTimer())); // no need to update as frequent as data for balances/txes/blocks pollMnTimer->start(MODEL_UPDATE_DELAY * 4); pollSnTimer = new QTimer(this); connect(pollSnTimer, SIGNAL(timeout()), this, SLOT(updateSnTimer())); // no need to update as frequent as data for balances/txes/blocks pollSnTimer->start(MODEL_UPDATE_DELAY * 4); subscribeToCoreSignals(); }
/** * Read sonar and update alt/vel topic * Function is called at main loop rate, updates happen at reduced rate */ static void updateSonarTopic(uint32_t currentTime) { static navigationTimer_t sonarUpdateTimer; if (updateTimer(&sonarUpdateTimer, HZ2US(INAV_SONAR_UPDATE_RATE), currentTime)) { if (sensors(SENSOR_SONAR)) { /* Read sonar */ float newSonarAlt = rangefinderRead(); newSonarAlt = rangefinderCalculateAltitude(newSonarAlt, calculateCosTiltAngle()); /* Apply predictive filter to sonar readings (inspired by PX4Flow) */ if (newSonarAlt > 0 && newSonarAlt <= INAV_SONAR_MAX_DISTANCE) { float sonarPredVel, sonarPredAlt; float sonarDt = (currentTime - posEstimator.sonar.lastUpdateTime) * 1e-6; posEstimator.sonar.lastUpdateTime = currentTime; sonarPredVel = (sonarDt < 0.25f) ? posEstimator.sonar.vel : 0.0f; sonarPredAlt = posEstimator.sonar.alt + sonarPredVel * sonarDt; posEstimator.sonar.alt = sonarPredAlt + INAV_SONAR_W1 * (newSonarAlt - sonarPredAlt); posEstimator.sonar.vel = sonarPredVel + INAV_SONAR_W2 * (newSonarAlt - sonarPredAlt); } } else { /* No sonar */ posEstimator.sonar.alt = 0; posEstimator.sonar.vel = 0; posEstimator.sonar.lastUpdateTime = 0; } } }
void SessionBar::mouseMoveEvent(QMouseEvent * ev) { SegType mn=min(); SegType mx=max(); if (mx < mn) return; SegType total=mx-mn; double px=double(width()-5) / double(total); double sx,ex; QList<SBSeg>::iterator i; for (i=segments.begin();i!=segments.end();++i) { SBSeg & seg=*i; sx=double(seg.session->first() - mn) * px; ex=double(seg.session->last() - mn) * px; if (ex>width()-5) ex=width()-5; //ex-=sx; if ((ev->x() > sx) && (ev->x() < ex) && (ev->y() > 0) && (ev->y() < height())) { seg.highlight=true; } else seg.highlight=false; } if (timer.isActive()) timer.stop(); timer.singleShot(50,this, SLOT(updateTimer())); }
void LoginPage::init() { QMap<QString, QString> countryCodes = Utils::GetCountryCodes(); combobox_->setEditBoxClass("CountrySearchEdit"); combobox_->setComboboxViewClass("CountrySearchView"); combobox_->setClass("CountySearchWidgetInternal"); combobox_->setPlaceholder(QT_TRANSLATE_NOOP("login_page","Type country or code")); country_search_widget_->layout()->addWidget(combobox_); combobox_->setSources(countryCodes); connect(combobox_, SIGNAL(selected(QString)), this, SLOT(countrySelected(QString)), Qt::QueuedConnection); connect(this, SIGNAL(country(QString)), this, SLOT(redrawCountryCode()), Qt::QueuedConnection); connect(next_page_link_, SIGNAL(clicked()), this, SLOT(nextPage()), Qt::QueuedConnection); connect(prev_page_link_, SIGNAL(clicked()), this, SLOT(prevPage()), Qt::QueuedConnection); connect(edit_phone_button_, SIGNAL(clicked()), this, SLOT(prevPage()), Qt::QueuedConnection); connect(edit_phone_button_, SIGNAL(clicked()), this, SLOT(stats_edit_phone()), Qt::QueuedConnection); connect(switch_login_link_, SIGNAL(clicked()), this, SLOT(switchLoginType()), Qt::QueuedConnection); connect(resend_button_, SIGNAL(clicked()), this, SLOT(sendCode()), Qt::QueuedConnection); connect(resend_button_, SIGNAL(clicked()), this, SLOT(stats_resend_sms()), Qt::QueuedConnection); connect(timer_, SIGNAL(timeout()), this, SLOT(updateTimer()), Qt::QueuedConnection); connect(proxy_settings_link_, SIGNAL(clicked()), this, SLOT(openProxySettings()), Qt::QueuedConnection); country_code_->setProperty("CountryCodeEdit", true); phone_->setProperty("PhoneNumberEdit", true); phone_->setAttribute(Qt::WA_MacShowFocusRect, false); phone_->setPlaceholderText(QT_TRANSLATE_NOOP("login_page","your phone number")); phone_widget_->layout()->addWidget(country_code_); phone_widget_->layout()->addWidget(phone_); Testing::setAccessibleName(phone_, "StartWindowPhoneNumberField"); connect(country_code_, SIGNAL(focusIn()), this, SLOT(setPhoneFocusIn()), Qt::QueuedConnection); connect(country_code_, SIGNAL(focusOut()), this, SLOT(setPhoneFocusOut()), Qt::QueuedConnection); connect(phone_, SIGNAL(focusIn()), this, SLOT(setPhoneFocusIn()), Qt::QueuedConnection); connect(phone_, SIGNAL(focusOut()), this, SLOT(setPhoneFocusOut()), Qt::QueuedConnection); connect(uin_login_edit_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection); connect(uin_password_edit_, SIGNAL(textEdited(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection); connect(code_edit_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection); connect(code_edit_, SIGNAL(textChanged(QString)), this, SLOT(codeEditChanged(QString)), Qt::QueuedConnection); connect(country_code_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection); connect(country_code_, SIGNAL(textEdited(QString)), this, SLOT(countryCodeChanged(QString)), Qt::QueuedConnection); connect(phone_, SIGNAL(textChanged(QString)), this, SLOT(clearErrors()), Qt::QueuedConnection); connect(phone_, SIGNAL(emptyTextBackspace()), this, SLOT(emptyPhoneRemove()), Qt::QueuedConnection); QObject::connect(Ui::GetDispatcher(), SIGNAL(getSmsResult(int64_t, int, int)), this, SLOT(getSmsResult(int64_t, int, int)), Qt::DirectConnection); QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResult(int64_t, int)), this, SLOT(loginResult(int64_t, int)), Qt::DirectConnection); QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResultAttachUin(int64_t, int)), this, SLOT(loginResultAttachUin(int64_t, int)), Qt::DirectConnection); QObject::connect(Ui::GetDispatcher(), SIGNAL(loginResultAttachPhone(int64_t, int)), this, SLOT(loginResultAttachPhone(int64_t, int)), Qt::DirectConnection); country_code_->setValidator(new QRegExpValidator(QRegExp("[\\+\\d]\\d*"))); phone_->setValidator(new QRegExpValidator(QRegExp("\\d*"))); code_edit_->setValidator(new QRegExpValidator(QRegExp("\\d*"))); combobox_->selectItem(Utils::GetTranslator()->getCurrentPhoneCode()); error_label_->hide(); phone_->setFocus(); country_code_->setFocusPolicy(Qt::ClickFocus); initLoginSubPage(SUBPAGE_PHONE_LOGIN_INDEX); }
void ConfigStabilizationWidget::restoreStabBank(int bank) { UAVObject *stabBankObject = getStabBankObject(bank); if (stabBankObject) { ObjectPersistence *objectPersistenceObject = ObjectPersistence::GetInstance(getObjectManager()); QTimer updateTimer(this); QEventLoop eventLoop(this); connect(&updateTimer, SIGNAL(timeout()), &eventLoop, SLOT(quit())); connect(objectPersistenceObject, SIGNAL(objectUpdated(UAVObject *)), &eventLoop, SLOT(quit())); ObjectPersistence::DataFields data; data.Operation = ObjectPersistence::OPERATION_LOAD; data.Selection = ObjectPersistence::SELECTION_SINGLEOBJECT; data.ObjectID = stabBankObject->getObjID(); data.InstanceID = stabBankObject->getInstID(); objectPersistenceObject->setData(data); objectPersistenceObject->updated(); updateTimer.start(500); eventLoop.exec(); if (updateTimer.isActive()) { stabBankObject->requestUpdate(); } updateTimer.stop(); } }
void renderTextFields() { if (nameExist) { text_layer_set_text(callerName, callerNameText); text_layer_set_text(callerNumType, callerNumTypeText); text_layer_set_text(callerNumber, callerNumberText); layer_set_hidden((Layer * ) callerNumType, false); layer_set_hidden((Layer * ) callerNumber, false); } else { text_layer_set_text(callerName, callerNumberText); layer_set_hidden((Layer * ) callerNumType, true); layer_set_hidden((Layer * ) callerNumber, true); } if (callEstablished) { updateTimer(); } else { text_layer_set_text(title, "Входящий звонок"); } }
int main() { int tstep; char time_str[34]; time_t t0; // Set the parameters int Nx, Ny, Nz, TMAX; Nx = 200; Ny = 200; Nz = 208; TMAX = 100; // Allocate host memory float ***Ex, ***Ey, ***Ez; float ***Hx, ***Hy, ***Hz; float ***CEx, ***CEy, ***CEz; Ex = makeArray(Nx, Ny, Nz); Ey = makeArray(Nx, Ny, Nz); Ez = makeArray(Nx, Ny, Nz); Hx = makeArray(Nx, Ny, Nz); Hy = makeArray(Nx, Ny, Nz); Hz = makeArray(Nx, Ny, Nz); CEx = makeArray(Nx, Ny, Nz); CEy = makeArray(Nx, Ny, Nz); CEz = makeArray(Nx, Ny, Nz); // Geometry set_geometry(Nx, Ny, Nz, CEx, CEy, CEz); // Update on the CPU t0 = time(0); for ( tstep=1; tstep<=TMAX; tstep++) { updateE(Nx, Ny, Nz, Ex, Ey, Ez, Hx, Hy, Hz, CEx, CEy, CEz); updateSrc(Nx, Ny, Nz, Ex, tstep); updateH(Nx, Ny, Nz, Ex, Ey, Ez, Hx, Hy, Hz); if ( tstep/100*100 == tstep ) { //dumpToH5(Nx, Ny, Nz, Nx/2, 0, 0, Nx/2, Ny-1, Nz-1, Ex, "cpu_png/Ex-%05d.h5", tstep); //exec("h5topng -ZM0.1 -x0 -S4 -c /usr/share/h5utils/colormaps/dkbluered cpu_png/Ex-%05d.h5", tstep); updateTimer(t0, tstep, time_str); printf("tstep=%d\t%s\n", tstep, time_str); } } updateTimer(t0, tstep, time_str); printf("tstep=%d\t%s\n", tstep, time_str); }
void FractalModel::setViewMode( ViewMode mode ) { if ( m_viewMode != mode ) { m_viewMode = mode; updateTimer(); emit viewModeChanged(); } }
void FractalModel::setAnimationSettings( const AnimationSettings& settings ) { if ( m_animationSettings != settings ) { m_animationSettings = settings; updateTimer(); emit animationSettingsChanged(); } }
unsigned char addThread(void (*fnc)(void), unsigned long freq) { threads.id[threads.count].fnc = fnc; if(freq!=0) threads.id[threads.count].freq = freq-1; //in ms else threads.id[threads.count].freq = 0; threads.id[threads.count].cnt = 0; threads.count++; updateTimer(); return threads.count-1; }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { winnerB = 0; ui->setupUi(this); ta = new TaskAllocator(); socket = new QUdpSocket(this); socket->bind(QHostAddress::LocalHost, port1, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint); qDebug() << "socket created"; connect(socket, SIGNAL(readyRead()), this, SLOT(onMessageReceived())); connect(ta, SIGNAL(winnerFound(int,int)),this,SLOT(onWinnerFound(int,int))); connect(ta, SIGNAL(taskAssigned(QString)),this,SLOT(onTaskAssigned(QString))); connect(ta, SIGNAL(tasksComplete()),this,SLOT(missionComplete())); for(int i = 0; i < 3; i++){ manual[i] = false; stopped[i] = false; } //Make the text area non-editable so we can read key events ui->textEdit->setReadOnly(true); //Initialize key press trackers to false aPressed = wPressed = sPressed = dPressed = false; // connect(&socket,SIGNAL(readyRead()),this,SLOT(on_message_received1())); // connect(&socket2,SIGNAL(readyRead()),this,SLOT(on_message_received2())); // connect(&socket3,SIGNAL(readyRead()),this,SLOT(on_message_received3())); // socket.connectToHost("localhost",port1,QIODevice::ReadWrite); // socket2.connectToHost("localhost",port2,QIODevice::ReadWrite); // socket3.connectToHost("localhost",port3,QIODevice::ReadWrite); // socket4.connectToHost("localhost",port4,QIODevice::ReadWrite); // r1.socket = &socket; // r2.socket = &socket2; // r3.socket = &socket3; // qDebug() << "attempting connection"; // if(socket.waitForConnected()&& socket2.waitForConnected()&& socket3.waitForConnected()&& socket4.waitForConnected()){ // qDebug() << "connected"; // }else{ // qDebug() << "not connected"; // } QStringList hHeader; hHeader.append("ID"); hHeader.append("TYPE"); hHeader.append("STATUS"); //model.index(1,1,model.index(0,0)); model = new QStandardItemModel(0,3,this); model->setHorizontalHeaderLabels(hHeader); ui->robotTable->setModel(model); ui->robotTable->setColumnWidth(0,30); ui->robotTable->setColumnWidth(1,50); ui->robotTable->horizontalHeader()->setStretchLastSection(true); connect(&timer, SIGNAL(timeout()), this, SLOT(updateTimer())); timer.start(10); mStart = false; //ui->robotTable->resizeColumnsToContents(); }
ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : QObject(parent), optionsModel(optionsModel), cachedNumBlocks(0), cachedNumBlocksOfPeers(0), numBlocksAtStartup(-1), pollTimer(0) { pollTimer = new QTimer(this); pollTimer->setInterval(MODEL_UPDATE_DELAY); pollTimer->start(); connect(pollTimer, SIGNAL(timeout()), this, SLOT(updateTimer())); subscribeToCoreSignals(); }
void FormStreamingImp::make_connections() { connect( pb_start, SIGNAL( clicked(bool) ), SLOT(startStream() )); connect( pb_stop, SIGNAL( clicked(bool) ), SLOT(stopStream() )); connect( pb_capture, SIGNAL( clicked(bool)),SLOT(grabPicture())); connect( pb_movie, SIGNAL( clicked(bool)), SLOT(grabMovie())); /*Qtimer Actually this is better that putting getFrame on on a "Real" (qtimer works inside a thread too) QThread and polling, because some locking method must be done for that thread while using the same image pointer. If you want to use a thread, you sould change the pass by pointer/ref. also take care of the plugins work. */ connect(tet,SIGNAL(timeout()), this, SLOT(updateTimer())); }
void LoginPage::sendCode() { timer_->stop(); gui_coll_helper collection(GetDispatcher()->create_collection(), true); collection.set_value_as_qstring("country", country_code_->text()); collection.set_value_as_qstring("phone", phone_->text()); collection.set_value_as_qstring("locale", Utils::GetTranslator()->getCurrentLang()); GetDispatcher()->post_message_to_core("login_get_sms_code", collection.get()); remaining_seconds_ = 60; updateTimer(); }
ZoneClockPanel::ZoneClockPanel(TQWidget *parent, const char *name) : TQFrame(parent, name), _dlg(0) { _flow = new SimpleFlow(this,1,1); TQTimer *t = new TQTimer(this); connect(t, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateTimer())); t->start(500); _clocks.setAutoDelete(true); }
void callscreen_second() { if (callEstablished) { elapsedTime++; updateTimer(); } else { if (speakerOn) vibes_double_pulse(); } }
void wakeTimer() { stopTimerCount = 0; if (state == state_Sleep) { startShowTime(); tick_timer_reset(delay_Second, TICK_SECOND); tick_timer_reset(delay_Update, 1); pwmSet(pwmRunning); updateTimer(); } else pwmSet(pwmRunning); }
void SessionBar::updateTimer() { if (!underMouse()) { QList<SBSeg>::iterator i; for (i=segments.begin();i!=segments.end();++i) { (*i).highlight=false; } } else { timer.singleShot(50,this, SLOT(updateTimer())); } update(); }
void GamePromptCenter::update(float dt) { updateCompMNMsg(dt); // 需要放在前面,其内部控件逻辑共享updateSystemMsg + updateSystemNotice1 updateCompMPMsg(dt); // 需要放在前面,其内部控件逻辑共享updateSystemMsg + updateSystemPrompt updateSystemMsg(dt); updateSystemNotice1(dt); updateSystemNotice2(dt); updateSystemPrompt(dt); updateSystemNormal(dt); updateSystemAlert(dt); updateSystemIcons(dt); updateTimer(dt); }
Moderator::Moderator() { commandLine = false; gamestate = GAME_STOPPED; timer = new QTimer(); connect(timer,SIGNAL(timeout()),SLOT(updateTimer())); timePerTurnTimer = new QTimer(); connect(this->timePerTurnTimer,SIGNAL(timeout()),this,SLOT(decrementTimePerTurnTimer())); timePerMove = 10000; delayBeforeMove = 1000; //choose your directory player1GoesFirst = true; player1 = NULL; player2 = NULL; }
ClientModel::ClientModel(OptionsModel *_optionsModel, QObject *parent) : QObject(parent), optionsModel(_optionsModel), peerTableModel(0), banTableModel(0), pollTimer(0) { peerTableModel = new PeerTableModel(this); banTableModel = new BanTableModel(this); pollTimer = new QTimer(this); connect(pollTimer, SIGNAL(timeout()), this, SLOT(updateTimer())); pollTimer->start(MODEL_UPDATE_DELAY); subscribeToCoreSignals(); }
ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : QObject(parent), optionsModel(optionsModel), peerTableModel(0), cachedNumBlocks(0), cachedReindexing(0), cachedImporting(0), numBlocksAtStartup(-1), pollTimer(0) { peerTableModel = new PeerTableModel(this); pollTimer = new QTimer(this); connect(pollTimer, SIGNAL(timeout()), this, SLOT(updateTimer())); pollTimer->start(MODEL_UPDATE_DELAY); subscribeToCoreSignals(); }
ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : QObject(parent), optionsModel(optionsModel), cachedNumBlocks(0), cachedNumHeaders(0), cachedReindexing(0), cachedImporting(0), cachedTrieOnline(0), cachedTotalMissing(0), cachedTrieComplete(0), cachedValidating(0), cachedProgress(0), nProgress(0), numBlocksAtStartup(-1), pollTimer(0) { pollTimer = new QTimer(this); connect(pollTimer, SIGNAL(timeout()), this, SLOT(updateTimer())); pollTimer->start(MODEL_UPDATE_DELAY); subscribeToCoreSignals(); }