Changeset - 2fb7fd9515d1
[Not reviewed]
default
0 2 0
Hasan Yavuz Ă–ZDERYA - 9 years ago 2016-06-14 21:53:37
hy@ozderya.net
increased default window hight and made sure ascii reader never reports number of channels as 0
2 files changed with 10 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/asciireader.cpp
Show inline comments
 
@@ -30,17 +30,12 @@ AsciiReader::AsciiReader(QIODevice* devi
 
    paused = false;
 
    discardFirstLine = true;
 
    sampleCount = 0;
 

	
 
    _numOfChannels = _settingsWidget.numOfChannels();
 
    autoNumOfChannels = (_numOfChannels == NUMOFCHANNELS_AUTO);
 
    // do not allow '0'
 
    if (_numOfChannels == 0)
 
    {
 
        _numOfChannels = 1;
 
    }
 

	
 
    connect(&_settingsWidget, &AsciiReaderSettings::numOfChannelsChanged,
 
            [this](unsigned value)
 
            {
 
                _numOfChannels = value;
 
                autoNumOfChannels = (_numOfChannels == NUMOFCHANNELS_AUTO);
 
@@ -57,13 +52,21 @@ QWidget* AsciiReader::settingsWidget()
 
{
 
    return &_settingsWidget;
 
}
 

	
 
unsigned AsciiReader::numOfChannels()
 
{
 
    return _numOfChannels;
 
    // do not allow '0'
 
    if (_numOfChannels == 0)
 
    {
 
        return 1;
 
    }
 
    else
 
    {
 
        return _numOfChannels;
 
    }
 
}
 

	
 
// TODO: this could be a part of AbstractReader
 
void AsciiReader::enable(bool enabled)
 
{
 
    if (enabled)
src/mainwindow.ui
Show inline comments
 
@@ -4,13 +4,13 @@
 
 <widget class="QMainWindow" name="MainWindow">
 
  <property name="geometry">
 
   <rect>
 
    <x>0</x>
 
    <y>0</y>
 
    <width>653</width>
 
    <height>534</height>
 
    <height>650</height>
 
   </rect>
 
  </property>
 
  <property name="windowTitle">
 
   <string>SerialPlot</string>
 
  </property>
 
  <widget class="QWidget" name="centralWidget">
0 comments (0 inline, 0 general)