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

C++ resetTimer函数代码示例

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

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



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

示例1: runScreenTimeoutTimer

void runScreenTimeoutTimer()
{
	uint16_t xval = 0;
	uint16_t yval = 0;
	TOUCH_VAL(&xval, &yval);

	if(yval | xval)
	{
		resetTimer(&screenTimeout,SECONDS_TO_SCREEN_TIMEOUT);
		TREADMILL_STATE=NO_MOVEMENT;
		startTimer(&screenTimeout);
	}
	else if(TREADMILL_STATE==NO_MOVEMENT)
	{
		runSecondsTimer(&screenTimeout);
		if(checkTimerIfExpired(&screenTimeout))
		{
			TREADMILL_STATE=TIMED_OUT;
		}
	}
	else if(TREADMILL_STATE==MOVING)
	{
		resetTimer(&screenTimeout,SECONDS_TO_SCREEN_TIMEOUT);
	}

}
开发者ID:NateZimmer,项目名称:blarg,代码行数:26,代码来源:treadmill.c


示例2: autonomous

task autonomous() // main task basically, but this will run if we are put itno autonomous mode
{
	MVR = 77;
	MVL = 77;
	resetTimer(T2);
	while (true)
	{
		change = full;
		if (time1[T1]>200)
		{
			Speed();
			resetTimer(T1);
			SensorValue[LeftSpeed] = 0;
			SensorValue[RightSpeed] = 0;
			Pid();
		}
		change = full;
		flyWheelRun();
		if (time1[T2]>2000)
		{
			Staggershot();
		}
	}

}
开发者ID:mrpitner,项目名称:334rf,代码行数:25,代码来源:Comp+Robot+2.0.c


示例3: pre_auton

void pre_auton() // this is where we can reset values/timers etc
{
	SensorValue[LeftSpeed] = 0;
	SensorValue[RightSpeed] = 0;
	resetTimer(T1);
	resetTimer(T2);
	resetTimer(T4);
}
开发者ID:mrpitner,项目名称:334rf,代码行数:8,代码来源:Comp+Robot+2.0.c


示例4: resetTimer

void QStreamCubeChat::disconnect()
{
    channelId_.clear();
    //lastMessageId_.clear();
    lastMessageId_ = "0";

    resetTimer( updateTimerId_ );
    resetTimer( reconnectTimerId_ );
}
开发者ID:c0deum,项目名称:BroChat,代码行数:9,代码来源:qstreamcubechat.cpp


示例5: SpeedControls2

void SpeedControls2()
{
	if(vexRT[Btn8UXmtr2] == 1)
	{
		change = full;
		MVR = 77;
		MVL = 77;
		wait1Msec(20);
		resetTimer(T4);
	}
	if(vexRT[Btn7LXmtr2] == 1 || vexRT[Btn7RXmtr2] == 1)
	{
		change = 0;
		MVR = 0;
		MVL = 0;
		wait1Msec(20);
		resetTimer(T4);
	}
	if(vexRT[Btn8RXmtr2] == 1 || vexRT[Btn8LXmtr2] == 1)
	{
		change = mid;
		MVR = 64;
		MVL = 64;
		wait1Msec(20);
		resetTimer(T4);
	}
	if(vexRT[Btn8DXmtr2] == 1)
	{
		change = close;
		MVR = 58;
		MVL = 58;
		wait1Msec(20);
		resetTimer(T4);
	}

	if(vexRT[Btn7DXmtr2] == 1)
	{
		if(MVR >=0)
		{
			change = change -1;
			wait1Msec(20);
		}
	}

	if(vexRT[Btn7UXmtr2] == 1)
	{
		change = change +1;
		wait1Msec(20);
	}

	if(vexRT[Btn7UXmtr2] == 1)
	{
		MVR = MVR+1;
		MVL = MVL+1;
		wait1Msec(200);
	}
}
开发者ID:mrpitner,项目名称:334rf,代码行数:57,代码来源:Comp+Robot+2.0.c


示例6: waitForMovementToFinish

/*void waitForMovementToFinish(motorGroup *group, int timeout=DEF_WAIT_TIMEOUT) {
	waitForMovementToFinish(timeout, 1, group);
}*/
void waitForMovementToFinish(motorGroup *group, int timeout=DEF_WAIT_TIMEOUT) {	//TODO: delete this as soon as possible
	long movementTimer = resetTimer();

	while (time(movementTimer) < timeout) {	//wait for targeting to stabilize
		if (group->moving==TARGET && !errorLessThan(group, group->waitErrorMargin))
				movementTimer = resetTimer();

		EndTimeSlice();
	}

	while (group->moving!=TARGET && group->moving!=NO) EndTimeSlice();
}
开发者ID:DHS-Robotics,项目名称:VEX_Prebuilt_Includes,代码行数:15,代码来源:motorGroup.c


