Hmmn, think it might have something to do with the breakpoint:
Free running, no breakpoint:
Code: Select all
void MAIN_FRAME::OnTimer_refreshModelData( wxTimerEvent& WXUNUSED( event ) )
{
double d = wxGetLocalTime();
wxString s = wxString::Format( wxT( "%f" ), d );
wxLogDebug( s );
MODEL.refresh_data();
this->update_log_view();
}
Keeps perfect time, 20 sec increments, checked with stop watch also:
1526750989.000000
'Logger_v1_.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\audiodev.dll'
'Logger_v1_.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\WMVCORE.DLL'
'Logger_v1_.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\WMASF.DLL'
'Logger_v1_.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\wpdshext.dll'
'Logger_v1_.exe' (Win32): Unloaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23894_none_5c0be957a009922e\GdiPlus.dll'
The thread 0x814 has exited with code 0 (0x0).
The thread 0x18c8 has exited with code 0 (0x0).
1526751009.000000
1526751029.000000
The thread 0xe78 has exited with code 0 (0x0).
1526751049.000000
The thread 0xe7c has exited with code 0 (0x0).
The thread 0xb74 has exited with code 0 (0x0).
The thread 0x300 has exited with code 0 (0x0).
The thread 0xb24 has exited with code 0 (0x0).
The thread 0xfc0 has exited with code 0 (0x0).
1526751069.000000
1526751089.000000
1526751109.000000
1526751129.000000
1526751149.000000
1526751169.000000
1526751189.000000
1526751209.000000
1526751229.000000
1526751249.000000
Obviously the logger will be skewed due to using local time with a breakpoint, but using 2 handheld stop watches( tested with internet time ) the breakpoint is still cutting in as shown in the OP, every 15 secs or so, and sometimes it breaks just 2-3 secs after running from the previous break:
Code: Select all
void MAIN_FRAME::OnTimer_refreshModelData( wxTimerEvent& WXUNUSED( event ) )
{
double d = wxGetLocalTime();
wxString s = wxString::Format( wxT( "%f" ), d );
wxLogDebug( s );
MODEL.refresh_data(); //---->breakpoint here
this->update_log_view();
}
Technically it's working, as it does what it should at runtime with no breakpoint, but it is perplexing why a breakpoint should make a difference.
------------------------
doublemax wrote:Either send an event from the thread to the main frame that tells it to refresh....
Do you have a link/example how this would work?
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)