mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
replace GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID with cached satellitePosition
Origin commit data
------------------
Commit: b69cb1019c
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-04-10 (Tue, 10 Apr 2012)
This commit is contained in:
@@ -95,11 +95,8 @@ void CScanTs::prev_next_TP( bool up)
|
|||||||
bool next_tp = false;
|
bool next_tp = false;
|
||||||
|
|
||||||
if(up) {
|
if(up) {
|
||||||
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;
|
if (tI->second.satellitePosition != position)
|
||||||
if (GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
|
||||||
satpos = -satpos;
|
|
||||||
if (satpos != position)
|
|
||||||
continue;
|
continue;
|
||||||
if(tI->second.feparams.frequency > TP.feparams.frequency){
|
if(tI->second.feparams.frequency > TP.feparams.frequency){
|
||||||
next_tp = true;
|
next_tp = true;
|
||||||
@@ -107,11 +104,8 @@ void CScanTs::prev_next_TP( bool up)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for ( tI=select_transponders.end() ; tI != select_transponders.begin(); tI-- ) {
|
for ( tI=select_transponders.end() ; tI != select_transponders.begin(); --tI ) {
|
||||||
t_satellite_position satpos = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xFFF;
|
if (tI->second.satellitePosition != position)
|
||||||
if (GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
|
||||||
satpos = -satpos;
|
|
||||||
if (satpos != position)
|
|
||||||
continue;
|
continue;
|
||||||
if(tI->second.feparams.frequency < TP.feparams.frequency) {
|
if(tI->second.feparams.frequency < TP.feparams.frequency) {
|
||||||
next_tp = true;
|
next_tp = true;
|
||||||
@@ -248,7 +242,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
|||||||
satList.push_back(sat);
|
satList.push_back(sat);
|
||||||
} else {
|
} else {
|
||||||
satellite_map_t & satmap = CServiceManager::getInstance()->SatelliteList();
|
satellite_map_t & satmap = CServiceManager::getInstance()->SatelliteList();
|
||||||
for(sit = satmap.begin(); sit != satmap.end(); sit++) {
|
for(sit = satmap.begin(); sit != satmap.end(); ++sit) {
|
||||||
if(sit->second.use_in_scan) {
|
if(sit->second.use_in_scan) {
|
||||||
sat.position = sit->first;
|
sat.position = sit->first;
|
||||||
strncpy(sat.satName, sit->second.name.c_str(), 50);
|
strncpy(sat.satName, sit->second.name.c_str(), 50);
|
||||||
@@ -301,11 +295,11 @@ 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_down)) {
|
if (test && (msg == CRCInput::RC_down || msg == CRCInput::RC_left)) {
|
||||||
prev_next_TP(false);
|
prev_next_TP(false);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (test && (msg == CRCInput::RC_up)) {
|
else if (test && (msg == CRCInput::RC_up || msg == CRCInput::RC_right)) {
|
||||||
prev_next_TP(true);
|
prev_next_TP(true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -1011,10 +1011,7 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/
|
|||||||
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;
|
if (tI->second.satellitePosition != position)
|
||||||
if (GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
|
||||||
satpos = -satpos;
|
|
||||||
if (satpos != position)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
@@ -771,12 +771,8 @@ void CServiceManager::SaveServices(bool tocopy, bool if_changed)
|
|||||||
printf("tp count: %d\n", transponders.size());
|
printf("tp count: %d\n", transponders.size());
|
||||||
#endif
|
#endif
|
||||||
for(transponder_list_t::iterator tI = transponders.begin(); tI != transponders.end(); ++tI) {
|
for(transponder_list_t::iterator tI = transponders.begin(); tI != transponders.end(); ++tI) {
|
||||||
t_satellite_position satpos = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xFFF;
|
|
||||||
bool tpdone = 0;
|
bool tpdone = 0;
|
||||||
if(GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
if(tI->second.satellitePosition != spos_it->first) {
|
||||||
satpos = -satpos;
|
|
||||||
|
|
||||||
if(satpos != spos_it->first) {
|
|
||||||
#ifdef SAVE_DEBUG
|
#ifdef SAVE_DEBUG
|
||||||
printf("Sat position %d not found !!\n", satpos);
|
printf("Sat position %d not found !!\n", satpos);
|
||||||
#endif
|
#endif
|
||||||
@@ -909,11 +905,7 @@ bool CServiceManager::SaveCurrentServices(transponder_id_t tpid)
|
|||||||
printf("[sdt monitor] tp not found ?!\n");
|
printf("[sdt monitor] tp not found ?!\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
t_satellite_position satellitePosition = tI->second.satellitePosition;
|
||||||
t_satellite_position satellitePosition = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tpid) & 0xFFF;
|
|
||||||
if(GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tpid) & 0xF000)
|
|
||||||
satellitePosition = -satellitePosition;
|
|
||||||
|
|
||||||
|
|
||||||
fd = fopen(CURRENTSERVICES_TMP, "w");
|
fd = fopen(CURRENTSERVICES_TMP, "w");
|
||||||
if(!fd) {
|
if(!fd) {
|
||||||
|
@@ -169,10 +169,8 @@ bool CServiceScan::AddTransponder(transponder_id_t TsidOnid, FrontendParameters
|
|||||||
t_transport_stream_id transport_stream_id = tI->second.transport_stream_id;
|
t_transport_stream_id transport_stream_id = tI->second.transport_stream_id;
|
||||||
t_original_network_id original_network_id = tI->second.original_network_id;
|
t_original_network_id original_network_id = tI->second.original_network_id;
|
||||||
uint16_t freq1 = GET_FREQ_FROM_TPID(tI->first);
|
uint16_t freq1 = GET_FREQ_FROM_TPID(tI->first);
|
||||||
//FIXME simplify/change GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID
|
|
||||||
t_satellite_position satellitePosition = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xFFF;
|
t_satellite_position satellitePosition = tI->second.satellitePosition;
|
||||||
if(GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
|
||||||
satellitePosition = -satellitePosition;
|
|
||||||
|
|
||||||
freq1++;
|
freq1++;
|
||||||
TsidOnid = CREATE_TRANSPONDER_ID64(
|
TsidOnid = CREATE_TRANSPONDER_ID64(
|
||||||
@@ -479,11 +477,7 @@ bool CServiceScan::ScanProvider(xmlNodePtr search, t_satellite_position satellit
|
|||||||
for(tI = transponders.begin(); tI != transponders.end(); tI++) {
|
for(tI = transponders.begin(); tI != transponders.end(); tI++) {
|
||||||
if(abort_scan)
|
if(abort_scan)
|
||||||
return false;
|
return false;
|
||||||
t_satellite_position satpos = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xFFF;
|
if(tI->second.satellitePosition == satellitePosition)
|
||||||
if(GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
|
||||||
satpos = -satpos;
|
|
||||||
if(satpos != satellitePosition)
|
|
||||||
continue;
|
|
||||||
AddTransponder(tI->first, &tI->second.feparams, tI->second.polarization);
|
AddTransponder(tI->first, &tI->second.feparams, tI->second.polarization);
|
||||||
}
|
}
|
||||||
/* read all transponders */
|
/* read all transponders */
|
||||||
@@ -749,10 +743,7 @@ bool CServiceScan::ReplaceTransponderParams(freq_id_t freq, t_satellite_position
|
|||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
for (transponder_list_t::iterator tI = transponders.begin(); tI != transponders.end(); tI++) {
|
for (transponder_list_t::iterator tI = transponders.begin(); tI != transponders.end(); tI++) {
|
||||||
t_satellite_position satpos = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xFFF;
|
if (tI->second.satellitePosition == satellitePosition) {
|
||||||
if (GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(tI->first) & 0xF000)
|
|
||||||
satpos = -satpos;
|
|
||||||
if (satpos == satellitePosition) {
|
|
||||||
freq_id_t newfreq;
|
freq_id_t newfreq;
|
||||||
if (cable)
|
if (cable)
|
||||||
newfreq = tI->second.feparams.frequency/100;
|
newfreq = tI->second.feparams.frequency/100;
|
||||||
|
Reference in New Issue
Block a user