|
|
|
//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
|
|
|
|
//Copyright: See COPYING file that comes with this distribution
|
|
|
|
|
|
|
|
#include <tqwidget.h>
|
|
|
|
|
|
|
|
#include <tqtrla.h>
|
|
|
|
|
|
|
|
class TQPixmap;
|
|
|
|
class TQLabel;
|
|
|
|
class TQVBoxLayout;
|
|
|
|
class TQGridLayout;
|
|
|
|
class TraceWidget;
|
|
|
|
|
|
|
|
class TraceData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TraceData(TQWidget* labelParent=0);
|
|
|
|
~TraceData();
|
|
|
|
void drawTrace(TQPainter* p, int graticule_width, int graticule_height);
|
|
|
|
|
|
|
|
public:
|
|
|
|
TQDoubleArray sampleArray;
|
|
|
|
TQDoubleArray positionArray;
|
|
|
|
unsigned int numberOfSamples;
|
|
|
|
TQColor color;
|
|
|
|
bool enabled;
|
|
|
|
double leftEdge;
|
|
|
|
double rightEdge;
|
|
|
|
double topEdge;
|
|
|
|
double bottomEdge;
|
|
|
|
TQString traceName;
|
|
|
|
TQString horizontalUnits;
|
|
|
|
TQString verticalUnits;
|
|
|
|
TQLabel* infoLabel;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef TQMemArray<TraceData*> TraceList;
|
|
|
|
|
|
|
|
class GraticuleWidget : public TQWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
GraticuleWidget(TraceWidget*, const char* = 0);
|
|
|
|
~GraticuleWidget();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void paintEvent(TQPaintEvent*);
|
|
|
|
virtual void resizeEvent(TQResizeEvent *);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void updateGraticule();
|
|
|
|
|
|
|
|
private:
|
|
|
|
TraceWidget* m_base;
|
|
|
|
TQPixmap* m_graticulePixmap;
|
|
|
|
|
|
|
|
friend class TraceWidget;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TraceWidget : public TQWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
TraceWidget(TQWidget* = 0, const char* = 0);
|
|
|
|
~TraceWidget();
|
|
|
|
|
|
|
|
void setNumberOfSamples(uint traceNumber, unsigned int samples);
|
|
|
|
void setNumberOfHorizontalDivisions(unsigned int divisions);
|
|
|
|
void setNumberOfVerticalDivisions(unsigned int divisions);
|
|
|
|
void setDisplayLimits(uint traceNumber, double x, double y, double w, double h);
|
|
|
|
|
|
|
|
TQDoubleArray& samples(uint traceNumber);
|
|
|
|
void setSamples(uint traceNumber, TQDoubleArray&);
|
|
|
|
TQDoubleArray& positions(uint traceNumber);
|
|
|
|
void setPositions(uint traceNumber, TQDoubleArray&);
|
|
|
|
TQColor& traceColor(uint traceNumber);
|
|
|
|
void setTraceColor(uint traceNumber, TQColor&);
|
|
|
|
bool traceEnabled(uint traceNumber);
|
|
|
|
void setTraceEnabled(uint traceNumber, bool enabled);
|
|
|
|
TQString traceName(uint traceNumber);
|
|
|
|
void setTraceName(uint traceNumber, TQString name);
|
|
|
|
TQString traceHorizontalUnits(uint traceNumber);
|
|
|
|
void setTraceHorizontalUnits(uint traceNumber, TQString units);
|
|
|
|
TQString traceVerticalUnits(uint traceNumber);
|
|
|
|
void setTraceVerticalUnits(uint traceNumber, TQString units);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void updateTraceText();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void resizeTraceArray(uint newsize);
|
|
|
|
|
|
|
|
private:
|
|
|
|
unsigned int m_horizDivs;
|
|
|
|
unsigned int m_vertDivs;
|
|
|
|
TraceList m_traceArray;
|
|
|
|
TQVBoxLayout* m_primaryLayout;
|
|
|
|
TQGridLayout* m_traceLabelLayout;
|
|
|
|
GraticuleWidget* m_graticuleWidget;
|
|
|
|
|
|
|
|
friend class GraticuleWidget;
|
|
|
|
};
|