Package SampleFiscalPrinter
Class Device
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposBaseDevice
de.gmxhome.conrad.jpos.jpos_base.JposDevice
SampleFiscalPrinter.Device
- All Implemented Interfaces:
Runnable
Base of a JposDevice based implementation of JavaPOS CashDrawer, ElectronicJournal, FiscalPrinter and LineDisplay
device service implementations for the sample device implemented in SampleFiscalPrinter.tcl.
Supported features are:
FiscalPrinter:
- Basic functionality,
- Set header, trailer, vat rates, POS ID
- Additional lines, additional header and trailer lines, pre and post lines, tax ID
- Item and subtotal adjustments (amount, percent, surcharge),
- Status handling for receipt (neither journal nor slip station),
- Subtotal,
- MessageType MT_CASHIER to change cashier on-the-fly (alternative to signon / signoff),
- Training Mode,
- X report,
- Totalizers (only GD_PRINTER_ID, GD_CURRENT_TOTAL, GD_DAILY_TOTAL, GD_GRAND_TOTAL, GD_NOT_PAID, GD_RECEIPT_NUMBER, GD_FISCAL_REC, GD_REFUND, GD_NONFISCAL_REC, GD_Z_REPORT, GD_DESCRIPTION_LENGTH),
- Report from counter to counter,
- non-fiscal reports,
- fixed-output documents for signon and signoff.
- Basic electronic journal capabilities,
- Print stored data.
- Basic LineDisplay capabilities,
- 2x20 lines.
- Basic cash drawer capabilities,
- Drawer status reporting.
Here a full list of all device specific properties that can be changed via jpos.xml:
- AdjustmentVoidText: Additional text line for adjustment void. Default "*** ADJUSTMENT VOID ***".
- Baudrate: Baud rate of the communication device. Must be one of the baud rate constants specified in the
SerialIOProcessor class. Default: 9600 (SerialIOProcessor.BAUDRATE_9600).
This property may only be set if the communication with the device shall be made via serial port. - CashierID: Cashier id prefix for signon or signoff receipt. Default: "Cashier ID".
- CashierName: Cashier name prefix for signon or signoff receipt. Default: "Cashier Name".
- CharacterTimeout: Positive integer value, specifying the maximum delay between bytes that belong to the same frame. Default value: 50 milliseconds.
- Databits: Number of data bits per data unit. Must be 7 or 8. Default: 8. It is strictly recommended to let
this value unchanged.
This property may only be set if the communication with the device shall be made via serial port. - JournalSizeNearFull: Cumulated size of all journal files to generate journal near full status update event. Default 99% of MaxJournalSize.
- MaxJournalSize: Maximum size of all journal files of the device simulator. Default fits for 100 periods, 100000 receipts per period, 10000 characters per receipt.
- MaxRetry: Specifies the maximum number of retries. Should be > 0 only for RS232 (real COM ports) where characters can become lost or corrupted on the communication line. Default: 2.
- NonFiscalReceiptWithTrailer: Flag specifying whether non-fiscal receipts shall be printed with (true) or without (false) trailer lines. Default is false (without trailer lines).
- OwnPort: Integer value between 0 and 65535 specifying the TCP port used for communication with the device
simulator. Default: 0 (for random port number selected by operating system).
This property may only be set if the communication with the device shall be made via TCP. - Parity: Parity of each data unit. Must be one of the parity constants specified in the
SerialIOProcessor class. Default: 0 (SerialIOProcessor.PARITY_NONE).
This property may only be set if the communication with the device shall be made via serial port. - PollDelay: Minimum time between status requests, in milliseconds. Status requests will be used to monitor the device state. Default: 500.
- Port: Operating system specific name of the serial communication port (e.g. RS232, Usb2Serial, Bluetooth...) or the TCP address to be used for communication with the device simulator. In case of RS232, names look typically like COM2 or /dev/ttyS1. In case of TCP, names are of the form IPv4:port, where IPv4 is the IP address of the device and port its TCP port.
- PrinterResetText: Text to be printed during printer reset. Default "*** RESET PRINTER ***".
- RefundVoidText: Additional text line for refund void. Default "*** REFUND VOID ***".
- RequestTimeout: Maximum time, in milliseconds, between sending a command to the simulator and getting the first byte of its response. Default: 2000.
- SecretText: Secret code prefix for signon or signoff receipt. Default: "Secret".
- SerialNumber: Fiscal printer serial number. If not set, serial no. of the currently connected printer will be retrieved. Otherwise, serial number must match the serial number stored in the printer. Default is not set.
- SignOffHeader: Header text for signoff receipt. Default: "S I G N O F F".
- SignOnHeader: Header text for signon receipt. Default: "S I G N O N".
- Stopbits: Number of stop bits per data unit. Must be 1 or 2. Default: 2.
This property may only be set if the communication with the device shall be made via serial port.
-
Field Summary
FieldsModifier and TypeFieldDescriptionintMaximum time between acknowledge and response frame.static intCommand for DirectIO: Send native command(s) and retrieve the response(s).static intDirectIO: Perform fiscalization.static intDirectIO: Sets flag for non-fiscal receipt printing (with / without trailer lines).static intHeader of fixed output receipts.static intFirst line no.static intLast line of a SIGNOFF.static intOptional second line of a SIGNOFF receipt.static intFirst line no.static intLast line of a SIGNON.static intBeginFixedOutput: documentType for sign off.static intBeginFixedOutput: documentType for sign on.Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.JposDevice
Belts, BillAcceptors, BillDispensers, Biometricss, BumpBars, CashChangers, CashDrawers, CATs, CheckScanners, ClaimedBelt, ClaimedBillAcceptor, ClaimedBillDispenser, ClaimedBiometrics, ClaimedBumpBar, ClaimedCashChanger, ClaimedCashDrawer, ClaimedCAT, ClaimedCheckScanner, ClaimedCoinAcceptor, ClaimedCoinDispenser, ClaimedDeviceMonitor, ClaimedElectronicJournal, ClaimedElectronicValueRW, ClaimedFiscalPrinter, ClaimedGate, ClaimedGestureControl, ClaimedGraphicDisplay, ClaimedHardTotals, ClaimedImageScanner, ClaimedIndividualRecognition, ClaimedItemDispenser, ClaimedKeylock, ClaimedLights, ClaimedLineDisplay, ClaimedMICR, ClaimedMotionSensor, ClaimedMSR, ClaimedPINPad, ClaimedPointCardRW, ClaimedPOSKeyboard, ClaimedPOSPower, ClaimedPOSPrinter, ClaimedRemoteOrderDisplay, ClaimedRFIDScanner, ClaimedScale, ClaimedScanner, ClaimedSignatureCapture, ClaimedSmartCardRW, ClaimedSoundPlayer, ClaimedSoundRecorder, ClaimedSpeechSynthesis, ClaimedToneIndicator, ClaimedVideoCapture, ClaimedVoiceRecognition, CoinAcceptors, CoinDispensers, DeviceMonitors, ElectronicJournals, ElectronicValueRWs, FiscalPrinters, Gates, GestureControls, GraphicDisplays, HardTotalss, ImageScanners, IndividualRecognitions, ItemDispensers, Keylocks, Lightss, LineDisplays, MICRs, MotionSensors, MSRs, PINPads, PointCardRWs, POSKeyboards, POSPowers, POSPrinters, RemoteOrderDisplays, RFIDScanners, Scales, Scanners, SignatureCaptures, SmartCardRWs, SoundPlayers, SoundRecorders, SpeechSynthesiss, ToneIndicators, VideoCaptures, VoiceRecognitionsFields inherited from class de.gmxhome.conrad.jpos.jpos_base.JposBaseDevice
AllowAlwaysSetProperties, AsyncProcessorRunning, CapCompareFirmwareVersion, CapPowerReporting, CapUpdateFirmware, CurrentCommand, DrawerBeepVolume, ID, JposVersion, Log, LogFilePath, LogFilePattern, LoggerFormat, LoggerName, LogLevel, MaxArrayStringElements, MaximumConfirmationEventWaitingTime, PendingCommands, PhysicalDeviceDescription, PhysicalDeviceName, SerialIOAdapterClass, StrictFIFOEventHandling -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeDefaults(CashDrawerProperties props)Change defaults of properties.voidChange defaults of properties.voidChange defaults of properties.voidchangeDefaults(LineDisplayProperties props)Change defaults of properties.voidcheckProperties(jpos.config.JposEntry entry)Checks whether a JposEntry belongs to a predefined property value an if so, sets the corresponding driver valuegetCashDrawerProperties(int index)Returns device implementation of CashDrawerProperties.getElectronicJournalProperties(int index)Returns device implementation of ElectronicJournalProperties.getFiscalPrinterProperties(int index)Returns device implementation of FiscalPrinterProperties.getLineDisplayProperties(int index)Returns device implementation of LineDisplayProperties.voidrun()Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposDevice
beltInit, billAcceptorInit, billDispenserInit, biometricsInit, bumpBarInit, cashChangerInit, cashDrawerInit, cATInit, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, checkScannerInit, coinAcceptorInit, coinDispenserInit, deviceMonitorInit, electronicJournalInit, electronicValueRWInit, fiscalPrinterInit, gateInit, gestureControlInit, getArrayOf, getBeltProperties, getBillAcceptorProperties, getBillDispenserProperties, getBiometricsProperties, getBumpBarProperties, getCashChangerProperties, getCATProperties, getCheckScannerProperties, getCoinAcceptorProperties, getCoinDispenserProperties, getDeviceMonitorProperties, getElectronicValueRWProperties, getGateProperties, getGestureControlProperties, getGraphicDisplayProperties, getHardTotalsProperties, getImageScannerProperties, getIndividualRecognitionProperties, getItemDispenserProperties, getKeylockProperties, getLightsProperties, getMICRProperties, getMotionSensorProperties, getMSRProperties, getPINPadProperties, getPointCardRWProperties, getPOSKeyboardProperties, getPOSPowerProperties, getPOSPrinterProperties, getRemoteOrderDisplayProperties, getRFIDScannerProperties, getScaleProperties, getScannerProperties, getSignatureCaptureProperties, getSmartCardRWProperties, getSoundPlayerProperties, getSoundRecorderProperties, getSpeechSynthesisProperties, getToneIndicatorProperties, getVideoCaptureProperties, getVoiceRecognitionProperties, graphicDisplayInit, hardTotalsInit, imageScannerInit, individualRecognitionInit, itemDispenserInit, keylockInit, lightsInit, lineDisplayInit, mICRInit, motionSensorInit, mSRInit, noOfPropertySets, pINPadInit, pointCardRWInit, pOSKeyboardInit, pOSPowerInit, pOSPrinterInit, remoteOrderDisplayInit, rFIDScannerInit, scaleInit, scannerInit, signatureCaptureInit, smartCardRWInit, soundPlayerInit, soundRecorderInit, speechSynthesisInit, toneIndicatorInit, videoCaptureInit, voiceRecognitionInitMethods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposBaseDevice
check, checkext, checkMember, checkRange, concurrentProcessingSupported, createConcurrentRequestThread, delay, getClaimingInstance, getCount, getPropertySetInstance, getRequestRunnersRequest, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handlePowerStateOnEnable, invokeRequestThread, log, member, member, postDirectIOProcessing, postTransitionProcessing, prepareSignalStatusWaits, processEventList, removePropertySet, signalStatusWaits, stringArrayToLongArray, synchronizedMessageBox
-
Field Details
-
RequestTimeout
public int RequestTimeoutMaximum time between acknowledge and response frame. Default: 2000. Can be set via jpos.xml. -
SAMPLEFISCALPRINTERDIO_EXECCOMMAND
public static final int SAMPLEFISCALPRINTERDIO_EXECCOMMANDCommand for DirectIO: Send native command(s) and retrieve the response(s).- See Also:
- Constant Field Values
-
SAMPLEFISCALPRINTERDIO_NONFISCALRECEIPTTRAILER
public static final int SAMPLEFISCALPRINTERDIO_NONFISCALRECEIPTTRAILERDirectIO: Sets flag for non-fiscal receipt printing (with / without trailer lines).- See Also:
- Constant Field Values
-
SAMPLEFISCALPRINTERDIO_FISCALIZE
public static final int SAMPLEFISCALPRINTERDIO_FISCALIZEDirectIO: Perform fiscalization. In addition to VAT table, header and trailer lines, store fiscal ID and POS ID, the serial number must be set as well. This can be done in the simulator (debug window, "set SerialNo [number]", where [number] should be replaced by any unique number).- See Also:
- Constant Field Values
-
SAMPLEFISCALPRINTERFXO_SIGNON
public static final int SAMPLEFISCALPRINTERFXO_SIGNONBeginFixedOutput: documentType for sign on. It can be used to set the cashier number after day has been opened to a non-zero value.- See Also:
- Constant Field Values
-
SAMPLEFISCALPRINTERFXO_SIGNOFF
public static final int SAMPLEFISCALPRINTERFXO_SIGNOFFBeginFixedOutput: documentType for sign off. It can be used to set the cashier number after day has been opened to zero.- See Also:
- Constant Field Values
-
SAMPLEFISCALPRINTERFXO_HEAD
public static final int SAMPLEFISCALPRINTERFXO_HEADHeader of fixed output receipts. Data must be an empty string.- See Also:
- Constant Field Values
-
SAMPLEFISCALPRINTERFXO_ON_CASHIER
public static final int SAMPLEFISCALPRINTERFXO_ON_CASHIERFirst line no. of SIGNON receipt. Data must be the number of the cashier to be signed on.- See Also:
- Constant Field Values
-
SAMPLEFISCALPRINTERFXO_ON_END
public static final int SAMPLEFISCALPRINTERFXO_ON_ENDLast line of a SIGNON. Data must be an empty string.- See Also:
- Constant Field Values
-
SAMPLEFISCALPRINTERFXO_OFF_CASHIER
public static final int SAMPLEFISCALPRINTERFXO_OFF_CASHIERFirst line no. of SIGNOFF receipt. Data must be the number of the cashier to be signed off.- See Also:
- Constant Field Values
-
SAMPLEFISCALPRINTERFXO_OFF_SECRET
public static final int SAMPLEFISCALPRINTERFXO_OFF_SECRETOptional second line of a SIGNOFF receipt. Data must be a secret number used for later sign on operations.- See Also:
- Constant Field Values
-
SAMPLEFISCALPRINTERFXO_OFF_END
public static final int SAMPLEFISCALPRINTERFXO_OFF_ENDLast line of a SIGNOFF. Data must be an empty string.- See Also:
- Constant Field Values
-
-
Constructor Details
-
Device
The device implementation. See parent for further details.- Parameters:
id- COM port or TCP address for simulator communication.
-
-
Method Details
-
checkProperties
public void checkProperties(jpos.config.JposEntry entry) throws jpos.JposExceptionDescription copied from class:JposBaseDeviceChecks whether a JposEntry belongs to a predefined property value an if so, sets the corresponding driver value- Overrides:
checkPropertiesin classJposBaseDevice- Parameters:
entry- Entry to be checked, contains value to be set- Throws:
jpos.JposException- if a property value is invalid
-
changeDefaults
Description copied from class:JposDeviceChange defaults of properties. Must be implemented within derived classed that support fiscal printer services.- Overrides:
changeDefaultsin classJposDevice- Parameters:
props- Property set for setting the property defaults
-
changeDefaults
Description copied from class:JposDeviceChange defaults of properties. Must be implemented within derived classed that support electronic journal services.- Overrides:
changeDefaultsin classJposDevice- Parameters:
props- Property set for setting the property defaults
-
changeDefaults
Description copied from class:JposDeviceChange defaults of properties. Must be implemented within derived classed that support line display services.- Overrides:
changeDefaultsin classJposDevice- Parameters:
props- Property set for setting the propperty defaults
-
changeDefaults
Description copied from class:JposDeviceChange defaults of properties. Must be implemented within derived classed that support cash drawer services.- Overrides:
changeDefaultsin classJposDevice- Parameters:
props- Property set for setting the property defaults
-
run
public void run() -
getCashDrawerProperties
Description copied from class:JposDeviceReturns device implementation of CashDrawerProperties.- Overrides:
getCashDrawerPropertiesin classJposDevice- Parameters:
index- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of CashDrawerProperties that matches the requirements of the corresponding device service.
-
getLineDisplayProperties
Description copied from class:JposDeviceReturns device implementation of LineDisplayProperties.- Overrides:
getLineDisplayPropertiesin classJposDevice- Parameters:
index- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of LineDisplayProperties that matches the requirements of the corresponding device service.
-
getFiscalPrinterProperties
Description copied from class:JposDeviceReturns device implementation of FiscalPrinterProperties.- Overrides:
getFiscalPrinterPropertiesin classJposDevice- Parameters:
index- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of FiscalPrinterProperties that matches the requirements of the corresponding device service.
-
getElectronicJournalProperties
Description copied from class:JposDeviceReturns device implementation of ElectronicJournalProperties.- Overrides:
getElectronicJournalPropertiesin classJposDevice- Parameters:
index- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of ElectronicJournalProperties that matches the requirements of the corresponding device service.
-