* 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>
using std::deque;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QColor AnalogSignal::SignalColours[4] = {
QColor(0xC4, 0xA0, 0x00), // Yellow
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());
- QPointF *points = new QPointF[sample_count];
+ QPointF *points = new QPointF[end - start];
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;
- *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);
- delete[] samples;
delete[] points;
}
owner_->row_item_appearance_changed(false, true);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv