Class BTMeasureCalculateCounterAlign

java.lang.Object
overit.geocall.bl.BusinessTask<MeasureCalculateCounterAlignEvent>
overit.geocallapp.wfm.measuringelements.bl.measuringelement.measure.task.BTMeasureCalculateCounterAlign
All Implemented Interfaces:
Serializable, Tool

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 Details

  • Constructor Details

    • BTMeasureCalculateCounterAlign

      public BTMeasureCalculateCounterAlign()
  • Method Details

    • body

      protected void body(MeasureCalculateCounterAlignEvent measureCheckCounterAlignEvent, PoolKit pk) throws DAException, DAValidateException
      Description copied from class: BusinessTask
      Implements this method to write the specific task logic to handle the input parameter.
      Specified by:
      body in class BusinessTask<MeasureCalculateCounterAlignEvent>
      Parameters:
      measureCheckCounterAlignEvent - the object upon which the task will works on
      pk - the poolkit containing the reference to the database connection that can be used
      Throws:
      DAException - in case of database error
      DAValidateException - 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.