File indexing completed on 2024-04-21 05:43:43

0001 /***************************************************************************
0002  *   Copyright (C) 2005 by John Myers                                      *
0003  *   electronerd@electronerdia.net                                         *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  ***************************************************************************/
0010 
0011 #ifndef SCOPESCREENVIEW_H
0012 #define SCOPESCREENVIEW_H
0013 #include "scopeviewbase.h"
0014 #include <QFrame>
0015 class QTimer;
0016 
0017 /// Screen-type Oscilloscope data view
0018 /**
0019 An Oscilloscope screen, as opposed to a paper tape (the current Oscilloscope)
0020 
0021     @author John Myers
0022 */
0023 class ScopeScreenView : public ScopeViewBase
0024 {
0025     Q_OBJECT
0026 public:
0027     ScopeScreenView(QWidget *parent = nullptr);
0028 
0029     ~ScopeScreenView() override;
0030     // virtual void drawContents(QPainter * p);
0031     void drawBackground(QPainter &p) override;
0032 
0033     /// Draw the horizontal line indicating the midpoint of our output for \c probe
0034     void drawMidLine(QPainter &p, ProbeData *probe) override;
0035 
0036     ///\TODO: remove virtual; draw one logic probe
0037     void drawProbe(QPainter &p, LogicProbeData *probe) override;
0038     ///\TODO: remove virtual; draw one floating-point probe
0039     void drawProbe(QPainter &p, FloatingProbeData *probe) override;
0040 
0041     /// gives the first Simulator tick visible in the view
0042     llong visibleStartTime() const override
0043     {
0044         return 0;
0045     }
0046     /// gives the last Simulator tick visible in the view
0047     llong visibleEndTime() const override
0048     {
0049         return 0;
0050     }
0051 
0052     double ticksPerPixel() const override
0053     {
0054         return 0;
0055     }
0056     llong pixelsPerTick() const override
0057     {
0058         return 0;
0059     }
0060 
0061 public slots:
0062     void setIntervalsX(int value);
0063     void setTicksPerIntervalX(int value);
0064     void setOffsetX(int value);
0065 
0066     void updateViewTimeout();
0067 
0068 private:
0069     int m_intervalsX;
0070     int m_ticksPerIntervalX;
0071     int m_offsetX;
0072 
0073     QTimer *m_updateViewTmr;
0074 };
0075 
0076 #endif