Class BTMeasureCalculateCounterAlign
java.lang.Object
overit.geocall.bl.BusinessTask<MeasureCalculateCounterAlignEvent>
overit.geocallapp.wfm.measuringelements.bl.measuringelement.measure.task.BTMeasureCalculateCounterAlign
- All Implemented Interfaces:
Serializable,Tool
@Event(MeasureCalculateCounterAlignEvent.class)
public class BTMeasureCalculateCounterAlign
extends BusinessTask<MeasureCalculateCounterAlignEvent>
Business task that handles the calculation and alignment of measure counters.
This class processes both forward and backward counters, calculating values such as:
- Cumulative values
- Delta values
- Total rotations
- Counter overflow handling
The task supports two types of measures:
- Counter-based measures (with rotation handling)
- Simple quantitative measures
It also determines if user input is required for rotation counts based on the counter direction and current/previous values.
- Since:
- 20.0
- See Also:
- GCApi:
- task
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BOMeasureprotected BOMeasuringElementprotected MeasureCalculateCounterAlignOutputprotected BOMeasure -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidMethod that aligns the counter of the measure.protected voidMethod that aligns the counter of the measure.protected voidbody(MeasureCalculateCounterAlignEvent measureCheckCounterAlignEvent, PoolKit pk) Implements this method to write the specific task logic to handle the input parameter.protected voidcalculateBackwardValues(double previousCumulativeValue, Long counterMaxValue, Long mode) Method that calculates the values for a backward counter.protected voidcalculateForwardValues(double previousCumulativeValue, Long counterMaxValue, Long mode) Method that calculates the values for a forward counter.protected voidMethod that calculates the total rotation.protected voidcalculateValuesBasedOnDirection(double previousCumulativeValue, Long counterMaxValue, Long mode) Method that calculates the values based on the direction of the counter.protected voidMethod that initializes the values to check the counter alignment.protected voidsetOutputData(boolean askForRotation) Method that updates the output.protected booleanshouldAskForRotation(double previousValue) Method that checks if the user should define the number of rotations.Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Field Details
-
previousMeasure
-
measuringElement
-
currentMeasure
-
output
-
-
Constructor Details
-
BTMeasureCalculateCounterAlign
public BTMeasureCalculateCounterAlign()
-
-
Method Details
-
body
protected void body(MeasureCalculateCounterAlignEvent measureCheckCounterAlignEvent, PoolKit pk) throws DAException, DAValidateException Description copied from class:BusinessTaskImplements this method to write the specific task logic to handle the input parameter.- Specified by:
bodyin classBusinessTask<MeasureCalculateCounterAlignEvent>- Parameters:
measureCheckCounterAlignEvent- the object upon which the task will works onpk- the poolkit containing the reference to the database connection that can be used- Throws:
DAException- in case of database errorDAValidateException- in case of database validation error
-
alignCounter
protected void alignCounter()Method that aligns the counter of the measure. -
initializeOutputValues
protected void initializeOutputValues()Method that initializes the values to check the counter alignment. -
calculateTotalRotation
protected void calculateTotalRotation()Method that calculates the total rotation. -
calculateValuesBasedOnDirection
protected void calculateValuesBasedOnDirection(double previousCumulativeValue, Long counterMaxValue, Long mode) Method that calculates the values based on the direction of the counter. -
calculateForwardValues
protected void calculateForwardValues(double previousCumulativeValue, Long counterMaxValue, Long mode) Method that calculates the values for a forward counter. -
calculateBackwardValues
protected void calculateBackwardValues(double previousCumulativeValue, Long counterMaxValue, Long mode) Method that calculates the values for a backward counter. -
setOutputData
protected void setOutputData(boolean askForRotation) Method that updates the output. -
shouldAskForRotation
protected boolean shouldAskForRotation(double previousValue) Method that checks if the user should define the number of rotations.- Returns:
- a flag that indicates if the user should define the number of rotations
-
alignSimpleQuantitativeMeasure
protected void alignSimpleQuantitativeMeasure()Method that aligns the counter of the measure.
-