source: flair-src/trunk/tools/FlairGCS/src/ScopeVariableStep.cpp @ 15

Last change on this file since 15 was 15, checked in by Bayard Gildas, 6 years ago

sources reformatted with flair-format-dir script

File size: 1011 bytes
RevLine 
[10]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[10]4// %flair:license}
[9]5#include "ScopeVariableStep.h"
6#include "Scrollbar.h"
7#include <QTime>
8#include <qwt_plot_curve.h>
9
[15]10ScopeVariableStep::ScopeVariableStep(QString title, float ymin, float ymax,
11                                     float view_size_s,
12                                     unsigned int refresh_rate_ms,
13                                     unsigned int history_size)
14    : Scope(title, ymin, ymax, view_size_s, refresh_rate_ms, history_size) {}
[9]15
[15]16ScopeVariableStep::~ScopeVariableStep() {}
[9]17
[15]18void ScopeVariableStep::plot(double value, QTime time,
19                             unsigned int curve_index) {
20  static QTime start_time = QTime::currentTime();
21  Curve *curve = curves.at(curve_index);
[9]22
[15]23  elapsed_time_s = start_time.msecsTo(time) / 1000.;
24  curve->data_x[curve->index] = elapsed_time_s;
25  curve->data_y[curve->index] = value;
26  curve->index++;
[9]27
[15]28  updateCurve(curve);
[9]29}
Note: See TracBrowser for help on using the repository browser.