gui/scan_setup.cpp: add pilot param to manual scan menu

Origin commit data
------------------
Branch: ni/coolstream
Commit: 34691a1724
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-12-08 (Mon, 08 Dec 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2014-12-08 17:22:41 +03:00
parent 81086d87b2
commit 33348df25f
10 changed files with 58 additions and 2 deletions

View File

@@ -493,6 +493,9 @@ extra.tp_mod_4_nr QAM/4-NR
extra.tp_mod_64 QAM/64
extra.tp_mod_8 8PSK
extra.tp_mod_auto QAM/AUTO
extra.tp_pilot Pilot
extra.tp_pilot_auto Auto (HW)
extra.tp_pilot_auto_sw Auto (SW)
extra.tp_pol Polarization
extra.tp_pol_h H
extra.tp_pol_l L
@@ -1258,6 +1261,7 @@ menu.hint_scan_motorpos Select stored position number for this satellite,\nignor
menu.hint_scan_nid Enter decimal network ID
menu.hint_scan_nit Add transpoders from network information
menu.hint_scan_pids Scan and save audio/video/PMT PIDs
menu.hint_scan_pilot Select pilot parameter
menu.hint_scan_pol Select transponder polarization
menu.hint_scan_rate Enter transponder symbol rate
menu.hint_scan_reset_numbers Reset exising channel numbers\nand re-number channels after scan

View File

@@ -223,6 +223,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
TP.feparams.polarization = scansettings.sat_TP_pol;
TP.feparams.delsys = (delivery_system_t)scansettings.sat_TP_delsys;
TP.feparams.modulation = (fe_modulation_t) scansettings.sat_TP_mod;
TP.feparams.pilot = (zapit_pilot_t) scansettings.sat_TP_pilot;
} else if (CFrontend::isTerr(delsys)) {
/* DVB-T. TODO: proper menu and parameter setup, not all "AUTO" */
TP.feparams.frequency = atoi(scansettings.terrestrial_TP_freq.c_str());

View File

@@ -266,6 +266,15 @@ const CMenuOptionChooser::keyval SATSETUP_SCANTP_POL[SATSETUP_SCANTP_POL_COUNT]
{ 3, LOCALE_EXTRA_TP_POL_R }
};
#define SATSETUP_SCANTP_PILOT_COUNT 4
const CMenuOptionChooser::keyval SATSETUP_SCANTP_PILOT[SATSETUP_SCANTP_PILOT_COUNT] =
{
{ ZPILOT_ON, LOCALE_OPTIONS_ON },
{ ZPILOT_OFF, LOCALE_OPTIONS_OFF },
{ ZPILOT_AUTO, LOCALE_EXTRA_TP_PILOT_AUTO },
{ ZPILOT_AUTO_SW, LOCALE_EXTRA_TP_PILOT_AUTO_SW }
};
#define OPTIONS_SOUTH0_NORTH1_OPTION_COUNT 2
const CMenuOptionChooser::keyval OPTIONS_SOUTH0_NORTH1_OPTIONS[OPTIONS_SOUTH0_NORTH1_OPTION_COUNT] =
{
@@ -1635,6 +1644,7 @@ int CScanSetup::addScanOptionsItems(CMenuWidget *options_menu, const int &shortc
CMenuOptionChooser *tm = NULL;
CMenuForwarder *Freq = NULL;
CMenuForwarder *Rate = NULL;
CMenuOptionChooser *pilot = NULL;
if (r_system == ALL_SAT) {
delsys = new CMenuOptionChooser(LOCALE_EXTRA_TP_DELSYS, (int *)&scansettings.sat_TP_delsys, SATSETUP_SCANTP_DELSYS, SATSETUP_SCANTP_DELSYS_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++), "", true);
delsys->setHint("", LOCALE_MENU_HINT_SCAN_DELSYS);
@@ -1650,6 +1660,8 @@ int CScanSetup::addScanOptionsItems(CMenuWidget *options_menu, const int &shortc
fec->setHint("", LOCALE_MENU_HINT_SCAN_FEC);
pol = new CMenuOptionChooser(LOCALE_EXTRA_TP_POL, (int *)&scansettings.sat_TP_pol, SATSETUP_SCANTP_POL, SATSETUP_SCANTP_POL_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++));
pol->setHint("", LOCALE_MENU_HINT_SCAN_POL);
pilot = new CMenuOptionChooser(LOCALE_EXTRA_TP_PILOT, (int *)&scansettings.sat_TP_pilot, SATSETUP_SCANTP_PILOT, SATSETUP_SCANTP_PILOT_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++));
pilot->setHint("", LOCALE_MENU_HINT_SCAN_PILOT);
} else if (r_system == ALL_CABLE) {
delsys = new CMenuOptionChooser(LOCALE_EXTRA_TP_DELSYS, (int *)&scansettings.cable_TP_delsys, CABLESETUP_SCANTP_DELSYS, CABLESETUP_SCANTP_DELSYS_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++), "", true);
delsys->setHint("", LOCALE_MENU_HINT_SCAN_DELSYS);
@@ -1708,6 +1720,8 @@ int CScanSetup::addScanOptionsItems(CMenuWidget *options_menu, const int &shortc
options_menu->addItem(tm);
if (pol)
options_menu->addItem(pol);
if (pilot)
options_menu->addItem(pilot);
return shortCut;
}
@@ -1998,6 +2012,7 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey)
scansettings.sat_TP_pol = tmpI->second.feparams.polarization;
scansettings.sat_TP_delsys = tmpI->second.feparams.delsys;
scansettings.sat_TP_mod = tmpI->second.feparams.modulation;
scansettings.sat_TP_pilot = tmpI->second.feparams.pilot;
}
else if (CFrontend::isCable(tmpI->second.feparams.delsys)) {
scansettings.cable_TP_freq = to_string(tmpI->second.feparams.frequency);

View File

@@ -520,6 +520,9 @@ typedef enum
LOCALE_EXTRA_TP_MOD_64,
LOCALE_EXTRA_TP_MOD_8,
LOCALE_EXTRA_TP_MOD_AUTO,
LOCALE_EXTRA_TP_PILOT,
LOCALE_EXTRA_TP_PILOT_AUTO,
LOCALE_EXTRA_TP_PILOT_AUTO_SW,
LOCALE_EXTRA_TP_POL,
LOCALE_EXTRA_TP_POL_H,
LOCALE_EXTRA_TP_POL_L,
@@ -1285,6 +1288,7 @@ typedef enum
LOCALE_MENU_HINT_SCAN_NID,
LOCALE_MENU_HINT_SCAN_NIT,
LOCALE_MENU_HINT_SCAN_PIDS,
LOCALE_MENU_HINT_SCAN_PILOT,
LOCALE_MENU_HINT_SCAN_POL,
LOCALE_MENU_HINT_SCAN_RATE,
LOCALE_MENU_HINT_SCAN_RESET_NUMBERS,

View File

@@ -520,6 +520,9 @@ const char * locale_real_names[] =
"extra.tp_mod_64",
"extra.tp_mod_8",
"extra.tp_mod_auto",
"extra.tp_pilot",
"extra.tp_pilot_auto",
"extra.tp_pilot_auto_sw",
"extra.tp_pol",
"extra.tp_pol_h",
"extra.tp_pol_l",
@@ -1285,6 +1288,7 @@ const char * locale_real_names[] =
"menu.hint_scan_nid",
"menu.hint_scan_nit",
"menu.hint_scan_pids",
"menu.hint_scan_pilot",
"menu.hint_scan_pol",
"menu.hint_scan_rate",
"menu.hint_scan_reset_numbers",

View File

@@ -145,6 +145,7 @@ bool CScanSettings::loadSettings(const char * const fileName)
sat_TP_rate = configfile.getString("sat_TP_rate", "27500000");
sat_TP_mod = configfile.getInt32("sat_TP_mod", QPSK);
sat_TP_delsys = configfile.getInt32("sat_TP_delsys", DVB_S);
sat_TP_pilot = configfile.getInt32("sat_TP_pilot", ZPILOT_AUTO_SW);
cableName = configfile.getString("cableName", cableName);
cable_TP_mod = configfile.getInt32("cable_TP_mod", QAM_64);
@@ -202,6 +203,7 @@ bool CScanSettings::saveSettings(const char * const fileName)
configfile.setString("sat_TP_rate", sat_TP_rate);
configfile.setInt32("sat_TP_delsys", sat_TP_delsys);
configfile.setInt32("sat_TP_mod", sat_TP_mod);
configfile.setInt32("sat_TP_pilot", sat_TP_pilot);
configfile.setString("cableName", cableName);
configfile.setInt32("cable_TP_fec", cable_TP_fec);

View File

@@ -846,6 +846,7 @@ class CScanSettings
std::string sat_TP_rate;
int sat_TP_delsys;
int sat_TP_mod;
int sat_TP_pilot;
std::string cableName;
int cable_TP_mod;

View File

@@ -79,6 +79,13 @@ typedef enum {
ALL_TERR = ZAPIT_DM_TERR,
} delivery_system_t;
typedef enum {
ZPILOT_ON,
ZPILOT_OFF,
ZPILOT_AUTO,
ZPILOT_AUTO_SW
} zapit_pilot_t;
typedef struct {
delivery_system_t delsys;
uint32_t frequency;
@@ -94,7 +101,7 @@ typedef struct {
fe_code_rate_t code_rate_HP;
fe_code_rate_t code_rate_LP;
fe_pilot_t pilot;
zapit_pilot_t pilot;
fe_rolloff_t rolloff;
enum fe_interleaving interleaving;

View File

@@ -1099,6 +1099,20 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
fec = FEC_AUTO;
break;
}
switch(feparams->pilot) {
case ZPILOT_ON:
pilot = PILOT_ON;
break;
case ZPILOT_OFF:
pilot = PILOT_OFF;
break;
case ZPILOT_AUTO:
pilot = PILOT_AUTO;
break;
case ZPILOT_AUTO_SW:
default:
break;
}
int nrOfProps = 0;
@@ -1112,7 +1126,7 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
cmdseq.props[MODULATION].u.data = feparams->modulation;
cmdseq.props[ROLLOFF].u.data = feparams->rolloff;
cmdseq.props[PILOTS].u.data = pilot;
printf("[fe%d] tuner pilot %d (feparams %d)\n", fenumber, pilot, feparams->pilot);
} else {
memcpy(cmdseq.props, dvbs_cmdargs, sizeof(dvbs_cmdargs));
nrOfProps = FE_DVBS_PROPS;

View File

@@ -385,6 +385,8 @@ void CServiceManager::ParseTransponders(xmlNodePtr node, t_satellite_position sa
feparams.frequency = feparams.frequency*1000;
else
feparams.frequency = (int) 1000 * (int) round ((double) feparams.frequency / (double) 1000);
/* TODO: add xml tag ? */
feparams.pilot = ZPILOT_AUTO_SW;
}
else if (CFrontend::isTerr(delsys)) {
//<TS id="0001" on="7ffd" frq="650000" inv="2" bw="3" hp="9" lp="9" con="6" tm="2" gi="0" hi="4" sys="6">
@@ -609,6 +611,8 @@ void CServiceManager::ParseSatTransponders(delivery_system_t delsys, xmlNodePtr
const char *system = xmlGetAttribute(tps, "system");
const char *rolloff = xmlGetAttribute(tps, "rolloff");
/* TODO: add xml tag ? */
feparams.pilot = ZPILOT_AUTO_SW;
if (system) {
uint32_t s = xmlGetNumericAttribute(tps, "system", 0);
switch (s) {