• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ enterState函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中enterState函数的典型用法代码示例。如果您正苦于以下问题:C++ enterState函数的具体用法?C++ enterState怎么用?C++ enterState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了enterState函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: enterState

void Rover::move(float distance) {

    //Convert from metres into millimetres.
    distance *= 1000;
    //Work out how many pulses are required to go that many millimetres.
    distance *= PULSES_PER_MM;
    //Make sure we scale the number of pulses according to our encoding method.
    distance /= ENCODING;

    positionSetPoint_ = distance;

    //Moving forward.
    if (distance > 0) {

        enterState(STATE_MOVING_FORWARD);

    }
    //Moving backward.
    else if (distance < 0) {

        enterState(STATE_MOVING_BACKWARD);

    }

    //If distance == 0, then do nothing, i.e. stay stationary.

}
开发者ID:acm-uiuc,项目名称:Kinect-Mapper,代码行数:27,代码来源:Rover.cpp


示例2: GGDBGM

void FalseColorDock::processApplyClicked()
{
	if(coloringState[selectedColoring()] == FalseColoringState::CALCULATING) {
		GGDBGM("enterState():"<<endl);
		enterState(selectedColoring(), FalseColoringState::ABORTING);

		if (lastShown == selectedColoring()) {
			// Cancel after re-calc
			enterState(selectedColoring(), FalseColoringState::UNKNOWN);
			emit unsubscribeFalseColoring(this, selectedColoring());
			updateProgressBar();
			updateTheButton();
		} else {
			emit unsubscribeFalseColoring(this, selectedColoring());

			// go back to last shown coloring
			if(coloringUpToDate[lastShown]) {
				uisel->sourceBox->setCurrentIndex(int(lastShown));
				requestColoring(lastShown);
			} else { // or fall back to CMF, e.g. after ROI change
				uisel->sourceBox->setCurrentIndex(FalseColoring::CMF);
				requestColoring(FalseColoring::CMF);
			}
		}
	} else if( coloringState[selectedColoring()] == FalseColoringState::FINISHED ||
			  coloringState[selectedColoring()] == FalseColoringState::UNKNOWN )
	{
		requestColoring(selectedColoring(), /* recalc */ true);

	}
}
开发者ID:philippefoubert,项目名称:gerbil,代码行数:31,代码来源:falsecolordock.cpp


示例3: abs

void Rover::turn(int degrees) {

    //Correct the amount to turn based on deviation during last segment.
    headingSetPoint_ = abs(degrees) + (endHeading_ - startHeading_);
    
    //In case the rover tries to [pointlessly] turn >360 degrees.
    if (headingSetPoint_ > 359.8){
    
        headingSetPoint_ -= 359.8;
    
    }

    //Rotating clockwise.
    if (degrees > 0) {

        enterState(STATE_ROTATING_CLOCKWISE);

    }
    //Rotating counter-clockwise.
    else if (degrees < 0) {

        enterState(STATE_ROTATING_COUNTER_CLOCKWISE);

    }

    //If degrees == 0, then do nothing, i.e. stay stationary.

}
开发者ID:acm-uiuc,项目名称:Kinect-Mapper,代码行数:28,代码来源:Rover.cpp


示例4: enterState

void XtgScanner::defAtRate()
{
	enterState(nameMode);
	sfcName = getToken();
	if (sfcName == "@$:")
	{
		if (doc->paragraphStyles().contains(m_item->itemName() + "_Normal"))
		{
			ParagraphStyle newStyle;
			newStyle.setParent(m_item->itemName() + "_Normal");
			currentParagraphStyle = newStyle;
			currentCharStyle = newStyle.charStyle();
		}
		else if (doc->paragraphStyles().contains("Normal"))
		{
			ParagraphStyle newStyle;
			newStyle.setParent("Normal");
			currentParagraphStyle = newStyle;
			currentCharStyle = newStyle.charStyle();
		}
		enterState(previousState());
	}
	else if (sfcName == "@:")
	{
		QString pStyle = CommonStrings::DefaultParagraphStyle;
		ParagraphStyle newStyle;
		newStyle.setParent(pStyle);
		newStyle.setLineSpacingMode(ParagraphStyle::AutomaticLineSpacing);
		currentParagraphStyle = newStyle;
		currentCharStyle = newStyle.charStyle();
		currentCharStyle.setFontSize(120.0);
		styleEffects = ScStyle_None;
		currentCharStyle.setFeatures(styleEffects.featureList());
		enterState(textMode);
	}
	else if (doc->paragraphStyles().contains(m_item->itemName() + "_" + sfcName))
	{
		ParagraphStyle newStyle;
		newStyle.setParent(m_item->itemName() + "_" + sfcName);
		currentParagraphStyle = newStyle;
		currentCharStyle = newStyle.charStyle();
		if (lookAhead() == ':')
			top++;
		enterState(textMode);
	}
	else if (doc->paragraphStyles().contains(sfcName))
	{
		ParagraphStyle newStyle;
		newStyle.setParent(sfcName);
		currentParagraphStyle = newStyle;
		currentCharStyle = newStyle.charStyle();
		if (lookAhead() == ':')
			top++;
		enterState(textMode);
	}
}
开发者ID:Sheikha443,项目名称:scribus,代码行数:56,代码来源:xtgscanner.cpp


