Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
44be4bba
Commit
44be4bba
authored
18 years ago
by
Ruud Overeem
Browse files
Options
Downloads
Patches
Plain Diff
BugID: 797
Controller correctly updates it state now after its child controllers are ready.
parent
3d7b6f25
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc
+18
-13
18 additions, 13 deletions
MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc
with
18 additions
and
13 deletions
MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc
+
18
−
13
View file @
44be4bba
...
...
@@ -140,7 +140,7 @@ void ObservationControl::setState(CTState::CTstateNr newState)
itsState
=
newState
;
CTState
cts
;
LOG_
DEBUG
_STR
(
getName
()
<<
" now in state "
<<
cts
.
name
(
newState
));
LOG_
INFO
_STR
(
getName
()
<<
" now in state "
<<
cts
.
name
(
newState
));
if
(
itsPropertySet
)
{
itsPropertySet
->
setValue
(
string
(
PVSSNAME_FSM_STATE
),
...
...
@@ -425,6 +425,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter
itsClaimTimer
=
0
;
LOG_DEBUG
(
"Requesting all childs to execute the CLAIM state"
);
itsChildControl
->
requestState
(
CTState
::
CLAIMED
,
""
);
itsBusyControllers
=
itsChildControl
->
countChilds
(
0
,
CNTLRTYPE_NO_TYPE
);
}
else
if
(
timerEvent
.
id
==
itsPrepareTimer
)
{
setState
(
CTState
::
PREPARE
);
...
...
@@ -432,6 +433,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter
itsPrepareTimer
=
0
;
LOG_DEBUG
(
"Requesting all childs to execute the PREPARE state"
);
itsChildControl
->
requestState
(
CTState
::
PREPARED
,
""
);
itsBusyControllers
=
itsChildControl
->
countChilds
(
0
,
CNTLRTYPE_NO_TYPE
);
}
else
if
(
timerEvent
.
id
==
itsStartTimer
)
{
setState
(
CTState
::
RESUME
);
...
...
@@ -439,6 +441,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter
itsStartTimer
=
0
;
LOG_DEBUG
(
"Requesting all childs to go operation state"
);
itsChildControl
->
requestState
(
CTState
::
RESUMED
,
""
);
itsBusyControllers
=
itsChildControl
->
countChilds
(
0
,
CNTLRTYPE_NO_TYPE
);
}
else
if
(
timerEvent
.
id
==
itsStopTimer
)
{
setState
(
CTState
::
FINISH
);
...
...
@@ -446,6 +449,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter
itsStopTimer
=
0
;
LOG_DEBUG
(
"Requesting all childs to quit"
);
itsChildControl
->
requestState
(
CTState
::
FINISHED
,
""
);
itsBusyControllers
=
itsChildControl
->
countChilds
(
0
,
CNTLRTYPE_NO_TYPE
);
}
// some other timer?
...
...
@@ -495,6 +499,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter
CONTROLClaimedEvent
msg
(
event
);
LOG_DEBUG_STR
(
"Received CLAIMED("
<<
msg
.
cntlrName
<<
")"
);
itsChildResult
|=
msg
.
result
;
doHeartBeatTask
();
break
;
}
...
...
@@ -502,6 +507,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter
CONTROLPreparedEvent
msg
(
event
);
LOG_DEBUG_STR
(
"Received PREPARED("
<<
msg
.
cntlrName
<<
")"
);
itsChildResult
|=
msg
.
result
;
doHeartBeatTask
();
break
;
}
...
...
@@ -509,6 +515,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter
CONTROLResumedEvent
msg
(
event
);
LOG_DEBUG_STR
(
"Received RESUMED("
<<
msg
.
cntlrName
<<
")"
);
itsChildResult
|=
msg
.
result
;
doHeartBeatTask
();
break
;
}
...
...
@@ -516,6 +523,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter
CONTROLSuspendedEvent
msg
(
event
);
LOG_DEBUG_STR
(
"Received SUSPENDED("
<<
msg
.
cntlrName
<<
")"
);
itsChildResult
|=
msg
.
result
;
doHeartBeatTask
();
break
;
}
...
...
@@ -523,6 +531,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter
CONTROLReleasedEvent
msg
(
event
);
LOG_DEBUG_STR
(
"Received RELEASED("
<<
msg
.
cntlrName
<<
")"
);
itsChildResult
|=
msg
.
result
;
doHeartBeatTask
();
break
;
}
...
...
@@ -685,6 +694,8 @@ void ObservationControl::doHeartBeatTask()
vector
<
ChildControl
::
StateInfo
>
lateCntlrs
=
itsChildControl
->
getPendingRequest
(
""
,
0
,
CNTLRTYPE_NO_TYPE
);
LOG_TRACE_FLOW_STR
(
"itsBusyControllers="
<<
itsBusyControllers
);
// all controllers up to date?
if
(
lateCntlrs
.
empty
())
{
LOG_DEBUG_STR
(
"All ("
<<
nrChilds
<<
") controllers are up to date"
);
...
...
@@ -693,18 +704,12 @@ void ObservationControl::doHeartBeatTask()
TRAN
(
ObservationControl
::
finishing_state
);
return
;
}
// TODO: ParentControl asserts with:
// _doRequestedAction:MCU001:ObservationControl[0]{13} : Claimed-->Connected [ParentControl.cc:342]
// Assertion: parent->currentState == CTState::CONNECT; Unexpected state:9 [ParentControl.cc:374]
//
// if (itsBusyControllers) { // last time not all cntrls ready?
// CTState cts;
// sendControlResult(*itsParentPort, cts.signal(itsState), getName(),
// itsChildResult);
// TODO
// DO NOT SEND RESULT TO MACSCHEDULER BUT CALL setState with right state(curstate+1)...
// itsBusyControllers = 0;
// }
if
(
itsBusyControllers
)
{
// last time not all cntrls ready?
CTState
cts
;
setState
(
cts
.
stateAck
(
itsState
));
itsBusyControllers
=
0
;
}
return
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment