Skip to content

Level Crossing: optimize start and stop of light blinking sequence #166

Description

@Mattzobricks

The activation of lights of the level crossing may happen any time. The blinking and fading sequence is defined indepdently of the start time of the closing sequence on an absolute time line. That means, that the are lights immediately set to some fading value in the "middle" of the blinking sequence when the closing sequence starts, and suddenly stop when it is fully opened again.

The goal is to achieve a smooth and realistic start and stop of the blinking sequence. That means, the the following changes must be implemented:

The flashing period needs to begin at the start of the fading sequence.

The lights must remain dark until phaseShift for the specific light has passed.

When the level crossing is fully opened again, the lights must not be extinguished immediately. Instead, they must complete their present flashing period.

Implementation ideas:

  • It might be useful to introduce a status model for each light.
  • Instead of flipping the fading sequence on and off by the status of the level crossing directly, the status changes of the level crossing should rather change the status of the lights.
  • Useful states could be:
    -- OFF
    -- INITIATING
    -- ACTIVE
    -- TERMINATING
  • Lights are illuminated and follow their fading sequence, if they are ACTIVE or TERMINATING. Else they are dark.
  • When the LC is closing, the state for all lights is set:
    -- to INITIATING, if status was OFF,
    -- to ACTIVE, if status was TERMINATING
  • When the LC is fully opened, the state for all lights is set:
    -- to TERMINATING, if status was ACTIVE,
    -- to OFF, if status was INITIATING
  • When now > startTime + phaseShift and status is INITIATING, set to ACTIVE.
  • When end of flashing period is reached and status is TERMINATING, set to OFF.

Feature must also work for blinking (non-fading) lights.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

MLCMattzoLayoutController

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions