Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global clock #5773

Closed
akhenry opened this issue Sep 15, 2022 · 3 comments · Fixed by #6768
Closed

Global clock #5773

akhenry opened this issue Sep 15, 2022 · 3 comments · Fixed by #6768
Labels
type:feature Feature. Required intentional design
Milestone

Comments

@akhenry
Copy link
Contributor

akhenry commented Sep 15, 2022

Is your feature request related to a problem? Please describe.
Open MCT should provide a clock that is always ticking, irrespective of time conductor mode, to provide a canonical time value for "now". Many plugins need to know what the current time is according to the configured time system and clock, even if the time conductor is in "fixed" mode.

eg. Displays such as the time list view which display a moving "now" line relative to scheduled activities in the past and future.

Date.now() cannot be used for this purpose because Open MCT must support simulated times in the past and future, as well as non-terrestrial time systems.

Describe the solution you'd like

Stage 1: Separate the selection of "mode" from the selection of the "clock"

  1. Modify the time conductor UI to add a "mode" drop-down that selects between fixed and real-time modes. A drop-down for selecting the clock will be maintained, however the "fixed" option will be removed from it, as this is now selected via the "mode".
  2. Selecting "real-time" mode from the drop-down will set the active clock to the one that is currently selected in the "clock" drop-down. Selecting "fixed" mode will unset it. The conductor is already doing this, but with a single drop-down instead.

Stage 2: Add API support for a canonical Open MCT clock

  1. Modify the Time API to add a mode() getter/setter to time contexts. Setting the mode to real-time will start the configured clock, and cause the conductor's time context to automatically follow that clock, automatically updating the bounds as it currently does when following a clock. Setting the mode to fixed will stop the currently configured clock.
  2. Modify the Time API so that when a clock is set via the clock() setter that clock is also immediately started. The time context will only follow the clock if the mode is set to "real-time".

Stage 3: Refactor Clocks and Timers to follow the Open MCT clock instead of the wall clock

Stage 4: Modify Notebook entry timestamps to use the Open MCT clock instead of the wall clock.

** Open Questions**

  • What about object timestamps? I suspect we still want to use Date.now() for this. Although it might cause some user confusion, we need to know the wall-clock time that objects were created and modified for various API-internal reasons.
@shefalijoshi
Copy link
Contributor

shefalijoshi commented Apr 25, 2023

From initial discussions, and in the interest of maintaining backwards compatibility, we will retain (and deprecate) the existing time API methods - clock(), timeSystem(), bounds(), clockOffsets(), stopClock() as well as events like bounds, clock, clockOffsets, timeSystem.

A new set of getters and setters will be implemented to enhance the Time API as follows:
Events
clockChanged - emitted when ticking clock changes
modeChanged - fixed / realtime mode
boundsChanged - emitted once for fixed mode and for every tick in realtime mode
clockOffsetsChanged - emitted when the clock offsets change.
tick - always emitted with the current timestamp value

Methods

getTimeSystem
setTimeSystem

getMode
setMode

getBounds
setBounds

getClock
setClock

getClockOffsets
setClockOffsets

NOTE: Calls to the new methods will emit new events, while calls to the old methods will emit old events.

@jvigliotta
Copy link
Contributor

jvigliotta commented Jul 6, 2023

Testing Clocks, Timers, Clock Indicator

  • create clocks and timers
  • verify they seem to be working correctly
  • change the current clock to something noticeably different if possible (ex. future dates)
  • see if the clocks and times are respecting these times
  • check the clock indicator in the top of Open MCT and make sure it's working as expected

