| 112 | |
| 113 | |
| 114 | void scopePlot::init(QString title) |
| 115 | { |
| 116 | |
| 117 | setup=true; |
| 118 | setCentralWidget(wd); |
| 119 | connect(ui.offsetWheel, SIGNAL(valueChanged(double)),SLOT(slotOffsetChanged(double ))); |
| 120 | connect(ui.rangeWheel, SIGNAL(valueChanged(double)), SLOT(slotRangeChanged(double ))); |
| 121 | connect(ui.samplesPushButton, SIGNAL(clicked()), this, SLOT(slotSamplesButtton())); |
| 122 | plW=ui.plotWindow; |
| 123 | plW->setTitle(title); |
| 124 | plW->setCanvasBackground(Qt::darkBlue); |
| 125 | curve1->attach(plW); |
| 126 | curve2->attach(plW); |
| 127 | curve3->attach(plW); |
| 128 | curve4->attach(plW); |
| 129 | plW->setAxisTitle(QwtPlot::xBottom,xAxisTitle); |
| 130 | plW->setAxisScale(QwtPlot::xBottom, 0, 100); |
| 131 | plW->setAxisTitle(QwtPlot::yLeft, "Values"); |
| 132 | plW->setAxisScale(QwtPlot::yLeft, -1.5, 1.5); |
| 133 | |
| 134 | QwtPlotGrid *grid = new QwtPlotGrid; |
| 135 | grid->enableXMin(true); |
| 136 | grid->setMajorPen(QPen(Qt::white, 0, Qt::DotLine)); |
| 137 | grid->setMinorPen(QPen(Qt::gray, 0 , Qt::DotLine)); |
| 138 | grid->attach(plW); |
| 139 | QwtText m1("M1"); |
| 140 | m1.setColor(QColor(Qt::white)); |
| 141 | marker1=new QwtPlotMarker(); |
| 142 | marker1->setValue(0.0, 0.0); |
| 143 | marker1->setLabel(m1); |
| 144 | marker1->setLabelAlignment(Qt::AlignRight | Qt::AlignBottom); |
| 145 | marker1->setLinePen(QPen(QColor(200,150,0), 0, Qt::DashDotLine)); |
| 146 | marker1->setSymbol( new QwtSymbol(QwtSymbol::Diamond,QColor(Qt::green), QColor(Qt::green), QSize(7,7))); |
| 147 | // marker1->hide(); |
| 148 | marker1->attach(plW); |
| 149 | |
| 150 | |
| 151 | |
| 152 | QwtText m2("M2"); |
| 153 | m2.setColor(QColor(Qt::white)); |
| 154 | marker2=new QwtPlotMarker(); |
| 155 | marker2->setValue(0.0, 0.0); |
| 156 | marker2->setLabel(m2); |
| 157 | marker2->setLabelAlignment(Qt::AlignLeft | Qt::AlignTop); |
| 158 | marker2->setLinePen(QPen(QColor(200,150,0), 0, Qt::DashDotLine)); |
| 159 | marker2->setSymbol( new QwtSymbol(QwtSymbol::Diamond,QColor(Qt::yellow), QColor(Qt::yellow), QSize(7,7))); |
| 160 | // marker2->hide(); |
| 161 | marker2->attach(plW); |
| 162 | |
| 163 | |
| 164 | |
| 165 | legend = new QwtLegend; |
| 166 | legend->setFrameStyle(QFrame::Box|QFrame::Sunken); |
| 167 | legend->setDefaultItemMode(QwtLegendData::Checkable); |
| 168 | QPalette pal(legend->palette()); |
| 169 | pal.setColor(QPalette::Window,Qt::darkBlue); |
| 170 | pal.setColor(QPalette::WindowText,Qt::white); |
| 171 | pal.setColor(QPalette::Text,Qt::black); |
nothing calls this directly
no test coverage detected