forked from GerhardHoffmann/DCLibraries
		
	
		
			
				
	
	
		
			151 lines
		
	
	
		
			4.9 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			151 lines
		
	
	
		
			4.9 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
 | 
						|
#ifndef RUN_PROCESS_H
 | 
						|
#define RUN_PROCESS_H
 | 
						|
 | 
						|
#include <stdint.h>
 | 
						|
#include <QObject>
 | 
						|
#include <QString>
 | 
						|
#include <QTimer>
 | 
						|
#include "tslib.h"
 | 
						|
#include "com.h"
 | 
						|
#include "interfaces.h"
 | 
						|
 | 
						|
#include <QtPlugin>
 | 
						|
#include <QObject>
 | 
						|
#include <QDebug>
 | 
						|
#include "datIf.h"
 | 
						|
#include <QSharedMemory>
 | 
						|
#include <atomic>
 | 
						|
#include "sendWRcmd.h"
 | 
						|
#include "controlBus.h"
 | 
						|
#include "storeINdata.h"
 | 
						|
#include "dcBL.h"
 | 
						|
#include "shared_mem_buffer.h"
 | 
						|
 | 
						|
 | 
						|
class T_runProc : public QObject
 | 
						|
{
 | 
						|
    Q_OBJECT
 | 
						|
    QTimer *hwapi_TimerPayment, *hwapi_triggerBL, *myTO;
 | 
						|
 | 
						|
    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);
 | 
						|
 | 
						|
    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);
 | 
						|
 | 
						|
#ifndef THIS_IS_CA_MASTER
 | 
						|
    std::atomic_bool m_coinAttached{false};
 | 
						|
#endif
 | 
						|
 | 
						|
private slots:
 | 
						|
    void runProc_slotProcess(void);
 | 
						|
    bool bl_performComplStart(void);
 | 
						|
    bool bl_waitForRdyMsg(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);
 | 
						|
        // byte 0: 0:unknown   1: printer OK     100: printer OK but paper near end
 | 
						|
        //          200: not connected    201: printer on error   202: no paper
 | 
						|
 | 
						|
    void bl_completeStart(void);
 | 
						|
    void dc_autoRequest(bool on);
 | 
						|
    void bl_rebootDC(void);
 | 
						|
    void bl_startBL(void);
 | 
						|
    void bl_checkBL(void);
 | 
						|
    //uint8_t bl_isUp(void);  neuere Sax-Version, bisher nicht verwendet
 | 
						|
        // return 1: BL is up   2: BL error  0: stopped
 | 
						|
    bool bl_isUp(void);	    
 | 
						|
        
 | 
						|
    void resetBLvari(void);
 | 
						|
 | 
						|
    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
 | 
						|
 | 
						|
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);
 | 
						|
 | 
						|
    void runProc_coinAttached();
 | 
						|
};
 | 
						|
 | 
						|
 | 
						|
 | 
						|
#endif
 |