当前位置: 首页>>代码示例>>C++>>正文


C++ ProcessMessages函数代码示例

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


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

示例1: OnOpenADCSaveFile

// 将ADC数据保存到文件中
void CADCDataSaveToFileThread::OnSaveADCToFile(unsigned int uiADCSaveDataNum)
{
	CString strOutput = "";
	CString strTemp = "";
	if(m_bOpenADCSaveFile == FALSE)
	{
		OnOpenADCSaveFile();
	}

	// 输出各仪器采样数据
	for (unsigned int i=0; i<uiADCSaveDataNum; i++)
	{
		ProcessMessages();
		for (int j=0; j<GraphViewNum; j++)
		{
			ProcessMessages();
			
			strTemp.Format(_T("%2.*lf\t"),DecimalPlaces, m_dADCSaveToFileProcBuf[j][i]);
			strOutput += strTemp;
		}
		strOutput += "\r\n";
	}
	for (int i=0; i<GraphViewNum; i++)
	{
		memset(m_dADCSaveToFileProcBuf[i], 0, uiADCSaveDataNum);
	}
	fprintf(m_pFileSave,"%s", strOutput); 

	m_uiADCDataToSaveNum += uiADCSaveDataNum;
	if (m_uiADCDataToSaveNum == m_uiADCFileLength)
	{
		m_uiADCDataToSaveNum = 0;
		OnCloseADCSaveFile();
	}
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:36,代码来源:ADCDataSaveToFileThread.cpp

示例2: ProcessMessages

// 关闭采样后保存剩余数据
void CADCDataRecThread::OnSaveRemainADCData(unsigned int uiADCDataNeedToSave)
{
    unsigned int uiDataLength = 0;
    CString strOutput = "";
    CString strTemp ="";
    if (m_pFileSave == NULL)
    {
        return;
    }
    for (unsigned int i=0; i<uiADCDataNeedToSave; i++)
    {
        ProcessMessages();
        for (int j=0; j<GraphViewNum; j++)
        {
            ProcessMessages();
            if (m_pSelectObject[j] == 1)
            {
                if (m_pSelectObjectNoise[j] == 0)
                {
                    uiDataLength = m_dADCSave[j].size();
                    if (uiDataLength == 0 )
                    {
                        strOutput += "\t\t";
                        continue;
                    }
                    if (uiDataLength > i)
                    {
                        strTemp.Format("%2.*lf\t",DecimalPlaces, m_dADCSave[j][i]);
                        strOutput += strTemp;
                    }
                    else
                    {
                        strOutput += "\t\t";
                    }
                }
                else
                {
                    strOutput += "\t\t";
                }
            }
            else
            {
                strOutput += "\t\t";
            }
        }
        strOutput += "\r\n";
    }
    fprintf(m_pFileSave,"%s", strOutput);
    // 清空接收缓冲区

    for (unsigned int i=0; i<GraphViewNum; i++)
    {
        ProcessMessages();
        m_dADCSave[i].clear();
    }
    OnCloseADCSaveFile();
}
开发者ID:svn2github,项目名称:jy00755131,代码行数:58,代码来源:ADCDataRecThread.cpp

示例3: _T

// 创建并打开ADC保存数据文件
void CADCDataRecThread::OnOpenADCSaveFile(void)
{
	m_uiADCSaveFileNum++;
	CString strFileName = _T("");
	CString strOutput = _T("");
	CString strTemp = _T("");
	errno_t err;
	CString str = _T("");
	SYSTEMTIME  sysTime;
	unsigned int uiADCDataFrameCount = 0;
	strFileName += m_csSaveFilePath;
	strTemp.Format(_T("\\%d.text"), m_uiADCSaveFileNum);
	strFileName += strTemp;
	// 将ADC采样数据保存成ANSI格式的文件
	if((err = fopen_s(&m_pFileSave,strFileName,"w+"))!=NULL)
	{
		AfxMessageBox(_T("ADC数据存储文件创建失败!"));	
		return;
	}

	GetLocalTime(&sysTime);
	for (int i=0; i<InstrumentNum; i++)
	{
		ProcessMessages();
		if (m_pSelectObject[i] == 1)
		{
			if (m_pSelectObjectNoise[i] == 0)
			{
				uiADCDataFrameCount = m_uiADCDataFrameCount[i];
				break;
			}
		}
	}
	str.Format(_T("%04d年%02d月%02d日%02d:%02d:%02d:%03d 由第%d个数据包开始记录ADC采样数据:\r\n\r\n"), sysTime.wYear,sysTime.wMonth,sysTime.wDay,
		sysTime.wHour,sysTime.wMinute,sysTime.wSecond,sysTime.wMilliseconds, uiADCDataFrameCount);
	strOutput += str;

	// 输出仪器标签
	for (int i=0; i<InstrumentNum; i++)
	{
		ProcessMessages();
		strTemp.Format(_T("%s\t\t"),m_cSelectObjectName[i]);
		strOutput += strTemp;
	}
	strOutput += _T("\r\n");

	fprintf(m_pFileSave, _T("%s"), strOutput); 
	m_bOpenADCSaveFile = TRUE;
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:50,代码来源:ADCDataRecThread.cpp

示例4: ProcessMessages

// 被选择仪器的ADC数据个数的最小值
unsigned int CADCDataSaveToFile::OnADCRecDataMinNum(unsigned int* upADCDataNum, int* pSelectObject,
													int* pSelectObjectNoise)
{
	unsigned int uiMinSize = 10000;
	bool bSelect = false;
	for (int i=0; i<InstrumentNum; i++)
	{
		ProcessMessages();
		if (pSelectObject[i] == 1)
		{
			if (pSelectObjectNoise[i] == 0)
			{
				if (uiMinSize > upADCDataNum[i])
				{
					uiMinSize = upADCDataNum[i];
					bSelect = true;
				}
			}
		}
	}
	if (bSelect == false)
	{
		uiMinSize = 0;
	}
	return uiMinSize;
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:27,代码来源:ADCDataSaveToFile.cpp

示例5: while

// ADC数据需要重新发送帧对应的最小个数
unsigned int CADCDataRecThread::OnADCRetransimissionMinNb(unsigned int uiInstrumentNb)
{
    unsigned int uimin = 0;								// 最小值
    POSITION pos = m_oADCLostMap[uiInstrumentNb].GetStartPosition();	// 得到索引表起始位置
    unsigned int uiKey;									// 索引键
    unsigned int uiCount = 0;							// 计数

    while(NULL != pos)
    {
        ProcessMessages();
        m_structADC ADCStructTemp;
        m_oADCLostMap[uiInstrumentNb].GetNextAssoc(pos, uiKey, ADCStructTemp);	// 得到仪器对象
        uiCount++;
        if (uiCount == 1)
        {
            uimin = ADCStructTemp.uiDataCount;
        }
        else
        {
            if (uimin > ADCStructTemp.uiDataCount)
            {
                uimin = ADCStructTemp.uiDataCount;
            }
        }
    }
    return uimin;
}
开发者ID:svn2github,项目名称:jy00755131,代码行数:28,代码来源:ADCDataRecThread.cpp

示例6: while

// 删除所有仪器
//************************************
// Method:    DeleteAllInstrument
// FullName:  CInstrumentList::DeleteAllInstrument
// Access:    public 
// Returns:   void
// Qualifier:
// Parameter: void
//************************************
void CInstrumentList::DeleteAllInstrument(void)
{
	CInstrument* pInstrument = NULL;	// 仪器对象指针
	POSITION pos = NULL;				// 位置	
	unsigned int uiKey = 0;					// 索引键	
	unsigned int icount = m_oInstrumentMap.GetCount();
	if (icount == 0)
	{
		return;
	}
	pos = m_oInstrumentMap.GetStartPosition();	// 得到索引表起始位置
	while(NULL != pos)
	{
		ProcessMessages();
		pInstrument = NULL;		
		m_oInstrumentMap.GetNextAssoc(pos, uiKey, pInstrument);	// 得到仪器对象
		if(NULL != pInstrument)	
		{
			// 显示设备断开连接的图标
			OnShowDisconnectedIcon(pInstrument->m_uiIPAddress);
			// 将仪器从索引表中删除
			DeleteInstrumentFromMap(uiKey);
			// 重置仪器
			pInstrument->OnReset();
			// 仪器加在空闲仪器队列尾部
			m_olsInstrumentFree.AddTail(pInstrument);
			m_uiCountFree++;
		}
	}
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:39,代码来源:InstrumentList.cpp

示例7: SortOutProcessedMessages

//--------------------------------------------------------------------------------------
// Updates the manoeuvre. This mostly consists of processing any messages received from
// the participating entities and reacting accordingly. This can include the sending
// out of follow-up orders for entities that have completed a stage of the manoeuvre. Eventually
// the function should also check whether the goal of the manoeuvre has been achieved in 
// order to initiate termination.
// Param1: The time passed since the last update.
// Returns a behaviour status representing the state of the manoeuvre.
//--------------------------------------------------------------------------------------
BehaviourStatus GuardedFlagCapture::Update(float deltaTime)
{
	// Keep track of who has reached the target and let those defend until all have arrived
	SortOutProcessedMessages();
	ProcessMessages();

	m_timer += deltaTime;

	if(m_updateMovementTargetsInterval != 0.0f && m_timer >= m_updateMovementTargetsInterval)
	{
		UpdateMovementTargets();
		m_timer = 0.0f;
	}

	if(!IsActive() || HasFailed() || (GetNumberOfParticipants() < GetMinNumberOfParticipants()))
	{
		// The manoeuvre will fail if something failed during the initiation or if it wasn't
		// initiated at all.
		return StatusFailure;
	}else if(HasSucceeded())
	{
		return StatusSuccess;
	}

	return StatusRunning;
}
开发者ID:BlurEffect,项目名称:SquadAI,代码行数:35,代码来源:GuardedFlagCapture.cpp

示例8: Run

/**
 *  Nachrichtenschleife.
 *
 *  @author FloSoft
 */
int LobbyServer::Run(void)
{
    // Clients testen (auf timeout usw)
    if(!CheckClientTimeouts())
        return 2;

    // neue Clients verbinden
    if(!CheckForNewClients())
        return 3;

    // Daten weiterleiten
    if(!ProcessMessages())
        return 4;

    // ggf. stoppen
    if(stop == true)
        return 100;

#ifdef _WIN32
    Sleep(20);
#else
    usleep(20);
#endif

    return 0;
}
开发者ID:Return-To-The-Roots,项目名称:liblobby,代码行数:31,代码来源:LobbyServer.cpp

示例9: OnUserPreNotice

	ModResult OnUserPreNotice(User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list)
	{
		if (target_type == TYPE_CHANNEL)
			return ProcessMessages(user, static_cast<Channel*>(dest));

		return MOD_RES_PASSTHRU;
	}
开发者ID:AntiDjin,项目名称:inspircd-extras,代码行数:7,代码来源:m_slowmode.cpp

示例10: _T

bool PerigeeMove::InitIt()
{
	// on Windows Vista, verify we have permissions to do this, and prompt to elevate otherwise
	if (!m_options.skip_inventory && 
		VistaHelper::IsVistaOrNewer() && !VistaHelper::IsAdmin())
	{	
		CString prompt;
		prompt.LoadString( IDS_PREPARING_TO_MOVE_FILES );
		m_progress.SetSourceDest(prompt, _T(""));
		int count = 0;
		for(file_list::iterator it = m_files.begin(); it != m_files.end(); ++it)
		{
			if (!VistaHelper::CheckAccess(it->source, GENERIC_READ | DELETE, m_token))
			{
				CString message;
				message.Format(IDS_ELEVATION_REQUIRED_TO_MOVE_FILE, it->source);
				DoElevatePrompt(message);
				if (m_cancel)
					return false;
			}
			if (0 == (++count & 0x3f))
			{
				ProcessMessages();
				m_cancel = m_cancel || m_progress.m_CancelRequest;
			}
		}
	}

	return true;
}
开发者ID:jstanley0,项目名称:PerigeeCopy,代码行数:30,代码来源:PerigeeMove.cpp

示例11: while

// 设备根据首包时刻排序
void CInstrumentList::SetInstrumentLocation(CInstrument* pInstrumentAdd)
{
	CInstrument* pInstrument = NULL;	// 仪器对象指针
	POSITION pos = NULL;				// 位置	
	unsigned int uiKey;					// 索引键	
	pos = m_oInstrumentMap.GetStartPosition();	// 得到索引表起始位置
	while(NULL != pos)
	{
		ProcessMessages();
		pInstrument = NULL;		
		m_oInstrumentMap.GetNextAssoc(pos, uiKey, pInstrument);	// 得到仪器对象
		if(NULL != pInstrument)	
		{
			if (pInstrumentAdd->m_uiHeadFrameTime > pInstrument->m_uiHeadFrameTime)
			{
				pInstrumentAdd->m_uiLocation++;
			}
			else
			{
				pInstrument->m_uiLocation++;
				// 按照首包时刻位置设置仪器IP地址
				pInstrument->m_uiIPAddress = 71 + (pInstrument->m_uiLocation)*10;
			}
		}
	}
	// 按照首包时刻位置设置新加入仪器的IP地址
	pInstrumentAdd->m_uiIPAddress = 71 + (pInstrumentAdd->m_uiLocation)*10;
	pInstrument = NULL;
	delete pInstrument;
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:31,代码来源:InstrumentList.cpp

示例12: while

int
RoutingNode::RequestNeighborConnectionInfo()
{
	neighborsIter it = neighbors.begin();
	while (it != neighbors.end())
	{
		char buffer[512];
		bzero(buffer,512);
		sprintf(buffer, "@%d~%d~%d", myID, RoutingMessage::REQCONINFO, it->first);
		SendMessage(server, buffer);
		bzero(buffer,512);
	
		#if logging > 1
			cout << "Waiting for connection ACK of " << it->first << "...\n";
		#endif

		//wait for ack
		//replace with message-type parser at some point
		while (buffer[6] != '1' && buffer[7] != '7')
		{
			bzero(buffer,512);
			int n = recvfrom(mySocket,buffer,512,0,(struct sockaddr *)&neighbor, &sockLen);
		}

		messages.clear();
		parser.ParseMessage(buffer, fromNode, messages);
		ProcessMessages();
		it++;
	}
}
开发者ID:calebtote,项目名称:vrouting,代码行数:30,代码来源:rtngnode.cpp

示例13: ProcessMessages

// 计算出最大的待处理数据个数
unsigned int CADCDataSaveToFileThread::OnCalMaxNeedToSaveDataNum(void)
{
	unsigned int uiMax = 0;
	unsigned int uiNum = 0;
	unsigned int uiClearZeroNum = 0;
	for (unsigned int i=0; i<GraphViewNum; i++)
	{
		ProcessMessages();
		if (m_pSelectObject[i] == 1)
		{
			if (m_pSelectObjectNoise[i] == 0)
			{
				uiNum = m_uiADCFrameSaveToFileProcNum[i] * ADCFrameNumNeedToSave + m_uiADCFrameRemain[i];
				uiClearZeroNum = ADCDataSaveToFileBufSize - uiNum * ReceiveDataSize;
				if(uiClearZeroNum > 0)
				{
					memset(&m_dADCSaveToFileProcBuf[i][ADCDataSaveToFileBufSize - uiClearZeroNum], 0, uiClearZeroNum);
				}
				if (uiNum > uiMax)
				{
					uiMax = uiNum;
				}
			}
		}
	}
	for (int i=0; i<GraphViewNum; i++)
	{
		m_uiADCFrameSaved[i] += uiMax;
	}
	uiMax = uiMax * ReceiveDataSize;
	return uiMax;
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:33,代码来源:ADCDataSaveToFileThread.cpp

示例14: bzero

int
RoutingNode::GetMyID()
{
	#if logging > 1
		cout << "Getting Id...\n";
	#endif

	int n;
	char buffer[512];
	bzero(buffer,512);
	unsigned int length = sizeof(struct sockaddr_in);
	struct sockaddr_in from;

	n = sendto(mySocket,"!", strlen("!"),0,(const struct sockaddr *)&server,length);

	if (n < 0) 
		perror("Sendto");

	n = recvfrom(mySocket,buffer,512,0,(struct sockaddr *)&from, &length);

	if (n < 0) 
		perror("recvfrom");

	parser.ParseMessage(buffer, fromNode, messages);
	ProcessMessages();
}
开发者ID:calebtote,项目名称:vrouting,代码行数:26,代码来源:rtngnode.cpp

示例15: _T

void CTabADCDataShow::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: ÔÚ´ËÌí¼ÓÏûÏ¢´¦Àí³ÌÐò´úÂëºÍ/»òµ÷ÓÃĬÈÏÖµ
	if (nIDEvent == TabADCDataShowADCTimerNb)
	{
		CString str = _T("");
		CString strshow = _T("");
		double dbTemp = 0.0;
		if (m_pADCDataShow != NULL)
		{	
			for (int i=1; i<=InstrumentNum; i++)
			{
				ProcessMessages();
				m_Sec_ADCDataShow.Lock();
				dbTemp = m_pADCDataShow[i-1];
				m_Sec_ADCDataShow.Unlock();
				str.Format(_T("ADC%d = %2.*lf"), i, DecimalPlaces, dbTemp);
				strshow += str;
				if(i % ADCDataShowPerLineNum == 0)
				{
					strshow += _T("\r\n");
				}
				else
				{
					strshow += _T("\t");
				}	
			}
		}
		GetDlgItem(IDC_EDIT_ADCDATA)->SetWindowText(strshow);
	}
	CDialog::OnTimer(nIDEvent);
}
开发者ID:liquanhai,项目名称:cxm-hitech-matrix428,代码行数:32,代码来源:TabADCDataShow.cpp


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