1- /*global define*/
2-
3- define ( [
4- './MCWSStreamProvider'
5- ] , function (
6- MCWSStreamProvider
7- ) {
8- 'use strict' ;
9-
10- /**
11- * Provides real-time streaming DataProduct data.
12- * @constructor
13- * @augments {MCWSStreamProvider }
14- * @memberof {vista/telemetry}
15- */
16- var MCWSDataProductStreamProvider = MCWSStreamProvider . extend ( {
17- constructor : function ( openmct , vistaTime , options ) {
18- this . options = options ;
19- MCWSStreamProvider . call ( this , openmct , vistaTime ) ;
20- }
21- } ) ;
1+ import MCWSStreamProvider from './MCWSStreamProvider' ;
2+
3+ /**
4+ * Provides real-time streaming DataProduct data.
5+ * @memberof {vista/telemetry}
6+ */
7+ class MCWSDataProductStreamProvider extends MCWSStreamProvider {
8+ constructor ( openmct , vistaTime , options ) {
9+ super ( openmct , vistaTime ) ;
10+ this . options = options ;
11+ }
2212
23- MCWSDataProductStreamProvider . prototype . getUrl = function ( domainObject ) {
24- return domainObject . telemetry && domainObject . telemetry . dataProductStreamUrl ;
25- } ;
13+ getUrl ( domainObject ) {
14+ return domainObject . telemetry ? .dataProductStreamUrl ;
15+ }
2616
27- MCWSDataProductStreamProvider . prototype . getKey = function ( domainObject ) {
17+ getKey ( ) {
2818 // We return undefined so that we can match on undefined properties.
2919 return undefined ;
30- } ;
20+ }
3121
32- MCWSDataProductStreamProvider . prototype . getProperty = function ( ) {
22+ getProperty ( ) {
3323 // We just want something that returns undefined so it matches the
3424 // key above. Hacky.
3525 return 'some_undefined_property' ;
36- } ;
26+ }
3727
38- MCWSDataProductStreamProvider . prototype . subscribe = function ( domainObject , callback , options ) {
28+ subscribe ( domainObject , callback , options ) {
3929 function wrappedCallback ( datum ) {
4030 let sessionId = datum . session_id ;
4131
@@ -53,18 +43,18 @@ define([
5343 callback ( datum ) ;
5444 }
5545
56- return MCWSStreamProvider . prototype . subscribe . call ( this , domainObject , wrappedCallback , options ) ;
46+ return super . subscribe ( domainObject , wrappedCallback , options ) ;
5747 }
5848
59- MCWSDataProductStreamProvider . prototype . notifyWorker = function ( key , value ) {
49+ notifyWorker ( key , value ) {
6050 if ( key === 'subscribe' && this . options . realtimeProductAPIDs
6151 && value . mcwsVersion === 3.2 ) {
6252 value . extraFilterTerms = {
6353 apid : '(' + this . options . realtimeProductAPIDs . join ( ',' ) + ')'
6454 } ;
6555 }
66- MCWSStreamProvider . prototype . notifyWorker . call ( this , key , value ) ;
67- } ;
56+ super . notifyWorker ( key , value ) ;
57+ }
58+ }
6859
69- return MCWSDataProductStreamProvider ;
70- } ) ;
60+ export default MCWSDataProductStreamProvider ;
0 commit comments