mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 22:14:45 -04:00
Add Sky Map support to Rotator Controller.
This commit is contained in:
@@ -25,6 +25,11 @@
|
||||
#include <QSerialPort>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include "maincore.h"
|
||||
#include "util/astronomy.h"
|
||||
|
||||
#include "SWGTargetAzimuthElevation.h"
|
||||
|
||||
#include "gs232controller.h"
|
||||
#include "gs232controllerworker.h"
|
||||
#include "gs232controllerreport.h"
|
||||
@@ -32,7 +37,8 @@
|
||||
MESSAGE_CLASS_DEFINITION(GS232ControllerWorker::MsgConfigureGS232ControllerWorker, Message)
|
||||
MESSAGE_CLASS_DEFINITION(GS232ControllerReport::MsgReportAzAl, Message)
|
||||
|
||||
GS232ControllerWorker::GS232ControllerWorker() :
|
||||
GS232ControllerWorker::GS232ControllerWorker(GS232Controller *controller) :
|
||||
m_controller(controller),
|
||||
m_msgQueueToFeature(nullptr),
|
||||
m_device(nullptr),
|
||||
m_serialPort(this),
|
||||
@@ -193,6 +199,8 @@ void GS232ControllerWorker::applySettings(const GS232ControllerSettings& setting
|
||||
{
|
||||
setAzimuth(azimuth);
|
||||
}
|
||||
|
||||
sendToSkyMap(azimuth, elevation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,3 +288,18 @@ void GS232ControllerWorker::update()
|
||||
}
|
||||
}
|
||||
|
||||
void GS232ControllerWorker::sendToSkyMap(float azimuth, float elevation)
|
||||
{
|
||||
QList<ObjectPipe*> targetPipes;
|
||||
MainCore::instance()->getMessagePipes().getMessagePipes(m_controller, "target", targetPipes);
|
||||
|
||||
for (const auto& pipe : targetPipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
SWGSDRangel::SWGTargetAzimuthElevation *swgTarget = new SWGSDRangel::SWGTargetAzimuthElevation();
|
||||
swgTarget->setName(new QString("Rotator"));
|
||||
swgTarget->setAzimuth(azimuth);
|
||||
swgTarget->setElevation(elevation);
|
||||
messageQueue->push(MainCore::MsgTargetAzimuthElevation::create(m_controller, swgTarget));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user