Changeset 11061 for trunk/FACT++/src
- Timestamp:
- 06/18/11 17:48:17 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/StateMachineImp.cc
r10977 r11061 548 548 549 549 Out() << ": " << Time().GetAsStr() << " - Adding command " << evt->GetName(); 550 Out() << " (transition to " << GetStateDescription(evt->GetTargetState()) << ")" << endl; 550 if (evt->GetTargetState()>=0) 551 Out() << " (transition to " << GetStateDescription(evt->GetTargetState()) << ")"; 552 Out() << endl; 553 551 554 552 555 fListOfEvents.push_back(evt); … … 1045 1048 } 1046 1049 1047 fRunning = !dummy;1048 1049 SetCurrentState(kSM_Ready, "by Run()");1050 1051 while (!fExitRequested)1052 {1053 usleep(1);1054 if (dummy)1055 continue;1056 1057 // Execute a step in the current state of the state machine1058 if (!HandleNewState(Execute(), "by Execute-command"))1059 break;1060 1061 // If the command stack is empty go on with processing in the1062 // current state1063 if (IsQueueEmpty())1064 continue;1065 1066 // Pop the next command which arrived from the stack1067 const auto_ptr<Event> cmd(PopEvent());1068 1069 if (!HandleEvent(*cmd))1070 break;1071 }1072 1073 fRunning = false;1074 1075 1050 if (!fExitRequested) 1076 1051 { 1077 Fatal("Fatal Error occured... shutting down."); 1078 return -1; 1079 } 1080 1081 SetCurrentState(kSM_NotReady, "due to return from Run()."); 1052 fRunning = !dummy; 1053 1054 SetCurrentState(kSM_Ready, "by Run()"); 1055 1056 while (!fExitRequested) 1057 { 1058 usleep(1); 1059 if (dummy) 1060 continue; 1061 1062 // Execute a step in the current state of the state machine 1063 if (!HandleNewState(Execute(), "by Execute-command")) 1064 break; 1065 1066 // If the command stack is empty go on with processing in the 1067 // current state 1068 if (IsQueueEmpty()) 1069 continue; 1070 1071 // Pop the next command which arrived from the stack 1072 const auto_ptr<Event> cmd(PopEvent()); 1073 1074 if (!HandleEvent(*cmd)) 1075 break; 1076 } 1077 1078 fRunning = false; 1079 1080 if (!fExitRequested) 1081 { 1082 Fatal("Fatal Error occured... shutting down."); 1083 return -1; 1084 } 1085 1086 SetCurrentState(kSM_NotReady, "due to return from Run()."); 1087 } 1082 1088 1083 1089 const int exitcode = fExitRequested-1;
Note:
See TracChangeset
for help on using the changeset viewer.