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

Last change on this file since 13 was 10, checked in by Sanahuja Guillaume, 8 years ago

lic

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