Skip to content

Commit

Permalink
Fix property name
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Mar 10, 2021
1 parent 8cf6cce commit cc39b9c
Showing 1 changed file with 31 additions and 17 deletions.
48 changes: 31 additions & 17 deletions indi-avalon/lx200stargo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,17 +355,19 @@ bool LX200StarGo::ISNewNumber(const char *dev, const char *name, double values[]
}
IDSetNumber(&GuidingSpeedNP, nullptr);
return result;
} else if (!strcmp(name, MountRequestDelayNP.name))
}
else if (!strcmp(name, MountRequestDelayNP.name))
{
int secs = static_cast<int>(floor(values[0] / 1000.0));
long nsecs = static_cast<long>(round((values[0] - 1000.0 * secs) * 1000000.0));
setMountRequestDelay(secs, nsecs);

MountRequestDelayN[0].value = secs*1000 + nsecs/1000000;
MountRequestDelayN[0].value = secs * 1000 + nsecs / 1000000;
MountRequestDelayNP.s = IPS_OK;
IDSetNumber(&MountRequestDelayNP, nullptr);
return true;
} else if (!strcmp(name, TrackingAdjustmentNP.name))
}
else if (!strcmp(name, TrackingAdjustmentNP.name))
{
// changing tracking adjustment
bool success = setTrackingAdjustment(values[0]);
Expand Down Expand Up @@ -398,55 +400,66 @@ bool LX200StarGo::initProperties()

IUFillSwitch(&Aux1FocuserS[0], "AUX1_FOCUSER_ON", "On", ISS_OFF);
IUFillSwitch(&Aux1FocuserS[1], "AUX1_FOCUSER_OFF", "Off", ISS_ON);
IUFillSwitchVector(&Aux1FocuserSP, Aux1FocuserS, 2, getDeviceName(), "AUX1_FOCUSER_CONTROL", "AUX1 Focuser", MAIN_CONTROL_TAB, IP_RW, ISR_ATMOST1, 60, IPS_IDLE);
IUFillSwitchVector(&Aux1FocuserSP, Aux1FocuserS, 2, getDeviceName(), "AUX1_FOCUSER_CONTROL", "AUX1 Focuser",
MAIN_CONTROL_TAB, IP_RW, ISR_ATMOST1, 60, IPS_IDLE);

IUFillSwitch(&MountGotoHomeS[0], "MOUNT_GOTO_HOME_VALUE", "Goto Home", ISS_OFF);
IUFillSwitchVector(&MountGotoHomeSP, MountGotoHomeS, 1, getDeviceName(), "MOUNT_GOTO_HOME", "Goto Home", MAIN_CONTROL_TAB, IP_RW, ISR_ATMOST1, 60, IPS_OK);
IUFillSwitchVector(&MountGotoHomeSP, MountGotoHomeS, 1, getDeviceName(), "MOUNT_GOTO_HOME", "Goto Home", MAIN_CONTROL_TAB,
IP_RW, ISR_ATMOST1, 60, IPS_OK);

IUFillSwitch(&MountSetParkS[0], "MOUNT_SET_PARK_VALUE", "Set Park", ISS_OFF);
IUFillSwitchVector(&MountSetParkSP, MountSetParkS, 1, getDeviceName(), "MOUNT_SET_PARK", "Set Park", MAIN_CONTROL_TAB, IP_RW, ISR_ATMOST1, 60, IPS_OK);
IUFillSwitchVector(&MountSetParkSP, MountSetParkS, 1, getDeviceName(), "MOUNT_SET_PARK", "Set Park", MAIN_CONTROL_TAB,
IP_RW, ISR_ATMOST1, 60, IPS_OK);

IUFillSwitch(&SyncHomeS[0], "SYNC_HOME", "Sync Home", ISS_OFF);
IUFillSwitchVector(&SyncHomeSP, SyncHomeS, 1, getDeviceName(), "TELESCOPE_SYNC_HOME", "Home Position", MAIN_CONTROL_TAB,
IP_RW, ISR_ATMOST1, 60, IPS_IDLE);

IUFillText(&MountFirmwareInfoT[0], "MOUNT_FIRMWARE_INFO", "Firmware", "");
IUFillTextVector(&MountFirmwareInfoTP, MountFirmwareInfoT, 1, getDeviceName(), "MOUNT_INFO", "Mount Info", INFO_TAB, IP_RO, 60, IPS_OK);
IUFillTextVector(&MountFirmwareInfoTP, MountFirmwareInfoT, 1, getDeviceName(), "MOUNT_INFO", "Mount Info", INFO_TAB, IP_RO,
60, IPS_OK);

// Guiding settings
IUFillNumber(&GuidingSpeedP[0], "GUIDE_RATE_WE", "RA Speed", "%.2f", 0.0, 2.0, 0.1, 0);
IUFillNumber(&GuidingSpeedP[1], "GUIDE_RATE_NS", "DEC Speed", "%.2f", 0.0, 2.0, 0.1, 0);
IUFillNumberVector(&GuidingSpeedNP, GuidingSpeedP, 2, getDeviceName(), "GUIDE_RATE", "Autoguiding", RA_DEC_TAB, IP_RW, 60, IPS_IDLE);
IUFillNumberVector(&GuidingSpeedNP, GuidingSpeedP, 2, getDeviceName(), "GUIDE_RATE", "Autoguiding", RA_DEC_TAB, IP_RW, 60,
IPS_IDLE);

IUFillSwitch(&ST4StatusS[0], "ST4_DISABLED", "disabled", ISS_OFF);
IUFillSwitch(&ST4StatusS[1], "ST4_ENABLED", "enabled", ISS_ON);
IUFillSwitchVector(&ST4StatusSP, ST4StatusS, 2, getDeviceName(), "ST4", "ST4", RA_DEC_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);
IUFillSwitchVector(&ST4StatusSP, ST4StatusS, 2, getDeviceName(), "ST4", "ST4", RA_DEC_TAB, IP_RW, ISR_1OFMANY, 60,
IPS_IDLE);

// keypad enabled / disabled
IUFillSwitch(&KeypadStatusS[0], "KEYPAD_DISABLED", "disabled", ISS_OFF);
IUFillSwitch(&KeypadStatusS[1], "KEYPAD_ENABLED", "enabled", ISS_ON);
IUFillSwitchVector(&KeypadStatusSP, KeypadStatusS, 2, getDeviceName(), "Keypad", "Keypad", RA_DEC_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);
IUFillSwitchVector(&KeypadStatusSP, KeypadStatusS, 2, getDeviceName(), "Keypad", "Keypad", RA_DEC_TAB, IP_RW, ISR_1OFMANY,
60, IPS_IDLE);

// System speed: Slew
IUFillSwitch(&SystemSpeedSlewS[0], "SYSTEM_SLEW_SPEED_LOW", "low", ISS_OFF);
IUFillSwitch(&SystemSpeedSlewS[1], "SYSTEM_SLEW_SPEED_MEDIUM", "medium", ISS_OFF);
IUFillSwitch(&SystemSpeedSlewS[2], "SYSTEM_SLEW_SPEED_FAST", "fast", ISS_ON);
IUFillSwitch(&SystemSpeedSlewS[3], "SYSTEM_SLEW_SPEED_HIGH", "high", ISS_OFF);
IUFillSwitchVector(&SystemSpeedSlewSP, SystemSpeedSlewS, 4, getDeviceName(), "SYSTEM_SLEW_SPEED", "Slew Speed", RA_DEC_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);
IUFillSwitchVector(&SystemSpeedSlewSP, SystemSpeedSlewS, 4, getDeviceName(), "SYSTEM_SLEW_SPEED", "Slew Speed", RA_DEC_TAB,
IP_RW, ISR_1OFMANY, 60, IPS_IDLE);

// Tracking adjustment
IUFillNumber(&TrackingAdjustment[0], "ADJUSTMENT_RA", "Adj. (max +/- 5%)", "%.2f", -5.0, 5.0, 0.01, 0.0);
IUFillNumberVector(&TrackingAdjustmentNP, TrackingAdjustment, 1, getDeviceName(), "TRACKING_ADJUSTMENT", "Tracking", RA_DEC_TAB, IP_RW, 60.0, IPS_IDLE);
IUFillNumberVector(&TrackingAdjustmentNP, TrackingAdjustment, 1, getDeviceName(), "TRACKING_ADJUSTMENT", "Tracking",
RA_DEC_TAB, IP_RW, 60.0, IPS_IDLE);

// meridian flip
IUFillSwitch(&MeridianFlipModeS[0], "MERIDIAN_FLIP_AUTO", "auto", ISS_OFF);
IUFillSwitch(&MeridianFlipModeS[1], "MERIDIAN_FLIP_DISABLED", "disabled", ISS_OFF);
IUFillSwitch(&MeridianFlipModeS[2], "MERIDIAN_FLIP_FORCED", "forced", ISS_OFF);
IUFillSwitchVector(&MeridianFlipModeSP, MeridianFlipModeS, 3, getDeviceName(), "MERIDIAN_FLIP_MODE", "Meridian Flip", RA_DEC_TAB, IP_RW, ISR_ATMOST1, 60, IPS_IDLE);
IUFillSwitchVector(&MeridianFlipModeSP, MeridianFlipModeS, 3, getDeviceName(), "MERIDIAN_FLIP_MODE", "Meridian Flip",
RA_DEC_TAB, IP_RW, ISR_ATMOST1, 60, IPS_IDLE);

// mount command delay
IUFillNumber(&MountRequestDelayN[0], "MOUNT_REQUEST_DELAY", "Request Delay (ms)", "%.0f", 0.0, 1000, 1.0, 50.0);
IUFillNumberVector(&MountRequestDelayNP, MountRequestDelayN, 1, getDeviceName(), "REQUEST_DELAY", "StarGO", RA_DEC_TAB, IP_RW, 60, IPS_OK);
IUFillNumberVector(&MountRequestDelayNP, MountRequestDelayN, 1, getDeviceName(), "REQUEST_DELAY", "StarGO", RA_DEC_TAB,
IP_RW, 60, IPS_OK);

// focuser on AUX1 port
focuserAux1->initProperties("AUX1 Focuser");
Expand Down Expand Up @@ -720,7 +733,7 @@ void LX200StarGo::getBasicData()
if (! getTrackFrequency(&TrackFreqN[0].value))
LOG_ERROR("Failed to get tracking frequency from device.");
else
IDSetNumber(&TrackingFreqNP, nullptr);
IDSetNumber(&TrackFreqNP, nullptr);
}
MountFirmwareInfoT[0].text = new char[64];
if (!getFirmwareInfo(MountFirmwareInfoT[0].text))
Expand Down Expand Up @@ -883,7 +896,8 @@ bool LX200StarGo::sendScopeLocation()
LocationNP.np[LOCATION_LATITUDE].value = siteLat;
LocationNP.np[LOCATION_LONGITUDE].value = siteLong;

LOGF_DEBUG("Mount Controller Latitude: %lg Longitude: %lg", LocationN[LOCATION_LATITUDE].value, LocationN[LOCATION_LONGITUDE].value);
LOGF_DEBUG("Mount Controller Latitude: %lg Longitude: %lg", LocationN[LOCATION_LATITUDE].value,
LocationN[LOCATION_LONGITUDE].value);

IDSetNumber(&LocationNP, nullptr);
if(!setLocalSiderealTime(siteLong))
Expand Down Expand Up @@ -1865,7 +1879,7 @@ bool LX200StarGo::SetTrackMode(uint8_t mode)
{
LOGF_DEBUG("%s: Get Tracking Freq", __FUNCTION__);
getTrackFrequency(&TrackFreqN[0].value);
IDSetNumber(&TrackingFreqNP, nullptr);
IDSetNumber(&TrackFreqNP, nullptr);
}
return true;
}
Expand Down

0 comments on commit cc39b9c

Please sign in to comment.