summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-01-27 16:37:23 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-01-27 16:37:23 +0100
commit0c888244d1e010e9327ee95af7b453b9832e0e65 (patch)
treec3e2d07bf5e0efce494538a9bae5f543fe1dd267 /src
parent42aaf8384b239f2e632a4ef042f24d4c9b7dac35 (diff)
downloaddabmod-0c888244d1e010e9327ee95af7b453b9832e0e65.tar.gz
dabmod-0c888244d1e010e9327ee95af7b453b9832e0e65.tar.bz2
dabmod-0c888244d1e010e9327ee95af7b453b9832e0e65.zip
Add a r/o timestamp remote-control parameter to display FCT and TIST
Diffstat (limited to 'src')
-rw-r--r--src/TimestampDecoder.cpp13
-rw-r--r--src/TimestampDecoder.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/TimestampDecoder.cpp b/src/TimestampDecoder.cpp
index e68bb4b..ba1a221 100644
--- a/src/TimestampDecoder.cpp
+++ b/src/TimestampDecoder.cpp
@@ -221,6 +221,9 @@ void TimestampDecoder::set_parameter(
ss >> timestamp_offset;
offset_changed = true;
}
+ else if (parameter == "timestamp") {
+ throw ParameterError("timestamp is read-only");
+ }
else {
stringstream ss;
ss << "Parameter '" << parameter
@@ -238,6 +241,16 @@ const std::string TimestampDecoder::get_parameter(
if (parameter == "offset") {
ss << timestamp_offset;
}
+ else if (parameter == "timestamp") {
+ if (full_timestamp_received) {
+ ss.setf(std::ios_base::fixed, std::ios_base::floatfield);
+ ss << time_secs + ((double)time_pps / 16384000.0) <<
+ " for frame FCT " << latestFCT;
+ }
+ else {
+ throw ParameterError("Not available yet");
+ }
+ }
else {
ss << "Parameter '" << parameter <<
"' is not exported by controllable " << get_rc_name();
diff --git a/src/TimestampDecoder.h b/src/TimestampDecoder.h
index 903346e..171dba7 100644
--- a/src/TimestampDecoder.h
+++ b/src/TimestampDecoder.h
@@ -126,6 +126,7 @@ class TimestampDecoder : public RemoteControllable
offset_changed = false;
RC_ADD_PARAMETER(offset, "TIST offset [s]");
+ RC_ADD_PARAMETER(timestamp, "FCT and timestamp [s]");
etiLog.level(info) << "Setting up timestamp decoder with " <<
timestamp_offset << " offset";