Compare commits

..

159 Commits

Author SHA1 Message Date
Henry
b939eb2fbe Hard-code telemetry metadata 2017-10-30 16:53:40 -07:00
Henry
1afecdc82c Trying to support CreateAction 2017-10-30 14:16:06 -07:00
Henry
b9cda6985e Only add (Mean) to range values 2017-10-30 11:28:18 -07:00
Henry
401b7e3f19 Decorate PropertiesAction instead of persistence service to catch properties updates 2017-10-30 09:50:30 -07:00
Henry
c9e9845172 Telemetry mean function 2017-10-27 14:12:44 -07:00
Henry
abbba38eac Fix precision of displayed numberical telemetry to 2 DP 2017-10-27 09:14:39 -07:00
Victor Woeltjen
db856251da [Telemetry] Handle unspecified domains/ranges
Handle cases where domains and ranges are not set from
TelemetryMetadataManager; these properties will only be
present on legacy telemetry objects.

Encountered issue while developing heat map view using
example telemetry.

Supports goals for sprint Alice, https://github.com/nasa/openmct/projects/1
2017-10-24 14:54:39 -07:00
Charles Hacskaylo
e1566e448d [Frontend] Kill iframe borders dead!
Fixes #1776
(cherry picked from commit 1685364)
2017-10-13 17:11:27 -07:00
Charles Hacskaylo
d9aae0700c Merge branch 'master' into demo-2017.1 2017-10-13 10:28:06 -07:00
Charles Hacskaylo
5c29726cc0 Merge branch 'demo-2017.1' of https://github.com/nasa/openmct into demo-2017.1 2017-10-04 15:16:33 -07:00
Charles Hacskaylo
5c207c3fe0 Merge branch 'timeline-follow-1688' into demo-2017.1 2017-10-04 15:13:56 -07:00
Pete Richards
eba1dd1a4e [Plugins] Match args to define string 2017-10-04 14:07:04 -07:00
Charles Hacskaylo
570edc0dec Merge in fixes from no-frame-margin-1745 2017-10-04 10:28:29 -07:00
Charles Hacskaylo
ad6bcd4ef8 [Frontend] Hide local controls for no-frame context
Fixes #1745
When a Layout or Fixed Position display is in a layout
with its frame hidden, also hide the hover buttons including
the View Large button.
2017-10-04 10:25:13 -07:00
Charles Hacskaylo
aedbbbbf75 [Frontend] Remove border definition causing scrollbars
Fixes #1745
2017-10-04 09:44:36 -07:00
Charles Hacskaylo
3caaf00483 Merge branch 'summary-widgets' into demo-2017.1 2017-10-04 09:23:46 -07:00
Charles Hacskaylo
971eda4d88 [Frontend] Standardized font-size in widgets
Fixes #1668
2017-10-04 09:23:10 -07:00
Charles Hacskaylo
090d216517 [Frontend] Changed no-frame margin to 0 from 2px
Fixes #1745
2017-10-03 16:47:53 -07:00
Charles Hacskaylo
d42d7ae68d Merge remote-tracking branch 'origin/summary-widgets' into demo-2017.1 2017-10-03 14:28:32 -07:00
Deep Tailor
68e6e3c121 finalize changes for v1 and add/fix tests 2017-10-02 09:32:26 -07:00
Charles Hacskaylo
7e7f39db2d Add tooltip values for duplicate and delete buttons
Fixes #1668
2017-09-28 15:36:47 -07:00
Charles Hacskaylo
b6e0fca828 Standardize to sentence casing
Fixes #1668
2017-09-28 15:31:26 -07:00
Deep Tailor
ffc5896e5a Merge branch 'summary-widgets' of https://github.com/nasa/openmct into summary-widgets 2017-09-28 11:06:06 -07:00
Deep Tailor
fd6ebd152f fix and add appropriate tests 2017-09-28 11:05:42 -07:00
Charles Hacskaylo
7a5c1c0e1f Clean up commented code
Fixes #1668
2017-09-28 10:35:38 -07:00
Charles Hacskaylo
2f7e1e3f1a [Frontend] Added missing condition label text
Fixes #1668
Each condition in a rule beyond the first one
now displays the text label "or when" or "and when"
depending on the value of the user's selection in
the "Trigger when" control: "any" or "all"
2017-09-27 15:53:43 -07:00
Charles Hacskaylo
d73746b51b [Frontend] Fix for tooltip not appearing
Fixes #1668
2017-09-27 14:49:00 -07:00
Deep Tailor
2df54af019 Merge branch 'summary-widgets' of https://github.com/nasa/openmct into summary-widgets 2017-09-27 11:23:57 -07:00
Deep Tailor
586269f761 remove js option from rules 2017-09-27 11:23:47 -07:00
Charles Hacskaylo
e536ab34d7 [Frontend] Added l-flex-accordion class
Fixes #1668
2017-09-26 17:44:35 -07:00
Charles Hacskaylo
e15002dd72 [Frontend] Added Rules expand/contract
Fixes #1668
2017-09-26 17:43:53 -07:00
Deep Tailor
453cf3ad6a watch for object changes and update url and newTab properties 2017-09-26 14:18:09 -07:00
Charles Hacskaylo
5c46e48bde Merge lastest master, resolve conflicts in _menus.scss
Fixes #1668
2017-09-26 11:51:53 -07:00
Deep Tailor
868ea9362f make open in same tab as default option for url 2017-09-25 16:04:23 -07:00
Charles Hacskaylo
d69106ff2c Merge remote-tracking branch 'origin/master' into summary-widgets
# Conflicts resolved:
#	platform/commonUI/general/res/sass/user-environ/_frame.scss
2017-09-25 12:33:42 -07:00
Deep Tailor
1658b17c56 add hyperlink functionality 2017-09-25 11:35:12 -07:00
Deep Tailor
39cf0528ca merge changes from charles 2017-09-25 10:04:44 -07:00
Deep Tailor
3d12f7312b checkstyle error fix 2017-09-25 10:04:25 -07:00
Charles Hacskaylo
22481fdc31 [Frontend] Set default widget colors and icon
Fixes #1668
2017-09-22 12:05:32 -07:00
Charles Hacskaylo
4a9d27dc79 [Frontend] Hover behaviors refined
Fixes #1668
2017-09-22 11:41:00 -07:00
Charles Hacskaylo
a5a9fefd40 [Frontend] Significant mods to vertical-align for inputs
Fixes #1668
vertical-align: middle for selects, inputs; removed
commented code;
2017-09-22 11:40:06 -07:00
Charles Hacskaylo
dae4074934 [Frontend] Various sanding and shimming
Fixes #1668
Added box-shadow to widget; better styles for
case where controls wrap;
2017-09-22 10:50:40 -07:00
Charles Hacskaylo
a540a3573f [Front-end] WIP Styling for widget in layout
Fixes #1668
2017-09-21 15:30:12 -07:00
Charles Hacskaylo
4e7fe9082c Merge remote-tracking branch 'origin/summary-widgets' into summary-widgets-styling-2 2017-09-21 15:26:47 -07:00
Charles Hacskaylo
568141bf81 [Front-end] WIP Styling for widget in layout
Fixes #1668
2017-09-21 15:26:28 -07:00
Deep Tailor
ac3ea43fe5 hide equal to label until select field is available 2017-09-21 15:22:55 -07:00
Charles Hacskaylo
e922e8d504 [Front-end] Add summary widgets to hide-buttons-in-Layout list
Fixes #1668
2017-09-21 15:11:15 -07:00
Charles Hacskaylo
650a877d2a [Front-end] Inject icon directly into widget Label
Fixes #1668
Remove .widget-icon element;
2017-09-21 15:04:35 -07:00
Deep Tailor
1202109c59 Merge branch 'summary-widgets-styling-2' of https://github.com/nasa/openmct into summary-widgets 2017-09-21 14:53:27 -07:00
Deep Tailor
429d7bbd57 add hide/unhide to select.js 2017-09-21 14:53:06 -07:00
Charles Hacskaylo
af749fe71b [Front-end] WIP for widget in Layout
Fixes #1668
Global rename of .l-widget-main to .w-summary-widget:
markup, SCSS and JS; styles; simplify widget markup;
2017-09-21 14:34:11 -07:00
Charles Hacskaylo
cf64c512ce [Front-end] Tweaks
Fixes #1668
More fine-grained selector to display editing UI;
Tweak to "no-data" message content;
2017-09-21 13:48:48 -07:00
Victor Woeltjen
14592d1c3e [Timeline] Follow up on front-end updates
Fixes #1688

Squashed commit of the following:

commit 817c7f31289b3e7631c3332d2192a68f21f50f9e
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 21 12:47:48 2017 -0700

    [Timeline] Initialize lastWidth

    ...to avoid clamping values before a width has actually been observed.

commit 5f7324c1cdb0cbef6385fbccac31b0404d216f95
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 21 12:21:11 2017 -0700

    [Timeline] Clamp right edge of zoom

    ...to avoid getting stuck in a weird scrolling state for large
    timer values.

commit 076aca112392e65835e7a01ac8e28780d24bfff1
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 21 12:02:23 2017 -0700

    [Timeline] Don't set scroll.x to negative values

    ...avoids mispositioning timer-following line,
    https://github.com/nasa/openmct/issues/1688#issuecomment-330373625

commit ac9bdb919df69fac65b297487131e2c41204ebeb
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 21 11:32:49 2017 -0700

    [Timers] Loosen test expectation

    Resolves build failure https://circleci.com/gh/nasa/openmct/4181
    by reducing test specificity for indicator display name.
2017-09-21 12:48:33 -07:00
Charles Hacskaylo
c5bd3da44a Merge remote-tracking branch 'origin/summary-widgets' into summary-widgets-styling-2 2017-09-21 11:39:04 -07:00
Deep Tailor
ff3e49e926 change composition policy to allow summary widgets to be added to folders, but not vice versa. Only allow telemetry producing objects to be added to summary widgets 2017-09-21 11:29:12 -07:00
Charles Hacskaylo
e244a3e431 [Front-end] New null value selection strings
Fixes #1668
2017-09-21 11:23:26 -07:00
Charles Hacskaylo
c5d9fb6fd9 [Front-end] Hide/show "no-data" message element
Fixes #1688
2017-09-21 11:11:12 -07:00
Charles Hacskaylo
4c276ab422 [Front-end] Normalize font sizing in overlay
Fixes #1688
2017-09-21 10:26:47 -07:00
Charles Hacskaylo
bf321abae4 Merge remote-tracking branch 'origin/summary-widgets' into summary-widgets-styling-2 2017-09-21 10:09:57 -07:00
Charles Hacskaylo
7336968ef9 [Frontend] Add message markup and styling
Fixes #1688
Add to Summary Widgets UI;
2017-09-20 18:03:03 -07:00
Charles Hacskaylo
d60956948b [Frontend] Sanding to avoid CSS collision
Fixes #1688
2017-09-20 18:02:26 -07:00
Charles Hacskaylo
23d5c2e1ee [Frontend] Refactor messages markup and styling
Fixes #1688
Significant changes! Refactor to allow messages markup and CSS to be used
in Summary Widgets UI
2017-09-20 18:01:26 -07:00
Deep Tailor
2632b8891a Merge latest styling changes from Charles 2017-09-20 14:56:05 -07:00
Deep Tailor
fff4cd9d51 add s-status-no-data class to summary widgets parent div when no telemetry is added and remove when telemetry is added. Add a composition policy to only allow compatible object types to be added to summary widgets 2017-09-20 14:40:31 -07:00
Victor Woeltjen
7f9fd5c705 [Timers] Frontend updates for time-of-interest
Squashed commit of the following:

commit 370b910d36
Author: Charles Hacskaylo <charlesh88@gmail.com>
Date:   Wed Sep 20 10:59:00 2017 -0700

    [Frontend] Fix in FollowIndicator.js

    Fixes #1688

commit 883d1feb32
Author: Charles Hacskaylo <charlesh88@gmail.com>
Date:   Wed Sep 20 10:36:56 2017 -0700

    [Frontend] Styling and content on Follow indicator

    Fixes #1688

commit cff85fbbde
Author: Charles Hacskaylo <charlesh88@gmail.com>
Date:   Wed Sep 20 10:09:19 2017 -0700

    [Frontend] Styling complete on Follow Line

    Fixes #1688

commit 563a86b69f
Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov>
Date:   Mon Sep 18 16:05:53 2017 -0700

    [Front-end] WIP Markup and CSS for Follow Line

    Fixes #1688
    Added line icon, style refinement;

commit fc49e5d023
Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov>
Date:   Mon Sep 18 15:07:35 2017 -0700

    [Front-end] WIP Markup and CSS for Follow Line

    Fixes #1688
    Moved TimelineTOIController up 2 levels of markup hierarchy
    to allow Follow Lines, one in each split pane;
    Follow LInes markup and CSS in progress;

commit 8ec3c42291
Author: Charles Hacskaylo <charlesh88@gmail.com>
Date:   Wed Sep 13 16:46:14 2017 -0700

    [Frontend] WIP Timeline Follow Line

    Fixes #1688
    VERY WIP! Initial move of styles into classes;
2017-09-20 12:11:41 -07:00
Charles Hacskaylo
be0291cf70 [Frontend] Removed t-condition from testDataItem
Fixes #1668
Fixes #1644
2017-09-19 17:51:16 -07:00
Charles Hacskaylo
b3a6d7271d [Frontend] Mods to main styles
Fixes #1668
Fixes #1644
Added .sm to number inputs; removed padding
from .compact-form label; set inputs and selects
in .compact-form to use $btnStdH for height;
2017-09-19 17:39:12 -07:00
Charles Hacskaylo
ebeed2f236 [Frontend] Significant styling for test data area
Fixes #1668
Fixes #1644
2017-09-19 17:37:15 -07:00
Deep Tailor
337c26c019 fix failing tests 2017-09-18 13:12:23 -07:00
Deep Tailor
730f363f94 Merge branch 'summary-widgets-styling-2' of https://github.com/nasa/openmct into summary-widgets 2017-09-18 09:44:15 -07:00
Deep Tailor
ae30e6110b merge from styling 2017-09-18 09:44:07 -07:00
Charles Hacskaylo
6e4bf3e45b [Frontend] Styling, markup for test data area
Fixes #1668
Fixes #1644
Significant sanding and shimming, WIP;
2017-09-15 18:48:03 -07:00
Charles Hacskaylo
5465ca92f9 [Frontend] Flex layout now working!
Fixes #1668
Fixes #1644
2017-09-15 17:33:28 -07:00
Charles Hacskaylo
e55ea41b0a [Frontend] Align selects
Fixes #1668
Fixes #1644
2017-09-15 17:02:20 -07:00
Charles Hacskaylo
8cfb3cc689 [Frontend] Merge latest master
Fixes #1668
Fixes #1644
2017-09-15 17:01:32 -07:00
Charles Hacskaylo
2d728a1362 [Frontend] WIP Styling continued
Fixes #1668
Markup tweaks
2017-09-15 16:44:11 -07:00
Charles Hacskaylo
99333988df [Frontend] WIP Styling continued
Fixes #1668
Fixes #1644:
VERY WIP! Outer wrapper styling; drag-n-drop
working currently; section-headers;
2017-09-15 16:43:01 -07:00
Deep Tailor
de783d4286 fix circle-ci build errors 2017-09-14 14:11:02 -07:00
Victor Woeltjen
1e1a2443d5 [Timers] Remove unused variable to pass lint checks 2017-09-11 11:24:52 -07:00
Victor Woeltjen
d65e1e604e Squashed commit of the following:
commit f1dc1ce152e186da0d10c8e77d920ac0a76c9bc2
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 14:35:38 2017 -0700

    [Timers] Rewrite JSDoc for FollowTimerAction

    https://github.com/nasa/openmct/pull/1694/files#r137604769

