mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
jump to next/prev transponder with up/down rc in test signal mode
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@747 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
100
src/gui/scan.cpp
100
src/gui/scan.cpp
@@ -64,7 +64,6 @@ extern CFrontend * frontend;
|
|||||||
#define NEUTRINO_SCAN_START_SCRIPT CONFIGDIR "/scan.start"
|
#define NEUTRINO_SCAN_START_SCRIPT CONFIGDIR "/scan.start"
|
||||||
#define NEUTRINO_SCAN_STOP_SCRIPT CONFIGDIR "/scan.stop"
|
#define NEUTRINO_SCAN_STOP_SCRIPT CONFIGDIR "/scan.stop"
|
||||||
#define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf"
|
#define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf"
|
||||||
TP_params TP;
|
|
||||||
|
|
||||||
#define BAR_BORDER 2
|
#define BAR_BORDER 2
|
||||||
#define BAR_WIDTH 150
|
#define BAR_WIDTH 150
|
||||||
@@ -84,7 +83,81 @@ CScanTs::CScanTs()
|
|||||||
extern int scan_pids;
|
extern int scan_pids;
|
||||||
extern int scan_fta_flag;//in zapit descriptors definiert
|
extern int scan_fta_flag;//in zapit descriptors definiert
|
||||||
extern int start_fast_scan(int scan_mode, int opid);
|
extern int start_fast_scan(int scan_mode, int opid);
|
||||||
|
#include <zapit/getservices.h>
|
||||||
|
|
||||||
|
void CScanTs::prev_next_TP( bool up)
|
||||||
|
{
|
||||||
|
t_satellite_position position = 0;
|
||||||
|
|
||||||
|
for (sat_iterator_t sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++) {
|
||||||
|
if (!strcmp(sit->second.name.c_str(), CNeutrinoApp::getInstance()->getScanSettings().satNameNoDiseqc)) {
|
||||||
|
position = sit->first;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extern std::map<transponder_id_t, transponder> select_transponders;
|
||||||
|
transponder_list_t::iterator tI;
|
||||||
|
bool next_tp = false;
|
||||||
|
|
||||||
|
if(up){
|
||||||
|
for (tI = select_transponders.begin(); tI != select_transponders.end(); tI++) {
|
||||||
|
t_satellite_position satpos = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xFFF;
|
||||||
|
if (GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
||||||
|
satpos = -satpos;
|
||||||
|
if (satpos != position)
|
||||||
|
continue;
|
||||||
|
if(tI->second.feparams.frequency > TP.feparams.frequency){
|
||||||
|
next_tp = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
for ( tI=select_transponders.end() ; tI != select_transponders.begin(); tI-- ){
|
||||||
|
t_satellite_position satpos = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xFFF;
|
||||||
|
if (GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
||||||
|
satpos = -satpos;
|
||||||
|
if (satpos != position)
|
||||||
|
continue;
|
||||||
|
if(tI->second.feparams.frequency < TP.feparams.frequency){
|
||||||
|
next_tp = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(next_tp){
|
||||||
|
TP.feparams.frequency = tI->second.feparams.frequency;
|
||||||
|
if(g_info.delivery_system == DVB_S) {
|
||||||
|
TP.feparams.u.qpsk.symbol_rate = tI->second.feparams.u.qpsk.symbol_rate;
|
||||||
|
TP.feparams.u.qpsk.fec_inner = tI->second.feparams.u.qpsk.fec_inner;
|
||||||
|
TP.polarization = tI->second.polarization;
|
||||||
|
} else {
|
||||||
|
TP.feparams.u.qam.symbol_rate = tI->second.feparams.u.qam.symbol_rate;
|
||||||
|
TP.feparams.u.qam.fec_inner = tI->second.feparams.u.qam.fec_inner;
|
||||||
|
TP.feparams.u.qam.modulation = tI->second.feparams.u.qam.modulation;
|
||||||
|
}
|
||||||
|
testFunc();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CScanTs::testFunc()
|
||||||
|
{
|
||||||
|
int w = x + width - xpos2;
|
||||||
|
char buffer[128];
|
||||||
|
char * f, *s, *m;
|
||||||
|
if(frontend->getInfo()->type == FE_QPSK) {
|
||||||
|
frontend->getDelSys(TP.feparams.u.qpsk.fec_inner, dvbs_get_modulation((fe_code_rate_t)TP.feparams.u.qpsk.fec_inner), f, s, m);
|
||||||
|
snprintf(buffer,sizeof(buffer), "%u %c %d %s %s %s", TP.feparams.frequency/1000, TP.polarization == 0 ? 'H' : 'V', TP.feparams.u.qpsk.symbol_rate/1000, f, s, m);
|
||||||
|
} else if(frontend->getInfo()->type == FE_QAM) {
|
||||||
|
frontend->getDelSys(get_set.TP_fec, get_set.TP_mod, f, s, m);
|
||||||
|
snprintf(buffer,sizeof(buffer), "%u %d %s %s %s", atoi(get_set.TP_freq)/1000, atoi(get_set.TP_rate)/1000, f, s, m);
|
||||||
|
}
|
||||||
|
paintLine(xpos2, ypos_cur_satellite, w - 95, get_set.satNameNoDiseqc);
|
||||||
|
paintLine(xpos2, ypos_frequency, w, buffer);
|
||||||
|
success = g_Zapit->tune_TP(TP);
|
||||||
|
|
||||||
|
}
|
||||||
int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
||||||
{
|
{
|
||||||
diseqc_t diseqcType = NO_DISEQC;
|
diseqc_t diseqcType = NO_DISEQC;
|
||||||
@@ -197,19 +270,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
|||||||
paint(test);
|
paint(test);
|
||||||
/* go */
|
/* go */
|
||||||
if(test) {
|
if(test) {
|
||||||
int w = x + width - xpos2;
|
testFunc();
|
||||||
char buffer[128];
|
|
||||||
char * f, *s, *m;
|
|
||||||
if(frontend->getInfo()->type == FE_QPSK) {
|
|
||||||
frontend->getDelSys(get_set.TP_fec, dvbs_get_modulation((fe_code_rate_t)get_set.TP_fec), f, s, m);
|
|
||||||
snprintf(buffer,sizeof(buffer), "%u %c %d %s %s %s", atoi(get_set.TP_freq)/1000, get_set.TP_pol == 0 ? 'H' : 'V', atoi(get_set.TP_rate)/1000, f, s, m);
|
|
||||||
} else if(frontend->getInfo()->type == FE_QAM) {
|
|
||||||
frontend->getDelSys(get_set.TP_fec, get_set.TP_mod, f, s, m);
|
|
||||||
snprintf(buffer,sizeof(buffer), "%u %d %s %s %s", atoi(get_set.TP_freq)/1000, atoi(get_set.TP_rate)/1000, f, s, m);
|
|
||||||
}
|
|
||||||
paintLine(xpos2, ypos_cur_satellite, w - 95, get_set.satNameNoDiseqc);
|
|
||||||
paintLine(xpos2, ypos_frequency, w, buffer);
|
|
||||||
success = g_Zapit->tune_TP(TP);
|
|
||||||
} else if(manual)
|
} else if(manual)
|
||||||
success = g_Zapit->scan_TP(TP);
|
success = g_Zapit->scan_TP(TP);
|
||||||
else if(fast) {
|
else if(fast) {
|
||||||
@@ -227,10 +288,19 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd);
|
g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd);
|
||||||
if (test && (msg <= CRCInput::RC_MaxRC)) {
|
if (test && (msg == CRCInput::RC_down)) {
|
||||||
|
prev_next_TP(false);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (test && (msg == CRCInput::RC_up)) {
|
||||||
|
prev_next_TP(true);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (test && (msg <= CRCInput::RC_MaxRC)) {
|
||||||
istheend = true;
|
istheend = true;
|
||||||
msg = CRCInput::RC_timeout;
|
msg = CRCInput::RC_timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(msg == CRCInput::RC_home) {
|
else if(msg == CRCInput::RC_home) {
|
||||||
if(manual && get_set.scan_mode)
|
if(manual && get_set.scan_mode)
|
||||||
continue;
|
continue;
|
||||||
|
@@ -77,6 +77,9 @@ class CScanTs : public CMenuTarget
|
|||||||
int greater_xpos(int xpos, const neutrino_locale_t txt);
|
int greater_xpos(int xpos, const neutrino_locale_t txt);
|
||||||
bool freqready;
|
bool freqready;
|
||||||
void showSNR();
|
void showSNR();
|
||||||
|
void testFunc();
|
||||||
|
void prev_next_TP(bool);
|
||||||
|
TP_params TP;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CScanTs();
|
CScanTs();
|
||||||
|
Reference in New Issue
Block a user