bool ScopeSim::SetCurrentPark() { SetAxis1Park(currentRA); SetAxis2Park(currentDEC); return true; }
bool SynscanDriver::SetCurrentPark() { char res[SYN_RES] = {0}; // Get Current Az/Alt memset(res, 0, SYN_RES); if (!sendCommand("z", res)) return false; uint32_t n1 = 0, n2 = 0; sscanf(res, "%ux,%ux#", &n1, &n2); double az = static_cast<double>(n1) / 0x100000000 * 360.0; double al = static_cast<double>(n2) / 0x100000000 * 360.0; al = rangeDec(al); char AzStr[16], AltStr[16]; fs_sexa(AzStr, az, 2, 3600); fs_sexa(AltStr, al, 2, 3600); LOGF_DEBUG("Setting current parking position to coordinates Az (%s) Alt (%s)...", AzStr, AltStr); SetAxis1Park(az); SetAxis2Park(al); return true; }
bool IEQPro::SetCurrentPark() { SetAxis1Park(currentRA); SetAxis2Park(currentDEC); return true; }
bool Paramount::updateProperties() { INDI::Telescope::updateProperties(); if (isConnected()) { if (isTheSkyTracking()) { IUResetSwitch(&TrackModeSP); TrackModeS[TRACK_SIDEREAL].s = ISS_ON; TrackState = SCOPE_TRACKING; } else { IUResetSwitch(&TrackModeSP); TrackState = SCOPE_IDLE; } //defineSwitch(&TrackModeSP); //defineNumber(&TrackRateNP); defineNumber(&JogRateNP); defineNumber(&GuideNSNP); defineNumber(&GuideWENP); defineNumber(&GuideRateNP); // Initial currentRA and currentDEC to LST and +90 or -90 if (InitPark()) { // If loading parking data is successful, we just set the default parking values. SetAxis1ParkDefault(currentRA); SetAxis2ParkDefault(currentDEC); } else { // Otherwise, we set all parking data to default in case no parking data is found. SetAxis1Park(currentRA); SetAxis2Park(currentDEC); SetAxis1ParkDefault(currentRA); SetAxis2ParkDefault(currentDEC); } SetParked(isTheSkyParked()); } else { //deleteProperty(TrackModeSP.name); //deleteProperty(TrackRateNP.name); deleteProperty(JogRateNP.name); deleteProperty(GuideNSNP.name); deleteProperty(GuideWENP.name); deleteProperty(GuideRateNP.name); } return true; }
bool SynscanDriver::SetDefaultPark() { // By default az to north, and alt to pole LOG_DEBUG("Setting Park Data to Default."); SetAxis1Park(359); SetAxis2Park(LocationN[LOCATION_LATITUDE].value); return true; }
bool ScopeSim::SetDefaultPark() { // By default set RA to HA SetAxis1Park(get_local_sidereal_time(LocationN[LOCATION_LONGITUDE].value)); // Set DEC to 90 or -90 depending on the hemisphere SetAxis2Park((LocationN[LOCATION_LATITUDE].value > 0) ? 90 : -90); return true; }
bool IEQPro::SetDefaultPark() { // By default set RA to HA SetAxis1Park(ln_get_apparent_sidereal_time(ln_get_julian_from_sys())); // Set DEC to 90 or -90 depending on the hemisphere SetAxis2Park( (HemisphereS[HEMI_NORTH].s == ISS_ON) ? 90 : -90); return true; }
bool ScopeSim::updateProperties() { INDI::Telescope::updateProperties(); if (isConnected()) { defineNumber(&GuideNSNP); defineNumber(&GuideWENP); defineNumber(&GuideRateNP); #ifdef USE_EQUATORIAL_PE defineNumber(&EqPENV); defineSwitch(&PEErrNSSP); defineSwitch(&PEErrWESP); #endif if (InitPark()) { // If loading parking data is successful, we just set the default parking values. SetAxis1ParkDefault(currentRA); SetAxis2ParkDefault(currentDEC); if (isParked()) { currentRA = ParkPositionN[AXIS_RA].value; currentDEC= ParkPositionN[AXIS_DE].value; } } else { // Otherwise, we set all parking data to default in case no parking data is found. SetAxis1Park(currentRA); SetAxis2Park(currentDEC); SetAxis1ParkDefault(currentRA); SetAxis2ParkDefault(currentDEC); } sendTimeFromSystem(); } else { deleteProperty(GuideNSNP.name); deleteProperty(GuideWENP.name); #ifdef USE_EQUATORIAL_PE deleteProperty(EqPENV.name); deleteProperty(PEErrNSSP.name); deleteProperty(PEErrWESP.name); #endif deleteProperty(GuideRateNP.name); } return true; }
bool SynscanDriver::updateProperties() { INDI::Telescope::updateProperties(); if (isConnected()) { setupParams(); defineNumber(&HorizontalCoordsNP); defineText(&StatusTP); defineNumber(&CustomSlewRateNP); defineNumber(&GuideNSNP); defineNumber(&GuideWENP); defineNumber(&GuideRateNP); if (InitPark()) { SetAxis1ParkDefault(359); SetAxis2ParkDefault(m_isAltAz ? 0 : LocationN[LOCATION_LATITUDE].value); } else { SetAxis1Park(359); SetAxis2Park(m_isAltAz ? 0 : LocationN[LOCATION_LATITUDE].value); SetAxis1ParkDefault(359); SetAxis2ParkDefault(m_isAltAz ? 0 : LocationN[LOCATION_LATITUDE].value); } } else { deleteProperty(HorizontalCoordsNP.name); deleteProperty(StatusTP.name); deleteProperty(CustomSlewRateNP.name); deleteProperty(GuideNSNP.name); deleteProperty(GuideWENP.name); deleteProperty(GuideRateNP.name); } return true; }
void IEQPro::getStartupData() { DEBUG(INDI::Logger::DBG_DEBUG, "Getting firmware data..."); if (get_ieqpro_firmware(PortFD, &firmwareInfo)) { IUSaveText(&FirmwareT[0], firmwareInfo.Model.c_str()); IUSaveText(&FirmwareT[1], firmwareInfo.MainBoardFirmware.c_str()); IUSaveText(&FirmwareT[2], firmwareInfo.ControllerFirmware.c_str()); IUSaveText(&FirmwareT[3], firmwareInfo.RAFirmware.c_str()); IUSaveText(&FirmwareT[4], firmwareInfo.DEFirmware.c_str()); FirmwareTP.s = IPS_OK; IDSetText(&FirmwareTP, NULL); } DEBUG(INDI::Logger::DBG_DEBUG, "Getting guiding rate..."); double guideRate=0; if (get_ieqpro_guide_rate(PortFD, &guideRate)) { GuideRateN[0].value = guideRate; IDSetNumber(&GuideRateNP, NULL); } double HA = ln_get_apparent_sidereal_time(ln_get_julian_from_sys()); double DEC = (HemisphereS[HEMI_NORTH].s == ISS_ON) ? 90 : -90; if (InitPark()) { // If loading parking data is successful, we just set the default parking values. SetAxis1ParkDefault(HA); SetAxis2ParkDefault(DEC); } else { // Otherwise, we set all parking data to default in case no parking data is found. SetAxis1Park(HA); SetAxis2Park(DEC); SetAxis1ParkDefault(HA); SetAxis2ParkDefault(DEC); } double utc_offset; int yy, dd, mm, hh, minute, ss; if (get_ieqpro_utc_date_time(PortFD, &utc_offset, &yy, &mm, &dd, &hh, &minute, &ss)) { char isoDateTime[32]; char utcOffset[8]; snprintf(isoDateTime, 32, "%04d-%02d-%02dT%02d:%02d:%02d", yy, mm, dd, hh, minute, ss); snprintf(utcOffset, 8, "%4.2f", utc_offset); IUSaveText(IUFindText(&TimeTP, "UTC"), isoDateTime); IUSaveText(IUFindText(&TimeTP, "OFFSET"), utcOffset); DEBUGF(INDI::Logger::DBG_SESSION, "Mount UTC offset is %s. UTC time is %s", utcOffset, isoDateTime); IDSetText(&TimeTP, NULL); } // Get Longitude and Latitude from mount double longitude=0,latitude=0; if (get_ieqpro_latitude(PortFD, &latitude) && get_ieqpro_longitude(PortFD, &longitude)) { // Convert to INDI standard longitude (0 to 360 Eastward) if (longitude < 0) longitude += 360; LocationN[LOCATION_LATITUDE].value = latitude; LocationN[LOCATION_LONGITUDE].value= longitude; LocationNP.s = IPS_OK; IDSetNumber(&LocationNP, NULL); } if (isSimulation()) { if (isParked()) set_sim_system_status(ST_PARKED); else set_sim_system_status(ST_STOPPED); } }