[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [labplot/analysis_interpolation] src: added base classes and integration for interpolation curve
From: Stefan Gerlach <stefan.gerlach () uni-konstanz ! de>
Date: 2016-04-07 20:41:02
Message-ID: E1aoGje-00037S-EP () scm ! kde ! org
[Download RAW message or body]
Git commit 6b61404fdfb82ef9dd6e754ecff36f906982efeb by Stefan Gerlach.
Committed on 07/04/2016 at 20:40.
Pushed by sgerlach into branch 'analysis_interpolation'.
added base classes and integration for interpolation curve
M +3 -0 src/CMakeLists.txt
M +5 -0 src/backend/core/Project.cpp
M +14 -0 src/backend/worksheet/plots/cartesian/CartesianPlot.cpp
M +3 -0 src/backend/worksheet/plots/cartesian/CartesianPlot.h
A +399 -0 src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp \
[License: GPL (v2+)] A +99 -0 \
src/backend/worksheet/plots/cartesian/XYInterpolationCurve.h [License: GPL (v2+)] \
A +68 -0 src/backend/worksheet/plots/cartesian/XYInterpolationCurvePrivate.h \
[License: GPL (v2+)] M +11 -5 src/commonfrontend/worksheet/WorksheetView.cpp
M +2 -1 src/commonfrontend/worksheet/WorksheetView.h
M +18 -0 src/kdefrontend/GuiObserver.cpp
M +1 -0 src/kdefrontend/MainWin.cpp
M +2 -0 src/kdefrontend/MainWin.h
M +1 -1 src/kdefrontend/dockwidgets/XYCurveDock.cpp
A +446 -0 src/kdefrontend/dockwidgets/XYInterpolationCurveDock.cpp [License: \
GPL (v2+)] A +87 -0 src/kdefrontend/dockwidgets/XYInterpolationCurveDock.h \
[License: GPL (v2+)] A +277 -0 \
src/kdefrontend/ui/dockwidgets/xyinterpolationcurvedockgeneraltab.ui
http://commits.kde.org/labplot/6b61404fdfb82ef9dd6e754ecff36f906982efeb
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f129faf..f879735 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -36,6 +36,7 @@ set(GUI_SOURCES
${KDEFRONTEND_DIR}/dockwidgets/XYEquationCurveDock.cpp
${KDEFRONTEND_DIR}/dockwidgets/XYFitCurveDock.cpp
${KDEFRONTEND_DIR}/dockwidgets/XYFourierFilterCurveDock.cpp
+ ${KDEFRONTEND_DIR}/dockwidgets/XYInterpolationCurveDock.cpp
${KDEFRONTEND_DIR}/dockwidgets/WorksheetDock.cpp
${KDEFRONTEND_DIR}/matrix/MatrixFunctionDialog.cpp
${KDEFRONTEND_DIR}/spreadsheet/EquidistantValuesDialog.cpp
@@ -83,6 +84,7 @@ set(UI_SOURCES
${KDEFRONTEND_DIR}/ui/dockwidgets/xycurvedockgeneraltab.ui
${KDEFRONTEND_DIR}/ui/dockwidgets/xyfitcurvedockgeneraltab.ui
${KDEFRONTEND_DIR}/ui/dockwidgets/xyfourierfiltercurvedockgeneraltab.ui
+ ${KDEFRONTEND_DIR}/ui/dockwidgets/xyinterpolationcurvedockgeneraltab.ui
${KDEFRONTEND_DIR}/ui/dockwidgets/xyequationcurvedockgeneraltab.ui
${KDEFRONTEND_DIR}/ui/dockwidgets/worksheetdock.ui
${KDEFRONTEND_DIR}/ui/matrix/matrixfunctionwidget.ui
@@ -165,6 +167,7 @@ set(BACKEND_SOURCES
${BACKEND_DIR}/worksheet/plots/cartesian/XYEquationCurve.cpp
${BACKEND_DIR}/worksheet/plots/cartesian/XYFitCurve.cpp
${BACKEND_DIR}/worksheet/plots/cartesian/XYFourierFilterCurve.cpp
+ ${BACKEND_DIR}/worksheet/plots/cartesian/XYInterpolationCurve.cpp
${BACKEND_DIR}/lib/SignallingUndoCommand.cpp
${BACKEND_DIR}/datapicker/DatapickerPoint.cpp
${BACKEND_DIR}/datapicker/DatapickerImage.cpp
diff --git a/src/backend/core/Project.cpp b/src/backend/core/Project.cpp
index 2df35f2..bff7b8a 100644
--- a/src/backend/core/Project.cpp
+++ b/src/backend/core/Project.cpp
@@ -30,6 +30,7 @@
#include "backend/lib/XmlStreamReader.h"
#include "backend/spreadsheet/Spreadsheet.h"
#include "backend/worksheet/plots/cartesian/XYEquationCurve.h"
+#include "backend/worksheet/plots/cartesian/XYInterpolationCurve.h"
#include "backend/worksheet/plots/cartesian/XYFitCurve.h"
#include "backend/worksheet/plots/cartesian/XYFourierFilterCurve.h"
#include "backend/worksheet/plots/cartesian/Axis.h"
@@ -290,11 +291,15 @@ bool Project::load(XmlStreamReader* reader) {
curve->suppressRetransform(true);
XYEquationCurve* equationCurve = dynamic_cast<XYEquationCurve*>(aspect);
+ XYInterpolationCurve* interpolationCurve = \
dynamic_cast<XYInterpolationCurve*>(aspect); XYFitCurve* fitCurve = \
dynamic_cast<XYFitCurve*>(aspect);
XYFourierFilterCurve* filterCurve = \
dynamic_cast<XYFourierFilterCurve*>(aspect); if (equationCurve) {
//curves defined by a mathematical equations recalculate their own columns on \
load again. equationCurve->recalculate();
+ } else if (interpolationCurve) {
+ RESTORE_COLUMN_POINTER(interpolationCurve, xDataColumn, XDataColumn);
+ RESTORE_COLUMN_POINTER(interpolationCurve, yDataColumn, YDataColumn);
} else if (fitCurve) {
RESTORE_COLUMN_POINTER(fitCurve, xDataColumn, XDataColumn);
RESTORE_COLUMN_POINTER(fitCurve, yDataColumn, YDataColumn);
diff --git a/src/backend/worksheet/plots/cartesian/CartesianPlot.cpp \
b/src/backend/worksheet/plots/cartesian/CartesianPlot.cpp index dc689c6..99d117f \
100644
--- a/src/backend/worksheet/plots/cartesian/CartesianPlot.cpp
+++ b/src/backend/worksheet/plots/cartesian/CartesianPlot.cpp
@@ -34,6 +34,7 @@
#include "XYEquationCurve.h"
#include "XYFitCurve.h"
#include "XYFourierFilterCurve.h"
+#include "XYInterpolationCurve.h"
#include "backend/core/Project.h"
#include "backend/worksheet/plots/cartesian/CartesianPlotLegend.h"
#include "backend/worksheet/plots/cartesian/CustomPoint.h"
@@ -348,6 +349,7 @@ void CartesianPlot::initActions(){
addEquationCurveAction = new KAction(KIcon("labplot-xy-equation-curve"), \
i18n("xy-curve from a mathematical equation"), this); addFitCurveAction = new \
KAction(KIcon("labplot-xy-fit-curve"), i18n("xy-curve from a fit to data"), this); \
addFourierFilterCurveAction = new KAction(KIcon("labplot-xy-fourier_filter-curve"), \
i18n("xy-curve from a Fourier filter"), this); + addInterpolationCurveAction = new \
KAction(KIcon("labplot-xy-interpolation-curve"), i18n("xy-curve from an \
interpolation"), this); addLegendAction = new KAction(KIcon("text-field"), \
i18n("legend"), this); addHorizontalAxisAction = new \
KAction(KIcon("labplot-axis-horizontal"), i18n("horizontal axis"), this); \
addVerticalAxisAction = new KAction(KIcon("labplot-axis-vertical"), i18n("vertical \
axis"), this); @@ -709,6 +711,12 @@ XYFourierFilterCurve* \
CartesianPlot::addFourierFilterCurve(){ return curve;
}
+XYInterpolationCurve* CartesianPlot::addInterpolationCurve(){
+ XYInterpolationCurve* curve = new XYInterpolationCurve("Interpolation");
+ this->addChild(curve);
+ return curve;
+}
+
void CartesianPlot::addLegend(){
//don't do anything if there's already a legend
if (m_legend)
@@ -1878,6 +1886,12 @@ bool CartesianPlot::load(XmlStreamReader* reader){
removeChild(curve);
return false;
}
+ } else if(reader->name() == "xyInterpolationCurve") {
+ XYInterpolationCurve* curve = addInterpolationCurve();
+ if (!curve->load(reader)){
+ removeChild(curve);
+ return false;
+ }
} else if(reader->name() == "cartesianPlotLegend"){
m_legend = new CartesianPlotLegend(this, "");
if (!m_legend->load(reader)){
diff --git a/src/backend/worksheet/plots/cartesian/CartesianPlot.h \
b/src/backend/worksheet/plots/cartesian/CartesianPlot.h index c43daa8..f743a2d 100644
--- a/src/backend/worksheet/plots/cartesian/CartesianPlot.h
+++ b/src/backend/worksheet/plots/cartesian/CartesianPlot.h
@@ -39,6 +39,7 @@ class XYCurve;
class XYEquationCurve;
class XYFitCurve;
class XYFourierFilterCurve;
+class XYInterpolationCurve;
class CartesianPlot:public AbstractPlot{
Q_OBJECT
@@ -110,6 +111,7 @@ class CartesianPlot:public AbstractPlot{
QAction* addEquationCurveAction;
QAction* addFitCurveAction;
QAction* addFourierFilterCurveAction;
+ QAction* addInterpolationCurveAction;
QAction* addHorizontalAxisAction;
QAction* addVerticalAxisAction;
QAction* addLegendAction;
@@ -141,6 +143,7 @@ class CartesianPlot:public AbstractPlot{
XYEquationCurve* addEquationCurve();
XYFitCurve* addFitCurve();
XYFourierFilterCurve* addFourierFilterCurve();
+ XYInterpolationCurve* addInterpolationCurve();
void addLegend();
void addCustomPoint();
void scaleAuto();
diff --git a/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp \
b/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp new file mode 100644
index 0000000..545ffbc
--- /dev/null
+++ b/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp
@@ -0,0 +1,399 @@
+/***************************************************************************
+ File : XYInterpolationCurve.cpp
+ Project : LabPlot
+ Description : A xy-curve defined by an interpolation
+ --------------------------------------------------------------------
+ Copyright : (C) 2016 Stefan Gerlach (stefan.gerlach@uni.kn)
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301 USA *
+ * *
+ ***************************************************************************/
+
+/*!
+ \class XYInterpolationCurve
+ \brief A xy-curve defined by an interpolation
+
+ \ingroup worksheet
+*/
+
+#include "XYInterpolationCurve.h"
+#include "XYInterpolationCurvePrivate.h"
+#include "backend/core/AbstractColumn.h"
+#include "backend/core/column/Column.h"
+#include "backend/lib/commandtemplates.h"
+#include <cmath> // isnan
+/*#include "backend/gsl/ExpressionParser.h"
+#include "backend/gsl/parser_extern.h"
+*/
+//#include <gsl/gsl_version.h>
+#include <gsl/gsl_fft_real.h>
+#include <gsl/gsl_fft_halfcomplex.h>
+#include <gsl/gsl_sf_pow_int.h>
+
+#include <KIcon>
+#include <KLocale>
+#include <QElapsedTimer>
+#include <QDebug>
+
+XYInterpolationCurve::XYInterpolationCurve(const QString& name)
+ : XYCurve(name, new XYInterpolationCurvePrivate(this)) {
+ init();
+}
+
+XYInterpolationCurve::XYInterpolationCurve(const QString& name, \
XYInterpolationCurvePrivate* dd) + : XYCurve(name, dd) {
+ init();
+}
+
+
+XYInterpolationCurve::~XYInterpolationCurve() {
+ //no need to delete the d-pointer here - it inherits from QGraphicsItem
+ //and is deleted during the cleanup in QGraphicsScene
+}
+
+void XYInterpolationCurve::init() {
+ Q_D(XYInterpolationCurve);
+
+ //TODO: read from the saved settings for XYInterpolationCurve?
+ d->lineType = XYCurve::Line;
+ d->symbolsStyle = Symbol::NoSymbols;
+}
+
+void XYInterpolationCurve::recalculate() {
+ Q_D(XYInterpolationCurve);
+ d->recalculate();
+}
+
+/*!
+ Returns an icon to be used in the project explorer.
+*/
+QIcon XYInterpolationCurve::icon() const {
+ return KIcon("labplot-xy-interpolation-curve");
+}
+
+//##############################################################################
+//########################## getter methods ##################################
+//##############################################################################
+BASIC_SHARED_D_READER_IMPL(XYInterpolationCurve, const AbstractColumn*, xDataColumn, \
xDataColumn) +BASIC_SHARED_D_READER_IMPL(XYInterpolationCurve, const AbstractColumn*, \
yDataColumn, yDataColumn) +const QString& XYInterpolationCurve::xDataColumnPath() \
const { Q_D(const XYInterpolationCurve); return d->xDataColumnPath; } +const QString& \
XYInterpolationCurve::yDataColumnPath() const { Q_D(const XYInterpolationCurve); \
return d->yDataColumnPath; } +
+BASIC_SHARED_D_READER_IMPL(XYInterpolationCurve, \
XYInterpolationCurve::InterpolationData, interpolationData, interpolationData) +
+const XYInterpolationCurve::InterpolationResult& \
XYInterpolationCurve::interpolationResult() const { + Q_D(const \
XYInterpolationCurve); + return d->interpolationResult;
+}
+
+bool XYInterpolationCurve::isSourceDataChangedSinceLastInterpolation() const {
+ Q_D(const XYInterpolationCurve);
+ return d->sourceDataChangedSinceLastInterpolation;
+}
+
+//##############################################################################
+//################# setter methods and undo commands ##########################
+//##############################################################################
+STD_SETTER_CMD_IMPL_S(XYInterpolationCurve, SetXDataColumn, const AbstractColumn*, \
xDataColumn) +void XYInterpolationCurve::setXDataColumn(const AbstractColumn* column) \
{ + Q_D(XYInterpolationCurve);
+ if (column != d->xDataColumn) {
+ exec(new XYInterpolationCurveSetXDataColumnCmd(d, column, i18n("%1: assign \
x-data"))); + emit sourceDataChangedSinceLastInterpolation();
+ if (column) {
+ connect(column, SIGNAL(dataChanged(const AbstractColumn*)), this, \
SLOT(handleSourceDataChanged())); + //TODO disconnect on undo
+ }
+ }
+}
+
+STD_SETTER_CMD_IMPL_S(XYInterpolationCurve, SetYDataColumn, const AbstractColumn*, \
yDataColumn) +void XYInterpolationCurve::setYDataColumn(const AbstractColumn* column) \
{ + Q_D(XYInterpolationCurve);
+ if (column != d->yDataColumn) {
+ exec(new XYInterpolationCurveSetYDataColumnCmd(d, column, i18n("%1: assign \
y-data"))); + emit sourceDataChangedSinceLastInterpolation();
+ if (column) {
+ connect(column, SIGNAL(dataChanged(const AbstractColumn*)), this, \
SLOT(handleSourceDataChanged())); + //TODO disconnect on undo
+ }
+ }
+}
+
+STD_SETTER_CMD_IMPL_F_S(XYInterpolationCurve, SetInterpolationData, \
XYInterpolationCurve::InterpolationData, interpolationData, recalculate); +void \
XYInterpolationCurve::setInterpolationData(const \
XYInterpolationCurve::InterpolationData& interpolationData) { \
+ Q_D(XYInterpolationCurve); + exec(new \
XYInterpolationCurveSetInterpolationDataCmd(d, interpolationData, i18n("%1: set \
options and perform the interpolation"))); +}
+
+//##############################################################################
+//################################## SLOTS ####################################
+//##############################################################################
+void XYInterpolationCurve::handleSourceDataChanged() {
+ Q_D(XYInterpolationCurve);
+ d->sourceDataChangedSinceLastInterpolation = true;
+ emit sourceDataChangedSinceLastInterpolation();
+}
+//##############################################################################
+//######################### Private implementation #############################
+//##############################################################################
+XYInterpolationCurvePrivate::XYInterpolationCurvePrivate(XYInterpolationCurve* \
owner) : XYCurvePrivate(owner), + xDataColumn(0), yDataColumn(0),
+ xColumn(0), yColumn(0),
+ xVector(0), yVector(0),
+ sourceDataChangedSinceLastInterpolation(false),
+ q(owner) {
+
+}
+
+XYInterpolationCurvePrivate::~XYInterpolationCurvePrivate() {
+ //no need to delete xColumn and yColumn, they are deleted
+ //when the parent aspect is removed
+}
+
+// ...
+// see XYFitCurvePrivate
+
+void XYInterpolationCurvePrivate::recalculate() {
+ QElapsedTimer timer;
+ timer.start();
+
+ //create interpolation result columns if not available yet, clear them otherwise
+ if (!xColumn) {
+ xColumn = new Column("x", AbstractColumn::Numeric);
+ yColumn = new Column("y", AbstractColumn::Numeric);
+ xVector = static_cast<QVector<double>* >(xColumn->data());
+ yVector = static_cast<QVector<double>* >(yColumn->data());
+
+ xColumn->setHidden(true);
+ q->addChild(xColumn);
+ yColumn->setHidden(true);
+ q->addChild(yColumn);
+
+ q->setUndoAware(false);
+ q->setXColumn(xColumn);
+ q->setYColumn(yColumn);
+ q->setUndoAware(true);
+ } else {
+ xVector->clear();
+ yVector->clear();
+ }
+
+ // clear the previous result
+ interpolationResult = XYInterpolationCurve::InterpolationResult();
+
+ if (!xDataColumn || !yDataColumn) {
+ emit (q->dataChanged());
+ sourceDataChangedSinceLastInterpolation = false;
+ return;
+ }
+
+ //check column sizes
+ if (xDataColumn->rowCount()!=yDataColumn->rowCount()) {
+ interpolationResult.available = true;
+ interpolationResult.valid = false;
+ interpolationResult.status = i18n("Number of x and y data points must be equal.");
+ emit (q->dataChanged());
+ sourceDataChangedSinceLastInterpolation = false;
+ return;
+ }
+
+ //copy all valid data point for the fit to temporary vectors
+ QVector<double> xdataVector;
+ QVector<double> ydataVector;
+ for (int row=0; row<xDataColumn->rowCount(); ++row) {
+ //only copy those data where _all_ values (for x and y, if given) are valid
+ if (!isnan(xDataColumn->valueAt(row)) && !isnan(yDataColumn->valueAt(row))
+ && !xDataColumn->isMasked(row) && !yDataColumn->isMasked(row)) {
+
+ xdataVector.append(xDataColumn->valueAt(row));
+ ydataVector.append(yDataColumn->valueAt(row));
+ }
+ }
+
+ //number of data points to fit
+ unsigned int n = ydataVector.size();
+ if (n == 0) {
+ interpolationResult.available = true;
+ interpolationResult.valid = false;
+ interpolationResult.status = i18n("No data points available.");
+ emit (q->dataChanged());
+ sourceDataChangedSinceLastInterpolation = false;
+ return;
+ }
+
+ //double* xdata = xdataVector.data();
+ double* ydata = ydataVector.data();
+
+ double min = xDataColumn->minimum();
+ double max = xDataColumn->maximum();
+
+ // interpolation settings
+// unsigned int order = interpolationData.order;
+#ifdef QT_DEBUG
+ //TODO
+#endif
+///////////////////////////////////////////////////////////
+//TODO
+///////////////////////////////////////////////////////////
+
+ //write the result
+ interpolationResult.available = true;
+ interpolationResult.valid = true;
+ interpolationResult.status = i18n("OK");
+ interpolationResult.elapsedTime = timer.elapsed();
+
+ //redraw the curve
+ emit (q->dataChanged());
+ sourceDataChangedSinceLastInterpolation = false;
+}
+
+//##############################################################################
+//################## Serialization/Deserialization ###########################
+//##############################################################################
+//! Save as XML
+void XYInterpolationCurve::save(QXmlStreamWriter* writer) const{
+ Q_D(const XYInterpolationCurve);
+
+ writer->writeStartElement("xyInterpolationCurve");
+
+ //write xy-curve information
+ XYCurve::save(writer);
+
+ //write xy-interpolation-curve specific information
+ // interpolation data
+ writer->writeStartElement("interpolationData");
+ WRITE_COLUMN(d->xDataColumn, xDataColumn);
+ WRITE_COLUMN(d->yDataColumn, yDataColumn);
+ //writer->writeAttribute( "order", QString::number(d->interpolationData.order) );
+ //writer->writeAttribute( "cutoff", QString::number(d->interpolationData.cutoff) );
+ writer->writeEndElement();// interpolationData
+
+ // interpolation results (generated columns)
+ writer->writeStartElement("interpolationResult");
+ writer->writeAttribute( "available", \
QString::number(d->interpolationResult.available) ); + writer->writeAttribute( \
"valid", QString::number(d->interpolationResult.valid) ); + writer->writeAttribute( \
"status", d->interpolationResult.status ); + writer->writeAttribute( "time", \
QString::number(d->interpolationResult.elapsedTime) ); +
+ //save calculated columns if available
+ if (d->xColumn) {
+ d->xColumn->save(writer);
+ d->yColumn->save(writer);
+ }
+ writer->writeEndElement(); //"interpolationResult"
+
+ writer->writeEndElement(); //"xyInterpolationCurve"
+}
+
+//! Load from XML
+bool XYInterpolationCurve::load(XmlStreamReader* reader){
+ Q_D(XYInterpolationCurve);
+
+ if(!reader->isStartElement() || reader->name() != "xyInterpolationCurve"){
+ reader->raiseError(i18n("no xy Fourier interpolation curve element found"));
+ return false;
+ }
+
+ QString attributeWarning = i18n("Attribute '%1' missing or empty, default value is \
used"); + QXmlStreamAttributes attribs;
+ QString str;
+
+ while (!reader->atEnd()) {
+ reader->readNext();
+ if (reader->isEndElement() && reader->name() == "xyInterpolationCurve")
+ break;
+
+ if (!reader->isStartElement())
+ continue;
+
+ if (reader->name() == "xyCurve") {
+ if ( !XYCurve::load(reader) )
+ return false;
+ } else if (reader->name() == "interpolationData") {
+ attribs = reader->attributes();
+
+ READ_COLUMN(xDataColumn);
+ READ_COLUMN(yDataColumn);
+
+/* str = attribs.value("order").toString();
+ if(str.isEmpty())
+ reader->raiseWarning(attributeWarning.arg("'order'"));
+ else
+ d->interpolationData.order = str.toInt();
+*/
+ } else if (reader->name() == "interpolationResult") {
+
+ attribs = reader->attributes();
+
+ str = attribs.value("available").toString();
+ if(str.isEmpty())
+ reader->raiseWarning(attributeWarning.arg("'available'"));
+ else
+ d->interpolationResult.available = str.toInt();
+
+ str = attribs.value("valid").toString();
+ if(str.isEmpty())
+ reader->raiseWarning(attributeWarning.arg("'valid'"));
+ else
+ d->interpolationResult.valid = str.toInt();
+
+ str = attribs.value("status").toString();
+ if(str.isEmpty())
+ reader->raiseWarning(attributeWarning.arg("'status'"));
+ else
+ d->interpolationResult.status = str;
+
+ str = attribs.value("time").toString();
+ if(str.isEmpty())
+ reader->raiseWarning(attributeWarning.arg("'time'"));
+ else
+ d->interpolationResult.elapsedTime = str.toInt();
+ } else if(reader->name() == "column") {
+ Column* column = new Column("", AbstractColumn::Numeric);
+ if (!column->load(reader)) {
+ delete column;
+ return false;
+ }
+ if (column->name()=="x")
+ d->xColumn = column;
+ else if (column->name()=="y")
+ d->yColumn = column;
+ }
+ }
+
+ if (d->xColumn) {
+ d->xColumn->setHidden(true);
+ addChild(d->xColumn);
+
+ d->yColumn->setHidden(true);
+ addChild(d->yColumn);
+
+ d->xVector = static_cast<QVector<double>* >(d->xColumn->data());
+ d->yVector = static_cast<QVector<double>* >(d->yColumn->data());
+
+ setUndoAware(false);
+ XYCurve::d_ptr->xColumn = d->xColumn;
+ XYCurve::d_ptr->yColumn = d->yColumn;
+ setUndoAware(true);
+ }
+
+ return true;
+}
diff --git a/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.h \
b/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.h new file mode 100644
index 0000000..e765eb0
--- /dev/null
+++ b/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.h
@@ -0,0 +1,99 @@
+/***************************************************************************
+ File : XYInterpolationCurve.h
+ Project : LabPlot
+ Description : A xy-curve defined by an interpolation
+ --------------------------------------------------------------------
+ Copyright : (C) 2016 Stefan Gerlach (stefan.gerlach@uni.kn)
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301 USA *
+ * *
+ ***************************************************************************/
+
+#ifndef XYINTERPOLATIONCURVE_H
+#define XYINTERPOLATIONCURVE_H
+
+#include "backend/worksheet/plots/cartesian/XYCurve.h"
+
+class XYInterpolationCurvePrivate;
+class XYInterpolationCurve: public XYCurve {
+ Q_OBJECT
+
+ public:
+ enum InterpolationType {Linear,Polynomial}; // TODO:more
+ enum InterpolationEval {Function,Derivative,Derivative2,Integral};
+
+ struct InterpolationData {
+ InterpolationData() : type(Linear), npoints(1), evalute(Function) {};
+
+ XYInterpolationCurve::InterpolationType type; // type of interpolation
+ unsigned int npoints; // nr. of points
+ InterpolationEval evalute; // what to evaluate
+ };
+ struct InterpolationResult {
+ InterpolationResult() : available(false), valid(false), elapsedTime(0) {};
+
+ bool available;
+ bool valid;
+ QString status;
+ qint64 elapsedTime;
+ };
+
+ explicit XYInterpolationCurve(const QString& name);
+ virtual ~XYInterpolationCurve();
+
+ void recalculate();
+ virtual QIcon icon() const;
+ virtual void save(QXmlStreamWriter*) const;
+ virtual bool load(XmlStreamReader*);
+
+ POINTER_D_ACCESSOR_DECL(const AbstractColumn, xDataColumn, XDataColumn)
+ POINTER_D_ACCESSOR_DECL(const AbstractColumn, yDataColumn, YDataColumn)
+ const QString& xDataColumnPath() const;
+ const QString& yDataColumnPath() const;
+
+ CLASS_D_ACCESSOR_DECL(InterpolationData, interpolationData, InterpolationData)
+ const InterpolationResult& interpolationResult() const;
+ bool isSourceDataChangedSinceLastInterpolation() const;
+
+ typedef WorksheetElement BaseClass;
+ typedef XYInterpolationCurvePrivate Private;
+
+ protected:
+ XYInterpolationCurve(const QString& name, XYInterpolationCurvePrivate* dd);
+
+ private:
+ Q_DECLARE_PRIVATE(XYInterpolationCurve)
+ void init();
+
+ private slots:
+ void handleSourceDataChanged();
+
+ signals:
+ friend class XYInterpolationCurveSetXDataColumnCmd;
+ friend class XYInterpolationCurveSetYDataColumnCmd;
+ void xDataColumnChanged(const AbstractColumn*);
+ void yDataColumnChanged(const AbstractColumn*);
+
+ friend class XYInterpolationCurveSetInterpolationDataCmd;
+ void interpolationDataChanged(const XYInterpolationCurve::InterpolationData&);
+ void sourceDataChangedSinceLastInterpolation();
+};
+
+#endif
diff --git a/src/backend/worksheet/plots/cartesian/XYInterpolationCurvePrivate.h \
b/src/backend/worksheet/plots/cartesian/XYInterpolationCurvePrivate.h new file mode \
100644 index 0000000..3388ced
--- /dev/null
+++ b/src/backend/worksheet/plots/cartesian/XYInterpolationCurvePrivate.h
@@ -0,0 +1,68 @@
+/***************************************************************************
+ File : XYInterpolationCurvePrivate.h
+ Project : LabPlot
+ Description : Private members of XYInterpolationCurve
+ --------------------------------------------------------------------
+ Copyright : (C) 2016 Stefan Gerlach (stefan.gerlach@uni.kn)
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301 USA *
+ * *
+ ***************************************************************************/
+
+#ifndef XYINTERPOLATIONCURVEPRIVATE_H
+#define XYINTERPOLATIONCURVEPRIVATE_H
+
+#include "backend/worksheet/plots/cartesian/XYCurvePrivate.h"
+#include "backend/worksheet/plots/cartesian/XYInterpolationCurve.h"
+
+#include <QDebug>
+
+class XYInterpolationCurve;
+class Column;
+
+class XYInterpolationCurvePrivate: public XYCurvePrivate {
+ public:
+ explicit XYInterpolationCurvePrivate(XYInterpolationCurve*);
+ ~XYInterpolationCurvePrivate();
+
+ void recalculate();
+
+ const AbstractColumn* xDataColumn; //<! column storing the values for the x-data \
to be interpolated + const AbstractColumn* yDataColumn; //<! column storing the \
values for the y-data to be interpolated + QString xDataColumnPath;
+ QString yDataColumnPath;
+
+ XYInterpolationCurve::InterpolationData interpolationData;
+ XYInterpolationCurve::InterpolationResult interpolationResult;
+
+ Column* xColumn; //<! column used internally for storing the x-values of the \
result interpolation curve + Column* yColumn; //<! column used internally for \
storing the y-values of the result interpolation curve + QVector<double>* xVector;
+ QVector<double>* yVector;
+
+ bool sourceDataChangedSinceLastInterpolation; //<! \c true if the data in the \
source columns (x, y) was changed, \c false otherwise +
+ XYInterpolationCurve* const q;
+
+// private:
+// void writeSolverState(gsl_multifit_fdfsolver* s);
+};
+
+#endif
diff --git a/src/commonfrontend/worksheet/WorksheetView.cpp \
b/src/commonfrontend/worksheet/WorksheetView.cpp index 75f030a..3c815dc 100644
--- a/src/commonfrontend/worksheet/WorksheetView.cpp
+++ b/src/commonfrontend/worksheet/WorksheetView.cpp
@@ -274,9 +274,9 @@ void WorksheetView::initActions() {
QActionGroup* cartesianPlotAddNewActionGroup = new QActionGroup(this);
addCurveAction = new KAction(KIcon("labplot-xy-curve"), i18n("xy-curve"), \
cartesianPlotAddNewActionGroup); addEquationCurveAction = new \
KAction(KIcon("labplot-xy-equation-curve"), i18n("xy-curve from a mathematical \
equation"), cartesianPlotAddNewActionGroup); + addInterpolationCurveAction = new \
KAction(KIcon("labplot-xy-interpolation-curve"), i18n("xy-curve from an \
interpolation"), cartesianPlotAddNewActionGroup); addFitCurveAction = new \
KAction(KIcon("labplot-xy-fit-curve"), i18n("xy-curve from a fit to data"), \
cartesianPlotAddNewActionGroup); addFourierFilterCurveAction = new \
KAction(KIcon("labplot-xy-fourier_filter-curve"), i18n("xy-curve from a Fourier \
filter"), cartesianPlotAddNewActionGroup);
-// addFFTAction = new KAction(KIcon("labplot-xy-fft-curve"), i18n("FFT"), \
cartesianPlotAddNewActionGroup); addLegendAction = new KAction(KIcon("text-field"), \
i18n("legend"), cartesianPlotAddNewActionGroup); addHorizontalAxisAction = new \
KAction(KIcon("labplot-axis-horizontal"), i18n("horizontal axis"), \
cartesianPlotAddNewActionGroup); addVerticalAxisAction = new \
KAction(KIcon("labplot-axis-vertical"), i18n("vertical axis"), \
cartesianPlotAddNewActionGroup); @@ -284,6 +284,7 @@ void \
WorksheetView::initActions() { connect(cartesianPlotAddNewActionGroup, \
SIGNAL(triggered(QAction*)), SLOT(cartesianPlotAddNew(QAction*)));
// Analysis menu
+ addInterpolationAction = new KAction(KIcon("labplot-xy-interpolation-curve"), \
i18n("Interpolation"), cartesianPlotAddNewActionGroup); addFitAction = new \
KAction(KIcon("labplot-xy-fit-curve"), i18n("Data fitting"), \
cartesianPlotAddNewActionGroup); addFourierFilterAction = new \
KAction(KIcon("labplot-xy-fourier_filter-curve"), i18n("Fourier filter"), \
cartesianPlotAddNewActionGroup);
@@ -389,6 +390,7 @@ void WorksheetView::initMenus() {
m_cartesianPlotAddNewMenu = new QMenu(i18n("Add new"), this);
m_cartesianPlotAddNewMenu->addAction(addCurveAction);
m_cartesianPlotAddNewMenu->addAction(addEquationCurveAction);
+ m_cartesianPlotAddNewMenu->addAction(addInterpolationCurveAction);
m_cartesianPlotAddNewMenu->addAction(addFitCurveAction);
m_cartesianPlotAddNewMenu->addAction(addFourierFilterCurveAction);
m_cartesianPlotAddNewMenu->addAction(addLegendAction);
@@ -467,8 +469,8 @@ void WorksheetView::createContextMenu(QMenu* menu) const {
void WorksheetView::createAnalysisMenu(QMenu* menu) const {
Q_ASSERT(menu);
+ menu->addAction(addInterpolationAction);
menu->addAction(addFitAction);
-// menu->addAction(addFFTAction);
menu->insertMenu(0,m_filterMenu);
//TODO: more to come
@@ -514,6 +516,7 @@ void WorksheetView::fillCartesianPlotToolBar(QToolBar* toolBar) {
toolBar->addSeparator();
toolBar->addAction(addCurveAction);
toolBar->addAction(addEquationCurveAction);
+ toolBar->addAction(addInterpolationCurveAction);
toolBar->addAction(addFitCurveAction);
toolBar->addAction(addFourierFilterCurveAction);
toolBar->addAction(addLegendAction);
@@ -1272,9 +1275,9 @@ void WorksheetView::handleCartesianPlotActions() {
addCurveAction->setEnabled(plot);
addEquationCurveAction->setEnabled(plot);
+ addInterpolationCurveAction->setEnabled(plot);
addFitCurveAction->setEnabled(plot);
addFourierFilterCurveAction->setEnabled(plot);
-// addFFTAction->setEnabled(plot);
addHorizontalAxisAction->setEnabled(plot);
addVerticalAxisAction->setEnabled(plot);
addLegendAction->setEnabled(plot);
@@ -1295,6 +1298,7 @@ void WorksheetView::handleCartesianPlotActions() {
// analysis functions
//m_filterMenu->setEnabled(plot);
+ addInterpolationAction->setEnabled(plot);
addFitAction->setEnabled(plot);
addFourierFilterAction->setEnabled(plot);
}
@@ -1491,6 +1495,8 @@ void WorksheetView::cartesianPlotAdd(CartesianPlot* plot, \
QAction* action) { plot->addFitCurve();
else if (action==addFourierFilterCurveAction)
plot->addFourierFilterCurve();
+ else if (action==addInterpolationCurveAction)
+ plot->addInterpolationCurve();
else if (action==addLegendAction)
plot->addLegend();
else if (action==addHorizontalAxisAction)
@@ -1504,8 +1510,8 @@ void WorksheetView::cartesianPlotAdd(CartesianPlot* plot, \
QAction* action) { plot->addFitCurve();
else if (action==addFourierFilterAction)
plot->addFourierFilterCurve();
-// else if (action==addFFTAction)
-// plot->addFFTCurve();
+ else if (action==addInterpolationAction)
+ plot->addInterpolationCurve();
}
void WorksheetView::cartesianPlotNavigationChanged(QAction* action) {
diff --git a/src/commonfrontend/worksheet/WorksheetView.h \
b/src/commonfrontend/worksheet/WorksheetView.h index c27dc21..cc9aef5 100644
--- a/src/commonfrontend/worksheet/WorksheetView.h
+++ b/src/commonfrontend/worksheet/WorksheetView.h
@@ -174,7 +174,7 @@ private:
QAction* addEquationCurveAction;
QAction* addFitCurveAction;
QAction* addFourierFilterCurveAction;
-// QAction* addFFTAction;
+ QAction* addInterpolationCurveAction;
QAction* addHorizontalAxisAction;
QAction* addVerticalAxisAction;
QAction* addLegendAction;
@@ -197,6 +197,7 @@ private:
// filter menu
QAction* addFitAction;
QAction* addFourierFilterAction;
+ QAction* addInterpolationAction;
public slots:
void createContextMenu(QMenu*) const;
diff --git a/src/kdefrontend/GuiObserver.cpp b/src/kdefrontend/GuiObserver.cpp
index 124d26f..4a01ab7 100644
--- a/src/kdefrontend/GuiObserver.cpp
+++ b/src/kdefrontend/GuiObserver.cpp
@@ -55,6 +55,7 @@
#include "kdefrontend/dockwidgets/XYEquationCurveDock.h"
#include "kdefrontend/dockwidgets/XYFitCurveDock.h"
#include "kdefrontend/dockwidgets/XYFourierFilterCurveDock.h"
+#include "kdefrontend/dockwidgets/XYInterpolationCurveDock.h"
#include "kdefrontend/dockwidgets/CustomPointDock.h"
#include "kdefrontend/dockwidgets/WorksheetDock.h"
#include "kdefrontend/widgets/LabelWidget.h"
@@ -299,6 +300,23 @@ GuiObserver::GuiObserver(MainWin* mainWin) : \
m_lastCartesianPlot(0){ mainWindow->xyFourierFilterCurveDock->setCurves(list);
mainWindow->stackedWidget->setCurrentWidget(mainWindow->xyFourierFilterCurveDock);
+ }else if (className=="XYInterpolationCurve"){
+ mainWindow->m_propertiesDock->setWindowTitle(i18n("xy-interpolation-curve \
properties")); +
+ if (!mainWindow->xyInterpolationCurveDock){
+ mainWindow->xyInterpolationCurveDock = new \
XYInterpolationCurveDock(mainWindow->stackedWidget); + \
mainWindow->xyInterpolationCurveDock->setupGeneral(); + \
connect(mainWindow->xyInterpolationCurveDock, SIGNAL(info(QString)), \
mainWindow->statusBar(), SLOT(showMessage(QString))); + \
mainWindow->stackedWidget->addWidget(mainWindow->xyInterpolationCurveDock); + }
+
+ QList<XYCurve*> list;
+ foreach(aspect, selectedAspects){
+ list<<qobject_cast<XYCurve*>(aspect);
+ }
+ mainWindow->xyInterpolationCurveDock->setCurves(list);
+
+ mainWindow->stackedWidget->setCurrentWidget(mainWindow->xyInterpolationCurveDock);
}else if (className=="TextLabel"){
mainWindow->m_propertiesDock->setWindowTitle(i18n("Text label properties"));
diff --git a/src/kdefrontend/MainWin.cpp b/src/kdefrontend/MainWin.cpp
index a95674e..c5b20ec 100644
--- a/src/kdefrontend/MainWin.cpp
+++ b/src/kdefrontend/MainWin.cpp
@@ -103,6 +103,7 @@ MainWin::MainWin(QWidget *parent, const QString& filename)
projectDock(0),
xyCurveDock(0),
xyEquationCurveDock(0),
+ xyInterpolationCurveDock(0),
xyFitCurveDock(0),
xyFourierFilterCurveDock(0),
worksheetDock(0),
diff --git a/src/kdefrontend/MainWin.h b/src/kdefrontend/MainWin.h
index 9329289..61b4c60 100644
--- a/src/kdefrontend/MainWin.h
+++ b/src/kdefrontend/MainWin.h
@@ -56,6 +56,7 @@ class XYCurveDock;
class XYEquationCurveDock;
class XYFitCurveDock;
class XYFourierFilterCurveDock;
+class XYInterpolationCurveDock;
class WorksheetDock;
class LabelWidget;
class ImportFileDialog;
@@ -161,6 +162,7 @@ private:
ProjectDock* projectDock;
XYCurveDock* xyCurveDock;
XYEquationCurveDock* xyEquationCurveDock;
+ XYInterpolationCurveDock* xyInterpolationCurveDock;
XYFitCurveDock* xyFitCurveDock;
XYFourierFilterCurveDock* xyFourierFilterCurveDock;
WorksheetDock* worksheetDock;
diff --git a/src/kdefrontend/dockwidgets/XYCurveDock.cpp \
b/src/kdefrontend/dockwidgets/XYCurveDock.cpp index d68375c..026277a 100644
--- a/src/kdefrontend/dockwidgets/XYCurveDock.cpp
+++ b/src/kdefrontend/dockwidgets/XYCurveDock.cpp
@@ -487,7 +487,7 @@ void XYCurveDock::init(){
void XYCurveDock::setModel() {
QList<const char*> list;
- list<<"Folder"<<"Workbook"<<"Datapicker"<<"DatapickerCurve"<<"Spreadsheet"<<"FileDat \
aSource"<<"Column"<<"Worksheet"<<"CartesianPlot"<<"XYFitCurve"<<"XYFourierFilterCurve";
+ list<<"Folder"<<"Workbook"<<"Datapicker"<<"DatapickerCurve"<<"Spreadsheet"<<"FileDa \
taSource"<<"Column"<<"Worksheet"<<"CartesianPlot"<<"XYInterpolationCurve"<<"XYFitCurve"<<"XYFourierFilterCurve";
if (cbXColumn) {
cbXColumn->setTopLevelClasses(list);
cbYColumn->setTopLevelClasses(list);
diff --git a/src/kdefrontend/dockwidgets/XYInterpolationCurveDock.cpp \
b/src/kdefrontend/dockwidgets/XYInterpolationCurveDock.cpp new file mode 100644
index 0000000..826c176
--- /dev/null
+++ b/src/kdefrontend/dockwidgets/XYInterpolationCurveDock.cpp
@@ -0,0 +1,446 @@
+/***************************************************************************
+ File : XYInterpolationCurveDock.h
+ Project : LabPlot
+ --------------------------------------------------------------------
+ Copyright : (C) 2016 Stefan Gerlach (stefan.gerlach@uni.kn)
+ Description : widget for editing properties of interpolation curves
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301 USA *
+ * *
+ ***************************************************************************/
+
+#include "XYInterpolationCurveDock.h"
+#include "backend/core/AspectTreeModel.h"
+#include "backend/core/Project.h"
+#include "backend/worksheet/plots/cartesian/XYInterpolationCurve.h"
+#include "commonfrontend/widgets/TreeViewComboBox.h"
+#include <QMenu>
+#include <QWidgetAction>
+#include <QDebug>
+
+/*!
+ \class XYInterpolationCurveDock
+ \brief Provides a widget for editing the properties of the XYInterpolationCurves
+ (2D-curves defined by an interpolation) currently selected in
+ the project explorer.
+
+ If more then one curves are set, the properties of the first column are shown.
+ The changes of the properties are applied to all curves.
+ The exclusions are the name, the comment and the datasets (columns) of
+ the curves - these properties can only be changed if there is only one single \
curve. +
+ \ingroup kdefrontend
+*/
+
+XYInterpolationCurveDock::XYInterpolationCurveDock(QWidget *parent):
+ XYCurveDock(parent), cbXDataColumn(0), cbYDataColumn(0), m_interpolationCurve(0) {
+}
+
+/*!
+ * // Tab "General"
+ */
+void XYInterpolationCurveDock::setupGeneral() {
+ QWidget* generalTab = new QWidget(ui.tabGeneral);
+ uiGeneralTab.setupUi(generalTab);
+
+ QGridLayout* gridLayout = dynamic_cast<QGridLayout*>(generalTab->layout());
+ if (gridLayout) {
+ gridLayout->setContentsMargins(2,2,2,2);
+ gridLayout->setHorizontalSpacing(2);
+ gridLayout->setVerticalSpacing(2);
+ }
+
+ cbXDataColumn = new TreeViewComboBox(generalTab);
+ gridLayout->addWidget(cbXDataColumn, 4, 1, 1, 2);
+ cbYDataColumn = new TreeViewComboBox(generalTab);
+ gridLayout->addWidget(cbYDataColumn, 5, 1, 1, 2);
+
+ uiGeneralTab.cbType->addItem(i18n("Low pass"));
+ uiGeneralTab.cbType->addItem(i18n("High pass"));
+ uiGeneralTab.cbType->addItem(i18n("Band pass"));
+ uiGeneralTab.cbType->addItem(i18n("Band reject"));
+ uiGeneralTab.cbType->addItem(i18n("Threshold"));
+
+ uiGeneralTab.cbForm->addItem(i18n("Ideal"));
+ uiGeneralTab.cbForm->addItem(i18n("Butterworth"));
+ uiGeneralTab.cbForm->addItem(i18n("Chebyshev type I"));
+ uiGeneralTab.cbForm->addItem(i18n("Chebyshev type II"));
+
+ uiGeneralTab.cbUnit->addItem(i18n("Frequency (Hz)"));
+ uiGeneralTab.cbUnit->addItem(i18n("Fraction"));
+ uiGeneralTab.cbUnit->addItem(i18n("Index"));
+ uiGeneralTab.cbUnit2->addItem(i18n("Frequency (Hz)"));
+ uiGeneralTab.cbUnit2->addItem(i18n("Fraction"));
+ uiGeneralTab.cbUnit2->addItem(i18n("Index"));
+ uiGeneralTab.pbRecalculate->setIcon(KIcon("run-build"));
+
+ QHBoxLayout* layout = new QHBoxLayout(ui.tabGeneral);
+ layout->setMargin(0);
+ layout->addWidget(generalTab);
+
+ //Slots
+ connect( uiGeneralTab.leName, SIGNAL(returnPressed()), this, SLOT(nameChanged()) );
+ connect( uiGeneralTab.leComment, SIGNAL(returnPressed()), this, \
SLOT(commentChanged()) ); + connect( uiGeneralTab.chkVisible, SIGNAL(clicked(bool)), \
this, SLOT(visibilityChanged(bool)) ); +
+ connect( uiGeneralTab.cbType, SIGNAL(currentIndexChanged(int)), this, \
SLOT(typeChanged(int)) ); + connect( uiGeneralTab.cbForm, \
SIGNAL(currentIndexChanged(int)), this, SLOT(formChanged(int)) ); + connect( \
uiGeneralTab.sbOrder, SIGNAL(valueChanged(int)), this, SLOT(orderChanged(int)) ); \
+ connect( uiGeneralTab.sbCutoff, SIGNAL(valueChanged(double)), this, \
SLOT(enableRecalculate()) ); + connect( uiGeneralTab.sbCutoff2, \
SIGNAL(valueChanged(double)), this, SLOT(enableRecalculate()) ); + connect( \
uiGeneralTab.cbUnit, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged(int)) \
); + connect( uiGeneralTab.cbUnit2, SIGNAL(currentIndexChanged(int)), this, \
SLOT(unit2Changed(int)) ); +
+// connect( uiGeneralTab.pbOptions, SIGNAL(clicked()), this, SLOT(showOptions()) );
+ connect( uiGeneralTab.pbRecalculate, SIGNAL(clicked()), this, \
SLOT(recalculateClicked()) ); +}
+
+void XYInterpolationCurveDock::initGeneralTab() {
+ //if there are more then one curve in the list, disable the tab "general"
+ if (m_curvesList.size()==1){
+ uiGeneralTab.lName->setEnabled(true);
+ uiGeneralTab.leName->setEnabled(true);
+ uiGeneralTab.lComment->setEnabled(true);
+ uiGeneralTab.leComment->setEnabled(true);
+
+ uiGeneralTab.leName->setText(m_curve->name());
+ uiGeneralTab.leComment->setText(m_curve->comment());
+ }else {
+ uiGeneralTab.lName->setEnabled(false);
+ uiGeneralTab.leName->setEnabled(false);
+ uiGeneralTab.lComment->setEnabled(false);
+ uiGeneralTab.leComment->setEnabled(false);
+
+ uiGeneralTab.leName->setText("");
+ uiGeneralTab.leComment->setText("");
+ }
+
+ //show the properties of the first curve
+ m_interpolationCurve = dynamic_cast<XYInterpolationCurve*>(m_curve);
+ Q_ASSERT(m_interpolationCurve);
+ XYCurveDock::setModelIndexFromColumn(cbXDataColumn, \
m_interpolationCurve->xDataColumn()); \
+ XYCurveDock::setModelIndexFromColumn(cbYDataColumn, \
m_interpolationCurve->yDataColumn()); +
+ uiGeneralTab.cbType->setCurrentIndex(m_interpolationData.type);
+ this->typeChanged(m_interpolationData.type);
+ //uiGeneralTab.cbForm->setCurrentIndex(m_interpolationData.form);
+ //this->formChanged(m_interpolationData.form);
+ //uiGeneralTab.sbOrder->setValue(m_interpolationData.order);
+ //uiGeneralTab.cbUnit->setCurrentIndex(m_interpolationData.unit);
+ //this->unitChanged(m_interpolationData.unit);
+ // after unit has set
+ //uiGeneralTab.sbCutoff->setValue(m_interpolationData.cutoff);
+ //uiGeneralTab.cbUnit2->setCurrentIndex(m_interpolationData.unit2);
+ //this->unit2Changed(m_interpolationData.unit2);
+ // after unit has set
+ //uiGeneralTab.sbCutoff2->setValue(m_interpolationData.cutoff2);
+ this->showInterpolationResult();
+
+ //enable the "recalculate"-button if the source data was changed since the last \
interpolation + uiGeneralTab.pbRecalculate->setEnabled(m_interpolationCurve->isSourceDataChangedSinceLastInterpolation());
+
+ uiGeneralTab.chkVisible->setChecked( m_curve->isVisible() );
+
+ //Slots
+ connect(m_interpolationCurve, SIGNAL(aspectDescriptionChanged(const \
AbstractAspect*)), this, SLOT(curveDescriptionChanged(const AbstractAspect*))); \
+ connect(m_interpolationCurve, SIGNAL(xDataColumnChanged(const AbstractColumn*)), \
this, SLOT(curveXDataColumnChanged(const AbstractColumn*))); \
+ connect(m_interpolationCurve, SIGNAL(yDataColumnChanged(const AbstractColumn*)), \
this, SLOT(curveYDataColumnChanged(const AbstractColumn*))); \
+ connect(m_interpolationCurve, \
SIGNAL(interpolationDataChanged(XYInterpolationCurve::InterpolationData)), this, \
SLOT(curveInterpolationDataChanged(XYInterpolationCurve::InterpolationData))); \
+ connect(m_interpolationCurve, SIGNAL(sourceDataChangedSinceLastInterpolation()), \
this, SLOT(enableRecalculate())); +}
+
+void XYInterpolationCurveDock::setModel() {
+ QList<const char*> list;
+ list<<"Folder"<<"Workbook"<<"Spreadsheet"<<"FileDataSource"<<"Column"<<"Datapicker";
+ cbXDataColumn->setTopLevelClasses(list);
+ cbYDataColumn->setTopLevelClasses(list);
+
+ list.clear();
+ list<<"Column";
+ cbXDataColumn->setSelectableClasses(list);
+ cbYDataColumn->setSelectableClasses(list);
+
+ cbXDataColumn->setModel(m_aspectTreeModel);
+ cbYDataColumn->setModel(m_aspectTreeModel);
+
+ connect( cbXDataColumn, SIGNAL(currentModelIndexChanged(QModelIndex)), this, \
SLOT(xDataColumnChanged(QModelIndex)) ); + connect( cbYDataColumn, \
SIGNAL(currentModelIndexChanged(QModelIndex)), this, \
SLOT(yDataColumnChanged(QModelIndex)) ); + XYCurveDock::setModel();
+}
+
+/*!
+ sets the curves. The properties of the curves in the list \c list can be edited in \
this widget. +*/
+void XYInterpolationCurveDock::setCurves(QList<XYCurve*> list) {
+ m_initializing=true;
+ m_curvesList=list;
+ m_curve=list.first();
+ m_interpolationCurve = dynamic_cast<XYInterpolationCurve*>(m_curve);
+ Q_ASSERT(m_interpolationCurve);
+ m_aspectTreeModel = new AspectTreeModel(m_curve->project());
+ this->setModel();
+ m_interpolationData = m_interpolationCurve->interpolationData();
+ initGeneralTab();
+ initTabs();
+ m_initializing=false;
+}
+
+//*************************************************************
+//**** SLOTs for changes triggered in XYFitCurveDock *****
+//*************************************************************
+void XYInterpolationCurveDock::nameChanged(){
+ if (m_initializing)
+ return;
+
+ m_curve->setName(uiGeneralTab.leName->text());
+}
+
+void XYInterpolationCurveDock::commentChanged(){
+ if (m_initializing)
+ return;
+
+ m_curve->setComment(uiGeneralTab.leComment->text());
+}
+
+void XYInterpolationCurveDock::xDataColumnChanged(const QModelIndex& index) {
+ if (m_initializing)
+ return;
+
+ AbstractAspect* aspect = static_cast<AbstractAspect*>(index.internalPointer());
+ AbstractColumn* column = 0;
+ if (aspect) {
+ column = dynamic_cast<AbstractColumn*>(aspect);
+ Q_ASSERT(column);
+ }
+
+ foreach(XYCurve* curve, m_curvesList)
+ dynamic_cast<XYInterpolationCurve*>(curve)->setXDataColumn(column);
+
+ // update range of cutoff spin boxes (like a unit change)
+// unitChanged(uiGeneralTab.cbUnit->currentIndex());
+// unit2Changed(uiGeneralTab.cbUnit2->currentIndex());
+}
+
+void XYInterpolationCurveDock::yDataColumnChanged(const QModelIndex& index) {
+ if (m_initializing)
+ return;
+
+ AbstractAspect* aspect = static_cast<AbstractAspect*>(index.internalPointer());
+ AbstractColumn* column = 0;
+ if (aspect) {
+ column = dynamic_cast<AbstractColumn*>(aspect);
+ Q_ASSERT(column);
+ }
+
+ foreach(XYCurve* curve, m_curvesList)
+ dynamic_cast<XYInterpolationCurve*>(curve)->setYDataColumn(column);
+}
+
+void XYInterpolationCurveDock::typeChanged(int index) {
+ XYInterpolationCurve::InterpolationType type = \
(XYInterpolationCurve::InterpolationType)index; + m_interpolationData.type = \
(XYInterpolationCurve::InterpolationType)uiGeneralTab.cbType->currentIndex(); +
+ //TODO
+
+ uiGeneralTab.pbRecalculate->setEnabled(true);
+}
+
+/*void XYInterpolationCurveDock::formChanged(int index) {
+ XYInterpolationCurve::InterpolationForm form = \
(XYInterpolationCurve::InterpolationForm)index; + m_interpolationData.form = \
(XYInterpolationCurve::InterpolationForm)uiGeneralTab.cbForm->currentIndex(); +
+ switch(form) {
+ case XYInterpolationCurve::Ideal:
+ uiGeneralTab.sbOrder->setVisible(false);
+ uiGeneralTab.lOrder->setVisible(false);
+ break;
+ case XYInterpolationCurve::Butterworth:
+ case XYInterpolationCurve::ChebyshevI:
+ case XYInterpolationCurve::ChebyshevII:
+ uiGeneralTab.sbOrder->setVisible(true);
+ uiGeneralTab.lOrder->setVisible(true);
+ break;
+ }
+
+ uiGeneralTab.pbRecalculate->setEnabled(true);
+}
+
+void XYInterpolationCurveDock::orderChanged(int index) {
+ Q_UNUSED(index)
+ m_interpolationData.order = uiGeneralTab.sbOrder->value();
+
+ uiGeneralTab.pbRecalculate->setEnabled(true);
+}
+
+void XYInterpolationCurveDock::unitChanged(int index) {
+ XYInterpolationCurve::CutoffUnit unit = (XYInterpolationCurve::CutoffUnit)index;
+ m_interpolationData.unit = \
(XYInterpolationCurve::CutoffUnit)uiGeneralTab.cbUnit->currentIndex(); +
+ int n=100;
+ double T=1.0;
+ if(m_interpolationCurve->xDataColumn() != NULL) {
+ n = m_interpolationCurve->xDataColumn()->rowCount();
+ T = m_interpolationCurve->xDataColumn()->maximum() - \
m_interpolationCurve->xDataColumn()->minimum(); + }
+ switch(unit) {
+ case XYInterpolationCurve::Frequency:
+ uiGeneralTab.sbCutoff->setDecimals(6);
+ uiGeneralTab.sbCutoff->setMaximum(1.0/T);
+ uiGeneralTab.sbCutoff->setSingleStep(0.01/T);
+ break;
+ case XYInterpolationCurve::Fraction:
+ uiGeneralTab.sbCutoff->setDecimals(6);
+ uiGeneralTab.sbCutoff->setMaximum(1.0);
+ uiGeneralTab.sbCutoff->setSingleStep(0.01);
+ break;
+ case XYInterpolationCurve::Index:
+ uiGeneralTab.sbCutoff->setDecimals(0);
+ uiGeneralTab.sbCutoff->setSingleStep(1);
+ uiGeneralTab.sbCutoff->setMaximum(n);
+ break;
+ }
+
+ uiGeneralTab.pbRecalculate->setEnabled(true);
+}
+
+void XYInterpolationCurveDock::unit2Changed(int index) {
+ XYInterpolationCurve::CutoffUnit unit2 = (XYInterpolationCurve::CutoffUnit)index;
+ m_interpolationData.unit2 = \
(XYInterpolationCurve::CutoffUnit)uiGeneralTab.cbUnit2->currentIndex(); +
+ int n=100;
+ double T=1.0;
+ if(m_interpolationCurve->xDataColumn() != NULL) {
+ n = m_interpolationCurve->xDataColumn()->rowCount();
+ T = m_interpolationCurve->xDataColumn()->maximum() - \
m_interpolationCurve->xDataColumn()->minimum(); + }
+ switch(unit2) {
+ case XYInterpolationCurve::Frequency:
+ uiGeneralTab.sbCutoff2->setDecimals(6);
+ uiGeneralTab.sbCutoff2->setMaximum(1.0/T);
+ uiGeneralTab.sbCutoff2->setSingleStep(0.01/T);
+ break;
+ case XYInterpolationCurve::Fraction:
+ uiGeneralTab.sbCutoff2->setDecimals(6);
+ uiGeneralTab.sbCutoff2->setMaximum(1.0);
+ uiGeneralTab.sbCutoff2->setSingleStep(0.01);
+ break;
+ case XYInterpolationCurve::Index:
+ uiGeneralTab.sbCutoff2->setDecimals(0);
+ uiGeneralTab.sbCutoff2->setSingleStep(1);
+ uiGeneralTab.sbCutoff2->setMaximum(n);
+ break;
+ }
+
+ uiGeneralTab.pbRecalculate->setEnabled(true);
+}
+*/
+void XYInterpolationCurveDock::recalculateClicked() {
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+ //m_interpolationData.cutoff = uiGeneralTab.sbCutoff->value();
+
+ foreach(XYCurve* curve, m_curvesList)
+ dynamic_cast<XYInterpolationCurve*>(curve)->setInterpolationData(m_interpolationData);
+
+ uiGeneralTab.pbRecalculate->setEnabled(false);
+ QApplication::restoreOverrideCursor();
+}
+
+void XYInterpolationCurveDock::enableRecalculate() const {
+ if (m_initializing)
+ return;
+
+ //no interpolationing possible without the x- and y-data
+ AbstractAspect* aspectX = \
static_cast<AbstractAspect*>(cbXDataColumn->currentModelIndex().internalPointer()); \
+ AbstractAspect* aspectY = \
static_cast<AbstractAspect*>(cbYDataColumn->currentModelIndex().internalPointer()); \
+ bool data = (aspectX!=0 && aspectY!=0); +
+ uiGeneralTab.pbRecalculate->setEnabled(data);
+}
+
+/*!
+ * show the result and details of the interpolation
+ */
+void XYInterpolationCurveDock::showInterpolationResult() {
+ const XYInterpolationCurve::InterpolationResult& interpolationResult = \
m_interpolationCurve->interpolationResult(); + if (!interpolationResult.available) {
+ uiGeneralTab.teResult->clear();
+ return;
+ }
+
+ //const XYInterpolationCurve::InterpolationData& interpolationData = \
m_interpolationCurve->interpolationData(); + QString str = i18n("status") + ": " + \
interpolationResult.status + "<br>"; +
+ if (!interpolationResult.valid) {
+ uiGeneralTab.teResult->setText(str);
+ return; //result is not valid, there was an error which is shown in the \
status-string, nothing to show more. + }
+
+ if (interpolationResult.elapsedTime>1000)
+ str += i18n("calculation time: %1 \
s").arg(QString::number(interpolationResult.elapsedTime/1000)) + "<br>"; + else
+ str += i18n("calculation time: %1 \
ms").arg(QString::number(interpolationResult.elapsedTime)) + "<br>"; +
+ str += "<br><br>";
+
+ uiGeneralTab.teResult->setText(str);
+}
+
+//*************************************************************
+//*********** SLOTs for changes triggered in XYCurve **********
+//*************************************************************
+//General-Tab
+void XYInterpolationCurveDock::curveDescriptionChanged(const AbstractAspect* aspect) \
{ + if (m_curve != aspect)
+ return;
+
+ m_initializing = true;
+ if (aspect->name() != uiGeneralTab.leName->text()) {
+ uiGeneralTab.leName->setText(aspect->name());
+ } else if (aspect->comment() != uiGeneralTab.leComment->text()) {
+ uiGeneralTab.leComment->setText(aspect->comment());
+ }
+ m_initializing = false;
+}
+
+void XYInterpolationCurveDock::curveXDataColumnChanged(const AbstractColumn* column) \
{ + m_initializing = true;
+ XYCurveDock::setModelIndexFromColumn(cbXDataColumn, column);
+ m_initializing = false;
+}
+
+void XYInterpolationCurveDock::curveYDataColumnChanged(const AbstractColumn* column) \
{ + m_initializing = true;
+ XYCurveDock::setModelIndexFromColumn(cbYDataColumn, column);
+ m_initializing = false;
+}
+
+void XYInterpolationCurveDock::curveInterpolationDataChanged(const \
XYInterpolationCurve::InterpolationData& data) { + m_initializing = true;
+ m_interpolationData = data;
+ uiGeneralTab.cbType->setCurrentIndex(m_interpolationData.type);
+ this->typeChanged(m_interpolationData.type);
+
+ this->showInterpolationResult();
+ m_initializing = false;
+}
+
+void XYInterpolationCurveDock::dataChanged() {
+ this->enableRecalculate();
+}
diff --git a/src/kdefrontend/dockwidgets/XYInterpolationCurveDock.h \
b/src/kdefrontend/dockwidgets/XYInterpolationCurveDock.h new file mode 100644
index 0000000..541fa7b
--- /dev/null
+++ b/src/kdefrontend/dockwidgets/XYInterpolationCurveDock.h
@@ -0,0 +1,87 @@
+/***************************************************************************
+ File : XYInterpolationCurveDock.h
+ Project : LabPlot
+ --------------------------------------------------------------------
+ Copyright : (C) 2016 Stefan Gerlach (stefan.gerlach@uni.kn)
+ Description : widget for editing properties of interpolation curves
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301 USA *
+ * *
+ ***************************************************************************/
+
+#ifndef XYINTERPOLATIONCURVEDOCK_H
+#define XYINTERPOLATIONCURVEDOCK_H
+
+#include "kdefrontend/dockwidgets/XYCurveDock.h"
+#include "backend/worksheet/plots/cartesian/XYInterpolationCurve.h"
+#include "ui_xyinterpolationcurvedockgeneraltab.h"
+
+class TreeViewComboBox;
+
+class XYInterpolationCurveDock: public XYCurveDock {
+ Q_OBJECT
+
+public:
+ explicit XYInterpolationCurveDock(QWidget *parent);
+ void setCurves(QList<XYCurve*>);
+ virtual void setupGeneral();
+
+private:
+ virtual void initGeneralTab();
+ void showInterpolationResult();
+
+ Ui::XYInterpolationCurveDockGeneralTab uiGeneralTab;
+ TreeViewComboBox* cbXDataColumn;
+ TreeViewComboBox* cbYDataColumn;
+ TreeViewComboBox* cbWeightsColumn;
+
+ XYInterpolationCurve* m_interpolationCurve;
+ XYInterpolationCurve::InterpolationData m_interpolationData;
+
+protected:
+ virtual void setModel();
+
+private slots:
+ //SLOTs for changes triggered in XYInterpolationCurveDock
+ //general tab
+ void nameChanged();
+ void commentChanged();
+ void xDataColumnChanged(const QModelIndex&);
+ void yDataColumnChanged(const QModelIndex&);
+ void typeChanged(int);
+// void formChanged(int);
+// void orderChanged(int);
+
+// void showOptions();
+ void recalculateClicked();
+
+ void enableRecalculate() const;
+
+ //SLOTs for changes triggered in XYCurve
+ //General-Tab
+ void curveDescriptionChanged(const AbstractAspect*);
+ void curveXDataColumnChanged(const AbstractColumn*);
+ void curveYDataColumnChanged(const AbstractColumn*);
+ void curveInterpolationDataChanged(const XYInterpolationCurve::InterpolationData&);
+ void dataChanged();
+
+};
+
+#endif
diff --git a/src/kdefrontend/ui/dockwidgets/xyinterpolationcurvedockgeneraltab.ui \
b/src/kdefrontend/ui/dockwidgets/xyinterpolationcurvedockgeneraltab.ui new file mode \
100644 index 0000000..016cbae
--- /dev/null
+++ b/src/kdefrontend/ui/dockwidgets/xyinterpolationcurvedockgeneraltab.ui
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>XYInterpolationCurveDockGeneralTab</class>
+ <widget class="QWidget" name="XYInterpolationCurveDockGeneralTab">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>917</width>
+ <height>794</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="8" column="1">
+ <widget class="KComboBox" name="cbType">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="14" column="0">
+ <widget class="QLabel" name="lCutoff">
+ <property name="text">
+ <string>Cutoff</string>
+ </property>
+ </widget>
+ </item>
+ <item row="19" column="0" rowspan="2" colspan="3">
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <spacer name="verticalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="lName">
+ <property name="text">
+ <string>Name</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0">
+ <widget class="QLabel" name="lInterpolation">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Interpolation:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="0">
+ <widget class="QLabel" name="lType">
+ <property name="text">
+ <string>Type</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="lYColumn">
+ <property name="text">
+ <string>y-data</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="lXColumn">
+ <property name="text">
+ <string>x-data</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" colspan="2">
+ <widget class="KLineEdit" name="leComment"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="lData">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Data:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" colspan="2">
+ <widget class="KLineEdit" name="leName"/>
+ </item>
+ <item row="23" column="0">
+ <spacer name="verticalSpacerGeneral">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>24</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="24" column="0">
+ <widget class="QCheckBox" name="chkVisible">
+ <property name="text">
+ <string>visible</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="lComment">
+ <property name="text">
+ <string>Comment</string>
+ </property>
+ </widget>
+ </item>
+ <item row="22" column="1">
+ <widget class="QPushButton" name="pbRecalculate">
+ <property name="text">
+ <string>Recalculate</string>
+ </property>
+ </widget>
+ </item>
+ <item row="18" column="1">
+ <widget class="QTextEdit" name="teResult"/>
+ </item>
+ <item row="18" column="0">
+ <widget class="QLabel" name="label">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Results:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ </widget>
+ </item>
+ <item row="14" column="1" rowspan="2">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QDoubleSpinBox" name="sbCutoff">
+ <property name="decimals">
+ <number>2</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="cbUnit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="9" column="0">
+ <widget class="QLabel" name="lForm">
+ <property name="text">
+ <string>Form</string>
+ </property>
+ </widget>
+ </item>
+ <item row="16" column="0">
+ <widget class="QLabel" name="lCutoff2">
+ <property name="text">
+ <string>Cutoff2</string>
+ </property>
+ </widget>
+ </item>
+ <item row="16" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QDoubleSpinBox" name="sbCutoff2"/>
+ </item>
+ <item>
+ <widget class="QComboBox" name="cbUnit2"/>
+ </item>
+ </layout>
+ </item>
+ <item row="9" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QComboBox" name="cbForm"/>
+ </item>
+ <item>
+ <widget class="QLabel" name="lOrder">
+ <property name="text">
+ <string>Order</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="sbOrder">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>10</number>
+ </property>
+ <property name="value">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>KComboBox</class>
+ <extends>QComboBox</extends>
+ <header>kcombobox.h</header>
+ </customwidget>
+ <customwidget>
+ <class>KLineEdit</class>
+ <extends>QLineEdit</extends>
+ <header>klineedit.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic