Documents > BPS V2 C++ API

Utility class to process scanned bar codes. More...

#include <bpsbarcode.h>

List of all members.

Public Types

enum  Function {
  SSCC = 0,
  LotID = 100,
  StockLocation = 200,
  ArticleCU = 300,
  ArticleTU = 301,
  ArticleLU = 302,
  Partner = 400,
  ShipToPartner = 401,
  BillToPartner = 402,
  SellingPartner = 403,
  DeliveringPartner = 404,
  InvoicingPartner = 405
}
 Bar code function types. More...

Public Member Functions

 BpsBarcode (BpsDatastore *aDatastore)
 BpsBarcode (BpsDatastore *aDatastore, char aCode, const QString &aData)
 BpsBarcode (BpsDatastore *aDatastore, const QString &aName, const QString &aData)
 BpsBarcode (const BpsBarcode &aOther)
 The copy constructor.
char code () const
QString data () const
QString data (Function aFunction, bool aForLookup) const
QStringList names () const
QStringList names (Function aFunction) const
void setCode (char aCode)
 Set code identifier.
void setData (const QString &aData)
 Set bar code data (without the code type identifier).
void setName (const QString &aName)
 Set code type name.

Static Public Member Functions

static QMap< char, QStringList > codeNames ()
static QList
< BpsBarcode::Function
partnerFunctions ()

Detailed Description

Utility class to process scanned bar codes.

Barcode settings

The mapping of bar code types and application identifiers is taken from the central system settings. For each function the settings in Central System Settings/Scanning can hold a comma separated list of bar codes.

Example bar code lists in those settings:

  • EAN8,EAN13,RSS14 : Any of EAN 8, 13 or RSS 14
  • EAN128(91),39 : Either content of AI 91 in a EAN128 bar code, or a Code 39

See chapter Barcode scanning in the manual for more details.

Lookup preprocessing

The barcode data retrieved can be preprocessed for lookup. In this case only the length of the returned data should be matched against the code in the lookup table.

CI Name Preprocessing
A EAN8 The check digit is truncated and the returned data length is 7.
B EAN13 In case the flag is 21, 22, 28 or 29 a code containing price or weight is assumed. The 5 price/weight digits and the check digit is truncated, and the returned data length is 7. For all other flags only the check digit is truncated and the returned data length is 12.

Member Enumeration Documentation

Bar code function types.

Enumerator:
SSCC 

Serial shipping container code.

LotID 

Lot ID.

StockLocation 

Stock location.

ArticleCU 

Article consumer unit.

ArticleTU 

Article trading unit.

ArticleLU 

Article logistic unit.

Partner 

General partner.

ShipToPartner 

Ship to partner.

BillToPartner 

Bill to partner.

SellingPartner 

Selling partner.

DeliveringPartner 

Delivering partner (distributor).

InvoicingPartner 

Invoicing partner.


Constructor & Destructor Documentation

BpsBarcode::BpsBarcode ( BpsDatastore aDatastore)
Parameters:
[in]aDatastoreThe current datastore object.
BpsBarcode::BpsBarcode ( BpsDatastore aDatastore,
char  aCode,
const QString &  aData 
)
Parameters:
[in]aDatastoreThe current datastore object.
[in]aCodeThe code type identifier.
[in]aDataThe code without prefix, suffix and code type identifier.
BpsBarcode::BpsBarcode ( BpsDatastore aDatastore,
const QString &  aName,
const QString &  aData 
)
Parameters:
[in]aDatastoreThe current datastore object.
[in]aNameThe code type name.
[in]aDataThe data without prefix, suffix and code type identifier.
BpsBarcode::BpsBarcode ( const BpsBarcode aOther)

The copy constructor.

Parameters:
[in]aOtherThe original object to clone.

Member Function Documentation

char BpsBarcode::code ( ) const
Returns:
Bar code type identifier.
static QMap<char,QStringList> BpsBarcode::codeNames ( ) [static]
Returns:
Map of scanned codes to names. A single code can map to multiple names, thus the names are in a string list.
QString BpsBarcode::data ( ) const
Returns:
The complete bar code data (without the code type identifier).
QString BpsBarcode::data ( Function  aFunction,
bool  aForLookup 
) const
Parameters:
[in]aFunctionThe function to find the data for.
[in]aForLookupWhen true, the data is preprocessed for lookup.
Returns:
The functions data portion, or an empty string when bar code has no such function data.
QStringList BpsBarcode::names ( ) const
Returns:
The bar code names matching the current code identifier.
QStringList BpsBarcode::names ( Function  aFunction) const
Parameters:
[in]aFunctionThe function to find the type names for.
Returns:
The allowed bar code type names for a certain function.
static QList<BpsBarcode::Function> BpsBarcode::partnerFunctions ( ) [static]
Returns:
List of all partner functions
void BpsBarcode::setCode ( char  aCode)

Set code identifier.

Parameters:
[in]aCodeThe new code identifier.
void BpsBarcode::setData ( const QString &  aData)

Set bar code data (without the code type identifier).

Parameters:
[in]aDataThe new bar code data.
void BpsBarcode::setName ( const QString &  aName)

Set code type name.

Parameters:
[in]aNameThe new code type name.

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