commit 7ab0693cc983f8a04ac8ee9002f4d776b06a869a
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 14:27:53 2017 -0700

    [Timer] Expect domain objects from FollowIndicator test

commit ff89c0849d16ab451bfd2fddd9202cf36940f599
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 14:26:28 2017 -0700

    [Timer] Add JSDoc for new method

commit 2a0343352eca241dfc28a4aa0b3832e3e6928864
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 14:24:59 2017 -0700

    [Timeline] Update TOI tests

    ...to account for refactoring out of tick handling.

commit 01cbaafc72870fab4ada5894637ae5721214933d
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 14:17:25 2017 -0700

    [Timeline] Update dependencies for TOI test

commit 6bd5c378566362dce331e7c200dea87f0b08ecc6
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 14:15:21 2017 -0700

    [Timers] Update timerService tests with dependencies

commit b0793865c5131e17a58786ec356d67f2f2bba4c5
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 14:09:54 2017 -0700

    [Timers] Declare vars to satisfy JSHint

commit 9d2a63f7fe61dadf68255d795512ec55f532c533
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 14:07:12 2017 -0700

    [Timeline] Handle stopped timer

commit 30871270514730f3f2f12482075e5140bb97fa1f
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 13:59:08 2017 -0700

    [Timer] Tweak refactored timer logic

commit 53ad127ba7cf679377dc865301612a1d78399324
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 13:53:36 2017 -0700

    [Timer] Convert times from timerService

    ...to reduce resposibilities for TOI controller.

commit f8341133cf23df383b8f6e4815b88e0066ebd2bc
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 13:03:37 2017 -0700

    [Timeline] Factor out timer knowledge

commit aebd9e0ac223971b868b03343dbe4c61c6eb4849
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 12:34:58 2017 -0700

    [Timeline] Consistently use this

commit 48ac427a20c5c343aecdbd54b068d8691f7830b6
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 12:33:57 2017 -0700

    [Timeline] Remove unused tick binding/call

commit ea62f0a15ba4ab5de53213bbed14599eaf878d70
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 12:10:59 2017 -0700

    [Timeline] Retrieve timestamp on demand

commit f53bd04b5e343b22ea52b431785ade891577bb6a
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 12:07:55 2017 -0700

    [Timeline] Update clocks on bounds events

    https://github.com/nasa/openmct/pull/1694/files#r137603081

commit 51d8e376ee46aafa13cd9a969c6f03885e10dafb
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 11:40:33 2017 -0700

    [Timeline] Don't listen for non-existing tick events

commit 5cc40c488cec5e7453c2fe1dea5e5a4fa3509ecd
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 11:39:21 2017 -0700

    [Time] Revert Time API changes

    https://github.com/nasa/openmct/pull/1694/files#r137603081

commit c55c8bc627bf0a7f3cfd04b604b82d15ff469ab9
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 11:37:40 2017 -0700

    [Timeline] Finish testing TOI controller

commit af5cea5f2f172a309568d477dfdf11b8d45e74bb
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 11:06:47 2017 -0700

    [Timeline] Test TOI controller

commit ba64db68b132fa431e8ccdb533024bf2850f9712
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 10:06:41 2017 -0700

    [Timers] Test timerService

commit 247e663b326ec5b8145b832af9b26086204baea3
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 10:05:24 2017 -0700

    [Timers] Remove unused timerService method

commit 8d741ad5744e1b7deb669dbaa0f3d30e4eb5866e
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 09:59:32 2017 -0700

    [Timers] Remove unused timerService dependency

commit b59c8917bdef5ec3e54c8857d993d86547cfe177
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 09:58:10 2017 -0700

    [Timers] Remove unused timerService event

commit f15dd9827f835a814dc40a6201c90268a60ed64a
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 09:49:09 2017 -0700

    [Timers] Test timer-following indicator

commit 2501f11af8c0b2aed9ebf16ffd28c0003b2701c2
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 09:42:54 2017 -0700

    [Timer] Complete test coverage for FollowTimerAction

commit aa2be83fc15cd68ee6de4d9f8205dc2fcba8c35b
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Thu Sep 7 09:35:37 2017 -0700

    [Timers] Begin testing Follow Timer action

commit d9062e0b0ff351b141dcb646972053ec72292d53
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 16:45:18 2017 -0700

    [Timeline] Remove unused variables

commit 79ebe4dd2b2aefc1e83ea8142588ed0715b3c269
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 16:39:22 2017 -0700

    [Timeline] JSDoc for TOI controller

commit 330f6b465188555e8e59f4eaf8ce1875b5335846
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 16:30:58 2017 -0700

    [Timeline] Use different icon to follow time bounds

commit f0a3b628e6d1d843324085edd563b68997f5a215
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 16:30:46 2017 -0700

    [Timeline] Simplify TOI following initialization

commit e76f3d1d525e0d19845b4c5b457995e60c416ad0
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 16:27:07 2017 -0700

    [Timeline] Add toggle to follow time bounds

commit 8ec072c0a2a953c074e0c327430dd68f27894ffb
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 16:19:25 2017 -0700

    [Timeline] Follow TC bounds based on boolean

commit 206a26734dedc267af6d298a77658aa261ca4fea
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 15:37:12 2017 -0700

    [Timeline] Tune bounds following

commit 19563bdf53a036c7bf09c52924425a1902b243bb
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 15:19:19 2017 -0700

    [Timeline] Remove unused method

commit 293981ec55ad115d7bd90b92f5bd090df64bd7c2
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 15:18:59 2017 -0700

    [Timeline] Only update timestamp on tick

    Leave bounds-following to the bounds event

commit 9180e15971d2043f0999a16f0aa8794273bcfc74
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 14:43:01 2017 -0700

    [Time] Document tick event

commit c7b163dff0d94aaea86b76647501f21623b353e1
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 14:39:57 2017 -0700

    [Timeline] Stop listening on destroy

    ...from the TOI controller.

commit ca7def3cf98e1eaf6c3aeb16cf9fd79452c86bd0
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 14:32:40 2017 -0700

    [Timeline] Remove surplus watches

commit 367e7afa94ae1ed448e39f13be804c62e2bfcf00
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 14:30:14 2017 -0700

    [Timeline] Very deltas are valid before panning

commit 7ee94f316e90d046015266a2a9168e349ff73345
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 14:28:10 2017 -0700

    [Timeline] Scroll with TOI only while in view

commit 9d7bb431119b7bc6ddc86f0058718e4385478518
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 10:36:46 2017 -0700

    [Timeline] Utilize zoomController.bounds

commit f151b9e8adfd235c31e32bef5fddab835efa7c8f
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 10:35:57 2017 -0700

    [Timeline] Add methods to set zoom bounds

commit c3d0b9876ab79c18003838ed3315045c5fb2ddbb
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 10:32:08 2017 -0700

    [Timelines] Observe bounds changes

    ...to synchronize zoom with Time Conductor, #1688

commit 58adafc46f231b0fd92827d10c377131166ff39c
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 09:37:07 2017 -0700

    [Timers] JSDoc for TimerService

commit a325a8d5085bf1a4c9aa3ab20771308d4789765a
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 09:12:50 2017 -0700

    [Timeline] Re-tweak follow scroll calculations

    ...for visibility.

commit 41e4bf153607b081aaf92253fa2b21300e2f0ea7
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 09:03:45 2017 -0700

    [Timeline] Tweak follow scroll calculations

    ...for visibility.

commit 08a5b9f14ab629a310dc27a3771ca454f1187327
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 08:59:45 2017 -0700

    [Timeline] Replace debug output with scroll updates

commit 26585ecd61341b4ee89abd8ee866e705a02bbc9a
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 08:59:07 2017 -0700

    [Timeline] Move TOI to scrollable area

commit 654eda027c3c67a3a0ff33136109ca27d14762ba
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 08:56:07 2017 -0700

    [Timeline] Begin implementing TOI following

commit 552f67a11ce439be58ab7ca7884c46241a25adee
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Sep 6 08:55:51 2017 -0700

    [Timeline] At zoom-to-time method

    For use by time-of-interest controller, #1688

commit 37acbfd458740b2c3176875f83d37f0fdf57e727
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Aug 30 12:46:33 2017 -0700

    [Timeline] Remove other excess $apply calls

    ...although this should make us nervy about those callbacks being
    invoked in different ways.

commit 0e72847c9ba59f957efa2d412cb77c024afa9e63
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Aug 30 12:44:27 2017 -0700

    [Timeline] Remove $apply from $watch callback

    ...to avoid an infinite digest loop.

commit bade0fd9f60101d5b1b782cd28e608af493c9076
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Aug 30 12:42:18 2017 -0700

    [Timeline] Begin adding TOI line to template

commit f94034a3b4136f6b174155397084f8cdb22ce544
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Aug 30 12:11:25 2017 -0700

    [Timers] Add missing semicolon, satisfy JSHint

commit cb465b94011e7432cc7e4d9e815641f97dc61d7a
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Aug 30 12:08:45 2017 -0700

    [Time] Verify that tick event is emitted

commit 7c84a86a33ceb73ba6a06801374ea3f89793c450
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Aug 30 11:59:06 2017 -0700

    [Time] Emit tick events from Time API

    https://github.com/nasa/openmct/pull/1694

commit d319a783fcd882c03eb7d9a81fec33898016384e
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Wed Aug 30 11:56:28 2017 -0700

    [Timeline] Sketch in TOI controller

    ...to position/follow time-of-interest, relative to the active timer.

commit 2dbdb2627450039d69dbfd10eed2c100207e061a
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Tue Aug 29 12:57:47 2017 -0700

    [Timers] Use timerService

    ...to coordinate between action and indicator

commit f94a2358eaf0366bd4da2b44e69ccb62b153c5db
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Tue Aug 29 12:52:22 2017 -0700

    [Timers] Use TimerService from Follow Timer action

commit a720c2ec2cda4a300d26167f4717f0571bedcbfd
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Tue Aug 29 12:50:31 2017 -0700

    [Timers] Expose TimerService through bundle

commit e32bbc3e232d25f7c5dba98674781e4f263c4870
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Tue Aug 29 12:49:03 2017 -0700

    [Timers] Sketch in timer service

    ...which will keep track of the active timer used to interpret SET
    for Timelines.

commit a038c2b1d8fd34c2874fa8fc0421fa7ba53e11ab
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Tue Aug 29 12:41:05 2017 -0700

    [Timers] Register indicator

commit 0e93ae87a1cccc4f3a0636844625b64ccb77a7ae
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Tue Aug 29 12:39:21 2017 -0700

    [Timers] Skeleton for time following indicator

commit e806386891639740e9fe3d8641c2f60ab5a88eac
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Tue Aug 29 09:37:14 2017 -0700

    [Timers] Register the Follow Timer action

commit 008aa95932070459dcc6fa1d918a23dac8df7592
Author: Victor Woeltjen <victor.woeltjen@nasa.gov>
Date:   Tue Aug 29 09:35:08 2017 -0700

    [Timers] Skeleton for Follow Timer action

    ...to synchronize the time conductor with a particular Timer. #1688
2017-09-07 15:22:38 -07:00
Doubek-Kraft
f6c1488ccd [Summary Widgets] Merge with style
Merge remote-tracking branch 'origin/summary-widget-styling-2' into summary-widgets
2017-08-25 14:23:06 -07:00
Doubek-Kraft
26be1ecf37 [Summary Widgets] Merge with style
Merge remote-tracking branch 'origin/summary-widget-styling-2' into summary-widgets

Restore correct glyphs after merge with master
2017-08-25 14:19:50 -07:00
Charles Hacskaylo
38f0f072bb [Merge] Ellipsize added to l-summary-widget
Fixes #1669
2017-08-25 14:19:43 -07:00
Charles Hacskaylo
e5e969665f [Merge] Merge latest master
Fixes #1669
Merge + resolve conflicts;
2017-08-25 14:11:34 -07:00
Doubek-Kraft
ffbb662c99 [Summary Widgets] Unit tests 2017-08-25 14:09:22 -07:00
Doubek-Kraft
bd7b23f896 [Summary Widgets] Merge from style branch
Merge remote-tracking branch 'origin/summary-widget-styling-2' into summary-widgets

Resolve conflicts with divergent rule implementation
2017-08-25 12:43:29 -07:00
Doubek-Kraft
c238def902 [Summary Widgets] Unit tests 2017-08-25 11:57:29 -07:00
Charles Hacskaylo
2d430ece7f [Merge] Thumbs now show icon and label text
Fixes #1669
Updates to allow thumbs to show their associated
icon and label text;
minor CSS tweaks for icon size and ellipsizing;
New rules now don't use first icon by default;
2017-08-25 11:40:46 -07:00
Doubek-Kraft
c92644a661 [Summary Widgets] Merge from master
Merge remote-tracking branch 'origin/master' into summary-widgets

Patch error with SineWave generators after merge
2017-08-25 10:04:32 -07:00
Doubek-Kraft
41ce3c04f7 [Summary Widgets] Unit Tests 2017-08-24 16:52:44 -07:00
Doubek-Kraft
fcf77f359f [Summary Widgets] Unit tests 2017-08-24 12:06:31 -07:00
Doubek-Kraft
40a2737915 [Summary Widgets] Performance Improvements
Remove unecessary re-initialization of Rule objects on certain
user interactions, and cleanup related code
2017-08-24 10:12:55 -07:00
Doubek-Kraft
216489d67f [Summary Widgets] Tests
Add unit tests
2017-08-23 17:01:14 -07:00
Doubek-Kraft
418a393b26 [Sumamry Widgets] Destroy
Implement destroy
2017-08-23 13:09:36 -07:00
Aaron Doubek-Kraft
1f3d744494 [Summary Widgets] Event Emitters
Replace custom event handlers with EventEmitters, remove binds
assoicated with old event handlers, and update documentation and
callback functions
2017-08-22 23:31:45 -07:00
Doubek-Kraft
ff3f2dccba [Summary Widget] Tests
Add and update unit tests

Fix style in markup

Begin implementing destroy
2017-08-22 16:51:00 -07:00
Doubek-Kraft
e69973bd29 [Summary Widgets] Documentation
Finished adding JSDoc comments

Standardize usage of event handler callbacks

Fix rule persistence bug
2017-08-22 11:13:26 -07:00
Doubek-Kraft
05b352cc36 [Summary Widgets] Documentation
Add JSDoc style comments
2017-08-21 17:05:41 -07:00
Doubek-Kraft
9735548999 [Summary Widgets] Add documentation 2017-08-18 16:22:23 -07:00
Doubek-Kraft
f9529b1362 [Summary Widgets] UI for scripted conditions
Add textfield input for JavaScript condition input, and modify the
condition manager and condition evaluator to read JS conditions
correctly from the data model. Currently, custom conditions are
not actually executed and will always be evaluated as false.
2017-08-18 14:27:57 -07:00
Doubek-Kraft
c598cec702 [Summary Widgets] Unit Tests
Add and update tests for select classes

