Line | |
---|
1 | #include "ScopeVariableStep.h"
|
---|
2 | #include "Scrollbar.h"
|
---|
3 | #include <QTime>
|
---|
4 | #include <qwt_plot_curve.h>
|
---|
5 |
|
---|
6 | ScopeVariableStep::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) {
|
---|
7 |
|
---|
8 | }
|
---|
9 |
|
---|
10 | ScopeVariableStep::~ScopeVariableStep() {
|
---|
11 |
|
---|
12 | }
|
---|
13 |
|
---|
14 | void ScopeVariableStep::plot(double value,QTime time,unsigned int curve_index) {
|
---|
15 | static QTime start_time=QTime::currentTime();
|
---|
16 | Curve* curve=curves.at(curve_index);
|
---|
17 |
|
---|
18 | elapsed_time_s=start_time.msecsTo(time)/1000.;
|
---|
19 | curve->data_x[curve->index]=elapsed_time_s;
|
---|
20 | curve->data_y[curve->index]=value;
|
---|
21 | curve->index++;
|
---|
22 |
|
---|
23 | updateCurve(curve);
|
---|
24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.