00001
00002
00003
00004
00005 #include "gapewaveformpalette.h"
00006
00007 GapeWaveformPalette::GapeWaveformPalette(QWidget* parent, const char * name, const QPixmap& icon)
00008 : GapeSimpleController(parent,name, icon) {
00009 preferredSize.setHeight(GAPE_SIMPLE_CONTROLLER_HEIGHT + GAPE_DRAWING_WIDGET_MIN_HEIGHT);
00010 if (GAPE_SIMPLE_CONTROLLER_WIDTH > GAPE_DRAWING_WIDGET_MIN_WIDTH) {
00011 preferredSize.setWidth(GAPE_SIMPLE_CONTROLLER_WIDTH);
00012 } else {
00013 preferredSize.setWidth(GAPE_DRAWING_WIDGET_MIN_WIDTH);
00014 }
00015
00016 palette = new GapeDrawingWidget(this);
00017 palette->setAxisTitle(QwtPlot::xBottom,"User Drawn Waveform");
00018 palette->setAxisTitle(QwtPlot::yLeft,"Amplitude");
00019 palette->setAxisScale(QwtPlot::xBottom, 0.0,1.0);
00020 palette->setAxisScale(QwtPlot::yLeft, -1.0,1.0);
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 columnLayout->insertWidget(0, palette);
00034
00035
00036 connect(palette, SIGNAL(emitPoint(double, double)), this, SLOT(setPoint(double, double)));
00037 }
00038
00039 GapeWaveformPalette::~GapeWaveformPalette() {}
00040
00041
00042 void GapeWaveformPalette::setPoint(double x, double y) {
00043
00044 emit emitPoint(x, (y * 2.0) - 1.0);
00045 requestUpdate();
00046 }