Last change
on this file since 15 was 15, checked in by Bayard Gildas, 8 years ago |
sources reformatted with flair-format-dir script
|
File size:
909 bytes
|
Rev | 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 "ScopeFixedStep.h"
|
---|
| 6 | #include "Scrollbar.h"
|
---|
| 7 | #include <qwt_plot_curve.h>
|
---|
| 8 |
|
---|
| 9 | ScopeFixedStep::ScopeFixedStep(QString title, float ymin, float ymax,
|
---|
| 10 | float step_s, float view_size_s,
|
---|
| 11 | unsigned int refresh_rate_ms,
|
---|
| 12 | unsigned int history_size)
|
---|
| 13 | : Scope(title, ymin, ymax, view_size_s, refresh_rate_ms, history_size) {
|
---|
| 14 | this->step_s = step_s;
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | ScopeFixedStep::~ScopeFixedStep() {}
|
---|
| 18 |
|
---|
| 19 | void ScopeFixedStep::plot(double *value) {
|
---|
| 20 | elapsed_time_s += step_s;
|
---|
| 21 | for (int i = 0; i < curves.count(); i++) {
|
---|
| 22 | Curve *curve = curves.at(i);
|
---|
| 23 |
|
---|
| 24 | curve->data_x[curve->index] = elapsed_time_s;
|
---|
| 25 | curve->data_y[curve->index] = value[i];
|
---|
| 26 | curve->index++;
|
---|
| 27 |
|
---|
| 28 | updateCurve(curve);
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.