Linux-DVB-DVBT-Apps-QuartzPVR

 view release on metacpan or  search on metacpan

js/tvguide/Pages/Scan.js  view on Meta::CPAN

	this.CHANNELS = [] ;
	
	this.timer = null ;
	this.tickCount = 0 ;
	
	
	// dom
	this.gridbox$ = null ;
	
	// add a ref to the global settings
	this.settings = Scan.settings ;
}

Scan.INT_FIELDS = ['PID', 'PERCENT', 'COMPLETE', 'RUNNING', 'FREQ'] ;

//Map for CHANNELS data
//
// 0 = LCN
// 1 = Name
// 2 = TSID
// 3 = Network
Scan.MAP_CHANS = {
	'LCN'		: 0,	
	'Name'		: 1,	
	'TSID'		: 2,	
	'Network'	: 3,
	'Type'		: 4	
} ;

//Map for FREQS data
//
// 0 = Freq
// 1 = Tuned
// 2 = Current freq
Scan.MAP_FREQS = {
	'Freq'		: 0,	
	'Seen'		: 1,	
	'Tuned'		: 2,	
	'Current'	: 3
} ;


/*------------------------------------------------------------------------------------------------------*/
// Set the display windows
// start date & hour, display period in hours
//
//
//	DISPLAY_DATE: "2009-08-07", 
//	DISPLAY_HOUR: 12, 
//	DISPLAY_PERIOD: 3
//
//
Scan.setup = function(settings)
{
	// Copy settings
	for (var setting in settings)
	{
		Scan.settings[setting] = settings[setting] ;
	}
	
	// make our popup bigger
	Scan.settings.POPUP_WIDTH_PX = 600 ;
}



/*------------------------------------------------------------------------------------------------------*/
// Add/Create channels
//
Scan.prototype.update = function(data)
{
	Profile.start('Scan.update') ;

	$.extend(
		this,
		{
			COMPLETE 	: 0,
			PERCENT		: 0,
			RUNNING		: 0,
			CHANNELS	: [],
			FREQS		: []
		},
		data || {}
	) ;
	
	// Ensure integer fields are integers
	for (var i in Scan.INT_FIELDS)
	{
		var field = Scan.INT_FIELDS[i] ;
		if (this.hasOwnProperty(field))
		{
			this[field] = parseInt(this[field], 10) ;
		}
	}

	Profile.stop('Scan.update') ;
}



/*------------------------------------------------------------------------------------------------------*/
//Display heading
Scan.prototype.display_head = function()
{
	TitleBar.display_head("Scan Frequencies", "", null, 'Scan') ;
}


/*------------------------------------------------------------------------------------------------------*/
//Display contents
Scan.prototype.display = function()
{
	// clear any pending timeouts
	this.update_timer() ;
	
	// set body width
	$("#quartz-net-com")
		.css({
			fontSize:	Scan.settings.FONT_SIZE,
			fontFamily:	"arial,helvetica,clean,sans-serif"
		}) ;



( run in 0.830 second using v1.01-cache-2.11-cpan-364913b4093 )