org.vishia.gral.base

## Class GralCurveView.TimeOrganisation

- java.lang.Object
- - org.vishia.gral.base.GralCurveView.TimeOrganisation

- Enclosing class:
    GralCurveView

      public static class GralCurveView.TimeOrganisation
      extends java.lang.Object

  Inner class for time organisation.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) Timeshort` | `absTime`
    `private int` | `ctTimeSet` It is counted while the pair `#absTime_short` and `absTime` is set newly.
    `int` | `firstShortTimeDateInCurve` Short time stamp of the oldest stored point.
    `int` | `lastShortTimeDateInCurve`
    `(package private) int` | `millisecPerDiv` Number of millisec between 2 fine divisions.
    `(package private) int[]` | `millisecPerDivVariants` Milliseconds per division for number of pixel per fine division between 12..30.
    `(package private) int` | `millisecPerFineDiv` Number of millisec between 2 fine divisions.
    `(package private) int[]` | `millisecPerFineDivVariants`
    `int` | `nrofPixelForTimestep`
    `float` | `pixel7time` The reciprocal of `timePerPixel`.
    `(package private) float` | `pixelPerTimeDiv` Number of pixel per 1 fine division in vertical lines.
    `(package private) float` | `pixelPerTimeFineDiv` Number of pixel per 1 fine division in vertical lines.
    `int` | `pixelWrittenAfterStrongDiv` Accumulated nr of pixel written with short drawing after a strong division.
    `java.lang.String[]` | `sTimeAbsDiv` The text written at the time divisions.
    `long` | `timeAbsOnLastStrongDiv`
    `int` | `timeLeftShowing` The last tested time to produce vertical lines for time division.
    `float` | `timePerPixel` Number of shorttime units for 1 pixel.
    `(package private) int` | `timeshortAdd` Value to add to the time stamp to get a continuous time for some simulations one after another.
    `(package private) int` | `timeshortLast` The last timeshort from the timeVariable.
    `int` | `timeSpread` Number of time shortTime steps to showing the curve in the current view.
    `int[]` | `xPixelTimeDiv` Pixel position from right for fine divisions of time lines (vertical lines) and normal divisions.
    `int[]` | `xPixelTimeDivFine` Pixel position from right for fine divisions of time lines (vertical lines) and normal divisions.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimeOrganisation()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `calc()` Calculates the divisions with known `timePerPixel`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### absTime

          Timeshort absTime

    - #### ctTimeSet

          private volatile int ctTimeSet

      It is counted while the pair `#absTime_short` and `absTime` is set newly. The pair is consistent only if this counter is the same before and after read.

    - #### timeshortLast

          int timeshortLast

      The last timeshort from the timeVariable. To detect newly simulation if it starts with a lesser value.

    - #### timeshortAdd

          int timeshortAdd

      Value to add to the time stamp to get a continuous time for some simulations one after another.

    - #### lastShortTimeDateInCurve

          public int lastShortTimeDateInCurve

    - #### firstShortTimeDateInCurve

          public int firstShortTimeDateInCurve

      Short time stamp of the oldest stored point.

    - #### nrofPixelForTimestep

          public int nrofPixelForTimestep

    - #### pixelPerTimeDiv

          float pixelPerTimeDiv

      Number of pixel per 1 fine division in vertical lines. The time for 1 division is a rounded number. The number of pixel have to be float, because it is cummulated.

    - #### pixelPerTimeFineDiv

          float pixelPerTimeFineDiv

      Number of pixel per 1 fine division in vertical lines. The time for 1 division is a rounded number. The number of pixel have to be float, because it is cummulated.

    - #### millisecPerDiv

          int millisecPerDiv

      Number of millisec between 2 fine divisions. It is a number of millisec able to divide by 10, 5 or 2.

    - #### millisecPerFineDiv

          int millisecPerFineDiv

      Number of millisec between 2 fine divisions. It is a number of millisec able to divide by 10, 5 or 2.

    - #### timePerPixel

          public float timePerPixel

      Number of shorttime units for 1 pixel. A time unit may be 1 millisecond for currently showing curves. This value may be e.g. 100 to show 30 seconds in 300 pixel or e.g. 10 to show 5 seconds in 500 pixel. This value may be given in another unit for example 1 microseconds. It should be the same value unit as used in `GralCurveView.setSample(float[], int)`.

    - #### pixel7time

          public float pixel7time

      The reciprocal of `timePerPixel`. The number of pixel for 1 short time step. It is less 1.0 often.

    - #### timeSpread

          public int timeSpread

      Number of time shortTime steps to showing the curve in the current view. If this value is given (>=0) then the `timePerPixel` will be calculated from this regarding the current graphic size. This value should be given in the same value unit as used for `GralCurveView.setSample(float[], int)`.

    - #### timeLeftShowing

          public int timeLeftShowing

      The last tested time to produce vertical lines for time division.

    - #### timeAbsOnLastStrongDiv

          public long timeAbsOnLastStrongDiv

    - #### pixelWrittenAfterStrongDiv

          public int pixelWrittenAfterStrongDiv

      Accumulated nr of pixel written with short drawing after a strong division. It is used to write the number after a proper time.

    - #### xPixelTimeDiv

          public final int[] xPixelTimeDiv

      Pixel position from right for fine divisions of time lines (vertical lines) and normal divisions. This array is filled newly whenever any draw or paint action is done. It is prepared in the routine `#prepareIndicesDataForDrawing(int, int, int)` and used in the draw routine of the implementation level.

    - #### xPixelTimeDivFine

          public final int[] xPixelTimeDivFine

      Pixel position from right for fine divisions of time lines (vertical lines) and normal divisions. This array is filled newly whenever any draw or paint action is done. It is prepared in the routine `#prepareIndicesDataForDrawing(int, int, int)` and used in the draw routine of the implementation level.

    - #### sTimeAbsDiv

          public final java.lang.String[] sTimeAbsDiv

      The text written at the time divisions. It is a mm:ss, ss.SSS or hh::mm

    - #### millisecPerFineDivVariants

          int[] millisecPerFineDivVariants

    - #### millisecPerDivVariants

          int[] millisecPerDivVariants

      Milliseconds per division for number of pixel per fine division between 12..30.

  - ### Constructor Detail

    - #### TimeOrganisation

          public TimeOrganisation()

  - ### Method Detail

    - #### calc

          public void calc()

      Calculates the divisions with known `timePerPixel`. This routine should be called whenever the display zoom will be changed. It sets `#divType`, `pixelPerTimeFineDiv`, `millisecPerFineDiv`