Stub specfiles for test data and DnD
2017-08-17 16:44:33 -07:00
Doubek-Kraft
e9ea1c4a0f [Summary Widgets] Edit Mode
Enable edit mode for summary widgets, and make configuration interface
visible only when the user has entered edit mode

Standardize usage of 'mutate'

Fix collision between widget palettes and other interfaces where
palettes would permanently hide other menus
2017-08-17 13:47:49 -07:00
Doubek-Kraft
e9238ff282 [Summary Widgets] Merge from View API Branch
Merge remote-tracking branch 'origin/view-api-implementation'
 into summary-widgets
2017-08-17 09:31:36 -07:00
Doubek-Kraft
4cebd72cba [Summary Widgets] Merge from style branch
Issues #1644 #1669

Merge remote-tracking branch 'origin/summary-widget-styling-2' into summary-widgets

Integrate new style for inputs
2017-08-16 14:57:29 -07:00
Doubek-Kraft
f8a44d6e71 [Summary Widget] Test Data
Issue #1644

Add user-configurable mock data to test rules. Modify evaluator to
gracefully handle uninitialzed test data points.

Fix DnD bug where drag position was not tracked correctly
2017-08-16 14:37:03 -07:00
Pete Richards
d0745b300b Allow views to be editable 2017-08-16 11:20:04 -07:00
Charles Hacskaylo
2a4e0a3081 [Frontend] Mods to custom selects
Fixes #1669
line-height, context arrow positioning and color
2017-08-16 10:50:08 -07:00
Charles Hacskaylo
1ff19f9574 [Front-end] Refinements to palette .selected
Fixes #1669
Unit tested in espresso and snow themes as well;
2017-08-15 16:04:07 -07:00
Charles Hacskaylo
7ef84cb50d [Front-end] Fix palette menu when no icon is selected
Fixes #1669
2017-08-15 15:51:32 -07:00
Charles Hacskaylo
cd05c70d64 [Front-end] Fixes to palette CSS
Fixes #1669
Changed .selected to avoid icon collision when
applying .selected to a an item in an icon palette;
Moved color defs into theme constants files;
TO-DO: fix custom select alignment issues,
fix menu when no icon is selected,
unit test in Snow theme.
2017-08-15 15:24:18 -07:00
Doubek-Kraft
568473b82f [Summary Widgets] Rule Reorders
Cleanup Widget DnD code and package it as a module
2017-08-14 16:24:38 -07:00
Doubek-Kraft
c61b074755 [Summary Widgets] Rule Reorders
Re-implement drag and drop with a 'sortable list' style interface
2017-08-14 14:21:37 -07:00
Doubek-Kraft
8ed66ab4ab [Summary Widgets] Rule Reorders
Implement drag and drop rule reorders using the native HTML5 API
2017-08-11 16:57:40 -07:00
Doubek-Kraft
b2502dd998 [Summary Widgets] Selection classes for palettes
Merge remote-tracking branch 'origin/summary-widget-styling-2' into
 summary-widgets. Issues #1669 #1644

Update palette classes to apply a visual indicator for selection
to their items.
2017-08-10 10:39:15 -07:00
Doubek-Kraft
856eedbf9d [Summary Widgets] 'Any/All Telemetry' in conditions
Add UI and implemenetion for evaluating any telemetry or all telemetry
in an individual condition. Add related unit tests.
2017-08-09 16:54:19 -07:00
Charles Hacskaylo
0c0ca6e6af [Frontend] Colors for palette defined
Fixes #1669
2017-08-09 16:00:33 -07:00
Doubek-Kraft
498b797e49 [Summary Widgets] Fix input issue
Fix a bug in the compsosition object selector where it would not display its
currently selected item on a composition add.

Update names of modules to more accurately describe their function.
2017-08-09 10:44:41 -07:00
Doubek-Kraft
02c33388ba [Summary Widgets] Generate Rule Descriptions
Dynamically update the rule description based on the current state
of the rules' conditions
2017-08-08 17:47:54 -07:00
Charles Hacskaylo
8a8e3cc055 [Front-end] WIP colors for Summary Widget palettes
Fixes #1669
2017-08-08 16:11:52 -07:00
Charles Hacskaylo
36d60b16e9 [Front-end] Updated Style Guide
Fixes #1669
Updated palette example in Style Guide to use `no-selection` and `selected` classes;
2017-08-08 15:35:41 -07:00
Charles Hacskaylo
de3114568b [Front-end] Implemented no-selection class in widgets
Fixes #1669
Added `no-selection` class to "None" selection choice in widgets palette;
2017-08-08 15:28:48 -07:00
Doubek-Kraft
eb5835faeb [Summary Widgets] Fix color palettes
Fix color palette bug where the 'none' option was not recognized as
a selectable item

Add ability to toggle 'none' option, and remove it from the text color
control

Remove 'grippy' element when only one user-defined rule exists

Fix format of requirejs headers

Add tooltips
2017-08-08 15:27:46 -07:00
Charles Hacskaylo
ff1ddb0b79 [Front-end] Added .selected class for palette items
Fixes #1669
Added `.selected` in `.s-palette-item` class;
Re-orged styles in palette.scss to place in .l-* and .s-*
classes properly;
2017-08-08 15:16:20 -07:00
Charles Hacskaylo
15b127bb2e [Front-end] Added 'no-selection' CSS class
Fixes #1669
Added to _global.scss;
implemented in color.html;
2017-08-08 15:09:56 -07:00
Doubek-Kraft
e4ed881f6d [Summary Widgets] Code Style
Fix code style issues

Update plugin syntax to more closely match existing plugins
2017-08-08 12:06:20 -07:00
Doubek-Kraft
7b62cf130c [Summary Widget] Add unit tests
Add tests for input classes

Fix code style errors
2017-08-07 17:07:21 -07:00
Doubek-Kraft
72fd2e531c [Summary Widget] Assorted Cleanup
Abstract palette behavior to superclass, and base new color and icon
palette classes on it

Add unit tests

Move private event handler methods out of object prototypes
2017-08-04 16:15:47 -07:00
Doubek-Kraft
4a5392ef78 [Summary Widgets] Minor Fixes
Update zepto in bower to enforce v1.2.0

Fix bug where summary widget conditions would modify appearance of other summary widgets

Move code to plugins directory

Stub for unit tests
2017-08-03 13:09:05 -07:00
Doubek-Kraft
0150a708ca [Evaluation] Implement condition evaluation
Issue #1644

Add telemetry subscription handling, and implement the execution of
rules.

Provide a toggle for 'any', 'all', or 'JavaScript' trigger

Add documentation
2017-08-02 14:31:26 -07:00
Doubek-Kraft
eacc181d5e [Inputs] Add value inputs for rule configuration
Dynamically add value inputs when an operation is being configured.

Cleanup code related to removed label caching feature
2017-08-01 16:03:08 -07:00
Doubek-Kraft
405bb55881 [Refactor] Cleanup old files 2017-08-01 13:51:20 -07:00
Doubek-Kraft
4a35508459 [Refactor] Overhaul of code structure
Re-implement widgets in with a module-oriented structure. Fix issues related to
asychronous loading of telemetry and composition.

Package inputs as re-usable, Zepto-based modules.
2017-08-01 13:40:04 -07:00
Doubek-Kraft
98a9d71a2e [Summary Widgets] Implementation for conditions
Support configuring and persisting multiple conditions per rule
2017-07-26 09:33:27 -07:00
Doubek-Kraft
a1596d0b06 [Summary Widgets] Make conditions persistable
Issue #1644

Add implementation and persistability for a single condition configuration
field. Baseline for adding arbitrary numbers of rules
2017-07-25 14:21:53 -07:00
Doubek-Kraft
4b3be4c483 [Inputs] Add implementation for icon palette
Issue #1644

Wire up icon palette inputs to widget, and make icon class a persistable
property of a rule
2017-07-24 12:15:39 -07:00
Doubek-Kraft
0fa8472db1 [Bug Fix] Fix text input handlers
Issue #1644

Fix merge issue related to inputs for label and message
2017-07-24 10:10:28 -07:00
Charles Hacskaylo
e1e2dca1d8 [Frontend] WIP summary widget styling
Fixes #1654
Refactor .l-color-palette to .l-palette, includes
file renaming; add icon-palette in WidgetView.js
2017-07-21 18:07:49 -07:00
Doubek-Kraft
755c013ec8 [Summary Widgets] Merge with style
Issue #1644

Merge and resolve conflicts with style branch

Fix rule indexing bug
2017-07-21 16:19:15 -07:00
Doubek-Kraft
eab702b763 [Summary Widgets] Link markup to implementation
Add additional implemenation for new markup. Rules now store label
and message, and label is applied to widget. Implementation for
duplicate.
2017-07-21 15:59:53 -07:00
Charles Hacskaylo
d15446ac91 [Frontend] WIP summary widget styling
Fixes #1654
Mod .grippy to point at new glyph class;
Stubbed in icon palette control in markup;
2017-07-21 10:32:20 -07:00
Charles Hacskaylo
500733afb2 [Frontend] Add new icon-grippy
Fixes #1654
2017-07-21 10:25:18 -07:00
Charles Hacskaylo
2aa04b0a56 Merge remote-tracking branch 'origin/summary-widgets' into summary-widgets-styling 2017-07-21 10:04:23 -07:00
Doubek-Kraft
c051f342af [Style] Merge with style branch
Merge remote-tracking branch 'origin/summary-widgets-styling' into summary-widgets

Apply new style and wire up new markup for interaction
2017-07-21 09:58:23 -07:00
Charles Hacskaylo
8aeb365f5f [Frontend] WIP summary widget styling
Fixes #1654
Add condition duplicate and delete buttons
2017-07-21 09:56:57 -07:00
Charles Hacskaylo
827a28313d [Frontend] WIP summary widget styling
Fixes #1654
Fixes and tweaks post-merge
2017-07-21 09:48:54 -07:00
Doubek-Kraft
c83de8aad2 [Summary Widgets] Minor UI implementation 2017-07-21 09:24:27 -07:00
Charles Hacskaylo
b55f43b8df [Frontend] WIP summary widget styling
Fixes #1654
Merge latest from summary-widgets branch
2017-07-21 09:15:19 -07:00
Charles Hacskaylo
8466723a90 [Frontend] WIP summary widget styling
Fixes #1654
Minor tweaks; class renaming; restructured
main containers in ruleTemplate.html;
minor updates for class names in WidgetView.js;
2017-07-20 19:01:13 -07:00
Charles Hacskaylo
a103b4dbff [Frontend] WIP summary widget styling
Fixes #1654
Significant mods to markup and SCSS;
2017-07-20 17:56:57 -07:00
Charles Hacskaylo
826ac3a947 [Frontend] WIP summary widget styling
Fixes #1654
Ported .view-control SCSS out of tree context to
allow more independent use;
2017-07-20 14:31:59 -07:00
Charles Hacskaylo
597327f138 [Frontend] WIP summary widget styling
Fixes #1654
New SCSS for widgets; markup mods in progress
2017-07-20 14:09:17 -07:00
Charles Hacskaylo
bef79402ca [Frontend] WIP summary widget styling
Fixes #1654
Ported .inspector-config SCSS from _inspector.scss
and renamed to .l-compact-form;
2017-07-20 14:08:49 -07:00
Doubek-Kraft
e68e0c381f [Summary Widgets] Make Rules Deletable
Add delete functionality and UI

Improve process for indexing and rendering rules to support deletion,
and eventually reordering

Fix bug where default style was passed by reference and overwritten
on style updates
2017-07-19 17:38:17 -07:00
Charles Hacskaylo
c73f7259c2 [Frontend] WIP summary widget styling
Fixes #1654
Markup cleanups
2017-07-19 15:38:44 -07:00
Charles Hacskaylo
4c9235ba10 [Frontend] Apply new summary-widget glyph
Fixes #1654
2017-07-19 15:01:04 -07:00
Charles Hacskaylo
55e2a77df8 [Frontend] Add new summary-widget glyph
Fixes #1654
Updated font files and icomoon json file;
2017-07-19 15:00:46 -07:00
Doubek-Kraft
cfbff02e7f [Summary Widgets] Populate rule config inputs
Add rule configuration inputs, populated with domain objects, metadata,
and appropriate operations for a given type
2017-07-18 16:19:46 -07:00
Doubek-Kraft
54980fb296 [Summary Widgets] Add summary widgets, WIP
Add a summary widget domain object type

Implement basic interface and style configuration for rules
2017-07-18 10:58:55 -07:00
Pete Richards
ba98d9315c [ViewAPI] Update view API with more support
Update view provider to allow metadata definitions and to play
nicely with old style views.

Spec out some updates to ViewProviders and ViewRegistry to
support further use of views.
2017-07-05 13:56:32 -07:00
70 changed files with 500 additions and 1187 deletions

15
API.md
View File

