Changeset - 015cdfbbb791
[Not reviewed]
new-reader
0 4 0
Hasan Yavuz Ă–ZDERYA - 9 years ago 2016-05-23 15:08:51
hy@ozderya.net
removed skip byte button from the port control panel

it's now in binary stream reader settings
4 files changed with 2 insertions and 26 deletions:
0 comments (0 inline, 0 general)
src/mainwindow.cpp
Show inline comments
 
@@ -102,15 +102,12 @@ MainWindow::MainWindow(QWidget *parent) 
 
                     this, &MainWindow::close);
 

	
 
    // port control signals
 
    QObject::connect(&portControl, &PortControl::portToggled,
 
                     this, &MainWindow::onPortToggled);
 

	
 
    QObject::connect(&portControl, &PortControl::skipByteRequested,
 
                     &dataFormatPanel, &DataFormatPanel::requestSkipByte);
 

	
 
    connect(&plotControlPanel, &PlotControlPanel::numOfSamplesChanged,
 
            this, &MainWindow::onNumOfSamplesChanged);
 

	
 
    connect(&plotControlPanel, &PlotControlPanel::scaleChanged,
 
            ui->plot, &Plot::setAxis);
 

	
src/portcontrol.cpp
Show inline comments
 
@@ -112,16 +112,12 @@ PortControl::PortControl(QSerialPort* po
 
                                 (int) QSerialPort::SoftwareControl);
 

	
 
    QObject::connect(&flowControlButtons,
 
                     SELECT<int>::OVERLOAD_OF(&QButtonGroup::buttonClicked),
 
                     this, &PortControl::selectFlowControl);
 

	
 
    // init skip byte button
 
    QObject::connect(ui->pbSkipByte, &QPushButton::clicked,
 
                     [this](){emit skipByteRequested();});
 

	
 
    loadPortList();
 
    loadBaudRateList();
 
    ui->cbBaudRate->setCurrentIndex(ui->cbBaudRate->findText("9600"));
 
}
 

	
 
PortControl::~PortControl()
 
@@ -269,17 +265,12 @@ void PortControl::selectPort(QString por
 
            // open new selection by toggling
 
            togglePort();
 
        }
 
    }
 
}
 

	
 
void PortControl::enableSkipByte(bool enabled)
 
{
 
    ui->pbSkipByte->setDisabled(enabled);
 
}
 

	
 
QToolBar* PortControl::toolBar()
 
{
 
    return &portToolBar;
 
}
 

	
 
void PortControl::openActionTriggered(bool checked)
src/portcontrol.h
Show inline comments
 
@@ -61,13 +61,12 @@ private:
 

	
 
public slots:
 
    void loadPortList();
 
    void loadBaudRateList();
 
    void togglePort();
 
    void selectPort(QString portName);
 
    void enableSkipByte(bool enabled = true);
 

	
 
    void selectBaudRate(QString baudRate);
 
    void selectParity(int parity); // parity must be one of QSerialPort::Parity
 
    void selectDataBits(int dataBits); // bits must be one of QSerialPort::DataBits
 
    void selectStopBits(int stopBits); // stopBits must be one of QSerialPort::StopBits
 
    void selectFlowControl(int flowControl); // flowControl must be one of QSerialPort::FlowControl
 
@@ -76,11 +75,10 @@ private slots:
 
    void openActionTriggered(bool checked);
 

	
 
    void onCbPortListActivated(int index);
 
    void onTbPortListActivated(int index);
 

	
 
signals:
 
    void skipByteRequested();
 
    void portToggled(bool open);
 
};
 

	
 
#endif // PORTCONTROL_H
src/portcontrol.ui
Show inline comments
 
@@ -4,13 +4,13 @@
 
 <widget class="QWidget" name="PortControl">
 
  <property name="geometry">
 
   <rect>
 
    <x>0</x>
 
    <y>0</y>
 
    <width>631</width>
 
    <height>213</height>
 
    <height>232</height>
 
   </rect>
 
  </property>
 
  <property name="windowTitle">
 
   <string>Form</string>
 
  </property>
 
  <layout class="QHBoxLayout" name="horizontalLayout">
 
@@ -282,13 +282,13 @@
 
         <horstretch>0</horstretch>
 
         <verstretch>0</verstretch>
 
        </sizepolicy>
 
       </property>
 
       <property name="minimumSize">
 
        <size>
 
         <width>0</width>
 
         <width>85</width>
 
         <height>50</height>
 
        </size>
 
       </property>
 
       <property name="toolTip">
 
        <string>Toggle port status</string>
 
       </property>
 
@@ -298,22 +298,12 @@
 
       <property name="checkable">
 
        <bool>true</bool>
 
       </property>
 
      </widget>
 
     </item>
 
     <item>
 
      <widget class="QPushButton" name="pbSkipByte">
 
       <property name="toolTip">
 
        <string>Skip reading 1 byte to correct the alignment</string>
 
       </property>
 
       <property name="text">
 
        <string>Skip Byte</string>
 
       </property>
 
      </widget>
 
     </item>
 
     <item>
 
      <spacer name="verticalSpacer">
 
       <property name="orientation">
 
        <enum>Qt::Vertical</enum>
 
       </property>
 
       <property name="sizeHint" stdset="0">
 
        <size>
0 comments (0 inline, 0 general)