Trade equipment common library.  1.0.0
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
TEBase Class Reference

The TEBase is base class for all trade equipment classes. More...

#include <tebase.h>

Inheritance diagram for TEBase:
TE TEDisplayBase TEReaderBase TEScalesBase

Public Slots

virtual int startDriver ()
 
virtual int stopDriver ()
 
virtual int setCaptureMode (int iMode)
 
virtual int captureMode ()
 

Signals

void deviceEvent (int Code)
 

Public Member Functions

 TEBase (int pn)
 
virtual void setActivationKey (const QString &key)
 
virtual QString activationKey () const
 
int connectionType ()
 
virtual int setConnectionType (int ct)
 
virtual int setPortNumber (int pn)
 
int portNumber () const
 
void setPollInterval (int pint)
 
int pollInterval ()
 
virtual int isOpen ()
 
int timeout ()
 
void setTimeout (int timeout)
 
bool isTimeout ()
 
int debugLevel ()
 
void setDebugLevel (int level)
 
virtual QCString utf8ToDevice (const QString &text)
 
virtual QString deviceToUtf8 (const QCString &text)
 
virtual int isActivationKeyValid ()
 
int errorCode () const
 
void setErrorCode (const int &code)
 
virtual QString errorText () const
 
virtual void setErrorText (const QString &err)
 
QString productSuffix () const
 
void setProductSuffix (const QString &sProductSuffix)
 
void setPortBaudRate (int)
 
int portBaudRate () const
 
void setPortFlowControl (FlowType)
 
FlowType portFlowControl () const
 
void setPortParity (ParityType)
 
ParityType portParity () const
 
void setPortDataBits (DataBitsType)
 
DataBitsType portDataBits () const
 
void setPortStopBits (StopBitsType)
 
StopBitsType portStopBits () const
 
virtual QValueList< int > supportedBaudRates ()
 
virtual QValueList< int > supportedConnectionTypes ()
 
virtual int open ()
 
virtual int close ()
 
virtual void processEvent (int Code)
 
virtual QStringList execCommand (const QString &cmd)
 
virtual bool isDriverRunning ()
 

Protected Member Functions

void abstract ()
 
void startPoll (int PollInterval=500, bool defaultProc=true)
 
void startPoll (bool defaultProc=true)
 
void stopPoll ()
 
void startIOTransaction ()
 
void stopIOTransaction ()
 
virtual int poll ()
 
TSerialPortport ()
 
virtual int putch (int b)
 
virtual int getch ()
 
virtual Q_ULONG writeBlock (const char *data, Q_ULONG len)
 
virtual Q_ULONG readBlock (char *data, Q_ULONG maxlen=1)
 
virtual Q_ULONG readCount ()
 
void clearPPP ()
 
void timerEvent (QTimerEvent *)
 

Protected Attributes

ExecEngine m_ee
 
int m_iCaptureMode
 
bool m_bDriverStarted
 

Properties

QString ActivationKey
 
int PortNumber
 
int PortBaudRate
 

Additional Inherited Members

- Public Types inherited from TE
enum  CaptureMode { CM_Exclusive =0, CM_NonExclusive =1 }
 Define connection capture mode for setCaptureMode()
 
enum  EquipmentConnectionType {
  ECT_NOCONNECTION =0x0, ECT_SERIAL =0x1, ECT_KEYBOARD =0x2, ECT_TCP =0x3,
  ECT_TESERVER =0x4
}
 
enum  CashRegisterOperations {
  CRO_SELL = 0x0, CRO_BUY = 0x1, CRO_SELLRET = 0x2, CRO_BUYRET = 0x3,
  CRO_SELLSTORNO = 0x4, CRO_BUYSTORNO = 0x5, CRO_CASHIN = 0x6, CRO_CASHOUT = 0x7,
  CRO_DISCOUNT = 0x8, CRO_DISCOUNTPERCENT = 0x9, CRO_OPMASK = 0xF
}
 

Detailed Description

The TEBase is base class for all trade equipment classes.

