Compare commits
10 Commits
a4afc4ced7
...
91ce1c84d8
Author | SHA1 | Date | |
---|---|---|---|
91ce1c84d8 | |||
dda9e4ad8f | |||
81cba7e615 | |||
b4a6d4a073 | |||
c8d7f2f904 | |||
0dc38d8908 | |||
f28f102ca0 | |||
d04e9ead89 | |||
9a584713e9 | |||
0fca448c53 |
@ -87,6 +87,7 @@ HEADERS += \
|
||||
$${PWD}/include/dcBL.h \
|
||||
$${PWD}/include/hwapi.h \
|
||||
$${PWD}/include/interfaces.h \
|
||||
$${PWD}/include/dynamic-machine-conditions.h \
|
||||
$${PWD}/include/sendWRcmd.h \
|
||||
$${PWD}/include/storeINdata.h \
|
||||
$${PWD}/include/tslib.h \
|
||||
|
@ -1033,8 +1033,7 @@ public:
|
||||
|
||||
void sys_getDeviceConditions(struct T_moduleCondition *devCond) const override;
|
||||
|
||||
void sys_getDynMachineConditions(uint8_t *leng, uint8_t *data) const override;
|
||||
|
||||
void sys_getDynMachineConditions(void *data) const override;
|
||||
void sys_getDynMachineConditions(struct T_dynamicCondition *dynMachCond) const override;
|
||||
|
||||
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#include <QtPlugin>
|
||||
|
||||
|
||||
|
||||
struct T_emp
|
||||
{
|
||||
|
||||
@ -1858,8 +1856,7 @@ public:
|
||||
Q_UNUSED(devCond);
|
||||
}
|
||||
|
||||
virtual void sys_getDynMachineConditions(uint8_t *leng, uint8_t *data) const {
|
||||
Q_UNUSED(leng);
|
||||
virtual void sys_getDynMachineConditions(void *data) const {
|
||||
Q_UNUSED(data);
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <QSharedMemory>
|
||||
#include <QtGlobal>
|
||||
|
||||
#include "interfaces.h"
|
||||
|
||||
bool shdMem_firstUse(void);
|
||||
|
||||
@ -190,8 +191,10 @@ struct SharedMem
|
||||
uint8_t store_deviceCondLen;
|
||||
uint8_t store_deviceCond[66];
|
||||
|
||||
uint8_t store_machCondLen;
|
||||
uint8_t store_machCond[66];
|
||||
// uint8_t store_machCondLen;
|
||||
// uint8_t store_machCond[66];
|
||||
|
||||
struct T_dynamicCondition dynMachCond;
|
||||
|
||||
uint8_t store_DcBackupNrOfAccNr;
|
||||
uint16_t store_DcBackupAccNr[16]; // z.Z. nur 8
|
||||
|
@ -488,10 +488,8 @@ void epi_restoreDeviceConditions(uint8_t *leng, uint8_t *data);
|
||||
|
||||
void epi_clearDynMachineConditions(void); // new, 24.6.23
|
||||
|
||||
void gpi_storeDynMachineConditions(uint8_t leng, uint8_t *data);
|
||||
|
||||
void epi_restoreDynMachineConditions(uint8_t *leng, uint8_t *data);
|
||||
|
||||
void gpi_storeDynMachineConditions(void const *data);
|
||||
void epi_restoreDynMachineConditions(void *data);
|
||||
|
||||
void gpi_storeDCbackupAccNr(uint8_t leng, uint8_t *data);
|
||||
|
||||
|
@ -14,6 +14,7 @@ History:
|
||||
#include <QDir>
|
||||
|
||||
|
||||
#include <algorithm> // min/max
|
||||
|
||||
|
||||
|
||||
@ -1042,9 +1043,19 @@ char T_datif::loadRecDataFromFrame()
|
||||
epi_setDcDataValid(); // DC-Data are valid as DC responded.
|
||||
// Could be set to every response but this (31)
|
||||
// is a very common and very important request
|
||||
gpi_storeDynMachineConditions(RdDleng, receivedData);
|
||||
|
||||
gpi_storeDI_CoinAttach(receivedData[6]); // new, 14.2.24 needed for direct coin insertion
|
||||
if (RdDleng > sizeof(struct T_dynamicCondition)) {
|
||||
qCritical() << "!!!WARNING!!! RdDlen too high" << RdDleng;
|
||||
// only use as many bytes as maximally possible
|
||||
char buf[sizeof(struct T_dynamicCondition)];
|
||||
memset(buf, 0, sizeof(buf));
|
||||
memcpy(buf, receivedData, std::min(sizeof(receivedData), sizeof(struct T_dynamicCondition)));
|
||||
gpi_storeDynMachineConditions(buf);
|
||||
} else {
|
||||
gpi_storeDynMachineConditions(receivedData);
|
||||
}
|
||||
|
||||
gpi_storeDI_CoinAttach(((struct T_dynamicCondition *)receivedData)->coinAttached); // new, 14.2.24 needed for direct coin insertion
|
||||
|
||||
}
|
||||
/* funktioniert, ist aber nicht nötig. Signal wird nach dem shared memory erzeugt
|
||||
|
@ -3229,29 +3229,14 @@ void hwapi::sys_getDeviceConditions(struct T_moduleCondition *devCond) const
|
||||
|
||||
|
||||
|
||||
void hwapi::sys_getDynMachineConditions(uint8_t *leng, uint8_t *data) const
|
||||
void hwapi::sys_getDynMachineConditions(void *data) const
|
||||
{
|
||||
epi_restoreDynMachineConditions(leng, data);
|
||||
epi_restoreDynMachineConditions(data);
|
||||
}
|
||||
|
||||
void hwapi::sys_getDynMachineConditions(struct T_dynamicCondition *dynMachCond) const
|
||||
{
|
||||
|
||||
uint16_t LL, nn;
|
||||
char *start;
|
||||
uint8_t buf[70], leng;
|
||||
|
||||
epi_restoreDynMachineConditions(&leng, buf);
|
||||
// Puffer in struct eintragen:
|
||||
LL=sizeof(struct T_dynamicCondition);
|
||||
start = &dynMachCond->allDoorsDebounced;
|
||||
nn=0;
|
||||
do
|
||||
{
|
||||
*start = buf[nn];
|
||||
start++;
|
||||
} while(++nn<LL);
|
||||
|
||||
epi_restoreDynMachineConditions(dynMachCond);
|
||||
}
|
||||
|
||||
|
||||
@ -3288,19 +3273,15 @@ uint8_t hwapi::prn_getCurrentPrinterState() const
|
||||
// bit4: paper jam in cutter
|
||||
// bit6: no response bit7: serial rec. error
|
||||
// bit5: printer not ready
|
||||
|
||||
|
||||
uint8_t lastPrinterStatus;
|
||||
uint8_t buf[70], leng;
|
||||
struct T_dynamicCondition dynCond;
|
||||
memset(&dynCond, 0, sizeof(dynCond));
|
||||
|
||||
if (!epi_areDcDataValid()) // was set to 0 with print command
|
||||
return 0x40; // no response
|
||||
|
||||
// 2nd way to get dyn.conditions:
|
||||
epi_restoreDynMachineConditions(&leng, buf);
|
||||
lastPrinterStatus=buf[52];
|
||||
|
||||
return lastPrinterStatus;
|
||||
epi_restoreDynMachineConditions(&dynCond);
|
||||
return dynCond.lastPrinterStatus;
|
||||
|
||||
// oder mit:
|
||||
//struct T_dynamicCondition myDynMachCond;
|
||||
|
@ -400,22 +400,7 @@ void T_runProc::changer_getAllParameters(struct T_changer *mw)
|
||||
|
||||
void T_runProc::sub_getDynMachineConditions(struct T_dynamicCondition *dynMachCond)
|
||||
{
|
||||
|
||||
uint16_t LL, nn;
|
||||
char *start;
|
||||
uint8_t buf[70], leng;
|
||||
|
||||
epi_restoreDynMachineConditions(&leng, buf);
|
||||
// Puffer in struct eintragen:
|
||||
LL=sizeof(struct T_dynamicCondition);
|
||||
start = &dynMachCond->allDoorsDebounced;
|
||||
nn=0;
|
||||
do
|
||||
{
|
||||
*start = buf[nn];
|
||||
start++;
|
||||
} while(++nn<LL);
|
||||
|
||||
epi_restoreDynMachineConditions(dynMachCond);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
#include "shared_mem_buffer.h"
|
||||
#include "datei.h"
|
||||
|
||||
#include "interfaces.h" // #include "dynamic-machine-conditions.h"
|
||||
|
||||
// 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)
|
||||
|
||||
@ -1932,32 +1934,17 @@ void epi_restoreDeviceConditions(uint8_t *leng, uint8_t *data)
|
||||
|
||||
void epi_clearDynMachineConditions(void)
|
||||
{
|
||||
uint8_t nn;
|
||||
SharedMem::write()->store_machCondLen=0;
|
||||
for (nn=0; nn<64; nn++)
|
||||
SharedMem::write()->store_machCond[nn] = 0;
|
||||
memset(&SharedMem::write()->dynMachCond, 0, sizeof(struct T_dynamicCondition));
|
||||
}
|
||||
|
||||
|
||||
void gpi_storeDynMachineConditions(uint8_t leng, uint8_t *data)
|
||||
void gpi_storeDynMachineConditions(void const *data)
|
||||
{
|
||||
uint8_t nn;
|
||||
if (leng>64) leng=64;
|
||||
SharedMem::write()->store_machCondLen=leng;
|
||||
// tslib_strcpy(data, SharedMem::write()->store_machCond, leng);
|
||||
for (nn=0; nn<leng; nn++)
|
||||
SharedMem::write()->store_machCond[nn] = data[nn];
|
||||
SharedMem::write()->dynMachCond = *(struct T_dynamicCondition const *)(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void epi_restoreDynMachineConditions(uint8_t *leng, uint8_t *data)
|
||||
void epi_restoreDynMachineConditions(void *data)
|
||||
{
|
||||
uint8_t nn, LL;
|
||||
LL=SharedMem::read()->store_machCondLen;
|
||||
*leng=LL;
|
||||
//tslib_strcpy(SharedMem::read()->store_machCond, data, SharedMem::read()->store_machCondLen);
|
||||
for (nn=0; nn<LL; nn++)
|
||||
data[nn] = SharedMem::read()->store_machCond[nn];
|
||||
*(struct T_dynamicCondition *)(data) = SharedMem::read()->dynMachCond;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user