gui/scan_setup.cpp, gui/motorcontrol.cpp: use per frontend rotor swap option

Origin commit data
------------------
Commit: 929eb86760
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-03-04 (Tue, 04 Mar 2014)
This commit is contained in:
[CST] Focus
2014-03-04 12:22:47 +04:00
parent d947a53f1e
commit 1ce3c60c74
3 changed files with 11 additions and 4 deletions

View File

@@ -90,6 +90,7 @@ void CMotorControl::Init(void)
satellitePosition = 0; satellitePosition = 0;
stepDelay = 10; stepDelay = 10;
signalbox = NULL; signalbox = NULL;
rotor_swap = frontend->getRotorSwap();
} }
int CMotorControl::exec(CMenuTarget* parent, const std::string &) 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) { else if (msg == CRCInput::RC_4) {
if (installerMenue) { if (installerMenue) {
printf("[motorcontrol] 4 key received... set west (soft) limit\n"); 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; else lim_cmd = 0x67;
g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0); g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0);
//g_Zapit->tune_TP(TP); //g_Zapit->tune_TP(TP);
@@ -233,7 +234,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &)
else if (msg == CRCInput::RC_6) { else if (msg == CRCInput::RC_6) {
if (installerMenue) { if (installerMenue) {
printf("[motorcontrol] 6 key received... set east (soft) limit\n"); 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; else lim_cmd = 0x66;
g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0); g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0);
//g_Zapit->tune_TP(TP); //g_Zapit->tune_TP(TP);
@@ -320,10 +321,10 @@ void CMotorControl::motorStep(bool west)
{ {
int cmd; int cmd;
if (west) { if (west) {
if(g_settings.rotor_swap) cmd = 0x68; if(rotor_swap) cmd = 0x68;
else cmd = 0x69; else cmd = 0x69;
} else { } else {
if(g_settings.rotor_swap) cmd = 0x69; if(rotor_swap) cmd = 0x69;
else cmd = 0x68; else cmd = 0x68;
} }
printf("[motorcontrol] motorStep: %s\n", west ? "West" : "East"); printf("[motorcontrol] motorStep: %s\n", west ? "West" : "East");

View File

@@ -50,6 +50,7 @@ class CMotorControl : public CMenuTarget
void Init(void); void Init(void);
CFrameBuffer *frameBuffer; CFrameBuffer *frameBuffer;
CFrontend *frontend; CFrontend *frontend;
bool rotor_swap;
int x; int x;
int y; int y;
int width; int width;

View File

@@ -809,6 +809,11 @@ int CScanSetup::showFrontendSetup(int number)
setupMenu->addItem(mc); setupMenu->addItem(mc);
msettings.Add(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); 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); mf->setHint("", LOCALE_MENU_HINT_SCAN_SATFIND);
setupMenu->addItem(mf); setupMenu->addItem(mf);