Starting to create udp server

merge-requests/2/head
Phil Taylor 2021-02-14 18:32:58 +00:00
rodzic 4d4a688733
commit dce5d93a6c
8 zmienionych plików z 357 dodań i 6 usunięć

Wyświetl plik

@ -1065,3 +1065,4 @@ QByteArray parseNullTerminatedString(QByteArray c, int s)
}
return res;
}

15
udpserversetup.cpp 100644
Wyświetl plik

@ -0,0 +1,15 @@
#include "udpserversetup.h"
#include "ui_udpserversetup.h"
udpServerSetup::udpServerSetup(QWidget* parent) :
QDialog(parent),
ui(new Ui::udpServerSetup)
{
ui->setupUi(this);
ui->enableCheckbox->setChecked(true);
}
udpServerSetup::~udpServerSetup()
{
delete ui;
}

22
udpserversetup.h 100644
Wyświetl plik

@ -0,0 +1,22 @@
#ifndef UDPSERVERSETUP_H
#define UDPSERVERSETUP_H
#include <QDialog>
namespace Ui {
class udpServerSetup;
}
class udpServerSetup : public QDialog
{
Q_OBJECT
public:
explicit udpServerSetup(QWidget* parent = 0);
~udpServerSetup();
private:
Ui::udpServerSetup* ui;
};
#endif // UDPSERVER_H

295
udpserversetup.ui 100644
Wyświetl plik

@ -0,0 +1,295 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>udpServerSetup</class>
<widget class="QDialog" name="udpServerSetup">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>368</width>
<height>262</height>
</rect>
</property>
<property name="windowTitle">
<string>Server Setup</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<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="QLabel" name="label">
<property name="text">
<string>Server Setup</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>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="enableCheckbox">
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<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>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Contol Port</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="controlPortText">
<property name="inputMask">
<string>99999</string>
</property>
<property name="text">
<string>50001</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Civ Port</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="civPortText">
<property name="inputMask">
<string>99999</string>
</property>
<property name="text">
<string>50002</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Audio Port</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="audioPortText">
<property name="inputMask">
<string>99999</string>
</property>
<property name="text">
<string>50003</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4"/>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QTableWidget" name="usersTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>90</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="midLineWidth">
<number>0</number>
</property>
<property name="columnCount">
<number>3</number>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>100</number>
</attribute>
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderShowSortIndicator" stdset="0">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderStretchLastSection">
<bool>false</bool>
</attribute>
<row>
<property name="text">
<string>User 1</string>
</property>
</row>
<row>
<property name="text">
<string>User 2</string>
</property>
</row>
<column>
<property name="text">
<string>Username</string>
</property>
</column>
<column>
<property name="text">
<string>Password</string>
</property>
</column>
<column>
<property name="text">
<string>Admin</string>
</property>
</column>
</widget>
</item>
<item>
<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>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="okButton">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>okButton</sender>
<signal>clicked()</signal>
<receiver>udpServerSetup</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>278</x>
<y>253</y>
</hint>
<hint type="destinationlabel">
<x>96</x>
<y>254</y>
</hint>
</hints>
</connection>
<connection>
<sender>cancelButton</sender>
<signal>clicked()</signal>
<receiver>udpServerSetup</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>369</x>
<y>253</y>
</hint>
<hint type="destinationlabel">
<x>179</x>
<y>282</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Wyświetl plik

@ -25,6 +25,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
cal = new calibrationWindow();
sat = new satelliteSetup();
srv = new udpServerSetup();
haveRigCaps = false;
@ -2411,6 +2412,10 @@ void wfmain::on_connectBtn_clicked()
}
}
void wfmain::on_udpServerSetupBtn_clicked()
{
srv->show();
}
void wfmain::on_sqlSlider_valueChanged(int value)
{
emit setSql((unsigned char)value);

Wyświetl plik

@ -18,6 +18,7 @@
#include "calibrationwindow.h"
#include "satellitesetup.h"
#include "udpserversetup.h"
#include <qcustomplot.h>
#include <qserialportinfo.h>
@ -287,6 +288,8 @@ private slots:
void on_dataModeBtn_toggled(bool checked);
void on_udpServerSetupBtn_clicked();
private:
Ui::wfmain *ui;
QSettings settings;
@ -445,7 +448,7 @@ private:
calibrationWindow *cal;
satelliteSetup *sat;
udpServerSetup* srv;
void bandStackBtnClick();
bool waitingForBandStackRtn;
char bandStkBand;

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">
@ -1356,6 +1356,13 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="udpServerSetupBtn">
<property name="text">
<string>Server Setup</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -1612,7 +1619,7 @@
<x>0</x>
<y>0</y>
<width>810</width>
<height>22</height>
<height>21</height>
</rect>
</property>
</widget>

Wyświetl plik

@ -83,7 +83,8 @@ SOURCES += main.cpp\
logcategories.cpp \
audiohandler.cpp \
calibrationwindow.cpp \
satellitesetup.cpp
satellitesetup.cpp \
udpserversetup.cpp
HEADERS += wfmain.h \
commhandler.h \
@ -94,12 +95,14 @@ HEADERS += wfmain.h \
logcategories.h \
audiohandler.h \
calibrationwindow.h \
satellitesetup.h
satellitesetup.h \
udpserversetup.h
FORMS += wfmain.ui \
calibrationwindow.ui \
satellitesetup.ui
satellitesetup.ui \
udpserversetup.ui