Class Device


public class Device extends JposDevice
JposDevice based dummy implementation, currently for JavaPOS CheckScanner and ImageScanner device service implementation. No real hardware. Scanned images always with dummy values, operator interaction via OptionDialog boxes.
Supported configuration values for CheckScanner in jpos.xml are:
  • ContrastCheck: The value of a CheckScanner's Contrast property. Must be a value between 0 and 100, default: 50.
  • MaxCropAreasCheck: The maximum number of crop areas a CheckScanner supports, default: 3.
  • MaxHeightCheck: The maximum height of a CheckScanner scan in (0.001 inch) units, default: 3000 (3 inch).
  • MaxWidthCheck: The maximum width of a CheckScanner scan in (0.001 inch) units, default: 6000 (6 inch).
In this simulator implementation, image data for CheckScanner will be returned in a byte array with one bit per dot, starting with the left-most column, with the bit values of the first row in the MSB of the first byte of each row. Depending on the Quality property which can be set to 100 or 300, each column consists of 300 or 900 dots stored in 38 or 113 bytes, therefore a full scan with 600 0o 1800 colums consists of 22800 or 203400 byte. Surprise: Since this simulator cannot really scan a check, all dot values will always be 0 (white).
Supported configuration values for ImageScanner in jpos.xml are:
  • HeightImage: The value of a ImageScanner's image height. Must be a value above 0, default: 500.
  • WidthImage: The value of a ImageScanner's image width. Must be a value above 0, default: 500.
  • BitsPerPixelImage: The number of bits per pixel. Must be a value above 0, default: 8.
  • AimModeImage: Specifies whether an aiming spot will be simulated, default: true.
  • IlluminateModeImage: Specifies whether illumination will be simulated, default: true.
  • SessionTimeoutImage: Specifies the maximum session length. Zero means CapHostTriggered becomes false, default: FOREVER (-1).
  • ImageType: Specifies the value of ImageType set before data event delivery, one of BMP, JPEG, GIF, PNG or TIFF. Default: JPEG
In this simulator implementation, image data for ImageScanner will be returned in a byte array with BitsPerPixelImage bit per dot, Depending on the Quality property which can be set to QUAL_LOW, QUAL_MED or QUAL_HIGH, the size of the byte array will be about 1/3, 2/3 or 3/3 or width * height * bits per pixel / 8. But Surprise: Since this simulator cannot really scan an image, all byte values will be 0. This implies that the frame data structure is not as it should be based on the ImageType property.
  • Constructor Details

    • Device

      protected Device(String id)
      The device implementation. See parent for further details.
      Parameters:
      id - Device ID, not used by implementation.
  • Method Details

    • checkProperties

      public void checkProperties(jpos.config.JposEntry entry) throws jpos.JposException
      Description copied from class: JposBaseDevice
      Checks whether a JposEntry belongs to a predefined property value an if so, sets the corresponding driver value
      Overrides:
      checkProperties in class JposBaseDevice
      Parameters:
      entry - Entry to be checked, contains value to be set
      Throws:
      jpos.JposException - if a property value is invalid
    • changeDefaults

      public void changeDefaults(CheckScannerProperties props)
      Description copied from class: JposDevice
      Change defaults of properties. Must be implemented within derived classed that support check scanner services.
      Overrides:
      changeDefaults in class JposDevice
      Parameters:
      props - Property set for setting the property defaults
    • getCheckScannerProperties

      public CheckScannerProperties getCheckScannerProperties(int index)
      Description copied from class: JposDevice
      Returns device implementation of CheckScannerProperties.
      Overrides:
      getCheckScannerProperties in class JposDevice
      Parameters:
      index - Device index, see constructor of JposCommonProperties.
      Returns:
      Instance of CheckScannerProperties that matches the requirements of the corresponding device service.
    • changeDefaults

      public void changeDefaults(ImageScannerProperties props)
      Description copied from class: JposDevice
      Change defaults of properties. Must be implemented within derived classed that support image scanner services.
      Overrides:
      changeDefaults in class JposDevice
      Parameters:
      props - Property set for setting the property defaults
    • getImageScannerProperties

      public ImageScannerProperties getImageScannerProperties(int index)
      Description copied from class: JposDevice
      Returns device implementation of ImageScannerProperties.
      Overrides:
      getImageScannerProperties in class JposDevice
      Parameters:
      index - Device index, see constructor of JposCommonProperties.
      Returns:
      Instance of ImageScannerProperties that matches the requirements of the corresponding device service.