示例5: analogRead

/*----------------------------------- CompressorSystem::heartbeat-----------------------------------
 *  This is called from the heartbeat() in the main page
 *  1. Reads the reservoir pressure
 *  2. Fills tank when it is too low, enters starting state
 *  3. Waits for one loop through, then enters the on state
 *  4. Once tank is filled to correct pressure, enter stopping state
 *  5. Waits for on loop through, then enters the off state
*/
void CompressorSystem::heartbeat(void){
  //Serial.print("Compressor System Heartbeat Started, State: "); Serial.println(comp.state);

  int reservoirPressure = analogRead(aiReservoirPin);
  if(reservoirPressure < pvTankPressMin-100)
	  reservoirPressure = pvTankPressMin;

  switch(state){
    case CSS_OFF:
      if (reservoirPressure <= pvTankPressMin) { //if the compressor is off, and the tank is to low, turn it on
        inverter.neededByCompressor(true);
//        Serial.print(" reservoirPressure: "); Serial.println(reservoirPressure);
        digitalWrite(oUnloaderPin, HIGH); //dump pressure for 2 heart beats before compressor is truned on
        pvUnloaderTimeout = 2;    // number of heartbeat intervals to wait for unloader
        enterState(CSS_STARTING); //compressor system is now starting
      } else
        digitalWrite(oCompressorPin, LOW); //turn off compressor
      break;

    case CSS_STARTING:
      if (pvUnloaderTimeout > 1) {
        pvUnloaderTimeout--;  // keep waiting  This works allongs as
      } else if (digitalRead(iInverterOnPin)) {
        digitalWrite(oUnloaderPin, LOW);        // unloader has timed out so close it
        digitalWrite(oCompressorPin, HIGH); //start compressor
        //Serial.print("oCompressorPin: "); Serial.print(oCompressorPin);
        enterState(CSS_ON); //the compressor is now on
      }  // end else if
      break;

    case CSS_ON:
      if (reservoirPressure > pvTankPressMax) {
        digitalWrite(oCompressorPin, LOW); //turn off if tank is pressurized
        inverter.neededByCompressor(false); //compressor is no longer needed by inverter
        pvUnloaderTimeout = 2;    // number of heartbeat intervals to wait for unloader
        enterState(CSS_STOPPING); //enter the stopping state
      } else
        digitalWrite(oCompressorPin, HIGH); //if tank pressure is not achieved, keep  compressor on
      break;

    case CSS_STOPPING:
      if (pvUnloaderTimeout > 1) {
        pvUnloaderTimeout--;  // keep waiting
      } else {
        // unloader has timed out so close it
        digitalWrite(oUnloaderPin, LOW);
        enterState(CSS_OFF); //compressor is now off
      }
      break;
  } //end switch (state)
} //end CompressorSystem::heartbeat
开发者ID:lunkscrummaster,项目名称:Installed_Edmonton_Code,代码行数:59,代码来源:CIS.cpp


示例6: switch

void ComponentGate::handleMessageClientUsesObject(Message &message)
{
    switch(state)
    {
    case STATE_A:
        enterState(STATE_TRANSITION_AB);
        break;
    case STATE_B:
        enterState(STATE_TRANSITION_BA);
        break;
    case STATE_TRANSITION_AB: /* do nothing */
        break;
    case STATE_TRANSITION_BA: /* do nothing */
        break;
    }
}
开发者ID:foxostro,项目名称:heroman,代码行数:16,代码来源:ComponentGate.cpp


示例7: enterState

