lib/dashboard/dashboard_operations.js
function innerStart (bundle) {
		var defered = q.defer();

		// Device Type is either T4, T5, or T7
		var deviceType = self.savedAttributes.deviceTypeName;

		// Save the created data collector object
		dataCollector = new dashboard_data_collector.create(deviceType);

		// Listen to only the next 'data' event emitted by the dataCollector.
		dataCollector.once('data', function(data) {
			debugDStart('dev_cur-dash_ops: First bit of data!');

			// Listen to future data.
			dataCollector.on('data', dataCollectorHandler);

			// Save the data to the data cache.
			self.dataCache = data;
			bundle.data = data;

			// Declare the innerStart function to be finished.
			defered.resolve(bundle);
		});

		// Start the data collector.
		dataCollector.start(self);

		return defered.promise;
	}
function innerStart (bundle) {
		var defered = q.defer();

		// Device Type is either T4, T5, or T7
		var deviceType = self.savedAttributes.deviceTypeName;

		// Save the created data collector object
		dataCollector = new dashboard_data_collector.create(deviceType);

		// Listen to only the next 'data' event emitted by the dataCollector.
		dataCollector.once('data', function(data) {
			debugDStart('dev_cur-dash_ops: First bit of data!');

			// Listen to future data.
			dataCollector.on('data', dataCollectorHandler);

			// Save the data to the data cache.
			self.dataCache = data;
			bundle.data = data;

			// Declare the innerStart function to be finished.
			defered.resolve(bundle);
		});

		// Start the data collector.
		dataCollector.start(self);

		return defered.promise;
	}
function innerStart ( bundle ) { var defered = q . defer ( ) ; // Device Type is either T4, T5, or T7 var deviceType = self . savedAttributes . deviceTypeName ; // Save the created data collector object dataCollector = new dashboard_data_collector . create ( deviceType ) ; // Listen to only the next 'data' event emitted by the dataCollector. dataCollector . once ( 'data' , function ( data ) { debugDStart ( 'dev_cur-dash_ops: First bit of data!' ) ; // Listen to future data. dataCollector . on ( 'data' , dataCollectorHandler ) ; // Save the data to the data cache. self . dataCache = data ; bundle . data = data ; // Declare the innerStart function to be finished. defered . resolve ( bundle ) ; } ) ; // Start the data collector. dataCollector . start ( self ) ; return defered . promise ; }
This function starts the data collector and registers event listeners.
This function starts the data collector and registers event listeners .