TableStatistics.h
Go to the documentation of this file.
/***************************************************************************
File : TableStatistics.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2006 by Knut Franke
Email (use @ for *) : knut.franke*gmx.de
Description : Table subclass that displays statistics on
columns or rows of another table
***************************************************************************/
/***************************************************************************
* *
* 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 TABLE_STATISTICS_H
#define TABLE_STATISTICS_H
#include "Table.h"
class TableStatistics : public Table
{
Q_OBJECT
public:
enum Type { row, column };
enum StatisticsColType {NoStats, Row, Col, Rows, Cols, Mean, StandardDev, StandardError, Variance, Sum, iMax, Max, iMin, Min, N, Median};
TableStatistics(ScriptingEnv *env, ApplicationWindow *parent, Table *base, Type, QList<int> targets, int start = 0, int end = -1);
Type type() const { return d_type; }
Table *base() const { return d_base; }
void setBase(Table *t);
// saving
virtual void save(const QString&, const QString &geometry, bool = false);
void setColumnStatsTypes(const QList<int>& colStatTypes);
void setRange(int start, int end);
QString baseName(){return d_base_name;}
void setBaseName(const QString& name){d_base_name = name;}
public slots:
void update();
void update(Table*, const QString& colName);
void renameCol(const QString&, const QString&);
void removeCol(const QString&);
private slots:
void closedBase();
void removeStatsCol(int);
void moveColumn(int, int, int);
void changeColIndex(int, int);
void insertCols(int start, int count);
void addCol(PlotDesignation pd = Y);
private:
Table *d_base;
Type d_type;
QList<int> d_targets;
QList<int> d_stats_col_type;
int d_start, d_end;
QString d_base_name;
};
#endif
TableStatistics::StandardDev
Definition: TableStatistics.h:47
TableStatistics::removeStatsCol
void removeStatsCol(int)
Definition: TableStatistics.cpp:418
TableStatistics::Mean
Definition: TableStatistics.h:47
TableStatistics::Min
Definition: TableStatistics.h:47
TableStatistics::d_base_name
QString d_base_name
Definition: TableStatistics.h:86
TableStatistics::moveColumn
void moveColumn(int, int, int)
Definition: TableStatistics.cpp:147
TableStatistics::closedBase
void closedBase()
Definition: TableStatistics.cpp:177
TableStatistics::Col
Definition: TableStatistics.h:47
TableStatistics::Rows
Definition: TableStatistics.h:47
TableStatistics::N
Definition: TableStatistics.h:47
TableStatistics::column
Definition: TableStatistics.h:46
ScriptingEnv
An interpreter for evaluating scripting code. Abstract.
Definition: ScriptingEnv.h:50
TableStatistics
Table that computes and displays statistics on another Table.
Definition: TableStatistics.h:40
TableStatistics::Row
Definition: TableStatistics.h:47
TableStatistics::renameCol
void renameCol(const QString &, const QString &)
handle renaming of columns (to be connected with Table::changedColHeader)
Definition: TableStatistics.cpp:388
TableStatistics::NoStats
Definition: TableStatistics.h:47
TableStatistics::d_stats_col_type
QList< int > d_stats_col_type
Definition: TableStatistics.h:84
TableStatistics::setBase
void setBase(Table *t)
Definition: TableStatistics.cpp:98
TableStatistics::type
Type type() const
return the type of statistics
Definition: TableStatistics.h:50
Table::Y
Definition: Table.h:62
TableStatistics::row
Definition: TableStatistics.h:46
TableStatistics::setBaseName
void setBaseName(const QString &name)
Definition: TableStatistics.h:60
TableStatistics::save
virtual void save(const QString &, const QString &geometry, bool=false)
Definition: TableStatistics.cpp:430
TableStatistics::Max
Definition: TableStatistics.h:47
TableStatistics::iMax
Definition: TableStatistics.h:47
TableStatistics::d_start
int d_start
Definition: TableStatistics.h:85
TableStatistics::Sum
Definition: TableStatistics.h:47
TableStatistics::d_type
Type d_type
Definition: TableStatistics.h:82
Table::colName
QString colName(int col)
Definition: Table.cpp:1055
ApplicationWindow
QtiPlot&#39;s main window.
Definition: ApplicationWindow.h:133
Table::removeCol
void removeCol()
Definition: Table.cpp:1726
TableStatistics::changeColIndex
void changeColIndex(int, int)
Definition: TableStatistics.cpp:142
TableStatistics::update
void update()
update statistics when the user triggers a recaculate action
Definition: TableStatistics.cpp:182
TableStatistics::setRange
void setRange(int start, int end)
Definition: TableStatistics.cpp:424
TableStatistics::d_targets
QList< int > d_targets
Definition: TableStatistics.h:83
TableStatistics::base
Table * base() const
return the base table of which statistics are displayed
Definition: TableStatistics.h:52
TableStatistics::addCol
void addCol(PlotDesignation pd=Y)
Definition: TableStatistics.cpp:171
TableStatistics::Cols
Definition: TableStatistics.h:47
TableStatistics::iMin
Definition: TableStatistics.h:47
Table.h
TableStatistics::Median
Definition: TableStatistics.h:47
TableStatistics::StatisticsColType
StatisticsColType
Definition: TableStatistics.h:47
TableStatistics::StandardError
Definition: TableStatistics.h:47
TableStatistics::d_base
Table * d_base
Definition: TableStatistics.h:81
TableStatistics::baseName
QString baseName()
Definition: TableStatistics.h:59
Table::PlotDesignation
PlotDesignation
Definition: Table.h:62
Table
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
TableStatistics::insertCols
void insertCols(int start, int count)
Definition: TableStatistics.cpp:158
TableStatistics::TableStatistics
TableStatistics(ScriptingEnv *env, ApplicationWindow *parent, Table *base, Type, QList< int > targets, int start=0, int end=-1)
Definition: TableStatistics.cpp:41
TableStatistics::d_end
int d_end
Definition: TableStatistics.h:85
TableStatistics::Type
Type
supported statistics types
Definition: TableStatistics.h:46
MdiSubWindow::name
QString name()
Return the window name.
Definition: MdiSubWindow.h:84
TableStatistics::setColumnStatsTypes
void setColumnStatsTypes(const QList< int > &colStatTypes)
Definition: TableStatistics.cpp:136
TableStatistics::Variance
Definition: TableStatistics.h:47