mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 09:51:13 +02:00
zapit/src/frontend.cpp: split current and rotor satellite positions
Origin commit data
------------------
Branch: ni/coolstream
Commit: a78961b721
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-04-22 (Sun, 22 Apr 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -112,6 +112,8 @@ class CFrontend
|
|||||||
fe_sec_voltage_t currentVoltage;
|
fe_sec_voltage_t currentVoltage;
|
||||||
/* current satellite position */
|
/* current satellite position */
|
||||||
int32_t currentSatellitePosition;
|
int32_t currentSatellitePosition;
|
||||||
|
/* rotor satellite position */
|
||||||
|
int32_t rotorSatellitePosition;
|
||||||
|
|
||||||
/* SETTINGS */
|
/* SETTINGS */
|
||||||
frontend_config_t config;
|
frontend_config_t config;
|
||||||
@@ -180,6 +182,7 @@ class CFrontend
|
|||||||
void getDelSys(int f, int m, char * &fec, char * &sys, char * &mod);
|
void getDelSys(int f, int m, char * &fec, char * &sys, char * &mod);
|
||||||
|
|
||||||
int32_t getCurrentSatellitePosition() { return currentSatellitePosition; }
|
int32_t getCurrentSatellitePosition() { return currentSatellitePosition; }
|
||||||
|
int32_t getRotorSatellitePosition() { return rotorSatellitePosition; }
|
||||||
|
|
||||||
void setDiseqcRepeats(const uint8_t repeats) { config.diseqcRepeats = repeats; }
|
void setDiseqcRepeats(const uint8_t repeats) { config.diseqcRepeats = repeats; }
|
||||||
void setDiseqcType(const diseqc_t type);
|
void setDiseqcType(const diseqc_t type);
|
||||||
@@ -204,6 +207,7 @@ class CFrontend
|
|||||||
const TP_params* getParameters(void) const { return ¤tTransponder; };
|
const TP_params* getParameters(void) const { return ¤tTransponder; };
|
||||||
struct dvb_frontend_event* setParametersResponse(TP_params *TP);
|
struct dvb_frontend_event* setParametersResponse(TP_params *TP);
|
||||||
void setCurrentSatellitePosition(int32_t satellitePosition) {currentSatellitePosition = satellitePosition; }
|
void setCurrentSatellitePosition(int32_t satellitePosition) {currentSatellitePosition = satellitePosition; }
|
||||||
|
void setRotorSatellitePosition(int32_t satellitePosition) {rotorSatellitePosition = satellitePosition; }
|
||||||
|
|
||||||
void positionMotor(uint8_t motorPosition);
|
void positionMotor(uint8_t motorPosition);
|
||||||
void sendMotorCommand(uint8_t cmdtype, uint8_t address, uint8_t command, uint8_t num_parameters, uint8_t parameter1, uint8_t parameter2, int repeat = 0);
|
void sendMotorCommand(uint8_t cmdtype, uint8_t address, uint8_t command, uint8_t num_parameters, uint8_t parameter1, uint8_t parameter2, int repeat = 0);
|
||||||
|
@@ -1389,7 +1389,7 @@ int CFrontend::driveToSatellitePosition(t_satellite_position satellitePosition,
|
|||||||
|
|
||||||
//if(config.diseqcType == DISEQC_ADVANCED) //FIXME testing
|
//if(config.diseqcType == DISEQC_ADVANCED) //FIXME testing
|
||||||
{
|
{
|
||||||
//printf("[fe%d] SatellitePosition %d -> %d\n", fenumber, currentSatellitePosition, satellitePosition);
|
//printf("[fe%d] SatellitePosition %d -> %d\n", fenumber, rotorSatellitePosition, satellitePosition);
|
||||||
bool moved = false;
|
bool moved = false;
|
||||||
|
|
||||||
sat_iterator_t sit = satellites.find(satellitePosition);
|
sat_iterator_t sit = satellites.find(satellitePosition);
|
||||||
@@ -1400,14 +1400,14 @@ int CFrontend::driveToSatellitePosition(t_satellite_position satellitePosition,
|
|||||||
new_position = sit->second.motor_position;
|
new_position = sit->second.motor_position;
|
||||||
use_usals = sit->second.use_usals;
|
use_usals = sit->second.use_usals;
|
||||||
}
|
}
|
||||||
sit = satellites.find(currentSatellitePosition);
|
sit = satellites.find(rotorSatellitePosition);
|
||||||
if (sit != satellites.end())
|
if (sit != satellites.end())
|
||||||
old_position = sit->second.motor_position;
|
old_position = sit->second.motor_position;
|
||||||
|
|
||||||
//printf("[fe%d] motorPosition %d -> %d usals %s\n", fenumber, old_position, new_position, use_usals ? "on" : "off");
|
//printf("[fe%d] motorPosition %d -> %d usals %s\n", fenumber, old_position, new_position, use_usals ? "on" : "off");
|
||||||
printf("[fe%d] sat pos %d -> %d motor pos %d -> %d usals %s\n", fenumber, currentSatellitePosition, satellitePosition, old_position, new_position, use_usals ? "on" : "off");
|
printf("[fe%d] sat pos %d -> %d motor pos %d -> %d usals %s\n", fenumber, rotorSatellitePosition, satellitePosition, old_position, new_position, use_usals ? "on" : "off");
|
||||||
|
|
||||||
if (currentSatellitePosition == satellitePosition)
|
if (rotorSatellitePosition == satellitePosition)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (use_usals) {
|
if (use_usals) {
|
||||||
@@ -1421,12 +1421,11 @@ int CFrontend::driveToSatellitePosition(t_satellite_position satellitePosition,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (from_scan || (new_position > 0 && old_position > 0)) {
|
if (from_scan || (new_position > 0 && old_position > 0)) {
|
||||||
waitForMotor = config.motorRotationSpeed ? 2 + abs(satellitePosition - currentSatellitePosition) / config.motorRotationSpeed : 0;
|
waitForMotor = config.motorRotationSpeed ? 2 + abs(satellitePosition - rotorSatellitePosition) / config.motorRotationSpeed : 0;
|
||||||
}
|
}
|
||||||
if (moved) {
|
if (moved) {
|
||||||
//currentSatellitePosition = satellitePosition;
|
waitForMotor = config.motorRotationSpeed ? 2 + abs(satellitePosition - rotorSatellitePosition) / config.motorRotationSpeed : 0;
|
||||||
waitForMotor = config.motorRotationSpeed ? 2 + abs(satellitePosition - currentSatellitePosition) / config.motorRotationSpeed : 0;
|
rotorSatellitePosition = satellitePosition;
|
||||||
currentSatellitePosition = satellitePosition;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//FIXME we never remember currentSatellitePosition for non-rotor ?
|
//FIXME we never remember currentSatellitePosition for non-rotor ?
|
||||||
|
Reference in New Issue
Block a user