mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
scan_setup: re-write to support two frontends; move update of manual scan menu params from neutrino; changeNotify for related params
This commit is contained in:
@@ -9,6 +9,8 @@
|
|||||||
Copyright (C) 2011 T. Graf 'dbt'
|
Copyright (C) 2011 T. Graf 'dbt'
|
||||||
Homepage: http://www.dbox2-tuning.net/
|
Homepage: http://www.dbox2-tuning.net/
|
||||||
|
|
||||||
|
Copyright (C) 2011 CoolStream International Ltd
|
||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -50,11 +52,13 @@
|
|||||||
#include <driver/record.h>
|
#include <driver/record.h>
|
||||||
#include <system/debug.h>
|
#include <system/debug.h>
|
||||||
|
|
||||||
#include <zapit/frontend_c.h>
|
#include <zapit/femanager.h>
|
||||||
#include <zapit/getservices.h>
|
#include <zapit/getservices.h>
|
||||||
#include <zapit/satconfig.h>
|
#include <zapit/satconfig.h>
|
||||||
#include <zapit/fastscan.h>
|
#include <zapit/fastscan.h>
|
||||||
#include <zapit/zapit.h>
|
#include <zapit/zapit.h>
|
||||||
|
#include <zapit/debug.h>
|
||||||
|
#include <set>
|
||||||
|
|
||||||
extern std::map<transponder_id_t, transponder> select_transponders;
|
extern std::map<transponder_id_t, transponder> select_transponders;
|
||||||
extern Zapit_config zapitCfg;
|
extern Zapit_config zapitCfg;
|
||||||
@@ -64,7 +68,7 @@ extern char zapit_long[20];
|
|||||||
extern CHintBox *reloadhintBox;
|
extern CHintBox *reloadhintBox;
|
||||||
|
|
||||||
static int all_usals = 1;
|
static int all_usals = 1;
|
||||||
sat_iterator_t sit;
|
//sat_iterator_t sit;
|
||||||
|
|
||||||
#define SCANTS_BOUQUET_OPTION_COUNT 3
|
#define SCANTS_BOUQUET_OPTION_COUNT 3
|
||||||
const CMenuOptionChooser::keyval SCANTS_BOUQUET_OPTIONS[SCANTS_BOUQUET_OPTION_COUNT] =
|
const CMenuOptionChooser::keyval SCANTS_BOUQUET_OPTIONS[SCANTS_BOUQUET_OPTION_COUNT] =
|
||||||
@@ -140,6 +144,7 @@ const CMenuOptionChooser::keyval SATSETUP_SCANTP_MOD[SATSETUP_SCANTP_MOD_COUNT]
|
|||||||
{ 4, LOCALE_EXTRA_TP_MOD_128},
|
{ 4, LOCALE_EXTRA_TP_MOD_128},
|
||||||
{ 5, LOCALE_EXTRA_TP_MOD_256}
|
{ 5, LOCALE_EXTRA_TP_MOD_256}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SATSETUP_SCANTP_POL_COUNT 2
|
#define SATSETUP_SCANTP_POL_COUNT 2
|
||||||
const CMenuOptionChooser::keyval SATSETUP_SCANTP_POL[SATSETUP_SCANTP_POL_COUNT] =
|
const CMenuOptionChooser::keyval SATSETUP_SCANTP_POL[SATSETUP_SCANTP_POL_COUNT] =
|
||||||
{
|
{
|
||||||
@@ -169,6 +174,7 @@ const CMenuOptionChooser::keyval SECTIONSD_SCAN_OPTIONS[SECTIONSD_SCAN_OPTIONS_C
|
|||||||
{ 1, LOCALE_OPTIONS_ON },
|
{ 1, LOCALE_OPTIONS_ON },
|
||||||
{ 2, LOCALE_OPTIONS_ON_WITHOUT_MESSAGES }
|
{ 2, LOCALE_OPTIONS_ON_WITHOUT_MESSAGES }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DISEQC_ORDER_OPTION_COUNT 2
|
#define DISEQC_ORDER_OPTION_COUNT 2
|
||||||
const CMenuOptionChooser::keyval DISEQC_ORDER_OPTIONS[DISEQC_ORDER_OPTION_COUNT] =
|
const CMenuOptionChooser::keyval DISEQC_ORDER_OPTIONS[DISEQC_ORDER_OPTION_COUNT] =
|
||||||
{
|
{
|
||||||
@@ -176,13 +182,20 @@ const CMenuOptionChooser::keyval DISEQC_ORDER_OPTIONS[DISEQC_ORDER_OPTION_COUNT]
|
|||||||
{ UNCOMMITED_FIRST, LOCALE_SATSETUP_DISEQC_UNCOM_COM }
|
{ UNCOMMITED_FIRST, LOCALE_SATSETUP_DISEQC_UNCOM_COM }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define SATSETUP_FRONTEND_MODE_COUNT 4
|
||||||
|
const CMenuOptionChooser::keyval SATSETUP_FRONTEND_MODE[SATSETUP_FRONTEND_MODE_COUNT] =
|
||||||
|
{
|
||||||
|
{ CFEManager::FE_MODE_SINGLE, LOCALE_SATSETUP_FE_MODE_SINGLE },
|
||||||
|
{ CFEManager::FE_MODE_LOOP, LOCALE_SATSETUP_FE_MODE_LOOP },
|
||||||
|
{ CFEManager::FE_MODE_TWIN, LOCALE_SATSETUP_FE_MODE_TWIN },
|
||||||
|
{ CFEManager::FE_MODE_ALONE, LOCALE_SATSETUP_FE_MODE_ALONE }
|
||||||
|
};
|
||||||
|
|
||||||
CScanSetup::CScanSetup(bool wizard_mode)
|
CScanSetup::CScanSetup(bool wizard_mode)
|
||||||
{
|
{
|
||||||
width = w_max (40, 10);
|
width = w_max (40, 10);
|
||||||
selected = -1;
|
selected = -1;
|
||||||
dmode = scansettings.diseqcMode;
|
fselected = -1;
|
||||||
sfound = 0;
|
|
||||||
r_system = g_info.delivery_system;
|
r_system = g_info.delivery_system;
|
||||||
fec_count = (r_system == DVB_S) ? SATSETUP_SCANTP_FEC_COUNT : CABLESETUP_SCANTP_FEC_COUNT;
|
fec_count = (r_system == DVB_S) ? SATSETUP_SCANTP_FEC_COUNT : CABLESETUP_SCANTP_FEC_COUNT;
|
||||||
freq_length = (r_system == DVB_S) ? 8 : 6;
|
freq_length = (r_system == DVB_S) ? 8 : 6;
|
||||||
@@ -193,8 +206,7 @@ CScanSetup::CScanSetup(bool wizard_mode)
|
|||||||
satprov_locale = (r_system == DVB_S) ? LOCALE_SATSETUP_SATELLITE : LOCALE_CABLESETUP_PROVIDER;
|
satprov_locale = (r_system == DVB_S) ? LOCALE_SATSETUP_SATELLITE : LOCALE_CABLESETUP_PROVIDER;
|
||||||
|
|
||||||
satSelect = NULL;
|
satSelect = NULL;
|
||||||
usalsNotify = NULL;
|
frontendSetup = NULL;
|
||||||
satNotify = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CScanSetup* CScanSetup::getInstance()
|
CScanSetup* CScanSetup::getInstance()
|
||||||
@@ -211,17 +223,17 @@ CScanSetup* CScanSetup::getInstance()
|
|||||||
|
|
||||||
CScanSetup::~CScanSetup()
|
CScanSetup::~CScanSetup()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||||
{
|
{
|
||||||
int res = menu_return::RETURN_REPAINT;
|
int res = menu_return::RETURN_REPAINT;
|
||||||
|
std::string::size_type loc;
|
||||||
|
|
||||||
if (parent)
|
if (parent)
|
||||||
parent->hide();
|
parent->hide();
|
||||||
|
|
||||||
|
printf("[neutrino] CScanSetup::%s: %s \n", __FUNCTION__, actionKey.c_str());
|
||||||
if(actionKey=="save_scansettings")
|
if(actionKey=="save_scansettings")
|
||||||
{
|
{
|
||||||
printf("[neutrino] CScanSetup::%s save_scansettings...\n", __FUNCTION__);
|
printf("[neutrino] CScanSetup::%s save_scansettings...\n", __FUNCTION__);
|
||||||
@@ -238,6 +250,20 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
reloadhintBox->hide();
|
reloadhintBox->hide();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
else if(actionKey=="satsetup")
|
||||||
|
{
|
||||||
|
return showScanMenuLnbSetup();
|
||||||
|
}
|
||||||
|
else if(actionKey=="satfind")
|
||||||
|
{
|
||||||
|
return showScanMenuSatFind();
|
||||||
|
}
|
||||||
|
else if((loc = actionKey.find("config_frontend", 0)) != std::string::npos)
|
||||||
|
{
|
||||||
|
int number = actionKey.at(15) - '0';
|
||||||
|
printf("[neutrino] CScanSetup::%s %s, fe %d\n", __FUNCTION__, actionKey.c_str(), number);
|
||||||
|
return showFrontendSetup(number);
|
||||||
|
}
|
||||||
|
|
||||||
//starting scan
|
//starting scan
|
||||||
std::string scants_key[] = {"all", "manual", "test", "fast", "auto"/*doesn't exists in CScanTs!*/};
|
std::string scants_key[] = {"all", "manual", "test", "fast", "auto"/*doesn't exists in CScanTs!*/};
|
||||||
@@ -264,34 +290,15 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef ENABLE_FASTSCAN
|
|
||||||
#define FAST_SCAN_OPTIONS_COUNT 2
|
|
||||||
const CMenuOptionChooser::keyval FAST_SCAN_OPTIONS[FAST_SCAN_OPTIONS_COUNT] =
|
|
||||||
{
|
|
||||||
{ FAST_SCAN_SD, LOCALE_SATSETUP_FASTSCAN_SD },
|
|
||||||
{ FAST_SCAN_HD, LOCALE_SATSETUP_FASTSCAN_HD }
|
|
||||||
/*{ FAST_SCAN_ALL, LOCALE_SATSETUP_FASTSCAN_ALL }*/
|
|
||||||
};
|
|
||||||
|
|
||||||
#define FAST_SCAN_PROV_OPTIONS_COUNT 3
|
|
||||||
const CMenuOptionChooser::keyval FAST_SCAN_PROV_OPTIONS[FAST_SCAN_PROV_OPTIONS_COUNT] =
|
|
||||||
{
|
|
||||||
{ OPERATOR_CD, LOCALE_SATSETUP_FASTSCAN_PROV_CD },
|
|
||||||
{ OPERATOR_TVV, LOCALE_SATSETUP_FASTSCAN_PROV_TVV },
|
|
||||||
{ OPERATOR_TELESAT, LOCALE_SATSETUP_FASTSCAN_PROV_TELESAT }
|
|
||||||
};
|
|
||||||
#endif /*ENABLE_FASTSCAN*/
|
|
||||||
|
|
||||||
//scale to max sat/cable name lenght
|
//scale to max sat/cable name lenght
|
||||||
unsigned int CScanSetup::getSatMenuListWidth()
|
unsigned int CScanSetup::getSatMenuListWidth()
|
||||||
{
|
{
|
||||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||||
unsigned int sat_txt_w = 0, max_txt_w = 0;
|
unsigned int sat_txt_w = 0, max_txt_w = 0;
|
||||||
|
|
||||||
for (sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++)
|
satellite_map_t satmap = CServiceManager::getInstance()->SatelliteList();
|
||||||
{
|
for(sat_iterator_t it = satmap.begin(); it != satmap.end(); ++it) {
|
||||||
sat_txt_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(sit->second.name.c_str(), true);
|
sat_txt_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(it->second.name.c_str(), true);
|
||||||
max_txt_w = std::max(max_txt_w, sat_txt_w);
|
max_txt_w = std::max(max_txt_w, sat_txt_w);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,26 +319,16 @@ int CScanSetup::showScanMenu()
|
|||||||
int shortcut = 1;
|
int shortcut = 1;
|
||||||
|
|
||||||
CMenuWidget *settings = NULL;//main
|
CMenuWidget *settings = NULL;//main
|
||||||
CMenuWidget *satSetup = NULL;//lnb config sub menu
|
|
||||||
CMenuForwarder *fsatSetup = NULL;//lnb config
|
|
||||||
CMenuWidget *motorMenu = NULL;//motor menu
|
|
||||||
CMenuForwarder *fmotorMenu = NULL;//motor settings
|
|
||||||
CMenuWidget *manualScan = NULL;//manual scan
|
CMenuWidget *manualScan = NULL;//manual scan
|
||||||
CMenuWidget *autoScanAll = NULL;//auto scan all
|
CMenuWidget *autoScanAll = NULL;//auto scan all
|
||||||
CMenuForwarder *fautoScanAll = NULL;
|
|
||||||
#ifdef ENABLE_FASTSCAN
|
#ifdef ENABLE_FASTSCAN
|
||||||
CMenuWidget *fastScanMenu = NULL;//fast scan
|
CMenuWidget *fastScanMenu = NULL;//fast scan
|
||||||
#endif /*ENABLE_FASTSCAN*/
|
#endif /*ENABLE_FASTSCAN*/
|
||||||
CMenuWidget *autoScan = NULL;//auto scan
|
CMenuWidget *autoScan = NULL;//auto scan
|
||||||
|
CMenuWidget *setupMenu = NULL;//sat frontend setup;
|
||||||
CMenuOptionChooser *ojDiseqc = NULL;//diseqc modes
|
|
||||||
CMenuOptionNumberChooser *ojDiseqcRepeats = NULL;//diseqc repeats
|
|
||||||
|
|
||||||
allow_start = !CRecordManager::getInstance()->RecordingStatus() || CRecordManager::getInstance()->TimeshiftOnly();
|
allow_start = !CRecordManager::getInstance()->RecordingStatus() || CRecordManager::getInstance()->TimeshiftOnly();
|
||||||
|
|
||||||
satNotify = new CSatelliteSetupNotifier();
|
|
||||||
usalsNotify = new CAllUsalsNotifier();
|
|
||||||
|
|
||||||
//main
|
//main
|
||||||
settings = new CMenuWidget(is_wizard ? LOCALE_SERVICEMENU_SCANTS : LOCALE_SERVICEMENU_HEAD, NEUTRINO_ICON_SETTINGS, width);
|
settings = new CMenuWidget(is_wizard ? LOCALE_SERVICEMENU_SCANTS : LOCALE_SERVICEMENU_HEAD, NEUTRINO_ICON_SETTINGS, width);
|
||||||
settings->setSelected(selected);
|
settings->setSelected(selected);
|
||||||
@@ -351,69 +348,41 @@ int CScanSetup::showScanMenu()
|
|||||||
//bouquet generate mode
|
//bouquet generate mode
|
||||||
settings->addItem(new CMenuOptionChooser(LOCALE_SCANTS_BOUQUET, (int *)&scansettings.bouquetMode, SCANTS_BOUQUET_OPTIONS, SCANTS_BOUQUET_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++), "", true));
|
settings->addItem(new CMenuOptionChooser(LOCALE_SCANTS_BOUQUET, (int *)&scansettings.bouquetMode, SCANTS_BOUQUET_OPTIONS, SCANTS_BOUQUET_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++), "", true));
|
||||||
|
|
||||||
//t_satellite_position currentSatellitePosition = CFrontend::getInstance()->getCurrentSatellitePosition();
|
|
||||||
//sat/provider selector
|
//sat/provider selector
|
||||||
satSelect = new CMenuOptionStringChooser(satprov_locale, scansettings.satNameNoDiseqc, true, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
|
satSelect = new CMenuOptionStringChooser(satprov_locale, scansettings.satNameNoDiseqc, true, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
|
||||||
satSetup = new CMenuWidget(satprov_locale, NEUTRINO_ICON_SETTINGS, width);
|
satOnOff = new CMenuWidget(satprov_locale, NEUTRINO_ICON_SETTINGS, width);
|
||||||
|
|
||||||
if (r_system == DVB_S) //sat
|
if (r_system == DVB_S) //sat
|
||||||
{
|
{
|
||||||
settings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SCANTS_PREVERENCES_RECEIVING_SYSTEM));
|
//settings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SCANTS_PREVERENCES_RECEIVING_SYSTEM));
|
||||||
|
setupMenu = new CMenuWidget(LOCALE_SATSETUP_FE_SETUP, NEUTRINO_ICON_SETTINGS, width);
|
||||||
//diseqc on/off
|
setupMenu->setSelected(fselected);
|
||||||
ojDiseqc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&scansettings.diseqcMode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, true, satNotify, CRCInput::convertDigitToKey(shortcut++), "", true);
|
addScanMenuFrontendSetup(setupMenu);
|
||||||
//diseqc type
|
CMenuForwarder * fsetupMenu = new CMenuForwarder(LOCALE_SATSETUP_FE_SETUP, true, NULL, setupMenu, "", CRCInput::convertDigitToKey(shortcut++));
|
||||||
ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&scansettings.diseqcRepeat, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), 0, 2, NULL);
|
settings->addItem(fsetupMenu);
|
||||||
|
/* add configured satellites to satSelect */
|
||||||
satNotify->addItem(1, ojDiseqcRepeats);
|
fillSatSelect();
|
||||||
//--------------------------------------------------------------
|
|
||||||
//add diseqc items
|
|
||||||
settings->addItem(ojDiseqc);
|
|
||||||
settings->addItem(ojDiseqcRepeats);
|
|
||||||
//--------------------------------------------------------------
|
|
||||||
settings->addItem(GenericMenuSeparatorLine);
|
|
||||||
//--------------------------------------------------------------
|
|
||||||
|
|
||||||
//lnb settings
|
|
||||||
addScanMenuLnbSetup(satSetup);
|
|
||||||
|
|
||||||
//motor settings
|
|
||||||
motorMenu = new CMenuWidget(LOCALE_SATSETUP_EXTENDED_MOTOR, NEUTRINO_ICON_SETTINGS, width);
|
|
||||||
addScanMenuMotorMenu(motorMenu);
|
|
||||||
}
|
}
|
||||||
else if (r_system == DVB_C) //cable
|
else if (r_system == DVB_C) //cable
|
||||||
{
|
{
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
settings->addItem(GenericMenuSeparatorLine);
|
settings->addItem(GenericMenuSeparatorLine);
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
//fsatSetup = new CMenuForwarder(LOCALE_CABLESETUP_PROVIDER, true, NULL, satSetup, "", CRCInput::convertDigitToKey(shortcut++));
|
fillCableSelect();
|
||||||
addScanMenuProvider(satSetup);
|
//tune timeout
|
||||||
|
settings->addItem(new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_FE_TIMEOUT, (int *)&zapitCfg.feTimeout, true, 6, 100) );
|
||||||
|
if(CFEManager::getInstance()->getFrontendCount() > 1) {
|
||||||
|
femode = CFEManager::getInstance()->getMode();
|
||||||
|
CMenuOptionChooser * mode = new CMenuOptionChooser(LOCALE_SATSETUP_FE_MODE, (int *)&femode, SATSETUP_FRONTEND_MODE, 2, true, this);
|
||||||
|
settings->addItem(mode);
|
||||||
|
}
|
||||||
|
CIntInput* nid = new CIntInput(LOCALE_SATSETUP_CABLE_NID, (int&) scansettings.cable_nid, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
|
||||||
|
settings->addItem(new CMenuForwarder(LOCALE_SATSETUP_CABLE_NID, true, nid->getValue(), nid));
|
||||||
}
|
}
|
||||||
|
|
||||||
//tune timeout
|
|
||||||
settings->addItem(new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_FE_TIMEOUT, (int *)&zapitCfg.feTimeout, true, 6, 100) );
|
|
||||||
|
|
||||||
if (r_system == DVB_S)
|
|
||||||
{
|
|
||||||
fmotorMenu = new CMenuForwarder(LOCALE_SATSETUP_EXTENDED_MOTOR, true, NULL, motorMenu, "", CRCInput::convertDigitToKey(shortcut++));
|
|
||||||
fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, true, NULL, satSetup, "", CRCInput::convertDigitToKey(shortcut++));
|
|
||||||
//--------------------------------------------------------------
|
|
||||||
settings->addItem(GenericMenuSeparatorLine);
|
|
||||||
//--------------------------------------------------------------
|
|
||||||
settings->addItem(fmotorMenu); //motor settings
|
|
||||||
settings->addItem(fsatSetup); //lnb satsetup setup
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
settings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SCANTS_PREVERENCES_SCAN));
|
settings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SCANTS_PREVERENCES_SCAN));
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
|
|
||||||
if (!sfound && satellitePositions.size())
|
|
||||||
{
|
|
||||||
sit = satellitePositions.begin();
|
|
||||||
snprintf(scansettings.satNameNoDiseqc, sizeof(scansettings.satNameNoDiseqc), "%s", sit->second.name.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
int w = getSatMenuListWidth();
|
int w = getSatMenuListWidth();
|
||||||
|
|
||||||
//auto scan
|
//auto scan
|
||||||
@@ -434,136 +403,321 @@ int CScanSetup::showScanMenu()
|
|||||||
//auto scan all
|
//auto scan all
|
||||||
autoScanAll = new CMenuWidget(LOCALE_SATSETUP_AUTO_SCAN_ALL, NEUTRINO_ICON_SETTINGS, w/*width*/);
|
autoScanAll = new CMenuWidget(LOCALE_SATSETUP_AUTO_SCAN_ALL, NEUTRINO_ICON_SETTINGS, w/*width*/);
|
||||||
addScanMenuAutoScanAll(autoScanAll);
|
addScanMenuAutoScanAll(autoScanAll);
|
||||||
fautoScanAll = new CMenuForwarder(LOCALE_SATSETUP_AUTO_SCAN_ALL, (dmode != NO_DISEQC), NULL, autoScanAll, "", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
|
fautoScanAll = new CMenuForwarder(LOCALE_SATSETUP_AUTO_SCAN_ALL, true /*(dmode != NO_DISEQC)*/, NULL, autoScanAll, "", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
|
||||||
satNotify->addItem(2, fautoScanAll);
|
|
||||||
settings->addItem(fautoScanAll);
|
settings->addItem(fautoScanAll);
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ENABLE_FASTSCAN
|
#ifdef ENABLE_FASTSCAN
|
||||||
if (r_system == DVB_S)
|
|
||||||
{
|
|
||||||
//fast scan
|
//fast scan
|
||||||
fastScanMenu = new CMenuWidget(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS);
|
fastScanMenu = new CMenuWidget(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS);
|
||||||
addScanMenuFastScan(fastScanMenu);
|
addScanMenuFastScan(fastScanMenu);
|
||||||
settings->addItem(new CMenuForwarder(LOCALE_SATSETUP_FASTSCAN_HEAD, true, NULL, fastScanMenu, "", CRCInput::convertDigitToKey(shortcut++)));
|
settings->addItem(new CMenuForwarder(LOCALE_SATSETUP_FASTSCAN_HEAD, true, NULL, fastScanMenu, "", CRCInput::convertDigitToKey(shortcut++)));
|
||||||
}
|
|
||||||
#endif /*ENABLE_FASTSCAN*/
|
#endif /*ENABLE_FASTSCAN*/
|
||||||
|
}
|
||||||
|
|
||||||
int res = settings->exec(NULL, "");
|
int res = settings->exec(NULL, "");
|
||||||
settings->hide();
|
settings->hide();
|
||||||
selected = settings->getSelected();
|
selected = settings->getSelected();
|
||||||
delete satNotify;
|
if(setupMenu)
|
||||||
delete usalsNotify;
|
fselected = setupMenu->getSelected();
|
||||||
|
|
||||||
delete satSelect;
|
delete satSelect;
|
||||||
delete settings;
|
delete settings;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
//init sat setup menu
|
void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu)
|
||||||
void CScanSetup::addScanMenuLnbSetup(CMenuWidget *sat_setup)
|
|
||||||
{
|
{
|
||||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
int shortcut = 1;
|
||||||
|
femode = CFEManager::getInstance()->getMode();
|
||||||
|
|
||||||
|
setupMenu->addIntroItems();
|
||||||
|
|
||||||
|
int count = CFEManager::getInstance()->getFrontendCount();
|
||||||
|
|
||||||
|
CMenuOptionChooser * mode = 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);
|
||||||
|
setupMenu->addItem(mode);
|
||||||
|
setupMenu->addItem(new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_FE_TIMEOUT, (int *)&zapitCfg.feTimeout, true, 6, 100) );
|
||||||
|
|
||||||
|
for(int i = 0; i < count; i++) {
|
||||||
|
CFrontend * fe = CFEManager::getInstance()->getFE(i);
|
||||||
|
|
||||||
|
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, fe->getInfo()->name);
|
||||||
|
|
||||||
|
CMenuForwarder * fSetup = new CMenuForwarderNonLocalized(name, ((i == 0) || (femode == CFEManager::FE_MODE_ALONE)), NULL, this, tmp,
|
||||||
|
(i == 0) ? CRCInput::RC_green : CRCInput::RC_yellow, (i == 0) ? NEUTRINO_ICON_BUTTON_GREEN : NEUTRINO_ICON_BUTTON_YELLOW);
|
||||||
|
setupMenu->addItem(fSetup);
|
||||||
|
if(i != 0)
|
||||||
|
frontendSetup = fSetup;
|
||||||
|
}
|
||||||
|
CStringInput *toff = NULL;
|
||||||
|
sprintf(zapit_lat, "%02.6f", zapitCfg.gotoXXLatitude);
|
||||||
|
sprintf(zapit_long, "%02.6f", zapitCfg.gotoXXLongitude);
|
||||||
|
|
||||||
|
setupMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SATSETUP_EXTENDED_MOTOR));
|
||||||
|
setupMenu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_LADIRECTION, (int *)&zapitCfg.gotoXXLaDirection, OPTIONS_SOUTH0_NORTH1_OPTIONS, OPTIONS_SOUTH0_NORTH1_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)));
|
||||||
|
|
||||||
|
toff = new CStringInput(LOCALE_EXTRA_LATITUDE, (char *) zapit_lat, 10, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789.");
|
||||||
|
setupMenu->addItem(new CMenuForwarder(LOCALE_EXTRA_LATITUDE, true, zapit_lat, toff, "", CRCInput::convertDigitToKey(shortcut++)));
|
||||||
|
|
||||||
|
setupMenu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_LODIRECTION, (int *)&zapitCfg.gotoXXLoDirection, OPTIONS_EAST0_WEST1_OPTIONS, OPTIONS_EAST0_WEST1_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)));
|
||||||
|
|
||||||
|
toff = new CStringInput(LOCALE_EXTRA_LONGITUDE, (char *) zapit_long, 10, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789.");
|
||||||
|
setupMenu->addItem(new CMenuForwarder(LOCALE_EXTRA_LONGITUDE, true, zapit_long, toff, "", CRCInput::convertDigitToKey(shortcut++)));
|
||||||
|
|
||||||
|
setupMenu->addItem(new CMenuOptionNumberChooser(LOCALE_SATSETUP_USALS_REPEAT, (int *)&zapitCfg.repeatUsals, true, 0, 10, NULL, 0, 0, LOCALE_OPTIONS_OFF) );
|
||||||
|
}
|
||||||
|
|
||||||
|
int CScanSetup::showFrontendSetup(int number)
|
||||||
|
{
|
||||||
|
int shortcut = 1;
|
||||||
|
static int feselected = 0;
|
||||||
|
|
||||||
|
printf("[neutrino] CScanSetup::%s fe %d\n", __FUNCTION__, number);
|
||||||
|
|
||||||
|
fenumber = number;
|
||||||
|
|
||||||
|
itemsForAdvancedDiseqc.Clear();
|
||||||
|
itemsForNonAdvancedDiseqc.Clear();
|
||||||
|
itemsForAnyDiseqc.Clear();
|
||||||
|
|
||||||
|
CFrontend * fe = CFEManager::getInstance()->getFE(number);
|
||||||
|
frontend_config_t & fe_config = fe->getConfig();
|
||||||
|
dmode = fe_config.diseqcType;
|
||||||
|
|
||||||
|
char name[255];
|
||||||
|
snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_SATSETUP_FE_SETUP), number, fe->getInfo()->name);
|
||||||
|
|
||||||
|
CMenuWidget * setupMenu = new CMenuWidget(name, NEUTRINO_ICON_SETTINGS, width);
|
||||||
|
setupMenu->setSelected(feselected);
|
||||||
|
setupMenu->addIntroItems();
|
||||||
|
|
||||||
|
CMenuOptionChooser * ojDiseqc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&dmode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, allow_start, this, CRCInput::convertDigitToKey(shortcut++), "", true);
|
||||||
|
CMenuOptionNumberChooser * ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&fe_config.diseqcRepeats, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), 0, 2, NULL);
|
||||||
|
|
||||||
|
itemsForAnyDiseqc.Add(ojDiseqcRepeats);
|
||||||
|
|
||||||
|
setupMenu->addItem(ojDiseqc);
|
||||||
|
setupMenu->addItem(ojDiseqcRepeats);
|
||||||
|
|
||||||
|
CMenuWidget *satToSelect = new CMenuWidget(LOCALE_SATSETUP_SELECT_SAT, NEUTRINO_ICON_SETTINGS, width);
|
||||||
|
satToSelect->addIntroItems();
|
||||||
|
|
||||||
|
satellite_map_t & satmap = fe->getSatellites();
|
||||||
|
for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); ++sit)
|
||||||
|
{
|
||||||
|
std::string satname = CServiceManager::getInstance()->GetSatelliteName(sit->first);
|
||||||
|
satToSelect->addItem(new CMenuOptionChooser(satname.c_str(), &sit->second.configured, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
||||||
|
}
|
||||||
|
setupMenu->addItem(new CMenuForwarder(LOCALE_SATSETUP_SELECT_SAT, true, NULL, satToSelect, "", CRCInput::convertDigitToKey(shortcut++)));
|
||||||
|
|
||||||
|
fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, true, NULL, this, "satsetup", CRCInput::convertDigitToKey(shortcut++));
|
||||||
|
setupMenu->addItem(fsatSetup);
|
||||||
|
|
||||||
|
setupMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SATSETUP_EXTENDED_MOTOR));
|
||||||
|
setupMenu->addItem(new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, true, 0, 64, NULL) );
|
||||||
|
setupMenu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
||||||
|
|
||||||
|
CMenuOptionChooser * allusals = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this);
|
||||||
|
setupMenu->addItem(allusals);
|
||||||
|
|
||||||
|
setupMenu->addItem(new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, this, "satfind", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
||||||
|
|
||||||
|
int res = setupMenu->exec(NULL, "");
|
||||||
|
setupMenu->hide();
|
||||||
|
feselected = setupMenu->getSelected();
|
||||||
|
|
||||||
|
/* add configured satellites to satSelect in case they changed */
|
||||||
|
fillSatSelect();
|
||||||
|
|
||||||
|
delete setupMenu;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CScanSetup::showScanMenuLnbSetup()
|
||||||
|
{
|
||||||
|
printf("[neutrino] CScanSetup call %s fe %d\n", __FUNCTION__, fenumber);
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
int res = menu_return::RETURN_REPAINT;
|
||||||
|
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
|
||||||
|
|
||||||
|
char name[255];
|
||||||
|
snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(satprov_locale), fenumber, fe->getInfo()->name);
|
||||||
|
|
||||||
|
CMenuWidget * sat_setup = new CMenuWidget(name /*satprov_locale*/, NEUTRINO_ICON_SETTINGS, width);
|
||||||
sat_setup->addIntroItems();
|
sat_setup->addIntroItems();
|
||||||
|
|
||||||
CMenuWidget *satToSelect = new CMenuWidget(LOCALE_SATSETUP_SATELLITE, NEUTRINO_ICON_SETTINGS, width);
|
satellite_map_t & satmap = fe->getSatellites();
|
||||||
|
INFO("satmap size = %d", satmap.size());
|
||||||
|
|
||||||
for (sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++)
|
for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); ++sit)
|
||||||
{
|
{
|
||||||
/* printf("Adding sat menu for %s position %d\n", sit->second.name.c_str(), sit->first); */
|
if(!sit->second.configured)
|
||||||
satSelect->addOption(sit->second.name.c_str());
|
continue;
|
||||||
|
|
||||||
if (strcmp(scansettings.satNameNoDiseqc,sit->second.name.c_str()) == 0)
|
//std::string satname = it->second.name.c_str();
|
||||||
sfound = 1;
|
std::string satname = CServiceManager::getInstance()->GetSatelliteName(sit->first);
|
||||||
|
|
||||||
//create selectable sat item
|
|
||||||
addScanMenuSatOnOff(satToSelect);
|
|
||||||
|
|
||||||
//sub menu for sat settings to selectable sat item
|
//sub menu for sat settings to selectable sat item
|
||||||
CMenuWidget *tempsat = new CMenuWidget(sit->second.name.c_str(), NEUTRINO_ICON_SETTINGS, width);
|
CMenuWidget *tempsat = new CMenuWidget(satname.c_str(), NEUTRINO_ICON_SETTINGS, width);
|
||||||
addScanMenuTempSat(tempsat);
|
addScanMenuTempSat(tempsat, sit->second);
|
||||||
sat_setup->addItem(new CMenuForwarderNonLocalized(sit->second.name.c_str(), true, NULL, tempsat));
|
#if 0 // option not refreshed.
|
||||||
|
if(sit->second.motor_position > 0) {
|
||||||
|
char mpos[10];
|
||||||
|
sprintf(mpos, "%d", sit->second.motor_position);
|
||||||
|
sat_setup->addItem(new CMenuForwarderNonLocalized(satname.c_str(), true, mpos, tempsat));
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
sat_setup->addItem(new CMenuForwarderNonLocalized(satname.c_str(), true, NULL, tempsat));
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
if(count) {
|
||||||
|
res = sat_setup->exec(NULL, "");
|
||||||
|
sat_setup->hide();
|
||||||
|
}
|
||||||
|
delete sat_setup;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CScanSetup::fillSatSelect()
|
||||||
|
{
|
||||||
|
std::set<int> satpos;
|
||||||
|
std::set<int>::iterator tmpit;
|
||||||
|
|
||||||
|
satSelect->removeOptions();
|
||||||
|
|
||||||
|
satOnOff->resetWidget();
|
||||||
|
satOnOff->addIntroItems();
|
||||||
|
|
||||||
|
bool sfound = false;
|
||||||
|
int count = CFEManager::getInstance()->getFrontendCount();
|
||||||
|
for(int i = 0; i < count; i++) {
|
||||||
|
CFrontend * fe = CFEManager::getInstance()->getFE(i);
|
||||||
|
satellite_map_t & satmap = fe->getSatellites();
|
||||||
|
for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); ++sit) {
|
||||||
|
tmpit = satpos.find(sit->first);
|
||||||
|
if(sit->second.configured && tmpit == satpos.end()) {
|
||||||
|
std::string satname = CServiceManager::getInstance()->GetSatelliteName(sit->first);
|
||||||
|
satSelect->addOption(satname.c_str());
|
||||||
|
satpos.insert(sit->first);
|
||||||
|
|
||||||
|
if (!sfound && strcmp(scansettings.satNameNoDiseqc, satname.c_str()) == 0)
|
||||||
|
sfound = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(CFEManager::getInstance()->getMode() != CFEManager::FE_MODE_ALONE)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(!sfound && satpos.size()) {
|
||||||
|
tmpit = satpos.begin();
|
||||||
|
std::string satname = CServiceManager::getInstance()->GetSatelliteName(*tmpit);
|
||||||
|
snprintf(scansettings.satNameNoDiseqc, sizeof(scansettings.satNameNoDiseqc), "%s", satname.c_str());
|
||||||
|
}
|
||||||
|
satellite_map_t & satmap = CServiceManager::getInstance()->SatelliteList();
|
||||||
|
for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); sit++) {
|
||||||
|
if(satpos.find(sit->first) != satpos.end())
|
||||||
|
satOnOff->addItem(new CMenuOptionChooser(sit->second.name.c_str(), &sit->second.use_in_scan, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
||||||
|
else
|
||||||
|
sit->second.use_in_scan = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//init cable provider menu
|
//init cable provider menu
|
||||||
void CScanSetup::addScanMenuProvider(CMenuWidget *provider_setup)
|
void CScanSetup::fillCableSelect()
|
||||||
{
|
{
|
||||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||||
provider_setup->addIntroItems();
|
|
||||||
|
|
||||||
//don't misunderstand the name "satSelect", in this context it's actually for cable providers
|
//don't misunderstand the name "satSelect", in this context it's actually for cable providers
|
||||||
//satSelect = new CMenuOptionStringChooser(LOCALE_CABLESETUP_PROVIDER, (char*)scansettings.satNameNoDiseqc, true);
|
satellite_map_t satmap = CServiceManager::getInstance()->SatelliteList();
|
||||||
|
bool sfound = false;
|
||||||
for (sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++)
|
for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); sit++)
|
||||||
{
|
{
|
||||||
printf("Adding cable menu for %s position %d\n", sit->second.name.c_str(), sit->first);
|
printf("Adding cable menu for %s position %d\n", sit->second.name.c_str(), sit->first);
|
||||||
satSelect->addOption(sit->second.name.c_str());
|
satSelect->addOption(sit->second.name.c_str());
|
||||||
|
|
||||||
if (strcmp(scansettings.satNameNoDiseqc,sit->second.name.c_str()) == 0)
|
if (!sfound && strcmp(scansettings.satNameNoDiseqc, sit->second.name.c_str()) == 0)
|
||||||
sfound = 1;
|
sfound = true;
|
||||||
|
|
||||||
dprintf(DEBUG_DEBUG, "got scanprovider (cable): %s\n", sit->second.name.c_str());
|
dprintf(DEBUG_DEBUG, "got scanprovider (cable): %s\n", sit->second.name.c_str());
|
||||||
}
|
}
|
||||||
|
if (!sfound && satmap.size()) {
|
||||||
|
sat_iterator_t sit = satmap.begin();
|
||||||
|
snprintf(scansettings.satNameNoDiseqc, sizeof(scansettings.satNameNoDiseqc), "%s", sit->second.name.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//init sat find menu
|
int CScanSetup::showScanMenuSatFind()
|
||||||
void CScanSetup::addScanMenuSatFind(CMenuWidget *sat_findMenu)
|
|
||||||
{
|
{
|
||||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
printf("[neutrino] CScanSetup call %s fe %d\n", __FUNCTION__, fenumber);
|
||||||
|
int count = 0;
|
||||||
|
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
|
||||||
|
char name[255];
|
||||||
|
snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_MOTORCONTROL_HEAD), fenumber, fe->getInfo()->name);
|
||||||
|
|
||||||
|
CMenuWidget* sat_findMenu = new CMenuWidget(name /*LOCALE_MOTORCONTROL_HEAD*/, NEUTRINO_ICON_SETTINGS, width);
|
||||||
|
|
||||||
sat_findMenu->addIntroItems();
|
sat_findMenu->addIntroItems();
|
||||||
|
|
||||||
sat_findMenu->addItem(satSelect);
|
CMenuOptionStringChooser * feSatSelect = new CMenuOptionStringChooser(satprov_locale, scansettings.satNameNoDiseqc, true, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
|
||||||
sat_findMenu->addItem(new CMenuForwarder(LOCALE_SCANTS_SELECT_TP, true, NULL, new CTPSelectHandler()/*tpSelect*/, "test", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
satellite_map_t & satmap = fe->getSatellites();
|
||||||
|
bool sfound = false;
|
||||||
|
std::string firstname;
|
||||||
|
for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); ++sit) {
|
||||||
|
if(!sit->second.configured)
|
||||||
|
continue;
|
||||||
|
std::string satname = CServiceManager::getInstance()->GetSatelliteName(sit->first);
|
||||||
|
feSatSelect->addOption(satname.c_str());
|
||||||
|
if (!sfound && strcmp(scansettings.satNameNoDiseqc, satname.c_str()) == 0)
|
||||||
|
sfound = true;
|
||||||
|
if (!sfound && !firstname.size())
|
||||||
|
firstname = satname;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if(count && !sfound)
|
||||||
|
snprintf(scansettings.satNameNoDiseqc, sizeof(scansettings.satNameNoDiseqc), "%s", firstname.c_str());
|
||||||
|
|
||||||
|
sat_findMenu->addItem(feSatSelect);
|
||||||
|
|
||||||
|
sat_findMenu->addItem(new CMenuForwarder(LOCALE_SCANTS_SELECT_TP, true, NULL, new CTPSelectHandler()/*tpSelect*/, "test", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
||||||
sat_findMenu->addItem(GenericMenuSeparatorLine);
|
sat_findMenu->addItem(GenericMenuSeparatorLine);
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
addScanOptionsItems(sat_findMenu);
|
addScanOptionsItems(sat_findMenu);
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
sat_findMenu->addItem(GenericMenuSeparatorLine);
|
sat_findMenu->addItem(GenericMenuSeparatorLine);
|
||||||
|
sat_findMenu->addItem(new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, allow_start, NULL, new CMotorControl(fenumber), "", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
|
||||||
|
|
||||||
sat_findMenu->addItem(new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, new CMotorControl(), "", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
|
int res = sat_findMenu->exec(NULL, "");
|
||||||
|
sat_findMenu->hide();
|
||||||
if (!sfound && satellitePositions.size()) {
|
delete sat_findMenu;
|
||||||
sit = satellitePositions.begin();
|
return res;
|
||||||
snprintf(scansettings.satNameNoDiseqc, sizeof(scansettings.satNameNoDiseqc), "%s", sit->second.name.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//init sat on off menu
|
|
||||||
void CScanSetup::addScanMenuSatOnOff(CMenuWidget *sat_OnOff)
|
|
||||||
{
|
|
||||||
sat_OnOff->addIntroItems();
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
sat_OnOff->addItem(new CMenuOptionChooser(sit->second.name.c_str(), &sit->second.use_in_scan, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//init tempsat menu
|
//init tempsat menu
|
||||||
void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat)
|
void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satconfig)
|
||||||
{
|
{
|
||||||
temp_sat->addIntroItems();
|
temp_sat->addIntroItems();
|
||||||
|
|
||||||
CMenuOptionNumberChooser *diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &sit->second.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
CMenuOptionNumberChooser *diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||||
CMenuOptionNumberChooser *comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &sit->second.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
CMenuOptionNumberChooser *comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||||
CMenuOptionNumberChooser *uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &sit->second.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
CMenuOptionNumberChooser *uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||||
//CMenuOptionNumberChooser *motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &sit->second.motor_position, dmode == DISEQC_ADVANCED, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF);
|
CMenuOptionNumberChooser *motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF);
|
||||||
CMenuOptionNumberChooser *motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &sit->second.motor_position, true, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF);
|
CMenuOptionChooser *usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/);
|
||||||
//CMenuOptionChooser *usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &sit->second.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, dmode == DISEQC_ADVANCED);
|
|
||||||
CMenuOptionChooser *usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &sit->second.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
|
|
||||||
|
|
||||||
if(!sit->second.use_usals)
|
if(!satconfig.use_usals)
|
||||||
all_usals = 0;
|
all_usals = 0;
|
||||||
|
|
||||||
satNotify->addItem(1, diseqc);
|
itemsForAnyDiseqc.Add(diseqc);
|
||||||
satNotify->addItem(0, comm);
|
itemsForAdvancedDiseqc.Add(comm);
|
||||||
satNotify->addItem(0, uncomm);
|
itemsForAdvancedDiseqc.Add(uncomm);
|
||||||
//satNotify->addItem(0, motor); //FIXME testing motor with not DISEQC_ADVANCED
|
|
||||||
//satNotify->addItem(0, usals);
|
|
||||||
|
|
||||||
CIntInput* lofL = new CIntInput(LOCALE_SATSETUP_LOFL, (int&) sit->second.lnbOffsetLow, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
|
//FIXME testing motor without DISEQC_ADVANCED
|
||||||
CIntInput* lofH = new CIntInput(LOCALE_SATSETUP_LOFH, (int&) sit->second.lnbOffsetHigh, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
|
//itemsForAdvancedDiseqc.Add(motor);
|
||||||
CIntInput* lofS = new CIntInput(LOCALE_SATSETUP_LOFS, (int&) sit->second.lnbSwitch, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
|
//itemsForAdvancedDiseqc.Add(usals);
|
||||||
|
|
||||||
|
CIntInput* lofL = new CIntInput(LOCALE_SATSETUP_LOFL, (int&) satconfig.lnbOffsetLow, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
|
||||||
|
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(diseqc);
|
||||||
temp_sat->addItem(comm);
|
temp_sat->addItem(comm);
|
||||||
@@ -575,45 +729,6 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat)
|
|||||||
temp_sat->addItem(new CMenuForwarder(LOCALE_SATSETUP_LOFS, true, lofS->getValue(), lofS));
|
temp_sat->addItem(new CMenuForwarder(LOCALE_SATSETUP_LOFS, true, lofS->getValue(), lofS));
|
||||||
}
|
}
|
||||||
|
|
||||||
//init motor settings
|
|
||||||
void CScanSetup::addScanMenuMotorMenu(CMenuWidget *motor_Menu)
|
|
||||||
{
|
|
||||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
|
||||||
motor_Menu->addIntroItems();
|
|
||||||
|
|
||||||
CMenuWidget* satfindMenu = new CMenuWidget(LOCALE_MOTORCONTROL_HEAD, NEUTRINO_ICON_SETTINGS, width);
|
|
||||||
addScanMenuSatFind(satfindMenu);
|
|
||||||
motor_Menu->addItem(new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, satfindMenu, "", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
motor_Menu->addItem(GenericMenuSeparatorLine);
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
|
|
||||||
motor_Menu->addItem(new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&zapitCfg.motorRotationSpeed, true, 0, 64, NULL) );
|
|
||||||
motor_Menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&zapitCfg.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
|
||||||
//motor_Menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, (int *)&zapitCfg.useGotoXX, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
|
||||||
|
|
||||||
CStringInput *toff = NULL;
|
|
||||||
sprintf(zapit_lat, "%02.6f", zapitCfg.gotoXXLatitude);
|
|
||||||
sprintf(zapit_long, "%02.6f", zapitCfg.gotoXXLongitude);
|
|
||||||
|
|
||||||
motor_Menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_LADIRECTION, (int *)&zapitCfg.gotoXXLaDirection, OPTIONS_SOUTH0_NORTH1_OPTIONS, OPTIONS_SOUTH0_NORTH1_OPTION_COUNT, true));
|
|
||||||
|
|
||||||
toff = new CStringInput(LOCALE_EXTRA_LATITUDE, (char *) zapit_lat, 10, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789.");
|
|
||||||
motor_Menu->addItem(new CMenuForwarder(LOCALE_EXTRA_LATITUDE, true, zapit_lat, toff));
|
|
||||||
|
|
||||||
motor_Menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_LODIRECTION, (int *)&zapitCfg.gotoXXLoDirection, OPTIONS_EAST0_WEST1_OPTIONS, OPTIONS_EAST0_WEST1_OPTION_COUNT, true));
|
|
||||||
|
|
||||||
toff = new CStringInput(LOCALE_EXTRA_LONGITUDE, (char *) zapit_long, 10, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789.");
|
|
||||||
motor_Menu->addItem(new CMenuForwarder(LOCALE_EXTRA_LONGITUDE, true, zapit_long, toff));
|
|
||||||
|
|
||||||
motor_Menu->addItem(new CMenuOptionNumberChooser(LOCALE_SATSETUP_USALS_REPEAT, (int *)&zapitCfg.repeatUsals, true, 0, 10, NULL, 0, 0, LOCALE_OPTIONS_OFF) );
|
|
||||||
|
|
||||||
CMenuOptionChooser * allusals = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, usalsNotify);
|
|
||||||
motor_Menu->addItem(allusals);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//init manual scan menu
|
//init manual scan menu
|
||||||
void CScanSetup::addScanMenuManualScan(CMenuWidget *manual_Scan)
|
void CScanSetup::addScanMenuManualScan(CMenuWidget *manual_Scan)
|
||||||
{
|
{
|
||||||
@@ -642,22 +757,7 @@ void CScanSetup::addScanMenuAutoScanAll(CMenuWidget *auto_ScanAll)
|
|||||||
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
printf("[neutrino] CScanSetup call %s...\n", __FUNCTION__);
|
||||||
auto_ScanAll->addIntroItems();
|
auto_ScanAll->addIntroItems();
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
CMenuWidget* satInUse = new CMenuWidget(satprov_locale, NEUTRINO_ICON_SETTINGS, width);
|
auto_ScanAll->addItem(new CMenuForwarder(satprov_locale, true, NULL, satOnOff, "", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
||||||
satInUse->addIntroItems();
|
|
||||||
|
|
||||||
//ensure, that we have no double options in satlist
|
|
||||||
satSelect->removeOptions();
|
|
||||||
|
|
||||||
for (sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++)
|
|
||||||
{
|
|
||||||
satSelect->addOption(sit->second.name.c_str());
|
|
||||||
if (strcmp(scansettings.satNameNoDiseqc,sit->second.name.c_str()) == 0)
|
|
||||||
sfound = 1;
|
|
||||||
|
|
||||||
satInUse->addItem(new CMenuOptionChooser(sit->second.name.c_str(), &sit->second.use_in_scan, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto_ScanAll->addItem(new CMenuForwarder(satprov_locale, true, NULL, satInUse, "", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
|
||||||
|
|
||||||
auto_ScanAll->addItem(GenericMenuSeparatorLine);
|
auto_ScanAll->addItem(GenericMenuSeparatorLine);
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@@ -668,6 +768,22 @@ void CScanSetup::addScanMenuAutoScanAll(CMenuWidget *auto_ScanAll)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_FASTSCAN
|
#ifdef ENABLE_FASTSCAN
|
||||||
|
#define FAST_SCAN_OPTIONS_COUNT 2
|
||||||
|
const CMenuOptionChooser::keyval FAST_SCAN_OPTIONS[FAST_SCAN_OPTIONS_COUNT] =
|
||||||
|
{
|
||||||
|
{ FAST_SCAN_SD, LOCALE_SATSETUP_FASTSCAN_SD },
|
||||||
|
{ FAST_SCAN_HD, LOCALE_SATSETUP_FASTSCAN_HD }
|
||||||
|
/*{ FAST_SCAN_ALL, LOCALE_SATSETUP_FASTSCAN_ALL }*/
|
||||||
|
};
|
||||||
|
|
||||||
|
#define FAST_SCAN_PROV_OPTIONS_COUNT 3
|
||||||
|
const CMenuOptionChooser::keyval FAST_SCAN_PROV_OPTIONS[FAST_SCAN_PROV_OPTIONS_COUNT] =
|
||||||
|
{
|
||||||
|
{ OPERATOR_CD, LOCALE_SATSETUP_FASTSCAN_PROV_CD },
|
||||||
|
{ OPERATOR_TVV, LOCALE_SATSETUP_FASTSCAN_PROV_TVV },
|
||||||
|
{ OPERATOR_TELESAT, LOCALE_SATSETUP_FASTSCAN_PROV_TELESAT }
|
||||||
|
};
|
||||||
|
|
||||||
//init fast scan menu
|
//init fast scan menu
|
||||||
void CScanSetup::addScanMenuFastScan(CMenuWidget *fast_ScanMenu)
|
void CScanSetup::addScanMenuFastScan(CMenuWidget *fast_ScanMenu)
|
||||||
{
|
{
|
||||||
@@ -699,7 +815,6 @@ void CScanSetup::addScanMenuAutoScan(CMenuWidget *auto_Scan)
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
auto_Scan->addItem(GenericMenuSeparatorLine);
|
auto_Scan->addItem(GenericMenuSeparatorLine);
|
||||||
auto_Scan->addItem(new CMenuForwarder(LOCALE_SCANTS_STARTNOW, allow_start, NULL, this, "auto", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
auto_Scan->addItem(new CMenuForwarder(LOCALE_SCANTS_STARTNOW, allow_start, NULL, this, "auto", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//create scan options items
|
//create scan options items
|
||||||
@@ -766,9 +881,84 @@ void CScanSetup::saveScanSetup()
|
|||||||
zapitCfg.gotoXXLongitude = strtod(zapit_long, NULL);
|
zapitCfg.gotoXXLongitude = strtod(zapit_long, NULL);
|
||||||
|
|
||||||
CZapit::getInstance()->SetConfig(&zapitCfg);
|
CZapit::getInstance()->SetConfig(&zapitCfg);
|
||||||
|
CFEManager::getInstance()->saveSettings(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*/)
|
||||||
|
{
|
||||||
|
if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_USE_USALS)) {
|
||||||
|
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
|
||||||
|
printf("[neutrino] CScanSetup::%s: all usals %d \n", __FUNCTION__, all_usals);
|
||||||
|
satellite_map_t & satmap = fe->getSatellites();
|
||||||
|
for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); sit++) {
|
||||||
|
sit->second.use_usals = all_usals;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_DISEQC)) {
|
||||||
|
printf("[neutrino] CScanSetup::%s: diseqc %d \n", __FUNCTION__, dmode);
|
||||||
|
//FIXME 2 frontends ??
|
||||||
|
fautoScanAll->setActive(dmode != NO_DISEQC);
|
||||||
|
if(dmode == NO_DISEQC) {
|
||||||
|
itemsForAdvancedDiseqc.Activate(false);
|
||||||
|
itemsForNonAdvancedDiseqc.Activate(false);
|
||||||
|
itemsForAnyDiseqc.Activate(false);
|
||||||
|
}
|
||||||
|
else if(dmode < DISEQC_ADVANCED) {
|
||||||
|
itemsForAdvancedDiseqc.Activate(false);
|
||||||
|
itemsForNonAdvancedDiseqc.Activate(true);
|
||||||
|
itemsForAnyDiseqc.Activate(true);
|
||||||
|
}
|
||||||
|
else if(dmode == DISEQC_ADVANCED) {
|
||||||
|
itemsForAdvancedDiseqc.Activate(true);
|
||||||
|
itemsForNonAdvancedDiseqc.Activate(false);
|
||||||
|
itemsForAnyDiseqc.Activate(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);
|
||||||
|
CFEManager::getInstance()->setMode((CFEManager::fe_mode_t) femode);
|
||||||
|
/* to copy settings from fe0 */
|
||||||
|
if(femode != CFEManager::FE_MODE_ALONE)
|
||||||
|
CFEManager::getInstance()->saveSettings(true);
|
||||||
|
fillSatSelect();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CScanSetup::updateManualSettings()
|
||||||
|
{
|
||||||
|
CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel();
|
||||||
|
if(channel) {
|
||||||
|
strncpy(scansettings.satNameNoDiseqc,
|
||||||
|
CServiceManager::getInstance()->GetSatelliteName(channel->getSatellitePosition()).c_str(), 50);
|
||||||
|
transponder_list_t::iterator tI;
|
||||||
|
tI = transponders.find(channel->getTransponderId());
|
||||||
|
if(tI != transponders.end()) {
|
||||||
|
sprintf(scansettings.TP_freq, "%d", tI->second.feparams.frequency);
|
||||||
|
CFrontend * frontend = CFEManager::getInstance()->getLiveFE();
|
||||||
|
switch (frontend->getInfo()->type) {
|
||||||
|
case FE_QPSK:
|
||||||
|
sprintf(scansettings.TP_rate, "%d", tI->second.feparams.u.qpsk.symbol_rate);
|
||||||
|
scansettings.TP_fec = tI->second.feparams.u.qpsk.fec_inner;
|
||||||
|
scansettings.TP_pol = tI->second.polarization;
|
||||||
|
break;
|
||||||
|
case FE_QAM:
|
||||||
|
sprintf(scansettings.TP_rate, "%d", tI->second.feparams.u.qam.symbol_rate);
|
||||||
|
scansettings.TP_fec = tI->second.feparams.u.qam.fec_inner;
|
||||||
|
scansettings.TP_mod = tI->second.feparams.u.qam.modulation;
|
||||||
|
break;
|
||||||
|
case FE_OFDM:
|
||||||
|
case FE_ATSC:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/)
|
int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/)
|
||||||
{
|
{
|
||||||
@@ -782,17 +972,12 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/
|
|||||||
static int old_selected = 0;
|
static int old_selected = 0;
|
||||||
static t_satellite_position old_position = 0;
|
static t_satellite_position old_position = 0;
|
||||||
|
|
||||||
|
int width = w_max (40, 10);
|
||||||
|
|
||||||
if (parent)
|
if (parent)
|
||||||
parent->hide();
|
parent->hide();
|
||||||
|
|
||||||
for (sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++)
|
position = CServiceManager::getInstance()->GetSatellitePosition(scansettings.satNameNoDiseqc);
|
||||||
{
|
|
||||||
if (!strcmp(sit->second.name.c_str(), scansettings.satNameNoDiseqc))
|
|
||||||
{
|
|
||||||
position = sit->first;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (old_position != position)
|
if (old_position != position)
|
||||||
{
|
{
|
||||||
@@ -804,8 +989,9 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/
|
|||||||
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
|
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
|
||||||
menu.addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); //add cancel button, ensures that we have enought space left from item caption
|
menu.addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); //add cancel button, ensures that we have enought space left from item caption
|
||||||
|
|
||||||
|
CFrontend * frontend = CFEManager::getInstance()->getLiveFE();
|
||||||
i = 0;
|
i = 0;
|
||||||
for (tI = select_transponders.begin(); tI != select_transponders.end(); tI++)
|
for (tI = select_transponders.begin(); tI != select_transponders.end(); ++tI)
|
||||||
{
|
{
|
||||||
t_satellite_position satpos = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xFFF;
|
t_satellite_position satpos = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xFFF;
|
||||||
if (GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
if (GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
||||||
@@ -816,14 +1002,14 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/
|
|||||||
char buf[128];
|
char buf[128];
|
||||||
sprintf(cnt, "%d", i);
|
sprintf(cnt, "%d", i);
|
||||||
char * f, *s, *m;
|
char * f, *s, *m;
|
||||||
switch (CFrontend::getInstance()->getInfo()->type)
|
switch (frontend->getInfo()->type)
|
||||||
{
|
{
|
||||||
case FE_QPSK:
|
case FE_QPSK:
|
||||||
CFrontend::getInstance()->getDelSys(tI->second.feparams.u.qpsk.fec_inner, dvbs_get_modulation(tI->second.feparams.u.qpsk.fec_inner), f, s, m);
|
frontend->getDelSys(tI->second.feparams.u.qpsk.fec_inner, dvbs_get_modulation(tI->second.feparams.u.qpsk.fec_inner), f, s, m);
|
||||||
snprintf(buf, sizeof(buf), "%d %c %d %s %s %s ", tI->second.feparams.frequency/1000, tI->second.polarization ? 'V' : 'H', tI->second.feparams.u.qpsk.symbol_rate/1000, f, s, m);
|
snprintf(buf, sizeof(buf), "%d %c %d %s %s %s ", tI->second.feparams.frequency/1000, tI->second.polarization ? 'V' : 'H', tI->second.feparams.u.qpsk.symbol_rate/1000, f, s, m);
|
||||||
break;
|
break;
|
||||||
case FE_QAM:
|
case FE_QAM:
|
||||||
CFrontend::getInstance()->getDelSys(tI->second.feparams.u.qam.fec_inner, tI->second.feparams.u.qam.modulation, f, s, m);
|
frontend->getDelSys(tI->second.feparams.u.qam.fec_inner, tI->second.feparams.u.qam.modulation, f, s, m);
|
||||||
snprintf(buf, sizeof(buf), "%d %d %s %s %s ", tI->second.feparams.frequency/1000, tI->second.feparams.u.qam.symbol_rate/1000, f, s, m);
|
snprintf(buf, sizeof(buf), "%d %d %s %s %s ", tI->second.feparams.frequency/1000, tI->second.feparams.u.qam.symbol_rate/1000, f, s, m);
|
||||||
break;
|
break;
|
||||||
case FE_OFDM:
|
case FE_OFDM:
|
||||||
@@ -871,7 +1057,7 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/
|
|||||||
|
|
||||||
sprintf(scansettings.TP_freq, "%d", tmpI->second.feparams.frequency);
|
sprintf(scansettings.TP_freq, "%d", tmpI->second.feparams.frequency);
|
||||||
|
|
||||||
switch (CFrontend::getInstance()->getInfo()->type)
|
switch (frontend->getInfo()->type)
|
||||||
{
|
{
|
||||||
case FE_QPSK:
|
case FE_QPSK:
|
||||||
sprintf(scansettings.TP_rate, "%d", tmpI->second.feparams.u.qpsk.symbol_rate);
|
sprintf(scansettings.TP_rate, "%d", tmpI->second.feparams.u.qpsk.symbol_rate);
|
||||||
@@ -895,4 +1081,3 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/
|
|||||||
|
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#include <system/setting_helpers.h>
|
#include <system/setting_helpers.h>
|
||||||
#include <system/settings.h>
|
#include <system/settings.h>
|
||||||
|
#include <zapit/satconfig.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -43,26 +43,41 @@
|
|||||||
|
|
||||||
#define ENABLE_FASTSCAN //don't define this to remove fast scan menu
|
#define ENABLE_FASTSCAN //don't define this to remove fast scan menu
|
||||||
|
|
||||||
class CScanSetup : public CMenuTarget
|
class CScanSetup : public CMenuTarget, public CChangeObserver
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
int width;
|
int width;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CSatelliteSetupNotifier *satNotify;
|
|
||||||
CAllUsalsNotifier *usalsNotify;
|
|
||||||
|
|
||||||
CMenuOptionStringChooser *satSelect;
|
CMenuOptionStringChooser *satSelect;
|
||||||
|
CMenuWidget *satOnOff;
|
||||||
|
|
||||||
|
/* global items to be enabled/disabled in notify */
|
||||||
|
CMenuForwarder *fautoScanAll;
|
||||||
|
CMenuForwarder *frontendSetup;
|
||||||
|
CMenuForwarder *fsatSetup;
|
||||||
|
|
||||||
|
/* dynamic frontend items to be enabled/disabled in notify */
|
||||||
|
CGenericMenuActivate itemsForAdvancedDiseqc;
|
||||||
|
CGenericMenuActivate itemsForNonAdvancedDiseqc;
|
||||||
|
CGenericMenuActivate itemsForAnyDiseqc;
|
||||||
|
|
||||||
|
/* variables for selected frontend */
|
||||||
|
/* diseqc mode */
|
||||||
|
int dmode;
|
||||||
|
int fenumber;
|
||||||
|
|
||||||
|
/* flag to allow any operations which can damage recordings */
|
||||||
|
bool allow_start;
|
||||||
|
|
||||||
bool is_wizard;
|
bool is_wizard;
|
||||||
|
|
||||||
int selected;
|
int selected;
|
||||||
int dmode;
|
int fselected;
|
||||||
int sfound;
|
|
||||||
int fec_count;
|
int fec_count;
|
||||||
int freq_length;
|
int freq_length;
|
||||||
int r_system;
|
int r_system;
|
||||||
bool allow_start;
|
int femode;
|
||||||
|
|
||||||
neutrino_locale_t satprov_locale;
|
neutrino_locale_t satprov_locale;
|
||||||
|
|
||||||
@@ -70,12 +85,14 @@ class CScanSetup : public CMenuTarget
|
|||||||
|
|
||||||
int showScanMenu();
|
int showScanMenu();
|
||||||
|
|
||||||
void addScanMenuLnbSetup(CMenuWidget *sat_setup);
|
int showFrontendSetup(int number);
|
||||||
void addScanMenuProvider(CMenuWidget *provider_setup);
|
int showScanMenuLnbSetup();
|
||||||
void addScanMenuSatFind(CMenuWidget *sat_findMenu);
|
int showScanMenuSatFind();
|
||||||
void addScanMenuSatOnOff(CMenuWidget *sat_OnOff);
|
void fillSatSelect();
|
||||||
void addScanMenuTempSat(CMenuWidget *temp_sat);
|
void fillCableSelect();
|
||||||
void addScanMenuMotorMenu(CMenuWidget *motor_Menu);
|
|
||||||
|
void addScanMenuFrontendSetup(CMenuWidget *settings);
|
||||||
|
void addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t &satconfig);
|
||||||
void addScanMenuManualScan(CMenuWidget *manual_Scan);
|
void addScanMenuManualScan(CMenuWidget *manual_Scan);
|
||||||
void addScanMenuAutoScanAll(CMenuWidget *auto_ScanAll);
|
void addScanMenuAutoScanAll(CMenuWidget *auto_ScanAll);
|
||||||
#ifdef ENABLE_FASTSCAN
|
#ifdef ENABLE_FASTSCAN
|
||||||
@@ -88,6 +105,7 @@ class CScanSetup : public CMenuTarget
|
|||||||
|
|
||||||
void saveScanSetup();
|
void saveScanSetup();
|
||||||
|
|
||||||
|
CScanSetup(bool wizard_mode = SCAN_SETUP_MODE_WIZARD_NO);
|
||||||
public:
|
public:
|
||||||
enum SCAN_SETUP_MODE
|
enum SCAN_SETUP_MODE
|
||||||
{
|
{
|
||||||
@@ -95,18 +113,19 @@ class CScanSetup : public CMenuTarget
|
|||||||
SCAN_SETUP_MODE_WIZARD = 1
|
SCAN_SETUP_MODE_WIZARD = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
CScanSetup(bool wizard_mode = SCAN_SETUP_MODE_WIZARD_NO);
|
|
||||||
~CScanSetup();
|
~CScanSetup();
|
||||||
|
|
||||||
static CScanSetup* getInstance();
|
static CScanSetup* getInstance();
|
||||||
|
|
||||||
bool getWizardMode() {return is_wizard;};
|
bool getWizardMode() {return is_wizard;};
|
||||||
void setWizardMode(bool mode);
|
void setWizardMode(bool mode);
|
||||||
|
void updateManualSettings();
|
||||||
|
|
||||||
int exec(CMenuTarget* parent, const std::string & actionKey = "");
|
int exec(CMenuTarget* parent, const std::string & actionKey = "");
|
||||||
|
bool changeNotify(const neutrino_locale_t OptionName, void * /*data*/);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CTPSelectHandler : public CScanSetup
|
class CTPSelectHandler : public CMenuTarget //CScanSetup
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int exec(CMenuTarget* parent, const std::string &actionkey);
|
int exec(CMenuTarget* parent, const std::string &actionkey);
|
||||||
|
Reference in New Issue
Block a user