示例7: SpeedControls

void SpeedControls()
{

	if(vexRT[Btn8U] == 1)
	{
		change = full;
		MVR = 65;
		MVL = 65;
		wait1Msec(20);
		resetTimer(T4);
	}
	if(vexRT[Btn8D] == 1)
	{
		change = 0;
		MVR = 0;
		MVL = 0;
		wait1Msec(20);
		resetTimer(T4);
	}
	if(vexRT[Btn8R] == 1)
	{
		change = mid;
		MVR = 50;
		MVL = 50;
		wait1Msec(20);
		resetTimer(T4);
	}
	if(vexRT[Btn8L] == 1)
	{
		change = close;
		MVR = 40;
		MVL = 40;
		wait1Msec(20);
		resetTimer(T4);
	}

	if(vexRT[Btn7D] == 1)
	{
		if(MVR >=0)
		{
			change = change -1;
			wait1Msec(20);
		}
	}

	if(vexRT[Btn7U] == 1)
	{
		change = change +1;
		wait1Msec(20);
	}

}
开发者ID:mrpitner,项目名称:334rf,代码行数:52,代码来源:Comp+Robot+2.0.c


示例8: FD_ZERO

bool Socket::think()
{
	if(connecting)
	{
		fd_set monitor;
		timeval tv;
		tv.tv_sec = 0;
		tv.tv_usec = 0;
		FD_ZERO(&monitor);
		FD_SET(s, &monitor);
		select(s+1, 0, &monitor, 0, &tv);
		
		if(FD_ISSET(s, &monitor))
		{
			int status;
			socklen_t len = sizeof(status);
			getsockopt(s, SOL_SOCKET, SO_ERROR, (char *)&status, &len);
			if(status != 0) // Error
			{
				error = ErrorConnect;
				return true;
			}
			
			connected = true;
			connecting = false;
			resetTimer();
		}
		else
			checkTimeout();
	}
	
	return error != ErrorNone;
}
开发者ID:a-sf-mirror,项目名称:gusanos,代码行数:33,代码来源:tcp.cpp


示例9: QPlainTextEdit

TextEditor::TextEditor(QWidget *parent) : QPlainTextEdit(parent)
{
    lineNumberArea = new LineNumberArea(this);

    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));
    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));
    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));

    updateLineNumberAreaWidth(0);
    highlightCurrentLine();

    QFont font("consolas",9);
    const int tabStop = 4;  // 4 characters
    QFontMetrics metrics(font);
    setTabStopWidth(tabStop * metrics.width(' '));
    setFont(font);
    setLineWrapMode(QPlainTextEdit::NoWrap);

    m_highlighter = new Highlighter(document());

    m_autoUpdate = false;
    m_timer = new QTimer();
    m_timer->setSingleShot(true);
    m_timer->setInterval(1000);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(updateShader()));
    connect(this, SIGNAL(textChanged()), this, SLOT(resetTimer()));
}
开发者ID:XT95,项目名称:VisualLiveSystem,代码行数:27,代码来源:texteditor.cpp


示例10: readResponse

