Skip to content

Commit

Permalink
Use Utilities::Sleep.
Browse files Browse the repository at this point in the history
Get rid of some order warnings.
  • Loading branch information
adeas31 committed Nov 9, 2017
1 parent 9e52038 commit 85c8ee9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions OMEdit/OMEditGUI/Simulation/OpcUaClient.cpp
Expand Up @@ -7,14 +7,6 @@
#include <QThread>
#include <QDebug>

class SleepThread : public QThread {
public:
// Work-around for Qt4 having msleep as protected
static inline void msleep(unsigned long msecs) {
QThread::msleep(msecs);
}
};

/*!
Write the value value to the real node with id id.
*/
Expand Down Expand Up @@ -97,7 +89,7 @@ bool OpcUaClient::connectToServer()
mpClient = UA_Client_new(UA_ClientConfig_standard);
UA_StatusCode returnValue;
do {
SleepThread::msleep(100);
Sleep::msleep(100);
// QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
returnValue = UA_Client_connect(mpClient, endPoint.c_str());
} while (returnValue != UA_STATUSCODE_GOOD);
Expand Down Expand Up @@ -368,7 +360,7 @@ void OpcUaWorker::startInteractiveSimulation()
}
} else {
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
SleepThread::msleep(mServerSampleInterval);
Sleep::msleep(mServerSampleInterval);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/Simulation/OpcUaClient.h
Expand Up @@ -78,6 +78,8 @@ private slots:
OpcUaClient *mpParentClient;
VariablesTreeItem *mpVariablesTreeItemRoot;
QTime mClock;
bool mSimulateWithSteps;
const double mSampleInterval;
double mInterval, mSpeedValue, mServerSampleInterval;
bool mIsRunning;

Expand All @@ -92,8 +94,6 @@ private slots:
static QThreadStorage<double> mCurrentTime;
static QThreadStorage<int> mInt;
UA_UInt32 mSubscriptionId;
bool mSimulateWithSteps;
const double mSampleInterval;
signals:
void sendUpdateCurves();
void sendUpdateYAxis(double, double);
Expand Down

0 comments on commit 85c8ee9

Please sign in to comment.