summaryrefslogtreecommitdiffstats
path: root/src/ParserConfigfile.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-03-22 17:17:30 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-03-22 17:17:30 +0100
commit750bcb896be7ab84cc30de58aba4c4620dfcf54b (patch)
treed10ce58e1fe66ea4287c11d7221a570d8f8daf7a /src/ParserConfigfile.cpp
parent479b106611539785a92cd77bbf3124c26501fce2 (diff)
downloaddabmux-750bcb896be7ab84cc30de58aba4c4620dfcf54b.tar.gz
dabmux-750bcb896be7ab84cc30de58aba4c4620dfcf54b.tar.bz2
dabmux-750bcb896be7ab84cc30de58aba4c4620dfcf54b.zip
Add local-time-offset and intl. table options
Diffstat (limited to 'src/ParserConfigfile.cpp')
-rw-r--r--src/ParserConfigfile.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ParserConfigfile.cpp b/src/ParserConfigfile.cpp
index 74d9588..4a67186 100644
--- a/src/ParserConfigfile.cpp
+++ b/src/ParserConfigfile.cpp
@@ -189,6 +189,25 @@ void parse_configfile(string configuration_file,
/* Extended Country Code */
ensemble->ecc = hexparse(pt_ensemble.get("ecc", "0"));
+ ensemble->international_table = pt_ensemble.get("international-table", 0);
+
+ double lto_hours = pt_ensemble.get("local-time-offset", 0.0);
+ if (round(lto_hours * 2) != lto_hours * 2) {
+ etiLog.level(error) << "Ensemble local time offset " <<
+ lto_hours << "h cannot be expressed in half-hour blocks.";
+ throw runtime_error("ensemble local-time-offset definition error");
+ }
+ if (lto_hours > 12 || lto_hours < -12) {
+ etiLog.level(error) << "Ensemble local time offset " <<
+ lto_hours << "h out of bounds [-12, +12].";
+ throw runtime_error("ensemble local-time-offset definition error");
+ }
+ ensemble->lto = abs(rint(lto_hours * 2));
+
+ if (lto_hours < 0.0) { // ensemble->lto is 1-bit complement
+ ensemble->lto |= (1<<5); // sign bit
+ }
+
int success = -5;
string ensemble_label = pt_ensemble.get<string>("label");
string ensemble_short_label(ensemble_label);