Testing Time Conductor (TC)

  • Make sure the Conductor appears as a single row element, and matches reference images as shown below.
  • Compress the TC width by dragging panes and/or resizing the browser window. Verify that text is truncated as shown in reference images and that precedence is given to the current time element in real-time mode, and to the start and end datetime stamps in fixed mode.
  • Make sure the URL time-based parameters are working correctly (ex. tc.mode, tc.startDelta, etc) by
    • Bookmarking/copying the URL, changing TC settings, then going back to the bookmarked/copied URL and ensuring that settings are applied as expected.
    • Perform a Snapshot of a plot view of telemetry. Change the settings, go to the Snapshot and choose "Navigate to Item in Time" from the 3 dot menu. Verify that the correct timeframe and is used to reconstitute the view.
  • Mouse over all elements in the main TC and verify that tooltips for each are displayed.
  • Mouse over all buttons in the two inputs popups and verify that tooltips for each are displayed.
  • Verify that the fixed mode ticks area allows panning (alt click + drag) and brush zooming (click + drag).
  • Verify that in real-time mode the TC displays "now" as expected by the following:
    • Observe the current value.
    • Change the future offset to several hours difference and apply.
    • Verify that the "now" value is not offset by several hours.

Inputs popups

  • Make sure that clicks on the Conductor invoke the appropriate inputs popup, as shown in reference images below.
  • In the inputs popup, play around with different settings and make sure you can:
    • Change mode (fixed, realtime) as expected.
    • Change the clock, if alternate clocks are available. Ensure the clock can be changed in both real-time and fixed modes.
    • Input values into the popup for both modes, and verify that settings are not applied until the clicking the "check" button.
    • Verify that inputs in the popup properly utilize validation in both real-time and fixed modes. Verify that the check button is disabled when the inputs are invalid, and is enabled when inputs are corrected.
    • View the History, and make sure that it's stacking entries as expected per mode.
  • Make selections from all the different menus (mode, clock, time system, history) and ensure that values are applied and menus are dismissed.
  • When using menus, test outside clicks to ensure that all popup menus close as expected.

Testing Independent Time Conductors (ITC)

Available in plot views in a Layout - to test, add to a layout.

  • Verify that you can toggle an ITC enabled to disabled and back via its toggle control.
  • Verify that clicking the expanded ITC displays a properly positioned inputs popup similarly to the main TC.
    • Verify that clicking the collapsed ITC does NOT display the inputs popup.
  • Scroll the layout's view such that the ITC is close to the top edge of the layout's view area. Click the ITC to display the inputs popup, and verify that the popup is positioned well in the available view area and isn't clipped.
    • Repeat the above with the ITC close to the bottom edge of the layout's view area.
  • Make sure the ITC's settings are properly applied to its view independently from the main Conductor - different modes, timeframes, clocks, etc.
  • Make sure the ITC's settings are persisted by setting, then navving away, refreshing and navving back.

Reference Images

Main TC, fixed time

Screen Shot 2023-07-13 at 2 53 32 PM

Main TC with truncation, fixed time

Screen Shot 2023-07-13 at 2 53 21 PM

Main TC with inputs popup, fixed time

Screen Shot 2023-07-13 at 2 53 10 PM

Main TC, real-time

Screen Shot 2023-07-13 at 2 52 15 PM

Main TC with truncation, real-time

Screen Shot 2023-07-13 at 2 52 41 PM

Main TC with inputs popup, real-time

Screen Shot 2023-07-13 at 2 53 00 PM

Main TC with super menu

Screen Shot 2023-07-13 at 3 10 35 PM

Independent TC example

Screen Shot 2023-07-13 at 3 20 50 PM

akhenry added a commit that referenced this issue Jul 19, 2023
* Fixed #4975 - Compact Time Conductor styling
* Fixed #5773 - Ubiquitous global clock
* Mode functionality added to TimeAPI
* TimeAPI modified to always have a ticking clock
* Mode dropdown added to independent and regular time conductors
* Overall conductor appearance modifications and enhancements
* TimeAPI methods deprecated with warnings
* Significant updates to markup, styling and behavior of main Time Conductor and independent version.


---------

Co-authored-by: Charles Hacskaylo <[email protected]>
Co-authored-by: Shefali <[email protected]>
Co-authored-by: Andrew Henry <[email protected]>
Co-authored-by: John Hill <[email protected]>
Co-authored-by: Scott Bell <[email protected]>
@ozyx ozyx added this to the Target:3.0.0 milestone Jul 19, 2023
@rukmini-bose
Copy link
Contributor

Issues found: #6811

@unlikelyzero unlikelyzero added type:feature Feature. Required intentional design and removed type:enhancement unverified labels Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature Feature. Required intentional design
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants