mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
gui/scan.cpp: add delivery type member, use it to find scanned type
Origin commit data
------------------
Branch: ni/coolstream
Commit: 4372df5a25
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2013-01-16 (Wed, 16 Jan 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -74,7 +74,7 @@ extern cVideo * videoDecoder;
|
|||||||
#define BAR_WIDTH 150
|
#define BAR_WIDTH 150
|
||||||
#define BAR_HEIGHT 16//(13 + BAR_BORDER*2)
|
#define BAR_HEIGHT 16//(13 + BAR_BORDER*2)
|
||||||
|
|
||||||
CScanTs::CScanTs()
|
CScanTs::CScanTs(int dtype)
|
||||||
{
|
{
|
||||||
frameBuffer = CFrameBuffer::getInstance();
|
frameBuffer = CFrameBuffer::getInstance();
|
||||||
radar = 0;
|
radar = 0;
|
||||||
@@ -83,13 +83,17 @@ CScanTs::CScanTs()
|
|||||||
|
|
||||||
sigscale = new CProgressBar(true, BAR_WIDTH, BAR_HEIGHT);
|
sigscale = new CProgressBar(true, BAR_WIDTH, BAR_HEIGHT);
|
||||||
snrscale = new CProgressBar(true, BAR_WIDTH, BAR_HEIGHT);
|
snrscale = new CProgressBar(true, BAR_WIDTH, BAR_HEIGHT);
|
||||||
|
deltype = dtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CScanTs::prev_next_TP( bool up)
|
void CScanTs::prev_next_TP( bool up)
|
||||||
{
|
{
|
||||||
t_satellite_position position = 0;
|
t_satellite_position position = 0;
|
||||||
|
|
||||||
position = CServiceManager::getInstance()->GetSatellitePosition(scansettings.satNameNoDiseqc);
|
if (deltype == FE_QPSK)
|
||||||
|
position = CServiceManager::getInstance()->GetSatellitePosition(scansettings.satName);
|
||||||
|
else
|
||||||
|
position = CServiceManager::getInstance()->GetSatellitePosition(scansettings.cableName);
|
||||||
|
|
||||||
transponder_list_t &select_transponders = CServiceManager::getInstance()->GetSatelliteTransponders(position);
|
transponder_list_t &select_transponders = CServiceManager::getInstance()->GetSatelliteTransponders(position);
|
||||||
transponder_list_t::iterator tI;
|
transponder_list_t::iterator tI;
|
||||||
@@ -114,7 +118,7 @@ void CScanTs::prev_next_TP( bool up)
|
|||||||
|
|
||||||
if(next_tp) {
|
if(next_tp) {
|
||||||
TP.feparams.dvb_feparams.frequency = tI->second.feparams.dvb_feparams.frequency;
|
TP.feparams.dvb_feparams.frequency = tI->second.feparams.dvb_feparams.frequency;
|
||||||
if(g_info.delivery_system == DVB_S) {
|
if (deltype == FE_QPSK) {
|
||||||
TP.feparams.dvb_feparams.u.qpsk.symbol_rate = tI->second.feparams.dvb_feparams.u.qpsk.symbol_rate;
|
TP.feparams.dvb_feparams.u.qpsk.symbol_rate = tI->second.feparams.dvb_feparams.u.qpsk.symbol_rate;
|
||||||
TP.feparams.dvb_feparams.u.qpsk.fec_inner = tI->second.feparams.dvb_feparams.u.qpsk.fec_inner;
|
TP.feparams.dvb_feparams.u.qpsk.fec_inner = tI->second.feparams.dvb_feparams.u.qpsk.fec_inner;
|
||||||
TP.polarization = tI->second.polarization;
|
TP.polarization = tI->second.polarization;
|
||||||
@@ -133,15 +137,15 @@ void CScanTs::testFunc()
|
|||||||
char buffer[128];
|
char buffer[128];
|
||||||
char * f, *s, *m;
|
char * f, *s, *m;
|
||||||
|
|
||||||
CFrontend * frontend = CServiceScan::getInstance()->GetFrontend();
|
if(deltype == FE_QPSK) {
|
||||||
if(frontend->getInfo()->type == FE_QPSK) {
|
CFrontend::getDelSys(deltype, TP.feparams.dvb_feparams.u.qpsk.fec_inner, dvbs_get_modulation((fe_code_rate_t)TP.feparams.dvb_feparams.u.qpsk.fec_inner), f, s, m);
|
||||||
frontend->getDelSys(TP.feparams.dvb_feparams.u.qpsk.fec_inner, dvbs_get_modulation((fe_code_rate_t)TP.feparams.dvb_feparams.u.qpsk.fec_inner), f, s, m);
|
|
||||||
snprintf(buffer,sizeof(buffer), "%u %c %d %s %s %s", TP.feparams.dvb_feparams.frequency/1000, transponder::pol(TP.polarization), TP.feparams.dvb_feparams.u.qpsk.symbol_rate/1000, f, s, m);
|
snprintf(buffer,sizeof(buffer), "%u %c %d %s %s %s", TP.feparams.dvb_feparams.frequency/1000, transponder::pol(TP.polarization), TP.feparams.dvb_feparams.u.qpsk.symbol_rate/1000, f, s, m);
|
||||||
} else if(frontend->getInfo()->type == FE_QAM) {
|
} else {
|
||||||
frontend->getDelSys(scansettings.TP_fec, scansettings.TP_mod, f, s, m);
|
CFrontend::getDelSys(deltype, TP.feparams.dvb_feparams.u.qam.fec_inner, TP.feparams.dvb_feparams.u.qam.modulation, f, s, m);
|
||||||
snprintf(buffer,sizeof(buffer), "%u %d %s %s %s", atoi(scansettings.TP_freq)/1000, atoi(scansettings.TP_rate)/1000, f, s, m);
|
snprintf(buffer,sizeof(buffer), "%u %d %s %s %s", TP.feparams.dvb_feparams.frequency/1000, TP.feparams.dvb_feparams.u.qam.symbol_rate/1000, f, s, m);
|
||||||
}
|
}
|
||||||
paintLine(xpos2, ypos_cur_satellite, w - 95, scansettings.satNameNoDiseqc);
|
printf("CScanTs::testFunc: %s\n", buffer);
|
||||||
|
paintLine(xpos2, ypos_cur_satellite, w - 95, pname);
|
||||||
paintLine(xpos2, ypos_frequency, w, buffer);
|
paintLine(xpos2, ypos_frequency, w, buffer);
|
||||||
success = g_Zapit->tune_TP(TP);
|
success = g_Zapit->tune_TP(TP);
|
||||||
}
|
}
|
||||||
@@ -172,6 +176,8 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
|||||||
bool manual = (actionKey == "manual") || test;
|
bool manual = (actionKey == "manual") || test;
|
||||||
bool fast = (actionKey == "fast");
|
bool fast = (actionKey == "fast");
|
||||||
|
|
||||||
|
pname = (deltype == FE_QPSK) ? scansettings.satName : scansettings.cableName;
|
||||||
|
|
||||||
int scan_pids = CZapit::getInstance()->scanPids();
|
int scan_pids = CZapit::getInstance()->scanPids();
|
||||||
|
|
||||||
hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
|
hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
|
||||||
@@ -208,22 +214,23 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
|||||||
if(scansettings.scan_nit_manual)
|
if(scansettings.scan_nit_manual)
|
||||||
scan_flags |= CServiceScan::SCAN_NIT;
|
scan_flags |= CServiceScan::SCAN_NIT;
|
||||||
TP.scan_mode = scan_flags;
|
TP.scan_mode = scan_flags;
|
||||||
TP.feparams.dvb_feparams.frequency = atoi(scansettings.TP_freq);
|
if (deltype == FE_QPSK) {
|
||||||
if(g_info.delivery_system == DVB_S) {
|
TP.feparams.dvb_feparams.frequency = atoi(scansettings.sat_TP_freq);
|
||||||
TP.feparams.dvb_feparams.u.qpsk.symbol_rate = atoi(scansettings.TP_rate);
|
TP.feparams.dvb_feparams.u.qpsk.symbol_rate = atoi(scansettings.sat_TP_rate);
|
||||||
TP.feparams.dvb_feparams.u.qpsk.fec_inner = (fe_code_rate_t) scansettings.TP_fec;
|
TP.feparams.dvb_feparams.u.qpsk.fec_inner = (fe_code_rate_t) scansettings.sat_TP_fec;
|
||||||
TP.polarization = scansettings.TP_pol;
|
TP.polarization = scansettings.sat_TP_pol;
|
||||||
} else {
|
} else {
|
||||||
TP.feparams.dvb_feparams.u.qam.symbol_rate = atoi(scansettings.TP_rate);
|
TP.feparams.dvb_feparams.frequency = atoi(scansettings.cable_TP_freq);
|
||||||
TP.feparams.dvb_feparams.u.qam.fec_inner = (fe_code_rate_t)scansettings.TP_fec;
|
TP.feparams.dvb_feparams.u.qam.symbol_rate = atoi(scansettings.cable_TP_rate);
|
||||||
TP.feparams.dvb_feparams.u.qam.modulation = (fe_modulation_t) scansettings.TP_mod;
|
TP.feparams.dvb_feparams.u.qam.fec_inner = (fe_code_rate_t)scansettings.cable_TP_fec;
|
||||||
|
TP.feparams.dvb_feparams.u.qam.modulation = (fe_modulation_t) scansettings.cable_TP_mod;
|
||||||
}
|
}
|
||||||
//printf("[neutrino] freq %d rate %d fec %d pol %d\n", TP.feparams.dvb_feparams.frequency, TP.feparams.dvb_feparams.u.qpsk.symbol_rate, TP.feparams.dvb_feparams.u.qpsk.fec_inner, TP.polarization);
|
//printf("[neutrino] freq %d rate %d fec %d pol %d\n", TP.feparams.dvb_feparams.frequency, TP.feparams.dvb_feparams.u.qpsk.symbol_rate, TP.feparams.dvb_feparams.u.qpsk.fec_inner, TP.polarization);
|
||||||
} else {
|
} else {
|
||||||
if(scansettings.scan_nit)
|
if(scansettings.scan_nit)
|
||||||
scan_flags |= CServiceScan::SCAN_NIT;
|
scan_flags |= CServiceScan::SCAN_NIT;
|
||||||
}
|
}
|
||||||
if(g_info.delivery_system == DVB_C)
|
if(deltype == FE_QAM)
|
||||||
CServiceScan::getInstance()->SetCableNID(scansettings.cable_nid);
|
CServiceScan::getInstance()->SetCableNID(scansettings.cable_nid);
|
||||||
|
|
||||||
CZapitClient::commandSetScanSatelliteList sat;
|
CZapitClient::commandSetScanSatelliteList sat;
|
||||||
@@ -232,8 +239,8 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
|||||||
if(fast) {
|
if(fast) {
|
||||||
}
|
}
|
||||||
else if(manual || !scan_all) {
|
else if(manual || !scan_all) {
|
||||||
sat.position = CServiceManager::getInstance()->GetSatellitePosition(scansettings.satNameNoDiseqc);
|
sat.position = CServiceManager::getInstance()->GetSatellitePosition(pname);
|
||||||
strncpy(sat.satName, scansettings.satNameNoDiseqc, 49);
|
strncpy(sat.satName, pname, 49);
|
||||||
satList.push_back(sat);
|
satList.push_back(sat);
|
||||||
} else {
|
} else {
|
||||||
satellite_map_t & satmap = CServiceManager::getInstance()->SatelliteList();
|
satellite_map_t & satmap = CServiceManager::getInstance()->SatelliteList();
|
||||||
@@ -493,12 +500,12 @@ void CScanTs::paint(bool fortest)
|
|||||||
|
|
||||||
ypos_cur_satellite = ypos;
|
ypos_cur_satellite = ypos;
|
||||||
|
|
||||||
if (g_info.delivery_system == DVB_S)
|
if(deltype == FE_QPSK)
|
||||||
{ //sat
|
{ //sat
|
||||||
paintLineLocale(xpos1, &ypos, width - xpos1, LOCALE_SCANTS_ACTSATELLITE);
|
paintLineLocale(xpos1, &ypos, width - xpos1, LOCALE_SCANTS_ACTSATELLITE);
|
||||||
xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTSATELLITE), true); // UTF-8
|
xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTSATELLITE), true); // UTF-8
|
||||||
}
|
}
|
||||||
if (g_info.delivery_system == DVB_C)
|
if(deltype == FE_QAM)
|
||||||
{ //cable
|
{ //cable
|
||||||
paintLineLocale(xpos1, &ypos, width - xpos1, LOCALE_SCANTS_ACTCABLE);
|
paintLineLocale(xpos1, &ypos, width - xpos1, LOCALE_SCANTS_ACTCABLE);
|
||||||
xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTCABLE), true); // UTF-8
|
xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTCABLE), true); // UTF-8
|
||||||
|
@@ -80,9 +80,11 @@ class CScanTs : public CMenuTarget
|
|||||||
void testFunc();
|
void testFunc();
|
||||||
void prev_next_TP(bool);
|
void prev_next_TP(bool);
|
||||||
TP_params TP;
|
TP_params TP;
|
||||||
|
int deltype;
|
||||||
|
char * pname;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CScanTs();
|
CScanTs(int dtype = FE_QPSK);
|
||||||
void hide();
|
void hide();
|
||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user