Class DoPriceCalculating

All Implemented Interfaces:
Runnable

public class DoPriceCalculating extends ReadLiveWeightWithTare
Input request executor for Scale method DoPriceCalculating.
  • Field Details

    • UnitPrice

      public long UnitPrice
      UnitPrice unitPrice from scale.
  • Constructor Details

    • DoPriceCalculating

      public DoPriceCalculating(JposCommonProperties props, int weightData, int tare, long unitPrice, long unitPriceX, int weightUnitX, int weightNumeratorX, int weightDenominatorX, long price, int timeout)
      Constructor. Stores given parameters for later use.
      Parameters:
      props - Property set of device service.
      weightData - Preset for returned value for the weight measured by the scale.
      tare - The value used to determine the item net weight in the price calculation algorithm.
      unitPrice - The cost per measurement unit that is used in the price calcuation algorithm.
      unitPriceX - See UPOS specification, chapter Scale - Methods - doPriceCalculating Method.
      weightUnitX - See UPOS specification, chapter Scale - Methods - doPriceCalculating Method.
      weightNumeratorX - See UPOS specification, chapter Scale - Methods - doPriceCalculating Method.
      weightDenominatorX - See UPOS specification, chapter Scale - Methods - doPriceCalculating Method.
      price - The calculated monetary value for the item on the scale.
      timeout - The number of milliseconds to wait for a settled weight before failing the method.
  • Method Details

    • getWeightUnitX

      public int getWeightUnitX()
      Scale method DoPriceCalculating parameter weightUnitX, see UPOS specification.
      Returns:
      weightUnitX preset passed to the message before calling invoke, weightUnitX from scale after successful invocation.
    • getWeightNumeratorX

      public int getWeightNumeratorX()
      Scale method DoPriceCalculating parameter weightNumeratorX, see UPOS specification.
      Returns:
      weightNumeratorX preset passed to the message before calling invoke, weightNumeratorX from scale after successful invocation.
    • getWeightDenominatorX

      public int getWeightDenominatorX()
      Scale method DoPriceCalculating parameter weightDenominatorX, see UPOS specification.
      Returns:
      weightDenominatorX preset passed to the message before calling invoke, weightDenominatorX from scale after successful invocation.
    • getUnitPriceX

      public long getUnitPriceX()
      Scale method DoPriceCalculating parameter unitPriceX, see UPOS specification.
      Returns:
      unitPriceX preset passed to the message before calling invoke, unitPriceX from scale after successful invocation.
    • invoke

      public void invoke() throws jpos.JposException
      Description copied from class: JposOutputRequest
      Invokes the command. Must be implemented in derived class. Calls finished() to wake up potentially waiting threads.
      Overrides:
      invoke in class ReadLiveWeightWithTare
      Throws:
      jpos.JposException - JposException thrown by the command to be executed.