From f2cbf7bc613e2a39c87943b7cb93962d3629416b Mon Sep 17 00:00:00 2001 From: Michael Carpenter Date: Tue, 30 Jul 2013 09:13:30 -0400 Subject: [PATCH] Simplified Serial port selection window --- src/ui/CommConfigurationWindow.cc | 13 +- src/ui/CommSettings.ui | 180 +++---- src/ui/SerialConfigurationWindow.cc | 3 + src/ui/SerialSettings.ui | 727 ++++++++++++++++------------ 4 files changed, 518 insertions(+), 405 deletions(-) diff --git a/src/ui/CommConfigurationWindow.cc b/src/ui/CommConfigurationWindow.cc index de6c8715d..20754dbcd 100644 --- a/src/ui/CommConfigurationWindow.cc +++ b/src/ui/CommConfigurationWindow.cc @@ -68,11 +68,18 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn ui.connectionType->setEnabled(false); ui.linkType->setEnabled(false); ui.protocolGroupBox->setVisible(false); + ui.protocolTypeGroupBox->setVisible(false); // Connect UI element visibility to checkbox - connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.connectionType, SLOT(setEnabled(bool))); - connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.linkType, SLOT(setEnabled(bool))); - connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.protocolGroupBox, SLOT(setVisible(bool))); + //connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.connectionType, SLOT(setEnabled(bool))); + //connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.linkType, SLOT(setEnabled(bool))); + //connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.protocolGroupBox, SLOT(setVisible(bool))); + ui.advancedOptionsCheckBox->setVisible(false); + //connect(ui.advCheckBox,SIGNAL(clicked(bool)),ui.advancedOptionsCheckBox,SLOT(setChecked(bool))); + connect(ui.advCheckBox,SIGNAL(clicked(bool)),ui.protocolTypeGroupBox,SLOT(setVisible(bool))); + connect(ui.advCheckBox, SIGNAL(clicked(bool)), ui.connectionType, SLOT(setEnabled(bool))); + connect(ui.advCheckBox, SIGNAL(clicked(bool)), ui.linkType, SLOT(setEnabled(bool))); + connect(ui.advCheckBox, SIGNAL(clicked(bool)), ui.protocolGroupBox, SLOT(setVisible(bool))); // add link types ui.linkType->addItem(tr("Serial"), QGC_LINK_SERIAL); diff --git a/src/ui/CommSettings.ui b/src/ui/CommSettings.ui index 91f0ad49d..735340383 100644 --- a/src/ui/CommSettings.ui +++ b/src/ui/CommSettings.ui @@ -6,76 +6,15 @@ 0 0 - 413 - 373 + 770 + 563 Form - - - 6 - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 5 - 5 - - - - - - - - - - Link Type - - - - - - - - - - Protocol - - - - - - - -1 - - - - - - - Advanced Options - - - - - - - - - Qt::Horizontal - - - - + + Link @@ -97,8 +36,8 @@ 0 0 - 393 - 76 + 748 + 97 @@ -107,7 +46,65 @@ - + + + + Show Advanced Protocol Options + + + + + + + GroupBox + + + + + + + + Link Type + + + + + + + + + + -1 + + + + + + + Advanced Options + + + + + + + Protocol + + + + + + + + + + + + Qt::Horizontal + + + + Protocol @@ -129,8 +126,8 @@ 0 0 - 393 - 76 + 748 + 96 @@ -139,20 +136,20 @@ - - - - - 0 - 0 - + + + + Qt::Vertical - - Disconnected + + + 20 + 40 + - + - + 12 @@ -189,6 +186,19 @@ + + + + + 0 + 0 + + + + Disconnected + + + @@ -214,6 +224,14 @@ Close the configuration window + line + linkGroupBox + protocolGroupBox + connectionStatusLabel + advCheckBox + protocolTypeGroupBox + label_5 + verticalSpacer diff --git a/src/ui/SerialConfigurationWindow.cc b/src/ui/SerialConfigurationWindow.cc index 72974c7c1..9d2661397 100644 --- a/src/ui/SerialConfigurationWindow.cc +++ b/src/ui/SerialConfigurationWindow.cc @@ -129,6 +129,9 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge connect(ui.parEven, SIGNAL(toggled(bool)), this, SLOT(setParityEven(bool))); connect(ui.dataBitsSpinBox, SIGNAL(valueChanged(int)), this->link, SLOT(setDataBits(int))); connect(ui.stopBitsSpinBox, SIGNAL(valueChanged(int)), this->link, SLOT(setStopBits(int))); + connect(ui.advCheckBox,SIGNAL(clicked(bool)),ui.advGroupBox,SLOT(setShown(bool))); + ui.advCheckBox->setChecked(false); + ui.advGroupBox->setVisible(false); //connect(this->link, SIGNAL(connected(bool)), this, SLOT()); ui.portName->setSizeAdjustPolicy(QComboBox::AdjustToContentsOnFirstShow); diff --git a/src/ui/SerialSettings.ui b/src/ui/SerialSettings.ui index 605672000..fd96720ec 100644 --- a/src/ui/SerialSettings.ui +++ b/src/ui/SerialSettings.ui @@ -6,379 +6,464 @@ 0 0 - 304 - 283 + 546 + 457 Form - - - 6 - - - - - Serial Port - - - - - - - The serial port to which the system is connected. All ports listed here should work. - - - The serial port to which the system is connected. All ports listed here should work. - - - The serial port to which the system is connected. All ports listed here should work. - - - true - - - QComboBox::AdjustToContents - - - - - - - - - - - - Baud Rate - - - - - - - The data transmission rate. If unsure 57600 and 115200 are very common rates. - - - The data transmission rate. If unsure 57600 and 115200 are very common rates. - - - The data transmission rate. If unsure 57600 and 115200 are very common rates. - - - false - - - QComboBox::AdjustToContents - - - - 50 - - - - - 75 - - - - - 110 - - - - - 134 - - - - - 150 - - - - - 200 - - - - - 300 - - - - - 600 - - - - - 1200 - - - - - 1800 - - - - - 2400 - - - - - 4800 - - - - - 9600 - - - - - 14400 - - - - - 19200 - - - - - 38400 - - - - - 56000 - - - - - 57600 - - - - - 76800 - - - - - 115200 - - + + + - - 128000 - - - - - 230400 - - - - - 256000 - - - - - 460800 - - - - - 921600 - + + + Serial Port + + - - - - - - Flow Control - - - - - - - Activate / deactivate hardware flow control. Commonly deactivated - - - Activate / deactivate hardware flow control. Commonly deactivated - - - Activate / deactivate hardware flow control. Commonly deactivated - - - Active - - - - - - - Parity - - - - - - + - Set the parity. In most cases no parity (None) is used. + The serial port to which the system is connected. All ports listed here should work. - Set the parity. In most cases no parity (None) is used. + The serial port to which the system is connected. All ports listed here should work. - Set the parity. In most cases no parity (None) is used. - - - None + The serial port to which the system is connected. All ports listed here should work. - + true + + QComboBox::AdjustToContents + + + + + + - - - Set the parity. In most cases no parity (None) is used. + + + Qt::Horizontal - - Set the parity. In most cases no parity (None) is used. - - - Set the parity. In most cases no parity (None) is used. + + + 40 + 20 + + + + + + + + + - Odd + Baud Rate - + - Set the parity. In most cases no parity (None) is used. + The data transmission rate. If unsure 57600 and 115200 are very common rates. - Set the parity. In most cases no parity (None) is used. + The data transmission rate. If unsure 57600 and 115200 are very common rates. - Set the parity. In most cases no parity (None) is used. + The data transmission rate. If unsure 57600 and 115200 are very common rates. - - Even + + false + + + QComboBox::AdjustToContents + + + 50 + + + + + 75 + + + + + 110 + + + + + 134 + + + + + 150 + + + + + 200 + + + + + 300 + + + + + 600 + + + + + 1200 + + + + + 1800 + + + + + 2400 + + + + + 4800 + + + + + 9600 + + + + + 14400 + + + + + 19200 + + + + + 38400 + + + + + 56000 + + + + + 57600 + + + + + 76800 + + + + + 115200 + + + + + 128000 + + + + + 230400 + + + + + 256000 + + + + + 460800 + + + + + 921600 + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + - - - - - 0 - 0 - - - - - 0 - 0 - - - - Number of data bits per symbol. This is almost always 8. - - - Number of data bits per symbol. This is almost always 8. - - - Number of data bits per symbol. This is almost always 8. - - - 5 - - - 8 - - - 5 - - - - - + + - Stop bits + Show Advanced Port Settings - - - - - 0 - 0 - - - - Number of stop bits per symbol. This is almost always 2. - - - Number of stop bits per symbol. This is almost always 2. - - - Number of stop bits per symbol. This is almost always 2. - - - true - - - false - - - 1 - - - 2 - - - 2 - - + + + + + + Advanced + + + + + + + + Flow Control + + + + + + + Activate / deactivate hardware flow control. Commonly deactivated + + + Activate / deactivate hardware flow control. Commonly deactivated + + + Activate / deactivate hardware flow control. Commonly deactivated + + + Active + + + + + + + + + + + Parity + + + + + + + + + Set the parity. In most cases no parity (None) is used. + + + Set the parity. In most cases no parity (None) is used. + + + Set the parity. In most cases no parity (None) is used. + + + None + + + true + + + + + + + Set the parity. In most cases no parity (None) is used. + + + Set the parity. In most cases no parity (None) is used. + + + Set the parity. In most cases no parity (None) is used. + + + Odd + + + + + + + Set the parity. In most cases no parity (None) is used. + + + Set the parity. In most cases no parity (None) is used. + + + Set the parity. In most cases no parity (None) is used. + + + Even + + + + + + + + + + + + + Data bits + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Number of data bits per symbol. This is almost always 8. + + + Number of data bits per symbol. This is almost always 8. + + + Number of data bits per symbol. This is almost always 8. + + + 5 + + + 8 + + + 5 + + + + + + + + + + + Stop bits + + + + + + + + 0 + 0 + + + + Number of stop bits per symbol. This is almost always 2. + + + Number of stop bits per symbol. This is almost always 2. + + + Number of stop bits per symbol. This is almost always 2. + + + true + + + false + + + 1 + + + 2 + + + 2 + + + + + + + horizontalLayoutWidget + horizontalLayoutWidget_2 + horizontalLayoutWidget_4 + portlabel_5 + horizontalLayoutWidget_3 + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - + Qt::Vertical - 0 - 0 + 20 + 40 - - - - Data bits - - - -- 2.22.0