Changeset - 2f04c80c72e3
[Not reviewed]
plot-manager
0 5 0
Hasan Yavuz Ă–ZDERYA - 9 years ago 2016-08-28 16:08:47
hy@ozderya.net
implemented PlotManager::flashSnapshotOverlay
5 files changed with 19 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/mainwindow.cpp
Show inline comments
 
@@ -133,7 +133,7 @@ MainWindow::MainWindow(QWidget *parent) 
 
                     this, SLOT(clearPlot()));
 

	
 
    QObject::connect(snapshotMan.takeSnapshotAction(), &QAction::triggered,
 
                     ui->plot, &Plot::flashSnapshotOverlay);
 
                     plotMan, &PlotManager::flashSnapshotOverlay);
 

	
 
    // init port signals
 
    QObject::connect(&(this->serialPort), SIGNAL(error(QSerialPort::SerialPortError)),
src/plot.cpp
Show inline comments
 
@@ -181,14 +181,12 @@ QColor Plot::makeColor(unsigned int chan
 
    }
 
}
 

	
 
void Plot::flashSnapshotOverlay()
 
void Plot::flashSnapshotOverlay(bool light)
 
{
 
    if (snapshotOverlay != NULL) delete snapshotOverlay;
 

	
 
    QColor color;
 
    // TODO: fix snapshot overlay
 
    // if (darkBackgroundAction.isChecked())
 
    if(1)
 
    if(light)
 
    {
 
        color = QColor(Qt::white);
 
    }
src/plot.h
Show inline comments
 
@@ -64,7 +64,12 @@ public slots:
 
    void darkBackground(bool enabled = true);
 
    void setAxis(bool autoScaled, double yMin = 0, double yMax = 1);
 

	
 
    void flashSnapshotOverlay();
 
    /**
 
     * Displays an animation for snapshot.
 
     *
 
     * @param light show a light colored (white) animation or the opposite
 
     */
 
    void flashSnapshotOverlay(bool light);
 

	
 
private slots:
 
    void unzoomed();
src/plotmanager.cpp
Show inline comments
 
@@ -328,3 +328,11 @@ void PlotManager::setAxis(bool autoScale
 
        plot->setAxis(autoScaled, yAxisMin, yAxisMax);
 
    }
 
}
 

	
 
void PlotManager::flashSnapshotOverlay()
 
{
 
    for (auto plot : plotWidgets)
 
    {
 
        plot->flashSnapshotOverlay(darkBackgroundAction.isChecked());
 
    }
 
}
src/plotmanager.h
Show inline comments
 
@@ -63,6 +63,8 @@ public slots:
 
    void showDemoIndicator(bool show = true);
 
    /// Set the Y axis
 
    void setAxis(bool autoScaled, double yMin = 0, double yMax = 1);
 
    /// Display an animation for snapshot
 
    void flashSnapshotOverlay();
 

	
 
private:
 
    bool isMulti;
0 comments (0 inline, 0 general)