for (const auto& motion : motions) { if (motion.Code == G01) {…
- User
for (const auto& motion : motions_) { if (motion.Code == G01) {
codeSetTimer(CApp::m_pAppInstance->m_hWnd, TIMER_ID_HORIZONTAL, motion.Speed, TimerProc); //WaitForSingleObject(); } else if (motion.Code == G03) { SetTimer(CApp::m_pAppInstance->m_hWnd, TIMER_ID_HORIZONTAL_Cir, motion.Speed, TimerProc); } else if (motion.Code == G05) { SetTimer(CApp::m_pAppInstance->m_hWnd, TIMER_ID_HORIZONTAL_Spl, motion.Speed, TimerProc); }is it true?
- Assistant
The code you posted appears to be part of a loop iterating over a collection named
motions_, where for each motion, a timer is set based on the value ofmotion.Code. The use ofSetTimersuggests this code is likely part of a Windows application, andTimerProcis likely a callback function that will be called when the timer expires.However, there are a couple of points to consider:
-
WaitForSingleObject:
- The commented-out
WaitForSingleObject();seems intended to wait for some event or object before continuing. Since it's commented out, it's unclear if this is a deliberate choice or if integration with a synchronization mechanism is missing.
- The commented-out
-