00001 /* 00002 * Linux Advanced Business Enterprise Management System 00003 * 00004 * 00005 * File name....... : qlabibm4694.h 00006 * File version.... : 1.0.2 00007 * Revision Date... : Tue Jan 27 2004 00008 * 00009 * File Description : IBM 4694 hardware abstraction 00010 * 00011 * Author.......... : DJ Anubis 00012 * Copyright....... : (C) 2001-2003 by DJ Anubis 00013 * Email .......... : labproject@free.fr 00014 * 00015 * License : 00016 * Please read the license file in doc directory. 00017 * 1. Lab Public License. 00018 * You should have received a copy of the Lab Public License with this package. 00019 * If this is not the case, you can read it or download it at: 00020 * http://labproject.free.fr 00021 * 2. Q Public License. 00022 * Conformant to Trolltech QPL license. 00023 * 3. GNU General Public License. 00024 * Reserved for free projects. 00025 * 4. Commercial license. 00026 * Recommanded if your code is not distributed under one of the 3 models above. 00027 * 00028 * Read the license FAQ in doc directory. 00029 * 00030 * Revision Comments: 00031 * 00032 * This is the class incarnation for the old structure. 00033 * 00034 */ 00035 00036 #ifndef QLABIBM4694_H 00037 #define QLABIBM4694_H 00038 00039 #include <qlabcashboxinterfacedefinition.h> 00040 00041 #include <qobject.h> 00042 #include <qvariant.h> 00043 #include <qmap.h> 00044 #include <qdatetime.h> 00045 00046 // Big Blue specific hardware includes 00047 00048 #include "pos/pos.h" 00049 #include "pos/device.h" 00050 #include "pos/display.h" 00051 #include "pos/msr.h" 00052 #include "pos/nvram.h" 00053 #include "pos/power.h" 00054 #include "pos/rs232c.h" 00055 #include "pos/scale.h" 00056 #include "pos/scanner.h" 00057 #include "pos/keyboard.h" 00058 #include "pos/drawer.h" 00059 #include "pos/printer.h" 00060 #include "pos/errno.h" 00061 00062 00063 // ====================================== 00064 // The following macros have been grabbed 00065 // from the IBM 4694 Reference Manual. 00066 // As this is very handy, I didn't need 00067 // to discoover warm water. 00068 // 00069 // Next lines Copyright (C) IBM Corporation 00070 00071 typedef struct TableEntry 00072 { 00073 int Value; 00074 char *Name; 00075 } TableEntry ; 00076 00077 #define MakeEntry(x) { x , # x } 00078 #define MakeExtEntry(x, y) { x ## y , # y } 00079 #define MakeSubtypeEntry( device, type, subtype ) \ 00080 { ( PosDEVICE_ ## device << 8 ) | Pos ## type ## _SUBTYPE_ ## subtype , \ 00081 # subtype } 00082 00083 // End of IBM grabbed stuff 00084 // ===================================== 00085 00086 class Q_EXPORT QlabIbm4694 : public QlabCashboxInterfaceDefinition 00087 { 00088 Q_OBJECT 00089 00090 00091 public : 00092 QlabIbm4694( QlabCashboxInterfaceDefinition * parent = 0, char * name = 0 ) ; 00093 ~QlabIbm4694() ; 00094 00095 void setup() ; 00096 void exec() ; 00097 00098 public slots : 00099 QStringList features() ; 00100 // Properties 00101 ActivePrintDevice activePrinter() const ; 00102 void setActivePrinter( ActivePrintDevice prn ) ; 00103 00104 // Standard slots 00105 void closeAll() ; 00106 void closeDevice( int dev ) ; 00107 void releaseAll() ; 00108 void lockDevice( int dev ) ; 00109 void unlockDevice( int dev ) ; 00110 // Keyboard specific Methods 00111 long keyboardSupervisorStatus() ; 00112 00113 // display specific Methods 00114 void clearScreen( int dev ) ; 00115 void displayFullScreen( int dev, const QString & msg, int cursor = 0 ) ; 00116 void displayString( int dev, const QString & msg, int cursor = 0 ) ; 00117 void displayItemRight( int dev, const QString & msg, int lineno = 1 ) ; 00118 00119 // printer specific Methods 00120 bool selectRollPaper() ; 00121 bool selectFullPage() ; 00122 void printLine( const QString & li ) ; 00123 void printText( const QString & txt ) ; 00124 long printerStatus() ; 00125 void writeToCRstation( const QString & line ) ; 00126 void writeToCRandSJstations( const QString & buffer ) ; 00127 void writeToDIstation( const QString & buffer ) ; 00128 QString evalPrintLine( const QString & line, bool withdash = FALSE ) ; 00129 00130 // drawer specific Methods 00131 void openCashDrawer() ; 00132 long drawerStatus() ; 00133 void waitForDrawerClosed() ; 00134 00135 // Sound Methods 00136 void soundTone( int frequency = PosMEDIUM, int duration = 10, int volume = PosLOW ) ; 00137 void soundError() ; 00138 void soundWarning() ; 00139 void soundReject() ; 00140 00141 protected slots : 00142 void openDevice( POSQMSG * pMsg ) ; 00143 int openAndAcquire( int device, PosArgPtr args, int nargs ) ; 00144 void setCheckoutNumpadStyle( int devdes ) ; 00145 QString readScannerData() ; 00146 virtual QString readMicr( long size ) ; 00147 00148 private : 00149 void initDevices() ; 00150 void deviceStatus( POSQMSG *pMsg ) ; 00151 void processPrinterStatus( POSQMSG *pMsg ) ; 00152 void processPrinterData( POSQMSG *pMsg ) ; 00153 void processPrinterError( POSQMSG *pMsg ) ; 00154 void processScannerData() ; 00155 QString processMsrData() ; 00156 void processTillOpened( long *till_open_tm ) ; 00157 void processTillClosed( long *till_open_tm ) ; 00158 void processChaseComplete() ; 00159 void processCharacterMessage( POSQMSG *qmsg ) ; 00160 00161 POSQMSG qmsg ; 00163 // ==== 4610 Stuff ===================== 00168 QString p4610RegisterDocument ; 00173 QString p4610ReleaseDocument ; 00178 QString p4610ReadMicrInfo ; 00183 QString p4610FlipCheck ; 00184 // ==== EOC ============================ 00185 00186 } ; 00187 00188 00189 #endif // QLABIBM4694_H 00190