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
8242cff1
Commit
8242cff1
authored
12 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Task #2669: Added printRSP tool to dump the header of the first RSP packet on stdin
parent
47cfdcb2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitattributes
+1
-0
1 addition, 0 deletions
.gitattributes
RTCP/Cobalt/InputProc/src/CMakeLists.txt
+1
-0
1 addition, 0 deletions
RTCP/Cobalt/InputProc/src/CMakeLists.txt
RTCP/Cobalt/InputProc/src/Station/printRSP.cc
+86
-0
86 additions, 0 deletions
RTCP/Cobalt/InputProc/src/Station/printRSP.cc
with
88 additions
and
0 deletions
.gitattributes
+
1
−
0
View file @
8242cff1
...
...
@@ -3939,6 +3939,7 @@ RTCP/Cobalt/InputProc/src/Station/PacketsToBuffer.cc -text
RTCP/Cobalt/InputProc/src/Station/PacketsToBuffer.h -text
RTCP/Cobalt/InputProc/src/Station/RSP.h -text
RTCP/Cobalt/InputProc/src/Station/filterRSP.cc -text
RTCP/Cobalt/InputProc/src/Station/printRSP.cc -text
RTCP/Cobalt/InputProc/src/Transpose/MPITransferStations.h -text
RTCP/Cobalt/InputProc/src/Transpose/MPITransferStations.tcc -text
RTCP/Cobalt/InputProc/src/WallClockTime.h -text
...
...
This diff is collapsed.
Click to expand it.
RTCP/Cobalt/InputProc/src/CMakeLists.txt
+
1
−
0
View file @
8242cff1
...
...
@@ -18,3 +18,4 @@ lofar_add_library(inputproc
lofar_add_bin_program
(
newInputSection newInputSection.cc
)
lofar_add_bin_program
(
filterRSP Station/filterRSP.cc
)
lofar_add_bin_program
(
printRSP Station/printRSP.cc
)
This diff is collapsed.
Click to expand it.
RTCP/Cobalt/InputProc/src/Station/printRSP.cc
0 → 100644
+
86
−
0
View file @
8242cff1
//# printRSP.cc: print one RSP header retrieved from stdin
//#
//# Copyright (C) 2009
//# ASTRON (Netherlands Foundation for Research in Astronomy)
//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
//#
//# This program is free software; you can redistribute it and/or modify
//# it under the terms of the GNU General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or
//# (at your option) any later version.
//#
//# This program is distributed in the hope that it will be useful,
//# but WITHOUT ANY WARRANTY; without even the implied warranty of
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//# GNU General Public License for more details.
//#
//# You should have received a copy of the GNU General Public License
//# along with this program; if not, write to the Free Software
//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//# Always #include <lofar_config.h> first!
#include
<lofar_config.h>
#include
<Station/RSP.h>
#include
<CoInterface/RSPTimeStamp.h>
#include
<Common/LofarLogger.h>
#include
<Common/DataConvert.h>
#include
<Stream/FileStream.h>
#include
<time.h>
#include
<string.h>
#include
<string>
#include
<iostream>
using
namespace
LOFAR
;
using
namespace
LOFAR
::
RTCP
;
using
namespace
std
;
void
report
(
const
string
&
filename
)
{
FileStream
f
(
filename
);
struct
RSP
packet
;
// read header
f
.
read
(
&
packet
.
header
,
sizeof
(
RSP
::
Header
)
);
#ifdef WORDS_BIGENDIAN
dataConvert
(
LittleEndian
,
packet
.
header
.
configuration
);
dataConvert
(
LittleEndian
,
packet
.
header
.
timestamp
);
dataConvert
(
LittleEndian
,
packet
.
header
.
blockSequenceNumber
);
#endif
TimeStamp
timeStamp
=
packet
.
timeStamp
();
time_t
seconds
=
timeStamp
.
getSeqId
();
char
buf
[
26
];
ctime_r
(
&
seconds
,
buf
);
buf
[
strlen
(
buf
)
-
1
]
=
0
;
// remove trailing \n
cout
<<
"Time stamp: "
<<
buf
<<
" sample "
<<
timeStamp
.
getBlockId
()
<<
endl
;
cout
<<
"RSP version: "
<<
(
int
)
packet
.
header
.
version
<<
endl
;
cout
<<
"RSP board nr: "
<<
packet
.
rspBoard
()
<<
endl
;
cout
<<
"Payload OK: "
<<
(
packet
.
payloadError
()
?
"NO"
:
"YES"
)
<<
endl
;
cout
<<
"Clock: "
<<
packet
.
clockMHz
()
<<
" MHz"
<<
endl
;
cout
<<
"Bit mode: "
<<
packet
.
bitMode
()
<<
" bit"
<<
endl
;
cout
<<
"Blocks: "
<<
(
int
)
packet
.
header
.
nrBlocks
<<
endl
;
cout
<<
"Beamlets: "
<<
(
int
)
packet
.
header
.
nrBeamlets
<<
endl
;
// read payload
f
.
read
(
&
packet
.
payload
,
packet
.
packetSize
()
-
sizeof
(
RSP
::
Header
)
);
#ifdef WORDS_BIGENDIAN
if
(
packet
.
bitMode
()
==
16
)
dataConvert
(
LittleEndian
,
(
int16
*
)
&
packet
.
payload
,
packet
.
header
.
nrBlocks
*
packet
.
header
.
nrBeamlets
*
2
*
2
);
#endif
}
int
main
()
{
INIT_LOGGER
(
"printRSP"
);
report
(
"/dev/stdin"
);
return
0
;
}
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