mirror of
https://github.com/wh201906/Proxmark3GUI.git
synced 2026-07-14 22:55:32 +08:00
Stop the running command after disconnected
This commit is contained in:
+9
-1
@@ -23,11 +23,14 @@ void Util::processOutput(QString output)
|
||||
void Util::execCMD(QString cmd)
|
||||
{
|
||||
qDebug() << cmd;
|
||||
emit write(cmd + "\r\n");
|
||||
if(isRunning)
|
||||
emit write(cmd + "\r\n");
|
||||
}
|
||||
|
||||
QString Util::execCMDWithOutput(QString cmd, unsigned long waitTime)
|
||||
{
|
||||
if(!isRunning)
|
||||
return "";
|
||||
QTime currTime = QTime::currentTime();
|
||||
QTime targetTime = QTime::currentTime().addMSecs(waitTime);
|
||||
isRequiringOutput = true;
|
||||
@@ -61,3 +64,8 @@ void Util::setClientType(Util::ClientType clientType)
|
||||
{
|
||||
this->clientType = clientType;
|
||||
}
|
||||
|
||||
void Util::setRunningState(bool st)
|
||||
{
|
||||
this->isRunning = st;
|
||||
}
|
||||
|
||||
@@ -31,9 +31,11 @@ public:
|
||||
public slots:
|
||||
void processOutput(QString output);
|
||||
void setClientType(Util::ClientType clientType);
|
||||
void setRunningState(bool st);
|
||||
|
||||
private:
|
||||
bool isRequiringOutput;
|
||||
bool isRunning;
|
||||
QString* requiredOutput;
|
||||
QTime timeStamp;
|
||||
ClientType clientType;
|
||||
|
||||
Reference in New Issue
Block a user