Changeset - ba9c69189b81
[Not reviewed]
Merge channelmanager
0 4 1
Hasan Yavuz ÖZDERYA - 10 years ago 2016-03-27 16:56:31
hy@ozderya.net
Merge with default
5 files changed with 38 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/dataformatpanel.cpp
Show inline comments
 
@@ -180,13 +180,13 @@ void DataFormatPanel::enableDemo(bool en
 
    }
 
}
 

	
 
void DataFormatPanel::spsTimerTimeout()
 
{
 
    unsigned currentSps = _samplesPerSecond;
 
    _samplesPerSecond = sampleCount/SPS_UPDATE_TIMEOUT;
 
    _samplesPerSecond = (sampleCount/_numOfChannels)/SPS_UPDATE_TIMEOUT;
 
    if (currentSps != _samplesPerSecond)
 
    {
 
        emit samplesPerSecondChanged(_samplesPerSecond);
 
    }
 
    sampleCount = 0;
 
}
src/defines.h
Show inline comments
 
new file 100644
 
/*
 
  Copyright © 2016 Hasan Yavuz Özderya
 

	
 
  This file is part of serialplot.
 

	
 
  serialplot is free software: you can redistribute it and/or modify
 
  it under the terms of the GNU General Public License as published by
 
  the Free Software Foundation, either version 3 of the License, or
 
  (at your option) any later version.
 

	
 
  serialplot is distributed in the hope that it will be useful,
 
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  GNU General Public License for more details.
 

	
 
  You should have received a copy of the GNU General Public License
 
  along with serialplot.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
const char* BUG_REPORT_URL = "https://bitbucket.org/hyOzd/serialplot/issues/new";
src/mainwindow.cpp
Show inline comments
 
@@ -22,22 +22,24 @@
 
#include <QByteArray>
 
#include <QApplication>
 
#include <QFileDialog>
 
#include <QFile>
 
#include <QTextStream>
 
#include <QMenu>
 
#include <QDesktopServices>
 
#include <QtDebug>
 
#include <qwt_plot.h>
 
#include <limits.h>
 
#include <cmath>
 
#include <iostream>
 

	
 
#include <plot.h>
 

	
 
#include "framebufferseries.h"
 
#include "utils.h"
 
#include "defines.h"
 
#include "version.h"
 

	
 
#if defined(Q_OS_WIN) && defined(QT_STATIC)
 
#include <QtPlugin>
 
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
 
#endif
 
@@ -92,12 +94,15 @@ MainWindow::MainWindow(QWidget *parent) 
 
    // init UI signals
 

	
 
    // menu signals
 
    QObject::connect(ui->actionHelpAbout, &QAction::triggered,
 
              &aboutDialog, &QWidget::show);
 

	
 
    QObject::connect(ui->actionReportBug, &QAction::triggered,
 
                     [](){QDesktopServices::openUrl(QUrl(BUG_REPORT_URL));});
 

	
 
    QObject::connect(ui->actionExportCsv, &QAction::triggered,
 
                     this, &MainWindow::onExportCsv);
 

	
 
    ui->actionQuit->setShortcutContext(Qt::ApplicationShortcut);
 

	
 
    QObject::connect(ui->actionQuit, &QAction::triggered,
 
@@ -202,13 +207,13 @@ MainWindow::MainWindow(QWidget *parent) 
 

	
 
    QObject::connect(ui->cbRangePresets, SIGNAL(activated(int)),
 
                     this, SLOT(onRangeSelected()));
 

	
 
    // Init sps (sample per second) counter
 
    spsLabel.setText("0sps");
 
    spsLabel.setToolTip("samples per second (total of all channels)");
 
    spsLabel.setToolTip("samples per second (per channel)");
 
    ui->statusBar->addPermanentWidget(&spsLabel);
 
    QObject::connect(&dataFormatPanel,
 
                     &DataFormatPanel::samplesPerSecondChanged,
 
                     this, &MainWindow::onSpsChanged);
 

	
 
    // init demo
src/mainwindow.ui
Show inline comments
 
@@ -247,12 +247,13 @@
 
   </property>
 
   <widget class="QMenu" name="menuHelp">
 
    <property name="title">
 
     <string>Help</string>
 
    </property>
 
    <addaction name="actionDemoMode"/>
 
    <addaction name="actionReportBug"/>
 
    <addaction name="actionHelpAbout"/>
 
   </widget>
 
   <widget class="QMenu" name="menuFile">
 
    <property name="title">
 
     <string>File</string>
 
    </property>
 
@@ -337,12 +338,20 @@
 
    <string>Quit</string>
 
   </property>
 
   <property name="shortcut">
 
    <string>Ctrl+Q</string>
 
   </property>
 
  </action>
 
  <action name="actionReportBug">
 
   <property name="text">
 
    <string>Report a Bug</string>
 
   </property>
 
   <property name="toolTip">
 
    <string>Report a Bug on SerialPlot Website</string>
 
   </property>
 
  </action>
 
 </widget>
 
 <layoutdefault spacing="6" margin="11"/>
 
 <customwidgets>
 
  <customwidget>
 
   <class>Plot</class>
 
   <extends>QWidget</extends>
src/plot.cpp
Show inline comments
 
@@ -151,21 +151,23 @@ void Plot::darkBackground(bool enabled)
 
        setCanvasBackground(QBrush(Qt::black));
 
        gridColor.setHsvF(0, 0, 0.25);
 
        grid.setPen(gridColor);
 
        zoomer.setRubberBandPen(QPen(Qt::white));
 
        zoomer.setTrackerPen(QPen(Qt::white));
 
        sZoomer.setPickerPen(QPen(Qt::white));
 
        legend.setTextPen(QPen(Qt::white));
 
    }
 
    else
 
    {
 
        setCanvasBackground(QBrush(Qt::white));
 
        gridColor.setHsvF(0, 0, 0.80);
 
        grid.setPen(gridColor);
 
        zoomer.setRubberBandPen(QPen(Qt::black));
 
        zoomer.setTrackerPen(QPen(Qt::black));
 
        sZoomer.setPickerPen(QPen(Qt::black));
 
        legend.setTextPen(QPen(Qt::black));
 
    }
 
    replot();
 
}
 

	
 
/*
 
  Below crude drawing demostrates how color selection occurs for
0 comments (0 inline, 0 general)