/en Abstract trade equipment object. Object have internal text command interpreter that give access to object functions.

Parameters
cmd(in) command text. Command format: <function> '(' <parm1> ',' <parm2> ',' ... <parmN> ')'
Returns
- command execution result. /_en /ru TEBase - базовый класс для всех классов торгового оборудования.

Работа с торговым оборудованием состоит из нескольких шагов:

  1. Создание объекта для работы с соответствующим оборудованием, например: TEReaderBarcode *barcodereader = new TEReaderBarcode();
  2. Установка параметров подключения оборудования.
  3. Соединение сигнала deviceEvent( int Event ) объекта работы с оборудованием с обработчиком события от устройства. Например, при считывании штрихкода генерируется сигнал EVENT_READER_DATAARRIVED. Если ваш обработчик подключен к сигналам от нескольких объектов, необходимо проверять базовый класс объекта, пославшего событие до того, как проверять и обрабатывать код события, так как коды событий для разных классов могут совпадать. Например: if ( sender()->inherits("TEReaderBase") ){ // Проверяем события от считывателя switch ( Event ) { case EVENT_READER_DATAARRIVED: // обрабатываем break; ... } }
  4. Старт работы драйвера: barcodereader->startDriver();
  5. Работа с оборудованием. Работа осуществляется вызовом методов объекта, обработкой событий от устройства.
  6. Остановка драйвера: barcodereader->stopDriver();
  7. Уничтожение обекта. /_ru

Constructor & Destructor Documentation

◆ TEBase()

TEBase::TEBase ( int  pn)

Abstract trade equipment object. Object have internal text command interpreter that give access to object functions.

Parameters
cmd(in) command text. Command format: <function> '(' <parm1> ',' <parm2> ',' ... <parmN> ')'
Returns
- command execution result.

References startPoll(), and stopPoll().

Member Function Documentation

◆ abstract()

void TEBase::abstract ( )
protected

/ru Устанавливает значение iDocNum в номер текущего открытого или последнего закрытого документа. При исполнении этой функции возможно обращение к устройству. /_ru /en /_en

◆ errorText()

QString TEBase::errorText ( ) const
virtual

/ru Возвращает описание ошибки, соответствующее последнему коду ошибки. /_ru /en /_en

◆ execCommand()

QStringList TEBase::execCommand ( const QString &  cmd)
virtual

Execute command. Object have internal text command interpreter that give access to object functions.

Parameters
cmd(in) command text. Command format: <function> '(' <parm1> ',' <parm2> ',' ... <parmN> ')'
Returns
- command execution result.

◆ getch()

int TEBase::getch ( )
protectedvirtual

Get character.

Referenced by readBlock().

◆ isOpen()

int TEBase::isOpen ( void  )
virtual

Check comunication port connection.

◆ port()

TSerialPort * TEBase::port ( )
protected

Return pointer to device serial port object.

◆ putch()

int TEBase::putch ( int  b)
protectedvirtual

Put character

Referenced by writeBlock().

◆ readBlock()

Q_ULONG TEBase::readBlock ( char *  data,
Q_ULONG  maxlen = 1 
)
protectedvirtual

Read data block from device.

References getch().

◆ setConnectionType()

int TEBase::setConnectionType ( int  ct)
virtual

/ru Устанавливает тип подключения торгового оборудования. /_ru /en /_en

◆ startPoll() [1/2]

void TEBase::startPoll ( int  PollInterval = 500,
bool  defaultProc = true 
)
protected

Referenced by startPoll(), and TEBase().

◆ startPoll() [2/2]

void TEBase::startPoll ( bool  defaultProc = true)
protected

References startPoll().

◆ stopPoll()

void TEBase::stopPoll ( )
protected

Referenced by TEBase().

◆ timerEvent()

void TEBase::timerEvent ( QTimerEvent *  )
protected

Poll device on timer event.

◆ writeBlock()

Q_ULONG TEBase::writeBlock ( const char *  data,
Q_ULONG  len 
)
protectedvirtual

Write data block to device.

References putch().


The documentation for this class was generated from the following files: