diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 1bbc13073..e6cc70ac0 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1569,6 +1569,8 @@ satsetup.satellite Satellit satsetup.select_sat Auswahl Satellit satsetup.smatvremote SMATV Remote Tuning satsetup.uncomm_input Uncommitted +satsetup.uni_settings Unicable Einstellungen +satsetup.unicable Unicable satsetup.usals_repeat USALS wiederholen satsetup.use_bat Benutze BAT satsetup.use_fta_flag nur FTA Kanäle diff --git a/data/locale/english.locale b/data/locale/english.locale index 6f86bf110..305cf064d 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1569,6 +1569,8 @@ satsetup.satellite Satellite satsetup.select_sat Select satellites satsetup.smatvremote SMATV Remote Tuning satsetup.uncomm_input Uncommited input +satsetup.uni_settings Unicable Settings +satsetup.unicable Unicable satsetup.usals_repeat USALS command repeat satsetup.use_bat Use BAT satsetup.use_fta_flag just free Channels diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 412c63c12..98b884b44 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -97,7 +97,8 @@ const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_ { DISEQC_1_1, LOCALE_SATSETUP_DISEQC11 }, /*{ DISEQC_1_2, LOCALE_SATSETUP_DISEQC12 },*/ { DISEQC_ADVANCED, LOCALE_SATSETUP_DISEQC_ADVANCED }, - { SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE } + { DISEQC_UNICABLE, LOCALE_SATSETUP_UNICABLE } +// { SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE } }; #define SATSETUP_SCANTP_FEC_COUNT 21 @@ -281,6 +282,10 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey) { return showScanMenuLnbSetup(); } + else if(actionKey=="unisetup") + { + return showUnicableSetup(); + } else if(actionKey=="satfind") { return showScanMenuSatFind(); @@ -568,7 +573,7 @@ int CScanSetup::showFrontendSetup(int number) mc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCTYPE); setupMenu->addItem(mc); - ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&fe_config.diseqcRepeats, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), 0, 2, NULL); + ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&fe_config.diseqcRepeats, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED) && (dmode != DISEQC_UNICABLE), 0, 2, NULL); ojDiseqcRepeats->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCREPEAT); setupMenu->addItem(ojDiseqcRepeats); @@ -592,6 +597,9 @@ int CScanSetup::showFrontendSetup(int number) fsatSetup->setHint("", LOCALE_MENU_HINT_SCAN_SATSETUP); setupMenu->addItem(fsatSetup); + uniSetup = new CMenuForwarder(LOCALE_SATSETUP_UNI_SETTINGS, (dmode == DISEQC_UNICABLE), NULL, this, "unisetup", CRCInput::convertDigitToKey(shortcut++)); + setupMenu->addItem(uniSetup); + setupMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SATSETUP_EXTENDED_MOTOR)); CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, true, 0, 64, NULL); nc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_SPEED); @@ -619,6 +627,35 @@ int CScanSetup::showFrontendSetup(int number) return res; } +int CScanSetup::showUnicableSetup() +{ + printf("[neutrino] CScanSetup call %s fe %d\n", __func__, fenumber); + + int res = menu_return::RETURN_REPAINT; + CFrontend *fe = CFEManager::getInstance()->getFE(fenumber); + frontend_config_t &fe_config = fe->getConfig(); + int unicable_scr = fe_config.uni_scr; + int unicable_qrg = fe_config.uni_qrg; + + CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &unicable_scr, true, 0, 7); + CIntInput *uniqrg = new CIntInput(LOCALE_UNICABLE_QRG, unicable_qrg, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); + + CMenuWidget *uni_setup = new CMenuWidget(LOCALE_SATSETUP_UNI_SETTINGS, NEUTRINO_ICON_SETTINGS, width); + uni_setup->addIntroItems(); + + uni_setup->addItem(uniscr); + CMenuForwarder *mf = new CMenuForwarder(LOCALE_UNICABLE_QRG, true, uniqrg->getValue(), uniqrg); + uni_setup->addItem(mf); + res = uni_setup->exec(NULL, ""); + delete uni_setup; + if (res) { + fe_config.uni_scr = unicable_scr; + fe_config.uni_qrg = unicable_qrg; + printf("%s: scr: %d qrg: %d\n", __func__, unicable_scr, unicable_qrg); + } + return res; +} + int CScanSetup::showScanMenuLnbSetup() { printf("[neutrino] CScanSetup call %s fe %d\n", __FUNCTION__, fenumber); @@ -795,21 +832,33 @@ int CScanSetup::showScanMenuSatFind() //init tempsat menu void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satconfig) { + bool unicable = (dmode == DISEQC_UNICABLE); temp_sat->addIntroItems(); - CMenuOptionNumberChooser *diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); - diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC); - CMenuOptionNumberChooser *comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); - comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED); - CMenuOptionNumberChooser *uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); - uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED); - CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &satconfig.unicable_scr, true, -1, 7, NULL, 0, -1, LOCALE_OPTIONS_OFF); - CIntInput *uniqrg = new CIntInput(LOCALE_UNICABLE_QRG, (int&) satconfig.unicable_qrg, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); - CMenuOptionNumberChooser *unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.unicable_lnb, true, 0, 1); - CMenuOptionNumberChooser *motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF); - motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS); - CMenuOptionChooser *usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/); - usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS); + CMenuOptionNumberChooser *diseqc; + CMenuOptionNumberChooser *comm; + CMenuOptionNumberChooser *uncomm; + CMenuOptionNumberChooser *unilnb; + CMenuOptionNumberChooser *motor; + CMenuOptionChooser *usals; + CMenuForwarder *mf; + + if (!unicable) { + diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC); + comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED); + uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED); + motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF); + motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS); + usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/); + usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS); + } else { + if (satconfig.diseqc < 0) + satconfig.diseqc = 0; + unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.diseqc, true, 0, 1); + } if(!satconfig.use_usals) all_usals = 0; @@ -818,15 +867,15 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon CIntInput* lofH = new CIntInput(LOCALE_SATSETUP_LOFH, (int&) satconfig.lnbOffsetHigh, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput* lofS = new CIntInput(LOCALE_SATSETUP_LOFS, (int&) satconfig.lnbSwitch, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); - temp_sat->addItem(diseqc); - temp_sat->addItem(comm); - temp_sat->addItem(uncomm); - temp_sat->addItem(uniscr); - CMenuForwarder * mf = new CMenuForwarder(LOCALE_UNICABLE_QRG, true, uniqrg->getValue(), uniqrg); - temp_sat->addItem(mf); - temp_sat->addItem(unilnb); - temp_sat->addItem(motor); - temp_sat->addItem(usals); + if (!unicable) { + temp_sat->addItem(diseqc); + temp_sat->addItem(comm); + temp_sat->addItem(uncomm); + temp_sat->addItem(motor); + temp_sat->addItem(usals); + } else { + temp_sat->addItem(unilnb); + } mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL); mf->setHint("", LOCALE_MENU_HINT_SCAN_LOFL); @@ -1140,7 +1189,8 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data* printf("[neutrino] CScanSetup::%s: diseqc %d \n", __FUNCTION__, dmode); //FIXME 2 frontends ?? fautoScanAll->setActive(dmode != NO_DISEQC); - if(dmode == NO_DISEQC) { + uniSetup->setActive(dmode == DISEQC_UNICABLE); + if (dmode == NO_DISEQC || dmode == DISEQC_UNICABLE) { ojDiseqcRepeats->setActive(false); } else if(dmode < DISEQC_ADVANCED) { diff --git a/src/gui/scan_setup.h b/src/gui/scan_setup.h index 56e079ab6..029351ba2 100644 --- a/src/gui/scan_setup.h +++ b/src/gui/scan_setup.h @@ -57,6 +57,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver CMenuForwarder *fautoScanAll; CMenuForwarder *frontendSetup; CMenuForwarder *fsatSetup; + CMenuForwarder *uniSetup; CMenuOptionNumberChooser * ojDiseqcRepeats; CIntInput * nid; CMenuOptionChooser * lcnhd; @@ -84,6 +85,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver int showFrontendSetup(int number); int showScanMenuLnbSetup(); + int showUnicableSetup(); int showScanMenuSatFind(); void fillSatSelect(CMenuOptionStringChooser *select); void fillCableSelect(CMenuOptionStringChooser *select); diff --git a/src/system/locals.h b/src/system/locals.h index cd29bb4ee..0efdd2a6b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1596,6 +1596,8 @@ typedef enum LOCALE_SATSETUP_SELECT_SAT, LOCALE_SATSETUP_SMATVREMOTE, LOCALE_SATSETUP_UNCOMM_INPUT, + LOCALE_SATSETUP_UNI_SETTINGS, + LOCALE_SATSETUP_UNICABLE, LOCALE_SATSETUP_USALS_REPEAT, LOCALE_SATSETUP_USE_BAT, LOCALE_SATSETUP_USE_FTA_FLAG, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 8e56efc49..236957606 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1596,6 +1596,8 @@ const char * locale_real_names[] = "satsetup.select_sat", "satsetup.smatvremote", "satsetup.uncomm_input", + "satsetup.uni_settings", + "satsetup.unicable", "satsetup.usals_repeat", "satsetup.use_bat", "satsetup.use_fta_flag", diff --git a/src/zapit/include/zapit/client/zapittypes.h b/src/zapit/include/zapit/client/zapittypes.h index 50d7a0859..3c472f14e 100644 --- a/src/zapit/include/zapit/client/zapittypes.h +++ b/src/zapit/include/zapit/client/zapittypes.h @@ -39,7 +39,8 @@ typedef enum { DISEQC_1_0, DISEQC_1_1, DISEQC_1_2, - DISEQC_ADVANCED + DISEQC_ADVANCED, + DISEQC_UNICABLE #if 0 , DISEQC_2_0, DISEQC_2_1, diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h index 2af2a867c..5993251ab 100644 --- a/src/zapit/include/zapit/frontend_c.h +++ b/src/zapit/include/zapit/frontend_c.h @@ -156,7 +156,6 @@ class CFrontend uint8_t getDiseqcPosition(void) const { return currentTransponder.diseqc; } uint8_t getDiseqcRepeats(void) const { return config.diseqcRepeats; } diseqc_t getDiseqcType(void) const { return (diseqc_t) config.diseqcType; } - int getUniSCR(void) const { return config.uni_scr; } uint32_t getFrequency(void) const { return currentTransponder.feparams.dvb_feparams.frequency; } bool getHighBand() { return (int) getFrequency() >= lnbSwitch; } static fe_modulation_t getModulation(const uint8_t modulation); diff --git a/src/zapit/include/zapit/satconfig.h b/src/zapit/include/zapit/satconfig.h index 75fb482bf..28921dee5 100644 --- a/src/zapit/include/zapit/satconfig.h +++ b/src/zapit/include/zapit/satconfig.h @@ -36,9 +36,6 @@ typedef struct sat_config { std::string name; int have_channels; int input; - int unicable_scr; - int unicable_qrg; - int unicable_lnb; int configured; int cable_nid; } sat_config_t; diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index 15d07ad56..3214da47c 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -115,7 +115,7 @@ void CFEManager::setConfigValue(CFrontend * fe, const char * name, uint32_t val) configfile.setInt32(cfg_key, val); } -#define SATCONFIG_SIZE 15 +#define SATCONFIG_SIZE 12 void CFEManager::setSatelliteConfig(CFrontend * fe, sat_config_t &satconfig) { char cfg_key[81]; @@ -133,9 +133,6 @@ void CFEManager::setSatelliteConfig(CFrontend * fe, sat_config_t &satconfig) satConfig.push_back(satconfig.use_in_scan); satConfig.push_back(satconfig.use_usals); satConfig.push_back(satconfig.configured); - satConfig.push_back(satconfig.unicable_scr); - satConfig.push_back(satconfig.unicable_qrg); - satConfig.push_back(satconfig.unicable_lnb); sprintf(cfg_key, "fe%d_position_%d", fe->fenumber, satconfig.position); //INFO("set %s", cfg_key); @@ -162,10 +159,6 @@ bool CFEManager::getSatelliteConfig(CFrontend * fe, sat_config_t &satconfig) satconfig.use_in_scan = satConfig[i++]; satconfig.use_usals = satConfig[i++]; satconfig.configured = satConfig[i++]; - satconfig.unicable_scr = satConfig[i++]; - satconfig.unicable_qrg = satConfig[i++]; - satconfig.unicable_lnb = satConfig[i++]; - return true; } return false; @@ -191,6 +184,8 @@ bool CFEManager::loadSettings() fe_config.diseqcRepeats = getConfigValue(fe, "diseqcRepeats", 0); fe_config.motorRotationSpeed = getConfigValue(fe, "motorRotationSpeed", 18); fe_config.highVoltage = getConfigValue(fe, "highVoltage", 0); + fe_config.uni_scr = getConfigValue(fe, "uni_scr", 0); + fe_config.uni_qrg = getConfigValue(fe, "uni_qrg", 0); fe->setRotorSatellitePosition(getConfigValue(fe, "lastSatellitePosition", 0)); @@ -229,9 +224,6 @@ bool CFEManager::loadSettings() satconfig.use_usals = 0; satconfig.input = 0; satconfig.configured = 0; - satconfig.unicable_scr = -1; - satconfig.unicable_qrg = 0; - satconfig.unicable_lnb = 0; satmap.insert(satellite_pair_t(position, satconfig)); @@ -262,6 +254,8 @@ void CFEManager::saveSettings(bool write) setConfigValue(fe, "diseqcRepeats", fe_config.diseqcRepeats); setConfigValue(fe, "motorRotationSpeed", fe_config.motorRotationSpeed); setConfigValue(fe, "highVoltage", fe_config.highVoltage); + setConfigValue(fe, "uni_scr", fe_config.uni_scr); + setConfigValue(fe, "uni_qrg", fe_config.uni_qrg); setConfigValue(fe, "lastSatellitePosition", fe->getRotorSatellitePosition()); std::vector satList; diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 0f954f5b5..cb50cdd8f 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -192,7 +192,7 @@ CFrontend::CFrontend(int Number, int Adapter) config.diseqcType = NO_DISEQC; config.diseqcRepeats = 0; - config.uni_scr = -1; /* the unicable SCR address, -1 == no unicable */ + config.uni_scr = 0; /* the unicable SCR address 0-7 */ config.uni_qrg = 0; /* the unicable frequency in MHz */ config.uni_lnb = 0; /* for two-position switches */ config.highVoltage = false; @@ -788,11 +788,11 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p } - if (config.uni_scr >= 0) + if (config.diseqcType == DISEQC_UNICABLE) cmdseq.props[FREQUENCY].u.data = sendEN50494TuningCommand(feparams->dvb_feparams.frequency, currentToneMode == SEC_TONE_ON, currentVoltage == SEC_VOLTAGE_18, - config.uni_lnb); + !!config.uni_lnb); cmdseq.num += nrOfProps; @@ -860,7 +860,7 @@ void CFrontend::secSetTone(const fe_sec_tone_mode_t toneMode, const uint32_t ms) if (currentToneMode == toneMode) return; - if (config.uni_scr >= 0) { + if (config.diseqcType == DISEQC_UNICABLE) { /* this is too ugly for words. the "currentToneMode" is the only place where the global "highband" state is saved. So we need to fake it for unicable and still set the tone on... */ @@ -889,7 +889,7 @@ void CFrontend::secSetVoltage(const fe_sec_voltage_t voltage, const uint32_t ms) return; printf("[fe%d] voltage %s\n", fenumber, voltage == SEC_VOLTAGE_OFF ? "OFF" : voltage == SEC_VOLTAGE_13 ? "13" : "18"); - if (config.uni_scr >= 0) { + if (config.diseqcType == DISEQC_UNICABLE) { /* see my comment in secSetTone... */ currentVoltage = voltage; /* need to know polarization for unicable */ fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); /* voltage must not be 18V */ @@ -947,6 +947,9 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force) case DISEQC_ADVANCED: INFO("fe%d: DISEQC_ADVANCED", fenumber); break; + case DISEQC_UNICABLE: + INFO("fe%d: DISEQC_UNICABLE", fenumber); + break; #if 0 case DISEQC_2_0: INFO("DISEQC_2_0"); @@ -963,7 +966,11 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force) return; } - if ((force && (newDiseqcType != NO_DISEQC)) || ((config.diseqcType <= MINI_DISEQC) + if (newDiseqcType == DISEQC_UNICABLE) { + secSetTone(SEC_TONE_OFF, 0); + secSetVoltage(SEC_VOLTAGE_13, 0); + } + else if ((force && (newDiseqcType != NO_DISEQC)) || ((config.diseqcType <= MINI_DISEQC) && (newDiseqcType > MINI_DISEQC))) { secSetTone(SEC_TONE_OFF, 15); sendDiseqcPowerOn(); @@ -1065,12 +1072,13 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque { sat_iterator_t sit = satellites.find(satellitePosition); - /* unicable */ - config.uni_scr = sit->second.unicable_scr; - config.uni_qrg = sit->second.unicable_qrg; - config.uni_lnb = sit->second.unicable_lnb; + /* unicable uses diseqc parameter for input selection */ + config.uni_lnb = sit->second.diseqc; setLnbOffsets(sit->second.lnbOffsetLow, sit->second.lnbOffsetHigh, sit->second.lnbSwitch); + if (config.diseqcType == DISEQC_UNICABLE) + return; + if (config.diseqcType != DISEQC_ADVANCED) { setDiseqc(sit->second.diseqc, polarization, frequency); return; @@ -1100,11 +1108,12 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int unsigned int t = (frequency / 1000 + bpf + 2) / 4 - 350; if (t < 1024 && config.uni_scr >= 0 && config.uni_scr < 8) { - INFO("[unicable] VOLT18=%d TONE_ON=%d, freq=%d bpf=%d uni_scr=%d bank=%d ret=%d\n", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, config.uni_scr, bank, (t + 350) * 4000 - frequency); + uint32_t ret = (t + 350) * 4000 - frequency; + INFO("[unicable] 18V=%d TONE=%d, freq=%d qrg=%d scr=%d bank=%d ret=%d", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, config.uni_scr, bank, ret); if (!slave && info.type == FE_QPSK) { cmd.msg[3] = (t >> 8) | /* highest 3 bits of t */ (config.uni_scr << 5) | /* adress */ - (bank << 4) | /* not implemented yet */ + (bank << 4) | /* input 0/1 */ (horizontal << 3) | /* horizontal == 0x08 */ (high_band) << 2; /* high_band == 0x04 */ cmd.msg[4] = t & 0xFF; @@ -1113,7 +1122,7 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int sendDiseqcCommand(&cmd, 50); /* en50494 says: >2ms and < 60 ms */ fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); } - return (t + 350) * 4000 - frequency; + return ret; } WARN("ooops. t > 1024? (%d) or uni_scr out of range? (%d)", t, config.uni_scr); return 0; diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 2daae12ce..85a0c649d 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -539,7 +539,6 @@ int CServiceManager::LoadMotorPositions(void) char buffer[256] = ""; t_satellite_position satellitePosition; int spos = 0, mpos = 0, diseqc = 0, uncom = 0, com = 0, usals = 0, inuse, input = 0; - int uniscr = -1, uniqrg = 0, unilnb = 0; int offH = 10600, offL = 9750, sw = 11700; printf("[getservices] loading motor positions...\n"); @@ -549,12 +548,7 @@ int CServiceManager::LoadMotorPositions(void) if ((fd = fopen(SATCONFIG, "r"))) { fgets(buffer, 255, fd); while(!feof(fd)) { - if (sscanf(buffer, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d", - &spos, &mpos, &diseqc, &com, &uncom, &offL, &offH, - &sw, &inuse, &usals, &input, &uniscr, &uniqrg, &unilnb) < 14) { - uniqrg = unilnb = 0; - uniscr = -1; - } + sscanf(buffer, "%d %d %d %d %d %d %d %d %d %d %d", &spos, &mpos, &diseqc, &com, &uncom, &offL, &offH, &sw, &inuse, &usals, &input); int configured = 0; if (diseqc != -1 || com != -1 || uncom != -1 || usals != 0 || mpos != 0) @@ -573,9 +567,6 @@ int CServiceManager::LoadMotorPositions(void) sit->second.use_usals = usals; sit->second.input = input; sit->second.position = satellitePosition; - sit->second.unicable_scr = uniscr; - sit->second.unicable_qrg = uniqrg; - sit->second.unicable_lnb = unilnb; sit->second.configured = configured; } fgets(buffer, 255, fd); @@ -600,12 +591,11 @@ void CServiceManager::SaveMotorPositions() printf("[zapit] cannot open %s\n", SATCONFIG); return; } - fprintf(fd, "# sat position, stored rotor, diseqc, commited, uncommited, low, high, switch, use in full scan, use usals, input, unicable_scr, unicable_freq, unicable_lnb\n"); + fprintf(fd, "# sat position, stored rotor, diseqc, commited, uncommited, low, high, switch, use in full scan, use usals, input\n"); for(sit = satellitePositions.begin(); sit != satellitePositions.end(); ++sit) { - fprintf(fd, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", sit->first, sit->second.motor_position, + fprintf(fd, "%d %d %d %d %d %d %d %d %d %d %d\n", sit->first, sit->second.motor_position, sit->second.diseqc, sit->second.commited, sit->second.uncommited, sit->second.lnbOffsetLow, - sit->second.lnbOffsetHigh, sit->second.lnbSwitch, sit->second.use_in_scan, sit->second.use_usals, sit->second.input, - sit->second.unicable_scr, sit->second.unicable_qrg, sit->second.unicable_lnb); + sit->second.lnbOffsetHigh, sit->second.lnbSwitch, sit->second.use_in_scan, sit->second.use_usals, sit->second.input); } fdatasync(fileno(fd)); fclose(fd); @@ -626,9 +616,6 @@ bool CServiceManager::InitSatPosition(t_satellite_position position, char * name satellitePositions[position].use_in_scan = 0; satellitePositions[position].use_usals = 0; satellitePositions[position].input = 0; - satellitePositions[position].unicable_scr = -1; - satellitePositions[position].unicable_qrg = 0; - satellitePositions[position].unicable_lnb = 0; satellitePositions[position].configured = 0; satellitePositions[position].cable_nid = 0; if(name) diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp index 6f1c35bc7..6129d5d2d 100644 --- a/src/zapit/src/scan.cpp +++ b/src/zapit/src/scan.cpp @@ -148,7 +148,7 @@ bool CServiceScan::tuneFrequency(FrontendParameters *feparams, uint8_t polarizat } } /* for unicable, retry tuning two times before assuming it failed */ - int retry = (frontend->getUniSCR() >= 0) * 2 + 1; + int retry = (frontend->getDiseqcType() == DISEQC_UNICABLE) * 2 + 1; do { ret = frontend->tuneFrequency(feparams, polarization, false); if (ret) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 06dcf6f35..ea4479ec1 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -511,7 +511,7 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay SaveSettings(false); /* retry tuning twice when using unicable */ - int retry = (live_fe->getUniSCR() >= 0) * 2; + int retry = (live_fe->getDiseqcType() == DISEQC_UNICABLE) * 2; again: if(!TuneChannel(live_fe, newchannel, transponder_change)) { if (retry < 1) { @@ -578,7 +578,7 @@ bool CZapit::ZapForRecord(const t_channel_id channel_id) CZapitChannel* newchannel; bool transponder_change; /* retry tuning twice when using unicable */ - int retry = (live_fe->getUniSCR() >= 0) * 2; + int retry = (live_fe->getDiseqcType() == DISEQC_UNICABLE) * 2; if((newchannel = CServiceManager::getInstance()->FindChannel(channel_id)) == NULL) { printf("zapit_to_record: channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id);