Class DoPriceCalculating
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
de.gmxhome.conrad.jpos.jpos_base.JposInputRequest
de.gmxhome.conrad.jpos.jpos_base.scale.ReadWeight
de.gmxhome.conrad.jpos.jpos_base.scale.ReadLiveWeightWithTare
de.gmxhome.conrad.jpos.jpos_base.scale.DoPriceCalculating
- All Implemented Interfaces:
Runnable
Input request executor for Scale method DoPriceCalculating.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
JposOutputRequest.JposRequestThread
-
Field Summary
FieldsFields inherited from class de.gmxhome.conrad.jpos.jpos_base.scale.ReadLiveWeightWithTare
Tare
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.scale.ReadWeight
SalesPrice, WeightData
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
Abort, AdditionalData, Device, EndSync, Exception, Finished, OutputID, Props, Waiting
-
Constructor Summary
ConstructorsConstructorDescriptionDoPriceCalculating(JposCommonProperties props, int weightData, int tare, long unitPrice, long unitPriceX, int weightUnitX, int weightNumeratorX, int weightDenominatorX, long price, int timeout)
Constructor. -
Method Summary
Modifier and TypeMethodDescriptionlong
Scale method DoPriceCalculating parameter unitPriceX, see UPOS specification.int
Scale method DoPriceCalculating parameter weightDenominatorX, see UPOS specification.int
Scale method DoPriceCalculating parameter weightNumeratorX, see UPOS specification.int
Scale method DoPriceCalculating parameter weightUnitX, see UPOS specification.void
invoke()
Invokes the command.Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.scale.ReadWeight
getTimeout
Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposInputRequest
createErrorEvent, createOutputEvent, enqueue, finishAsyncProcessing, reactivate
Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
abortCommand, abortCommand, catchedInvocation, clearAll, clearInput, clearOutput, countCommands, createIdleEvent, dequeue, enqueueSynchronous, finished, reactivate, reset, run
-
Field Details
-
UnitPrice
public long UnitPriceUnitPrice 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.JposExceptionDescription copied from class:JposOutputRequest
Invokes the command. Must be implemented in derived class. Calls finished() to wake up potentially waiting threads.- Overrides:
invoke
in classReadLiveWeightWithTare
- Throws:
jpos.JposException
- JposException thrown by the command to be executed.
-