void FenwarBoss::dealDamage(float damage, bool makesFlash)
{
	//Fenwar is invincible until you kill his orbs!!!
	if (orbManager->numOrbsAlive() > 0)
	{
		smh->soundManager->playSound("snd_HitInvulnerable");
		return;
	}

	if (!flashing) {
		health -= damage;
		if (makesFlash) {
			flashing = true;
			timeStartedFlashing = smh->getGameTime();
		}
	}
	
	if (health <= 0.0)
	{
		if (state != FenwarStates::NEAR_DEATH && state != FenwarStates::RETURN_TO_ARENA)
		{
			//Initial "death"
			health = 0.0;
			fadeWhiteAlpha = 0;
			flashing = false;
			smh->screenEffectsManager->stopEffect();
			orbManager->killOrbs();
			bulletManager->killBullets();
			enterState(FenwarStates::RETURN_TO_ARENA);
			smh->windowManager->openDialogueTextBox(-1, FENWAR_NEAR_DEFEAT_TEXT);
			hasBegunFadeToWhite=false;
		} 
	}
}
开发者ID:rgw0094,项目名称:smileysmazehunt3,代码行数:34,代码来源:FenwarBoss.cpp


示例8: hgeRect

FenwarBoss::FenwarBoss(int _gridX, int _gridY, int _groupID) 
{
	x = _gridX * 64 + 32;
	y = _gridY * 64 + 32;

	startGridX = _gridX;
	startGridY = _gridY;

	groupID = _groupID;
	health = maxHealth = FenwarAttributes::HEALTH;
	startedIntroDialogue = false;
	terraformedYet = false;
	startedShakingYet = false;

	flashing = false;
	floatingYOffset = 0.0;
	collisionBox = new hgeRect();
	collisionBox->SetRadius(x, y, 1);
	timeRelocated = 999999999.0;
	relocatedYet = false;
	hasBegunFadeToWhite=false;

	orbManager = new FenwarOrbs(this);
	bulletManager = new FenwarBullets(this);
	bombManager = new FenwarBombs(this);

	smh->resources->GetAnimation("fenwar")->Play();
	smh->resources->GetAnimation("fenwar")->SetColor(ARGB(255,255,255,255));

	initPlatformPoints();

	tauntedAboutOrbs = false;

	enterState(FenwarStates::INACTIVE);
}
开发者ID:rgw0094,项目名称:smileysmazehunt3,代码行数:35,代码来源:FenwarBoss.cpp


示例9: mainWindow

void gui_mode::documentChanged(){  
    // qDebug("gui_mode::documentChanged()");
    if(!mainWindow()->hasModePlugin()) return;
    ModePlugin* iMode = mainWindow()->getModePlugin();

    switch(state){
    /// But there was no active plugin
    case DEFAULT:
        return;
    /// And there was an active plugin
    case MODE:
        /// Give the plugin a chance to react to the selection change
        /// If plugin didn't specify how to perform the update, simply 
        /// destroy it and re-create it from scratch.
        if(!iMode->documentChanged()){
            iMode->__internal_destroy();
            iMode->__internal_create();
        }
        return;
    /// There was a suspended plugin
    case SUSPENDED:
        /// On the other hand, when plugin is suspended, change in document just 
        /// results in the plugin termination
        if(!iMode->documentChanged())
            iMode->__internal_destroy();
        mainWindow()->removeModePlugin();
        lastActiveModeAction = NULL;
        enterState(DEFAULT);
        return;    
    }
}
开发者ID:LemonChiu,项目名称:starlab,代码行数:31,代码来源:gui_mode.cpp


示例10: enterState

void Label::resetState() {
    m_occludedLastFrame = false;
    m_occlusionSolved = false;
    m_updateMeshVisibility = true;
    m_dirty = true;
    enterState(State::wait_occ, 0.0);
}
开发者ID:deepinit-arek,项目名称:tangram-es,代码行数:7,代码来源:label.cpp


示例11: calcMoveCenterVector

void StateIdle::MouseLeftDrag(int dx, int dy) {
    if (Controller::bMoveCenterMode) {
        mCamera->setCamCenter(mCamera->getCamCenter() +
                              calcMoveCenterVector(dx, dy, Plane()));
        return;
    }
    if (INTERNAL_STATE_MOUSE_DOWN == internalState) {
        std::vector<Vector3> selectedPoints;
        Vector3 planeVec = Vector3(0, 1, 0);
        selectedPoints.push_back(selectedPoint);
        Plane::buildPlane(selectedPoints, Controller::currPlane, planeVec);
        if (Controller::currPlane.N.dot(mCamera->getDirection()) > 0) {
            Controller::currPlane = -Controller::currPlane;
        }
        dynamic_cast<StateDraw*>(State::statePool[STATE_DRAW])->selectedPoints =
            selectedPoints;
        dynamic_cast<StateDraw*>(State::statePool[STATE_DRAW])->startPoint =
            selectedPoint;
        dynamic_cast<StateDraw*>(State::statePool[STATE_DRAW])->endPoint =
            selectedPoint;
        dynamic_cast<StateDraw*>(State::statePool[STATE_DRAW])->internalState =
            StateDraw::STATE_DRAW_START_POINT_SELECTED;
        enterState(State::statePool[STATE_DRAW]);
        internalState = INTERNAL_STATE_IDLE;
    }
}
开发者ID:Soledad89,项目名称:cashew,代码行数:26,代码来源:StateIdle.cpp


