neutrino: -add unicabel menu option

Origin commit data
------------------
Branch: ni/coolstream
Commit: 7d550ed88e
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2013-01-08 (Tue, 08 Jan 2013)


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

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2013-01-08 20:35:53 +01:00
parent 9ec9ae527b
commit a2a72a538c
13 changed files with 175 additions and 62 deletions

View File

@@ -1568,6 +1568,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
@@ -1758,6 +1760,9 @@ timing.infobar_movieplayer Infobar (Filmwiedergabe)
timing.infobar_radio Infobar (Radiobetrieb)
timing.menu Menü
timing.numericzap Umschalten mit Zifferntasten
unicable.lnb Unicable Eingang
unicable.qrg Unicable Frequenz
unicable.scr Unicable SCR
upnpbrowser.head UPnP Browser
upnpbrowser.noservers Kein UPnP-Server gefunden
upnpbrowser.rescan Neue Suche

View File

@@ -1568,6 +1568,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
@@ -1758,6 +1760,9 @@ timing.infobar_movieplayer Infobar (movie mode)
timing.infobar_radio Infobar (radio mode)
timing.menu Menu
timing.numericzap Numeric Zap
unicable.lnb Unicable Input
unicable.qrg Unicable Frequency
unicable.scr Unicable SCR
upnpbrowser.head UPnP Browser
upnpbrowser.noservers No UPnP servers found
upnpbrowser.rescan Scan again

View File

