Commit e8f8f1b3 authored by Gertulla, Janis Luca's avatar Gertulla, Janis Luca
Browse files

resize

parent 9c18f05d
......@@ -17,23 +17,26 @@ DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
client.cpp \
graphtab.cpp \
lib.cpp \
main.cpp \
maintab.cpp \
overlaytab.cpp \
settingstab.cpp \
valuestab.cpp \
window.cpp
HEADERS += \
client.h \
graphtab.h \
lib.h \
maintab.h \
overlaytab.h \
settingstab.h \
valuestab.h \
window.h
FORMS += \
maintab.ui \
graphtab.ui \
overlaytab.ui \
settingstab.ui \
valuestab.ui \
window.ui
......@@ -47,6 +50,7 @@ RESOURCES += \
visuals.qrc
DISTFILES += \
stylesheet.qss \
svg/valve_closed.svg \
svg/valve_open.svg \
svg/valve_unknown.svg
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.13.1, 2020-10-10T23:00:26. -->
<!-- Written by QtCreator 4.13.1, 2020-10-20T18:33:28. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
......@@ -280,11 +280,6 @@
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
......
#include "graphtab.h"
#include "ui_graphtab.h"
GraphTab::GraphTab(QWidget *parent) :
QWidget(parent),
ui(new Ui::GraphTab)
{
ui->setupUi(this);
}
GraphTab::~GraphTab()
{
delete ui;
}
#ifndef GRAPHTAB_H
#define GRAPHTAB_H
#include <QWidget>
namespace Ui {
class GraphTab;
}
class GraphTab : public QWidget
{
Q_OBJECT
public:
explicit GraphTab(QWidget *parent = nullptr);
~GraphTab();
private:
Ui::GraphTab *ui;
};
#endif // GRAPHTAB_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>GraphTab</class>
<widget class="QWidget" name="GraphTab">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1272</width>
<height>933</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
</widget>
<resources/>
<connections/>
</ui>
......@@ -6,6 +6,11 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// auto f = QFile(":/stylesheet.qss");
// f.open(QFile::ReadOnly);
// QString StyleSheet = QLatin1String(f.readAll());
// a.setStyleSheet(StyleSheet);
Window w;
w.show();
return a.exec();
......
#include "maintab.h"
#include "ui_maintab.h"
#include "overlaytab.h"
#include "ui_overlaytab.h"
#include "lib.h"
#include <cstdlib>
MainTab::MainTab(QWidget *parent) : QWidget(parent), ui(std::make_unique<Ui::MainTab>())
OverlayTab::OverlayTab(QWidget *parent) : QWidget(parent), ui(std::make_unique<Ui::OverlayTab>())
{
ui->setupUi(this);
......@@ -28,20 +28,20 @@ MainTab::MainTab(QWidget *parent) : QWidget(parent), ui(std::make_unique<Ui::Mai
iValveUnknown = std::make_unique<QIcon>(*pValveUnknown);
iValveUnknownV = std::make_unique<QIcon>(*pValveUnknownV);
connect(ui->vdetButton, &QPushButton::clicked, this, &MainTab::onVDetButtonClicked);
connect(ui->vTdetButton, &QPushButton::clicked, this, &MainTab::onVTDetButtonClicked);
connect(ui->vfoilButton, &QPushButton::clicked, this, &MainTab::onVFoilButtonClicked);
connect(ui->vdpsButton, &QPushButton::clicked, this, &MainTab::onVDpsButtonClicked);
connect(ui->pumpStartButton, &QPushButton::clicked, this, &MainTab::onPumpStartButtonClicked);
connect(ui->linkButton, &QPushButton::clicked, this, &MainTab::onLinkButtonClicked);
connect(ui->tDetActive, &QCheckBox::stateChanged, this, &MainTab::onTDetActiveCheckboxClicked);
connect(ui->vdetButton, &QPushButton::clicked, this, &OverlayTab::onVDetButtonClicked);
connect(ui->vTdetButton, &QPushButton::clicked, this, &OverlayTab::onVTDetButtonClicked);
connect(ui->vfoilButton, &QPushButton::clicked, this, &OverlayTab::onVFoilButtonClicked);
connect(ui->vdpsButton, &QPushButton::clicked, this, &OverlayTab::onVDpsButtonClicked);
//connect(ui->pumpStartButton, &QPushButton::clicked, this, &OverlayTab::onPumpStartButtonClicked);
connect(ui->linkButton, &QPushButton::clicked, this, &OverlayTab::onLinkButtonClicked);
connect(ui->tDetActive, &QCheckBox::stateChanged, this, &OverlayTab::onTDetActiveCheckboxClicked);
}
MainTab::~MainTab()
OverlayTab::~OverlayTab()
{}
void MainTab::switchValveIcon(QPushButton *valve, bool low, bool high, bool vertical)
void OverlayTab::switchValveIcon(QPushButton *valve, bool low, bool high, bool vertical)
{
if(low == 0 && high == 1)
{
......@@ -57,7 +57,7 @@ void MainTab::switchValveIcon(QPushButton *valve, bool low, bool high, bool vert
}
}
void MainTab::onNewMeasurements(PlcMeasurement &msg)
void OverlayTab::onNewMeasurements(PlcMeasurement &msg)
{
*meas = msg;
setValue(ui->pGratValueLabel, pressureFromReading(meas->pGrat, config->gaugeTypeGrat) * factorFromConfig(config->pressureUnitType));
......@@ -77,18 +77,18 @@ void MainTab::onNewMeasurements(PlcMeasurement &msg)
switchValveIcon(ui->vdpsButton, meas->vDpsLow, meas->vDpsHigh, true);
}
void MainTab::onNewState(PlcState &msg)
void OverlayTab::onNewState(PlcState &msg)
{
*state = msg;
ui->linkButton->setText(msg.linked ? "X" : "| |");
ui->hvmcpState->setPixmap(!(state->hvmcpHigh) ? *pHvActive : *pHvInactive);
ui->rBeamlineStateLabel->setPixmap(state->rbeamlineHigh ? *pHvActive : *pHvInactive);
ui->pumpRunningLabel->setText(state->pumpEnabled ? "RUNNING" : "STOPPED");
ui->pumpStartButton->setText(state->pumpEnabled ? "STOP" : "START");
//ui->pumpRunningLabel->setText(state->pumpEnabled ? "RUNNING" : "STOPPED");
//ui->pumpStartButton->setText(state->pumpEnabled ? "STOP" : "START");
ui->tDetActive->setCheckState(state->tDetActive ? Qt::Checked : Qt::Unchecked);
}
void MainTab::onDisconnect()
void OverlayTab::onDisconnect()
{
connected = false;
......@@ -108,18 +108,18 @@ void MainTab::onDisconnect()
ui->rBeamlineStateLabel->setPixmap(*pHvInactive);
}
void MainTab::onConnect()
void OverlayTab::onConnect()
{
connected = true;
}
void MainTab::onNewConfig(Config &newConfig)
void OverlayTab::onNewConfig(Config &newConfig)
{
*config = newConfig;
}
void MainTab::onVDetButtonClicked()
void OverlayTab::onVDetButtonClicked()
{
if(connected)
{
......@@ -133,7 +133,7 @@ void MainTab::onVDetButtonClicked()
}
}
void MainTab::onVDpsButtonClicked()
void OverlayTab::onVDpsButtonClicked()
{
if(connected)
{
......@@ -148,7 +148,7 @@ void MainTab::onVDpsButtonClicked()
}
void MainTab::onVFoilButtonClicked()
void OverlayTab::onVFoilButtonClicked()
{
if(connected)
{
......@@ -163,7 +163,7 @@ void MainTab::onVFoilButtonClicked()
}
}
void MainTab::onVTDetButtonClicked()
void OverlayTab::onVTDetButtonClicked()
{
if(connected)
{
......@@ -177,7 +177,7 @@ void MainTab::onVTDetButtonClicked()
}
}
void MainTab::onLinkButtonClicked()
void OverlayTab::onLinkButtonClicked()
{
if(connected)
{
......@@ -191,7 +191,7 @@ void MainTab::onLinkButtonClicked()
}
}
void MainTab::onPumpStartButtonClicked()
void OverlayTab::onPumpStartButtonClicked()
{
if(connected)
{
......@@ -206,7 +206,7 @@ void MainTab::onPumpStartButtonClicked()
}
void MainTab::onTDetActiveCheckboxClicked(int val)
void OverlayTab::onTDetActiveCheckboxClicked(int val)
{
if(connected)
{
......
......@@ -8,19 +8,19 @@
#include "client.h"
namespace Ui {
class MainTab;
class OverlayTab;
}
class MainTab : public QWidget
class OverlayTab : public QWidget
{
Q_OBJECT
public:
explicit MainTab(QWidget *parent = nullptr);
~MainTab();
explicit OverlayTab(QWidget *parent = nullptr);
~OverlayTab();
private:
std::unique_ptr<Ui::MainTab> ui;
std::unique_ptr<Ui::OverlayTab> ui;
bool connected = false;
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainTab</class>
<widget class="QWidget" name="MainTab">
<class>OverlayTab</class>
<widget class="QWidget" name="OverlayTab">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1016</width>
<height>680</height>
<width>1272</width>
<height>933</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -45,7 +45,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="visuals.qrc">:/svg/main.svg</pixmap>
<pixmap resource="visuals.qrc">:/svg/overlay.svg</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
......@@ -179,8 +179,8 @@
<widget class="QLabel" name="tDpsLabel">
<property name="geometry">
<rect>
<x>650</x>
<y>60</y>
<x>550</x>
<y>450</y>
<width>60</width>
<height>30</height>
</rect>
......@@ -195,8 +195,8 @@
<widget class="QLabel" name="tDpsValueLabel">
<property name="geometry">
<rect>
<x>490</x>
<y>430</y>
<x>560</x>
<y>470</y>
<width>60</width>
<height>30</height>
</rect>
......@@ -211,8 +211,8 @@
<widget class="QLabel" name="tDpsRPMLabel">
<property name="geometry">
<rect>
<x>560</x>
<y>430</y>
<x>630</x>
<y>470</y>
<width>60</width>
<height>30</height>
</rect>
......@@ -549,51 +549,6 @@
<string>mTorr</string>
</property>
</widget>
<widget class="QLabel" name="pumpLabel">
<property name="geometry">
<rect>
<x>720</x>
<y>460</y>
<width>60</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>PUMP</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="pumpRunningLabel">
<property name="geometry">
<rect>
<x>700</x>
<y>490</y>
<width>101</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>STOPPED</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QPushButton" name="pumpStartButton">
<property name="geometry">
<rect>
<x>700</x>
<y>540</y>
<width>100</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>START</string>
</property>
</widget>
<widget class="QPushButton" name="linkButton">
<property name="geometry">
<rect>
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1090</width>
<height>730</height>
<width>1272</width>
<height>933</height>
</rect>
</property>
<property name="sizePolicy">
......
......@@ -7,12 +7,12 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1016"
height="680"
viewBox="0 0 1016 680"
width="1272"
height="933"
viewBox="0 0 1272 933"
version="1.1"
id="svg8"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
sodipodi:docname="main.svg">
<defs
id="defs2">
......@@ -20,28 +20,28 @@
inkscape:isstock="true"
style="overflow:visible"
id="marker1207"
refX="0.0"
refY="0.0"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Lstart">
<path
transform="scale(0.8) translate(12.5,0)"
style="fill-rule:evenodd;stroke:#015a90;stroke-width:1pt;stroke-opacity:1;fill:#ffffff;fill-opacity:1"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
transform="matrix(0.8,0,0,0.8,10,0)"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#015a90;stroke-width:1pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path1205" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="Arrow1Lstart"
refX="0.0"
refY="0.0"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Lstart">
<path
transform="scale(0.8) translate(12.5,0)"
style="fill-rule:evenodd;stroke:#4444ff;stroke-width:1pt;stroke-opacity:1;fill:#4444ff;fill-opacity:1"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
transform="matrix(0.8,0,0,0.8,10,0)"
style="fill:#4444ff;fill-opacity:1;fill-rule:evenodd;stroke:#4444ff;stroke-width:1pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path885" />
</marker>
<marker
......@@ -80,9 +80,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.5487366"
inkscape:cx="681.80795"
inkscape:cy="453.65701"
inkscape:zoom="0.54756108"
inkscape:cx="215.6916"
inkscape:cy="372.7381"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
......@@ -90,7 +90,7 @@
units="px"
width="1024px"
inkscape:window-width="1920"
inkscape:window-height="1143"
inkscape:window-height="1023"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
......@@ -102,7 +102,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
......@@ -112,35 +112,36 @@
id="layer1">
<rect
ry="15"
y="201.01318"
x="461.01318"
height="147.97363"
width="197.97362"
y="334.14487"
x="612.92023"
height="207.98352"
width="278.13794"
id="rect1167"
style="fill:none;stroke:#015a90;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:8.675;stroke-dasharray:none;stroke-opacity:1;paint-order:normal" />
style="fill:none;stroke:#015a90;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
rx="14.999999" />
<rect
ry="15"
y="226.0484"
x="61.048401"
height="97.903244"
width="198.00002"
y="369.33298"
x="51"
height="137.60736"
width="278.17502"
id="rect1193"
style="fill:none;stroke:#015a90;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:8.675;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
rx="15" />
style="fill:none;stroke:#015a90;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
rx="14.999999" />
<path
id="path1197"
d="M 259,275.02025 H 461"
style="fill:none;stroke:#015a90;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.675;stroke-dasharray:none;stroke-opacity:1;marker-mid:url(#marker1207)" />
d="M 329.10699,438.16509 H 612.90168"
style="fill:none;stroke:#015a90;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1;marker-mid:url(#marker1207)" />
<path
id="path1251"
d="M 157.89452,324 V 436"
style="fill:none;stroke:#015a90;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.675;stroke-dasharray:none;stroke-opacity:1" />
d="M 187.06145,507.00831 V 664.42929"
style="fill:none;stroke:#015a90;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1" />
<g
style="stroke:#015a90;stroke-width:2.5;stroke-miterlimit:8.675;stroke-dasharray:none;stroke-opacity:1"
transform="matrix(0.8,0,0,0.8,52.961809,65.307049)"
style="stroke:#015a90;stroke-width:2.66859405;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1"
transform="matrix(1.1239394,0,0,1.1244356,39.638951,143.40385)"
id="g1301">
<ellipse
style="fill:none;stroke:#015a90;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:8.675;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
style="fill:none;stroke:#015a90;stroke-width:2.66859405;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
id="path1253"
cx="110.00431"
cy="497.22849"
......@@ -148,85 +149,69 @@
rx="28.947807"
ry="28.948053" />
<circle
style="fill:none;stroke:#015a90;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:8.675;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
style="fill:none;stroke:#015a90;stroke-width:2.66859405;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
id="path1255"
cx="110.00449"
cy="497.22845"
r="13.656011"
transform="rotate(-2.4585972)" />
<path
style="fill:none;stroke:#015a90;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.675;stroke-dasharray:none;stroke-opacity:1"
style="fill:none;stroke:#015a90;stroke-width:2.66859405;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1"
d="m 146.80559,467.48984 7.95398,41.04643"
id="path1281" />
<path
style="fill:none;stroke:#015a90;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.675;stroke-dasharray:none;stroke-opacity:1"
style="fill:none;stroke:#015a90;stroke-width:2.66859405;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1"
d="m 114.88481,468.29863 -7.65843,39.52335"
id="path1283" />
</g>
<path
id="path1315"
d="M 560,201 V 70"
style="fill:none;stroke:#015a90;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.675;stroke-dasharray:none;stroke-opacity:1" />
<g
id="g40"
transform="rotate(90,387.5007,176.76178)">
<path
style="fill:none;stroke:#015a90;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1"
d="m 560,88.20857 h 60"
id="path1317"
inkscape:connector-curvature="0" />
<g
transform="matrix(0,-0.8,0.8,0,249.60006,192.93472)"
id="g1301-6"
style="stroke:#015a90;stroke-width:2.5;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1">
<ellipse
style="fill:none;stroke:#015a90;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
id="path1253-7"
cx="110.00431"
cy="497.22849"
transform="rotate(-2.4586185)"
rx="28.947807"
ry="28.948053" />
<circle
style="fill:none;stroke:#015a90;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
id="path1255-5"
cx="110.00449"
cy="497.22845"
r="13.656011"
transform="rotate(-2.4585972)" />
<path
style="fill:none;stroke:#015a90;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1"
d="m 146.80559,467.48984 7.95398,41.04643"
id="path1281-3"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#015a90;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1"
d="m 114.88481,468.29863 -7.65843,39.52335"
id="path1283-5"
inkscape:connector-curvature="0" />
</g>
</g>
d="M 751.98917,334.12633 V 150"
style="fill:none;stroke:#015a90;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.67500019;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:none;stroke:#015a90;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8.675;stroke-dasharray:6, 2;stroke-dashoffset:0;stroke-opacity:1;marker-mid:url(#marker1207-3)"