Config fiie for official client

Unfinished
Refactor nested(), info(), chk()
This commit is contained in:
wh201906
2021-09-18 01:59:00 +08:00
parent 5a8ab42281
commit 03d9c601fc
6 changed files with 153 additions and 127 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ void Util::execCMD(const QString& cmd)
emit write(cmd + "\n");
}
QString Util::execCMDWithOutput(const QString& cmd, ReturnTrigger trigger)
QString Util::execCMDWithOutput(const QString& cmd, ReturnTrigger trigger, bool rawOutput)
{
// if the trigger is empty, this function will wait trigger.waitTime then return all outputs during the wait time.
// otherwise, this function will return empty string if no trigger is detected, or return outputs if any trigger is detected.
@@ -78,7 +78,7 @@ QString Util::execCMDWithOutput(const QString& cmd, ReturnTrigger trigger)
}
}
isRequiringOutput = false;
return (isResultFound || trigger.expectedOutputs.isEmpty() ? *requiredOutput : "");
return (isResultFound || trigger.expectedOutputs.isEmpty() || rawOutput ? *requiredOutput : "");
}
void Util::delay(unsigned int msec)
+1 -1
View File
@@ -53,7 +53,7 @@ public:
explicit Util(QObject *parent = nullptr);
void execCMD(const QString& cmd);
QString execCMDWithOutput(const QString& cmd, ReturnTrigger trigger = 10000);
QString execCMDWithOutput(const QString& cmd, ReturnTrigger trigger = 10000, bool rawOutput = false);
void delay(unsigned int msec);
static ClientType getClientType();
static int rawTabIndex;