示例12: rtgChainBegin

INLINE_CHAINS void ElevatorDoor_Actor::chain1_Initial( void )
{
	// transition ':TOP:Initial:Initial'
	rtgChainBegin( 1, "Initial" );
	rtgTransitionBegin();
	rtgTransitionEnd();
	enterState( 2 );
}
开发者ID:jamessryann,项目名称:Elevator_Control_System,代码行数:8,代码来源:ElevatorDoor.cpp


示例13: enterState

		void StateBasedGame::enterState(unsigned int id) {
			for (unsigned int i = 0; i < m_states.size(); i++) {
				if (m_states.at(i)->id() == id) {
					enterState(m_states.at(i));
					break;
				}
			}
		}
开发者ID:DTwomey,项目名称:ark2d,代码行数:8,代码来源:StateBasedGame.cpp


示例14: rtgChainBegin

INLINE_CHAINS void serialTranslateCapsule_Actor::chain1_Initial( void )
{
	// transition ':TOP:Initial:Initial'
	rtgChainBegin( 1, "Initial" );
	rtgTransitionBegin();
	rtgTransitionEnd();
	enterState( 2 );
}
开发者ID:K-4U,项目名称:ese_project4y5,代码行数:8,代码来源:serialTranslateCapsule.cpp


示例15: enterState

void FalseColorDock::setCalculationInProgress(FalseColoring::Type coloringType)
{
	if (selectedColoring() == coloringType) {
		enterState(selectedColoring(), FalseColoringState::CALCULATING);
		updateTheButton();
		updateProgressBar();
	}
}
开发者ID:philippefoubert,项目名称:gerbil,代码行数:8,代码来源:falsecolordock.cpp


示例16: rtgChainBegin

INLINE_CHAINS void roombaProgram_Actor::chain5_Initial( void )
{
	// transition ':TOP:Initial:Initial'
	rtgChainBegin( 1, "Initial" );
	rtgTransitionBegin();
	rtgTransitionEnd();
	enterState( 2 );
}
开发者ID:K-4U,项目名称:ese_project4y5,代码行数:8,代码来源:roombaProgram.cpp


示例17: rtgChainBegin

INLINE_CHAINS void serialCommunicationCapsule_Actor::chain2_False( void )
{
	// transition ':TOP:openPort:False'
	rtgChainBegin( 6, "False" );
	rtgTransitionBegin();
	transition2_False( msg->data, msg->sap() );
	rtgTransitionEnd();
	enterState( 3 );
}
开发者ID:K-4U,项目名称:ese_project4y5,代码行数:9,代码来源:serialCommunicationCapsule.cpp


示例18: rtgChainBegin

INLINE_CHAINS void Local_Controller_Actor::chain1_Initial( void )
{
	// transition ':TOP:Initial:Initial'
	rtgChainBegin( 1, "Initial" );
	rtgTransitionBegin();
	transition1_Initial( msg->data, msg->sap() );
	rtgTransitionEnd();
	enterState( 2 );
}
开发者ID:jamessryann,项目名称:Elevator_Control_System,代码行数:9,代码来源:Local_Controller.cpp


示例19: enterState

void Label::resetState() {

    if (m_state == State::dead) { return; }

    m_occludedLastFrame = false;
    m_occluded = false;
    m_anchorIndex = 0;
    enterState(State::none, 0.0);
}
开发者ID:redfish64,项目名称:tangram-es,代码行数:9,代码来源:label.cpp


示例20: if

void StateIdle::UIEvent(int event) {
    if (event == Controller::BTN_ID_STANDARD_VIEW) {
        Quaternion q = Quaternion::fromEuler(Vector3(-90, 0, 0));
        mCamera->setCamCenterTo(Vector3(0, 0, 0));
        mCamera->rotateCamTo(q);
    } else if (event == Controller::BTN_ID_DELETE_LINE) {
        enterState(State::statePool[STATE_DELETE]);
    }
}
开发者ID:Soledad89,项目名称:cashew,代码行数:9,代码来源:StateIdle.cpp



注:本文中的enterState函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ enter_blocking_section函数代码示例发布时间:2022-05-30
下一篇:
C++ ensure_root_path_mounted函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap