Author: smaisonneuve Date: 2015-06-09 15:32:54 +0000 (Tue, 09 Jun 2015) New Revision: 1660 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1660 Log: [Refactor] Moving Tuner and TunerCollection into es6 classes Modified: oipf/lib/gulpfile.js oipf/lib/js/impl/model/Tuner.js oipf/lib/js/impl/model/TunerCollection.js Modified: oipf/lib/gulpfile.js =================================================================== --- oipf/lib/gulpfile.js 2015-06-09 15:31:49 UTC (rev 1659) +++ oipf/lib/gulpfile.js 2015-06-09 15:32:54 UTC (rev 1660) @@ -42,7 +42,7 @@ "minification.propertyLiterals", "utility.inlineEnvironmentVariables" ], - compact: true + compact: false })) .on("error", errorHandler) .pipe(concat(conf.buildFile)) Modified: oipf/lib/js/impl/model/Tuner.js =================================================================== --- oipf/lib/js/impl/model/Tuner.js 2015-06-09 15:31:49 UTC (rev 1659) +++ oipf/lib/js/impl/model/Tuner.js 2015-06-09 15:32:54 UTC (rev 1660) @@ -8,90 +8,95 @@ * attribute of the <video_broadcast> element. * NOTE: An OITF may contain a physical tuner that has its capabilities split into multiple Tuner objects to fit the * restrictions on the <video_broadcast> element outlined above and in section 9.3.1. -* +* * Note: The standbyState property has been removed from this class. */ -var Tuner = Class.extend({ - - /* - * Description: A unique identifier of the tuner. - * - * Visibility Type: readonly Integer - */ - id: null, - - /* - * Description: The name of the tuner as designated in OITF. - * - * Visibility Type: readonly String - */ - name: null, - - /* - * Description: Returns a collection of the types supported by the tuner. The types are according to the ID types in section 7.13.11.1 under Channel object. - * - * Visibility Type: readonly IntegerCollection - */ - idTypes: null, - - /* - * Description: - * The property enables ( true ) and disables ( false ) the tuner. Reading the property provides the current - * state, enabled or disabled. Attempting to disable the tuner while the resource is in use has no effect and the tuner SHALL continue to be enabled. - * While disabled: - * • any external power feed (if applicable) SHALL be turned off; - * • the value of the signalInfo property is not defined; - * • the value of the lnbInfo property is not defined; - * • the tuner SHALL NOT be available for use by any JavaScript object (e.g. the video/broadcast object) or by the underlying OITF system (e.g. to perform a * scheduled recording). Note the property enableTuner is available in order to re-enable the tuner and get access to the tuner again. - * - * The set value of the property SHALL persist after OITF restarts. - * - * Type: Boolean - */ - enableTuner: null, - - /* - * Description: The property returns a SignalInfo object with signal information for example signal strength. - * - * Visibility Type: readonly SignalInfo - */ - signalInfo: null, - - /* - * Description: The property returns a LNBInfo object with information regarding the LNB associated with the tuner. - * - * Visibility Type: readonly LNBInfo - */ - lnbInfo: null, +class Tuner { - /* - * Description: Indicates the physical interface associated with the tuner. - * - * Visibility Type: readonly Integer - */ - frontEndPosition: null, - - /* - * Description: - * The property turns on (true) and off (false) the power applied to the external interface of the tuner unless the - * tuner is disabled. Reading the property provides the current value, on or off. Attempting to modify the - * property while the resource is in use has no effect. The value of the property SHALL persist after OITF - * restarts. - * For DVB-S/S2 power is supplied to the LNB(s) and if present the DiSEqC switch. - * For DVB-T/T2 a supply +5V is supplied to the antenna with built in amplifier. Note that applying power may - * have adverse effects to the external equipment if it has its own power supply. It is a strong recommendation - * to indicate to the end user a possible adverse effect before using this method. - * For DVB-C/C2 there is no effect. - * Reading the property provides the current value. - * - * Type: Boolean - */ - powerOnExternal: null, - - init: function(name, idTypes, defaultProperties) { + constructor() { + /* + * Description: A unique identifier of the tuner. + * + * Visibility Type: readonly Integer + */ + this.id = null; + + /* + * Description: The name of the tuner as designated in OITF. + * + * Visibility Type: readonly String + */ + this.name = null; + + /* + * Description: Returns a collection of the types supported by the tuner. The types are according to the ID types in section + * 7.13.11.1 under Channel object. + * + * Visibility Type: readonly IntegerCollection + */ + this.idTypes = null; + + /* + * Description: + * The property enables ( true ) and disables ( false ) the tuner. Reading the property provides the current + * state, enabled or disabled. Attempting to disable the tuner while the resource is in use has no effect and the tuner SHALL + * continue to be enabled. + * While disabled: + * • any external power feed (if applicable) SHALL be turned off; + * • the value of the signalInfo property is not defined; + * • the value of the lnbInfo property is not defined; + * • the tuner SHALL NOT be available for use by any JavaScript object (e.g. the video/broadcast object) or by the underlying OITF + * system (e.g. to perform a * scheduled recording). Note the property enableTuner is available in order to re-enable + * the tuner and get access to the tuner again. + * + * The set value of the property SHALL persist after OITF restarts. + * + * Type: Boolean + */ + this.enableTuner = null; + + /* + * Description: The property returns a SignalInfo object with signal information for example signal strength. + * + * Visibility Type: readonly SignalInfo + */ + this.signalInfo = null; + + /* + * Description: The property returns a LNBInfo object with information regarding the LNB associated with the tuner. + * + * Visibility Type: readonly LNBInfo + */ + this.lnbInfo = null; + + /* + * Description: Indicates the physical interface associated with the tuner. + * + * Visibility Type: readonly Integer + */ + this.frontEndPosition = null; + + /* + * Description: + * The property turns on (true) and off (false) the power applied to the external interface of the tuner unless the + * tuner is disabled. Reading the property provides the current value, on or off. Attempting to modify the + * property while the resource is in use has no effect. The value of the property SHALL persist after OITF + * restarts. + * For DVB-S/S2 power is supplied to the LNB(s) and if present the DiSEqC switch. + * For DVB-T/T2 a supply +5V is supplied to the antenna with built in amplifier. Note that applying power may + * have adverse effects to the external equipment if it has its own power supply. It is a strong recommendation + * to indicate to the end user a possible adverse effect before using this method. + * For DVB-C/C2 there is no effect. + * Reading the property provides the current value. + * + * Type: Boolean + */ + this.powerOnExternal = null; + } + + init(name, idTypes, defaultProperties) { oipf.utils.initProperties.call(this, defaultProperties); this.idTypes = idTypes; this.name = name; } - -}); \ No newline at end of file +} Modified: oipf/lib/js/impl/model/TunerCollection.js =================================================================== --- oipf/lib/js/impl/model/TunerCollection.js 2015-06-09 15:31:49 UTC (rev 1659) +++ oipf/lib/js/impl/model/TunerCollection.js 2015-06-09 15:32:54 UTC (rev 1660) @@ -3,10 +3,10 @@ * The TunerCollection class represents a collection of Tuner objects. See Annex K for the definition of the collection template. * */ -var TunerCollection = Collection.extend({ - - init: function() { - this.super.init.apply(this, arguments); +class TunerCollection extends Collection { + + constructor(...args) { + super(...args); } -}); \ No newline at end of file +}
participants (1)
-
smaisonneuve@users.nuiton.org