/************************************************************************************ * * ***********************************************************************************/ bool BaaderDome::SetupParms() { targetAz = 0; if (UpdatePosition()) IDSetNumber(&DomeAbsPosNP, nullptr); if (UpdateShutterStatus()) IDSetSwitch(&DomeShutterSP, nullptr); if (UpdateFlapStatus()) IDSetSwitch(&DomeFlapSP, nullptr); if (InitPark()) { // If loading parking data is successful, we just set the default parking values. SetAxis1ParkDefault(0); } else { // Otherwise, we set all parking data to default in case no parking data is found. SetAxis1Park(0); SetAxis1ParkDefault(0); } return true; }
bool DomeSim::SetupParms() { targetAz = 0; shutterTimer = SHUTTER_TIMER; DomeAbsPosN[0].value = 0; DomeParamN[0].value = 5; IDSetNumber(&DomeAbsPosNP, NULL); IDSetNumber(&DomeParamNP, NULL); if (InitPark()) { // If loading parking data is successful, we just set the default parking values. SetAxis1ParkDefault(90); } else { // Otherwise, we set all parking data to default in case no parking data is found. SetAxis1Park(90); SetAxis1ParkDefault(90); } 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 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 ScopeDome::SetupParms() { targetAz = 0; readU32(GetImpPerTurn, stepsPerTurn); LOGF_INFO("Steps per turn read as %d", stepsPerTurn); StepsPerRevolutionN[0].value = stepsPerTurn; StepsPerRevolutionNP.s = IPS_OK; IDSetNumber(&StepsPerRevolutionNP, nullptr); readS32(GetHomeSensorPosition, homePosition); LOGF_INFO("Home position read as %d", homePosition); if (UpdatePosition()) IDSetNumber(&DomeAbsPosNP, nullptr); if (UpdateShutterStatus()) IDSetSwitch(&DomeShutterSP, nullptr); UpdateSensorStatus(); UpdateRelayStatus(); if (InitPark()) { // If loading parking data is successful, we just set the default parking // values. SetAxis1ParkDefault(0); } else { // Otherwise, we set all parking data to default in case no parking data is // found. SetAxis1Park(0); SetAxis1ParkDefault(0); } uint8_t calibrationNeeded = false; readU8(IsFullSystemCalReq, calibrationNeeded); CalibrationNeededS[0].s = calibrationNeeded ? ISS_ON : ISS_OFF; CalibrationNeededSP.s = IPS_OK; IDSetSwitch(&CalibrationNeededSP, nullptr); uint16_t fwVersion; readU16(GetVersionFirmware, fwVersion); FirmwareVersionsN[0].value = fwVersion / 100.0; uint8_t fwVersionRotary; readU8(GetVersionFirmwareRotary, fwVersionRotary); FirmwareVersionsN[1].value = (fwVersionRotary + 9) / 10.0; FirmwareVersionsNP.s = IPS_OK; IDSetNumber(&FirmwareVersionsNP, nullptr); return true; }
bool DomeScript::updateProperties() { INDI::Dome::updateProperties(); if (isConnected()) { if (InitPark()) { SetAxis1ParkDefault(0); } else { SetAxis1Park(0); SetAxis1ParkDefault(0); } TimerHit(); } 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); } }