这篇教程C++ updateSpeed函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中updateSpeed函数的典型用法代码示例。如果您正苦于以下问题:C++ updateSpeed函数的具体用法?C++ updateSpeed怎么用?C++ updateSpeed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了updateSpeed函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ULTRACOPIER_DEBUGCONSOLEvoid ThemesFactory::on_SliderSpeed_valueChanged(int value){ if(optionsEngine==NULL) return; if(!ui->checkBoxShowSpeed->isChecked()) return; ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QString("value: %1").arg(value)); switch(value) { case 0: currentSpeed=0; break; case 1: currentSpeed=1024; break; case 2: currentSpeed=1024*4; break; case 3: currentSpeed=1024*16; break; case 4: currentSpeed=1024*64; break; case 5: currentSpeed=1024*128; break; } if(optionsEngine!=NULL) optionsEngine->setOptionValue("currentSpeed",currentSpeed); else ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); updateSpeed();}
开发者ID:AutoRunWare,项目名称:Ultracopier,代码行数:34,
示例2: updatePos// Update data.void MyCar::update(TrackDesc* track, tCarElt* car, tSituation *situation){ updatePos(); updateDir(); updateSpeedSqr(); updateSpeed(); // Update currentsegment and destination segment id's. int searchrange = MAX((int) ceil(situation->deltaTime*speed+1.0) * 2, 4); currentsegid = destsegid = pf->getCurrentSegment(car, searchrange); double l = 0.0; while (l < 2.0 * wheelbase) { l = l + dynpath->getLength(destsegid); destsegid = (destsegid + 1 + pf->getnPathSeg()) % pf->getnPathSeg(); } currentseg = track->getSegmentPtr(currentsegid); destseg = track->getSegmentPtr(destsegid); currentpathsegid = currentsegid; updateDError(); int lookahead = (destsegid + (int) (MIN(LOOKAHEAD_MAX_ERROR,derror)*speed*LOOKAHEAD_FACTOR)) % pf->getnPathSeg(); destpathsegid = lookahead; mass = carmass + car->priv.fuel; trtime += situation->deltaTime; deltapitch = MAX(-track->getSegmentPtr(currentsegid)->getKgamma() - me->_pitch, 0.0);}
开发者ID:chagge,项目名称:gym_torcs,代码行数:29,
示例3: Classvoid Player::setDefaultSpeed(const AnimationSpeed& speed_){ defaultSpeed = speed_; speed = Class()->getSpeed(playerAnimation); animation.elapsedTime.timeout = speed.animation; updateSpeed();}
开发者ID:dgengin,项目名称:DGEngine,代码行数:7,
示例4: movevoid HelloWorld::update(float dt) { left = right = down = false;#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) if ((GetAsyncKeyState(VK_LEFT) & 0x8000)==0x8000) { left = true; move(MOVELEFT); } if ((GetAsyncKeyState(VK_RIGHT) & 0x8000)==0x8000) { right = true; move(MOVERIGHT); } if ((GetAsyncKeyState(VK_UP) & 0x8000)==0x8000) { move(JUMP); } if ((GetAsyncKeyState(VK_DOWN) & 0x8000)==0x8000) { down = true; move(SQUAT); }#endif if( !isJumping ) { if( right && left ) { move(moveDir); } else if(!right && !left && !down) { move(STAND); } } updateSpeed(); updateWeapon();}
开发者ID:Ratel13,项目名称:Flash2Cocos2d-x,代码行数:32,
示例5: switchvoid Themes::on_SliderSpeed_valueChanged(int value){ if(!uiOptions->checkBoxShowSpeed->isChecked()) return; switch(value) { case 0: currentSpeed=0; break; case 1: currentSpeed=1024; break; case 2: currentSpeed=1024*4; break; case 3: currentSpeed=1024*16; break; case 4: currentSpeed=1024*64; break; case 5: currentSpeed=1024*128; break; } ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("value: %1").arg(value)); emit newSpeedLimitation(currentSpeed); updateSpeed();}
开发者ID:amitamitamitamit,项目名称:Ultracopier,代码行数:29,
示例6: acceptvoid CopyProgressDialog::update(){ const int state = fileCopy->GetState(); if(state == FileCopy::Finished) { refreshTimer.stop(); accept(); } if(state != FileCopy::Running && state != FileCopy::ForcedRunning) return; updateSpeed(); ui.progressBar->setValue(fileCopy->GetProgress()); ui.totalSizeLabel->setText(tr("Total: ") + formatSize(fileCopy->GetTotalBytesCopied()) + '/' + formatSize(fileCopy->GetTotalSize())); if(const FileInfo *file = fileCopy->GetCurrentCopiedFile()) { ui.sourceLabel->setText(file->name); ui.currentFileBytesCopied->setText(formatSize(fileCopy->GetCurrentFileBytesCopied()) + '/' + formatSize(file->size)); } ui.progressBar_2->setValue(fileCopy->GetCurrentFileProgress()); }
开发者ID:TeamKami,项目名称:KamiCmd,代码行数:27,
示例7: disconnectvoid CentralWidget::slotClientDisconnected(){ if (!connError) connectionStatusLabel->setText(tr(connetionStatus[CS_DISCONNECTED])); connectButton->setText(tr("Connect")); connectButton->setEnabled(true); connectButton->setIcon(QIcon(CONNECT_BUTTON_IMAGE_CONNECT)); disconnect(connectButton, SIGNAL(clicked()), this, SLOT(slotClientAbortConnect())); disconnect(connectButton, SIGNAL(clicked()), this, SLOT(slotClientDisconnecting())); connect(connectButton, SIGNAL(clicked()), this, SLOT(slotClientConnecting()));#ifdef CONFIG_SPEAKER speaker->stopStream();#endif sendCmdTimer->stop(); receiveCmdAckTimer->stop(); videoPlayer->showVideoWidget(false); updateBatteryChargeLevel(0); updateSpeed(0); updateDistanceToObstacle(0); initRemoteSettings();}
开发者ID:bbogush,项目名称:wall-e,代码行数:26,
示例8: switchint MiningPage::qt_metacall(QMetaObject::Call _c, int _id, void **_a){ _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: startPressed(); break; case 1: startPoolMining(); break; case 2: stopPoolMining(); break; case 3: updateSpeed(); break; case 4: loadSettings(); break; case 5: saveSettings(); break; case 6: reportToList((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< QString(*)>(_a[3]))); break; case 7: minerStarted(); break; case 8: minerError((*reinterpret_cast< QProcess::ProcessError(*)>(_a[1]))); break; case 9: minerFinished(); break; case 10: readProcessOutput(); break; case 11: { QString _r = getTime((*reinterpret_cast< QString(*)>(_a[1]))); if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; } break; case 12: enableMiningControls((*reinterpret_cast< bool(*)>(_a[1]))); break; case 13: enablePoolMiningControls((*reinterpret_cast< bool(*)>(_a[1]))); break; case 14: { ClientModel::MiningType _r = getMiningType(); if (_a[0]) *reinterpret_cast< ClientModel::MiningType*>(_a[0]) = _r; } break; case 15: typeChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 16: debugToggled((*reinterpret_cast< bool(*)>(_a[1]))); break; default: ; } _id -= 17; } return _id;}
开发者ID:signat,项目名称:bsacoin,代码行数:32,
示例9: digitalWritevoid MotorsClass::turnRightQuickly(int speed) { if (setDirection(DIRECTION_RIGHT)) { digitalWrite(leftDirectionPin_, HIGH); digitalWrite(rightDirectionPin_, LOW); delay(DIRECTION_UPDATE_DELAY); } updateSpeed(speed, speed);}
开发者ID:leewaya,项目名称:remotecar,代码行数:9,
示例10: updateSpeedvoid MotorsClass::updateSpeedPct(int leftSpeedPct, int rightSpeedPct){ if (!isBegin_) { return; } int16_t leftSpeed = 255 * leftSpeedPct / 100.0; int16_t rightSpeed = 255 * rightSpeedPct / 100.0; updateSpeed(leftSpeed, rightSpeed);}
开发者ID:leewaya,项目名称:remotecar,代码行数:9,
示例11: updateSpeedvoid Wind::OnLoop() { t++; if (t%5 == 0){ X_Speed = 0; } if (t%10 == 0){ updateSpeed(); }}
开发者ID:Natelegreat1,项目名称:Pikarun,代码行数:9,
示例12: updateCameravoid viewport::moveForward(){ camRadius -= zoomSpeed; if(camRadius < minCamRadius) camRadius = minCamRadius; updateCamera(); updateSpeed();}
开发者ID:FlorianKummer,项目名称:OCCA2,代码行数:9,
示例13: QWidgetThemesFactory::ThemesFactory(){ optionsEngine=NULL; tempWidget=new QWidget(); ui=new Ui::themesOptions(); ui->setupUi(tempWidget); ui->toolBox->setCurrentIndex(0); currentSpeed = 0; updateSpeed();}
开发者ID:AutoRunWare,项目名称:Ultracopier,代码行数:10,
示例14: updatePosvoid OtherCar::update(){ updatePos(); updateDir(); updateSpeedSqr(); updateSpeed(); int searchrange = MAX((int) ceil(dt*speed+1.0) * 2, 4); currentsegid = track->getCurrentSegment(getCarPtr(), currentsegid, searchrange);}
开发者ID:chagge,项目名称:gym_torcs,代码行数:10,
示例15: QMainWindowMainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this); connect(&water, SIGNAL(updateSpeed(qint16)), this, SLOT(setSpeedLabel(qint16))); connect(&water, SIGNAL(updateWaterLevel(QString)), this, SLOT(setWaterLevelLabel(QString))); connect(&water, SIGNAL(updateTemp1(qint16)), this, SLOT(setTemp1Label(qint16))); connect(&water, SIGNAL(updateTemp2(qint16)), this, SLOT(setTemp2Label(qint16)));}
开发者ID:GorgedeLoup,项目名称:WaterCycle,代码行数:11,
示例16: QWidgetThemesFactory::ThemesFactory(){ optionsEngine=NULL; tempWidget=new QWidget(); ui=new Ui::themesOptions(); ui->setupUi(tempWidget); ui->toolBox->setCurrentIndex(0); currentSpeed = 0; updateSpeed(); qRegisterMetaType<QList<QPersistentModelIndex> >("QList<QPersistentModelIndex>");}
开发者ID:amitamitamitamit,项目名称:Ultracopier,代码行数:12,
示例17: QPointFvoid Ball::move(){ QPointF v = QPointF(-(speed_.x() * (10.0 / Frames) + acc_.reading()->x() * (1.0 / Frames) * (10.0 / Frames) / 2), speed_.y() * (10.0 / Frames) + acc_.reading()->y() * (1.0 / Frames) * (10.0 / Frames) / 2); if (collidingItems().size() == 0) { moveBy(v.x(), v.y()); updateSpeed(); } else { emit collision(); }}
开发者ID:Wookesh,项目名称:Gravity-Ball,代码行数:12,
示例18: pixmapQWidget * ThemesFactory::options(){ if(optionsEngine!=NULL) { bool ok; currentSpeed=optionsEngine->getOptionValue("currentSpeed").toUInt(&ok); if(!ok) currentSpeed=0; ui->comboBox_copyEnd->setCurrentIndex(optionsEngine->getOptionValue("comboBox_copyEnd").toUInt()); ui->speedWithProgressBar->setChecked(optionsEngine->getOptionValue("speedWithProgressBar").toBool()); ui->checkBoxShowSpeed->setChecked(optionsEngine->getOptionValue("checkBoxShowSpeed").toBool()); ui->checkBoxStartWithMoreButtonPushed->setChecked(optionsEngine->getOptionValue("moreButtonPushed").toBool()); ui->showDualProgression->setChecked(optionsEngine->getOptionValue("showDualProgression").toBool()); ui->showProgressionInTheTitle->setChecked(optionsEngine->getOptionValue("showProgressionInTheTitle").toBool()); ui->alwaysOnTop->setChecked(optionsEngine->getOptionValue("alwaysOnTop").toBool()); ui->minimizeToSystray->setChecked(optionsEngine->getOptionValue("minimizeToSystray").toBool()); progressColorWrite=optionsEngine->getOptionValue("progressColorWrite").value<QColor>(); progressColorRead=optionsEngine->getOptionValue("progressColorRead").value<QColor>(); progressColorRemaining=optionsEngine->getOptionValue("progressColorRemaining").value<QColor>(); QPixmap pixmap(75,20); pixmap.fill(progressColorWrite); ui->progressColorWrite->setIcon(pixmap); pixmap.fill(progressColorRead); ui->progressColorRead->setIcon(pixmap); pixmap.fill(progressColorRemaining); ui->progressColorRemaining->setIcon(pixmap); updateSpeed(); updateProgressionColorBar(); connect(ui->alwaysOnTop,&QCheckBox::stateChanged,this,&ThemesFactory::alwaysOnTop); connect(ui->checkBoxShowSpeed,&QCheckBox::stateChanged,this,&ThemesFactory::checkBoxShowSpeed); connect(ui->minimizeToSystray,&QCheckBox::stateChanged,this,&ThemesFactory::minimizeToSystray); connect(ui->checkBox_limitSpeed,&QCheckBox::stateChanged,this,&ThemesFactory::uiUpdateSpeed); connect(ui->SliderSpeed,&QAbstractSlider::valueChanged,this,&ThemesFactory::on_SliderSpeed_valueChanged); connect(ui->limitSpeed,static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &ThemesFactory::uiUpdateSpeed); connect(ui->checkBoxShowSpeed,&QAbstractButton::toggled,this,&ThemesFactory::checkBoxShowSpeedHaveChanged); connect(ui->checkBoxStartWithMoreButtonPushed,&QAbstractButton::toggled,this,&ThemesFactory::checkBoxStartWithMoreButtonPushedHaveChanged); connect(ui->speedWithProgressBar,&QAbstractButton::toggled,this,&ThemesFactory::speedWithProgressBar); connect(ui->comboBox_copyEnd, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,&ThemesFactory::comboBox_copyEnd); connect(ui->showDualProgression,&QCheckBox::stateChanged,this,&ThemesFactory::showDualProgression); connect(ui->showDualProgression,&QCheckBox::stateChanged,this,&ThemesFactory::updateProgressionColorBar); connect(ui->showProgressionInTheTitle,&QCheckBox::stateChanged,this,&ThemesFactory::setShowProgressionInTheTitle); connect(ui->progressColorWrite,&QAbstractButton::clicked,this,&ThemesFactory::progressColorWrite_clicked); connect(ui->progressColorRead, &QAbstractButton::clicked,this,&ThemesFactory::progressColorRead_clicked); connect(ui->progressColorRemaining,&QAbstractButton::clicked,this,&ThemesFactory::progressColorRemaining_clicked); } else ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"internal error, crash prevented"); ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"return the options"); return tempWidget;}
开发者ID:AutoRunWare,项目名称:Ultracopier,代码行数:53,
示例19: QStringvoid MiningPage::reportToList(QString msg, int type, QString time){ QString message; if (time == NULL) message = QString("[%1] - %2").arg(QTime::currentTime().toString(), msg); else message = QString("[%1] - %2").arg(time, msg); switch(type) { case SHARE_SUCCESS: acceptedShares++; roundAcceptedShares++; updateSpeed(); break; case SHARE_FAIL: rejectedShares++; roundRejectedShares++; updateSpeed(); break; case LONGPOLL: roundAcceptedShares = 0; roundRejectedShares = 0; break; default: break; } ui->list->addItem(message); ui->list->scrollToBottom(); }
开发者ID:365-Coin,项目名称:365coin,代码行数:40,
示例20: setCarPtrvoid OtherCar::init(TrackDesc* itrack, tCarElt* car, tSituation *situation){ track = itrack; dt = situation->deltaTime; setCarPtr(car); currentsegid = track->getCurrentSegment(car); initCGh(); updatePos(); updateDir(); updateSpeedSqr(); updateSpeed();}
开发者ID:chagge,项目名称:gym_torcs,代码行数:13,
示例21: abortRequestvoid HttpConnection::on(BufferedSocketListener::Data, uint8_t* aBuf, size_t aLen) noexcept { if(size != -1 && static_cast<size_t>(size - done) < aLen) { abortRequest(true); connState = CONN_FAILED; fire(HttpConnectionListener::Failed(), this, str(F_("Too much data in response body (%1%)") % url)); return; } done += aLen; updateSpeed(); fire(HttpConnectionListener::Data(), this, aBuf, aLen);}
开发者ID:hjpotter92,项目名称:dcplusplus,代码行数:13,
示例22: updateSpeedvoid Fruit::removeEquipment(Equipment *equipment){ int index = -1; for (int i=0; i<listEquipment.size(); i++) { if (listEquipment[i] == equipment) { index = i; capacity += listEquipment[i]->getWeight(); updateSpeed(); break; } } listEquipment.erase(listEquipment.begin()+index-1);}
开发者ID:aurelien-defossez,项目名称:cod-open-world,代码行数:15,
示例23: ULTRACOPIER_DEBUGCONSOLEvoid Themes::newLanguageLoaded(){ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start"); if(modeIsForced) forceCopyMode(mode); ui->retranslateUi(this); if(!haveStarted) ui->current_file->setText(tr("File Name, 0KB")); else updateCurrentFileInformation(); updateOverallInformation(); updateSpeed(); ui->tabWidget->setTabText(4,facilityEngine->translateText("Copy engine")); on_moreButton_toggled(ui->moreButton->isChecked());}
开发者ID:dolanor,项目名称:Ultracopier,代码行数:15,
示例24: updateSpeedvoid Agent::removeEquipment(sp<AEquipment> object){ this->equipment.remove(object); if (unit) { unit->updateDisplayedItem(); } if (object->equippedSlotType == AEquipmentSlotType::RightHand) { rightHandItem = nullptr; } if (object->equippedSlotType == AEquipmentSlotType::LeftHand) { leftHandItem = nullptr; } object->ownerAgent.clear(); updateSpeed();}
开发者ID:steveschnepp,项目名称:OpenApoc,代码行数:18,
示例25: maintask main(){ initializeRobot(); waitForStart(); int threshold = 10; /* Int 'threshold' will allow us to ignore low */ /* readings that keep our robot in perpetual motion. */ while(true) // Infinite loop: { getJoystickSettings(joystick); updateSpeed(); //if(abs(joystick.joy1_y1) > threshold) { // Controller 1, right joystick does right motor // motor[leftMotor] = joystick.joy1_y1; // } else { // motor[leftMotor] = 0; //} //if(abs(joystick.joy1_y2) > threshold) { // Controller 1, left joystick does left motor // motor[rightMotor] = joystick.joy1_y2; // } else { // motor[rightMotor] = 0; //} //if(joy1Btn(1)) // { // Servo[servo1] = 100; // motor[leftMotor] = 100; // } // else if(joy1Btn(2)) // { // Servo[servo1]= -100 ; // motor[rightMotor] = 100; // } else if (joy1Btn(3)) // { // Servo[servo1]= 0; // motor[rightMotor] = 100; // motor[leftMotor] = 100; // } else if (joy1Btn(4)){ // motor[rightMotor] = 0; // motor[leftMotor] = 0; // } }}
开发者ID:IronRiders,项目名称:Cascade-Effect,代码行数:44,
示例26: syncWithServervoid OMXPlayerSync::update (){ if ( updateTicker >= UPDATE_THRESHOLD ) { syncWithServer (); if ( syncType == SYNC_CLIENT ) { updateJitter (); updateSpeed (); } updateTicker = 0; displayVerbose (); } else { updateTicker++; }}
开发者ID:pukster,项目名称:omxplayer-sync-2,代码行数:19,
示例27: Q_UNUSEDvoid ThemesFactory::setResources(OptionInterface * optionsEngine,const QString & #ifdef ULTRACOPIER_PLUGIN_DEBUG writePath #endif ,const QString & #ifdef ULTRACOPIER_PLUGIN_DEBUG pluginPath #endif ,FacilityInterface * facilityEngine,const bool &portableVersion){ Q_UNUSED(portableVersion); Q_UNUSED(writePath); Q_UNUSED(pluginPath); ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, writePath: "+writePath+", pluginPath: "+pluginPath); this->facilityEngine=facilityEngine; if(optionsEngine!=NULL) { this->optionsEngine=optionsEngine; //load the options QList<QPair<QString, QVariant> > KeysList; KeysList.append(qMakePair(QStringLiteral("checkBoxShowSpeed"),QVariant(false))); KeysList.append(qMakePair(QStringLiteral("moreButtonPushed"),QVariant(false))); KeysList.append(qMakePair(QStringLiteral("speedWithProgressBar"),QVariant(true))); KeysList.append(qMakePair(QStringLiteral("currentSpeed"),QVariant(0))); KeysList.append(qMakePair(QStringLiteral("comboBox_copyEnd"),QVariant(0))); KeysList.append(qMakePair(QStringLiteral("showDualProgression"),QVariant(false))); KeysList.append(qMakePair(QStringLiteral("showProgressionInTheTitle"),QVariant(true))); KeysList.append(qMakePair(QStringLiteral("progressColorWrite"),QVariant(QApplication::palette().color(QPalette::Highlight)))); KeysList.append(qMakePair(QStringLiteral("progressColorRead"),QVariant(QApplication::palette().color(QPalette::AlternateBase)))); KeysList.append(qMakePair(QStringLiteral("progressColorRemaining"),QVariant(QApplication::palette().color(QPalette::Base)))); KeysList.append(qMakePair(QStringLiteral("alwaysOnTop"),QVariant(false))); KeysList.append(qMakePair(QStringLiteral("minimizeToSystray"),QVariant(false))); optionsEngine->addOptionGroup(KeysList); connect(optionsEngine,&OptionInterface::resetOptions,this,&ThemesFactory::resetOptions); updateSpeed(); } #ifndef __GNUC__ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"__GNUC__ is not set"); #else ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"__GNUC__ is set"); #endif}
开发者ID:inno-v,项目名称:Ultracopier,代码行数:42,
注:本文中的updateSpeed函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ updateStakingIcon函数代码示例 C++ updateSize函数代码示例 |