void FFT::output(QList<Column *> columns) { ApplicationWindow *app = (ApplicationWindow *)parent(); QString tableName = app->generateUniqueName(objectName()); Table *t = app->newHiddenTable(tableName, d_explanation, columns); MultiLayer *ml = app->multilayerPlot( t, QStringList() << tableName + "_" + tr("Amplitude"), 0); if (!ml) return; Graph *g = ml->activeGraph(); if (g) { g->setCurvePen(0, QPen(ColorBox::color(d_curveColorIndex), 1)); Plot *plot = g->plotWidget(); plot->setTitle(QString()); if (!d_inverse) plot->setAxisTitle(QwtPlot::xBottom, tr("Frequency") + " (" + tr("Hz") + ")"); else plot->setAxisTitle(QwtPlot::xBottom, tr("Time") + +" (" + tr("s") + ")"); plot->setAxisTitle(QwtPlot::yLeft, tr("Amplitude")); plot->replot(); } ml->showMaximized(); }
void FFT::output(const QString &text) { ApplicationWindow *app = (ApplicationWindow *)parent(); QString tableName = app->generateUniqueName(QString(objectName())); d_result_table = app->newHiddenTable(tableName, d_explanation, d_n, 5, text); if (d_graphics_display){ MultiLayer *ml = 0; if (!d_output_graph){ ml = createOutputGraph(); d_output_graph = ml->activeGraph(); } d_output_graph->setTitle(QString()); if (!d_inverse) d_output_graph->setXAxisTitle(tr("Frequency") + " (" + tr("Hz") + ")"); else d_output_graph->setXAxisTitle(tr("Time") + + " (" + tr("s") + ")"); d_output_graph->setYAxisTitle(tr("Amplitude")); d_output_graph->insertCurve(d_result_table, 0, tableName + "_" + tr("Amplitude"), 0); d_output_graph->setCurvePen(d_output_graph->curves() - 1, QPen(ColorBox::color(d_curveColorIndex), 1)); d_output_graph->replot(); if (ml) ml->showMaximized(); } }
void FFT::output(const QString &text) { ApplicationWindow *app = (ApplicationWindow *)parent(); QString tableName = app->generateUniqueName(QString(name())); Table *t = app->newHiddenTable(tableName, d_explanation, d_n, 5, text); MultiLayer *ml = app->multilayerPlot(t, QStringList() << tableName + "_" + tr("Amplitude"), 0); if (!ml) return; Graph* g = ml->activeGraph(); if ( g ) { Plot* plot = g->plotWidget(); plot->setTitle(QString()); if (!d_inverse) plot->setAxisTitle(QwtPlot::xBottom, tr("Frequency") + " (" + tr("Hz") + ")"); else plot->setAxisTitle(QwtPlot::xBottom, tr("Time") + + " (" + tr("s") + ")"); plot->setAxisTitle(QwtPlot::yLeft, tr("Amplitude")); plot->replot(); } ml->showMaximized(); }