2017-02-21 23:56:08 +00:00
|
|
|
/*****************************************************************************
|
2022-01-18 19:27:28 +00:00
|
|
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
2017-02-21 23:56:08 +00:00
|
|
|
* 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([
|
|
|
|
"./GeneratorProvider",
|
2018-03-21 21:18:08 +00:00
|
|
|
"./SinewaveLimitProvider",
|
|
|
|
"./StateGeneratorProvider",
|
|
|
|
"./GeneratorMetadataProvider"
|
2017-02-21 23:56:08 +00:00
|
|
|
], function (
|
|
|
|
GeneratorProvider,
|
2018-03-21 21:18:08 +00:00
|
|
|
SinewaveLimitProvider,
|
|
|
|
StateGeneratorProvider,
|
|
|
|
GeneratorMetadataProvider
|
2017-02-21 23:56:08 +00:00
|
|
|
) {
|
|
|
|
|
2019-11-28 00:04:52 +00:00
|
|
|
return function (openmct) {
|
2018-03-02 22:29:34 +00:00
|
|
|
|
|
|
|
openmct.types.addType("example.state-generator", {
|
|
|
|
name: "State Generator",
|
|
|
|
description: "For development use. Generates test enumerated telemetry by cycling through a given set of states",
|
2018-11-06 21:22:44 +00:00
|
|
|
cssClass: "icon-generator-telemetry",
|
2018-03-02 22:29:34 +00:00
|
|
|
creatable: true,
|
|
|
|
form: [
|
|
|
|
{
|
|
|
|
name: "State Duration (seconds)",
|
2019-01-25 00:03:09 +00:00
|
|
|
control: "numberfield",
|
2018-03-02 22:29:34 +00:00
|
|
|
cssClass: "l-input-sm l-numeric",
|
|
|
|
key: "duration",
|
|
|
|
required: true,
|
|
|
|
property: [
|
|
|
|
"telemetry",
|
|
|
|
"duration"
|
2019-01-25 00:03:09 +00:00
|
|
|
]
|
2018-03-02 22:29:34 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
initialize: function (object) {
|
|
|
|
object.telemetry = {
|
2018-03-21 21:18:08 +00:00
|
|
|
duration: 5
|
2020-07-31 19:11:03 +00:00
|
|
|
};
|
2018-03-02 22:29:34 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
openmct.telemetry.addProvider(new StateGeneratorProvider());
|
|
|
|
|
2017-02-22 03:53:56 +00:00
|
|
|
openmct.types.addType("generator", {
|
2017-05-10 00:55:15 +00:00
|
|
|
name: "Sine Wave Generator",
|
2017-02-21 23:56:08 +00:00
|
|
|
description: "For development use. Generates example streaming telemetry data using a simple sine wave algorithm.",
|
2018-11-06 21:22:44 +00:00
|
|
|
cssClass: "icon-generator-telemetry",
|
2017-02-21 23:56:08 +00:00
|
|
|
creatable: true,
|
|
|
|
form: [
|
|
|
|
{
|
|
|
|
name: "Period",
|
2018-03-21 21:18:08 +00:00
|
|
|
control: "numberfield",
|
2017-02-21 23:56:08 +00:00
|
|
|
cssClass: "l-input-sm l-numeric",
|
|
|
|
key: "period",
|
|
|
|
required: true,
|
|
|
|
property: [
|
|
|
|
"telemetry",
|
|
|
|
"period"
|
2018-03-21 21:18:08 +00:00
|
|
|
]
|
2017-02-21 23:56:08 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Amplitude",
|
2018-03-21 21:18:08 +00:00
|
|
|
control: "numberfield",
|
2017-02-21 23:56:08 +00:00
|
|
|
cssClass: "l-input-sm l-numeric",
|
|
|
|
key: "amplitude",
|
|
|
|
required: true,
|
|
|
|
property: [
|
|
|
|
"telemetry",
|
|
|
|
"amplitude"
|
2018-03-21 21:18:08 +00:00
|
|
|
]
|
2017-02-21 23:56:08 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Offset",
|
2018-03-21 21:18:08 +00:00
|
|
|
control: "numberfield",
|
2017-02-21 23:56:08 +00:00
|
|
|
cssClass: "l-input-sm l-numeric",
|
|
|
|
key: "offset",
|
|
|
|
required: true,
|
|
|
|
property: [
|
|
|
|
"telemetry",
|
|
|
|
"offset"
|
2018-03-21 21:18:08 +00:00
|
|
|
]
|
2017-02-21 23:56:08 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Data Rate (hz)",
|
2018-03-21 21:18:08 +00:00
|
|
|
control: "numberfield",
|
2017-02-21 23:56:08 +00:00
|
|
|
cssClass: "l-input-sm l-numeric",
|
|
|
|
key: "dataRateInHz",
|
|
|
|
required: true,
|
|
|
|
property: [
|
|
|
|
"telemetry",
|
|
|
|
"dataRateInHz"
|
2018-03-21 21:18:08 +00:00
|
|
|
]
|
2018-03-02 22:29:34 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Phase (radians)",
|
2018-03-21 21:18:08 +00:00
|
|
|
control: "numberfield",
|
2018-03-02 22:29:34 +00:00
|
|
|
cssClass: "l-input-sm l-numeric",
|
|
|
|
key: "phase",
|
|
|
|
required: true,
|
|
|
|
property: [
|
|
|
|
"telemetry",
|
|
|
|
"phase"
|
2018-03-21 21:18:08 +00:00
|
|
|
]
|
2020-03-05 16:29:45 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Randomness",
|
|
|
|
control: "numberfield",
|
|
|
|
cssClass: "l-input-sm l-numeric",
|
|
|
|
key: "randomness",
|
|
|
|
required: true,
|
|
|
|
property: [
|
|
|
|
"telemetry",
|
|
|
|
"randomness"
|
|
|
|
]
|
2017-02-21 23:56:08 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
initialize: function (object) {
|
|
|
|
object.telemetry = {
|
|
|
|
period: 10,
|
|
|
|
amplitude: 1,
|
|
|
|
offset: 0,
|
|
|
|
dataRateInHz: 1,
|
2020-03-05 16:29:45 +00:00
|
|
|
phase: 0,
|
|
|
|
randomness: 0
|
2017-02-21 23:56:08 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
2018-03-02 22:29:34 +00:00
|
|
|
|
2022-03-25 16:13:10 +00:00
|
|
|
openmct.telemetry.addProvider(new GeneratorProvider(openmct));
|
2018-03-21 21:18:08 +00:00
|
|
|
openmct.telemetry.addProvider(new GeneratorMetadataProvider());
|
|
|
|
openmct.telemetry.addProvider(new SinewaveLimitProvider());
|
2017-02-21 23:56:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
});
|