Skip to content
Snippets Groups Projects
Commit 779a21b0 authored by Davide Rosato's avatar Davide Rosato Committed by Davide Mor
Browse files

First commit: RefuelingVisualizer added as an empty module

parent ad3fcc7c
Branches
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ SOURCES += \
src/shared/Modules/Graph/Graph.cpp \
src/shared/Modules/Test/TestModule.cpp \
src/shared/Modules/ModulesList.cpp \
src/shared/Modules/RefuelingVisualizer/RefuelingVisualizer.cpp \
src/shared/Modules/Splitter/Splitter.cpp \
src/shared/Modules/DefaultModule/DefaultModule.cpp \
src/shared/Modules/CommandPad/CommandPad.cpp \
......@@ -87,6 +88,7 @@ HEADERS += \
src/shared/Modules/MainStateViewer/MainStateViewer.h \
src/shared/Modules/PayloadStateViewer/PayloadStatesList.h \
src/shared/Modules/PayloadStateViewer/PayloadStateViewer.h \
src/shared/Modules/RefuelingVisualizer/RefuelingVisualizer.h \
src/shared/Modules/FileStream/FileStreamModule.h \
src/shared/Modules/Graph/Graph.h \
src/shared/Modules/Test/TestModule.h \
......@@ -144,6 +146,7 @@ FORMS += \
src/shared/Modules/MainWindow/Window.ui \
src/shared/Components/ModulesPicker/ModulesPicker.ui \
src/shared/Components/SaveConfigurationDialog/SaveConfigurationDialog.ui \
src/shared/Modules/RefuelingVisualizer/RefuelingVisualizer.ui \
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
......
......@@ -25,6 +25,7 @@ class Module;
enum ModuleId
{
EMPTY,
REFUELING_VISUALIZER,
SPLITTER,
COMMANDPAD,
COMPACT_COMMAND_PAD,
......
......@@ -38,6 +38,7 @@
#include <Modules/TimerController/TimerControllerModule.h>
#include <Modules/ValuesConverterViewer/ValuesConverterViewerModule.h>
#include <Modules/ValvesViewer/ValvesViewer.h>
#include <Modules/RefuelingVisualizer/RefuelingVisualizer.h>
void ModulesList::createModuleList()
{
......@@ -151,6 +152,12 @@ void ModulesList::createModuleList()
valvesViewer.setFactory([]() { return new ValvesViewer(); });
valvesViewer.addModuleSourceFiles("Modules/ValvesViewer/");
addModuleInfo(valvesViewer);
ModuleInfo refuelingVisualizer(ModuleId::REFUELING_VISUALIZER,
"RefuelingVisualizer", ModuleCategory::DATAVISUAL);
refuelingVisualizer.setFactory([]() { return new RefuelingVisualizer(); });
tabs.addModuleSourceFiles("Modules/RefuelingVisualizer/");
modulesInfo.append(refuelingVisualizer);
}
// ____________________________________________________________________________________________
......
/*
* This file is part of Skyward Hub.
*
* Skyward Hub is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* Skyward Hub is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* Skyward Hub. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "RefuelingVisualizer.h"
#include <Core/ModulesManager/ModulesManager.h>
#include <QAction>
#include <QMessageBox>
#include <QPoint>
#include "Components/ContextMenuSeparator/ContextMenuSeparator.h"
#include "ui_RefuelingVisualizer.h"
RefuelingVisualizer::RefuelingVisualizer() : DefaultModule(), ui(new Ui::RefuelingVisualizer)
{
ui->setupUi(this);
defaultContextMenuSetup();
connectUiSlots();
}
RefuelingVisualizer::~RefuelingVisualizer() { delete ui; }
void RefuelingVisualizer::connectUiSlots()
{
connect(ui->selectPanel_button, &QPushButton::clicked, this,
&RefuelingVisualizer::onSelectPanelClick);
}
void RefuelingVisualizer::onSelectPanelClick() { onReplaceClicked(); }
QWidget* RefuelingVisualizer::toWidget() { return this; }
XmlObject RefuelingVisualizer::toXmlObject()
{
return XmlObject(getName(ModuleId::EMPTY));
}
void RefuelingVisualizer::fromXmlObject(const XmlObject& xmlObject)
{
Q_UNUSED(xmlObject);
}
/*
* This file is part of Skyward Hub.
*
* Skyward Hub is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* Skyward Hub is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* Skyward Hub. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#include <Core/Module/Module.h>
#include <Modules/DefaultModule/DefaultModule.h>
#include <QMenu>
#include <QSharedPointer>
#include <QWidget>
namespace Ui
{
class RefuelingVisualizer;
}
class RefuelingVisualizer : public DefaultModule
{
Q_OBJECT
public:
explicit RefuelingVisualizer();
~RefuelingVisualizer() override;
QWidget* toWidget() override;
XmlObject toXmlObject() override;
void fromXmlObject(const XmlObject& xmlObject) override;
protected:
void connectUiSlots();
protected slots:
void onSelectPanelClick();
private:
Ui::RefuelingVisualizer* ui;
};
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RefuelingVisualizer</class>
<widget class="QWidget" name="RefuelingVisualizer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>448</width>
<height>233</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>This is an Empty panel.
In order to select a panel click the following button</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="selectPanel_button">
<property name="text">
<string>Select Panel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment