Add UI elements for a new remote connection system. Just UI and settings for now.

This commit is contained in:
Collin Kidder
2018-02-11 18:32:18 -05:00
parent 59e75d9637
commit c380e172b0
5 changed files with 343 additions and 247 deletions
+11
View File
@@ -52,6 +52,7 @@ ConnectionWindow::ConnectionWindow(QWidget *parent) :
connect(ui->rbGVRET, &QAbstractButton::clicked, this, &ConnectionWindow::handleConnTypeChanged); connect(ui->rbGVRET, &QAbstractButton::clicked, this, &ConnectionWindow::handleConnTypeChanged);
connect(ui->rbKvaser, &QAbstractButton::clicked, this, &ConnectionWindow::handleConnTypeChanged); connect(ui->rbKvaser, &QAbstractButton::clicked, this, &ConnectionWindow::handleConnTypeChanged);
connect(ui->rbSocketCAN, &QAbstractButton::clicked, this, &ConnectionWindow::handleConnTypeChanged); connect(ui->rbSocketCAN, &QAbstractButton::clicked, this, &ConnectionWindow::handleConnTypeChanged);
connect(ui->rbRemote, &QAbstractButton::clicked, this, &ConnectionWindow::handleConnTypeChanged);
connect(ui->tableConnections->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &ConnectionWindow::currentRowChanged); connect(ui->tableConnections->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &ConnectionWindow::currentRowChanged);
connect(ui->btnActivateAll, &QPushButton::clicked, this, &ConnectionWindow::handleEnableAll); connect(ui->btnActivateAll, &QPushButton::clicked, this, &ConnectionWindow::handleEnableAll);
connect(ui->btnDeactivateAll, &QPushButton::clicked, this, &ConnectionWindow::handleDisableAll); connect(ui->btnDeactivateAll, &QPushButton::clicked, this, &ConnectionWindow::handleDisableAll);
@@ -226,6 +227,7 @@ void ConnectionWindow::handleConnTypeChanged()
if (ui->rbGVRET->isChecked()) selectSerial(); if (ui->rbGVRET->isChecked()) selectSerial();
if (ui->rbKvaser->isChecked()) selectKvaser(); if (ui->rbKvaser->isChecked()) selectKvaser();
if (ui->rbSocketCAN->isChecked()) selectSocketCan(); if (ui->rbSocketCAN->isChecked()) selectSocketCan();
if (ui->rbRemote->isChecked()) selectRemote();
} }
@@ -327,6 +329,7 @@ void ConnectionWindow::handleSendText() {
void ConnectionWindow::selectSerial() void ConnectionWindow::selectSerial()
{ {
ui->lPort->setText("Port:");
/* set combobox page visible */ /* set combobox page visible */
ui->stPort->setCurrentWidget(ui->cbPage); ui->stPort->setCurrentWidget(ui->cbPage);
@@ -339,16 +342,24 @@ void ConnectionWindow::selectSerial()
void ConnectionWindow::selectKvaser() void ConnectionWindow::selectKvaser()
{ {
ui->lPort->setText("Port:");
/* set combobox page visible */ /* set combobox page visible */
ui->stPort->setCurrentWidget(ui->cbPage); ui->stPort->setCurrentWidget(ui->cbPage);
} }
void ConnectionWindow::selectSocketCan() void ConnectionWindow::selectSocketCan()
{ {
ui->lPort->setText("Port:");
/* set edit text page visible */ /* set edit text page visible */
ui->stPort->setCurrentWidget(ui->etPage); ui->stPort->setCurrentWidget(ui->etPage);
} }
void ConnectionWindow::selectRemote()
{
ui->lPort->setText("Access Key:");
ui->stPort->setCurrentWidget(ui->etPage);
}
void ConnectionWindow::setSpeed(int speed0) void ConnectionWindow::setSpeed(int speed0)
{ {
} }
+1
View File
@@ -69,6 +69,7 @@ private:
void selectSerial(); void selectSerial();
void selectKvaser(); void selectKvaser();
void selectSocketCan(); void selectSocketCan();
void selectRemote();
bool isSocketCanAvailable(); bool isSocketCanAvailable();
int getSpeed(); int getSpeed();
QString getPortName(); QString getPortName();
+9
View File
@@ -28,6 +28,9 @@ MainSettingsDialog::MainSettingsDialog(QWidget *parent) :
ui->cbValidate->setChecked(settings->value("Main/ValidateComm", true).toBool()); ui->cbValidate->setChecked(settings->value("Main/ValidateComm", true).toBool());
ui->spinPlaybackSpeed->setValue(settings->value("Playback/DefSpeed", 5).toInt()); ui->spinPlaybackSpeed->setValue(settings->value("Playback/DefSpeed", 5).toInt());
ui->lineClockFormat->setText(settings->value("Main/TimeFormat", "MMM-dd HH:mm:ss.zzz").toString()); ui->lineClockFormat->setText(settings->value("Main/TimeFormat", "MMM-dd HH:mm:ss.zzz").toString());
ui->lineRemoteHost->setText(settings->value("Remote/Host", "api.savvycan.com").toString());
ui->lineRemotePort->setText(settings->value("Remote/Port", "21315").toString()); // = 0x5343 = SC. Yep, really creative port number
ui->cbAutoStartRemote->setChecked(settings->value("Remote/AutoStart", false).toBool());
ui->spinFontSize->setValue(settings->value("Main/FontSize", ui->cbDisplayHex->font().pointSize()).toUInt()); ui->spinFontSize->setValue(settings->value("Main/FontSize", ui->cbDisplayHex->font().pointSize()).toUInt());
@@ -76,6 +79,9 @@ MainSettingsDialog::MainSettingsDialog(QWidget *parent) :
connect(ui->cbUseFiltered, SIGNAL(toggled(bool)), this, SLOT(updateSettings())); connect(ui->cbUseFiltered, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
connect(ui->lineClockFormat, SIGNAL(editingFinished()), this, SLOT(updateSettings())); connect(ui->lineClockFormat, SIGNAL(editingFinished()), this, SLOT(updateSettings()));
connect(ui->cbUseOpenGL, SIGNAL(toggled(bool)), this, SLOT(updateSettings())); connect(ui->cbUseOpenGL, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
connect(ui->cbAutoStartRemote, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
connect(ui->lineRemoteHost, SIGNAL(editingFinished()), this, SLOT(updateSettings()));
connect(ui->lineRemotePort, SIGNAL(editingFinished()), this, SLOT(updateSettings()));
installEventFilter(this); installEventFilter(this);
} }
@@ -130,6 +136,9 @@ void MainSettingsDialog::updateSettings()
settings->setValue("Main/UseOpenGL", ui->cbUseOpenGL->isChecked()); settings->setValue("Main/UseOpenGL", ui->cbUseOpenGL->isChecked());
settings->setValue("Main/TimeFormat", ui->lineClockFormat->text()); settings->setValue("Main/TimeFormat", ui->lineClockFormat->text());
settings->setValue("Main/FontSize", ui->spinFontSize->value()); settings->setValue("Main/FontSize", ui->spinFontSize->value());
settings->setValue("Remote/Host", ui->lineRemoteHost->text());
settings->setValue("Remote/Port", ui->lineRemotePort->text());
settings->setValue("Remote/AutoStart", ui->cbAutoStartRemote->isChecked());
settings->sync(); settings->sync();
emit updatedSettings(); emit updatedSettings();
+20 -13
View File
@@ -80,18 +80,8 @@
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QGridLayout" name="gridLayout">
<item> <item row="0" column="1">
<widget class="QRadioButton" name="rbGVRET">
<property name="text">
<string>GVRET Serial</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbKvaser"> <widget class="QRadioButton" name="rbKvaser">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@@ -101,7 +91,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="0">
<widget class="QRadioButton" name="rbGVRET">
<property name="text">
<string>GVRET Serial</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="rbSocketCAN"> <widget class="QRadioButton" name="rbSocketCAN">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@@ -111,6 +111,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<widget class="QRadioButton" name="rbRemote">
<property name="text">
<string>Remote Host</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
+302 -234
View File
@@ -6,260 +6,330 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>965</width>
<height>850</height> <height>585</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Main Settings</string> <string>Main Settings</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QHBoxLayout" name="horizontalLayout_5" stretch="1,1">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="title"> <item>
<string>General Settings:</string> <widget class="QGroupBox" name="groupBox_2">
</property> <property name="title">
<layout class="QVBoxLayout" name="verticalLayout_2"> <string>Main Form Settings:</string>
<item> </property>
<widget class="QCheckBox" name="cbRestorePositions"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="text">
<string>Save/Restore window positions and sizes</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbDisplayHex">
<property name="text">
<string>Display values as hexadecimal</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbValidate">
<property name="text">
<string>Require validation of GVRET connection</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_6">
<property name="title">
<string>Time Keeping</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Seconds/Microseconds are dongle based</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QRadioButton" name="rbSeconds">
<property name="text">
<string>Seconds</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbMicros">
<property name="text">
<string>Microseconds</string>
</property>
</widget>
</item>
<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="QRadioButton" name="rbSysClock">
<property name="text">
<string>System Clock</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Time Format String:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineClockFormat"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbUseFiltered">
<property name="text">
<string>Use filtered frames in sub-windows</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbUseOpenGL">
<property name="text">
<string>OpenGL Accelerated AntiAliased Graphing</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_7">
<property name="title">
<string>Font Size</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QSpinBox" name="spinFontSize">
<property name="minimum">
<number>7</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="value">
<number>9</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Main Form Settings:</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="cbMainAutoScroll">
<property name="text">
<string>Autoscroll main frame window by default</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Flowview Settings:</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="cbFlowUseTimestamp">
<property name="text">
<string>Use timestamp mode by default</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbFlowAutoRef">
<property name="text">
<string>Set Auto Reference by default</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Playback Window Settings:</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QCheckBox" name="cbPlaybackLoop">
<property name="text">
<string>Loop by default</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QCheckBox" name="cbMainAutoScroll">
<property name="text"> <property name="text">
<string>Default playback speed (ms)</string> <string>Autoscroll main frame window by default</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinPlaybackSpeed">
<property name="maximum">
<number>1000</number>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </widget>
<item> </item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>General Settings:</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QCheckBox" name="cbRestorePositions">
<property name="text"> <property name="text">
<string>Default Sending Bus</string> <string>Save/Restore window positions and sizes</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="comboSendingBus"/> <widget class="QCheckBox" name="cbDisplayHex">
<property name="text">
<string>Display values as hexadecimal</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbValidate">
<property name="text">
<string>Require validation of GVRET connection</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbUseFiltered">
<property name="text">
<string>Use filtered frames in sub-windows</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbUseOpenGL">
<property name="text">
<string>OpenGL Accelerated AntiAliased Graphing</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_6">
<property name="title">
<string>Time Keeping</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Seconds/Microseconds are dongle based</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QRadioButton" name="rbSeconds">
<property name="text">
<string>Seconds</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbMicros">
<property name="text">
<string>Microseconds</string>
</property>
</widget>
</item>
<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="QRadioButton" name="rbSysClock">
<property name="text">
<string>System Clock</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Time Format String:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineClockFormat"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_7">
<property name="title">
<string>Font Size</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QSpinBox" name="spinFontSize">
<property name="minimum">
<number>7</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="value">
<number>9</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Flowview Settings:</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="cbFlowUseTimestamp">
<property name="text">
<string>Use timestamp mode by default</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbFlowAutoRef">
<property name="text">
<string>Set Auto Reference by default</string>
</property>
</widget>
</item>
</layout>
</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> </item>
</layout> </layout>
</item> </widget>
</layout> </item>
</widget> </layout>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_5"> <layout class="QVBoxLayout" name="verticalLayout_9">
<property name="title"> <item>
<string>File Info and Comparator Settings:</string> <widget class="QGroupBox" name="groupBox_4">
</property> <property name="title">
<layout class="QVBoxLayout" name="verticalLayout_6"> <string>Playback Window Settings:</string>
<item> </property>
<widget class="QCheckBox" name="cbInfoAutoExpand"> <layout class="QVBoxLayout" name="verticalLayout_5">
<property name="text"> <item>
<string>Auto expand all nodes</string> <widget class="QCheckBox" name="cbPlaybackLoop">
</property> <property name="text">
</widget> <string>Loop by default</string>
</item> </property>
</layout> </widget>
</widget> </item>
</item> <item>
<item> <layout class="QHBoxLayout" name="horizontalLayout">
<widget class="QLabel" name="label_5"> <item>
<property name="text"> <widget class="QLabel" name="label">
<string>Some settings will not take effect until the application is restarted</string> <property name="text">
</property> <string>Default playback speed (ms)</string>
<property name="wordWrap"> </property>
<bool>true</bool> </widget>
</property> </item>
</widget> <item>
<widget class="QSpinBox" name="spinPlaybackSpeed">
<property name="maximum">
<number>1000</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Default Sending Bus</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboSendingBus"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>File Info and Comparator Settings:</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QCheckBox" name="cbInfoAutoExpand">
<property name="text">
<string>Auto expand all nodes</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_8">
<property name="title">
<string>Remote Connection:</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Host:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineRemoteHost"/>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineRemotePort"/>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="cbAutoStartRemote">
<property name="text">
<string>Auto start remote hosting</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Some settings will not take effect until the application is restarted</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<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>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -271,8 +341,6 @@
<tabstop>rbMicros</tabstop> <tabstop>rbMicros</tabstop>
<tabstop>rbSysClock</tabstop> <tabstop>rbSysClock</tabstop>
<tabstop>lineClockFormat</tabstop> <tabstop>lineClockFormat</tabstop>
<tabstop>cbUseFiltered</tabstop>
<tabstop>cbUseOpenGL</tabstop>
<tabstop>cbMainAutoScroll</tabstop> <tabstop>cbMainAutoScroll</tabstop>
<tabstop>cbFlowUseTimestamp</tabstop> <tabstop>cbFlowUseTimestamp</tabstop>
<tabstop>cbFlowAutoRef</tabstop> <tabstop>cbFlowAutoRef</tabstop>