void readResponse(outstandingQuery *queries,int *slot,int &nrOfQueries,char *serverflag,SYSTEMTIME &timer){
#else
void readResponse(outstandingQuery *queries,int *slot,int &nrOfQueries,char *serverflag,timeval &timer){
#endif
    int tmpNr = 1;
    for(int i=0;i<MAXQUERIES;i++){
        
        if(queries[i].running){
			//cout << "reading from index: "<<i<<endl;
            if(serverflag[i] == '1'){
                if(slot[i] == -1){
                    
                    queries[i].running = 0;
                    nrOfQueries--;
                    cout << endl<<"query "<< i << " is done in: " <<TimerStop(queries[i].startTime)<< " sec"<<endl;
                }else{
                    //TODO: Remove testmode
                    
                    repeated = 0;
                    resetTimer(timer);
                    cout <<"Q"<<i<<": "<<slot[i] << " ";
                    if(queries[i].testRun){
                        cout << endl;
                    }else{
                        fflush(0);
                    }
                    
                }
                serverflag[i] = '0';
            }
        }
    }
    
}
开发者ID:aipoyun,项目名称:Multithreaded-Client-Server,代码行数:34,代码来源:Client.cpp


示例11: executeAutomovement

int executeAutomovement(motorGroup *group, int debugStartCol) {
	switch (group->moving) {
		case TARGET:
			if (group->posPID.kP != 0) {
				int powerLimit = (group->autoStillSpeeding && errorLessThan(group, group->autoSSmargin) ? group->stillSpeed : 127);	//limit power if autoStillSpeeding conditions are met
				group->posPID.integralMax = powerLimit;
				int PIDpower = PID_runtime(group->posPID, getPosition(group), debugStartCol);
				setPower(group, copysign(PIDpower, limit(fabs(PIDpower), 0, powerLimit)));
			}
			break;

		case MANEUVER:
			if (group->forward == (getPosition(group) < group->targetPos)) {
				group->maneuverTimer = resetTimer();
				setPower(group, group->movePower);
			}
			else if (time(group->maneuverTimer) > group->maneuverTimeout) {
				setPower(group, group->endPower);
				group->moving = NO;
			}
			break;

		case DURATION:
			if (time(group->maneuverTimer) > group->moveDuration) {
				setPower(group, group->endPower);
				group->moving = NO;
			}
			else {
				setPower(group, group->movePower);
			}
			break;
	}

	return getPower(group);	//TODO: be better
}
开发者ID:DHS-Robotics,项目名称:VEX_Prebuilt_Includes,代码行数:35,代码来源:motorGroup.c


示例12: recv

bool Socket::readChunk()
{
	dataBegin = dataEnd = 0;
	
	int r = recv(s, staticBuffer, 1024, 0);
	if(r != -1)
	{
		if(r == 0)
		{
			connected = false;
			return true; // No more data
		}
		dataBegin = staticBuffer;
		dataEnd = staticBuffer + r;
		resetTimer();
	}
	else if(sockError() != EWOULDBLOCK)
	{
		error = ErrorRecv;
		return true; // Error
	}
	else
	{
		checkTimeout();
	}
	
	return error != ErrorNone;
}
开发者ID:a-sf-mirror,项目名称:gusanos,代码行数:28,代码来源:tcp.cpp


示例13: initialize

// initializes MSP 430 and the other electronics
void initialize()
{
    // stop watch dog timer
    WDTCTL = WDTPW + WDTHOLD;
  
    // set CPU clock speed
    BCSCTL1 = _BCS_CLK;
    DCOCTL = _DCO_CLK;

    // set launchpad board LED and button pin directions
    P1DIR_bit.P0 = _OUTPUT;
    P1DIR_bit.P3 = _INPUT;
    P1DIR_bit.P6 = _OUTPUT;

    // turn on internal pull-up resistor for launchpad push button
    P1REN_bit.P3 = _HIGH;
    
    // configure for fuel cell car
    _initMotorController();
#ifdef _RESET_MOT_CNTL
    _resetMotorController();
#endif
    _initADC();

    // set switch pin direction
    P2DIR_bit._P_SWITCH = _INPUT;
    
    // set LED light bar pin directions to output
    P2DIR |= _LED_MASK;

    //enable the elapsed time timer
    resetTimer();
    __enable_interrupt();  // enable global interrupts
}
开发者ID:Rich143,项目名称:Fuel-Cell-Car,代码行数:35,代码来源:UW_GENE_121.cpp


示例14: checkState

//The check state function checks if a flag has been set, and if it has, it both resets the flag and changes and counters / states
void checkState(){
   if(checkTimer()){  //If the timer flag is set
      if(state == RED)
	 state = GREEN;
      else
	 ++state;

      //PORTC = ~PORTC;  //Debugging code
      resetTimer();

      if(state == YELLOW)
	 OCR1A = 7813; //Set the timer to 1 second (with 1024 prescaler)
      else
	 OCR1A = 23438;//Set the timer to 3 seconds (with 1024 prescaler)

      //Debugging USART statements
      if(state == RED)
	 USART_send_string("RED                           \r");
      else if (state == GREEN)
	 USART_send_string("GREEN                         \r");
      else
	 USART_send_string("YELLOW                        \r");
   }

}
开发者ID:Nrpickle,项目名称:EECS162,代码行数:26,代码来源:main.c


示例15: turnLeft

void turnLeft(int time)
{
  resetTimer();
  setMotor(MOTOR_A, -100);
  setMotor(MOTOR_B, -100);
  while (time1() < time);
}
开发者ID:arunjey,项目名称:Cplusplus-Code,代码行数:7,代码来源:trackce2.cpp


示例16: timer

Spawn2::Spawn2(uint32 in_spawn2_id, uint32 spawngroup_id, 
	float in_x, float in_y, float in_z, float in_heading, 
	uint32 respawn, uint32 variance, uint32 timeleft, uint32 grid,
	uint16 in_cond_id, int16 in_min_value, bool in_enabled, EmuAppearance anim)
: timer(100000), killcount(0)
{
	spawn2_id = in_spawn2_id;
	spawngroup_id_ = spawngroup_id;
	x = in_x;
	y = in_y;
	z = in_z;
	heading = in_heading;
    respawn_ = respawn;
	variance_ = variance;
	grid_ = grid;
	condition_id = in_cond_id;
	condition_min_value = in_min_value;
	npcthis = NULL;
	enabled = in_enabled;
	this->anim = anim;

	if(timeleft == 0xFFFFFFFF) {
		//special disable timeleft
		timer.Disable();
	} else if(timeleft != 0){
		//we have a timeleft from the DB or something
		timer.Start(timeleft);
	} else {
		//no timeleft at all, reset to 
		timer.Start(resetTimer());
		timer.Trigger();
	}
}
开发者ID:josheb,项目名称:emu_dc,代码行数:33,代码来源:spawn2.cpp


示例17: main

int main(void) {



      WDTCTL = WDTPW + WDTHOLD;               //
	  DCOCTL = 0x00;                          //
	  BCSCTL1 = CALBC1_8MHZ;
	  DCOCTL = CALDCO_8MHZ;

	  P2OUT = 0x00;
	  P2SEL = UART_TXD + UART_RXD;            //  uart TX/RX pinos
	  P2DIR = 0xFF & ~UART_RXD;               //
	  P2OUT = 0XFF;

	  P1DIR = 0x01 + 0x40;        // Define pinos 1.0 e 1.6 como saída (0100 0001)
	  P1REN = 0x08;               // Habilita pullup/pulldown do pino 1.3 (0000 1000)
	  P1OUT = 0x08;               // Define pullup para o pino 1.3 (0000 1000)
	  P1SEL |= TX + RX;           // Timer function for TXD/RXD pins


	  zigbeeInit();
	  resetTimer();
	  __enable_interrupt();
	  NetworkProtocolConfigure();


	  for (;;){
		  execNetworkProtocol();
	  }
}
开发者ID:elerson,项目名称:RPL,代码行数:30,代码来源:main.c


示例18: turnRight

void turnRight(int time)
{
  resetTimer();
  setMotor(MOTOR_A, 100);
  setMotor(MOTOR_B, 100);
  while (time1() < time);
}
开发者ID:arunjey,项目名称:Cplusplus-Code,代码行数:7,代码来源:trackce2.cpp


示例19: test2

void test2(void) {
	int		x;
	int		rc;
	unsigned	i;

	printf("\nDisplay nsecs\n");
	for (i = 0; i < 50; i++) {
		printf("%s\n", nsecStringer(1ULL << i).s);
	}
	for (i = 0; i < 30; ++i) {
		x = urand(1000000);
		startTimer();

		rc = usleep(x);

		stopTimer();
		if (rc == -1) perror("usleep");

		if (urand(100) < 3) resetTimer();
		printf("%d.%.6d == ", x/1000000, x%1000000);

		prTimer();
		printf("\n");
	}
}
开发者ID:taysom,项目名称:tau,代码行数:25,代码来源:timer.c


示例20: if

    void Tooltip::setTargetWindow(Window* wnd)
    {
        if (!wnd)
        {
            d_target = wnd;
        }
        else if (wnd != this)
        {
            if (d_target != wnd)
            {
                wnd->getGUIContext().getRootWindow()->addChild(this);
                d_target = wnd;
            }

            // set text to that of the tooltip text of the target
            setText(wnd->getTooltipText());

            // set size and position of the tooltip window.
            sizeSelf();
            positionSelf();
        }

        resetTimer();

        if (d_active)
        {
            WindowEventArgs args(this);
            onTooltipTransition(args);
        }
    }
开发者ID:OpenTechEngine-Libraries,项目名称:CEGUI,代码行数:30,代码来源:Tooltip.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ resetTransform函数代码示例发布时间:2022-05-30
下一篇:
C++ resetStringInfo函数代码示例发布时间: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