From 1ce3c60c74aadf4edc4a67ccd74ffbf7681dbba2 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 4 Mar 2014 12:22:47 +0400 Subject: [PATCH] gui/scan_setup.cpp, gui/motorcontrol.cpp: use per frontend rotor swap option Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/929eb8676022ef5efd9b0790e5564205d6dd86b8 Author: [CST] Focus Date: 2014-03-04 (Tue, 04 Mar 2014) --- src/gui/motorcontrol.cpp | 9 +++++---- src/gui/motorcontrol.h | 1 + src/gui/scan_setup.cpp | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 1eca47b51..04c5c54d7 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -90,6 +90,7 @@ void CMotorControl::Init(void) satellitePosition = 0; stepDelay = 10; signalbox = NULL; + rotor_swap = frontend->getRotorSwap(); } int CMotorControl::exec(CMenuTarget* parent, const std::string &) @@ -197,7 +198,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) else if (msg == CRCInput::RC_4) { if (installerMenue) { printf("[motorcontrol] 4 key received... set west (soft) limit\n"); - if(g_settings.rotor_swap) lim_cmd = 0x66; + if(rotor_swap) lim_cmd = 0x66; else lim_cmd = 0x67; g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0); //g_Zapit->tune_TP(TP); @@ -233,7 +234,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) else if (msg == CRCInput::RC_6) { if (installerMenue) { printf("[motorcontrol] 6 key received... set east (soft) limit\n"); - if(g_settings.rotor_swap) lim_cmd = 0x67; + if(rotor_swap) lim_cmd = 0x67; else lim_cmd = 0x66; g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0); //g_Zapit->tune_TP(TP); @@ -320,10 +321,10 @@ void CMotorControl::motorStep(bool west) { int cmd; if (west) { - if(g_settings.rotor_swap) cmd = 0x68; + if(rotor_swap) cmd = 0x68; else cmd = 0x69; } else { - if(g_settings.rotor_swap) cmd = 0x69; + if(rotor_swap) cmd = 0x69; else cmd = 0x68; } printf("[motorcontrol] motorStep: %s\n", west ? "West" : "East"); diff --git a/src/gui/motorcontrol.h b/src/gui/motorcontrol.h index 5ca924dc8..b7e01b321 100644 --- a/src/gui/motorcontrol.h +++ b/src/gui/motorcontrol.h @@ -50,6 +50,7 @@ class CMotorControl : public CMenuTarget void Init(void); CFrameBuffer *frameBuffer; CFrontend *frontend; + bool rotor_swap; int x; int y; int width; diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 5af926331..86fa3df03 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -809,6 +809,11 @@ int CScanSetup::showFrontendSetup(int number) setupMenu->addItem(mc); msettings.Add(mc); + mc = new CMenuOptionChooser(LOCALE_EXTRA_ROTOR_SWAP, &fe_config.rotor_swap, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, allow_moptions, this); + mc->setHint("", LOCALE_MENU_HINT_ROTOR_SWAP); + setupMenu->addItem(mc); + msettings.Add(mc); + CMenuForwarder * mf = new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, allow_moptions, NULL, this, "satfind", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); mf->setHint("", LOCALE_MENU_HINT_SCAN_SATFIND); setupMenu->addItem(mf);