Compare commits
22 Commits
1.99.0
...
fix-dynami
Author | SHA1 | Date | |
---|---|---|---|
91ce1c84d8 | |||
dda9e4ad8f | |||
81cba7e615 | |||
b4a6d4a073 | |||
c8d7f2f904 | |||
0dc38d8908 | |||
f28f102ca0 | |||
d04e9ead89 | |||
9a584713e9 | |||
0fca448c53 | |||
a4afc4ced7 | |||
06d43009ad
|
|||
bed98c2c0e
|
|||
f6cc40c8f9
|
|||
6be24fe9ff | |||
3612fc28ee | |||
c59de6cad8 | |||
4b0e8ec5f6
|
|||
3486c4ccaf | |||
ea462ba5c8 | |||
961fc6b5dc | |||
6f920604b7 |
@@ -87,6 +87,7 @@ HEADERS += \
|
|||||||
$${PWD}/include/dcBL.h \
|
$${PWD}/include/dcBL.h \
|
||||||
$${PWD}/include/hwapi.h \
|
$${PWD}/include/hwapi.h \
|
||||||
$${PWD}/include/interfaces.h \
|
$${PWD}/include/interfaces.h \
|
||||||
|
$${PWD}/include/dynamic-machine-conditions.h \
|
||||||
$${PWD}/include/sendWRcmd.h \
|
$${PWD}/include/sendWRcmd.h \
|
||||||
$${PWD}/include/storeINdata.h \
|
$${PWD}/include/storeINdata.h \
|
||||||
$${PWD}/include/tslib.h \
|
$${PWD}/include/tslib.h \
|
||||||
|
84
include/dynamic-machine-conditions.h
Normal file
84
include/dynamic-machine-conditions.h
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
#ifndef DYNAMIC_MACHINE_CONDITIONS_H_INCLUDED
|
||||||
|
#define DYNAMIC_MACHINE_CONDITIONS_H_INCLUDED
|
||||||
|
|
||||||
|
struct T_dynamicCondition
|
||||||
|
{
|
||||||
|
char allDoorsDebounced;
|
||||||
|
char openedAuthorized;
|
||||||
|
uint8_t CBinDebounced; // 0:fehlt 1:drin
|
||||||
|
char upperDoor; // 99: undefined 0:closed 1:open
|
||||||
|
char middleDoor; // 99: undefined 0:closed 1:open
|
||||||
|
char lowerDoor; // 99: undefined 0:closed 1:open
|
||||||
|
char coinAttached;
|
||||||
|
char billBox;
|
||||||
|
char modeAbrech;
|
||||||
|
char onAlarm; // 0:alarm aus 1:alarm 2:alarm mit Sirene 3: Sirenentest
|
||||||
|
char nowCardTest;
|
||||||
|
char nowPayment; // not used, always 0
|
||||||
|
char lastMifCardType;
|
||||||
|
uint8_t lastSDoorState;
|
||||||
|
uint8_t lastVDoorState;
|
||||||
|
uint8_t lastCBstate;
|
||||||
|
char paymentInProgress;
|
||||||
|
// Version Szeged: aug2023
|
||||||
|
// 0: stopped by timeout
|
||||||
|
// 1: running 2: wait4lastCoin
|
||||||
|
// 3: payment stopped manually, coins in Escrow
|
||||||
|
// 4: payment stopped autom, amount collected, coins in Escrow
|
||||||
|
// 5: payment stopped, escrow full, coins in Escrow
|
||||||
|
// 6: coins encashed 7:coins returned
|
||||||
|
// 8: CoinChecker or MDB on Error
|
||||||
|
|
||||||
|
// since Schoenau with bill and changer, nov2023
|
||||||
|
//0 = no payment
|
||||||
|
//will be set to 1 by cash_startCollection()
|
||||||
|
//neu 1: wait for devices getting ready for payment
|
||||||
|
//2 = payment,
|
||||||
|
//3 = wait for last coin/bill
|
||||||
|
//4 = Bezahlvorgang manuell beendet
|
||||||
|
//5 = payment stopped autom, amount collected, coins in Escrow
|
||||||
|
//6 = Bezahlvorgang beendet weil ZK voll
|
||||||
|
//4,5,6: payment done, keep on polling, wait for cash or return command
|
||||||
|
//7 = encash collected money from coin escrow into cash box
|
||||||
|
//8 = return "amountToReturn", can be complete inserted amount or only overpayment
|
||||||
|
//9 = wait for changer result
|
||||||
|
//10= print refund receipt with "amountToReturn"
|
||||||
|
|
||||||
|
char res1;
|
||||||
|
uint16_t U_Batt;
|
||||||
|
uint16_t Temperatur;
|
||||||
|
uint16_t nrCoinsInBox;
|
||||||
|
uint32_t amountInBox;
|
||||||
|
uint32_t totalTransVolume;
|
||||||
|
uint32_t totalNrOfVends;
|
||||||
|
char jsonValid_config;
|
||||||
|
char jsonValid_device;
|
||||||
|
char jsonValid_cash;
|
||||||
|
char jsonValid_print;
|
||||||
|
// 40
|
||||||
|
char jsonValid_serial;
|
||||||
|
char jsonValid_time;
|
||||||
|
char lastFileType;
|
||||||
|
uint8_t MifCardHolder[8];
|
||||||
|
uint8_t resultOfLastTemplPrint;
|
||||||
|
// 0: unknown or printing in progress
|
||||||
|
// 1: OK, doc was printed 2: error, doc was not printed
|
||||||
|
uint8_t lastPrinterStatus;
|
||||||
|
// 0: printer OK
|
||||||
|
// bit0: near paper end bit1: no paper
|
||||||
|
// bit2: temperature error bit3: error head open
|
||||||
|
// bit4: paper jam in cutter
|
||||||
|
// bit6: no response bit7: serial rec. error
|
||||||
|
// bit5: printer not ready
|
||||||
|
uint8_t startupTestIsRunning;
|
||||||
|
|
||||||
|
uint8_t padd01;
|
||||||
|
uint8_t padd02;
|
||||||
|
uint8_t padd03;
|
||||||
|
uint32_t padd04;
|
||||||
|
uint32_t padd05;
|
||||||
|
uint32_t padd06;
|
||||||
|
uint16_t padd07;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DYNAMIC_MACHINE_CONDITIONS_H_INCLUDED
|
@@ -1033,8 +1033,7 @@ public:
|
|||||||
|
|
||||||
void sys_getDeviceConditions(struct T_moduleCondition *devCond) const override;
|
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;
|
void sys_getDynMachineConditions(struct T_dynamicCondition *dynMachCond) const override;
|
||||||
|
|
||||||
|
|
||||||
@@ -1318,6 +1317,10 @@ public:
|
|||||||
// countOfBills: array of up to 16 sums, countOfBills[0]=nr of 5€-bills in stacker
|
// countOfBills: array of up to 16 sums, countOfBills[0]=nr of 5€-bills in stacker
|
||||||
// countOfBills[1] for 10€ and so on
|
// countOfBills[1] for 10€ and so on
|
||||||
|
|
||||||
|
bool cash_isCollectionStarted(void) const override;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// download device controller
|
// download device controller
|
||||||
bool dcDownloadRequest(QString const &fileToDownload) const override;
|
bool dcDownloadRequest(QString const &fileToDownload) const override;
|
||||||
bool dcDownloadRequested() const override;
|
bool dcDownloadRequested() const override;
|
||||||
@@ -1355,9 +1358,9 @@ public:
|
|||||||
virtual QObject const *getAPI() override;
|
virtual QObject const *getAPI() override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void hwapi_reportDCDownloadStatus(QString const&) const;
|
void hwapi_reportDCDownloadStatus(QString const&) const override;
|
||||||
void hwapi_reportDCDownloadSuccess(QString const&) const;
|
void hwapi_reportDCDownloadSuccess(QString const&) const override;
|
||||||
void hwapi_reportDCDownloadFailure(QString const&) const;
|
void hwapi_reportDCDownloadFailure(QString const&) const override;
|
||||||
|
|
||||||
void hwapi_templatePrintFinished_OK(void) const override;
|
void hwapi_templatePrintFinished_OK(void) const override;
|
||||||
void hwapi_templatePrintFinished_Err(void) const override;
|
void hwapi_templatePrintFinished_Err(void) const override;
|
||||||
|
@@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct T_emp
|
struct T_emp
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -170,6 +168,7 @@ struct T_vaultRecord
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ATTENTION: struct length must be 64 exactly!!!
|
||||||
struct T_moduleCondition
|
struct T_moduleCondition
|
||||||
{
|
{
|
||||||
// store conditon of all system components, hold in RAM
|
// store conditon of all system components, hold in RAM
|
||||||
@@ -182,44 +181,53 @@ struct T_moduleCondition
|
|||||||
uint8_t ram;
|
uint8_t ram;
|
||||||
uint8_t intEe;
|
uint8_t intEe;
|
||||||
uint8_t extEe;
|
uint8_t extEe;
|
||||||
|
|
||||||
uint8_t rtc; // 1: time/date OK 100: time not plausible 200: hardware error
|
uint8_t rtc; // 1: time/date OK 100: time not plausible 200: hardware error
|
||||||
uint8_t boardHw;
|
uint8_t boardHw;
|
||||||
uint8_t printer;
|
uint8_t printer;
|
||||||
uint8_t modem;
|
uint8_t modem;
|
||||||
|
|
||||||
uint8_t signal; // 1...99
|
uint8_t signal; // 1...99
|
||||||
uint8_t regist; // 100:not 1:reg 2:ping OK 3:gotTime
|
uint8_t regist; // 100:not 1:reg 2:ping OK 3:gotTime
|
||||||
uint8_t mdbBus;
|
uint8_t mdbBus;
|
||||||
|
// 10
|
||||||
uint8_t coinChecker; // EMP, OMP or mei-cashflow
|
uint8_t coinChecker; // EMP, OMP or mei-cashflow
|
||||||
|
|
||||||
uint8_t coinEscrow;
|
uint8_t coinEscrow;
|
||||||
uint8_t mifareReader; // 0: unknown 1=OK 200=no response 201=wrong response 202: Reader reports HW-error
|
uint8_t mifareReader; // 0: unknown 1=OK 200=no response 201=wrong response 202: Reader reports HW-error
|
||||||
uint8_t creditTerm;
|
uint8_t creditTerm;
|
||||||
uint8_t coinReject;
|
uint8_t coinReject;
|
||||||
|
|
||||||
uint8_t coinSafe;
|
uint8_t coinSafe;
|
||||||
uint8_t billSafe;
|
uint8_t billSafe;
|
||||||
uint8_t voltage; // 1:11..14V
|
uint8_t voltage; // 1:11..14V
|
||||||
uint8_t temper;
|
uint8_t temper;
|
||||||
|
|
||||||
uint8_t poweronTest;
|
uint8_t poweronTest;
|
||||||
|
// 20
|
||||||
uint8_t doorState; // 1: alles zu 200: tuer offen + bit1(S) +bit2(CB) + bit3(CB)
|
uint8_t doorState; // 1: alles zu 200: tuer offen + bit1(S) +bit2(CB) + bit3(CB)
|
||||||
uint8_t doorWasOpened; // 1: all doors are closed 200: any door was just opened
|
uint8_t doorWasOpened; // 1: all doors are closed 200: any door was just opened
|
||||||
uint8_t changer; // can only be tested by usage
|
uint8_t changer; // can only be tested by usage
|
||||||
|
|
||||||
uint8_t coinBlocker; // can only be tested by usage
|
uint8_t coinBlocker; // can only be tested by usage
|
||||||
uint8_t billReader; // can only be tested by usage
|
uint8_t billReader; // can only be tested by usage
|
||||||
uint8_t ResetReason;
|
uint8_t ResetReason;
|
||||||
uint8_t allModulesChecked;
|
uint8_t allModulesChecked;
|
||||||
|
|
||||||
uint8_t alarmState;
|
uint8_t alarmState;
|
||||||
uint8_t res11;
|
uint8_t res11;
|
||||||
uint8_t res12;
|
uint8_t res12;
|
||||||
|
// 30
|
||||||
uint8_t res13;
|
uint8_t res13;
|
||||||
// 31
|
uint8_t padd01;
|
||||||
|
uint8_t padd02;
|
||||||
|
uint8_t padd03;
|
||||||
|
uint32_t padd04;
|
||||||
|
uint32_t padd05;
|
||||||
|
uint32_t padd06;
|
||||||
|
uint32_t padd07;
|
||||||
|
// 50
|
||||||
|
uint32_t padd08;
|
||||||
|
uint32_t padd09;
|
||||||
|
uint32_t padd10;
|
||||||
|
uint16_t padd11;
|
||||||
|
// 64
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ATTENTION: struct length must be 64 exactly!!!
|
||||||
struct T_dynamicCondition
|
struct T_dynamicCondition
|
||||||
{
|
{
|
||||||
char allDoorsDebounced;
|
char allDoorsDebounced;
|
||||||
@@ -228,10 +236,11 @@ struct T_dynamicCondition
|
|||||||
char upperDoor; // 99: undefined 0:closed 1:open
|
char upperDoor; // 99: undefined 0:closed 1:open
|
||||||
char middleDoor; // 99: undefined 0:closed 1:open
|
char middleDoor; // 99: undefined 0:closed 1:open
|
||||||
char lowerDoor; // 99: undefined 0:closed 1:open
|
char lowerDoor; // 99: undefined 0:closed 1:open
|
||||||
char reserve;
|
char coinAttached;
|
||||||
char billBox;
|
char billBox;
|
||||||
char modeAbrech;
|
char modeAbrech;
|
||||||
char onAlarm; // 0:alarm aus 1:alarm 2:alarm mit Sirene 3: Sirenentest
|
char onAlarm; // 0:alarm aus 1:alarm 2:alarm mit Sirene 3: Sirenentest
|
||||||
|
// 10
|
||||||
char nowCardTest;
|
char nowCardTest;
|
||||||
char nowPayment; // not used, always 0
|
char nowPayment; // not used, always 0
|
||||||
char lastMifCardType;
|
char lastMifCardType;
|
||||||
@@ -266,6 +275,7 @@ struct T_dynamicCondition
|
|||||||
|
|
||||||
char res1;
|
char res1;
|
||||||
uint16_t U_Batt;
|
uint16_t U_Batt;
|
||||||
|
// 20
|
||||||
uint16_t Temperatur;
|
uint16_t Temperatur;
|
||||||
uint16_t nrCoinsInBox;
|
uint16_t nrCoinsInBox;
|
||||||
uint32_t amountInBox;
|
uint32_t amountInBox;
|
||||||
@@ -275,10 +285,10 @@ struct T_dynamicCondition
|
|||||||
char jsonValid_device;
|
char jsonValid_device;
|
||||||
char jsonValid_cash;
|
char jsonValid_cash;
|
||||||
char jsonValid_print;
|
char jsonValid_print;
|
||||||
|
// 40
|
||||||
char jsonValid_serial;
|
char jsonValid_serial;
|
||||||
char jsonValid_time;
|
char jsonValid_time;
|
||||||
char lastFileType;
|
char lastFileType;
|
||||||
// 44
|
|
||||||
uint8_t MifCardHolder[8];
|
uint8_t MifCardHolder[8];
|
||||||
uint8_t resultOfLastTemplPrint;
|
uint8_t resultOfLastTemplPrint;
|
||||||
// 0: unknown or printing in progress
|
// 0: unknown or printing in progress
|
||||||
@@ -292,7 +302,15 @@ struct T_dynamicCondition
|
|||||||
// bit5: printer not ready
|
// bit5: printer not ready
|
||||||
uint8_t startupTestIsRunning;
|
uint8_t startupTestIsRunning;
|
||||||
|
|
||||||
//54
|
uint8_t padd01;
|
||||||
|
uint8_t padd02;
|
||||||
|
uint8_t padd03;
|
||||||
|
//50
|
||||||
|
uint32_t padd04;
|
||||||
|
uint32_t padd05;
|
||||||
|
uint32_t padd06;
|
||||||
|
uint16_t padd07;
|
||||||
|
// 64
|
||||||
};
|
};
|
||||||
|
|
||||||
struct T_extTime
|
struct T_extTime
|
||||||
@@ -329,6 +347,7 @@ struct T_extTime
|
|||||||
typedef uint8_t UCHAR;
|
typedef uint8_t UCHAR;
|
||||||
typedef uint16_t UINT;
|
typedef uint16_t UINT;
|
||||||
|
|
||||||
|
// ATTENTION: struct length must be 64 exactly!!!
|
||||||
struct T_devices
|
struct T_devices
|
||||||
{
|
{
|
||||||
// set by master, used(1) or notused (0) or type 2....20
|
// set by master, used(1) or notused (0) or type 2....20
|
||||||
@@ -337,27 +356,33 @@ struct T_devices
|
|||||||
UCHAR kindOfCoinChecker; // 0: without 1=EMP820 2=EMP900 3=currenza Csquare (MW)
|
UCHAR kindOfCoinChecker; // 0: without 1=EMP820 2=EMP900 3=currenza Csquare (MW)
|
||||||
UCHAR kindOfMifareReader; // by now only stronglink SL025 =1
|
UCHAR kindOfMifareReader; // by now only stronglink SL025 =1
|
||||||
UCHAR solarPower; // 1:sleep allowed 0: no sleep
|
UCHAR solarPower; // 1:sleep allowed 0: no sleep
|
||||||
//UCHAR suppressSleepMode; // 0:sleep allowed 1: no sleep
|
|
||||||
|
|
||||||
UCHAR kindOfModem; // 0:off 1:Sunlink
|
UCHAR kindOfModem; // 0:off 1:Sunlink
|
||||||
UCHAR kindOfCreditcard; // 0:off 1:Feig NFC
|
UCHAR kindOfCreditcard; // 0:off 1:Feig NFC
|
||||||
UCHAR CoinEscrow;
|
UCHAR CoinEscrow;
|
||||||
UCHAR CoinRejectUnit;
|
UCHAR CoinRejectUnit;
|
||||||
|
|
||||||
UCHAR CoinShutter;
|
UCHAR CoinShutter;
|
||||||
UCHAR BillAcceptor;
|
UCHAR BillAcceptor;
|
||||||
|
// 10
|
||||||
UCHAR usevaultLock;
|
UCHAR usevaultLock;
|
||||||
UCHAR autoAlarm; // 1: switch on siren for 1min in doors opened unauthorized
|
UCHAR autoAlarm; // 1: switch on siren for 1min in doors opened unauthorized
|
||||||
|
|
||||||
UCHAR autoOpen; // 1: open door covers after valid ATBcard
|
UCHAR autoOpen; // 1: open door covers after valid ATBcard
|
||||||
UCHAR printAccReceipt; // 0/1
|
UCHAR printAccReceipt; // 0/1
|
||||||
UCHAR printDoorReceipt;
|
UCHAR printDoorReceipt;
|
||||||
UCHAR printTokenTicket;
|
UCHAR printTokenTicket;
|
||||||
|
|
||||||
UINT VaultFullWarnLevel;
|
UINT VaultFullWarnLevel;
|
||||||
UINT VaultFullErrorLevel;
|
UINT VaultFullErrorLevel;
|
||||||
|
// 30
|
||||||
UINT BattEmptyWarnLevel;
|
UINT BattEmptyWarnLevel;
|
||||||
UINT BattEmptyErrorLevel;
|
UINT BattEmptyErrorLevel;
|
||||||
|
uint32_t padd01;
|
||||||
|
uint32_t padd02;
|
||||||
|
uint32_t padd03;
|
||||||
|
uint32_t padd04;
|
||||||
|
uint32_t padd05;
|
||||||
|
uint32_t padd06;
|
||||||
|
uint32_t padd07;
|
||||||
|
uint16_t padd08;
|
||||||
|
// 64
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1831,8 +1856,7 @@ public:
|
|||||||
Q_UNUSED(devCond);
|
Q_UNUSED(devCond);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void sys_getDynMachineConditions(uint8_t *leng, uint8_t *data) const {
|
virtual void sys_getDynMachineConditions(void *data) const {
|
||||||
Q_UNUSED(leng);
|
|
||||||
Q_UNUSED(data);
|
Q_UNUSED(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2299,6 +2323,9 @@ public:
|
|||||||
// countOfBills: array of up to 16 sums, countOfBills[0]=nr of 5€-bills in stacker
|
// countOfBills: array of up to 16 sums, countOfBills[0]=nr of 5€-bills in stacker
|
||||||
// countOfBills[1] for 10€ and so on
|
// countOfBills[1] for 10€ and so on
|
||||||
|
|
||||||
|
virtual bool cash_isCollectionStarted(void) const {return false;}
|
||||||
|
// return true is coin collection in DC is running
|
||||||
|
|
||||||
|
|
||||||
// download device controller
|
// download device controller
|
||||||
virtual bool dcDownloadRequest(QString const &fileToDownload) const {
|
virtual bool dcDownloadRequest(QString const &fileToDownload) const {
|
||||||
@@ -2479,10 +2506,12 @@ signals:
|
|||||||
|
|
||||||
// hier dazwischen: Umstellung ALLER Prototypen
|
// hier dazwischen: Umstellung ALLER Prototypen
|
||||||
// hier von =0 auf {} durch Gerhard
|
// hier von =0 auf {} durch Gerhard
|
||||||
|
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/5.2"
|
||||||
#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/5.2"
|
|
||||||
// 7.11.2023: bna functions activated
|
// 7.11.2023: bna functions activated
|
||||||
|
#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/5.3"
|
||||||
|
// 14.3.24:new function bool hwapi::cash_isCollectionStarted(void) const
|
||||||
|
// padding three struct to 64 byte to avoid stack overflow when using
|
||||||
|
// signal coin attached is much faster now
|
||||||
|
|
||||||
Q_DECLARE_INTERFACE(hwinf, HWINF_iid)
|
Q_DECLARE_INTERFACE(hwinf, HWINF_iid)
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include <QSharedMemory>
|
#include <QSharedMemory>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
|
#include "interfaces.h"
|
||||||
|
|
||||||
bool shdMem_firstUse(void);
|
bool shdMem_firstUse(void);
|
||||||
|
|
||||||
@@ -190,8 +191,10 @@ struct SharedMem
|
|||||||
uint8_t store_deviceCondLen;
|
uint8_t store_deviceCondLen;
|
||||||
uint8_t store_deviceCond[66];
|
uint8_t store_deviceCond[66];
|
||||||
|
|
||||||
uint8_t store_machCondLen;
|
// uint8_t store_machCondLen;
|
||||||
uint8_t store_machCond[66];
|
// uint8_t store_machCond[66];
|
||||||
|
|
||||||
|
struct T_dynamicCondition dynMachCond;
|
||||||
|
|
||||||
uint8_t store_DcBackupNrOfAccNr;
|
uint8_t store_DcBackupNrOfAccNr;
|
||||||
uint16_t store_DcBackupAccNr[16]; // z.Z. nur 8
|
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 epi_clearDynMachineConditions(void); // new, 24.6.23
|
||||||
|
|
||||||
void gpi_storeDynMachineConditions(uint8_t leng, uint8_t *data);
|
void gpi_storeDynMachineConditions(void const *data);
|
||||||
|
void epi_restoreDynMachineConditions(void *data);
|
||||||
void epi_restoreDynMachineConditions(uint8_t *leng, uint8_t *data);
|
|
||||||
|
|
||||||
|
|
||||||
void gpi_storeDCbackupAccNr(uint8_t leng, uint8_t *data);
|
void gpi_storeDCbackupAccNr(uint8_t leng, uint8_t *data);
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@ History:
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
|
|
||||||
|
#include <algorithm> // min/max
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -990,22 +991,24 @@ char T_datif::loadRecDataFromFrame()
|
|||||||
case 112: // get inserted amount in cent in sum
|
case 112: // get inserted amount in cent in sum
|
||||||
// byte 0..3: amount just paid 4,5:last coin type 6,7: last coin value
|
// byte 0..3: amount just paid 4,5:last coin type 6,7: last coin value
|
||||||
newInsertedAmount=uchar2ulong(receivedData[3],receivedData[2],receivedData[1],receivedData[0]);
|
newInsertedAmount=uchar2ulong(receivedData[3],receivedData[2],receivedData[1],receivedData[0]);
|
||||||
uitmp=uchar2uint(receivedData[5],receivedData[4]);
|
uitmp=uchar2uint(receivedData[5],receivedData[4]); // last coin type
|
||||||
uit2=uchar2uint(receivedData[7],receivedData[6]);
|
uit2=uchar2uint(receivedData[7],receivedData[6]); // last coin value
|
||||||
//if (uitmp>0) // nur 1x bei neuer Münze 6.10.23 aendern: beim Wechsler hat die kleinste Muenze immer coin type 0!
|
//if (uitmp>0) // nur 1x bei neuer Münze 6.10.23 aendern:
|
||||||
if (uit2>0)
|
// beim Wechsler hat die kleinste Muenze immer coin type 0!
|
||||||
|
if (uitmp>10000 || uit2>10000)
|
||||||
|
{
|
||||||
|
uitmp=0;
|
||||||
|
uit2=0;
|
||||||
|
}
|
||||||
|
if ((newInsertedAmount != lastInsertedAmount) || uit2>0) // 22.5.2024
|
||||||
{
|
{
|
||||||
gpi_storeCurrentPayment(newInsertedAmount, uitmp, uit2);
|
gpi_storeCurrentPayment(newInsertedAmount, uitmp, uit2);
|
||||||
//void gpi_storeCurrentPayment(uint32_t insertedAmount, uint16_t lastCoinType, uint16_t lastCoinValue)
|
emit datif_gotNewCoin(); // OR BILL if (uitmp & 0x8000)>0
|
||||||
if (newInsertedAmount != lastInsertedAmount)
|
|
||||||
{
|
|
||||||
emit datif_gotNewCoin();
|
|
||||||
//qDebug()<<"emit new coin";
|
//qDebug()<<"emit new coin";
|
||||||
|
|
||||||
lastInsertedAmount=newInsertedAmount;
|
lastInsertedAmount=newInsertedAmount;
|
||||||
|
//qCritical()<<"datif 112 store and emit new coin "<<newInsertedAmount<<" "<<uitmp<<" "<<uit2;
|
||||||
}
|
}
|
||||||
// qDebug()<<"datif store new coin"<<newInsertedAmount<<" "<<uitmp<<" "<<uit2;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 113: // get wake source, 8byte
|
case 113: // get wake source, 8byte
|
||||||
@@ -1040,7 +1043,20 @@ char T_datif::loadRecDataFromFrame()
|
|||||||
epi_setDcDataValid(); // DC-Data are valid as DC responded.
|
epi_setDcDataValid(); // DC-Data are valid as DC responded.
|
||||||
// Could be set to every response but this (31)
|
// Could be set to every response but this (31)
|
||||||
// is a very common and very important request
|
// is a very common and very important request
|
||||||
gpi_storeDynMachineConditions(RdDleng, receivedData);
|
|
||||||
|
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
|
/* funktioniert, ist aber nicht nötig. Signal wird nach dem shared memory erzeugt
|
||||||
prnResult=receivedData[52];
|
prnResult=receivedData[52];
|
||||||
|
@@ -17,6 +17,9 @@
|
|||||||
und hier in hwapi die entprellten Werte fuer Tueren und Kasse verwenden.
|
und hier in hwapi die entprellten Werte fuer Tueren und Kasse verwenden.
|
||||||
Problem war: Signal "Kasse entnommen" war zu langsam -> manchmal abr nicht gesendet
|
Problem war: Signal "Kasse entnommen" war zu langsam -> manchmal abr nicht gesendet
|
||||||
|
|
||||||
|
14.3.24 new function bool hwapi::cash_isCollectionStarted(void) const
|
||||||
|
padding three struct to 64 byte to avoid stack overflow when using
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "hwapi.h"
|
#include "hwapi.h"
|
||||||
@@ -3226,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
|
void hwapi::sys_getDynMachineConditions(struct T_dynamicCondition *dynMachCond) const
|
||||||
{
|
{
|
||||||
|
epi_restoreDynMachineConditions(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);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3285,19 +3273,15 @@ uint8_t hwapi::prn_getCurrentPrinterState() const
|
|||||||
// bit4: paper jam in cutter
|
// bit4: paper jam in cutter
|
||||||
// bit6: no response bit7: serial rec. error
|
// bit6: no response bit7: serial rec. error
|
||||||
// bit5: printer not ready
|
// bit5: printer not ready
|
||||||
|
struct T_dynamicCondition dynCond;
|
||||||
|
memset(&dynCond, 0, sizeof(dynCond));
|
||||||
uint8_t lastPrinterStatus;
|
|
||||||
uint8_t buf[70], leng;
|
|
||||||
|
|
||||||
if (!epi_areDcDataValid()) // was set to 0 with print command
|
if (!epi_areDcDataValid()) // was set to 0 with print command
|
||||||
return 0x40; // no response
|
return 0x40; // no response
|
||||||
|
|
||||||
// 2nd way to get dyn.conditions:
|
// 2nd way to get dyn.conditions:
|
||||||
epi_restoreDynMachineConditions(&leng, buf);
|
epi_restoreDynMachineConditions(&dynCond);
|
||||||
lastPrinterStatus=buf[52];
|
return dynCond.lastPrinterStatus;
|
||||||
|
|
||||||
return lastPrinterStatus;
|
|
||||||
|
|
||||||
// oder mit:
|
// oder mit:
|
||||||
//struct T_dynamicCondition myDynMachCond;
|
//struct T_dynamicCondition myDynMachCond;
|
||||||
@@ -4402,6 +4386,17 @@ uint16_t hwapi::bna_getStackerLevel(uint32_t *amountInStacker, uint16_t *countOf
|
|||||||
return anzahl;
|
return anzahl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// new, 14.3.24TS
|
||||||
|
bool hwapi::cash_isCollectionStarted(void) const
|
||||||
|
{
|
||||||
|
struct T_dynamicCondition myDynMachCond;
|
||||||
|
sys_getDynMachineConditions(&myDynMachCond);
|
||||||
|
if (myDynMachCond.paymentInProgress >=2)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QObject const *hwapi::getAPI() {
|
QObject const *hwapi::getAPI() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@@ -400,22 +400,7 @@ void T_runProc::changer_getAllParameters(struct T_changer *mw)
|
|||||||
|
|
||||||
void T_runProc::sub_getDynMachineConditions(struct T_dynamicCondition *dynMachCond)
|
void T_runProc::sub_getDynMachineConditions(struct T_dynamicCondition *dynMachCond)
|
||||||
{
|
{
|
||||||
|
epi_restoreDynMachineConditions(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);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -6,6 +6,8 @@
|
|||||||
#include "shared_mem_buffer.h"
|
#include "shared_mem_buffer.h"
|
||||||
#include "datei.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
|
// 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)
|
// epi: external access from GUI to PI: FOR external devices (DC)
|
||||||
|
|
||||||
@@ -1773,15 +1775,25 @@ void epi_clearCurrentPayment(void)
|
|||||||
|
|
||||||
void gpi_storeCurrentPayment(uint32_t insertedAmount, uint16_t lastCoinType, uint16_t lastCoinValue)
|
void gpi_storeCurrentPayment(uint32_t insertedAmount, uint16_t lastCoinType, uint16_t lastCoinValue)
|
||||||
{
|
{
|
||||||
uint8_t pLC=SharedMem::read()->p_lastCoin;
|
uint8_t pLC;
|
||||||
|
|
||||||
|
// 21.3.24 attention: if bit 15 in lastCoinType is set then we got a bill not a coin
|
||||||
SharedMem::write()->store_insertedAmount=insertedAmount;
|
SharedMem::write()->store_insertedAmount=insertedAmount;
|
||||||
|
if (lastCoinType & 0x8000)
|
||||||
|
{
|
||||||
|
// then it's a banknote
|
||||||
|
//qCritical()<<"gpi_storeCurrentPayment got banknote, total: "<<insertedAmount;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
//qCritical()<<"gpi_storeCurrentPayment "<<insertedAmount<<" " << lastCoinType<<" " << lastCoinValue;
|
||||||
|
pLC=SharedMem::read()->p_lastCoin;
|
||||||
SharedMem::write()->store_lastCoinType[pLC]=lastCoinType;
|
SharedMem::write()->store_lastCoinType[pLC]=lastCoinType;
|
||||||
SharedMem::write()->store_lastCoinValue[pLC]=lastCoinValue;
|
SharedMem::write()->store_lastCoinValue[pLC]=lastCoinValue;
|
||||||
pLC++;
|
pLC++;
|
||||||
SharedMem::write()->p_lastCoin=pLC;
|
SharedMem::write()->p_lastCoin=pLC;
|
||||||
SharedMem::write()->store_curPayNewCoin++;
|
SharedMem::write()->store_curPayNewCoin++;
|
||||||
|
}
|
||||||
|
|
||||||
//qDebug()<<"gpi_storeCurrentPayment "<<insertedAmount<<" " << lastCoinType<<" " << lastCoinValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t epi_CurrentPaymentGetAmount(void)
|
uint32_t epi_CurrentPaymentGetAmount(void)
|
||||||
@@ -1819,6 +1831,13 @@ bool epi_CurrentPaymentGetAllCoins(uint16_t *types, uint16_t *values)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
int nn;
|
||||||
|
for (nn=0; nn<8; nn++)
|
||||||
|
{
|
||||||
|
data[nn]=SharedMem::read()->store_bnaCollect[nn];
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//uint64_t stor_wakSrc;
|
//uint64_t stor_wakSrc;
|
||||||
//uint8_t stor_reason;
|
//uint8_t stor_reason;
|
||||||
@@ -1915,32 +1934,17 @@ void epi_restoreDeviceConditions(uint8_t *leng, uint8_t *data)
|
|||||||
|
|
||||||
void epi_clearDynMachineConditions(void)
|
void epi_clearDynMachineConditions(void)
|
||||||
{
|
{
|
||||||
uint8_t nn;
|
memset(&SharedMem::write()->dynMachCond, 0, sizeof(struct T_dynamicCondition));
|
||||||
SharedMem::write()->store_machCondLen=0;
|
|
||||||
for (nn=0; nn<64; nn++)
|
|
||||||
SharedMem::write()->store_machCond[nn] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gpi_storeDynMachineConditions(void const *data)
|
||||||
void gpi_storeDynMachineConditions(uint8_t leng, uint8_t *data)
|
|
||||||
{
|
{
|
||||||
uint8_t nn;
|
SharedMem::write()->dynMachCond = *(struct T_dynamicCondition const *)(data);
|
||||||
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];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void epi_restoreDynMachineConditions(uint8_t *leng, uint8_t *data)
|
void epi_restoreDynMachineConditions(void *data)
|
||||||
{
|
{
|
||||||
uint8_t nn, LL;
|
*(struct T_dynamicCondition *)(data) = SharedMem::read()->dynMachCond;
|
||||||
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];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user