-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditionals feature #2830
Merged
Merged
Conditionals feature #2830
Changes from 1 commit
Commits
Show all changes
489 commits
Select commit
Hold shift + click to select a range
486dae5
add metadata provider
davetsay acd75f8
add name to conditions view
davetsay 80656c1
Merge branch 'topic-conditionals' into dave/provide-conditions-telemetry
davetsay 0915aae
allow conditions to be dropped into telemetry views
davetsay 96e433b
Merge pull request #2677 from nasa/condition-clone-name
shefalijoshi 30a493d
resolved merge conflict
614206b
remove criterion working
43056c4
implimented clone criterion
25e28ab
added controls for remove and duplicate criteria
598d2b3
remove criterion working
fea6d2d
Merge branch 'remove-criteria' of https://github.com/nasa/openmct int…
ec4d121
changed classname of controls div
463ec47
changed classname of controls div
f504a33
disabled add or edit condition set without telemetry
858199e
enable trigger
cda97d1
Merge branch 'condition-trigger' of https://github.com/nasa/openmct i…
4456633
output telemetry to views
davetsay 1b9b7e2
added hid/show selects
b4cf81a
wip: filtering select comparison
f328a10
filter comparison list based on field selected
ee6e0f3
changed default input to array and clear downstream selection lists o…
8f87cc7
rendering correct number of input fields depending on operation and p…
d46310c
handle multiple inputs in telemetryCriterion
a51c0d5
addressed review comments
467c57b
Merge branch 'criterion-multi-input' of https://github.com/nasa/openm…
fc53e85
Merge branch 'conditionals-refactor' into dave/provide-conditions-tel…
davetsay 9d5c7a4
destroy conditionManager instance on stop providing telemetry
davetsay b8dc5ac
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
shefalijoshi 2609a41
Addresses comments
shefalijoshi 0e9bf74
Merge branch 'conditionals-refactor' into dave/provide-conditions-tel…
davetsay 3aec9ec
add setData on dragStart for FF support
e57c18f
removed unused isDefault prop
1a409af
wip: addressing review comments
d2a45e4
modified getOperationFormat
b386275
removed disabled inputs with no telemetry
c9419d3
Fix for when input is not an array. This will be handled differently …
shefalijoshi 28255dc
Merge pull request #2687 from nasa/remove-criteria
shefalijoshi 583f4da
Merge branch 'conditionals-refactor' into dave/provide-conditions-tel…
davetsay 364191e
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
shefalijoshi d333fd5
disabled add or edit condition set without telemetry
8539d60
enable trigger
371a7d3
removed disabled inputs with no telemetry
564be6f
Merge branch 'condition-trigger' of https://github.com/nasa/openmct i…
e526626
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
shefalijoshi ac13bc5
Merge pull request #2688 from nasa/condition-trigger
shefalijoshi ba78098
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
shefalijoshi 89ae6ef
provide telemetry with timestamps
davetsay cfafecd
Merge pull request #2685 from nasa/conditionals-refactor
JoelMcKinnon 39bf601
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
83d08ae
resolve merge conflicts
14e3500
add timestamps for default condition
davetsay fd56840
Merge branch 'topic-conditionals' into dave/provide-conditions-telemetry
davetsay 3626ff9
fix linting issues
davetsay fd74fb0
remove unused var
davetsay 9bd1c51
always use timestamp from latest datum
davetsay 0f9d7d2
fix default condition edge case
davetsay 5498ba8
changed computeResults
16a0bf9
Merge pull request #2703 from nasa/criterion-multi-input
shefalijoshi 2c40396
refactor for clarity
davetsay 71424dc
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
84ae655
remove unused var
davetsay b74733b
Add back id and conditionId required for styling
davetsay 51c70d0
fix naming bug
davetsay dabd0bf
only listen for condition updates in telemetry provider
davetsay 47d4fc9
removed CurrentOutput component
fa83b48
removed extra div
fb1eed1
Merge pull request #2706 from nasa/current-output-refactor
shefalijoshi 97f829d
added dragstop listener and dragStop method
3b046db
Merge pull request #2695 from nasa/firefox-drag-fix
shefalijoshi f8b3899
addressed review comments and lint errors
768df84
Merge pull request #2711 from nasa/condition-output-persistance2
shefalijoshi ecabd00
fix failing unit tests
davetsay ece6223
Merge pull request #2704 from nasa/dave/provide-conditions-telemetry
shefalijoshi 8cb29ba
add handleConditionUpdated back
davetsay b8b838f
get all timesystems
davetsay 4c4b587
pass timestamp datum through to ConditionManager
davetsay 34a1496
keep track of latest timestamp
davetsay 5b00246
fix failing unit test
davetsay 95f855f
Merge pull request #2717 from nasa/dave/conditions-telemetry
JoelMcKinnon 576b843
Merge branch 'master' of https://github.com/nasa/openmct into topic-c…
shefalijoshi 3e6509c
WIP add support for LAD request
davetsay 897d052
WIP continue to add support for LAD request
davetsay 7f32d19
WIP request gets to telemetry criterion before erroring
davetsay cf9336d
WIP receive criterion results and compute condition results
davetsay 4675fc8
Conditional styles (#2718)
shefalijoshi 4a5e106
request LAD for conditions provides telemetry
davetsay 27a0923
Integrate Conditionals styling into topic-conditionals (try 2) (#2730)
charlesh88 24bade2
provide correct data to getLatestTimestamp call
davetsay a7e57c6
linting fixes (#2733)
davetsay 8900072
added computed property and method to get description
efca7c8
added descriptions to conditions
7a4b967
condition sets with no telemetry points should not provide telemetry
davetsay 49ff0c7
tidy up condition manager use in telemetry provider
davetsay 084df53
Merge branch 'topic-conditionals' into dave/condition-telemetry-request
davetsay 0da80c2
move var declaration around for clarity
davetsay dba5586
fix broken unit tests
davetsay 6095872
remove logging
davetsay 63feaef
reinitialize rule string in forEach
02cd304
Removed conditions as domain objects
shefalijoshi 65f80f4
Resubscribe to the conditionSet telemetry provider when the condition…
shefalijoshi 625b39d
Fix typo
shefalijoshi b75b7a9
added input types and fixed bug for isDefined, isUndefined comparisons
649575f
Moves domain object observe logic to the condition set telemetry prov…
shefalijoshi 74a7ef2
Fix bug with removeCondition
shefalijoshi 81caa27
Fixes failing tests
shefalijoshi 8f05c57
Fixes clone condition bug
shefalijoshi 1dc9743
remove unecessary get call
davetsay 15a7d03
rename function for clarity
davetsay 09bfd80
Fix bug with telemetry disappearing
shefalijoshi 76e7fec
Ensures the conditionManager is in sync with outside changes so that …
shefalijoshi 83c648c
Addresses comments
shefalijoshi 41c79c6
[Conditions] ConditionManager should observe its own mutations (#2748)
davetsay 94b5617
Since we're observing for changes to the conditionSet domain object, …
shefalijoshi f090f7f
Removes comment.
shefalijoshi 55e5c49
Merge pull request #2747 from nasa/conditions-do-refactor
davetsay 8975bc8
Handles enum meta data for criteria
shefalijoshi 6ab60ab
ConditionSet view listens to a listener from conditionCollection to d…
shefalijoshi 90dd53e
Merge branch 'topic-conditionals' into dave/condition-telemetry-request
davetsay 090e89d
remove testing aid
davetsay 84f0d49
code is documentation
davetsay e339d74
remove uneccessary update call
davetsay b7fffea
conditionManager controls subscriptions
davetsay b0bb723
resolve merge, address review comments
500ab52
Merge pull request #2754 from nasa/conditions-observables
shefalijoshi 5d21a8b
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
shefalijoshi 60aecfe
Merge branch 'topic-conditionals' into dave/conditions-telemetry
davetsay fe2e29d
Merge pull request #2753 from nasa/remove-ConditionSetView-telemetry
davetsay 43a82ec
Conditional styles for drawing objects (#2740)
shefalijoshi cc2df84
vue style render of description
e22458f
Merge branch 'master' of https://github.com/nasa/openmct into topic-c…
shefalijoshi 05f94ed
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
shefalijoshi 316e0f2
added fieldName prop to telemetry object, computed props for canEvalu…
243b9ca
subscribe to telemetry
davetsay 0cd2799
added isLastCriterion comp method
6b4cd25
Merge branch 'topic-conditionals' into dave/conditions-telemetry
davetsay 6731283
Merge pull request #2734 from nasa/condition-description
davetsay 00d1b5e
avoid multiple instantiations of condtionManager if possible
davetsay 11978cd
remove straggler call
davetsay 983ed7f
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
shefalijoshi 5332d13
Fix small bug with inputCount
shefalijoshi ce1fdbd
Merge pull request #2757 from nasa/conditions-set-cleanup
shefalijoshi 3f61db2
pass telemetry down to criteria. criteria listens to corresponding en…
davetsay 1f3ec77
Merge branch 'topic-conditionals' into fix-enum-metadata
davetsay e08b4ff
Merge pull request #2751 from nasa/fix-enum-metadata
davetsay 3b82fd5
Merge branch 'topic-conditionals' into dave/conditions-telemetry
davetsay ecf3e19
remove listener on destroy
davetsay b38a9ad
exclude default condition when requesting telemetry
davetsay cbeb25c
request telemetry from all conditions
davetsay aed5377
use existing var instead of recalculating
davetsay d51dd8b
fix broken tests
davetsay e4a6c21
load composition using less code
davetsay 05d9817
change string output to enum for plot views
davetsay f04b5b6
suppress plot view on view condition sets
davetsay 60fce4a
remove completed TODO comments
davetsay 44f48a3
moved persist calls to events, used emit to save name and fieldname p…
1f19f48
fix unit tests
davetsay 096c968
Merge branch 'master' of https://github.com/nasa/openmct into topic-c…
shefalijoshi f790c9b
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
shefalijoshi 87b4000
Merge pull request #2763 from nasa/dave/conditions-views
davetsay 26ffe8e
remove comment
davetsay 42ac3ef
Implements two new operations - is one of and is not one of that eval…
shefalijoshi f13714e
rename telemetry subscription calls
davetsay 48af39a
Merge branch 'topic-conditionals' into dave/conditions-telemetry
davetsay 77b705e
add telemetry object back for criterion
davetsay d42bd44
remove logging statement
davetsay a5a1976
remove debug
davetsay 78487a4
restrict conditionManager instances to one per domainObject
davetsay 168c040
fix sticky telemetry selection issue
87513a1
removed log
0a2e912
removed refs from dom elements and added index to call to isLastCrite…
437e8a0
always load composition
davetsay 2c1b4b4
Merge pull request #2759 from nasa/dave/conditions-telemetry
shefalijoshi 57a68a2
Apply condition sets to drawing objects in a layout + Static styling …
shefalijoshi dc54eef
Resolves #2776
shefalijoshi c27c347
Conditionals fixes and tweaks
charlesh88 cdf0dd0
Conditionals fixes and tweaks
charlesh88 07d101a
Conditionals fixes and tweaks
charlesh88 6f500d0
Resolves ##2741
shefalijoshi 7f49a7b
Conditionals fixes and tweaks
charlesh88 dc7f837
Adds parse treatment for string format.
shefalijoshi 829eecf
resolved merge conflicts
fcca8fa
Fixes error while getting metadata when telemetry is not yet availabl…
shefalijoshi 0a634eb
Fixes unit tests
shefalijoshi a681d67
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
shefalijoshi f76f537
removed extraneous emits and handlers
39d7dc8
Adds unit tests for isOneOf and isNotOneOf
shefalijoshi 32da19a
New Condition Widget, WIP
charlesh88 b7cea7b
New Condition Widget, WIP
charlesh88 a1f2608
Merge pull request #2782 from nasa/conditionals-ch-fixes-032420
charlesh88 0857fd9
New Condition Widget, WIP
charlesh88 6ff5ce7
Merge remote-tracking branch 'origin' into new-widget
charlesh88 953b95f
Merge branch 'topic-conditionals' into new-widget
charlesh88 fff89a6
delete unsubscribe method on destroy
davetsay d2b7407
add request for LAD data
davetsay 28a603d
New Condition Widget, WIP
charlesh88 0cae614
New Condition Widget, WIP
charlesh88 311ff00
Merge pull request #2784 from nasa/fix-conditionals
davetsay 1b680cf
moved persist call into change event method and removed check on $ref
a810095
Merge branch 'condition-persist' of https://github.com/nasa/openmct i…
4a07ddb
added persist call to change enum input
015aa8c
Checks for input before processing it.
shefalijoshi 0cf27c3
Merge pull request #2768 from nasa/conditionset-multi-value-operations
shefalijoshi 32c1641
Fixes description for enums
shefalijoshi de8f808
Merge pull request #2786 from nasa/issue-2773
shefalijoshi 0552769
change back to refs
271c619
Merge pull request #2789 from nasa/fix-description
JoelMcKinnon 23ec838
Merge pull request #2764 from nasa/condition-persist
davetsay d1b28e0
Merge branch 'topic-conditionals' into new-widget
charlesh88 7c200df
resolved merge conflict
4172fdf
Merge pull request #2788 from nasa/criterion-enum-persist
shefalijoshi 5128af2
New Condition Widget, WIP
charlesh88 53440c3
Handles remove telemetry from condition set - this resets criterion p…
shefalijoshi 91e1a14
Merge branch 'master' of https://github.com/nasa/openmct into topic-c…
shefalijoshi 4413c29
Merge pull request #2793 from nasa/new-widget
charlesh88 ec0291c
Implement any telemetry and all telemetry options
shefalijoshi 7282792
fixed refs and ev bugs
f0fd0a9
Use parsed telemetry data values for condition evaluations (#2783)
shefalijoshi bf947a8
reverted to espresso (#2797)
JoelMcKinnon 502d29d
Add all and any options for telemetry
shefalijoshi 459a055
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
shefalijoshi 03a690a
Fixes import
shefalijoshi 0a1959d
Fixes linting issues
shefalijoshi 1a86204
used lodash cloneDeep for criteria, conditions
ef3c4cc
clear dependent fields when field selector is changed
5f06100
fixed updateOperations, clearDependentFields, removed unnecessary ref
5ec8ac9
Fixes linting issues
shefalijoshi f990a14
Remove duplicate metadata options
shefalijoshi 89a298f
Removes name string fix
shefalijoshi 90b475e
addressed review comments
c02cbd1
Merge pull request #2804 from nasa/criterion-type-change
davetsay 389589d
Merge pull request #2806 from nasa/preserve-user-input
davetsay a5a4bb8
Removed extra if statement, copied only config
2907d6d
moved opy to cloneCondition
d00e8b6
Merge pull request #2802 from nasa/clone-condition-issues
davetsay 84874f2
Cast number inputs to a Number so that operations evaluate correctly …
shefalijoshi 9e12203
Merge branch 'master' into topic-conditionals
davetsay f9e8832
Condition Widget refinements (#2814)
charlesh88 a31d10e
Adds NOT and XOR triggers for conditions (#2816)
shefalijoshi 14eaf4e
Addresses comments: Fixes dropdown logic
shefalijoshi 4e39d9f
Test data for condition sets (#2807)
shefalijoshi 984bede
Removed image properties button from display layouts toolbar (#2809)
JoelMcKinnon 42eeeea
Merge branch 'topic-conditionals' of https://github.com/nasa/openmct …
shefalijoshi e4c9f15
Merge pull request #2800 from nasa/any-all-telemetry
shefalijoshi 0792012
Merge branch 'master' into topic-conditionals
davetsay 4220a8a
[Conditionals] default condition handling (#2827)
davetsay 8512b63
Merge branch 'master' of https://github.com/nasa/openmct into topic-c…
shefalijoshi 064cf67
Adds copyright text
shefalijoshi 3956cd1
Merge pull request #2829 from nasa/topic-conditionals-master-merge
shefalijoshi ebaf702
Topic conditionals master merge (#2833)
charlesh88 b90eb80
Addresses review comments: Rename file, change copyright year, remove…
shefalijoshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Adds NOT and XOR triggers for conditions (#2816)
* Adds XOR and NOT triggers for conditions * Adds unit tests and fixes linting issues
- Loading branch information
commit a31d10e70887c4189cb9496e2b170fd6223dcc8d
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/***************************************************************************** | ||
* Open MCT, Copyright (c) 2014-2020, 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. | ||
*****************************************************************************/ | ||
|
||
import { computeConditionByLimit } from "./evaluator"; | ||
|
||
describe('evaluate results based on trigger', function () { | ||
|
||
it('should evaluate to true if trigger is NOT', () => { | ||
const results = { | ||
result: false, | ||
result1: false, | ||
result2: false | ||
}; | ||
const result = computeConditionByLimit(results, 0); | ||
expect(result).toBeTrue(); | ||
}); | ||
|
||
it('should evaluate to false if trigger is NOT', () => { | ||
const results = { | ||
result: true, | ||
result1: false, | ||
result2: false | ||
}; | ||
const result = computeConditionByLimit(results, 0); | ||
expect(result).toBeFalse(); | ||
}); | ||
|
||
it('should evaluate to true if trigger is XOR', () => { | ||
const results = { | ||
result: false, | ||
result1: true, | ||
result2: false | ||
}; | ||
const result = computeConditionByLimit(results, 1); | ||
expect(result).toBeTrue(); | ||
}); | ||
|
||
it('should evaluate to false if trigger is XOR', () => { | ||
const results = { | ||
result: false, | ||
result1: true, | ||
result2: true | ||
}; | ||
const result = computeConditionByLimit(results, 1); | ||
expect(result).toBeFalse(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Criteria need to be indexed by ID. An array search is O(N) in the worst case, and we might be doing this hundreds of times per second with high data rate telemetry sources.