本文整理汇总了C++中Idle函数的典型用法代码示例。如果您正苦于以下问题:C++ Idle函数的具体用法?C++ Idle怎么用?C++ Idle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Idle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KGLogPrintf
void KGatewaytest::TestUserLoginPaysysNeedMibaoPaysysNoRespond() // caseID:
{
int nResult = false;
int nRetCode = false;
char szTestCaseDscribe[] = "// caseID????:,测试Paysys返回登陆账号密码正确,需要密保验证时,客户端已经输入密保矩阵,但paysys不返回验证结果,Client玩家收到密保密码错误";
KG_RETURN_RESULT Result;
KGLogPrintf(KGLOG_INFO, "caseID????:\n");
FillTestUserLoginInfo(KG_USER_MIBAO, ACTION_SUCCESS, AccountUserLoginInfo, PASSPODMODE_ZPMATRIX, ACTION_SUCCESS, false, false, ACTION_FAILED, true);
nRetCode = InitTestEnvironment(true, true, true, 1, m_GatewayTestConfig.ForecastConfig.nTestPoint);
KGLOG_PROCESS_ERROR(nRetCode);
m_GatewayTestConfig.PaysysManagerConfig.nNotRespondSubProtocol = AccountUserPasspodVerify;
nRetCode = m_pClientController->FillOperate(
3,
onConnectToGateway,
onHandShake,
onAccountVerify
//onMibaoVerify
);
KGLOG_PROCESS_ERROR(nRetCode);
nRetCode = m_pClientController->Run();
KGLOG_PROCESS_ERROR(nRetCode);
Idle(70);
nRetCode = m_pPaysys->SetAccountVerifyRespondType(AccountUserPasspodVerifyRet, PASSPODMODE_ZPMATRIX, ACTION_FAILED);
KGLOG_PROCESS_ERROR(nRetCode);
nRetCode = m_pClientController->AddOperateToClient(0, 1, onMibaoVerify);
KGLOG_PROCESS_ERROR(nRetCode);
Idle(70);
nRetCode = m_pClientController->GetReturnResult(0, &Result);
KGLOG_PROCESS_ERROR(nRetCode);
nRetCode = memcmp(&Result, &(m_GatewayTestConfig.ForecastConfig), sizeof(Result));
KGLOG_PROCESS_ERROR(!nRetCode);
nResult = true;
Exit0:
UnInitTestEnvironment();
#ifdef WIN32
{
KG_CASE_INFO(szTestCaseDscribe, "");
KG_CPPUNIT_ASSERT(nResult);
}
#else
{
//InsertInfo(CASEPURPOSE, (szTestCaseDscribe));
//InsertInfo(PRECONDITION, (""));
CPPUNIT_ASSERT(nResult);
}
#endif
}
示例2: GetInput
signed char GetInput(void) {
signed char ret = 0;
ClearUI_Event = 1;
while (ClearUI_Event) Idle();
while (ret == 0) {
bLock_UI_Event = 1;
ret = UI_Event;
bLock_UI_Event = 0;
Idle();
}
return ret;
}
示例3: if
void Transceiver::StopListen()
{
if (Connected()){
if (timer.Cycle()<(_helloCycle+20)) //check 1min
Idle();
if (timer.Cycle()>_helloCycle+100) //after 5min without knock
Deconnect();
} else {
if (timer.Cycle() >(_KnockCycle+60)){ // check 3 min
DBGINFO("StopListen");
Idle();
}
}
}
示例4: Keyboard
/*keybord function
@param[in] key, the type of the key
@param[in] x,y : the current position of the mouse
*/
void Keyboard(unsigned char key, int x, int y)
{
int mod = glutGetModifiers(); //the state(Shift,Ctrl,Alt)
switch(key){
case '\033': // the ASCII code of ESC
OnExitApp();
break;
case ' ': //idle
Idle();
break;
case 's': //animation ON/OFF
SwitchIdle(-1);
break;
case 'F': //Fullscreen
SwitchFullScreen();
break;
default: //drawing flag
{
int idx = 0;
while(RX_DRAW_STR[2*idx]!="-1"&&(int)RX_DRAW_STR[2*idx+1][0]!=key) idx++;
if(RX_DRAW_STR[2*idx]!="-1"){
g_iDraw=(0x01<<idx);
}
}
break;
}
glutPostRedisplay();
}
示例5: ExchangeBlackboard
void
GlueMapWindow::OnPaintBuffer(Canvas &canvas)
{
#ifdef ENABLE_OPENGL
ExchangeBlackboard();
EnterDrawThread();
/* update terrain, topography, ... */
if (Idle())
/* still dirty: schedule a redraw to load more data */
data_timer.Schedule(500);
else
data_timer.Cancel();
#endif
MapWindow::OnPaintBuffer(canvas);
DrawMapScale(canvas, GetClientRect(), render_projection);
if (IsPanning())
DrawPanInfo(canvas);
#ifdef ENABLE_OPENGL
LeaveDrawThread();
#endif
}
示例6: Key
static void Key( unsigned char key, int x, int y )
{
const GLfloat step = 3.0;
(void) x;
(void) y;
switch (key) {
case 'a':
Anim = !Anim;
if (Anim)
glutIdleFunc(Idle);
else
glutIdleFunc(NULL);
break;
case 's':
Idle();
break;
case 'z':
Zrot -= step;
break;
case 'Z':
Zrot += step;
break;
case ' ':
Init();
break;
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
示例7: main
int main(int argc, char* argv[]) {
BYTE Buttons;
printf("Example2: ByteIO\n");
#ifdef OnOSX
signal(SIGINT, Quit); // Trap Control+C function Quit on Mac
#endif
if (!InitializeForByteIO()) {
printf("\nFT232R cable found\n");
// Configure Buttons to be input
WriteI2CByte(0xFF, ConfigurationRegister, ButtonsAddress);
// Setup Buttons(InputPortRegister) as the default register
WriteI2CByte(0xAA, InputPortRegister, ButtonsAddress);
// Configure Lights to be output
WriteI2CByte(0, ConfigurationRegister, LightsAddress);
WriteI2CByte(0, ConfigurationRegister, DigitLSB);
for (int i=0; i<100; i++) {
Buttons = ReadI2CByte(ButtonsAddress);
printf("\rButtons = %2.2X", Buttons);
// BYTE Answer = (Buttons & 0xF) * ((Buttons>>4) & 0xF);
WriteI2CByte(Buttons, OutputPortRegister, LightsAddress);
WriteI2CByte(SevenSegmentLookup[i&0xf], OutputPortRegister, DigitLSB);
Idle(1000);
}
}
Quit();
}
示例8: quit
void quit() {
char string[StringSize];
my_log("POLYGLOT *** QUIT ***\n");
if (Init) {
stop_search();
engine_send(Engine,"quit");
// wait for the engine to quit
#ifndef _WIN32
while (true) {
engine_get(Engine,string,sizeof(string)); // HACK: calls exit() on receiving EOF
}
#else
Idle500msecs();//
while(peek_engine_get(Engine,string,StringSize))
Idle();
#endif
uci_close(Uci);
}
exit(EXIT_SUCCESS);
}
示例9: QF_onIdle
/*..........................................................................*/
void QF_onIdle(void) { /* entered with interrupts disabled, NOTE01 */
LED_ON (IDLE_LED); /* blink the IDLE LED, see NOTE02 */
LED_OFF(IDLE_LED);
#ifdef Q_SPY
QF_INT_ENABLE(); /* enable interrupts, see NOTE01 */
while (U2STAbits.UTXBF == 0U) { /* TX Buffer not full? */
uint16_t b;
QF_INT_DISABLE();
b = QS_getByte();
QF_INT_ENABLE();
if (b == QS_EOD) { /* End-Of-Data reached? */
break; /* break out of the loop */
}
U2TXREG = (uint8_t)b; /* stick the byte to TXREG for transmission */
}
#elif defined NDEBUG
__asm__ volatile("disi #0x0001");
Idle(); /* transition to Idle mode, see NOTE03 */
#else
QF_INT_ENABLE(); /* enable interrupts, see NOTE01 */
#endif
}
示例10: main
/*-----------------------------------------------------------------------------
* main
*/
int main(void) {
uint8_t ret;
int sioHdl;
/* set clock prescaler to 2 (set clock to 7.3928 MHz) */
CLKPR = 1 << CLKPCE;
CLKPR = 1;
/* get module address from EEPROM */
sMyAddr = eeprom_read_byte((const uint8_t *)MODUL_ADDRESS);
GetClientListFromEeprom();
PortInit();
TimerInit();
ButtonInit();
PwmInit();
ApplicationInit();
SioInit();
SioRandSeed(sMyAddr);
/* sio for bus interface */
sioHdl = SioOpen("USART1", eSioBaud9600, eSioDataBits8, eSioParityNo,
eSioStopBits1, eSioModeHalfDuplex);
SioSetIdleFunc(sioHdl, IdleSio1);
SioSetTransceiverPowerDownFunc(sioHdl, BusTransceiverPowerDown);
BusTransceiverPowerDown(true);
BusInit(sioHdl);
spBusMsg = BusMsgBufGet();
/* warten for full operation voltage */
while (!POWER_GOOD);
/* enable ints before RestorePwm() */
ENABLE_INT;
TimerStart();
RestorePwm();
/* ext int for power fail: INT0 low level sensitive */
EICRA &= ~((1 << ISC01) | (1 << ISC00));
EIMSK |= (1 << INT0);
ApplicationStart();
/* Hauptschleife */
while (1) {
Idle();
ret = BusCheck();
ProcessBus(ret);
CheckButton();
PwmCheck();
ApplicationCheck();
CheckEvent();
}
return 0;
}
示例11:
Enemy::Enemy(double x, double y, const std::string &name):
PE::Ai(x, y, name)
{
speed = 50.0;
stateMachine.addState(Idle(stateMachine, *this));
stateMachine.changeState(IDLE_ID);
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Debug", "initStateMachine done", NULL);
}
示例12: Idle
void Transceiver::StopListenBroadcast()
{
if (Connected()&& (timer.Cycle()<(_helloCycle+20)) ) //check 3min
{
Idle();
// timer.setStage(IMTimer::IDDLESTAGE);
}
}
示例13: NextEv
// vrati proces jehoz aktivni faze bude zahajena po potlaceni tohoto procesu
CProcess* CProcess::NextEv()
{
if (Idle()) return NULL; // proces nema zaznam o udalosti
if (event->Suc() == NULL)
return NULL; // udalost procesu nema naslednika
return ((CEventNotice*)event->Suc())->proc;
}
示例14: WriteBits
void WriteBits(UCHAR Value) {
DWORD BytesWritten;
FT_Status = FT_Write(FT_Handle, &Value, 1, &BytesWritten);
if (FT_Status != FT_OK) {
printf("\nFT_Write error (%d), Cable disconnected?\n", FT_Status);
Idle(2000); // Display error message for 2 seconds
Quit();
}
}
示例15: Vector
void CHostageImprov::__MAKE_VHOOK(OnReset)()
{
m_moveFlags = 0;
m_moveType = Stopped;
m_moveLimit = Running;
m_vel.x = 0;
m_vel.y = 0;
m_actualVel = Vector(0, 0, 0);
m_checkNearbyTerroristTimer.Invalidate();
m_lastKnownArea = NULL;
m_hasKnownGoodPos = false;
m_hasPriorKnownGoodPos = false;
m_isTerroristNearby = false;
m_isCrouching = false;
SetMoveAngle(m_hostage->pev->angles.y);
m_moveGoal = m_hostage->m_vStart;
ClearLookAt();
ClearFaceTo();
m_blinkTimer.Invalidate();
m_blinkCounter = 0;
m_hostage->SetBoneController(2, 0);
m_hostage->SetBoneController(3, 0);
m_hostage->SetBoneController(4, 0);
m_path.Invalidate();
m_chatterTimer.Invalidate();
m_visiblePlayerCount = 0;
m_isDelayedChatterPending = 0;
m_animateState.Reset();
m_didFidget = 0;
m_lastSawCT.Start();
m_lastSawT.Start();
m_scaredTimer.Invalidate();
m_jumpTimer.Invalidate();
m_hasJumped = false;
m_isFriendInTheWay = false;
m_aggression = RANDOM_FLOAT(0, 1);
StandUp();
m_behavior.Reset(this);
Idle();
}