本文整理汇总了C++中UpdateTime函数的典型用法代码示例。如果您正苦于以下问题:C++ UpdateTime函数的具体用法?C++ UpdateTime怎么用?C++ UpdateTime使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UpdateTime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetFST
void SetFST( void )
{
if( s_bFrameSkip == FALSE ) return;
UpdateTime();
while (m_lTime < (1000 / FRAME_PER_SEC))
UpdateTime();
m_lTime -= (1000 / FRAME_PER_SEC);
}
示例2: time
void Custom1System::DispatchEvent()
{
U8 u8State=0;
time_t timep;
struct tm *p;
time(&timep);
p=localtime(&timep);
GetValue(cmndr.u32deviceid, cmndr.name, cmndr.pu8ParaBuf,&u8State);
if(baseYear!=p->tm_year || baseMonth!=p->tm_mon || baseDay!=p->tm_mday)
{
UpdateTime();
memcpy(&baseValue, cmndr.pu8ParaBuf, sizeof(float));
float *pw=(float*)cmndw.pu8ParaBuf;
float *pi=(float*)cmndd.pu8ParaBuf;
*pw=0;
*pi=4;
UpdateTime();
}
else
{
float *pw=(float*)cmndw.pu8ParaBuf;
float *pr=(float*)cmndr.pu8ParaBuf;
float *pi=(float*)cmndd.pu8ParaBuf;
int i2f;
float f=(*pr)-baseValue;
i2f=(int)f;
if(i2f>=1000)
{
(*pw)=(float)(i2f%10000);
*pi=4;
}
else if(i2f>=100)
{
(*pw)=(float)(f*10);
*pi=3;
}
else if(i2f>=10)
{
(*pw)=(float)(f*100);
*pi=2;
}
else
{
(*pw)=(float)(f*1000);
*pi=1;
}
}
SetValue(cmndw.u32deviceid, cmndw.name, cmndw.pu8ParaBuf);
SetValue(cmndd.u32deviceid, cmndd.name, cmndd.pu8ParaBuf);
}
示例3: SanitizedString
void CNowPlayingCtrl::UpdateInfo( const MusikSongId &songid )
{
std::auto_ptr<CMusikSong> pSong = songid.Song();
//--- first things first, verify data in song ---//
wxString sArtist = SanitizedString( ConvFromUTF8( pSong->MetaData.Artist ));
wxString sTitle = SanitizedString( ConvFromUTF8( pSong->MetaData.Title ));
wxString sAlbum = SanitizedString( ConvFromUTF8( pSong->MetaData.Album ));
if ( sArtist.IsEmpty())
sArtist = _( "Unknown Artist" );
if ( sTitle.IsEmpty() )
sTitle = _( "Unknown Song" );
if (!(m_CurrSong.MetaData.Filename == pSong->MetaData.Filename
&& m_CurrSong.MetaData.Artist == pSong->MetaData.Artist
&& m_CurrSong.MetaData.Album == pSong->MetaData.Album
&& m_CurrSong.MetaData.Title == pSong->MetaData.Title))
{
// song info has changed
m_CurrSong = *pSong;
m_pTunage->Started( *pSong );
//--- title / artist / time -//
sTitle.Replace ( wxT( "&" ), wxT( "&&" ), TRUE );
sArtist.Replace ( wxT( "&" ), wxT( "&&" ), TRUE );
if ( sTitle != stSong->GetLabel() )
stSong->SetLabel( sTitle );
if ( sArtist != stArtist->GetLabel() )
stArtist->SetLabel( sArtist );
}
UpdateTime();
}
示例4: UpdateTime
void InputFile::Update () {
time_t newTime = UpdateTime(GetName());
if (newTime > updateTime) {
Reread();
updateTime = newTime;
}
}
示例5: ProcessEvent
/** Process an event. */
void ProcessEvent(XEvent *event)
{
switch(event->type) {
case ButtonPress:
case ButtonRelease:
HandleButtonEvent(&event->xbutton);
break;
case KeyPress:
HandleKeyPress(&event->xkey);
break;
case KeyRelease:
HandleKeyRelease(&event->xkey);
break;
case EnterNotify:
HandleEnterNotify(&event->xcrossing);
break;
case MotionNotify:
while(JXCheckTypedEvent(display, MotionNotify, event));
UpdateTime(event);
HandleMotionNotify(&event->xmotion);
break;
case LeaveNotify:
case DestroyNotify:
case Expose:
case ConfigureNotify:
break;
default:
Debug("Unknown event type: %d", event->type);
break;
}
}
示例6: trace
// disconnect from external sources -----------------------------------------
void __fastcall TPlot::Disconnect(void)
{
AnsiString s;
char *cmd;
int i;
trace(3,"Disconnect\n");
if (!ConnectState) return;
ConnectState=0;
for (i=0;i<2;i++) {
if (StrCmdEna[i][1]) {
cmd=StrCmds[i][1].c_str();
strwrite(Stream+i,(unsigned char *)cmd,strlen(cmd));
}
strclose(Stream+i);
}
if (strstr(Caption.c_str(),"CONNECT")) {
Caption=s.sprintf("DISCONNECT%s",Caption.c_str()+7);
}
UpdateTime();
UpdatePlot();
}
示例7: MAP_GetCurrent
void CMainWnd::OnPlayStop()
{
// レジューム用の情報を取得しておく
if (m_pOptions->m_fResume && MAP_GetStatus(m_hMap) != MAP_STATUS_STOP) {
m_pOptions->m_nResumeTime = MAP_GetCurrent(m_hMap);
}
if (MAP_GetStatus(m_hMap) == MAP_STATUS_STOP)
MAP_AudioDeviceClose(m_hMap);
// 停止処理
Stop();
// シャッフルフラグをリセット
if (m_pOptions->m_fShuffle) {
ResetShuffle();
FILEINFO* p = (FILEINFO*)m_pListFile->GetAt(m_nCurrent);
if (p) p->fShuffle = TRUE;
}
// レジュームの場合時刻をセット
if (m_pOptions->m_fResume) {
MAP_Seek(m_hMap, m_pOptions->m_nResumeTime);
m_pOptions->m_nResumeTime = 0;
}
UpdateTime();
UpdateStatus();
UpdateStreamTitle();
}
示例8: DiscardKeyEvents
/** Discard key events for the specified window. */
void DiscardKeyEvents(XEvent *event, Window w)
{
JXSync(display, False);
while(JXCheckTypedWindowEvent(display, w, KeyPress, event)) {
UpdateTime(event);
}
}
示例9: ListView_DeleteItem
BOOL CPpcMainWnd::DeleteFile(int nIndex)
{
if (!m_pListFile->RemoveAt(nIndex))
return FALSE;
ListView_DeleteItem(m_hwndLV, nIndex);
if (!m_pListFile->GetCount()) {
Close();
m_nCurrent = OPEN_NONE;
InvalidateRect(m_hWnd, NULL, TRUE);
UpdateWindow(m_hWnd);
}
else if (m_nCurrent == nIndex) {
Stop();
UpdateTime();
UpdateStatus();
m_nCurrent = OPEN_NONE;
Open(m_pListFile->GetCount() - 1 < nIndex ? 0 : nIndex);
}
else if (m_nCurrent > nIndex) {
m_nCurrent--;
UpdateTrack();
}
return TRUE;
}
示例10: SanitizedString
void CNowPlayingCtrl::UpdateInfo( const CMusikSong &song )
{
//--- first things first, verify data in song ---//
wxString sArtist = SanitizedString( ConvFromUTF8( song.MetaData.Artist ));
wxString sTitle = SanitizedString( ConvFromUTF8( song.MetaData.Title ));
wxString sAlbum = SanitizedString( ConvFromUTF8( song.MetaData.Album ));
if ( sArtist.IsEmpty())
sArtist = _( "Unknown Artist" );
if ( sTitle.IsEmpty() )
sTitle = _( "Unknown Song" );
// tell Tunage to do it's thing if file has changed
if ( m_LastFile != song.MetaData.Filename )
m_pTunage->Execute( song );
m_LastFile = song.MetaData.Filename;
//--- caption bar title ---//
g_MusikFrame->SetTitle( sArtist + wxT( " - " ) + sTitle + (!sAlbum.IsEmpty() ? wxString(wxT( " - " )) + sAlbum : wxString()) );
g_MusikFrame->SetSongInfoText( song );
//--- title / artist / time -//
sTitle.Replace ( wxT( "&" ), wxT( "&&" ), TRUE );
sArtist.Replace ( wxT( "&" ), wxT( "&&" ), TRUE );
if ( sTitle != stSong->GetLabel() )
stSong->SetLabel( sTitle );
if ( sArtist != stArtist->GetLabel() )
stArtist->SetLabel( sArtist );
UpdateTime();
Layout();
}
示例11: Server
ServerObject::ServerObject(Services::SharedPtr services, boost::asio::io_service& io, bool debug)
: Server(services)
, Io(io)
, Debug(debug)
, Instance(std::move(CreateServerObject(services)))
, ServerTime(Instance.GetVariable(GetCurrentTimeRelativepath()))
, Timer(io)
{
Timer.Start(boost::posix_time::seconds(1), [this](){
UpdateTime();
});
//Set many values in address space which are expected by clients
std::vector<std::string> uris;
uris.push_back("http://opcfoundation.org/UA/");
uris.push_back("http://freeopcua.github.io");
Node node = Node(Server, ObjectId::Server_NamespaceArray);
node.SetValue(uris);
node = Node(Server, ObjectId::Server_ServerStatus_BuildInfo_ManufacturerName);
node.SetValue(std::string("FreeOpcUa"));
node = Node(Server, ObjectId::Server_ServerCapabilities_LocaleIdArray);
node.SetValue(std::vector<std::string>({ "en" }));
node = Node(Server, ObjectId::Server_ServerStatus_BuildInfo_BuildNumber);
node.SetValue(std::string("0.8"));
node = Node(Server, ObjectId::Server_ServerStatus_BuildInfo_ProductName);
node.SetValue(std::string("FreeOpcUa"));
node = Node(Server, ObjectId::Server_ServerStatus_BuildInfo_ProductUri);
node.SetValue(std::string("https://freeopcua.github.io"));
node = Node(Server, ObjectId::Server_ServerStatus_State);
node.SetValue((int32_t) 0);
node = Node(Server, ObjectId::Server_ServerStatus_CurrentTime);
node.SetValue(DateTime::Current());//Set time before the thread does it
}
示例12: RunPhysics
void RunPhysics()
{
if (gSceneRunning)
return;
// Update the time step
NxReal deltaTime = UpdateTime();
deltaTime = 0.02f; // todo: may go back to real time at some point
// Run collision and dynamics for delta time since the last frame
#if 1
NxSceneDesc desc;
gScene->saveToDesc(desc);
gScene->simulate(desc.maxTimestep);
#else
gScene->simulate(deltaTime);
#endif
gSceneRunning = true;
WaitForPhysics();
gSamples[gSampleIndex]->update();
gFrameCounter++;
}
示例13: QFrame
PunchOut::PunchOut(QWidget *parent) :
QFrame(parent),
ui(new Ui::PunchOut)
{
ui->setupUi(this);
ui->label_warring->hide();
ui->dateTimeEdit->setDateTime(QDateTime::currentDateTime());
QTimer *timer=new QTimer(this);
connect(timer,SIGNAL(timeout()),this,SLOT(UpdateTime()));
//开启定时器
timer->start(1000);
// 显示是否已签退
QSqlQuery query;
query.prepare("select count(*) from punchreg where date = curdate() and persid = ? and outtime is not null");
query.addBindValue(login_persid);
query.exec();
if(query.next()){
if(query.value(0).toInt() != 0){
ui->pushButton->hide();
ui->label_warring->show();
}
}
}
示例14: MyFunc
LRESULT CALLBACK MyFunc(HWND this_hwnd,UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_TIMER:
UpdateTime(0.02f);
InvalidateRect(hWnd, NULL, 0);
break;
case WM_PAINT:
// перерисовываем только всё окно
if(this_hwnd == hWnd)
{
PAINTSTRUCT ps;
HDC ThisDC = BeginPaint(hWnd, &ps);
PaintIt(ThisDC);
EndPaint(hWnd, &ps);
}
break;
}
return DefWindowProc(this_hwnd, message, wParam, lParam);
}
示例15: UpdateTime
void RouterProfile::TunnelBuildResponse (uint8_t ret)
{
if (ret > 0)
m_NumTunnelsDeclined++;
else
m_NumTunnelsAgreed++;
UpdateTime ();
}