Changeset - 60f4eedd8b5e
[Not reviewed]
plot-manager
0 6 0
Hasan Yavuz Ă–ZDERYA - 9 years ago 2016-08-28 16:58:01
hy@ozderya.net
moved "Multi Plot" from plot control tab to view menu
6 files changed with 14 insertions and 27 deletions:
0 comments (0 inline, 0 general)
src/mainwindow.cpp
Show inline comments
 
@@ -119,9 +119,6 @@ MainWindow::MainWindow(QWidget *parent) 
 
    connect(&plotControlPanel, &PlotControlPanel::scaleChanged,
 
            plotMan, &PlotManager::setAxis);
 

	
 
    connect(&plotControlPanel, &PlotControlPanel::multiPlotChanged,
 
            plotMan, &PlotManager::setMulti);
 

	
 
    QObject::connect(ui->actionClear, SIGNAL(triggered(bool)),
 
                     this, SLOT(clearPlot()));
 

	
src/plotcontrolpanel.cpp
Show inline comments
 
@@ -60,9 +60,6 @@ PlotControlPanel::PlotControlPanel(QWidg
 
    connect(ui->spYmin, SIGNAL(valueChanged(double)),
 
            this, SLOT(onYScaleChanged()));
 

	
 
    connect(ui->cbMultiPlot, &QCheckBox::toggled,
 
            this, &PlotControlPanel::multiPlotChanged);
 

	
 
    // init scale range preset list
 
    for (int nbits = 8; nbits <= 24; nbits++) // signed binary formats
 
    {
 
@@ -153,8 +150,3 @@ void PlotControlPanel::setChannelNamesMo
 
{
 
    ui->lvChannelNames->setModel(model);
 
}
 

	
 
bool PlotControlPanel::multiPlot()
 
{
 
    return ui->cbMultiPlot->isChecked();
 
}
src/plotcontrolpanel.h
Show inline comments
 
@@ -39,14 +39,12 @@ public:
 
    bool autoScale();
 
    double yMax();
 
    double yMin();
 
    bool multiPlot(); ///< returns true if multi plot is selected
 

	
 
    void setChannelNamesModel(QAbstractItemModel * model);
 

	
 
signals:
 
    void numOfSamplesChanged(int value);
 
    void scaleChanged(bool autoScaled, double yMin = 0, double yMax = 1);
 
    void multiPlotChanged(bool enabled);
 

	
 
private:
 
    Ui::PlotControlPanel *ui;
src/plotcontrolpanel.ui
Show inline comments
 
@@ -7,7 +7,7 @@
 
    <x>0</x>
 
    <y>0</y>
 
    <width>590</width>
 
    <height>183</height>
 
    <height>187</height>
 
   </rect>
 
  </property>
 
  <property name="windowTitle">
 
@@ -147,9 +147,6 @@
 
       </property>
 
      </widget>
 
     </item>
 
     <item row="4" column="1">
 
      <widget class="QComboBox" name="cbRangePresets"/>
 
     </item>
 
     <item row="4" column="0">
 
      <widget class="QLabel" name="label">
 
       <property name="text">
 
@@ -157,15 +154,8 @@
 
       </property>
 
      </widget>
 
     </item>
 
     <item row="5" column="0">
 
      <widget class="QCheckBox" name="cbMultiPlot">
 
       <property name="toolTip">
 
        <string>Plot all channels separately</string>
 
       </property>
 
       <property name="text">
 
        <string>Multi Plot</string>
 
       </property>
 
      </widget>
 
     <item row="4" column="1">
 
      <widget class="QComboBox" name="cbRangePresets"/>
 
     </item>
 
    </layout>
 
   </item>
src/plotmanager.cpp
Show inline comments
 
@@ -31,7 +31,8 @@ PlotManager::PlotManager(QWidget* plotAr
 
    showMinorGridAction("Minor Grid", this),
 
    unzoomAction("Unzoom", this),
 
    darkBackgroundAction("Dark Background", this),
 
    showLegendAction("Legend", this)
 
    showLegendAction("Legend", this),
 
    showMultiAction("Multi Plot", this)
 
{
 
    _autoScaled = true;
 
    _yMin = 0;
 
@@ -50,6 +51,7 @@ PlotManager::PlotManager(QWidget* plotAr
 
    unzoomAction.setToolTip("Unzoom the Plot");
 
    darkBackgroundAction.setToolTip("Enable Dark Plot Background");
 
    showLegendAction.setToolTip("Display the Legend on Plot");
 
    showMultiAction.setToolTip("Display All Channels Separately");
 

	
 
    showGridAction.setShortcut(QKeySequence("G"));
 
    showMinorGridAction.setShortcut(QKeySequence("M"));
 
@@ -58,11 +60,13 @@ PlotManager::PlotManager(QWidget* plotAr
 
    showMinorGridAction.setCheckable(true);
 
    darkBackgroundAction.setCheckable(true);
 
    showLegendAction.setCheckable(true);
 
    showMultiAction.setCheckable(true);
 

	
 
    showGridAction.setChecked(false);
 
    showMinorGridAction.setChecked(false);
 
    darkBackgroundAction.setChecked(false);
 
    showLegendAction.setChecked(true);
 
    showMultiAction.setChecked(false);
 

	
 
    showMinorGridAction.setEnabled(false);
 

	
 
@@ -77,6 +81,10 @@ PlotManager::PlotManager(QWidget* plotAr
 
            this, &PlotManager::darkBackground);
 
    connect(&showLegendAction, SELECT<bool>::OVERLOAD_OF(&QAction::triggered),
 
            this, &PlotManager::showLegend);
 
    connect(&showLegendAction, SELECT<bool>::OVERLOAD_OF(&QAction::triggered),
 
            this, &PlotManager::showLegend);
 
    connect(&showMultiAction, SELECT<bool>::OVERLOAD_OF(&QAction::triggered),
 
            this, &PlotManager::setMulti);
 
}
 

	
 
PlotManager::~PlotManager()
 
@@ -279,6 +287,7 @@ QList<QAction*> PlotManager::menuActions
 
    actions << &unzoomAction;
 
    actions << &darkBackgroundAction;
 
    actions << &showLegendAction;
 
    actions << &showMultiAction;
 
    return actions;
 
}
 

	
src/plotmanager.h
Show inline comments
 
@@ -81,6 +81,7 @@ private:
 
    QAction unzoomAction;
 
    QAction darkBackgroundAction;
 
    QAction showLegendAction;
 
    QAction showMultiAction;
 

	
 
    void setupLayout(bool multiPlot);
 
    /// Inserts a new plot widget to the current layout.
0 comments (0 inline, 0 general)