Skip to content

Commit 0ad7da2

Browse files
committed
Settings parser fix
1 parent 16e7073 commit 0ad7da2

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

common/settings.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,10 @@ bool Settings::differentialDecode() const {
301301
bool result = false;
302302

303303
if(mArgs.count("--diff")) {
304-
result = true;
304+
result = atoi(mArgs.at("--diff").c_str()) > 0;
305+
}
306+
if(mArgs.count("-diff")) {
307+
result = atoi(mArgs.at("-diff").c_str()) > 0;
305308
}
306309

307310
return result;
@@ -311,7 +314,10 @@ bool Settings::deInterleave() const {
311314
bool result = false;
312315

313316
if(mArgs.count("--int")) {
314-
result = true;
317+
result = atoi(mArgs.at("--int").c_str()) > 0;
318+
}
319+
if(mArgs.count("-int")) {
320+
result = atoi(mArgs.at("-int").c_str()) > 0;
315321
}
316322

317323
return result;
@@ -321,10 +327,10 @@ bool Settings::getBrokenModulation() const {
321327
bool result = false;
322328

323329
if(mArgs.count("-b")) {
324-
result = true;
330+
result = atoi(mArgs.at("-b").c_str()) > 0;
325331
}
326332
if(mArgs.count("--brokenM2")) {
327-
result = true;
333+
result = atoi(mArgs.at("--brokenM2").c_str()) > 0;
328334
}
329335

330336
return result;

main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ int main(int argc, char* argv[]) {
5656

5757
mThreadPool.start();
5858

59+
MeteorDecoder meteorDecoder(mSettings.deInterleave(), mSettings.getDemodulatorMode() == "oqpsk", mSettings.differentialDecode());
60+
5961
size_t decodedPacketCounter = 0;
60-
MeteorDecoder meteorDecoder(mSettings.deInterleave(), mSettings.differentialDecode(), mSettings.getDemodulatorMode() == "oqpsk");
6162
std::string inputPath = mSettings.getInputFilePath();
6263
try {
6364
if(inputPath.substr(inputPath.find_last_of(".") + 1) == "wav") {

0 commit comments

Comments
 (0)