Skip to content

Commit

Permalink
Add more debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
pcolby committed Oct 11, 2024
1 parent 53f255e commit 5b9cdbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cli/abstractcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ quint32 AbstractCommand::parseNumber(const QString &value, const QString &unit,
number.chop(unit.length());
ratio = makeRatio<std::ratio<1>>();
}
qDebug() << "B" << number << ratio.den << '/' << ratio.num;
qDebug() << "B" << number << ratio.isValid() << ratio.den << '/' << ratio.num;

// Parse, and remove, the optional SI unit prefix.
if (!number.isEmpty()) {
Expand All @@ -192,7 +192,7 @@ quint32 AbstractCommand::parseNumber(const QString &value, const QString &unit,
number.chop(1);
}
}
qDebug() << "C" << number << ratio.den << '/' << ratio.num;
qDebug() << "C" << number << ratio.isValid() << ratio.den << '/' << ratio.num;

#define DOKIT_RESULT(var) (var * ratio.num * R::den / ratio.den / R::num)
// Parse the number as an (unsigned) integer.
Expand All @@ -217,7 +217,7 @@ quint32 AbstractCommand::parseNumber(const QString &value, const QString &unit,
if (!ratio.isValid()) {
for (ratio = makeRatio<R>(); DOKIT_RESULT(dbl) < sensibleMinimum; ratio.num *= 1000);
}
qDebug() << "G" << dbl << (quint32)DOKIT_RESULT(dbl);
qDebug() << "G" << dbl << ratio.isValid() << ratio.num << '/' << ratio.den << (quint32)DOKIT_RESULT(dbl);
return (quint32)DOKIT_RESULT(dbl);
}
#undef DOKIT_RESULT
Expand Down

0 comments on commit 5b9cdbc

Please sign in to comment.