2023-11-08 13:02:26 +01:00
|
|
|
|
|
|
|
#ifndef RUN_PROCESS_H
|
|
|
|
#define RUN_PROCESS_H
|
|
|
|
|
2023-12-06 14:28:24 +01:00
|
|
|
#include <stdint.h>
|
2024-03-02 12:15:15 +01:00
|
|
|
#include <QObject>
|
2023-11-08 13:02:26 +01:00
|
|
|
#include <QString>
|
|
|
|
#include <QTimer>
|
|
|
|
#include "tslib.h"
|
|
|
|
#include "com.h"
|
|
|
|
#include "interfaces.h"
|
|
|
|
|
|
|
|
#include <QtPlugin>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QDebug>
|
|
|
|
#include "datIf.h"
|
|
|
|
#include <QSharedMemory>
|
2024-02-21 10:39:03 +01:00
|
|
|
#include <atomic>
|
2023-11-08 13:02:26 +01:00
|
|
|
#include "sendWRcmd.h"
|
|
|
|
#include "controlBus.h"
|
|
|
|
#include "storeINdata.h"
|
|
|
|
#include "dcBL.h"
|
|
|
|
#include "shared_mem_buffer.h"
|
|
|
|
|
|
|
|
|
|
|
|
class T_runProc : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2023-12-06 14:28:24 +01:00
|
|
|
QTimer *hwapi_TimerPayment, *hwapi_triggerBL, *myTO;
|
2023-11-08 13:02:26 +01:00
|
|
|
|
|
|
|
void sub_emp_getAllParameters(struct T_emp *emp);
|
|
|
|
void changer_getAllParameters(struct T_changer *mw);
|
|
|
|
|
|
|
|
void sub_getDynMachineConditions(struct T_dynamicCondition *dynMachCond);
|
|
|
|
|
|
|
|
void restoreDeviceParameter(struct T_devices *deviceSettings);
|
|
|
|
|
2024-07-04 14:01:43 +02:00
|
|
|
void clearPrnFile(void);
|
|
|
|
char subFeedPaper(char *valueStr);
|
|
|
|
bool subGetVariStr(char *valueStr, char *returnStr);
|
|
|
|
//void subAppendNxtTxt(char *textLine);
|
|
|
|
void sub_changeStyle(char *valueStr);
|
|
|
|
void subPrintGrafics(char *valueStr);
|
|
|
|
char prn_directTicket_cycle(void);
|
|
|
|
void runProc_subPerformPrintCmds(uint8_t nextCmd, uint8_t nextPara);
|
|
|
|
uint16_t subStoreTicketText(char *textLine);
|
|
|
|
|
2024-02-21 10:39:03 +01:00
|
|
|
#ifndef THIS_IS_CA_MASTER
|
|
|
|
std::atomic_bool m_coinAttached{false};
|
|
|
|
#endif
|
|
|
|
|
2023-11-08 13:02:26 +01:00
|
|
|
private slots:
|
|
|
|
void runProc_slotProcess(void);
|
|
|
|
bool bl_performComplStart(void);
|
|
|
|
|
|
|
|
public:
|
|
|
|
T_runProc();
|
|
|
|
|
|
|
|
bool cash_startPayment(uint32_t amount);
|
|
|
|
uint8_t cash_paymentProcessing(void);
|
|
|
|
uint8_t epi_store64BdevParameter(uint8_t length, uint8_t *buf);
|
|
|
|
uint8_t epi_restore64BdevParameter(uint8_t *length, uint8_t *buf);
|
|
|
|
bool doors_supervise(void);
|
|
|
|
uint8_t prn_getHwState(struct Tprn_hw_state *prn_hw_state);
|
2024-07-04 14:01:43 +02:00
|
|
|
// byte 0: 0:unknown 1: printer OK 100: printer OK but paper near end
|
|
|
|
// 200: not connected 201: printer on error 202: no paper
|
|
|
|
|
2023-11-08 13:02:26 +01:00
|
|
|
void bl_completeStart(void);
|
|
|
|
void dc_autoRequest(bool on);
|
|
|
|
void bl_rebootDC(void);
|
|
|
|
void bl_startBL(void);
|
|
|
|
void bl_checkBL(void);
|
|
|
|
bool bl_isUp(void);
|
|
|
|
|
2024-07-04 14:01:43 +02:00
|
|
|
// new from 21.5.24 ..................................................................
|
|
|
|
|
|
|
|
uint16_t sys_getCustomerNumber(void);
|
|
|
|
uint16_t sys_getMachineNumber(void);
|
|
|
|
uint16_t sys_getBoroughNumber(void);
|
|
|
|
uint16_t sys_getZoneNumber(void);
|
|
|
|
uint16_t sys_getMachineAlias(void);
|
|
|
|
void sys_getLocation(char *locStr);
|
|
|
|
void prn_sendText(QByteArray *buf);
|
|
|
|
void prn_sendPrnSysCmd(uint8_t para1, uint8_t para2, uint32_t para3);
|
|
|
|
void prn_printBarcode(uint8_t kindOf, uint8_t withText, uint8_t offset, uint8_t rotation, uint8_t dataLeng, uint8_t *data);
|
|
|
|
bool sys_parseFile(QByteArray jsonFile2print);
|
|
|
|
// and copy all keys and values to arrays
|
|
|
|
|
|
|
|
bool sys_translateKeys(void);
|
|
|
|
|
|
|
|
bool sys_interpretPrnCmds(void);
|
|
|
|
|
|
|
|
|
|
|
|
void prn_sendPrnSetup(uint16_t paperSpeed, uint8_t density, uint8_t alignment, uint8_t orientation);
|
|
|
|
// send 5 byte: byte 0,1: speed 5...250 mm/s
|
|
|
|
// byte2: density 0....(25)....50
|
|
|
|
// byte3: alignment 'l', 'c', 'r' = left, center, right
|
|
|
|
// byte4: orientation 0, 90, 180 = 0°, 90°, 180° rotation (by now not supported!)
|
|
|
|
|
|
|
|
void prnStoreDynamics(char *bufferDynPrintVars[], uint8_t nrOfDyns);
|
|
|
|
// store nrOfDyns (up to 16) dynamics before printing
|
|
|
|
// max length = 16 byte per dynamic
|
|
|
|
|
|
|
|
bool prnRestoreDynamic(uint8_t nrOfDyn, char *bufferOneDyn);
|
|
|
|
// nrOfDyn = 0...15
|
|
|
|
// buffer bufferOneDyn[16] needs length of at least 16 byte
|
|
|
|
|
|
|
|
bool prn_isUpAndReady(void);
|
|
|
|
|
|
|
|
void prnStartDirectPrinting(void);
|
|
|
|
|
|
|
|
uint8_t prn_getDirectPrintResult(void);
|
|
|
|
// return: 0: just printing, wait
|
|
|
|
// 1: OK - last print was succesful
|
|
|
|
// 2: error - not printed
|
|
|
|
// 2: printer error 3: no connection to DC
|
2023-11-08 13:02:26 +01:00
|
|
|
|
|
|
|
signals:
|
|
|
|
//void runProc_templatePrintFinished_OK(void) const override;
|
|
|
|
//void runProc_templatePrintFinished_Err(void) const override;
|
|
|
|
|
|
|
|
void runProc_coinCollectionJustStarted(void);
|
|
|
|
void runProc_coinCollectionAborted(void);
|
|
|
|
|
|
|
|
void runProc_gotNewCoin(void);
|
|
|
|
void runProc_payStopByMax(void);
|
|
|
|
void runProc_payStopByPushbutton(void);
|
|
|
|
|
|
|
|
void runProc_payStopByEscrow(void);
|
|
|
|
void runProc_payStopByError(void);
|
|
|
|
void runProc_payStopByTimeout(void);
|
|
|
|
void runProc_payCancelled(void);
|
|
|
|
void runProc_coinProcessJustStopped(void);
|
|
|
|
|
|
|
|
void runProc_doorServiceDoorOpened(void);
|
|
|
|
void runProc_doorVaultDoorOpened(void);
|
|
|
|
void runProc_doorCoinBoxRemoved(void);
|
|
|
|
void runProc_doorCoinBoxInserted(void);
|
|
|
|
void runProc_doorCBinAndAllDoorsClosed(void);
|
|
|
|
void runProc_doorAllDoorsClosed(void);
|
|
|
|
|
2024-02-19 15:59:41 +01:00
|
|
|
void runProc_coinAttached();
|
2023-11-08 13:02:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|