@@ -96,7 +96,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
@@ -268,6 +269,10 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
{
return showScanMenuLnbSetup();
}
else if(actionKey=="unisetup")
{
return showUnicableSetup();
}
else if(actionKey=="satfind")
{
return showScanMenuSatFind();
@@ -481,7 +486,6 @@ void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu)
setupMenu->addIntroItems();
int count = CFEManager::getInstance()->getFrontendCount();
CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_FE_MODE, (int *)&femode, SATSETUP_FRONTEND_MODE, SATSETUP_FRONTEND_MODE_COUNT, allow_start && (count > 1), this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
mc->setHint("", LOCALE_MENU_HINT_SCAN_FEMODE);
setupMenu->addItem(mc);
@@ -491,13 +495,14 @@ void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu)
for(int i = 0; i < count; i++) {
CFrontend * fe = CFEManager::getInstance()->getFE(i);
frontend_config_t & fe_config = fe->getConfig();
char tmp[32];
snprintf(tmp, sizeof(tmp), "config_frontend%d", i);
char name[255];
snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_SATSETUP_FE_SETUP), i+1, fe->getInfo()->name);
mf = new CMenuForwarderNonLocalized(name, ((i == 0) || (femode == CFEManager::FE_MODE_ALONE)), NULL, this, tmp,
mf = new CMenuForwarderNonLocalized(name, ((i == 0) || (femode == CFEManager::FE_MODE_ALONE) || (fe_config.diseqcType == DISEQC_UNICABLE && femode == CFEManager::FE_MODE_TWIN)), NULL, this, tmp,
(i == 0) ? CRCInput::RC_green : CRCInput::RC_yellow, (i == 0) ? NEUTRINO_ICON_BUTTON_GREEN : NEUTRINO_ICON_BUTTON_YELLOW);
mf->setHint("", LOCALE_MENU_HINT_SCAN_SETUP_FE);
setupMenu->addItem(mf);
@@ -551,11 +556,13 @@ int CScanSetup::showFrontendSetup(int number)
setupMenu->setSelected(feselected);
setupMenu->addIntroItems();
CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&dmode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, allow_start, this, CRCInput::convertDigitToKey(shortcut++), "", true);
bool option_onoff = (number > 0 && fe_config.diseqcType == DISEQC_UNICABLE && femode == CFEManager::FE_MODE_TWIN) ? false : true;
CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&dmode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, allow_start && option_onoff, this, CRCInput::convertDigitToKey(shortcut++), "", true);
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);
@@ -570,29 +577,32 @@ int CScanSetup::showFrontendSetup(int number)
mc->setHint("", LOCALE_MENU_HINT_SCAN_SATENABLE);
satToSelect.addItem(mc);
}
CMenuForwarder * mf = new CMenuForwarder(LOCALE_SATSETUP_SELECT_SAT, true, NULL, &satToSelect, "", CRCInput::convertDigitToKey(shortcut++));
CMenuForwarder * mf = new CMenuForwarder(LOCALE_SATSETUP_SELECT_SAT, option_onoff, NULL, &satToSelect, "", CRCInput::convertDigitToKey(shortcut++));
mf->setHint("", LOCALE_MENU_HINT_SCAN_SATADD);
setupMenu->addItem(mf);
//FIXME why fsatSetup not local variable ?
fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, true, NULL, this, "satsetup", CRCInput::convertDigitToKey(shortcut++));
fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, option_onoff, NULL, this, "satsetup", CRCInput::convertDigitToKey(shortcut++));
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);
CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, option_onoff, 0, 64, NULL);
nc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_SPEED);
setupMenu->addItem(nc);
mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, option_onoff);
mc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_18V);
setupMenu->addItem(mc);
mc = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this);
mc = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, option_onoff, this);
mc->setHint("", LOCALE_MENU_HINT_SCAN_USALSALL);
setupMenu->addItem(mc);
mf = new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, this, "satfind", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
mf = new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, option_onoff, NULL, this, "satfind", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
mf->setHint("", LOCALE_MENU_HINT_SCAN_SATFIND);
setupMenu->addItem(mf);
@@ -606,6 +616,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);
@@ -783,18 +822,31 @@ int CScanSetup::showScanMenuSatFind()
void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satconfig)
{
temp_sat->addIntroItems();
CMenuOptionNumberChooser *diseqc;
CMenuOptionNumberChooser *comm;
CMenuOptionNumberChooser *uncomm;
CMenuOptionNumberChooser *unilnb;
CMenuOptionNumberChooser *motor;
CMenuOptionChooser *usals;
CMenuForwarder *mf;
bool unicable = (dmode == DISEQC_UNICABLE);
CMenuOptionNumberChooser *diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
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);
CMenuOptionNumberChooser *comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
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 = 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 *motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF);
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 = 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;
@@ -802,13 +854,17 @@ 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);
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);
}
CMenuForwarder * mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL);
mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL);
mf->setHint("", LOCALE_MENU_HINT_SCAN_LOFL);
temp_sat->addItem(mf);
mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFH, true, lofH->getValue(), lofH);
@@ -1110,26 +1166,50 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*
}
}
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_DISEQC)) {
printf("[neutrino] CScanSetup::%s: diseqc %d \n", __FUNCTION__, dmode);
//FIXME 2 frontends ??
printf("[neutrino] CScanSetup::%s: diseqc %d fenumber %d\n", __FUNCTION__, dmode, fenumber);
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
fe->setDiseqcType((diseqc_t) dmode);
if(femode != CFEManager::FE_MODE_ALONE)
CFEManager::getInstance()->saveSettings(true);
fautoScanAll->setActive(dmode != NO_DISEQC);
if(dmode == NO_DISEQC) {
uniSetup->setActive(dmode == DISEQC_UNICABLE);
if (dmode == NO_DISEQC || dmode == DISEQC_UNICABLE) {
ojDiseqcRepeats->setActive(false);
if(frontendSetup){
if(femode == CFEManager::FE_MODE_TWIN && dmode == DISEQC_UNICABLE){
frontendSetup->setActive(true);
}
else if( femode != CFEManager::FE_MODE_ALONE){
frontendSetup->setActive(false);
}
}
}
else if(dmode < DISEQC_ADVANCED) {
ojDiseqcRepeats->setActive(true);
if(frontendSetup && femode != CFEManager::FE_MODE_ALONE){
frontendSetup->setActive(false);
}
}
else if(dmode == DISEQC_ADVANCED) {
if(frontendSetup && femode != CFEManager::FE_MODE_ALONE){
frontendSetup->setActive(false);
}
ojDiseqcRepeats->setActive(true);
}
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
fe->setDiseqcType((diseqc_t) dmode);
}
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_FE_MODE)) {
printf("[neutrino] CScanSetup::%s: fe mode %d \n", __FUNCTION__, femode);
/* cable dont have this menu */
if(frontendSetup)
frontendSetup->setActive(femode == CFEManager::FE_MODE_ALONE);
bool twin_unicabel = false;
if(frontendSetup){
CFrontend * fe = CFEManager::getInstance()->getLiveFE();
frontend_config_t & fe_config = fe->getConfig();
twin_unicabel = (femode == CFEManager::FE_MODE_TWIN && fe_config.diseqcType == DISEQC_UNICABLE);
frontendSetup->setActive(femode == CFEManager::FE_MODE_ALONE || twin_unicabel);
}
CFEManager::getInstance()->setMode((CFEManager::fe_mode_t) femode);
/* to copy settings from fe0 */
if(femode != CFEManager::FE_MODE_ALONE)

View File

@@ -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);

View File

@@ -1595,6 +1595,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,
@@ -1785,6 +1787,9 @@ typedef enum
LOCALE_TIMING_INFOBAR_RADIO,
LOCALE_TIMING_MENU,
LOCALE_TIMING_NUMERICZAP,
LOCALE_UNICABLE_LNB,
LOCALE_UNICABLE_QRG,
LOCALE_UNICABLE_SCR,
LOCALE_UPNPBROWSER_HEAD,
LOCALE_UPNPBROWSER_NOSERVERS,
LOCALE_UPNPBROWSER_RESCAN,

View File

@@ -1595,6 +1595,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",
@@ -1785,6 +1787,9 @@ const char * locale_real_names[] =
"timing.infobar_radio",
"timing.menu",
"timing.numericzap",
"unicable.lnb",
"unicable.qrg",
"unicable.scr",
"upnpbrowser.head",
"upnpbrowser.noservers",
"upnpbrowser.rescan",

View File

@@ -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,

View File

