19 #include <QCommandLineOption> 20 #include <QRegExpValidator> 26 m_testOption(QStringList() <<
"t" <<
"test",
27 "Test type: decimateii, decimatefi, decimateff, decimateif, decimateinfii, decimatesupii, ambe",
30 m_nbSamplesOption(QStringList() <<
"n" <<
"nb-samples",
31 "Number of sample to deal with.",
34 m_repetitionOption(QStringList() <<
"r" <<
"repeat",
35 "Number of repetitions.",
38 m_log2FactorOption(QStringList() <<
"l" <<
"log2-factor",
39 "Log2 factor for rate conversion.",
48 m_parser.setApplicationDescription(
"Software Defined Radio application benchmarks");
72 QString testStr =
"([a-z]+)";
73 QRegExp ipRegex (
"^" + testStr +
"$");
74 QRegExpValidator ipValidator(ipRegex);
76 if (ipValidator.validate(test, pos) == QValidator::Acceptable) {
79 qWarning() <<
"ParserBench::parse: test string invalid. Defaulting to " <<
m_testStr;
85 int nbSamples = nbSamplesStr.toInt(&ok);
87 if (ok && (nbSamples > 1024) && (nbSamples < 1073741824)) {
90 qWarning() <<
"ParserBench::parse: number of samples invalid. Defaulting to " <<
m_nbSamples;
96 int repetition = repetitionStr.toInt(&ok);
98 if (ok && (repetition >= 0)) {
101 qWarning() <<
"ParserBench::parse: repetition invalid. Defaulting to " <<
m_repetition;
107 int log2Factor = log2FactorStr.toInt(&ok);
109 if (ok && (log2Factor >= 0) && (log2Factor <= 6)) {
112 qWarning() <<
"ParserBench::parse: repetilog2 factortion invalid. Defaulting to " <<
m_log2Factor;
124 }
else if (
m_testStr ==
"decimateinfii") {
126 }
else if (
m_testStr ==
"decimatesupii") {
QCommandLineParser m_parser
void parse(const QCoreApplication &app)
QCommandLineOption m_log2FactorOption
QCommandLineOption m_nbSamplesOption
QCommandLineOption m_repetitionOption
QCommandLineOption m_testOption
TestType getTestType() const