tescalesbase.h

00001 /****************************************************************************
00002 ** $Id: tescalesbase.h,v 1.3 2006/03/25 11:32:22 leader 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 /*
00027    Abstract Scales interface object
00028    (c) V.Grazdankin, 1999-2005
00029 */
00030 #ifndef TESCALES_H
00031 #define TESCALES_H
00032 #include <tebase.h>
00033 
00034 #define EVENT_SCALES_WEIGHT_READ 1
00035 #define EVENT_SCALES_COMM_ERROR 100
00036 #define EVENT_SCALES_QUERY_INFO 2
00037 
00038 struct PLUInfo {
00039     unsigned int  PLU,
00040          ICode;
00041     char Name[56];
00042     int  Price,
00043          SLife,
00044          Tare,
00045          GCode,
00046          MsgNo;
00047 };
00048 
00049 //---------------------------------------------------------------------------
00050 class LIB_EXPORT TEScalesBase : public TEBase
00051 {
00052     Q_OBJECT
00053     
00054 public:
00055     TEScalesBase( int pn );
00056     ~TEScalesBase();
00057 
00058     QString productCode() const; // Can be used after EVENT_SCALES_QUERY_INFO. 
00059                                  //Returns product code for which information was requested.
00060     
00061     
00062     
00063 public:
00064         double price() const {return m_dPrice;}
00065         virtual void setPrice( double Price );
00066         
00067         double tareWeight() const {return m_dTareWeight;}
00068         virtual void setTareWeight( double dTareWeight ) {m_dTareWeight=dTareWeight;}
00069 
00070         unsigned int PLU() const {return m_uiPLU;}
00071         virtual void setPLU(unsigned int uiPLU) {m_uiPLU=uiPLU;}
00072 
00073         QString prodCode() const {return m_sProdCode;}
00074         virtual void setProdCode(const QString & sProdCode) {m_sProdCode=sProdCode;}
00075 
00076         QString groupCode() const {return m_sGroupCode;}
00077         virtual void setGroupCode(const QString & sGroupCode) {m_sGroupCode=sGroupCode;}
00078 
00079         QString prodName() const {return m_sProdName;}
00080         virtual void setProdName(const QString & sProdName) {m_sProdName=sProdName;}
00081 
00082         QDateTime useByDate() const {return m_dUseByDate;}
00083         virtual void setUseByDate(const QDateTime & dUseByDate) {m_dUseByDate=dUseByDate;}
00084         
00085         double weight() const {return 0;}
00086         double summa() const {return 0;}
00087 
00088 public slots:
00089         virtual int readDisplay();
00090 
00091 protected:
00092         void setSumma(double dSum){ Q_UNUSED( dSum );};
00093         void setWeight(double dWeight){ Q_UNUSED( dWeight ); };
00094 
00095 //    virtual void processEvent( int Code );
00096 //    int poll();
00097 private:
00098         unsigned int m_uiPLU;
00099         QString m_sProdCode;
00100         QString m_sGroupCode;
00101         double m_dPrice;
00102         double m_dTareWeight;
00103         QString m_sProdName;
00104         QDateTime m_dUseByDate;
00105 };
00106 //---------------------------------------------------------------------------
00107 
00108 #endif
00109 
00110 

Generated on Sun Jul 2 23:38:22 2006 for Trade equipment common library. by  doxygen 1.4.7