QMSMFormMemory::QMSMFormMemory(QWidget *pParent, NData::CDataHandler *pDataHandler) : QMSMFormMeasurementAbstract(pParent, pDataHandler), mpCurveMemoryCpu(new QwtPlotCurve("CPU RAM")), mpCurveSwapCpu(new QwtPlotCurve("CPU SWAP")), mpCurveMemoryGpu(new QwtPlotCurve("GPU")), mpCurveMemoryMic(new QwtPlotCurve("MIC")) { setWindowTitle(QApplication::translate("FormMeasurement", "Memory", 0, QApplication::UnicodeUTF8)); qwtPlot->setAxisTitle(QwtPlot::yLeft, createTitle(QString::fromUtf8("Memory [MiB]"))); mpCurveMemoryCpu->setPen(mColorCpu); mpCurveSwapCpu->setPen(mColorCpuAlternative); mpCurveMemoryGpu->setPen(mColorGpu); mpCurveMemoryMic->setPen(mColorMic); setupCurves(); mpCurveMemoryCpu->attach(qwtPlot); mpCurveSwapCpu->attach(qwtPlot); mpCurveMemoryGpu->attach(qwtPlot); mpCurveMemoryMic->attach(qwtPlot); qwtPlot->insertLegend(mpLegend, QwtPlot::BottomLegend); }
QMSMFormTemperature::QMSMFormTemperature(QWidget *pParent, NData::CDataHandler *pDataHandler) : QMSMFormMeasurementAbstract(pParent, pDataHandler), mpCurveTempCpu0(new QwtPlotCurve("CPU0")), mpCurveTempCpu1(new QwtPlotCurve("CPU1")), mpCurveTempGpu(new QwtPlotCurve("GPU")), mpCurveTempFpgaM(new QwtPlotCurve("Compute FPGA")), mpCurveTempFpgaI(new QwtPlotCurve("Interface FPGA")), mpCurveTempMic(new QwtPlotCurve("MIC Die")), mpCurveTempSystem(new QwtPlotCurve("Mainboard")) { setWindowTitle(QApplication::translate("FormMeasurement", "Temperature", 0, QApplication::UnicodeUTF8)); qwtPlot->setAxisTitle(QwtPlot::yLeft, createTitle(QString::fromUtf8("Temperature [°C]"))); mpCurveTempCpu0->setPen(mColorCpu); mpCurveTempCpu1->setPen(mColorCpuAlternative); mpCurveTempGpu->setPen(mColorGpu); mpCurveTempFpgaM->setPen(mColorFpga); mpCurveTempFpgaI->setPen(mColorFpgaAlternative); mpCurveTempMic->setPen(mColorMic); mpCurveTempSystem->setPen(mColorSystem); setupCurves(); mpCurveTempCpu0->attach(qwtPlot); mpCurveTempCpu1->attach(qwtPlot); mpCurveTempGpu->attach(qwtPlot); mpCurveTempFpgaM->attach(qwtPlot); mpCurveTempFpgaI->attach(qwtPlot); mpCurveTempMic->attach(qwtPlot); mpCurveTempSystem->attach(qwtPlot); qwtPlot->insertLegend(mpLegend, QwtPlot::BottomLegend); }
QMSMFormPower::QMSMFormPower(QWidget *pParent, NData::CDataHandler *pDataHandler) : QMSMFormMeasurementAbstract(pParent, pDataHandler), mpCurvePowerCpu0(new QwtPlotCurve("CPU0")), mpCurvePowerCpu1(new QwtPlotCurve("CPU1")), mpCurvePowerGpu(new QwtPlotCurve("GPU")), mpCurvePowerFpga(new QwtPlotCurve("FPGA")), mpCurvePowerMic(new QwtPlotCurve("MIC")), mpCurvePowerSystem(new QwtPlotCurve("System")) { setWindowTitle(QApplication::translate("FormMeasurement", "Power", 0, QApplication::UnicodeUTF8)); qwtPlot->setAxisTitle(QwtPlot::yLeft, createTitle(QString::fromUtf8("Power [W]"))); mpCurvePowerCpu0->setPen(mColorCpu); mpCurvePowerCpu1->setPen(mColorCpuAlternative); mpCurvePowerGpu->setPen(mColorGpu); mpCurvePowerFpga->setPen(mColorFpga); mpCurvePowerMic->setPen(mColorMic); mpCurvePowerSystem->setPen(mColorSystem); setupCurves(); mpCurvePowerCpu0->attach(qwtPlot); mpCurvePowerCpu1->attach(qwtPlot); mpCurvePowerGpu->attach(qwtPlot); mpCurvePowerFpga->attach(qwtPlot); mpCurvePowerMic->attach(qwtPlot); mpCurvePowerSystem->attach(qwtPlot); qwtPlot->insertLegend(mpLegend, QwtPlot::BottomLegend); }
QMSMFormClock::QMSMFormClock(QWidget *pParent, NData::CDataHandler *pDataHandler) : QMSMFormMeasurementAbstract(pParent, pDataHandler), mpCurveClockCpu0(new QwtPlotCurve("Avg. CPU0")), mpCurveClockCpu1(new QwtPlotCurve("Avg. CPU1")), mpCurveClockGpuCore(new QwtPlotCurve("GPU Core")), mpCurveClockGpuMemory(new QwtPlotCurve("GPU Memory")), mpCurveClockMicCore(new QwtPlotCurve("MIC Core")), mpCurveClockMicMemory(new QwtPlotCurve("MIC Memory")) { setWindowTitle(QApplication::translate("FormMeasurement", "Clock", 0, QApplication::UnicodeUTF8)); qwtPlot->setAxisTitle(QwtPlot::yLeft, createTitle(QString::fromUtf8("Frequency [MHz]"))); mpCurveClockCpu0->setPen(mColorCpu); mpCurveClockCpu1->setPen(mColorCpuAlternative); mpCurveClockGpuCore->setPen(mColorGpu); mpCurveClockGpuMemory->setPen(mColorGpuAlternative); mpCurveClockMicCore->setPen(mColorMic); mpCurveClockMicMemory->setPen(mColorMicAlternative); setupCurves(); mpCurveClockCpu0->attach(qwtPlot); mpCurveClockCpu1->attach(qwtPlot); mpCurveClockGpuCore->attach(qwtPlot); mpCurveClockGpuMemory->attach(qwtPlot); mpCurveClockMicCore->attach(qwtPlot); mpCurveClockMicMemory->attach(qwtPlot); qwtPlot->insertLegend(mpLegend, QwtPlot::BottomLegend); }
void AQTelemetryView::initChart(UASInterface *uav) { if (!uav) return; uas = uav; if ( !AqTeleChart ) { AqTeleChart = new AQLinechartWidget(uas->getUASID(), ui->plotFrameTele); linLayoutPlot = new QGridLayout( ui->plotFrameTele); linLayoutPlot->addWidget(AqTeleChart, 0, Qt::AlignCenter); } setupCurves(); }
PowerBarHistoryPlot::PowerBarHistoryPlot(double defaultTime, double defaultPowerLevel, QWidget* parent) : QWidget(parent) , m_overalTime(0.0) , m_lastSampleTime(0.0) , m_firstTime(true) , m_defaultTime(defaultTime) , m_defaultPowerLevel(defaultPowerLevel) , m_powerAxisMax(defaultPowerLevel) , m_powerAxisMin(-1*defaultPowerLevel) , m_timeAxisMax(defaultTime) { m_plot = new QwtPlot(); m_plot->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); m_plot->setAxisScale(QwtPlot::xBottom, 0, defaultTime, defaultTime/20.0); m_plot->setAxisScale(QwtPlot::yLeft, -1 * defaultPowerLevel, defaultPowerLevel, defaultPowerLevel/2.0); m_plot->setAxisAutoScale(QwtPlot::xBottom, false); m_plot->setCanvasBackground(QBrush(Qt::white)); m_plot->setAxisTitle(QwtPlot::xBottom, tr(TIME_AXIS_NAME)); m_plot->setAxisTitle(QwtPlot::yLeft, tr(POWER_AXIS_NAME)); // legend QwtLegend *legend = new QwtLegend; legend->setFrameStyle(QFrame::Box|QFrame::Sunken); m_plot->insertLegend(legend, QwtPlot::BottomLegend); QwtPlotGrid *grid = new QwtPlotGrid; grid->enableX(false); grid->enableYMin(true); grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine)); grid->setMinPen(QPen(Qt::transparent, 0 , Qt::NoPen)); grid->attach(m_plot); setupCurves(); QHBoxLayout* historyPlotlayout = new QHBoxLayout; historyPlotlayout->addWidget(m_plot); historyPlotlayout->setSpacing(0); setColors(Qt::blue, Qt::red); setLayout(historyPlotlayout); }