new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
#include <Plugins/ParticipantManagement/ppm_data_plugin_interface.h>
|
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
|
#include <LtsSession/lts_session.h>
|
|
|
|
#include "gui_element_plugin.h"
|
|
#include "custom_widget.h"
|
|
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
GuiElementPlugin::GuiElementPlugin()
|
|
{
|
|
|
|
}
|
|
|
|
QWidget *GuiElementPlugin::createGuiElement(QWidget *parent)
|
|
{
|
|
m_customWidget = new CustomWidget(parent);
|
|
if (!m_ppmDtc)
|
|
{
|
|
qCritical()<<" ppmDtc not yet init!!!";
|
|
return nullptr;
|
|
}
|
|
|
|
connect(m_customWidget, &CustomWidget::finOnMapClicked, this, &GuiElementPlugin::onFindOnMap);
|
|
connect(m_ppmDtc.get(), &ParticipantManagement::Interface::Dtc::participantPositionChanged,
|
|
m_customWidget, [=](const ParticipantManagement::ParticipantPosition &ppPos){
|
|
m_customWidget->onPositionChanged(ppPos.pos, m_participantId);
|
|
}, Qt::UniqueConnection);
|
|
m_customWidget->onPositionChanged(m_ppmDtc->participantPosition(m_participantId).pos, m_participantId);
|
|
return m_customWidget;
|
|
}
|
|
|
|
|
|
bool GuiElementPlugin::init(LtsSession::LtsSession *session, int participantId)
|
|
{
|
|
m_session = session;
|
|
|
|
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
|
|
{
|
|
qCritical()<<"couln't init ppmDtc for gui element ";
|
|
return false;
|
|
}
|
|
|
|
if (!session->getForeignGuiInterface<SituationMap::ForeignGuiInterface>(m_sitMapGuiIfc))
|
|
{
|
|
qCritical()<<"couln't init sitMapGuiIfc for gui element ";
|
|
return false;
|
|
}
|
|
|
|
m_participantId = participantId;
|
|
return true;
|
|
}
|
|
|
|
void GuiElementPlugin::onFindOnMap()
|
|
{
|
|
if (m_sitMapGuiIfc)
|
|
m_sitMapGuiIfc->centerMapToParticipant(m_participantId);
|
|
}
|