103 lines
2.9 KiB
C++
Executable File
103 lines
2.9 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
*
|
|
* MainWindow for DDS View
|
|
*
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "initialisation.h"
|
|
|
|
#include <nglwidgets/nglmainwindow.h>
|
|
#include <DDS/DDSConnector/subscriber.h>
|
|
#include <QVariant>
|
|
#include <QItemSelection>
|
|
|
|
namespace Ui
|
|
{
|
|
class MainWindow;
|
|
}
|
|
|
|
namespace DdsView
|
|
{
|
|
class Initialisation;
|
|
}
|
|
|
|
namespace LtsPluginManager
|
|
{
|
|
struct PluginInstance;
|
|
}
|
|
|
|
class TopicDataModel;
|
|
class TopicSortModel;
|
|
class TopicDiscoverer;
|
|
struct TopicDescriptionEx;
|
|
class TreeItem;
|
|
class TreeModel;
|
|
|
|
// --------------------------------------------------------------------------------
|
|
// | Class MainWindow |
|
|
// --------------------------------------------------------------------------------
|
|
class MainWindow : public NGLMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(int domainId, int exerciseId,
|
|
DDS::QosProfile::ConnectionType ct, const QUrl &tcpDiscoveryUrl,
|
|
QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
private:
|
|
TreeItem *getServiceKnot(TopicDescriptionEx &description, TreeModel *modelToSearch) const;
|
|
struct DdsCredentials
|
|
{
|
|
int exercise = 0;
|
|
int domain = 0;
|
|
IDL::PartitionType partitionType = IDL::PartitionType::Exercise;
|
|
QVector<DDSGeneric::TopicDescription> droTypes;
|
|
|
|
bool operator ==(const DdsCredentials &o) const
|
|
{
|
|
return (exercise == o.exercise && domain == o.domain && droTypes == o.droTypes && partitionType == o.partitionType);
|
|
}
|
|
DdsCredentials(int e = 0, int d = 0, IDL::PartitionType p = IDL::PartitionType::Exercise, const QVector<DDSGeneric::TopicDescription> &s = QVector<DDSGeneric::TopicDescription>())
|
|
: exercise(e)
|
|
, domain(d)
|
|
, partitionType(p)
|
|
, droTypes(s)
|
|
{}
|
|
};
|
|
|
|
DdsView::Initialisation *m_dsr;
|
|
DdsCredentials m_ddsCredentials;
|
|
TopicDiscoverer *m_topicDiscoverer;
|
|
TopicSortModel *m_dataSortModel;
|
|
TopicSortModel *m_functionSortModel;
|
|
TopicDataModel *m_topicDataModel;
|
|
Ui::MainWindow *m_ui;
|
|
TreeModel *m_treeSrcModelData;
|
|
TreeModel *m_treeSrcModelFunction;
|
|
|
|
void setVersionView();
|
|
void loadPlugins();
|
|
void updateButtons(const DdsCredentials ¤t);
|
|
bool loadPlugin(const LtsPluginManager::PluginInstance &pi);
|
|
|
|
IDL::PartitionType partitionType() const;
|
|
private slots:
|
|
DdsCredentials onReaderChanged();
|
|
void onSelectionFunctionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
|
void onSend(const QSharedPointer<dds::core::xtypes::DynamicData> &data, const QString &topicName);
|
|
void onConnect();
|
|
void onDisconnect();
|
|
void onConfigureDetails();
|
|
void onTopicDescription(const std::string &topicName,
|
|
const std::string &typeName,
|
|
const dds::core::xtypes::StructType &type);
|
|
};
|