equal
deleted
inserted
replaced
485 { |
485 { |
486 m_config = aConfig ; |
486 m_config = aConfig ; |
487 m_timerif = atimerif ; |
487 m_timerif = atimerif ; |
488 m_currentState = EInit ; |
488 m_currentState = EInit ; |
489 m_index = aIndex ; |
489 m_index = aIndex ; |
|
490 isStatemachineBlocked = false; |
490 } |
491 } |
491 |
492 |
492 CStateEngine::~CStateEngine() |
493 CStateEngine::~CStateEngine() |
493 { |
494 { |
494 // Just to be sure... |
495 // Just to be sure... |
939 */ |
940 */ |
940 bool CStateEngine::handleStateEvent() |
941 bool CStateEngine::handleStateEvent() |
941 { |
942 { |
942 // We get an event into m_hwe by this moment, lets kick the state machine |
943 // We get an event into m_hwe by this moment, lets kick the state machine |
943 m_wasFiltered = ETrue ; |
944 m_wasFiltered = ETrue ; |
|
945 if (isStatemachineBlocked) |
|
946 return m_wasFiltered; |
944 |
947 |
945 CalculateDelta() ; |
948 CalculateDelta() ; |
946 turnStateMachine() ; |
949 turnStateMachine(); |
947 |
950 |
948 m_previousPointerEventPosition = m_hwe.iPosition ; |
951 m_previousPointerEventPosition = m_hwe.iPosition ; |
949 return m_wasFiltered ; |
952 return m_wasFiltered ; |
950 } |
953 } |
951 |
954 |
1083 |
1086 |
1084 const STATE_ELEMENT* pelement ; |
1087 const STATE_ELEMENT* pelement ; |
1085 m_eventConsumed = false ; // run the loop until the event has been consumed |
1088 m_eventConsumed = false ; // run the loop until the event has been consumed |
1086 // Now run trough the motions of the state elements, and prepare to change to next state while doing so. |
1089 // Now run trough the motions of the state elements, and prepare to change to next state while doing so. |
1087 // If the state elements set the m_eventConsumed then all is done |
1090 // If the state elements set the m_eventConsumed then all is done |
|
1091 isStatemachineBlocked = true; |
1088 while (!m_eventConsumed) |
1092 while (!m_eventConsumed) |
1089 { |
1093 { |
1090 int i = 0 ; |
1094 int i = 0 ; |
1091 const STATE* const pcurrentstate = allStates[m_currentState] ; |
1095 const STATE* const pcurrentstate = allStates[m_currentState] ; |
1092 // Since each state definition must contain entries for all possible events the following loop cannot fail ;-) |
1096 // Since each state definition must contain entries for all possible events the following loop cannot fail ;-) |
1129 ++pelement ; // next entry in the elements |
1133 ++pelement ; // next entry in the elements |
1130 } |
1134 } |
1131 if (m_config->m_enableLogging) DebugPrintState(nextState) ; |
1135 if (m_config->m_enableLogging) DebugPrintState(nextState) ; |
1132 m_currentState = nextState ; // Change to the next state |
1136 m_currentState = nextState ; // Change to the next state |
1133 } |
1137 } |
|
1138 isStatemachineBlocked = false; |
1134 } |
1139 } |
1135 TTimeIntervalMicroSeconds CStateEngine::getInterval() |
1140 TTimeIntervalMicroSeconds CStateEngine::getInterval() |
1136 { |
1141 { |
1137 TTime now ; |
1142 TTime now ; |
1138 now.HomeTime() ; |
1143 now.HomeTime() ; |