Compare commits
No commits in common. "fbe53ea845a267af639b5f7695ab4e21ef6e7065" and "de61de85f1a6e3da2353f03322f99546a0cab5a3" have entirely different histories.
fbe53ea845
...
de61de85f1
@ -121,13 +121,8 @@ public:
|
||||
explicit hwapi(QObject *parent = nullptr);
|
||||
|
||||
|
||||
|
||||
#ifdef THIS_IS_CA_MASTER
|
||||
T_datif *myDatif;
|
||||
#else // THIS_IS_CA_SLAVE
|
||||
QString getVersions();
|
||||
void resetVersions();
|
||||
bool m_resetVersions = false;
|
||||
#endif
|
||||
|
||||
T_runProc *runProcess;
|
||||
@ -1406,8 +1401,6 @@ public:
|
||||
|
||||
|
||||
signals:
|
||||
void hwapi_restoredVersions();
|
||||
|
||||
void hwapi_reportDCDownloadStatus(QString const&) const override;
|
||||
void hwapi_reportDCDownloadSuccess(QString const&) const override;
|
||||
void hwapi_reportDCDownloadFailure(QString const&) const override;
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "hwapi.h"
|
||||
#include "download_thread.h"
|
||||
#include "reporting_thread.h"
|
||||
#include "storeINdata.h" // epi_loadSWVer, epi_loadHWVer
|
||||
|
||||
#include <cstring>
|
||||
#include <QThread>
|
||||
@ -26,37 +25,6 @@ static uint8_t hwapi_lastDoorState;
|
||||
static uint8_t bl_startupStep;
|
||||
|
||||
|
||||
#ifdef THIS_IS_CA_MASTER
|
||||
#else // THIS_IS_CA_SLAVE
|
||||
QString hwapi::getVersions() {
|
||||
if (m_sharedMem != nullptr) {
|
||||
// check if sw/hw-versions have been restored (see resetVersions()).
|
||||
// emit a signal in such a case.
|
||||
QString const &sw = epi_loadSWver(); // command 11
|
||||
QString const &hw = epi_loadHWver(); // command 12
|
||||
if (!sw.isEmpty() && !hw.isEmpty() && m_resetVersions) {
|
||||
emit hwapi_restoredVersions();
|
||||
return sw + " " + hw;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
void hwapi::resetVersions() {
|
||||
if (m_sharedMem != nullptr) {
|
||||
// command 11 and 12 are included in the requests sent automatically,
|
||||
// first 11, then 12. The results are used to refresh corresponding
|
||||
// shared memory locations.
|
||||
// set these locations to the empty string in the opposite order as
|
||||
// the commands are sent.
|
||||
// purpose: only when both locations are not empty again, we can be
|
||||
// sure that data are not obsolete.
|
||||
gpi_storeHWver(""); // command 12
|
||||
gpi_storeSWver(""); // command 11
|
||||
m_resetVersions = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
hwapi::hwapi(QObject *parent) : QObject(parent)
|
||||
{
|
||||
|
@ -6,11 +6,6 @@
|
||||
#include "shared_mem_buffer.h"
|
||||
#include "datei.h"
|
||||
|
||||
#include <QMutex>
|
||||
#include <QMutexLocker>
|
||||
|
||||
static QMutex SWHD_mutex;
|
||||
|
||||
// gpi: grafical access to PI: access from external devices over device controller FOR GUI
|
||||
// epi: external access from GUI to PI: FOR external devices (DC)
|
||||
|
||||
@ -69,7 +64,6 @@ bool indat_isMdbOn()
|
||||
|
||||
void gpi_storeHWver(QString text)
|
||||
{
|
||||
QMutexLocker locker(&SWHD_mutex);
|
||||
// change Qstring to array of chars, because shared mem allowes no QString!
|
||||
int nn, LL = text.length();
|
||||
if (LL >= versionBufferLen)
|
||||
@ -85,7 +79,6 @@ void gpi_storeHWver(QString text)
|
||||
|
||||
QString epi_loadHWver(void)
|
||||
{
|
||||
QMutexLocker locker(&SWHD_mutex);
|
||||
// load array of chars from SM and change to QString
|
||||
int nn, LL = versionBufferLen;
|
||||
char cc;
|
||||
@ -103,7 +96,6 @@ QString epi_loadHWver(void)
|
||||
|
||||
void gpi_storeSWver(QString text)
|
||||
{
|
||||
QMutexLocker locker(&SWHD_mutex);
|
||||
int nn, LL = text.length();
|
||||
if (LL >= versionBufferLen)
|
||||
LL=versionBufferLen-1; // leave place for termination
|
||||
@ -119,7 +111,6 @@ void gpi_storeSWver(QString text)
|
||||
|
||||
QString epi_loadSWver(void)
|
||||
{
|
||||
QMutexLocker locker(&SWHD_mutex);
|
||||
int nn, LL = versionBufferLen;
|
||||
char cc;
|
||||
QString myStr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user