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

Timestamp format millisecs #378

Merged
merged 11 commits into from
May 4, 2020
Merged

Conversation

will-moore
Copy link
Member

@will-moore will-moore commented Apr 19, 2020

Fixes #375

This adds supports for displaying timestamp labels in milliseconds or mins:secs.
Previously, all timestamps were loaded as seconds (timestamps were rounded when images were added to figures) and these integer values are stored in the figure JSON, so all existing figures can't have timestamps in milliseconds.

So, when older figures are open (VERSION 4) we now load un-rounded timestamps from the server to update those values in the figure JSON.
This allows us to choose "milliseconds" for timestamp labels (also "mins:secs") AND fixes the display of milliseconds for the label beside the T-slider.

To test:

  • Use https://merge-ci.openmicroscopy.org/web/figure/file/25179 (user-3) which was created with VERSION 4 (last release). In this figure, timestamps are rounded to seconds (integers).
  • Open this figure - Browser console will say "Transforming to VERSION 5" and "Load timestamps for images (3) [83221, 64166, 122915]".
  • Now timestamps should be available without rounding. Can see full values with File > Export as JSON.
  • Add new images - their timestamps should also not be rounded.
  • T-slider label should now show time as hh:mm:ss.ss e.g. 00:03:45.02.
  • Add Time-labels, test using "milliseconds" and "mins:secs".
  • Save, reload. Check OK.
  • Export and check that all timestamps in PDF/TIFF match those in the web.

@jburel
Copy link
Member

jburel commented Apr 22, 2020

The slider shows 00:00:10.71, as a user, I will expect to see the same in the label

@will-moore
Copy link
Member Author

@jburel Which label? What format did you choose for the label?

@jburel
Copy link
Member

jburel commented Apr 22, 2020

[mins:secs]

@will-moore
Copy link
Member Author

Then the label should say 00:11 (mins:secs) rounded to nearest second.

@jburel
Copy link
Member

jburel commented Apr 22, 2020

it is rounded to the nearest second 10.47 -> 10. My point was more that the time is displayed in the slider as 10.47 but the precision is lost when adding as a label

@will-moore
Copy link
Member Author

If the user chooses mins:secs format then they are probably showing a bunch of frames from a movie that lasts several minutes, so they don't need to see milliseconds.
That's what I see when I look at figures from papers.
Sometimes it's even less precision. e.g. 5 mins, 10 mins, 15 mins etc.. If the microscope didn't get around to acquiring the image until 5 mins 1.52 secs, they don't want to show that on the figure.

@will-moore
Copy link
Member Author

We could add a format for mins:secs.00 (or something) if we also want to support that.
It might be useful for FRAP example where some frames are very fast to start with, but the movie is longer than a few milliseconds?

@will-moore
Copy link
Member Author

Fixed "millisecs" and "secs" to "milliseconds" and "seconds".
Menu options now look like this:

Screenshot 2020-05-01 at 14 56 10

And formatted on the figure like this (uses "ms" and "s" units):
Screenshot 2020-05-01 at 14 56 23

@jburel
Copy link
Member

jburel commented May 4, 2020

Thanks
We should probably do a release before the community meeting

@jburel jburel merged commit 457ea52 into ome:master May 4, 2020
@jburel jburel mentioned this pull request May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More time-stamp formatting options
3 participants