tedisplaybase.h

00001 /****************************************************************************
00002 ** $Id: tedisplaybase.h,v 1.3 2006/06/20 06:55:18 red75 Exp $
00003 **
00004 ** Trade equipment common portable library project
00005 **
00006 ** Copyright (C) 1999-2006 Leader InfoTech.  All rights reserved.
00007 **
00008 ** This file is part of the Library of the Ananas
00009 ** automation accounting system.
00010 **
00011 ** This file may be distributed and/or modified under the terms of the
00012 ** GNU General Public License version 2 as published by the Free Software
00013 ** Foundation and appearing in the file LICENSE.GPL included in the
00014 ** packaging of this file.
00015 **
00016 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00017 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00018 **
00019 ** See http://www.leaderit.ru/ or email sales@leaderit.ru
00020 **
00021 ** Contact org@leaderit.ru if any conditions of this licensing are
00022 ** not clear to you.
00023 **
00024 **********************************************************************/
00025 
00026 #ifndef _TEDISPLAYBASE_H
00027 #define _TEDISPLAYBASE_H
00028 #include <tebase.h>
00029 #include <qstringlist.h>
00030 #include <qthread.h>
00031 #include <qmutex.h>
00032 #include <qwaitcondition.h>
00033 
00034 //---------------------------------------------------------------------------
00035 class LIB_EXPORT TEDisplayBase : public TEBase
00036 {
00037         Q_OBJECT
00038         
00039 public:
00040         TEDisplayBase( int pn );
00041         ~TEDisplayBase();
00042  
00043   enum CommandSet
00044   {
00045     CS_DEFAULT=0,
00046     CS_EPSON,
00047     CS_DSP800,
00048     CS_AEDEX,
00049     CS_FIRICH
00050   };
00051   virtual QString commandSetName(int);
00052   virtual bool isCommandSetSupported(int);
00053 
00054         virtual QString modelInfo();
00055         virtual int scrollSpeed()=0;
00056         virtual int portBaudRate();
00057   int getCommandSet() const {return m_eCommandSet;}
00058 public slots:
00059         virtual void setPortBaudRate(int);
00060         virtual void setScrollSpeed(int)=0;
00061   virtual int setCommandSet(int);
00062         virtual void initDisplay();
00063         virtual void setPortNumberAndInit(int pn);
00064         virtual void setDisplayMode(const QString & mode);
00065         virtual void showText(const QString & text, 
00066                 const QString & category="default", 
00067                 const QString & mode="scroll/left");
00068         virtual void processEvent( int Code );
00069 //      virtual QStringList execCommand(const QString & cmd);
00070 
00071 protected:
00072         Q_ULONG m_baudRate;
00073         int m_slowMode;
00074         void setSlowPortMode(int delayus);
00075         Q_ULONG writeBlockSlow( const char *data, Q_ULONG len );
00076         void addToBuffer(const char * data, Q_ULONG len);
00077 
00078         QMutex * m_pBufferMutex;
00079         QWaitCondition * m_pDataReady;
00080         QThread * m_pWriter;
00081         QByteArray * m_pBuffer;
00082   int m_eCommandSet;
00083 
00084         virtual void initPort()=0; 
00085 };
00086 //---------------------------------------------------------------------------
00087 
00088 #endif
00089 
00090 

Документация по Общая библиотека для работы с торговым оборудованием.. Последние изменения: Sun Jul 2 23:37:24 2006. Создано системой  doxygen 1.4.7