diff --git a/kstars/ekos/auxiliary/dome.cpp b/kstars/ekos/auxiliary/dome.cpp --- a/kstars/ekos/auxiliary/dome.cpp +++ b/kstars/ekos/auxiliary/dome.cpp @@ -14,6 +14,7 @@ #include "indi/driverinfo.h" #include "indi/clientmanager.h" #include "kstars.h" +#include "ekos_debug.h" #include @@ -68,22 +69,25 @@ if (currentDome == nullptr || currentDome->canPark() == false) return false; + qCDebug(KSTARS_EKOS) << "Parking dome..."; return currentDome->Park(); } bool Dome::unpark() { if (currentDome == nullptr || currentDome->canPark() == false) return false; + qCDebug(KSTARS_EKOS) << "Unparking dome..."; return currentDome->UnPark(); } bool Dome::abort() { if (currentDome == nullptr) return false; + qCDebug(KSTARS_EKOS) << "Aborting..."; return currentDome->Abort(); } @@ -141,6 +145,10 @@ if (currentDome == nullptr) return false; + if (isRolloffRoof()) + qCDebug(KSTARS_EKOS) << (moveCW ? "Opening" : "Closing") << "rolloff roof" << (start ? "started." : "stopped."); + else + qCDebug(KSTARS_EKOS) << "Moving dome" << (moveCW ? "" : "counter") << "clockwise" << (start ? "started." : "stopped."); return currentDome->moveDome(moveCW ? ISD::Dome::DOME_CW : ISD::Dome::DOME_CCW, start ? ISD::Dome::MOTION_START : ISD::Dome::MOTION_STOP); } @@ -173,7 +181,10 @@ { if (currentDome) + { + qCDebug(KSTARS_EKOS) << (open ? "Opening" : "Closing") << " shutter..."; return currentDome->ControlShutter(open); + } // no dome, no shutter control return false; } @@ -192,18 +203,24 @@ // special case for rolloff roofs. if (isRolloffRoof()) { - // if a parked rollof roof starts to move, its state changes to unparking + // if a parked rolloff roof starts to move, its state changes to unparking if (status == ISD::Dome::DOME_MOVING_CW && (m_ParkStatus == ISD::PARK_PARKED || m_ParkStatus == ISD::PARK_PARKING)) { m_ParkStatus = ISD::PARK_UNPARKING; + qCDebug(KSTARS_EKOS) << "Unparking rolloff roof (status = " << status << ")."; emit newParkStatus(m_ParkStatus); } - // if a unparked rollof roof starts to move, its state changes to parking + // if a unparked rolloff roof starts to move, its state changes to parking else if (status == ISD::Dome::DOME_MOVING_CCW && (m_ParkStatus == ISD::PARK_UNPARKED || m_ParkStatus == ISD::PARK_UNPARKING)) { m_ParkStatus = ISD::PARK_PARKING; + qCDebug(KSTARS_EKOS) << "Parking rolloff roof (status = " << status << ")."; emit newParkStatus(m_ParkStatus); } + else + { + qCDebug(KSTARS_EKOS) << "Rolloff roof status = " << status << "."; + } } // in all other cases, do nothing } diff --git a/kstars/ekos/observatory/observatory.cpp b/kstars/ekos/observatory/observatory.cpp --- a/kstars/ekos/observatory/observatory.cpp +++ b/kstars/ekos/observatory/observatory.cpp @@ -197,8 +197,7 @@ // abort button should always be available motionAbortButton->setEnabled(true); - // update the dome status - setDomeStatus(getDomeModel()->status()); + // update the dome parking status setDomeParkStatus(getDomeModel()->parkStatus()); } @@ -225,25 +224,30 @@ switch (status) { case ISD::Dome::DOME_ERROR: + appendLogText(i18n("%1 error. See INDI log for details.", getDomeModel()->isRolloffRoof() ? i18n("Rolloff roof") : i18n("Dome"))); + motionCWButton->setChecked(false); + motionCCWButton->setChecked(false); break; - case ISD::Dome::DOME_IDLE: + + case ISD::Dome::DOME_IDLE: motionCWButton->setChecked(false); motionCWButton->setEnabled(true); motionCCWButton->setChecked(false); motionCCWButton->setEnabled(true); - appendLogText(i18n("Dome is idle.")); + appendLogText(i18n("%1 is idle.", getDomeModel()->isRolloffRoof() ? i18n("Rolloff roof") : i18n("Dome"))); break; case ISD::Dome::DOME_MOVING_CW: motionCWButton->setChecked(true); - motionCCWButton->setEnabled(true); + motionCWButton->setEnabled(false); motionCCWButton->setChecked(false); + motionCCWButton->setEnabled(true); if (getDomeModel()->isRolloffRoof()) { domeAzimuthPosition->setText(i18n("Opening")); toggleButtons(domeUnpark, i18n("Unparking"), domePark, i18n("Park")); - appendLogText(i18n("Dome is opening...")); + appendLogText(i18n("Rolloff roof opening...")); } else { @@ -255,11 +259,12 @@ motionCWButton->setChecked(false); motionCWButton->setEnabled(true); motionCCWButton->setChecked(true); + motionCCWButton->setEnabled(false); if (getDomeModel()->isRolloffRoof()) { domeAzimuthPosition->setText(i18n("Closing")); toggleButtons(domePark, i18n("Parking"), domeUnpark, i18n("Unpark")); - appendLogText(i18n("Dome is closing...")); + appendLogText(i18n("Rolloff roof is closing...")); } else { @@ -270,7 +275,7 @@ case ISD::Dome::DOME_PARKED: setDomeParkStatus(ISD::PARK_PARKED); - appendLogText(i18n("Dome is parked.")); + appendLogText(i18n("%1 is parked.", getDomeModel()->isRolloffRoof() ? i18n("Rolloff roof") : i18n("Dome"))); break; case ISD::Dome::DOME_PARKING: @@ -285,7 +290,7 @@ motionCWButton->setChecked(false); motionCCWButton->setChecked(true); - appendLogText(i18n("Dome is parking...")); + appendLogText(i18n("%1 is parking...", getDomeModel()->isRolloffRoof() ? i18n("Rolloff roof") : i18n("Dome"))); break; case ISD::Dome::DOME_UNPARKING: @@ -300,14 +305,14 @@ motionCWButton->setChecked(true); motionCCWButton->setChecked(false); - appendLogText(i18n("Dome is unparking...")); + appendLogText(i18n("%1 is unparking...", getDomeModel()->isRolloffRoof() ? i18n("Rolloff roof") : i18n("Dome"))); break; case ISD::Dome::DOME_TRACKING: enableMotionControl(true); motionCWButton->setEnabled(true); motionCCWButton->setChecked(true); - appendLogText(i18n("Dome is tracking.")); + appendLogText(i18n("%1 is tracking.", getDomeModel()->isRolloffRoof() ? i18n("Rolloff roof") : i18n("Dome"))); break; } } @@ -321,7 +326,7 @@ activateButton(domePark, i18n("Park")); buttonPressed(domeUnpark, i18n("Unparked")); motionCWButton->setChecked(false); - motionCWButton->setEnabled(false); + motionCWButton->setEnabled(true); motionCCWButton->setChecked(false); if (getDomeModel()->isRolloffRoof()) diff --git a/kstars/ekos/observatory/observatory.ui b/kstars/ekos/observatory/observatory.ui --- a/kstars/ekos/observatory/observatory.ui +++ b/kstars/ekos/observatory/observatory.ui @@ -6,8 +6,8 @@ 0 0 - 873 - 494 + 800 + 600 @@ -126,7 +126,7 @@ - false + true Motion @@ -297,7 +297,7 @@ - + @@ -547,7 +547,7 @@ - + false @@ -668,7 +668,7 @@ - + false diff --git a/kstars/ekos/observatory/observatorydomemodel.cpp b/kstars/ekos/observatory/observatorydomemodel.cpp --- a/kstars/ekos/observatory/observatorydomemodel.cpp +++ b/kstars/ekos/observatory/observatorydomemodel.cpp @@ -48,7 +48,7 @@ if (domeInterface == nullptr) return; - emit newLog(i18n("Parking dome...")); + emit newLog(i18n("Parking %1...", isRolloffRoof() ? i18n("rolloff roof") : i18n("dome"))); domeInterface->park(); } @@ -58,7 +58,7 @@ if (domeInterface == nullptr) return; - emit newLog(i18n("Unparking dome...")); + emit newLog(i18n("Unparking %1...", isRolloffRoof() ? i18n("rolloff roof") : i18n("dome"))); domeInterface->unpark(); } @@ -85,7 +85,7 @@ return; if (domeInterface->setAutoSync(activate)) - emit newLog(i18n(activate ? "Slaving activated." : "Slaving deactivated.")); + emit newLog(activate ? i18n("Slaving activated.") : i18n("Slaving deactivated.")); } @@ -121,7 +121,10 @@ if (domeInterface == nullptr) return false; - emit newLog(i18n("%2 dome motion %1...", moveCW ? "clockwise" : "counter clockwise", start ? "Starting" : "Stopping")); + if (isRolloffRoof()) + emit newLog(i18nc("%2 dome or rolloff roof motion %1...", "%2 rolloff roof %1...", moveCW ? i18n("opening") : i18n("closing"), start ? i18n("Start") : i18n("Stop"))); + else + emit newLog(i18nc("%2 dome or rolloff roof motion %1...", "%2 dome motion %1...", moveCW ? i18n("clockwise") : i18n("counter clockwise"), start ? i18n("Start") : i18n("Stop"))); return domeInterface->moveDome(moveCW, start); } diff --git a/kstars/indi/indidome.cpp b/kstars/indi/indidome.cpp --- a/kstars/indi/indidome.cpp +++ b/kstars/indi/indidome.cpp @@ -241,6 +241,11 @@ m_Status = DOME_IDLE; emit newStatus(m_Status); } + else if (svp->s == IPS_ALERT) + { + m_Status = DOME_ERROR; + emit newStatus(m_Status); + } } else if (!strcmp(svp->name, "DOME_SHUTTER")) {