@@ -184,7 +184,6 @@ class CFrontend
};
void configRotor(int _motorRotationSpeed, bool _highVoltage)
{ config.motorRotationSpeed = _motorRotationSpeed; config.highVoltage = _highVoltage; };
void configUnicable(int scr, int qrg) { config.uni_scr = scr; config.uni_qrg = qrg; };
frontend_config_t& getConfig() { return config; };
void setConfig(frontend_config_t cfg) { setDiseqcType((diseqc_t) cfg.diseqcType); config = cfg; };

View File

@@ -34,6 +34,7 @@ typedef struct frontend_config {
int diseqcType;
int uni_scr;
int uni_qrg;
int uni_lnb;
int motorRotationSpeed;
int highVoltage;
} frontend_config_t;

View File

@@ -70,7 +70,8 @@ typedef struct Zapit_config {
int highVoltage;
int motorRotationSpeed;
int uni_scr;
int uni_qrg;
int uni_qrg; /* the unicable frequency in MHz */
int uni_lnb; /* the input (0/1) of a twin-position switch */
} t_zapit_config;

View File

@@ -236,8 +236,12 @@ void CFEManager::saveSettings(bool write)
INFO("fe%d", fe->fenumber);
if(fe->fenumber && mode != FE_MODE_ALONE) {
CFrontend * fe0 = getFE(0);
fe->setConfig(fe0->getConfig());
fe->setSatellites(fe0->getSatellites());
//fe->setConfig(fe0->getConfig());
fe->config.diseqcType = fe0->config.diseqcType;
fe->config.diseqcRepeats = fe0->config.diseqcRepeats;
fe->config.motorRotationSpeed = fe0->config.motorRotationSpeed;
fe->config.highVoltage = fe0->config.highVoltage;
}
setConfigValue(fe, "diseqcType", fe_config.diseqcType);

View File

@@ -159,8 +159,9 @@ 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_qrg = 0; /* the unicable frequency in MHz, 0 == from spec */
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;
config.motorRotationSpeed = 0; //in 0.1 degrees per second
@@ -699,11 +700,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,
0); /* bank 0/1, like mini-diseqc a/b, not impl.*/
!!config.uni_lnb);
cmdseq.num += nrOfProps;
@@ -767,7 +768,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... */
@@ -796,7 +797,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 */
@@ -854,6 +855,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");
@@ -870,7 +874,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();
@@ -972,7 +980,14 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque
{
sat_iterator_t sit = satellites.find(satellitePosition);
/* 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;
@@ -994,24 +1009,19 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque
uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int high_band,
const int horizontal, const int bank)
{
uint32_t uni_qrgs[] = { 1284, 1400, 1516, 1632, 1748, 1864, 1980, 2096 };
uint32_t bpf;
if (config.uni_qrg == 0)
bpf = uni_qrgs[config.uni_scr];
else
bpf = config.uni_qrg;
uint32_t bpf = config.uni_qrg;
struct dvb_diseqc_master_cmd cmd = {
{0xe0, 0x10, 0x5a, 0x00, 0x00, 0x00}, 5
};
unsigned int t = (frequency / 1000 + bpf + 2) / 4 - 350;
if (t < 1024 && config.uni_scr >= 0 && config.uni_scr < 8)
{
INFO("VOLT18=%d TONE_ON=%d, freq=%d bpf=%d ret=%d", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, (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;
@@ -1020,7 +1030,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;

View File

@@ -192,8 +192,6 @@ void CZapit::SaveSettings(bool write)
configfile.setInt32("diseqcRepeats", live_fe->getDiseqcRepeats());
configfile.setInt32("diseqcType", live_fe->getDiseqcType());
configfile.setInt32("motorRotationSpeed", config.motorRotationSpeed);
configfile.setInt32("uni_scr", config.uni_scr);
configfile.setInt32("uni_qrg", config.uni_qrg);
#endif
if (configfile.getModifiedFlag())
configfile.saveConfig(CONFIGFILE);
@@ -309,8 +307,6 @@ void CZapit::LoadSettings()
/* FIXME FE specific, to be removed */
diseqcType = (diseqc_t)configfile.getInt32("diseqcType", NO_DISEQC);
config.motorRotationSpeed = configfile.getInt32("motorRotationSpeed", 18); // default: 1.8 degrees per second
config.uni_scr = configfile.getInt32("uni_scr", -1);
config.uni_qrg = configfile.getInt32("uni_qrg", 0);
printf("[zapit.cpp] diseqc type = %d\n", diseqcType);
@@ -336,7 +332,6 @@ void CZapit::ConfigFrontend()
if(!CFEManager::getInstance()->configExist()) {
INFO("New frontend config not exist");
fe->configRotor(config.motorRotationSpeed, config.highVoltage);
fe->configUnicable(config.uni_scr, config.uni_qrg);
fe->setDiseqcType(diseqcType);
fe->setDiseqcRepeats(configfile.getInt32("diseqcRepeats", 0));
fe->setRotorSatellitePosition(configfile.getInt32("lastSatellitePosition", 0));