void MainWindow
::View_tank_Details(QString local
) {
for (refIndx=0; refIndx<16; refIndx++)
{
if (cardinalP[refIndx].contains(local))
{
//ui->Tanque1Level->display((fuelvalues[refIndx]*FUELTANKCAP)/1023);
TankIndex = refIndx;
ui->Tanque1Level->display(rand() % 30000);
ui->GraphTitle->setText(local);
}
}
myPlot
= new QwtPlot(ui
->GraphPlot
);
myPlot->setGeometry( 5, 70, 590, 325 );
myPlot->setStyleSheet("background-color:black; color:rgb(255,255,255);border: 0px;");
//myPlot->setTitle(title);
myPlot
->setAxisTitle
(QwtPlot::xBottom,
"Horas");
myPlot
->setAxisTitle
(QwtPlot::yLeft,
"Litros");
myPlot
->setAxisScale
(QwtPlot::xBottom,
0,
96);
//48); myPlot
->setAxisMaxMajor
(QwtPlot::xBottom,
12);
//24); myPlot
->setAxisMaxMinor
(QwtPlot::xBottom,
0);
myPlot
->setAxisScale
(QwtPlot::yLeft,
0,
30000);
// grid
grid->enableXMin(true);
grid
->setMajPen
(QPen(Qt
::white,
0, Qt
::DotLine));
grid
->setMinPen
(QPen(Qt
::white,
0 , Qt
::DotLine));
grid->attach(myPlot);
for (int i = 0; i < 97; i++)//49; i++)
{
xplot[i] = i;
//yplot[i] = (rand() % 30000);//i * (rand() % 30000) * cos(i / M_PI);
yplot[i] = (i * (rand() % 300) * cos(i / M_PI));
//yplot[i] = testcnt;
}
//m_curve->setPen(QColor(Qt::yellow));
m_curve
->setPen
(QPen(QColor::fromRgb(0,
0,
255),
1));
m_curve->setRawSamples(xplot, yplot, 97);//49);
m_curve->setTitle("Curva do nivel de combustivel");
m_curve->attach(myPlot);
myPlot->canvas());
d_picker
->setRubberBandPen
(QColor(Qt
::green));
d_picker
->setRubberBand
(QwtPicker::CrossRubberBand);
d_picker
->setTrackerPen
(QColor(Qt
::yellow));
myPlot->show();
}