@@ -879,21 +879,6 @@ openmct.install(openmct.plugins.CouchDB('http://localhost:9200'))
* `openmct.plugins.Espresso` and `openmct.plugins.Snow` are two different
themes (dark and light) available for Open MCT. Note that at least one
of these themes must be installed for Open MCT to appear correctly.
* `openmct.plugins.URLIndicatorPlugin` adds an indicator which shows the
availability of a URL with the following options:
- `url` : URL to indicate the status of
- `cssClass`: Icon to show in the status bar, defaults to `icon-database`, [list of all icons](https://nasa.github.io/openmct/style-guide/#/browse/styleguide:home?view=items)
- `interval`: Interval between checking the connection, defaults to `10000`
- `label` Name showing up as text in the status bar, defaults to url
```javascript
openmct.install(openmct.plugins.URLIndicatorPlugin({
url: 'http://google.com',
cssClass: 'check',
interval: 10000,
label: 'Google'
})
);
```
* `openmct.plugins.LocalStorage` provides persistence of user-created
objects in browser-local storage. This is particularly useful in
development environments.

View File

@@ -17,8 +17,8 @@
"screenfull": "^3.0.0",
"node-uuid": "^1.4.7",
"comma-separated-values": "^3.6.4",
"file-saver": "^1.3.3",
"zepto": "^1.1.6",
"FileSaver.js": "^0.0.2",
"zepto": "1.2.0",
"eventemitter3": "^1.2.0",
"lodash": "3.10.1",
"almond": "~0.3.2",

View File

@@ -4,6 +4,12 @@ deployment:
commands:
- npm install canvas nomnoml
- ./build-docs.sh
- git fetch --unshallow
- git push git@heroku.com:openmctweb-demo.git $CIRCLE_SHA1:refs/heads/master
openmct-demo:
branch: live_demo
heroku:
appname: openmct-demo
openmctweb-staging-deux:
branch: mobile
heroku:

View File

@@ -44,7 +44,9 @@ define([
message = message.data;
var callback = this.callbacks[message.id];
if (callback) {
callback(message);
if (callback(message)) {
delete this.callbacks[message.id];
}
}
};
@@ -70,7 +72,6 @@ define([
deferred.resolve = resolve;
deferred.reject = reject;
});
var messageId;
function callback(message) {
if (message.error) {
@@ -78,27 +79,33 @@ define([
} else {
deferred.resolve(message.data);
}
delete this.callbacks[messageId];
return true;
}
messageId = this.dispatch('request', request, callback.bind(this));
this.dispatch('request', request, callback);
return promise;
};
WorkerInterface.prototype.subscribe = function (request, cb) {
function callback(message) {
var isCancelled = false;
var callback = function (message) {
if (isCancelled) {
return true;
}
cb(message.data);
};
var messageId = this.dispatch('subscribe', request, callback);
var messageId = this.dispatch('subscribe', request, callback)
return function () {
isCancelled = true;
this.dispatch('unsubscribe', {
id: messageId
});
delete this.callbacks[messageId];
}.bind(this);
};

View File

@@ -43,6 +43,7 @@
openmct.install(openmct.plugins.ExampleImagery());
openmct.install(openmct.plugins.UTCTimeSystem());
openmct.install(openmct.plugins.ImportExport());
openmct.install(openmct.plugins.TelemetryMean());
openmct.install(openmct.plugins.Conductor({
menuOptions: [
{

View File

@@ -33,7 +33,7 @@ requirejs.config({
"moment": "bower_components/moment/moment",
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
"moment-timezone": "bower_components/moment-timezone/builds/moment-timezone-with-data",
"saveAs": "bower_components/file-saver/FileSaver.min",
"saveAs": "bower_components/FileSaver.js/FileSaver.min",
"screenfull": "bower_components/screenfull/dist/screenfull.min",
"text": "bower_components/text/text",
"uuid": "bower_components/node-uuid/uuid",
@@ -66,9 +66,6 @@ requirejs.config({
"moment-duration-format": {
"deps": ["moment"]
},
"saveAs": {
"exports": "saveAs"
},
"screenfull": {
"exports": "screenfull"
},

View File

@@ -42,37 +42,23 @@ define(
* @param event the mouse event
*/
ObjectHeaderController.prototype.updateName = function (event) {
if (!event || !event.currentTarget) {
return;
}
if (event && (event.type === 'blur' || event.which === 13)) {
var name = event.currentTarget.innerHTML;
if (event.type === 'blur') {
this.updateModel(event);
} else if (event.which === 13) {
this.updateModel(event);
event.currentTarget.blur();
window.getSelection().removeAllRanges();
}
};
if (name.length === 0) {
name = "Unnamed " + this.domainObject.getCapability("type").typeDef.name;
event.currentTarget.innerHTML = name;
}
/**
* Updates the model.
*
* @param event the mouse event
* @param private
*/
ObjectHeaderController.prototype.updateModel = function (event) {
var name = event.currentTarget.textContent.replace(/\n/g, ' ');
if (name !== this.$scope.domainObject.model.name) {
this.domainObject.getCapability('mutation').mutate(function (model) {
model.name = name;
});
}
if (name.length === 0) {
name = "Unnamed " + this.domainObject.getCapability("type").typeDef.name;
event.currentTarget.textContent = name;
}
if (name !== this.domainObject.getModel().name) {
this.domainObject.getCapability('mutation').mutate(function (model) {
model.name = name;
});
if (event.which === 13) {
event.currentTarget.blur();
}
}
};

View File

@@ -32,7 +32,6 @@ define(
mockTypeCapability,
mockEvent,
mockCurrentTarget,
model,
controller;
beforeEach(function () {
@@ -48,11 +47,8 @@ define(
type: mockTypeCapability
};
model = {
name: "Test name"
};
mockDomainObject = jasmine.createSpyObj("domainObject", ["getCapability", "getModel"]);
mockDomainObject.getModel.andReturn(model);
mockDomainObject = jasmine.createSpyObj("domainObject", ["getCapability", "model"]);
mockDomainObject.model = {name: "Test name"};
mockDomainObject.getCapability.andCallFake(function (key) {
return mockCapabilities[key];
});
@@ -61,7 +57,7 @@ define(
domainObject: mockDomainObject
};
mockCurrentTarget = jasmine.createSpyObj("currentTarget", ["blur", "textContent"]);
mockCurrentTarget = jasmine.createSpyObj("currentTarget", ["blur", "innerHTML"]);
mockCurrentTarget.blur.andReturn(mockCurrentTarget);
mockEvent = {
@@ -75,7 +71,7 @@ define(
it("updates the model with new name on blur", function () {
mockEvent.type = "blur";
mockCurrentTarget.textContent = "New name";
mockCurrentTarget.innerHTML = "New name";
controller.updateName(mockEvent);
expect(mockMutationCapability.mutate).toHaveBeenCalled();
@@ -83,23 +79,23 @@ define(
it("updates the model with a default for blank names", function () {
mockEvent.type = "blur";
mockCurrentTarget.textContent = "";
mockCurrentTarget.innerHTML = "";
controller.updateName(mockEvent);
expect(mockCurrentTarget.textContent.length).not.toEqual(0);
expect(mockCurrentTarget.innerHTML.length).not.toEqual(0);
expect(mockMutationCapability.mutate).toHaveBeenCalled();
});
it("does not update the model if the same name", function () {
mockEvent.type = "blur";
mockCurrentTarget.textContent = mockDomainObject.getModel().name;
mockCurrentTarget.innerHTML = mockDomainObject.model.name;
controller.updateName(mockEvent);
expect(mockMutationCapability.mutate).not.toHaveBeenCalled();
});
it("updates the model on enter keypress event only", function () {
mockCurrentTarget.textContent = "New name";
mockCurrentTarget.innerHTML = "New name";
controller.updateName(mockEvent);
expect(mockMutationCapability.mutate).not.toHaveBeenCalled();
@@ -109,13 +105,12 @@ define(
expect(mockMutationCapability.mutate).toHaveBeenCalledWith(jasmine.any(Function));
mockMutationCapability.mutate.mostRecentCall.args[0](model);
mockMutationCapability.mutate.mostRecentCall.args[0](mockDomainObject.model);
expect(mockDomainObject.getModel().name).toBe("New name");
expect(mockDomainObject.model.name).toBe("New name");
});
it("blurs the field on enter key press", function () {
mockCurrentTarget.textContent = "New name";
mockEvent.which = 13;
controller.updateName(mockEvent);

View File

@@ -101,15 +101,10 @@ define(
*/
EditorCapability.prototype.finish = function () {
var domainObject = this.domainObject;
if (this.transactionService.isActive()) {
return this.transactionService.cancel().then(function () {
domainObject.getCapability("status").set("editing", false);
return domainObject;
});
} else {
return Promise.resolve(domainObject);
}
return this.transactionService.cancel().then(function () {
domainObject.getCapability("status").set("editing", false);
return domainObject;
});
};
/**

View File

@@ -80,6 +80,12 @@ define(
return closeEditor();
}
function resolveWith (object) {
return function () {
return object;
}
}
newModel.type = this.type.getKey();
newModel.location = this.parent.getId();
newObject = this.parent.useCapability('instantiation', newModel);

View File

@@ -62,7 +62,6 @@ define(
);
mockTransactionService.commit.andReturn(fastPromise());
mockTransactionService.cancel.andReturn(fastPromise());
mockTransactionService.isActive = jasmine.createSpy('isActive');
mockStatusCapability = jasmine.createSpyObj(
"statusCapability",
@@ -142,7 +141,6 @@ define(
describe("finish", function () {
beforeEach(function () {
mockTransactionService.isActive.andReturn(true);
capability.edit();
capability.finish();
});
@@ -154,23 +152,6 @@ define(
});
});
describe("finish", function () {
beforeEach(function () {
mockTransactionService.isActive.andReturn(false);
capability.edit();
});
it("does not cancel transaction when transaction is not active", function () {
capability.finish();
expect(mockTransactionService.cancel).not.toHaveBeenCalled();
});
it("returns a promise", function () {
expect(capability.finish() instanceof Promise).toBe(true);
});
});
describe("dirty", function () {
var model = {};

View File

@@ -290,11 +290,6 @@
opacity: 1;
}
}
.l-rule-action-buttons-wrapper {
.t-delete {
margin-left: 10px;
}
}
.t-condition {
&:hover {
.l-condition-action-buttons-wrapper {

View File

@@ -45,7 +45,9 @@
&.t-object-type-timer,
&.t-object-type-clock,
&.t-object-type-hyperlink,
&.t-object-type-summary-widget {
&.t-object-type-summary-widget,
&.no-frame .t-object-type-fixed-display,
&.no-frame .t-object-type-layout {
// Hide the right side buttons for objects where they don't make sense
// Note that this will hide the view Switcher button if applied
// to an object that has it.
@@ -104,7 +106,7 @@
}
&.t-frame-outer > .t-rep-frame {
&.contents {
$m: 2px;
$m: 0px;
top: $m;
right: $m;
bottom: $m;

View File

@@ -20,7 +20,7 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
.s-hover-border {
border: 1px dotted transparent;
border: none;
}
.s-status-editing {

View File

@@ -36,9 +36,7 @@ define(
* @param {ActionContext} context the context for this action
*/
function FollowTimerAction(timerService, context) {
var domainObject =
context.domainObject &&
context.domainObject.useCapability('adapter');
var domainObject = context.domainObject;
this.perform =
timerService.setTimer.bind(timerService, domainObject);
}

View File

@@ -32,7 +32,6 @@ define(['EventEmitter'], function (EventEmitter) {
function TimerService(openmct) {
EventEmitter.apply(this);
this.time = openmct.time;
this.objects = openmct.objects;
}
TimerService.prototype = Object.create(EventEmitter.prototype);
@@ -45,16 +44,6 @@ define(['EventEmitter'], function (EventEmitter) {
TimerService.prototype.setTimer = function (timer) {
this.timer = timer;
this.emit('change');
if (this.stopObserving) {
this.stopObserving();
delete this.stopObserving;
}
if (timer) {
this.stopObserving =
this.objects.observe(timer, '*', this.setTimer.bind(this));
}
};
/**
@@ -84,16 +73,16 @@ define(['EventEmitter'], function (EventEmitter) {
var clock = this.time.clock();
var canConvert = this.hasTimer() &&
!!clock &&
this.timer.timerState !== 'stopped';
this.timer.getModel().timerState !== 'stopped';
if (!canConvert) {
return undefined;
}
var now = clock.currentValue();
var delta = this.timer.timerState === 'paused' ?
now - this.timer.pausedTime : 0;
var epoch = this.timer.timestamp;
var model = this.timer.getModel();
var delta = model.timerState === 'paused' ? now - model.pausedTime : 0;
var epoch = model.timestamp;
return timestamp - epoch - delta;
};

View File

@@ -29,19 +29,12 @@ define([
describe("The Follow Timer action", function () {
var testContext;
var testModel;
var testAdaptedObject;
beforeEach(function () {
testModel = {};
testContext = { domainObject: jasmine.createSpyObj('domainObject', [
'getModel',
'useCapability'
]) };
testAdaptedObject = { foo: 'bar' };
testContext.domainObject.getModel.andReturn(testModel);
testContext.domainObject.useCapability.andCallFake(function (c) {
return c === 'adapter' && testAdaptedObject;
});
testContext = { domainObject: { getModel: function () {
return testModel;
} } };
});
it("is applicable to timers", function () {
@@ -79,7 +72,7 @@ define([
it("sets the active timer", function () {
expect(mockTimerService.setTimer)
.toHaveBeenCalledWith(testAdaptedObject);
.toHaveBeenCalledWith(testContext.domainObject);
});
});
});

View File

@@ -30,10 +30,7 @@ define([
beforeEach(function () {
callback = jasmine.createSpy('callback');
mockmct = {
time: { clock: jasmine.createSpy('clock') },
objects: { observe: jasmine.createSpy('observe') }
};
mockmct = { time: { clock: jasmine.createSpy('clock') } };
timerService = new TimerService(mockmct);
timerService.on('change', callback);
});
@@ -61,17 +58,6 @@ define([
it("reports the current timer", function () {
expect(timerService.getTimer()).toBe(testTimer);
});
it("observes changes to an object", function () {
var newTimer = { name: "I am another timer." };
expect(mockmct.objects.observe).toHaveBeenCalledWith(
testTimer,
'*',
jasmine.any(Function)
);
mockmct.objects.observe.mostRecentCall.args[2](newTimer);
expect(timerService.getTimer()).toBe(newTimer);
});
});
});
});

View File

@@ -255,8 +255,6 @@ define(
if (this.nextDatum) {
this.updateValues(this.nextDatum);
delete this.nextDatum;
} else {
this.updateValues(this.$scope.imageHistory[this.$scope.imageHistory.length - 1]);
}
this.autoScroll = true;
}

View File

@@ -183,17 +183,6 @@ define(
expect(controller.getImageUrl()).toEqual(newUrl);
});
it("forwards large image view to latest image in history on un-pause", function () {
$scope.imageHistory = [
{ utc: 1434600258122, url: 'some/url1', selected: false},
{ utc: 1434600258123, url: 'some/url2', selected: false}
];
controller.paused(true);
controller.paused(false);
expect(controller.getImageUrl()).toEqual(controller.getImageUrl($scope.imageHistory[1]));
});
it("subscribes to telemetry", function () {
expect(openmct.telemetry.subscribe).toHaveBeenCalledWith(
newDomainObject,
@@ -238,7 +227,7 @@ define(
expect(controller.updateHistory(mockDatum)).toBe(false);
});
describe("when user clicks on imagery thumbnail", function () {
describe("user clicks on imagery thumbnail", function () {
var mockDatum = { utc: 1434600258123, url: 'some/url', selected: false};
it("pauses and adds selected class to imagery thumbnail", function () {
@@ -259,7 +248,6 @@ define(
expect(controller.getTime()).toEqual(controller.timeFormat.format(mockDatum.utc));
});
});
});
it("initially shows an empty string for date/time", function () {

View File

@@ -360,47 +360,22 @@ define(
*/
FixedController.prototype.updateView = function (telemetryObject, datum) {
var metadata = this.openmct.telemetry.getMetadata(telemetryObject);
var telemetryKeyToDisplay = this.chooseTelemetryKeyToDisplay(metadata);
var formattedTelemetryValue = this.getFormattedTelemetryValueForKey(telemetryKeyToDisplay, datum, metadata);
var rangeMetadata = metadata.valuesForHints(['range'])[0];
var rangeKey = rangeMetadata.source || rangeMetadata.key;
var valueMetadata = metadata.value(rangeKey);
var limitEvaluator = this.openmct.telemetry.limitEvaluator(telemetryObject);
var alarm = limitEvaluator && limitEvaluator.evaluate(datum, telemetryKeyToDisplay);
var formatter = this.openmct.telemetry.getValueFormatter(valueMetadata);
var value = datum[valueMetadata.key];
var alarm = limitEvaluator && limitEvaluator.evaluate(datum, rangeKey);
this.setDisplayedValue(
telemetryObject,
formattedTelemetryValue,
formatter.format(value),
alarm && alarm.cssClass
);
this.digest();
};
/**
* @private
*/
FixedController.prototype.getFormattedTelemetryValueForKey = function (telemetryKeyToDisplay, datum, metadata) {
var valueMetadata = metadata.value(telemetryKeyToDisplay);
var formatter = this.openmct.telemetry.getValueFormatter(valueMetadata);
return formatter.format(datum[valueMetadata.key]);
};
/**
* @private
*/
FixedController.prototype.chooseTelemetryKeyToDisplay = function (metadata) {
// If there is a range value, show that preferentially
var telemetryKeyToDisplay = metadata.valuesForHints(['range'])[0];
// If no range is defined, default to the highest priority non time-domain data.
if (telemetryKeyToDisplay === undefined) {
var valuesOrderedByPriority = metadata.values();
telemetryKeyToDisplay = valuesOrderedByPriority.filter(function (valueMetadata) {
return !(valueMetadata.hints.domain);
})[0];
}
return telemetryKeyToDisplay.source;
};
/**
* Request the last historical data point for the given domain objects
* @param {object[]} objects
@@ -413,9 +388,7 @@ define(
objects.forEach(function (object) {
self.openmct.telemetry.request(object, {start: bounds.start, end: bounds.end, size: 1})
.then(function (data) {
if (data.length > 0) {
self.updateView(object, data[data.length - 1]);
}
self.updateView(object, data[data.length - 1]);
});
});
return objects;

View File

@@ -26,12 +26,8 @@
* @namespace platform/features/layout
*/
define(
[
'./LayoutDrag'
],
function (
LayoutDrag
) {
['./LayoutDrag'],
function (LayoutDrag) {
var DEFAULT_DIMENSIONS = [12, 8],
DEFAULT_GRID_SIZE = [32, 32],
@@ -127,8 +123,6 @@ define(
if (self.droppedIdToSelectAfterRefresh) {
self.select(null, self.droppedIdToSelectAfterRefresh);
delete self.droppedIdToSelectAfterRefresh;
} else if (composition.indexOf(self.selectedId) === -1) {
self.clearSelection();
}
}
});

View File

@@ -178,6 +178,7 @@ define(
Promise.resolve(mockChildren)
);
mockScope.model = testModel;
mockScope.configuration = testConfiguration;
mockScope.selection = jasmine.createSpyObj(
@@ -193,8 +194,7 @@ define(
mockMetadata = jasmine.createSpyObj('mockMetadata', [
'valuesForHints',
'value',
'values'
'value'
]);
mockMetadata.value.andReturn({
key: 'value'
@@ -653,39 +653,6 @@ define(
});
});
it("selects an range value to display, if available", function () {
mockMetadata.valuesForHints.andReturn([
{
key: 'range',
source: 'range'
}
]);
var key = controller.chooseTelemetryKeyToDisplay(mockMetadata);
expect(key).toEqual('range');
});
it("selects the first non-domain value to display, if no range available", function () {
mockMetadata.valuesForHints.andReturn([]);
mockMetadata.values.andReturn([
{
key: 'domain',
source: 'domain',
hints: {
domain: 1
}
},
{
key: 'image',
source: 'image',
hints: {
image: 1
}
}
]);
var key = controller.chooseTelemetryKeyToDisplay(mockMetadata);
expect(key).toEqual('image');
});
it("reflects limit status", function () {
mockLimitEvaluator.evaluate.andReturn({cssClass: "alarm-a"});
controller.updateView(mockTelemetryObject, [{

View File

@@ -424,17 +424,6 @@ define(
expect(selectedObj.showFrame).toEqual(jasmine.any(Function));
});
it("deselects the object that is no longer in the composition", function () {
mockScope.$watchCollection.mostRecentCall.args[1]();
var childObj = mockCompositionObjects[0];
controller.select(mockEvent, childObj.getId());
var composition = ["b", "c"];
mockScope.$watchCollection.mostRecentCall.args[1](composition);
expect(controller.selected(childObj)).toBe(false);
});
});
}
);

View File

@@ -49,7 +49,7 @@
{
"key": "ListViewController",
"implementation": ListViewController,
"depends": ["$scope", "formatService"]
"depends": ["$scope"]
}
],
"directives": [

View File

@@ -21,7 +21,7 @@
*****************************************************************************/
define(function () {
function ListViewController($scope, formatService) {
function ListViewController($scope) {
this.$scope = $scope;
$scope.orderByField = 'title';
$scope.reverseSort = false;
@@ -30,8 +30,6 @@ define(function () {
var unlisten = $scope.domainObject.getCapability('mutation')
.listen(this.updateView.bind(this));
this.utc = formatService.getFormat('utc');
$scope.$on('$destroy', function () {
unlisten();
});
@@ -52,13 +50,17 @@ define(function () {
icon: child.getCapability('type').getCssClass(),
title: child.getModel().name,
type: child.getCapability('type').getName(),
persisted: this.utc.format(child.getModel().persisted),
modified: this.utc.format(child.getModel().modified),
persisted: new Date(
child.getModel().persisted
).toUTCString(),
modified: new Date(
child.getModel().modified
).toUTCString(),
asDomainObject: child,
location: child.getCapability('location'),
action: child.getCapability('action')
};
}, this);
});
};
return ListViewController;

View File

@@ -31,9 +31,7 @@ define(
controller,
childModel,
typeCapability,
mutationCapability,
formatService;
mutationCapability;
beforeEach(function () {
unlistenFunc = jasmine.createSpy("unlisten");
@@ -43,18 +41,6 @@ define(
);
mutationCapability.listen.andReturn(unlistenFunc);
formatService = jasmine.createSpyObj(
"formatService",
["getFormat"]
);
formatService.getFormat.andReturn(jasmine.createSpyObj(
'utc',
["format"]
));
formatService.getFormat().format.andCallFake(function (v) {
return "formatted " + v;
});
typeCapability = jasmine.createSpyObj(
"typeCapability",
["getCssClass", "getName"]
@@ -108,27 +94,20 @@ define(
);
scope.domainObject = domainObject;
controller = new ListViewController(scope, formatService);
controller = new ListViewController(scope);
waitsFor(function () {
return scope.children;
});
});
it("uses the UTC time format", function () {
expect(formatService.getFormat).toHaveBeenCalledWith('utc');
});
it("updates the view", function () {
expect(scope.children[0]).toEqual(
{
icon: "icon-folder",
title: "Battery Charge Status",
type: "Folder",
persisted: formatService.getFormat('utc')
.format(childModel.persisted),
modified: formatService.getFormat('utc')
.format(childModel.modified),
persisted: "Wed, 07 Jun 2017 20:34:57 GMT",
modified: "Wed, 07 Jun 2017 20:34:57 GMT",
asDomainObject: childObject,
location: ''
}

View File

@@ -24,7 +24,7 @@ define(
[],
function () {
var DIGITS = 3;
var DIGITS = 2;
/**
* Wraps a `TelemetryFormatter` to provide formats for domain and

View File

@@ -170,9 +170,6 @@ define(
* @param rows
*/
TelemetryTableController.prototype.addRowsToTable = function (rows) {
rows.forEach(function (row) {
this.$scope.rows.push(row);
}, this);
this.$scope.$broadcast('add:rows', rows);
};

View File

@@ -436,28 +436,5 @@ define(
expect(mockScope.$broadcast).toHaveBeenCalledWith("remove:rows", discardedRows);
});
describe('when telemetry is added', function () {
var testRows;
var expectedRows;
beforeEach(function () {
testRows = [{ a: 0 }, { a: 1 }, { a: 2 }];
mockScope.rows = [{ a: -1 }];
expectedRows = mockScope.rows.concat(testRows);
spyOn(controller.telemetry, "on").andCallThrough();
controller.registerChangeListeners();
controller.telemetry.on.calls.forEach(function (call) {
if (call.args[0] === 'added') {
call.args[1](testRows);
}
});
});
it("adds it to rows in scope", function () {
expect(mockScope.rows).toEqual(expectedRows);
});
});
});
});

View File

@@ -38,7 +38,6 @@ define([
"./src/capabilities/CostCapability",
"./src/directives/MCTSwimlaneDrop",
"./src/directives/MCTSwimlaneDrag",
"./src/directives/MCTResourceGraphDrop",
"./src/services/ObjectLoader",
"./src/chart/MCTTimelineChart",
"text!./res/templates/values.html",
@@ -70,7 +69,6 @@ define([
CostCapability,
MCTSwimlaneDrop,
MCTSwimlaneDrag,
MCTResourceGraphDrop,
ObjectLoader,
MCTTimelineChart,
valuesTemplate,
@@ -579,13 +577,6 @@ define([
"$interval",
"$log"
]
},
{
"key": "mctResourceGraphDrop",
"implementation": MCTResourceGraphDrop,
"depends": [
"dndService"
]
}
],
"services": [

View File

@@ -38,10 +38,6 @@
.l-timeline-pane {
@include absPosDefault();
&.drop-over {
background-color: lighten($colorEditAreaBg, 5%);
}
.l-width-control {
position: relative;
}

View File

@@ -77,8 +77,7 @@
<mct-splitter></mct-splitter>
<!-- BOTTOM PANE RESOURCE LEGEND -->
<div mct-resource-graph-drop
class="split-pane-component abs l-timeline-pane t-pane-h l-pane-btm s-timeline-resource-legend l-timeline-resource-legend">
<div class="split-pane-component abs l-timeline-pane t-pane-h l-pane-btm s-timeline-resource-legend l-timeline-resource-legend">
<div class="l-title s-title">{{ngModel.title}}Resource Graph Legend</div>
<div class="l-legend-items legend">
<mct-include key="'timeline-legend-item'"

View File

@@ -1,81 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2009-2016, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(
['./SwimlaneDragConstants'],
function (SwimlaneDragConstants) {
/**
* Defines the `mct-resource-graph-drop` directive. When a drop occurs
* on an element with this attribute, the swimlane targeted by the drop
* will receive the dropped domain object (at which point it can handle
* the drop, typically by toggling the swimlane graph.)
* @param {DndService} dndService drag-and-drop service
*/
function MCTResourceGraphDrop(dndService) {
function link(scope, element, attrs) {
// Handle dragover
element.on('dragover', function (e) {
var swimlane = dndService.getData(
SwimlaneDragConstants.TIMELINE_SWIMLANE_DRAG_TYPE
);
if (typeof swimlane !== "undefined" && !swimlane.graph()) {
element.addClass('drop-over');
scope.$apply();
e.preventDefault();
}
});
// Handle drops
element.on('drop', function (e) {
var swimlane = dndService.getData(
SwimlaneDragConstants.TIMELINE_SWIMLANE_DRAG_TYPE
);
element.removeClass('drop-over');
// Only toggle if the graph isn't already set
if (typeof swimlane !== "undefined" && !swimlane.graph()) {
swimlane.toggleGraph();
e.preventDefault();
}
});
// Clear highlights when drag leaves this swimlane
element.on('dragleave', function (e) {
element.removeClass('drop-over');
scope.$apply();
e.preventDefault();
});
}
return {
// Applies to attributes
restrict: "A",
// Link using above function
link: link
};
}
return MCTResourceGraphDrop;
}
);

View File

@@ -1,159 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2009-2016, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(
['../../src/directives/MCTResourceGraphDrop', '../../src/directives/SwimlaneDragConstants'],
function (MCTResourceGraphDrop, SwimlaneDragConstants) {
describe("The mct-resource-graph-drop directive", function () {
var mockDndService,
mockScope,
mockElement,
testAttrs,
mockSwimlane,
testEvent,
handlers,
directive;
beforeEach(function () {
handlers = {};
mockDndService = jasmine.createSpyObj(
'dndService',
['setData', 'getData', 'removeData']
);
mockScope = jasmine.createSpyObj('$scope', ['$eval', '$apply']);
mockElement = jasmine.createSpyObj('element', ['on', 'addClass', 'removeClass']);
testAttrs = { mctSwimlaneDrop: "mockSwimlane" };
mockSwimlane = jasmine.createSpyObj(
"swimlane",
['graph', 'toggleGraph']
);
testEvent = {
dataTransfer: { getData: jasmine.createSpy() },
preventDefault: jasmine.createSpy(),
stopPropagation: jasmine.createSpy()
};
testEvent.dataTransfer.getData.andReturn('abc');
mockDndService.getData.andCallFake(function (key) {
return key === SwimlaneDragConstants.TIMELINE_SWIMLANE_DRAG_TYPE ?
mockSwimlane : undefined;
});
mockSwimlane.graph.andReturn(false);
directive = new MCTResourceGraphDrop(mockDndService);
directive.link(mockScope, mockElement, testAttrs);
mockElement.on.calls.forEach(function (call) {
handlers[call.args[0]] = call.args[1];
});
});
it("is available as an attribute", function () {
expect(directive.restrict).toEqual("A");
});
[false, true].forEach(function (graphing) {
describe("when swimlane graph is " + (graphing ? "" : "not ") + "enabled", function () {
beforeEach(function () {
mockSwimlane.graph.andReturn(graphing);
});
describe("on dragover", function () {
var prefix = !graphing ? "does" : "does not";
beforeEach(function () {
handlers.dragover(testEvent);
});
it(prefix + " add a drop-over class", function () {
var expectAddClass = expect(mockElement.addClass);
(!graphing ? expectAddClass : expectAddClass.not)
.toHaveBeenCalledWith('drop-over');
});
it(prefix + " call $apply on scope", function () {
var expectApply = expect(mockScope.$apply);
(!graphing ? expectApply : expectApply.not)
.toHaveBeenCalled();
});
it(prefix + " prevent default", function () {
var expectPreventDefault = expect(testEvent.preventDefault);
(!graphing ? expectPreventDefault : expectPreventDefault.not)
.toHaveBeenCalled();
});
});
describe("on drop", function () {
var prefix = !graphing ? "does" : "does not";
beforeEach(function () {
handlers.drop(testEvent);
});
it("removes any drop-over class", function () {
expect(mockElement.removeClass)
.toHaveBeenCalledWith('drop-over');
});
it(prefix + " toggle the swimlane's resource graph", function () {
var expectToggle = expect(mockSwimlane.toggleGraph);
(!graphing ? expectToggle : expectToggle.not)
.toHaveBeenCalled();
});
it(prefix + " prevent default", function () {
var expectPreventDefault = expect(testEvent.preventDefault);
(!graphing ? expectPreventDefault : expectPreventDefault.not)
.toHaveBeenCalled();
});
});
describe("on dragleave", function () {
beforeEach(function () {
handlers.dragleave(testEvent);
});
it("removes any drop-over class", function () {
expect(mockElement.removeClass)
.toHaveBeenCalledWith('drop-over');
});
it("calls $apply on scope", function () {
expect(mockScope.$apply).toHaveBeenCalled();
});
it("calls preventDefault on events", function () {
expect(testEvent.preventDefault).toHaveBeenCalled();
});
});
});
});
});
}
);

View File

@@ -27,7 +27,7 @@
ng-required="ngRequired || compositeCtrl.isNonEmpty(ngModel[field])"
ng-pattern="ngPattern"
options="item.options"
structure="item"
structure="row"
field="$index">
</mct-control>
<span class="composite-control-label">

View File

@@ -255,15 +255,16 @@ define([
this.legacyExtension('types', legacyDefinition);
}.bind(this));
this.objectViews.getAllProviders().forEach(function (p) {
this.objectViews.providers.forEach(function (p) {
this.legacyExtension('views', {
key: p.key,
key: 'vpid' + p.vpid,
vpid: p.vpid,
provider: p,
name: p.name,
cssClass: p.cssClass,
description: p.description,
editable: p.editable,
template: '<mct-view mct-provider-key="' + p.key + '"/>'
template: '<mct-view mct-vpid="' + p.vpid + '"/>'
});
}, this);

View File

@@ -43,8 +43,8 @@ define([
priority: i + 100 // arbitrary to allow new views to
// be defaults by returning priority less than 100.
};
if (v.provider && v.provider.priority) {
vd.priority = v.provider.priority(newDomainObject);
if (v.provider) {
vd.priority = v.provider.canView(newDomainObject);
}
return vd;
})
@@ -54,6 +54,7 @@ define([
};
return capability;
};
}
return patchViewCapability;

View File

@@ -27,15 +27,12 @@ define([
return {
restrict: 'E',
link: function (scope, element, attrs) {
var provider = openmct.objectViews.getByProviderKey(attrs.mctProviderKey);
var provider = openmct.objectViews.getByVPID(Number(attrs.mctVpid));
var view = new provider.view(scope.domainObject.useCapability('adapter'));
var domElement = element[0];
view.show(domElement);
view.show(element[0]);
if (view.destroy) {
scope.$on('$destroy', function () {
view.destroy(domElement);
view.destroy(element[0]);
});
}
}

View File

@@ -29,7 +29,7 @@ define([], function () {
view,
legacyObject
) {
if (view.hasOwnProperty('provider')) {
if (view.hasOwnProperty('vpid')) {
var domainObject = legacyObject.useCapability('adapter');
return view.provider.canView(domainObject);
}

View File

@@ -48,7 +48,6 @@ define([
this.unlisteners.forEach(function (unlisten) {
unlisten();
});
this.unlisteners = [];
};
/**

View File

@@ -50,18 +50,11 @@ define([
this.rootProvider = new RootObjectProvider(this.rootRegistry);
}
/**
* Set fallback provider, this is an internal API for legacy reasons.
* @private
*/
ObjectAPI.prototype.supersecretSetFallbackProvider = function (p) {
this.fallbackProvider = p;
};
/**
* Retrieve the provider for a given identifier.
* @private
*/
// Retrieve the provider for a given key.
ObjectAPI.prototype.getProvider = function (identifier) {
if (identifier.key === 'ROOT') {
return this.rootProvider;
@@ -142,28 +135,27 @@ define([
* @returns {Promise} a promise which will resolve when the domain object
* has been saved, or be rejected if it cannot be saved
*/
ObjectAPI.prototype.get = function (identifier) {
identifier = utils.parseKeyString(identifier);
var provider = this.getProvider(identifier);
if (!provider) {
throw new Error('No Provider Matched');
}
[
'save',
'delete',
'get'
].forEach(function (method) {
ObjectAPI.prototype[method] = function () {
var identifier = arguments[0],
provider = this.getProvider(identifier);
if (!provider.get) {
throw new Error('Provider does not support get!');
}
if (!provider) {
throw new Error('No Provider Matched');
}
return provider.get(identifier);
};
if (!provider[method]) {
throw new Error('Provider does not support [' + method + '].');
}
ObjectAPI.prototype.delete = function () {
throw new Error('Delete not implemented');
};
ObjectAPI.prototype.save = function () {
throw new Error('Save not implemented');
};
return provider[method].apply(provider, arguments);
};
});
/**
* Add a root-level object.

View File

@@ -35,7 +35,7 @@ define([
name: 'Name'
});
metadata.domains.forEach(function (domain, index) {
(metadata.domains || []).forEach(function (domain, index) {
var valueMetadata = _.clone(domain);
valueMetadata.hints = {
domain: index + 1
@@ -43,11 +43,11 @@ define([
valueMetadatas.push(valueMetadata);
});
metadata.ranges.forEach(function (range, index) {
(metadata.ranges || []).forEach(function (range, index) {
var valueMetadata = _.clone(range);
valueMetadata.hints = {
range: index,
priority: index + metadata.domains.length + 1
priority: index + (metadata.domains || []).length + 1
};
if (valueMetadata.type === 'enum') {

View File

@@ -25,7 +25,7 @@ define([
], function (
_
) {
// TODO: needs reference to formatService;
function TelemetryValueFormatter(valueMetadata, formatService) {
var numberFormatter = {
@@ -33,7 +33,12 @@ define([
return Number(x);
},
format: function (x) {
return x;
var number = parseFloat(x);
if (isNaN(number)){
return x;
} else {
return number.toFixed(2);
}
},
validate: function (x) {
return true;

View File

@@ -1,97 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2016, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(
[],
function () {
// Set of connection states; changing among these states will be
// reflected in the indicator's appearance.
// CONNECTED: Everything nominal, expect to be able to read/write.
// DISCONNECTED: HTTP failed; maybe misconfigured, disconnected.
// PENDING: Still trying to connect, and haven't failed yet.
var CONNECTED = {
glyphClass: "ok"
},
PENDING = {
glyphClass: 'caution'
},
DISCONNECTED = {
glyphClass: "err"
};
function URLIndicator($http, $interval) {
var self = this;
this.cssClass = this.options.cssClass ? this.options.cssClass : "icon-database";
this.URLpath = this.options.url;
this.label = this.options.label ? this.options.label : this.options.url;
this.interval = this.options.interval || 10000;
this.state = PENDING;
function handleError(e) {
self.state = DISCONNECTED;
}
function handleResponse() {
self.state = CONNECTED;
}
function updateIndicator() {
$http.get(self.URLpath).then(handleResponse, handleError);
}
updateIndicator();
$interval(updateIndicator, self.interval, 0, false);
}
URLIndicator.prototype.getCssClass = function () {
return this.cssClass;
};
URLIndicator.prototype.getGlyphClass = function () {
return this.state.glyphClass;
};
URLIndicator.prototype.getText = function () {
switch (this.state) {
case CONNECTED: {
return this.label + " is connected";
}
case PENDING: {
return "Checking status of " + this.label + " please stand by...";
}
case DISCONNECTED: {
return this.label + " is offline";
}
}
};
URLIndicator.prototype.getDescription = function () {
switch (this.state) {
case CONNECTED: {
return this.label + " is online, checking status every " +
this.interval + " milliseconds.";
}
case PENDING: {
return "Checking status of " + this.label + " please stand by...";
}
case DISCONNECTED: {
return this.label + " is offline, checking status every " +
this.interval + " milliseconds";
}
}
};
return URLIndicator;
});

View File

@@ -1,20 +0,0 @@
define(
[
'./URLIndicator'
],
function URLIndicatorPlugin(URLIndicator) {
return function (opts) {
// Wrap the plugin in a function so we can apply the arguments.
function URLIndicatorWrapper() {
this.options = opts;
URLIndicator.apply(this, arguments);
}
URLIndicatorWrapper.prototype = Object.create(URLIndicator.prototype);
return function install(openmct) {
openmct.legacyExtension('indicators', {
"implementation": URLIndicatorWrapper,
"depends": ["$http", "$interval"]
});
};
};
});

View File

@@ -1,158 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2016, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(
["./URLIndicator"],
function (URLIndicator) {
describe("The URLIndicator", function () {
var mockHttp,
mockInterval,
mockPromise,
opts,
Indicator,
indicatorWrapper;
beforeEach(function () {
mockHttp = jasmine.createSpyObj("$http", ["get"]);
mockInterval = jasmine.createSpy("$interval");
mockPromise = jasmine.createSpyObj("promise", ["then"]);
opts = {
url: "http://localhost:8080",
interval: 1337 //some number
};
mockHttp.get.andReturn(mockPromise);
Indicator = function () {
this.options = opts;
URLIndicator.call(this, mockHttp, mockInterval);
};
Indicator.prototype = Object.create(URLIndicator.prototype);
indicatorWrapper = new Indicator();
});
it("polls for changes", function () {
expect(mockInterval).toHaveBeenCalledWith(
jasmine.any(Function),
opts.interval,
0,
false
);
});
it("has a database cssClass as default", function () {
expect(indicatorWrapper.getCssClass()).toEqual("icon-database");
});
it("consults the url with the path supplied", function () {
expect(mockHttp.get).toHaveBeenCalledWith(opts.url);
});
it("changes when the database connection is nominal", function () {
var initialText = indicatorWrapper.getText(),
initialDescrption = indicatorWrapper.getDescription(),
initialGlyphClass = indicatorWrapper.getGlyphClass();
// Nominal just means getting back an object, without
// an error field.
mockPromise.then.mostRecentCall.args[0]({ data: {} });
// Verify that these values changed;
// don't test for specific text.
expect(indicatorWrapper.getText()).not.toEqual(initialText);
expect(indicatorWrapper.getGlyphClass()).not.toEqual(initialGlyphClass);
expect(indicatorWrapper.getDescription()).not.toEqual(initialDescrption);
// Do check for specific class
expect(indicatorWrapper.getGlyphClass()).toEqual("ok");
});
it("changes when the server cannot be reached", function () {
var initialText = indicatorWrapper.getText(),
initialDescrption = indicatorWrapper.getDescription(),
initialGlyphClass = indicatorWrapper.getGlyphClass();
// Nominal just means getting back an object, without
// an error field.
mockPromise.then.mostRecentCall.args[1]({ data: {} });
// Verify that these values changed;
// don't test for specific text.
expect(indicatorWrapper.getText()).not.toEqual(initialText);
expect(indicatorWrapper.getGlyphClass()).not.toEqual(initialGlyphClass);
expect(indicatorWrapper.getDescription()).not.toEqual(initialDescrption);
// Do check for specific class
expect(indicatorWrapper.getGlyphClass()).toEqual("err");
});
it("has a customized cssClass if supplied in initialization", function () {
opts = {
url: "http://localhost:8080",
cssClass: "cssClass-checked",
interval: 10000
};
indicatorWrapper = new Indicator();
expect(indicatorWrapper.getCssClass()).toEqual("cssClass-checked");
});
it("has a customized interval if supplied in initialization", function () {
opts = {
url: "http://localhost:8080",
interval: 1814
};
indicatorWrapper = new Indicator();
expect(mockInterval).toHaveBeenCalledWith(
jasmine.any(Function),
1814,
0,
false
);
});
it("has a custom label if supplied in initialization", function () {
opts = {
url: "http://localhost:8080",
label: "Localhost"
};
indicatorWrapper = new Indicator();
expect(indicatorWrapper.getText()).toEqual("Checking status of Localhost please stand by...");
});
it("has a default label if not supplied in initialization", function () {
opts = {
url: "http://localhost:8080"
};
indicatorWrapper = new Indicator();
expect(indicatorWrapper.getText()).toEqual(
"Checking status of http://localhost:8080 please stand by..."
);
});
it("has a default interval if not supplied in initialization", function () {
opts = {
url: "http://localhost:8080"
};
indicatorWrapper = new Indicator();
expect(mockInterval).toHaveBeenCalledWith(
jasmine.any(Function),
10000,
0,
false
);
});
});
}
);

View File

@@ -27,9 +27,9 @@ define([
'../../platform/features/autoflow/plugin',
'./timeConductor/plugin',
'../../example/imagery/plugin',
'../../platform/import-export/bundle',
'./summaryWidget/plugin',
'./URLIndicatorPlugin/URLIndicatorPlugin'
'../../platform/import-export/bundle',
'./telemetryMean/plugin'
], function (
_,
UTCTimeSystem,
@@ -37,9 +37,9 @@ define([
AutoflowPlugin,
TimeConductorPlugin,
ExampleImagery,
ImportExport,
SummaryWidget,
URLIndicatorPlugin
ImportExport,
TelemetryMean
) {
var bundleMap = {
CouchDB: 'platform/persistence/couch',
@@ -124,9 +124,8 @@ define([
};
plugins.ExampleImagery = ExampleImagery;
plugins.SummaryWidget = SummaryWidget;
plugins.URLIndicatorPlugin = URLIndicatorPlugin;
plugins.TelemetryMean = TelemetryMean;
return plugins;
});

View File

@@ -24,11 +24,19 @@ define(
[],
function () {
/**
* Defines composition policy for Display Layout objects.
* They cannot contain folders.
* @constructor
* @memberof platform/features/layout
* @implements {Policy.<View, DomainObject>}
*/
function SummaryWidgetsCompositionPolicy(openmct) {
this.openmct = openmct;
}
SummaryWidgetsCompositionPolicy.prototype.allow = function (parent, child) {
var parentType = parent.getCapability('type');
var newStyleChild = child.useCapability('adapter');

View File

@@ -44,13 +44,16 @@ define(['./src/SummaryWidget', './SummaryWidgetsCompositionPolicy'], function (S
return {
name: 'Widget View',
view: function (domainObject) {
return new SummaryWidget(domainObject, openmct);
var summaryWidget = new SummaryWidget(domainObject, openmct);
return {
show: summaryWidget.show,
destroy: summaryWidget.destroy
};
},
canView: function (domainObject) {
return (domainObject.type === 'summary-widget');
},
editable: true,
key: 'summaryWidgets'
editable: true
};
}
@@ -58,8 +61,7 @@ define(['./src/SummaryWidget', './SummaryWidgetsCompositionPolicy'], function (S
openmct.types.addType('summary-widget', widgetType);
openmct.objectViews.addProvider(initViewProvider(openmct));
openmct.legacyExtension('policies', {category: 'composition',
implementation: SummaryWidgetsCompositionPolicy, depends: ['openmct']
});
implementation: SummaryWidgetsCompositionPolicy, depends: ['openmct']});
};
}

View File

@@ -52,10 +52,14 @@
<select class="t-trigger">
<option value="any">any condition is met</option>
<option value="all">all conditions are met</option>
<!-- <option value="js">the following JavaScript evaluates to true</option> -->
</select>
</div>
</span>
</li>
<!-- <li class="t-rule-js-condition-input-holder">
<textarea placeholder="" class="med t-rule-js-condition-input"></textarea>
</li> -->
<li>
<label></label>
<span class="controls">

View File

@@ -3,7 +3,6 @@ define([
'./input/ObjectSelect',
'./input/KeySelect',
'./input/OperationSelect',
'./eventHelpers',
'EventEmitter',
'zepto'
], function (
@@ -11,10 +10,10 @@ define([
ObjectSelect,
KeySelect,
OperationSelect,
eventHelpers,
EventEmitter,
$
) {
/**
* Represents an individual condition for a summary widget rule. Manages the
* associated inputs and view.
@@ -26,7 +25,6 @@ define([
* selects with configuration data
*/
function Condition(conditionConfig, index, conditionManager) {
eventHelpers.extend(this);
this.config = conditionConfig;
this.index = index;
this.conditionManager = conditionManager;
@@ -73,17 +71,15 @@ define([
value = (isNaN(elem.valueAsNumber) ? elem.value : elem.valueAsNumber),
inputIndex = self.valueInputs.indexOf(elem);
if (elem.tagName.toUpperCase() === 'INPUT') {
self.eventEmitter.emit('change', {
value: value,
property: 'values[' + inputIndex + ']',
index: self.index
});
}
self.eventEmitter.emit('change', {
value: value,
property: 'values[' + inputIndex + ']',
index: self.index
});
}
this.listenTo(this.deleteButton, 'click', this.remove, this);
this.listenTo(this.duplicateButton, 'click', this.duplicate, this);
this.deleteButton.on('click', this.remove);
this.duplicateButton.on('click', this.duplicate);
this.selects.object = new ObjectSelect(this.config, this.conditionManager, [
['any', 'any telemetry'],
@@ -109,9 +105,13 @@ define([
$('.t-configuration', self.domElement).append(select.getDOM());
});
this.listenTo($(this.domElement), 'input', onValueInput);
$(this.domElement).on('input', 'input', onValueInput);
}
/**
* Get the DOM element representing this condition in the view
* @return {Element}
*/
Condition.prototype.getDOM = function (container) {
return this.domElement;
};
@@ -143,14 +143,6 @@ define([
*/
Condition.prototype.remove = function () {
this.eventEmitter.emit('remove', this.index);
this.destroy();
};
Condition.prototype.destroy = function () {
this.stopListening();
Object.values(this.selects).forEach(function (select) {
select.destroy();
});
};
/**

View File

@@ -312,6 +312,17 @@ define([], function () {
}
};
/**
* Interpret a string as a JavaScript conditional, and return its boolean value
* @param {string} condition The string to interpreted as JavaScript
* @return {boolean} The value of the conditions
*/
ConditionEvaluator.prototype.executeJavaScriptCondition = function (condition) {
var conditionValue = false;
//TODO: implement JavaScript execution
return conditionValue;
};
/**
* A function that returns true only if each value in its input argument is
* of a numerical type

View File

@@ -66,8 +66,6 @@ define ([
ConditionManager.prototype.on = function (event, callback, context) {
if (this.supportedCallbacks.includes(event)) {
this.eventEmitter.on(event, callback, context || this);
} else {
throw event + " is not a supported callback. Supported callbacks are " + this.supportedCallbacks;
}
};
@@ -87,7 +85,8 @@ define ([
ruleOrder.forEach(function (ruleId) {
rule = rules[ruleId];
conditions = rule.getProperty('conditions');
conditions = rule.getProperty('trigger') === 'js' ?
rule.getProperty('jsCondition') : rule.getProperty('conditions');
if (self.evaluator.execute(conditions, rule.getProperty('trigger'))) {
activeId = ruleId;
}
@@ -129,7 +128,7 @@ define ([
self = this;
self.telemetryTypesById[object.identifier.key] = {};
return telemetryAPI.request(object, {size: 1, strategy: 'latest'}).then(function (telemetry) {
return telemetryAPI.request(object, {}).then(function (telemetry) {
Object.entries(telemetry[telemetry.length - 1]).forEach(function (telem) {
key = telem[0];
type = typeof telem[1];

View File

@@ -3,7 +3,6 @@ define([
'./Condition',
'./input/ColorPalette',
'./input/IconPalette',
'./eventHelpers',
'EventEmitter',
'lodash',
'zepto'
@@ -12,11 +11,11 @@ define([
Condition,
ColorPalette,
IconPalette,
eventHelpers,
EventEmitter,
_,
$
) {
/**
* An object representing a summary widget rule. Maintains a set of text
* and css properties for output, and a set of conditions for configuring
@@ -30,7 +29,6 @@ define([
* @param {element} container The DOM element which cotains this summary widget
*/
function Rule(ruleConfig, domainObject, openmct, conditionManager, widgetDnD, container) {
eventHelpers.extend(this);
var self = this;
this.config = ruleConfig;
@@ -104,19 +102,11 @@ define([
*/
function onColorInput(color, property) {
self.config.style[property] = color;
self.updateDomainObject();
self.thumbnail.css(property, color);
self.eventEmitter.emit('change');
}
/**
* Parse input text from textbox to prevent HTML Injection
* @param {string} msg The text to be Parsed
* @private
*/
function encodeMsg(msg) {
return $('<div />').text(msg).html();
}
/**
* An onchange event handler method for this rule's trigger key
* @param {event} event The change event from this rule's select element
@@ -124,7 +114,7 @@ define([
*/
function onTriggerInput(event) {
var elem = event.target;
self.config.trigger = encodeMsg(elem.value);
self.config.trigger = elem.value;
self.generateDescription();
self.updateDomainObject();
self.refreshConditions();
@@ -138,13 +128,12 @@ define([
* @private
*/
function onTextInput(elem, inputKey) {
var text = encodeMsg(elem.value);
self.config[inputKey] = text;
self.config[inputKey] = elem.value;
self.updateDomainObject();
if (inputKey === 'name') {
self.title.html(text);
self.title.html(elem.value);
} else if (inputKey === 'label') {
self.thumbnailLabel.html(text);
self.thumbnailLabel.html(elem.value);
}
self.eventEmitter.emit('change');
}
@@ -184,38 +173,33 @@ define([
Object.keys(this.colorInputs).forEach(function (inputKey) {
var input = self.colorInputs[inputKey];
input.set(self.config.style[inputKey]);
onColorInput(self.config.style[inputKey], inputKey);
input.on('change', function (value) {
onColorInput(value, inputKey);
self.updateDomainObject();
});
input.set(self.config.style[inputKey]);
$('.t-style-input', self.domElement).append(input.getDOM());
});
Object.keys(this.textInputs).forEach(function (inputKey) {
self.textInputs[inputKey].prop('value', self.config[inputKey] || '');
self.listenTo(self.textInputs[inputKey], 'input', function () {
self.textInputs[inputKey].on('input', function () {
onTextInput(this, inputKey);
});
});
this.listenTo(this.deleteButton, 'click', this.remove);
this.listenTo(this.duplicateButton, 'click', this.duplicate);
this.listenTo(this.addConditionButton, 'click', function () {
this.deleteButton.on('click', this.remove);
this.duplicateButton.on('click', this.duplicate);
this.addConditionButton.on('click', function () {
self.initCondition();
});
this.listenTo(this.toggleConfigButton, 'click', toggleConfig);
this.listenTo(this.trigger, 'change', onTriggerInput);
this.toggleConfigButton.on('click', toggleConfig);
this.trigger.on('change', onTriggerInput);
this.title.html(self.config.name);
this.description.html(self.config.description);
this.trigger.prop('value', self.config.trigger);
this.listenTo(this.grippy, 'mousedown', onDragStart);
this.grippy.on('mousedown', onDragStart);
this.widgetDnD.on('drop', function () {
this.domElement.show();
$('.t-drag-indicator').hide();
@@ -260,10 +244,6 @@ define([
palette.destroy();
});
this.iconInput.destroy();
this.stopListening();
this.conditions.forEach(function (condition) {
condition.destroy();
});
};
/**
@@ -376,7 +356,6 @@ define([
this.domainObject.configuration.ruleConfigById = ruleConfigById;
this.updateDomainObject();
this.refreshConditions();
this.generateDescription();
};
/**
@@ -416,9 +395,11 @@ define([
}
if (self.conditions.length === 1) {
// Only one condition
self.conditions[0].hideButtons();
}
self.generateDescription();
};
/**
@@ -436,7 +417,6 @@ define([
this.domainObject.configuration.ruleConfigById[this.config.id] = this.config;
this.updateDomainObject();
this.refreshConditions();
this.generateDescription();
this.eventEmitter.emit('conditionChange');
};
@@ -480,6 +460,7 @@ define([
description = (description === '' ? this.config.description : description);
this.description.html(description);
this.config.description = description;
this.updateDomainObject();
};
return Rule;

View File

@@ -4,7 +4,6 @@ define([
'./ConditionManager',
'./TestDataManager',
'./WidgetDnD',
'./eventHelpers',
'lodash',
'zepto'
], function (
@@ -13,7 +12,6 @@ define([
ConditionManager,
TestDataManager,
WidgetDnD,
eventHelpers,
_,
$
) {
@@ -34,8 +32,6 @@ define([
* @param {MCT} openmct An MCT instance
*/
function SummaryWidget(domainObject, openmct) {
eventHelpers.extend(this);
this.domainObject = domainObject;
this.openmct = openmct;
@@ -90,7 +86,7 @@ define([
self.outerWrapper.toggleClass('expanded-widget-test-data');
self.toggleTestDataControl.toggleClass('expanded');
}
this.listenTo(this.toggleTestDataControl, 'click', toggleTestData);
this.toggleTestDataControl.on('click', toggleTestData);
/**
* Toggles the configuration area for rules in the view
@@ -100,7 +96,7 @@ define([
self.outerWrapper.toggleClass('expanded-widget-rules');
self.toggleRulesControl.toggleClass('expanded');
}
this.listenTo(this.toggleRulesControl, 'click', toggleRules);
this.toggleRulesControl.on('click', toggleRules);
openmct.$injector.get('objectService')
.getObjects([id])
@@ -142,7 +138,7 @@ define([
* @param {domainObject} Object instance of this object
*/
SummaryWidget.prototype.watchForChanges = function (openmct, domainObject) {
this.watchForChangesUnsubscribe = openmct.objects.observe(domainObject, '*', function (newDomainObject) {
openmct.objects.observe(domainObject, '*', function (newDomainObject) {
if (newDomainObject.url !== this.domainObject.url ||
newDomainObject.openNewTab !== this.domainObject.openNewTab) {
this.addHyperlink(newDomainObject.url, newDomainObject.openNewTab);
@@ -164,15 +160,13 @@ define([
this.widgetDnD = new WidgetDnD(this.domElement, this.domainObject.configuration.ruleOrder, this.rulesById);
this.initRule('default', 'Default');
this.domainObject.configuration.ruleOrder.forEach(function (ruleId) {
if (ruleId !== 'default') {
self.initRule(ruleId);
}
self.initRule(ruleId);
});
this.refreshRules();
this.updateWidget();
this.updateView();
this.listenTo(this.addRuleButton, 'click', this.addRule);
this.addRuleButton.on('click', this.addRule);
this.conditionManager.on('receiveTelemetry', this.executeRules, this);
this.widgetDnD.on('drop', this.reorder, this);
};
@@ -184,14 +178,10 @@ define([
SummaryWidget.prototype.destroy = function (container) {
this.editListenerUnsubscribe();
this.conditionManager.destroy();
this.testDataManager.destroy();
this.widgetDnD.destroy();
this.watchForChangesUnsubscribe();
Object.values(this.rulesById).forEach(function (rule) {
rule.destroy();
});
this.stopListening();
};
/**
@@ -232,26 +222,13 @@ define([
var self = this,
ruleOrder = self.domainObject.configuration.ruleOrder,
rules = self.rulesById;
self.ruleArea.html('');
Object.values(ruleOrder).forEach(function (ruleId) {
self.ruleArea.append(rules[ruleId].getDOM());
});
this.executeRules();
this.addOrRemoveDragIndicator();
};
SummaryWidget.prototype.addOrRemoveDragIndicator = function () {
var rules = this.domainObject.configuration.ruleOrder;
var rulesById = this.rulesById;
rules.forEach(function (ruleKey, index, array) {
if (array.length > 2 && index > 0) {
$('.t-grippy', rulesById[ruleKey].domElement).show();
} else {
$('.t-grippy', rulesById[ruleKey].domElement).hide();
}
});
};
/**
@@ -285,13 +262,12 @@ define([
ruleOrder = this.domainObject.configuration.ruleOrder;
while (Object.keys(this.rulesById).includes('rule' + ruleCount)) {
ruleCount++;
ruleCount = ++ruleCount;
}
ruleId = 'rule' + ruleCount;
ruleOrder.push(ruleId);
this.domainObject.configuration.ruleOrder = ruleOrder;
this.updateDomainObject();
this.initRule(ruleId, 'Rule');
this.refreshRules();
@@ -341,7 +317,7 @@ define([
if (!this.domainObject.configuration.ruleConfigById[ruleId]) {
this.domainObject.configuration.ruleConfigById[ruleId] = {
name: ruleName || 'Rule',
label: 'Unnamed Rule',
label: this.domainObject.name,
message: '',
id: ruleId,
icon: ' ',

View File

@@ -2,14 +2,12 @@ define([
'text!../res/testDataItemTemplate.html',
'./input/ObjectSelect',
'./input/KeySelect',
'./eventHelpers',
'EventEmitter',
'zepto'
], function (
itemTemplate,
ObjectSelect,
KeySelect,
eventHelpers,
EventEmitter,
$
) {
@@ -26,7 +24,6 @@ define([
* @constructor
*/
function TestDataItem(itemConfig, index, conditionManager) {
eventHelpers.extend(this);
this.config = itemConfig;
this.index = index;
this.conditionManager = conditionManager;
@@ -73,17 +70,16 @@ define([
function onValueInput(event) {
var elem = event.target,
value = (isNaN(elem.valueAsNumber) ? elem.value : elem.valueAsNumber);
if (elem.tagName.toUpperCase() === 'INPUT') {
self.eventEmitter.emit('change', {
value: value,
property: 'value',
index: self.index
});
}
self.eventEmitter.emit('change', {
value: value,
property: 'value',
index: self.index
});
}
this.listenTo(this.deleteButton, 'click', this.remove);
this.listenTo(this.duplicateButton, 'click', this.duplicate);
this.deleteButton.on('click', this.remove);
this.duplicateButton.on('click', this.duplicate);
this.selects.object = new ObjectSelect(this.config, this.conditionManager);
this.selects.key = new KeySelect(
@@ -101,7 +97,8 @@ define([
Object.values(this.selects).forEach(function (select) {
$('.t-configuration', self.domElement).append(select.getDOM());
});
this.listenTo(this.domElement, 'input', onValueInput);
$(this.domElement).on('input', 'input', onValueInput);
}
/**
@@ -140,11 +137,6 @@ define([
TestDataItem.prototype.remove = function () {
var self = this;
this.eventEmitter.emit('remove', self.index);
this.stopListening();
Object.values(this.selects).forEach(function (select) {
select.destroy();
});
};
/**

View File

@@ -1,11 +1,9 @@
define([
'./eventHelpers',
'text!../res/testDataTemplate.html',
'./TestDataItem',
'zepto',
'lodash'
], function (
eventHelpers,
testDataTemplate,
TestDataItem,
$,
@@ -20,7 +18,6 @@ define([
* @param {MCT} openmct and MCT instance
*/
function TestDataManager(domainObject, conditionManager, openmct) {
eventHelpers.extend(this);
var self = this;
this.domainObject = domainObject;
@@ -48,10 +45,10 @@ define([
self.updateTestCache();
}
this.listenTo(this.addItemButton, 'click', function () {
this.addItemButton.on('click', function () {
self.initItem();
});
this.listenTo(this.testDataInput, 'change', toggleTestData);
this.testDataInput.on('change', toggleTestData);
this.evaluator.setTestDataCache(this.testCache);
this.evaluator.useTestData(false);
@@ -189,12 +186,5 @@ define([
this.openmct.objects.mutate(this.domainObject, 'configuration.testDataConfig', this.config);
};
TestDataManager.prototype.destroy = function () {
this.items.forEach(function (item) {
item.remove();
});
this.stopListening();
};
return TestDataManager;
});

View File

@@ -1,74 +0,0 @@
var listenersCount = 0;
/*global define*/
// jscs:disable disallowDanglingUnderscores
define([], function () {
var helperFunctions = {
listenTo: function (object, event, callback, context) {
if (!this._listeningTo) {
this._listeningTo = [];
}
var listener = {
object: object,
event: event,
callback: callback,
context: context,
_cb: !!context ? callback.bind(context) : callback
};
if (object.$watch && event.indexOf('change:') === 0) {
var scopePath = event.replace('change:', '');
listener.unlisten = object.$watch(scopePath, listener._cb, true);
} else if (object.$on) {
listener.unlisten = object.$on(event, listener._cb);
} else if (object.addEventListener) {
object.addEventListener(event, listener._cb);
} else {
object.on(event, listener._cb);
}
this._listeningTo.push(listener);
listenersCount++;
},
stopListening: function (object, event, callback, context) {
if (!this._listeningTo) {
this._listeningTo = [];
}
this._listeningTo.filter(function (listener) {
if (object && object !== listener.object) {
return false;
}
if (event && event !== listener.event) {
return false;
}
if (callback && callback !== listener.callback) {
return false;
}
if (context && context !== listener.context) {
return false;
}
return true;
})
.map(function (listener) {
if (listener.unlisten) {
listener.unlisten();
} else if (listener.object.removeEventListener) {
listener.object.removeEventListener(listener.event, listener._cb);
} else {
listener.object.off(listener.event, listener._cb);
}
listenersCount--;
return listener;
})
.forEach(function (listener) {
this._listeningTo.splice(this._listeningTo.indexOf(listener), 1);
}, this);
},
extend: function (object) {
object.listenTo = helperFunctions.listenTo;
object.stopListening = helperFunctions.stopListening;
}
};
return helperFunctions;
});

View File

@@ -1,8 +1,4 @@
define([
'./Select'
], function (
Select
) {
define(['./Select'], function (Select) {
/**
* Create a {Select} element whose composition is dynamically updated with
@@ -66,7 +62,7 @@ define([
onMetadataLoad();
}
this.objectSelect.on('change', onObjectChange, this);
this.objectSelect.on('change', onObjectChange);
this.manager.on('metadata', onMetadataLoad);
return this.select;
@@ -89,10 +85,6 @@ define([
}
};
KeySelect.prototype.destroy = function () {
this.objectSelect.destroy();
};
return KeySelect;
});

View File

@@ -1,10 +1,4 @@
define([
'./Select',
'../eventHelpers'
], function (
Select,
eventHelpers
) {
define(['./Select'], function (Select) {
/**
* Create a {Select} element whose composition is dynamically updated with
@@ -23,7 +17,6 @@ define([
var NULLVALUE = '- Select Comparison -';
function OperationSelect(config, keySelect, manager, changeCallback) {
eventHelpers.extend(this);
var self = this;
this.config = config;
@@ -38,7 +31,7 @@ define([
this.select.hide();
this.select.addOption('', NULLVALUE);
if (changeCallback) {
this.listenTo(this.select, 'change', changeCallback);
this.select.on('change', changeCallback);
}
/**
@@ -70,6 +63,7 @@ define([
}
self.select.setSelected(self.config.operation);
}
this.keySelect.on('change', onKeyChange);
this.manager.on('metadata', onMetadataLoad);
@@ -115,10 +109,6 @@ define([
});
};
OperationSelect.prototype.destroy = function () {
this.stopListening();
};
return OperationSelect;
});

View File

@@ -1,14 +1,13 @@
define([
'../eventHelpers',
'text!../../res/input/paletteTemplate.html',
'EventEmitter',
'zepto'
], function (
eventHelpers,
paletteTemplate,
EventEmitter,
$
) {
/**
* Instantiates a new Open MCT Color Palette input
* @constructor
@@ -20,8 +19,6 @@ define([
* up to the descendent class
*/
function Palette(cssClass, container, items) {
eventHelpers.extend(this);
var self = this;
this.cssClass = cssClass;
@@ -52,8 +49,8 @@ define([
$('.menu', self.domElement).hide();
this.listenTo($(document), 'click', this.hideMenu);
this.listenTo($('.l-click-area', self.domElement), 'click', function (event) {
$(document).on('click', this.hideMenu);
$('.l-click-area', self.domElement).on('click', function (event) {
event.stopPropagation();
$('.menu', self.container).hide();
$('.menu', self.domElement).show();
@@ -72,7 +69,7 @@ define([
$('.menu', self.domElement).hide();
}
this.listenTo($('.s-palette-item', self.domElement), 'click', handleItemClick);
$('.s-palette-item', self.domElement).on('click', handleItemClick);
}
/**
@@ -86,7 +83,7 @@ define([
* Clean up any event listeners registered to DOM elements external to the widget
*/
Palette.prototype.destroy = function () {
this.stopListening();
$(document).off('click', this.hideMenu);
};
Palette.prototype.hideMenu = function () {

View File

@@ -1,10 +1,8 @@
define([
'../eventHelpers',
'text!../../res/input/selectTemplate.html',
'EventEmitter',
'zepto'
], function (
eventHelpers,
selectTemplate,
EventEmitter,
$
@@ -16,8 +14,6 @@ define([
* @constructor
*/
function Select() {
eventHelpers.extend(this);
var self = this;
this.domElement = $(selectTemplate);
@@ -40,7 +36,7 @@ define([
self.eventEmitter.emit('change', value[0]);
}
this.listenTo($('select', this.domElement), 'change', onChange, this);
$('select', this.domElement).on('change', onChange);
}
/**
@@ -144,9 +140,5 @@ define([
$('.equal-to').removeClass('hidden');
};
Select.prototype.destroy = function () {
this.stopListening();
};
return Select;
});

View File

@@ -196,6 +196,7 @@ define(['../src/ConditionEvaluator'], function (ConditionEvaluator) {
//if no conditions are fully defined, should return false for any mode
expect(evaluator.execute(mockConditionsUndefined, 'any')).toEqual(false);
expect(evaluator.execute(mockConditionsUndefined, 'all')).toEqual(false);
expect(evaluator.execute(mockConditionsUndefined, 'js')).toEqual(false);
//these conditions are true: evaluator should ignore undefined conditions,
//and evaluate the rule as true
mockConditionsUndefined.push({

View File

@@ -65,8 +65,7 @@ define(['../src/SummaryWidget', 'zepto'], function (SummaryWidget, $) {
]);
mockOpenMCT.composition.get.andReturn(mockComposition);
mockOpenMCT.objects.mutate = jasmine.createSpy('mutate');
mockOpenMCT.objects.observe = jasmine.createSpy('observe');
mockOpenMCT.objects.observe.andReturn(function () {});
mockOpenMCT.objects.observe = function () {};
summaryWidget = new SummaryWidget(mockDomainObject, mockOpenMCT);
mockContainer = document.createElement('div');
@@ -116,8 +115,7 @@ define(['../src/SummaryWidget', 'zepto'], function (SummaryWidget, $) {
expect(Object.keys(mockDomainObject.configuration.ruleConfigById).length).toEqual(1);
});
it('uses mutate when updating the domain object only when in edit mode', function () {
summaryWidget.editing = true;
it('uses mutate when updating the domain object', function () {
summaryWidget.updateDomainObject();
expect(mockOpenMCT.objects.mutate).toHaveBeenCalled();
});

View File

@@ -0,0 +1,60 @@
define([
'./src/TelemetryMeanProvider',
'./src/TelemetryMeanActionDecorator'
],
function (
TelemetryMeanProvider, TelemetryMeanActionDecorator) {
var DEFAULT_SAMPLES = 10;
function plugin() {
return function install(openmct) {
openmct.types.addType('telemetry-mean', {
name: 'Telemetry Filter',
description: 'Provides telemetry values that represent the mean of the last N values of a telemetry stream',
creatable: true,
cssClass: 'icon-telemetry',
initialize: function (domainObject) {
domainObject.samples = DEFAULT_SAMPLES;
domainObject.telemetry = {
values: [
{
key: "utc",
name: "Time",
format: "utc",
hints: {
domain: 1
}
},
{
key: "value",
name: "Value",
hints: {
range: 1
}
}
]
}
},
form: [
{
"key": "telemetryPoint",
"name": "Telemetry Point",
"control": "textfield",
"required": true,
"cssClass": "l-input-lg"
},
{
"key": "samples",
"name": "Samples to Average",
"control": "textfield",
"required": true,
"cssClass": "l-input-sm"
}
]
});
openmct.telemetry.addProvider(new TelemetryMeanProvider(openmct));
};
}
return plugin;
});

View File

@@ -0,0 +1,71 @@
define([], function () {
function TelemetryMeanActionDecorator (openmct, actionService) {
this.actionService = actionService;
this.openmct = openmct;
[
'decorateAction',
'getActions',
'updateTelemetryFromLinkedObject'
].forEach(function (name) {
this[name] = this[name].bind(this);
}.bind(this))
}
TelemetryMeanActionDecorator.prototype.decorateAction = function (action) {
function update(object) {
var domainObject = object || action.domainObject;
return this.updateTelemetryFromLinkedObject(object)
.then(function (modelWithTelemetry) {
return this.mutate(domainObject, modelWithTelemetry);
}.bind(this));
}
if (action.getMetadata && action.getMetadata().key === 'properties' || action.getMetadata().key === 'create'){
var oldPerform = action.perform.bind(action);
action.perform = function () {
return oldPerform().then(update.bind(this), update.bind(this));
}.bind(this);
}
}
TelemetryMeanActionDecorator.prototype.mutate = function (domainObject, model) {
return domainObject.useCapability('mutation', function () {
return model
});
}
TelemetryMeanActionDecorator.prototype.getActions = function () {
var actions = this.actionService.getActions.apply(this.actionService, arguments);
actions.forEach(this.decorateAction);
return actions;
};
TelemetryMeanActionDecorator.prototype.updateTelemetryFromLinkedObject = function (domainObject) {
var model = domainObject.getModel();
var telemetryPoint = model.telemetryPoint;
var telemetryApi = this.openmct.telemetry;
if (telemetryPoint) {
return this.openmct.objects.get(telemetryPoint).then(function (referencedObject) {
if (referencedObject.type !== 'unknown') {
var keysForRanges = telemetryApi.getMetadata(referencedObject).valuesForHints(['range'])
.map(function (metadatum) {
return metadatum.source;
});
model.telemetry.values = referencedObject.telemetry.values.map(function (value) {
if (keysForRanges.indexOf(value.source) !== -1) {
value.name = value.name + " (Mean)";
}
return value;
});
}
return model;
}.bind(this));
}
}
return TelemetryMeanActionDecorator;
});

View File

@@ -0,0 +1,112 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
function TelemetryMeanProvider(openmct) {
this.openmct = openmct;
this.subscriptionBuffer = [];
this.lastNValues = [];
}
TelemetryMeanProvider.prototype.canProvideTelemetry = function (domainObject) {
return domainObject.type === 'telemetry-mean';
};
TelemetryMeanProvider.prototype.supportsRequest = function () {
return false;
}
TelemetryMeanProvider.prototype.supportsSubscribe =
TelemetryMeanProvider.prototype.canProvideTelemetry;
TelemetryMeanProvider.prototype.subscribe = function (domainObject, callback) {
var promiseForObject = this.getWrappedObject(domainObject)
return this.subscribeToWrappedObject(promiseForObject, callback);
};
TelemetryMeanProvider.prototype.getWrappedObject = function (domainObject) {
var objectId = domainObject.telemetryPoint;
return this.openmct.objects.get(objectId);
};
TelemetryMeanProvider.prototype.subscribeToWrappedObject = function (promiseForObject, callback) {
var wrappedUnsubscribe;
var unsubscribeCalled = false;
promiseForObject.then(function subscribe(wrappedObject) {
if (!unsubscribeCalled && wrappedObject){
wrappedUnsubscribe = this.subscribeToMeanValues(wrappedObject, callback);
}
}.bind(this));
return function unsubscribe(){
unsubscribeCalled = true;
if (wrappedUnsubscribe !== undefined) {
wrappedUnsubscribe();
}
};
}
TelemetryMeanProvider.prototype.subscribeToMeanValues = function (object, callback) {
var telemetryApi = this.openmct.telemetry;
var lastNData = [];
var rangeKey = telemetryApi.getMetadata(object).valuesForHints(['range'])
.map(function (metadatum) {
return metadatum.source;
}
)[0];
return telemetryApi.subscribe(object, function (telemetryDatum) {
lastNData.push(telemetryDatum);
if (lastNData.length > object.samples) {
lastNData.shift();
}
var meanDatum = this.calculateMeansForDatum(telemetryDatum, rangeKey, lastNData);
callback(meanDatum);
}.bind(this));
}
TelemetryMeanProvider.prototype.calculateMeansForDatum = function (telemetryDatum, keyToMean, lastNData) {
var meanDatum = {
'utc': telemetryDatum['utc'],
'value': this.calculateMean(lastNData, keyToMean)
}
return meanDatum;
}
TelemetryMeanProvider.prototype.calculateMean = function (lastNData, valueToMean) {
return lastNData.reduce(function (sum, datum){
return sum + datum[valueToMean];
}, 0) / lastNData.length;
};
TelemetryMeanProvider.prototype.request = function (domainObject, request) {
throw "Historical requests not supported for Telemetry Averager";
};
return TelemetryMeanProvider;
});

View File

@@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global console */
define([], function () {
/**
@@ -29,7 +28,8 @@ define([], function () {
* @memberof module:openmct
*/
function ViewRegistry() {
this.providers = {};
this.next_id = 0;
this.providers = [];
}
@@ -40,17 +40,10 @@ define([], function () {
* which can provide views of this object
*/
ViewRegistry.prototype.get = function (item) {
return this.getAllProviders()
.filter(function (provider) {
return provider.canView(item);
});
};
/**
* @private
*/
ViewRegistry.prototype.getAllProviders = function () {
return Object.values(this.providers);
return this.providers.filter(function (provider) {
return typeof provider.canView(item) !== 'undefined' &&
provider.canView(item) !== false;
});
};
/**
@@ -61,22 +54,8 @@ define([], function () {
* @memberof module:openmct.ViewRegistry#
*/
ViewRegistry.prototype.addProvider = function (provider) {
var key = provider.key;
if (key === undefined) {
throw "View providers must have a unique 'key' property defined";
}
if (this.providers[key] !== undefined) {
console.warn("Provider already defined for key '%s'. Provider keys must be unique.", key);
}
this.providers[key] = provider;
};
/**
* @private
*/
ViewRegistry.prototype.getByProviderKey = function (key) {
return this.providers[key];
provider.vpid = this.next_id++;
this.providers.push(provider);
};
/**
@@ -126,7 +105,6 @@ define([], function () {
* Exposes types of views in Open MCT.
*
* @interface ViewProvider
* @property {string} key a unique identifier for this view
* @property {string} name the human-readable name of this view
* @property {string} [description] a longer-form description (typically
* a single sentence or short paragraph) of this kind of view
@@ -141,26 +119,16 @@ define([], function () {
* When called by Open MCT, this may include additional arguments
* which are on the path to the object to be viewed; for instance,
* when viewing "A Folder" within "My Items", this method will be
* invoked with "A Folder" (as a domain object) as the first argument
* invoked with "A Folder" (as a domain object) as the first argument,
* and "My Items" as the second argument.
*
* @method canView
* @memberof module:openmct.ViewProvider#
* @param {module:openmct.DomainObject} domainObject the domain object
* to be viewed
* @returns {boolean} 'true' if the view applies to the provided object,
* otherwise 'false'.
*/
/**
* Optional method determining the priority of a given view. If this
* function is not defined on a view provider, then a default priority
* of 100 will be applicable for all objects supported by this view.
*
* @method priority
* @memberof module:openmct.ViewProvider#
* @param {module:openmct.DomainObject} domainObject the domain object
* to be viewed
* @returns {number} The priority of the view. If multiple views could apply
* @returns {Number|boolean} if this returns `false`, then the view does
* not apply to the object. If it returns true or any number, then
* it applies to this object. If multiple views could apply
* to an object, the view that returns the lowest number will be
* the default view.
*/

View File

@@ -59,7 +59,7 @@ requirejs.config({
"moment": "bower_components/moment/moment",
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
"moment-timezone": "bower_components/moment-timezone/builds/moment-timezone-with-data",
"saveAs": "bower_components/file-saver/FileSaver.min",
"saveAs": "bower_components/FileSaver.js/FileSaver.min",
"screenfull": "bower_components/screenfull/dist/screenfull.min",
"text": "bower_components/text/text",
"uuid": "bower_components/node-uuid/uuid",