8#include "mountmotionwidget.h"
13extern const char *libindi_strings_context;
17MountMotionWidget::MountMotionWidget(
QWidget *parent)
22 northWest->setIcon(
QIcon(
":/icons/go-northwest"));
25 emit newMotionCommand(0, 0, 0);
29 emit newMotionCommand(1, 0, 0);
33 north->setIcon(
QIcon(
":/icons/go-north"));
36 emit newMotionCommand(0, 0, -1);
40 emit newMotionCommand(1, 0, -1);
44 northEast->setIcon(
QIcon(
":/icons/go-northeast"));
47 emit newMotionCommand(0, 0, 1);
51 emit newMotionCommand(1, 0, 1);
55 west->setIcon(
QIcon(
":/icons/go-west"));
58 emit newMotionCommand(0, -1, 0);
62 emit newMotionCommand(1, -1, 0);
73 east->setIcon(
QIcon(
":/icons/go-east"));
77 emit newMotionCommand(0, -1, 1);
81 emit newMotionCommand(1, -1, 1);
85 southWest->setIcon(
QIcon(
":/icons/go-southwest"));
89 emit newMotionCommand(0, 1, 0);
93 emit newMotionCommand(1, 1, 0);
97 south->setIcon(
QIcon(
":/icons/go-south"));
101 emit newMotionCommand(0, 1, -1);
105 emit newMotionCommand(1, 1, -1);
109 southEast->setIcon(
QIcon(
":/icons/go-southeast"));
112 emit newMotionCommand(0, 1, 1);
117 emit newMotionCommand(1, 1, 1);
123 emit newSlewRate(speedSliderObject->value());
136void MountMotionWidget::syncSpeedInfo(INDI::PropertyView<ISwitch> *svp)
140 int index = svp->findOnSwitchIndex();
141 speedSliderObject->setEnabled(
true);
142 speedSliderObject->setMaximum(svp->count() - 1);
143 speedSliderObject->setValue(index);
145 speedLabelObject->setText(
i18nc(libindi_strings_context, svp->at(index)->getLabel()));
146 speedLabelObject->setEnabled(
true);
151 speedSliderObject->setEnabled(
false);
152 speedLabelObject->setEnabled(
false);
159void MountMotionWidget::updateSpeedInfo(INDI::PropertyView<ISwitch> *svp)
163 auto index = svp->findOnSwitchIndex();
164 speedSliderObject->setProperty(
"value", index);
165 speedLabelObject->setProperty(
"text",
i18nc(libindi_strings_context, svp->at(index)->getLabel()));
172void MountMotionWidget::keyPressEvent(
QKeyEvent *event)
174 if (
event->isAutoRepeat())
177 switch (
event->key())
181 north->setDown(
true);
182 emit newMotionCommand(0, 0, -1);
187 south->setDown(
true);
188 emit newMotionCommand(0, 1, -1);
194 emit newMotionCommand(0, -1, 1);
200 emit newMotionCommand(0, -1, 0);
215void MountMotionWidget::keyReleaseEvent(
QKeyEvent *event)
217 if (
event->isAutoRepeat())
220 switch (
event->key())
224 north->setDown(
false);
225 emit newMotionCommand(1, 0, -1);
230 south->setDown(
false);
231 emit newMotionCommand(1, 1, -1);
236 east->setDown(
false);
237 emit newMotionCommand(1, -1, 1);
242 west->setDown(
false);
243 emit newMotionCommand(1, -1, 0);
void setIcon(const QIcon &iconset)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
Ekos is an advanced Astrophotography tool for Linux.
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)