mirror of
https://github.com/nasa/openmct.git
synced 2025-01-02 11:26:42 +00:00
Implements two new operations - is one of and is not one of that evaluates to true if telemetry matches one of many values
This commit is contained in:
parent
87b4000b12
commit
42ac3ef9af
@ -202,5 +202,31 @@ export const OPERATIONS = [
|
||||
getDescription: function (values) {
|
||||
return ' is not ' + values[0];
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'valueIs',
|
||||
operation: function (input) {
|
||||
const values = input[1].split(',');
|
||||
return values.find((value) => input[0].toString() === value.toString().replace(' ', ''));
|
||||
},
|
||||
text: 'is one of',
|
||||
appliesTo: ["string", "number"],
|
||||
inputCount: 1,
|
||||
getDescription: function (values) {
|
||||
return ' is one of ' + values[0];
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'valueIsNot',
|
||||
operation: function (input) {
|
||||
const values = input[1].split(',');
|
||||
return values.find((value) => input[0].toString() !== value.toString().replace(' ', ''));
|
||||
},
|
||||
text: 'is not one of',
|
||||
appliesTo: ["string", "number"],
|
||||
inputCount: 1,
|
||||
getDescription: function (values) {
|
||||
return ' is not one of ' + values[0];
|
||||
}
|
||||
}
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user