projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Switch segment storage from single vector to vector of arrays
[pulseview.git]
/
pv
/
view
/
analogsignal.cpp
diff --git
a/pv/view/analogsignal.cpp
b/pv/view/analogsignal.cpp
index 20004777cac2eda854cd4d97fcb3f1a327081f16..41f46dfcc75b414e47fbf8dd6bf47d2d7ff8502a 100644
(file)
--- a/
pv/view/analogsignal.cpp
+++ b/
pv/view/analogsignal.cpp
@@
-14,8
+14,7
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <extdef.h>
*/
#include <extdef.h>
@@
-241,26
+240,25
@@
void AnalogSignal::paint_trace(QPainter &p,
int y, int left, const int64_t start, const int64_t end,
const double pixels_offset, const double samples_per_pixel)
{
int y, int left, const int64_t start, const int64_t end,
const double pixels_offset, const double samples_per_pixel)
{
- const int64_t sample_count = end - start;
-
- const float *const samples = segment->get_samples(start, end);
- assert(samples);
-
p.setPen(base_->colour());
p.setPen(base_->colour());
- QPointF *points = new QPointF[
sample_coun
t];
+ QPointF *points = new QPointF[
end - star
t];
QPointF *point = points;
QPointF *point = points;
+ pv::data::SegmentAnalogDataIterator* it =
+ segment->begin_sample_iteration(start);
+
for (int64_t sample = start; sample != end; sample++) {
const float x = (sample / samples_per_pixel -
pixels_offset) + left;
for (int64_t sample = start; sample != end; sample++) {
const float x = (sample / samples_per_pixel -
pixels_offset) + left;
- *point++ = QPointF(x,
- y - samples[sample - start] * scale_);
+
+ *point++ = QPointF(x, y - *((float*)it->value) * scale_);
+ segment->continue_sample_iteration(it, 1);
}
}
+ segment->end_sample_iteration(it);
p.drawPolyline(points, point - points);
p.drawPolyline(points, point - points);
- delete[] samples;
delete[] points;
}
delete[] points;
}