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
04f77f8d
Commit
04f77f8d
authored
12 years ago
by
Joris van Zwieten
Browse files
Options
Downloads
Patches
Plain Diff
Task #3458: Added checks on command status returned by Command::accept().
parent
7f22325e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CEP/Calibration/BBSControl/src/bbs-reducer.cc
+39
-5
39 additions, 5 deletions
CEP/Calibration/BBSControl/src/bbs-reducer.cc
CEP/Calibration/BBSControl/src/bbs-shared-estimator.cc
+1
-1
1 addition, 1 deletion
CEP/Calibration/BBSControl/src/bbs-shared-estimator.cc
with
40 additions
and
6 deletions
CEP/Calibration/BBSControl/src/bbs-reducer.cc
+
39
−
5
View file @
04f77f8d
...
@@ -235,7 +235,13 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args)
...
@@ -235,7 +235,13 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args)
// Fake intialization.
// Fake intialization.
InitializeCommand
initCmd
(
strategy
);
InitializeCommand
initCmd
(
strategy
);
initCmd
.
accept
(
handler
);
CommandResult
initResult
=
initCmd
.
accept
(
handler
);
if
(
!
initResult
)
{
LOG_ERROR_STR
(
"Error executing "
<<
initCmd
.
type
()
<<
" command: "
<<
initResult
.
message
());
return
1
;
}
// Fake session control.
// Fake session control.
StrategyIterator
it
;
StrategyIterator
it
;
...
@@ -243,9 +249,19 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args)
...
@@ -243,9 +249,19 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args)
{
{
if
(
!
it
.
atEnd
())
if
(
!
it
.
atEnd
())
{
{
// Execute the current command.
LOG_DEBUG_STR
(
"Executing a "
<<
(
*
it
)
->
type
()
<<
" command:"
<<
endl
LOG_DEBUG_STR
(
"Executing a "
<<
(
*
it
)
->
type
()
<<
" command:"
<<
endl
<<
**
it
);
<<
**
it
);
(
*
it
)
->
accept
(
handler
);
CommandResult
result
=
(
*
it
)
->
accept
(
handler
);
if
(
!
result
)
{
LOG_ERROR_STR
(
"Error executing "
<<
(
*
it
)
->
type
()
<<
" command: "
<<
result
.
message
());
return
1
;
}
// Move to the next command in the strategy.
++
it
;
++
it
;
}
}
else
else
...
@@ -255,7 +271,17 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args)
...
@@ -255,7 +271,17 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args)
{
{
// Fake finalization.
// Fake finalization.
FinalizeCommand
finCmd
;
FinalizeCommand
finCmd
;
finCmd
.
accept
(
handler
);
LOG_DEBUG_STR
(
"Executing a "
<<
finCmd
.
type
()
<<
" command:"
<<
endl
<<
finCmd
);
CommandResult
result
=
finCmd
.
accept
(
handler
);
if
(
!
result
)
{
LOG_ERROR_STR
(
"Error executing "
<<
finCmd
.
type
()
<<
" command: "
<<
result
.
message
());
return
1
;
}
}
}
else
else
{
{
...
@@ -270,9 +296,17 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args)
...
@@ -270,9 +296,17 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList &args)
// Fake next chunk.
// Fake next chunk.
NextChunkCommand
nextCmd
(
msFreqRange
.
first
,
msFreqRange
.
second
,
start
,
NextChunkCommand
nextCmd
(
msFreqRange
.
first
,
msFreqRange
.
second
,
start
,
end
);
end
);
LOG_DEBUG_STR
(
"Executing a "
<<
nextCmd
.
type
()
<<
" command:"
<<
endl
LOG_DEBUG_STR
(
"Executing a "
<<
nextCmd
.
type
()
<<
" command:"
<<
endl
<<
nextCmd
);
<<
nextCmd
);
nextCmd
.
accept
(
handler
);
CommandResult
result
=
nextCmd
.
accept
(
handler
);
if
(
!
result
)
{
LOG_ERROR_STR
(
"Error executing "
<<
nextCmd
.
type
()
<<
" command: "
<<
result
.
message
());
return
1
;
}
// Re-initialize strategy iterator.
// Re-initialize strategy iterator.
it
=
StrategyIterator
(
strategy
);
it
=
StrategyIterator
(
strategy
);
...
@@ -368,7 +402,7 @@ int runDistributed(const ParameterSet &options,
...
@@ -368,7 +402,7 @@ int runDistributed(const ParameterSet &options,
session
.
postResult
(
command
.
first
,
result
);
session
.
postResult
(
command
.
first
,
result
);
// If an error occurred, log a descriptive message and exit.
// If an error occurred, log a descriptive message and exit.
if
(
result
.
is
(
CommandResult
::
ERROR
)
)
if
(
!
result
)
{
{
LOG_ERROR_STR
(
"Error executing "
<<
command
.
second
->
type
()
LOG_ERROR_STR
(
"Error executing "
<<
command
.
second
->
type
()
<<
" command: "
<<
result
.
message
());
<<
" command: "
<<
result
.
message
());
...
...
This diff is collapsed.
Click to expand it.
CEP/Calibration/BBSControl/src/bbs-shared-estimator.cc
+
1
−
1
View file @
04f77f8d
...
@@ -188,7 +188,7 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList&)
...
@@ -188,7 +188,7 @@ int run(const ParameterSet &options, const OptionParser::ArgumentList&)
session
.
postResult
(
command
.
first
,
result
);
session
.
postResult
(
command
.
first
,
result
);
// If an error occurred, log a descriptive message and exit.
// If an error occurred, log a descriptive message and exit.
if
(
result
.
is
(
CommandResult
::
ERROR
)
)
if
(
!
result
)
{
{
LOG_ERROR_STR
(
"Error executing "
<<
command
.
second
->
type
()
LOG_ERROR_STR
(
"Error executing "
<<
command
.
second
->
type
()
<<
" command: "
<<
result
.
message
());
<<
" command: "
<<
result
.
message
());
...
...
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