mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
gui/scan_setup: show unit for motor speed
Origin commit data
------------------
Commit: a0f2960501
Author: martii <m4rtii@gmx.de>
Date: 2013-12-21 (Sat, 21 Dec 2013)
This commit is contained in:
@@ -437,7 +437,7 @@ extra.zap_cycle Zap nur in Bouquet
|
|||||||
extra.zapit_fe_timeout Tuning Timeout
|
extra.zapit_fe_timeout Tuning Timeout
|
||||||
extra.zapit_hvoltage High (13.5/ 18.5) Voltage
|
extra.zapit_hvoltage High (13.5/ 18.5) Voltage
|
||||||
extra.zapit_make_bouquet Kanalliste auffüllen
|
extra.zapit_make_bouquet Kanalliste auffüllen
|
||||||
extra.zapit_motor_speed Rotor Drehzeit (10 = 1°/ sec)
|
extra.zapit_motor_speed Rotor Drehzeit
|
||||||
extra.zapit_scanpids PIDs scannen/nutzen
|
extra.zapit_scanpids PIDs scannen/nutzen
|
||||||
extra.zapit_sdt_changed Kanalliste wird neu geladen.
|
extra.zapit_sdt_changed Kanalliste wird neu geladen.
|
||||||
fan_speed CPU-Lüftergeschwindigkeit
|
fan_speed CPU-Lüftergeschwindigkeit
|
||||||
|
@@ -437,7 +437,7 @@ extra.zap_cycle Zap cycle
|
|||||||
extra.zapit_fe_timeout Tune timeout
|
extra.zapit_fe_timeout Tune timeout
|
||||||
extra.zapit_hvoltage 18V for rotor moving
|
extra.zapit_hvoltage 18V for rotor moving
|
||||||
extra.zapit_make_bouquet Make Remaining Channels list
|
extra.zapit_make_bouquet Make Remaining Channels list
|
||||||
extra.zapit_motor_speed Motor moving speed (10 = 1deg/sec)
|
extra.zapit_motor_speed Motor moving speed
|
||||||
extra.zapit_scanpids Scan/Use pids
|
extra.zapit_scanpids Scan/Use pids
|
||||||
extra.zapit_sdt_changed Channels changed, reload settings.
|
extra.zapit_sdt_changed Channels changed, reload settings.
|
||||||
fan_speed CPU Fan speed
|
fan_speed CPU Fan speed
|
||||||
|
@@ -606,6 +606,13 @@ int CScanSetup::showScanMenuFrontendSetup()
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string rotationSpeed2str(int i)
|
||||||
|
{
|
||||||
|
char s[40];
|
||||||
|
snprintf(s, sizeof(s), "%d.%d°/s", i / 10, i % 10);
|
||||||
|
return std::string(s);
|
||||||
|
}
|
||||||
|
|
||||||
int CScanSetup::showFrontendSetup(int number)
|
int CScanSetup::showFrontendSetup(int number)
|
||||||
{
|
{
|
||||||
int shortcut = 1;
|
int shortcut = 1;
|
||||||
@@ -737,6 +744,7 @@ int CScanSetup::showFrontendSetup(int number)
|
|||||||
|
|
||||||
setupMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SATSETUP_EXTENDED_MOTOR));
|
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, allow_moptions, 0, 64, NULL);
|
CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, allow_moptions, 0, 64, NULL);
|
||||||
|
nc->setNumberFormat(rotationSpeed2str);
|
||||||
nc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_SPEED);
|
nc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_SPEED);
|
||||||
setupMenu->addItem(nc);
|
setupMenu->addItem(nc);
|
||||||
msettings.Add(nc);
|
msettings.Add(nc);
|
||||||
|
@@ -1159,6 +1159,7 @@ CMenuOptionNumberChooser::CMenuOptionNumberChooser(const neutrino_locale_t name,
|
|||||||
|
|
||||||
optionString = non_localized_name;
|
optionString = non_localized_name;
|
||||||
numberFormat = "%d";
|
numberFormat = "%d";
|
||||||
|
numberFormatFunction = NULL;
|
||||||
observ = Observ;
|
observ = Observ;
|
||||||
slider_on = sliderOn;
|
slider_on = sliderOn;
|
||||||
}
|
}
|
||||||
@@ -1187,11 +1188,15 @@ int CMenuOptionNumberChooser::exec(CMenuTarget*)
|
|||||||
int CMenuOptionNumberChooser::paint(bool selected)
|
int CMenuOptionNumberChooser::paint(bool selected)
|
||||||
{
|
{
|
||||||
const char * l_option;
|
const char * l_option;
|
||||||
char option_value[11];
|
char option_value[40];
|
||||||
|
|
||||||
if ((localized_value_name == NONEXISTANT_LOCALE) || ((*optionValue) != localized_value))
|
if ((localized_value_name == NONEXISTANT_LOCALE) || ((*optionValue) != localized_value))
|
||||||
{
|
{
|
||||||
sprintf(option_value, numberFormat.c_str(), ((*optionValue) + display_offset));
|
if (numberFormatFunction) {
|
||||||
|
std::string s = numberFormatFunction(*optionValue + display_offset);
|
||||||
|
strncpy(option_value, s.c_str(), s.length());
|
||||||
|
} else
|
||||||
|
sprintf(option_value, numberFormat.c_str(), *optionValue + display_offset);
|
||||||
l_option = option_value;
|
l_option = option_value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1243,7 +1248,10 @@ int CMenuOptionNumberChooser::getWidth(void)
|
|||||||
|
|
||||||
width += (w1 > w2) ? w1 : w2;
|
width += (w1 > w2) ? w1 : w2;
|
||||||
|
|
||||||
if (numberFormat != "%d") {
|
if (numberFormatFunction) {
|
||||||
|
std::string s = numberFormatFunction(0);
|
||||||
|
width += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(s.c_str(), true) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("0", true); // arbitrary
|
||||||
|
} else if (numberFormat != "%d") {
|
||||||
char format[numberFormat.length()];
|
char format[numberFormat.length()];
|
||||||
snprintf(format, numberFormat.length(), numberFormat.c_str(), 0);
|
snprintf(format, numberFormat.length(), numberFormat.c_str(), 0);
|
||||||
width += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(format, true) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("0", true);
|
width += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(format, true) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("0", true);
|
||||||
|
@@ -299,7 +299,7 @@ private:
|
|||||||
bool slider_on;
|
bool slider_on;
|
||||||
CChangeObserver * observ;
|
CChangeObserver * observ;
|
||||||
std::string numberFormat;
|
std::string numberFormat;
|
||||||
|
std::string (*numberFormatFunction)(int num);
|
||||||
public:
|
public:
|
||||||
CMenuOptionNumberChooser(const neutrino_locale_t name, int * const OptionValue, const bool Active, const int min_value, const int max_value, CChangeObserver * const Observ = NULL, const int print_offset = 0, const int special_value = 0, const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE, const char * non_localized_name = NULL, bool sliderOn = false );
|
CMenuOptionNumberChooser(const neutrino_locale_t name, int * const OptionValue, const bool Active, const int min_value, const int max_value, CChangeObserver * const Observ = NULL, const int print_offset = 0, const int special_value = 0, const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE, const char * non_localized_name = NULL, bool sliderOn = false );
|
||||||
|
|
||||||
@@ -309,6 +309,7 @@ private:
|
|||||||
int isMenueOptionChooser(void) const{return 1;}
|
int isMenueOptionChooser(void) const{return 1;}
|
||||||
int getWidth(void);
|
int getWidth(void);
|
||||||
void setNumberFormat(std::string format) { numberFormat = format; }
|
void setNumberFormat(std::string format) { numberFormat = format; }
|
||||||
|
void setNumberFormat(std::string (*fun)(int)) { numberFormatFunction = fun; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMenuOptionChooser : public CAbstractMenuOptionChooser
|
class CMenuOptionChooser : public CAbstractMenuOptionChooser
|
||||||
|
Reference in New Issue
Block a user