Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
scdaq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
scouting-demonstrator
scdaq
Commits
f5f71aaf
Commit
f5f71aaf
authored
2 years ago
by
Dinyar Rabady
Committed by
Dinyar Rabady
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Quit more gracefully if configuration incomplete
Belongs to
#15
.
parent
c44ce4b9
No related branches found
No related tags found
Tags containing commit
2 merge requests
!59
CMSSW json file
,
!25
Quit more gracefully if configuration is incomplete
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
etc/scdaq/scdaq.conf
+3
-3
3 additions, 3 deletions
etc/scdaq/scdaq.conf
scripts/runSCdaq.sh
+4
-0
4 additions, 0 deletions
scripts/runSCdaq.sh
src/config.cc
+11
-3
11 additions, 3 deletions
src/config.cc
src/config.h
+3
-3
3 additions, 3 deletions
src/config.h
src/scdaq.cc
+4
-1
4 additions, 1 deletion
src/scdaq.cc
with
25 additions
and
10 deletions
etc/scdaq/scdaq.conf
+
3
−
3
View file @
f5f71aaf
...
@@ -59,7 +59,7 @@ enable_stream_processor:yes
...
@@ -59,7 +59,7 @@ enable_stream_processor:yes
# Note: When changing the processing type, change also "output_filename_prefix"
# Note: When changing the processing type, change also "output_filename_prefix"
# in the file output section.
# in the file output section.
#
#
#
processor_type:
GMT
processor_type
:
# Enable software zero-supression
# Enable software zero-supression
doZS
:
yes
doZS
:
yes
...
@@ -70,9 +70,9 @@ doZS:yes
...
@@ -70,9 +70,9 @@ doZS:yes
##
##
################################################################################
################################################################################
#
output_filename_prefix:
scout_GMT
output_filename_prefix
:
#
output_filename_base:
/fff/BU0/ramdisk/scdaq
output_filename_base
:
max_file_size
:
8589934592
max_file_size
:
8589934592
...
...
This diff is collapsed.
Click to expand it.
scripts/runSCdaq.sh
+
4
−
0
View file @
f5f71aaf
...
@@ -15,6 +15,10 @@ while true
...
@@ -15,6 +15,10 @@ while true
do
do
echo
"Starting scdaq..."
echo
"Starting scdaq..."
/opt/scdaq/bin/scdaq
--config
/etc/scdaq/scdaq.conf 2>&1
/opt/scdaq/bin/scdaq
--config
/etc/scdaq/scdaq.conf 2>&1
if
[[
${
PIPESTATUS
[0]
}
==
78
]]
;
then
# Numerical value of EX_CONFIG.
# If the configuration is incomplete there's no point in us retrying forever..
exit
1
fi
echo
"Resetting the board..."
echo
"Resetting the board..."
../scripts/reset-firmware.sh
../scripts/reset-firmware.sh
echo
"Clearing caches..."
echo
"Clearing caches..."
...
...
This diff is collapsed.
Click to expand it.
src/config.cc
+
11
−
3
View file @
f5f71aaf
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
#include
"log.h"
#include
"log.h"
config
::
config
(
std
::
string
filename
){
config
::
config
(
std
::
string
filename
){
bool
valid
=
true
;
std
::
ifstream
in
(
filename
.
c_str
(),
std
::
ios_base
::
in
);
std
::
ifstream
in
(
filename
.
c_str
(),
std
::
ios_base
::
in
);
std
::
string
line
;
std
::
string
line
;
while
(
!
std
::
getline
(
in
,
line
).
eof
()
)
{
while
(
!
std
::
getline
(
in
,
line
).
eof
()
)
{
...
@@ -31,19 +33,25 @@ config::config(std::string filename){
...
@@ -31,19 +33,25 @@ config::config(std::string filename){
std
::
string
key
=
line
.
substr
(
0
,
delim
);
std
::
string
key
=
line
.
substr
(
0
,
delim
);
std
::
string
value
=
line
.
substr
(
delim
+
1
);
std
::
string
value
=
line
.
substr
(
delim
+
1
);
if
(
key
.
empty
()
||
value
.
empty
()
)
{
if
(
key
.
empty
())
{
// Skip ill formated lines
// Skip ill formated lines
continue
;
continue
;
}
}
//std::cout << "key: " << key << ", value: " << value << "\n";
if
(
value
.
empty
())
{
LOG
(
ERROR
)
<<
"Configuration entry "
<<
key
<<
" has no value!"
;
valid
&=
false
;
}
vmap
[
key
]
=
value
;
vmap
[
key
]
=
value
;
}
}
if
(
!
valid
)
{
throw
std
::
invalid_argument
(
"Configuration error: Keys with no value detected!"
);
}
}
}
void
config
::
print
()
const
{
void
config
::
print
()
const
{
for
(
std
::
map
<
std
::
string
,
std
::
string
>::
const_iterator
it
=
vmap
.
begin
();
it
!=
vmap
.
end
();
it
++
){
for
(
std
::
map
<
std
::
string
,
std
::
string
>::
const_iterator
it
=
vmap
.
begin
();
it
!=
vmap
.
end
();
it
++
){
LOG
(
INFO
)
<<
"key "
<<
it
->
first
<<
" value "
<<
it
->
second
;
LOG
(
INFO
)
<<
"key "
<<
it
->
first
<<
" value "
<<
it
->
second
;
}
}
}
}
This diff is collapsed.
Click to expand it.
src/config.h
+
3
−
3
View file @
f5f71aaf
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
class
config
{
class
config
{
public:
public:
enum
class
InputType
{
WZDMA
,
DMA
,
FILEDMA
,
MICRONDMA
,
FILE
};
enum
class
InputType
{
WZDMA
,
DMA
,
FILEDMA
,
MICRONDMA
,
FILE
};
config
(
std
::
string
filename
);
config
(
std
::
string
filename
);
...
@@ -144,9 +144,9 @@ public:
...
@@ -144,9 +144,9 @@ public:
return
boost
::
lexical_cast
<
uint32_t
>
(
v
.
c_str
());
return
boost
::
lexical_cast
<
uint32_t
>
(
v
.
c_str
());
}
}
private
:
private
:
std
::
map
<
std
::
string
,
std
::
string
>
vmap
;
std
::
map
<
std
::
string
,
std
::
string
>
vmap
;
};
};
#endif
#endif
This diff is collapsed.
Click to expand it.
src/scdaq.cc
+
4
−
1
View file @
f5f71aaf
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include
<cctype>
#include
<cctype>
#include
<string>
#include
<string>
#include
<iostream>
#include
<iostream>
#include
<sysexits.h>
#include
<boost/bind.hpp>
#include
<boost/bind.hpp>
#include
<boost/asio.hpp>
#include
<boost/asio.hpp>
...
@@ -198,7 +199,9 @@ if(argc < 2){
...
@@ -198,7 +199,9 @@ if(argc < 2){
// utility::report_elapsed_time((tbb::tick_count::now() - mainStartTime).seconds());
// utility::report_elapsed_time((tbb::tick_count::now() - mainStartTime).seconds());
return
retval
;
return
retval
;
}
catch
(
std
::
exception
&
e
)
{
LOG
(
FATAL
)
<<
"Configuration invalid! Error text is
\"
"
<<
e
.
what
()
<<
"
\"
Bailing out."
;
return
EX_CONFIG
;
}
catch
(
std
::
exception
&
e
)
{
}
catch
(
std
::
exception
&
e
)
{
LOG
(
ERROR
)
<<
"Error occurred. error text is:
\"
"
<<
e
.
what
()
<<
"
\"
"
;
LOG
(
ERROR
)
<<
"Error occurred. error text is:
\"
"
<<
e
.
what
()
<<
"
\"
"
;
return
1
;
return
1
;
...
...
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