Changeset - c6033ffac487
[Not reviewed]
default
0 2 0
Hasan Yavuz Ă–ZDERYA - 11 years ago 2015-03-08 08:12:49
hy@ozderya.net
inverted functionality of the Start button, pause makes more sense
2 files changed with 9 insertions and 6 deletions:
0 comments (0 inline, 0 general)
mainwindow.cpp
Show inline comments
 
@@ -159,25 +159,25 @@ void MainWindow::selectBaudRate(QString 
 
            qDebug() << "Baud rate changed: " << serialPort.baudRate();
 
        }
 
    }
 
}
 

	
 
void MainWindow::onPortToggled(bool open)
 
{
 
    ui->pbOpenPort->setChecked(open);
 
}
 

	
 
void MainWindow::onDataReady()
 
{
 
    if (ui->actionStart->isChecked())
 
    if (!ui->actionPause->isChecked())
 
    {
 
        QByteArray data = serialPort.readAll();
 
        addData((unsigned char)(data[0]));
 
    }
 
}
 

	
 
void MainWindow::onPortError(QSerialPort::SerialPortError error)
 
{
 
    switch(error)
 
    {
 
        case QSerialPort::NoError :
 
            break;
mainwindow.ui
Show inline comments
 
@@ -398,25 +398,25 @@
 
       </layout>
 
      </widget>
 
     </widget>
 
    </item>
 
   </layout>
 
  </widget>
 
  <widget class="QMenuBar" name="menuBar">
 
   <property name="geometry">
 
    <rect>
 
     <x>0</x>
 
     <y>0</y>
 
     <width>653</width>
 
     <height>23</height>
 
     <height>20</height>
 
    </rect>
 
   </property>
 
   <widget class="QMenu" name="menuFile">
 
    <property name="title">
 
     <string>File</string>
 
    </property>
 
    <addaction name="actionFileLoadProfile"/>
 
    <addaction name="actionFileSaveProfile"/>
 
   </widget>
 
   <widget class="QMenu" name="menuHelp">
 
    <property name="title">
 
     <string>Help</string>
 
@@ -425,37 +425,40 @@
 
    <addaction name="actionHelpAbout"/>
 
   </widget>
 
   <addaction name="menuFile"/>
 
   <addaction name="menuHelp"/>
 
  </widget>
 
  <widget class="QToolBar" name="mainToolBar">
 
   <attribute name="toolBarArea">
 
    <enum>TopToolBarArea</enum>
 
   </attribute>
 
   <attribute name="toolBarBreak">
 
    <bool>false</bool>
 
   </attribute>
 
   <addaction name="actionStart"/>
 
   <addaction name="actionPause"/>
 
   <addaction name="actionClear"/>
 
  </widget>
 
  <widget class="QStatusBar" name="statusBar"/>
 
  <action name="actionStart">
 
  <action name="actionPause">
 
   <property name="checkable">
 
    <bool>true</bool>
 
   </property>
 
   <property name="checked">
 
    <bool>true</bool>
 
    <bool>false</bool>
 
   </property>
 
   <property name="text">
 
    <string>Start</string>
 
    <string>Pause</string>
 
   </property>
 
   <property name="toolTip">
 
    <string>Pause Plotting</string>
 
   </property>
 
  </action>
 
  <action name="actionClear">
 
   <property name="text">
 
    <string>Clear</string>
 
   </property>
 
  </action>
 
  <action name="actionHelpDataFormats">
 
   <property name="text">
 
    <string>Data Formats</string>
 
   </property>
 
  </action>
0 comments (0 inline, 0 general)