diff --git a/data/locale/english.locale b/data/locale/english.locale index f74088eb8..036f06f24 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -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 diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 288d2ba09..6e451f94e 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -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()); diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 5133310e0..7e266de83 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -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); diff --git a/src/system/locals.h b/src/system/locals.h index 92d169d82..dddafab8b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -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, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 799b72fb7..aaed15ea7 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -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", diff --git a/src/system/settings.cpp b/src/system/settings.cpp index 80ea42ef4..4ee846df1 100644 --- a/src/system/settings.cpp +++ b/src/system/settings.cpp @@ -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); diff --git a/src/system/settings.h b/src/system/settings.h index 7d6fe8194..957ec06b6 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -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; diff --git a/src/zapit/include/zapit/frontend_types.h b/src/zapit/include/zapit/frontend_types.h index 4d9bf9ee7..7e3591c70 100644 --- a/src/zapit/include/zapit/frontend_types.h +++ b/src/zapit/include/zapit/frontend_types.h @@ -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; diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index abb83d7e8..2bc885346 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -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; diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 3f27f0611..10ca08dff 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -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)) { // @@ -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) {