Compare commits
No commits in common. "2efdbe2d68a627437b8f5be26d474f772feae2ef" and "f0762e272f69399dff62f68bbcb6149024ebe126" have entirely different histories.
2efdbe2d68
...
f0762e272f
@ -91,8 +91,6 @@ PLUGIN_STATE ATBVMCPlugin::initVMCPlugin(QObject *appControl,
|
|||||||
connect(m_vmc, SIGNAL(setMachineNr(QString)), hmiConfig, SLOT(setMachineNr(QString)), Qt::QueuedConnection);
|
connect(m_vmc, SIGNAL(setMachineNr(QString)), hmiConfig, SLOT(setMachineNr(QString)), Qt::QueuedConnection);
|
||||||
connect(m_vmc, SIGNAL(setDefaultLanguage(quint8)), hmiConfig, SLOT(setDefaultLanguage(quint8)), Qt::QueuedConnection);
|
connect(m_vmc, SIGNAL(setDefaultLanguage(quint8)), hmiConfig, SLOT(setDefaultLanguage(quint8)), Qt::QueuedConnection);
|
||||||
|
|
||||||
connect(m_vmc, SIGNAL(wakeVMC()), m_vmc, SLOT(onWakeVMC()), Qt::QueuedConnection);
|
|
||||||
|
|
||||||
return PLUGIN_STATE::INITIALIZED;
|
return PLUGIN_STATE::INITIALIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,6 +110,8 @@ QString const &ATBVMCPlugin::getLastErrorDescription() {
|
|||||||
return m_errorDescription;
|
return m_errorDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// helpers e.g. for debug / log
|
// helpers e.g. for debug / log
|
||||||
QString const &ATBVMCPlugin::getString(RESULT_STATE resultState) {
|
QString const &ATBVMCPlugin::getString(RESULT_STATE resultState) {
|
||||||
static QString str;
|
static QString str;
|
||||||
@ -135,15 +135,6 @@ QString const &ATBVMCPlugin::getString(RESULT_STATE resultState) {
|
|||||||
case RESULT_STATE::INFO:
|
case RESULT_STATE::INFO:
|
||||||
str = QString("RESULT_STATE::INFO");
|
str = QString("RESULT_STATE::INFO");
|
||||||
break;
|
break;
|
||||||
case RESULT_STATE::ERROR_NETWORK:
|
|
||||||
str = QString("RESULT_STATE::ERROR_NETWORK");
|
|
||||||
break;
|
|
||||||
case RESULT_STATE::ERROR_BUSY:
|
|
||||||
str = QString("RESULT_STATE::ERROR_BUSY");
|
|
||||||
break;
|
|
||||||
case RESULT_STATE::ERROR_STATE:
|
|
||||||
str = QString("RESULT_STATE::ERROR_STATE");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
@ -13,13 +13,6 @@
|
|||||||
VMC::VMC(QObject *appControl, QSettings const *settings,
|
VMC::VMC(QObject *appControl, QSettings const *settings,
|
||||||
QObject *parent)
|
QObject *parent)
|
||||||
: QObject(parent) {
|
: QObject(parent) {
|
||||||
|
|
||||||
this->REMOTE_OUT_gpio_outstream = nullptr;
|
|
||||||
this->REMOTE_OUT_gpio = nullptr;
|
|
||||||
this->sendBuffer = nullptr;
|
|
||||||
this->receiveBuffer = nullptr;
|
|
||||||
this->com_interface = nullptr;
|
|
||||||
|
|
||||||
this->flag_blockVMCScreen = 0;
|
this->flag_blockVMCScreen = 0;
|
||||||
this->currentCachedScreen = VMC_CMD_SCREEN_START;
|
this->currentCachedScreen = VMC_CMD_SCREEN_START;
|
||||||
|
|
||||||
@ -30,8 +23,6 @@ VMC::VMC(QObject *appControl, QSettings const *settings,
|
|||||||
this->receiveBuffer = new ReceiveBuffer(com_interface, this);
|
this->receiveBuffer = new ReceiveBuffer(com_interface, this);
|
||||||
this->sendBuffer = new SendBuffer(com_interface, this);
|
this->sendBuffer = new SendBuffer(com_interface, this);
|
||||||
|
|
||||||
this->privateInit_REMOTE_OUT();
|
|
||||||
|
|
||||||
connect(receiveBuffer, SIGNAL(ReceiveResponse(quint8)), sendBuffer, SLOT(onReceiveResponse(quint8)));
|
connect(receiveBuffer, SIGNAL(ReceiveResponse(quint8)), sendBuffer, SLOT(onReceiveResponse(quint8)));
|
||||||
|
|
||||||
com_interface->open(settings->value("VMC/serialPort", "ttymxc2").toString(),
|
com_interface->open(settings->value("VMC/serialPort", "ttymxc2").toString(),
|
||||||
@ -50,59 +41,11 @@ VMC::VMC(QObject *appControl, QSettings const *settings,
|
|||||||
|
|
||||||
|
|
||||||
VMC::~VMC() {
|
VMC::~VMC() {
|
||||||
if (this->REMOTE_OUT_gpio_outstream) {
|
delete(this->sendBuffer);
|
||||||
delete(this->REMOTE_OUT_gpio_outstream);
|
delete(this->receiveBuffer);
|
||||||
}
|
delete(this->com_interface);
|
||||||
if (this->REMOTE_OUT_gpio) {
|
|
||||||
delete(this->REMOTE_OUT_gpio);
|
|
||||||
}
|
|
||||||
if (this->sendBuffer) {
|
|
||||||
delete(this->sendBuffer);
|
|
||||||
}
|
|
||||||
if (this->receiveBuffer) {
|
|
||||||
delete(this->receiveBuffer);
|
|
||||||
}
|
|
||||||
if (this->com_interface) {
|
|
||||||
delete(this->com_interface);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
* functions for wake vmc
|
|
||||||
*/
|
|
||||||
|
|
||||||
void VMC::onWakeVMC() {
|
|
||||||
this->privateWakeVMC();
|
|
||||||
}
|
|
||||||
|
|
||||||
void VMC::privateWakeVMC() {
|
|
||||||
QTimer::singleShot (100, this, SLOT(privateSuspendVMC()));
|
|
||||||
this->privateSet_REMOTE_OUT(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void VMC::privateSuspendVMC() {
|
|
||||||
this->privateSet_REMOTE_OUT(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void VMC::privateSet_REMOTE_OUT(bool state) {
|
|
||||||
if (state) { *(this->REMOTE_OUT_gpio_outstream) << "1"; }
|
|
||||||
else { *(this->REMOTE_OUT_gpio_outstream) << "0"; }
|
|
||||||
|
|
||||||
this->REMOTE_OUT_gpio_outstream->flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
void VMC::privateInit_REMOTE_OUT() {
|
|
||||||
QString sysfs_remout_out("/sys/class/leds/REMOTE_OUT/brightness");
|
|
||||||
|
|
||||||
this->REMOTE_OUT_gpio = new QFile(sysfs_remout_out);
|
|
||||||
if (!REMOTE_OUT_gpio->open(QIODevice::WriteOnly | QIODevice::Text)) {
|
|
||||||
qDebug() << "ATB_system::privateInit_REMOTE_OUT() cannot open file: " << sysfs_remout_out;
|
|
||||||
qDebug() << " file.errorString() = " << REMOTE_OUT_gpio->errorString();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this->REMOTE_OUT_gpio_outstream = new QTextStream(this->REMOTE_OUT_gpio);
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* S E N D M E S S A G E S t o V M C
|
* S E N D M E S S A G E S t o V M C
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QFile>
|
|
||||||
#include <QTextStream>
|
|
||||||
|
|
||||||
|
|
||||||
#define VMC_RECEIVE_TIMEOUT 1000
|
#define VMC_RECEIVE_TIMEOUT 1000
|
||||||
@ -149,8 +147,11 @@ class SendBuffer;
|
|||||||
using FormatedStringList = QList<QByteArray>;
|
using FormatedStringList = QList<QByteArray>;
|
||||||
|
|
||||||
|
|
||||||
class VMC : public QObject {
|
class VMC : public QObject
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QObject *m_appControl;
|
QObject *m_appControl;
|
||||||
COM_interface *com_interface;
|
COM_interface *com_interface;
|
||||||
@ -158,9 +159,6 @@ private:
|
|||||||
SendBuffer *sendBuffer;
|
SendBuffer *sendBuffer;
|
||||||
QSettings const *m_settings;
|
QSettings const *m_settings;
|
||||||
|
|
||||||
QFile *REMOTE_OUT_gpio;
|
|
||||||
QTextStream *REMOTE_OUT_gpio_outstream;
|
|
||||||
|
|
||||||
// internal: write a ByteArray to com-port:
|
// internal: write a ByteArray to com-port:
|
||||||
int SendMessage(QByteArray ba, bool enqueue = false);
|
int SendMessage(QByteArray ba, bool enqueue = false);
|
||||||
|
|
||||||
@ -187,14 +185,10 @@ private:
|
|||||||
quint8 flag_blockVMCScreen;
|
quint8 flag_blockVMCScreen;
|
||||||
quint16 currentCachedScreen;
|
quint16 currentCachedScreen;
|
||||||
|
|
||||||
void privateInit_REMOTE_OUT();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onDelayedMessageTimerTimeout();
|
void onDelayedMessageTimerTimeout();
|
||||||
|
|
||||||
void skipDiscount();
|
void skipDiscount();
|
||||||
void privateSet_REMOTE_OUT(bool state);
|
|
||||||
void privateWakeVMC();
|
|
||||||
void privateSuspendVMC();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit VMC(QObject *eventReceiver, QSettings const *settings,
|
explicit VMC(QObject *eventReceiver, QSettings const *settings,
|
||||||
@ -393,8 +387,6 @@ public slots:
|
|||||||
void ccStartTransactionRequest(); // called to start/restart a CC transaction
|
void ccStartTransactionRequest(); // called to start/restart a CC transaction
|
||||||
void ccStartConfirmTransaction(); // called to start confirmation
|
void ccStartConfirmTransaction(); // called to start confirmation
|
||||||
void ccPrintReceipt(QString receipt); // called to send receipt to vmc
|
void ccPrintReceipt(QString receipt); // called to send receipt to vmc
|
||||||
|
|
||||||
void onWakeVMC();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VMC_H
|
#endif // VMC_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user