Commit 9269195b authored by Stefan Gerlach's avatar Stefan Gerlach

see changelog

parent 96280b34
2008-03-08 use ACCESS macro for standard methods
MainWin::modified -> Project::changed
started with own TableModel for faster Spreadsheet
2008-03-03 released 2.0.0.alpha1
2008-02-17 worksheet, plots and axes
2008-02-08 column dialog
......
......@@ -38,10 +38,13 @@ BUGS:
TODO :
******
-------------------------------------------------------------------------
* updateGUI() when closing a sheet, changing active sheet
* create parser.tab.c with cmake
"bison parser.y"
* use numinputs in import dialog (when ok)
* check functions.h, constants.h
XX * use GSL
* GSL_VERSION
* Import Dialog
Options
same first column
......@@ -51,39 +54,31 @@ TODO :
audio
database (kexi ?)
file info dialog
XX * labelWidget(): title dialog, function dialog, axes dialog
XX * Use QTableView with own model (QAbstractTableModel) for a faster/smaller Spreadsheet
XX * add function to spreadsheet
* Use const declarations when possible
* dialogs
* SettingsDialog Alexander
* AxesDialog Alexander
* LegendDialog
* PlotDialog
* WorksheetDialog
* dataset dialog
* title dialog : saveSettings
* FunctionDialog
style/symbol
update sheetcb after apply
other plot types
save/load settings
* Print
Worksheet::setupPrinter();
* use GSL (functions.h)
* GSL_VERSION ?
* labelWidget(): title dialog, function dialog
* Use QTableView with own model (QAbstractTableModell) for a faster/smaller Spreadsheet
* Use const declarations when possible
* use macros for standard declarations
#define ACCESSOR(type, var, method) \
type method() const { return var; }; \
void set ## method(const type value) { var = value; }
Example usage:
ACCESSOR(int, version, Version);
* MainWin::modified -> Project::modified
* add Doxygen style documentations
* Project explorer
* analysis functions
-------------------------------------------------------------------------
Settings Dialog Alexander
Axes Dialog Alexander
add function to spreadsheet
XX Worksheet
legend dialog
title dialog : saveSettings
set dialog
Worksheet
draw other symbols
draw other styles
Settings dialog
plot dialog
worksheet dialog
XX Function Dialog
style/symbol
update sheetcb after apply
other plot types
save/load settings
Spreadsheet
column dialog on double click
new column on click (empty header)
......@@ -105,20 +100,19 @@ XX Function Dialog
surface
qwt plot
3d ?
Project explorer
MainWin
Print Preview (see Qt textedit demo)
Export to eps, svg, ...
open
save, save as
analysis functions
open, save, save as
dynamic menus (sheets + data sets)
View: autoscale, zoom, etc.
Scripting (Workbench ?)
dynamic menus (sheets + graphs)
* add Doxygen style documentations
...
##############################################################################################################
NEW FEATURES :
PLANNED NEW FEATURES :
* independent/different y axes
* option to disconnect y2,x2 axes ?
* Undo/Redo support
......@@ -208,9 +202,3 @@ NEW FEATURES :
* include all subdirs
* install
* uninstall -> see cmake FAQ
* Qt/KDE 4 :
* qt3to4
* kdeconfig -> kde4-config
* ./configure --with-qt-dir=/home/kde4/qt
* libqt-mt -> libQtCore, etc.
......@@ -12,5 +12,10 @@ svn co https://labplot.svn.sourceforge.net/svnroot/labplot/2.0
Commit :
########
svn status <- shows modified, deleted, added files
svn add file
svn rename --force oldfile newfile
svn delete file.tmp
svn commit -m "deleted tmp file" --username=<login>
make clean
rm -rf CMakeFiles CMakeTmp src/CMakeFiles
rm -f Makefile CMakeCache.txt cmake_install.cmake cmake_uninstall.cmake install_manifest.txt
rm -f src/LabPlot src/LabPlot.shell src/moc_* src/LabPlot_automoc.cpp src/LabPlot_automoc.cpp.files src/cmake_install.cmake
......@@ -9,7 +9,7 @@ class AxesDialog: public Dialog
{
Q_OBJECT
public:
// AxesDialog(MainWin *mw, const char *name, int axesnr);
// AxesDialog(MainWin *mw, int axesnr);
AxesDialog(MainWin *mw);
};
#endif //AXESDIALOG_H
......@@ -30,7 +30,7 @@ Axis::Axis() {
ticklabelformat = AUTO;
datetimeformat = "auto";
ticklabelprecision = 3;
tickpos = 0;
tickposition = 0;
gap = 15;
majorgridtype = Qt::DashLine;
minorgridtype = Qt::DotLine;
......
......@@ -5,126 +5,87 @@
#include <QFont>
#include <QColor>
#include "Label.h"
#include "scale.h"
#include "tickformat.h"
#include "Label.h"
#include "defs.h"
class Axis {
public:
Axis();
/* ~Axis();
QDomElement saveXML(QDomDocument doc, int id);
void openXML(QDomNode node);
*/
void Enable(bool b=true) { enabled = b; }
bool Enabled() { return enabled; }
void setScale(TScale s) { scale=s; }
TScale Scale() { return scale; }
// void setLabel(Label *l);
Label *getLabel() { return label; }
void setScaling(double s) { scaling=s; }
double Scaling() { return scaling; }
void setShift(double s) { shift=s; }
double Shift() { return shift; }
void setPosition(int p) { position = p; }
int Position() { return position; }
// QDomElement saveXML(QDomDocument doc, int id);
// void openXML(QDomNode node);
void centerX(int plotsize, double center); //!< center label on x axis
void centerY(int plotsize, double center); //!< center label on y axis
bool tickType() { return ticktype; }
void setTickType(bool t) { ticktype = t; }
bool tickLabelEnabled() { return ticklabel_enabled; }
void enableTickLabel(bool e=true) { ticklabel_enabled = e; }
void setTickLabelRotation(double r) { ticklabelrotation = r; }
double TickLabelRotation() { return ticklabelrotation; }
void setTickLabelPrefix(QString p) { ticklabelprefix=p; }
QString TickLabelPrefix() { return ticklabelprefix; }
void setTickLabelSuffix(QString s) { ticklabelsuffix=s; }
QString TickLabelSuffix() { return ticklabelsuffix; }
void setTickLabelFont(QFont a) { tickfont = a; }
QFont TickLabelFont() { return tickfont; }
void setTickColor(QColor col) { tickcolor = col; }
QColor TickColor() { return tickcolor; }
void setTickLabelColor(QColor col) { ticklabelcolor = col; }
QColor TickLabelColor() { return ticklabelcolor; }
void setTickLabelFormat(TFormat t) { ticklabelformat = t; }
TFormat TickLabelFormat() { return ticklabelformat; }
void setDateTimeFormat(QString f) { datetimeformat = f; }
QString DateTimeFormat() { return datetimeformat; }
void setTickLabelPrecision(int p) { ticklabelprecision = p; }
int TickLabelPrecision() { return ticklabelprecision; }
void setTickLabelPosition(int g) { gap=g; }
int TickLabelPosition() { return gap; }
// TODO void setLabel(Label *l);
Label *getLabel() { return label; }
ACCESS(bool, enabled, Enabled);
ACCESS(TScale, scale, Scale);
ACCESS(double, scaling, Scaling);
ACCESS(double, shift, Shift);
ACCESS(int, position, Position);
void setMajorTicks(double t) { majorticks = t; } //!< set number of /increment for major ticks
double MajorTicks() { return majorticks; } //!< get number/increment of major ticks
void setMinorTicks(int t) { minorticks = t; } //!< set number of minor ticks
int MinorTicks() { return minorticks; } //!< get number of minor ticks
void enableMajorTicks(bool b=true) { majorticks_enabled = b; }
void enableMinorTicks(bool b=true) { minorticks_enabled = b; }
bool MajorTicksEnabled() { return majorticks_enabled; }
bool MinorTicksEnabled() { return minorticks_enabled; }
void setTickPos(int tp) { tickpos = tp; }
int TickPos() { return tickpos; }
void setMajorTickWidth(int w) { majortickwidth = w; }
int majorTickWidth() { return majortickwidth; }
void setMinorTickWidth(int w) { minortickwidth = w; }
int minorTickWidth() { return minortickwidth; }
double majorTickLength() { return majorticklength; }
void setMajorTickLength(double v) {majorticklength=v; }
double minorTickLength() { return minorticklength; }
void setMinorTickLength(double v) {minorticklength=v; }
ACCESS(int, ticktype, TickType);
ACCESSFLAG(ticklabel_enabled, TickLabel);
ACCESS(double, ticklabelrotation, TickLabelRotation);
ACCESS(QString, ticklabelprefix, TickLabelPrefix);
ACCESS(QString, ticklabelsuffix, TickLabelSuffix);
ACCESS(QFont, tickfont, TickLabelFont);
ACCESS(QColor, tickcolor, TickColor);
ACCESS(QColor, ticklabelcolor, TickLabelColor);
ACCESS(TFormat, ticklabelformat, TickLabelFormat);
ACCESS(QString, datetimeformat, DateTimeFormat);
ACCESS(int, ticklabelprecision, TickLabelPrecision);
ACCESS(int, gap, TickLabelPosition);
bool BorderEnabled() { return border_enabled; }
void enableBorder(bool b=true) { border_enabled=b; }
void setBorderColor(QColor c) { bordercolor = c; }
QColor BorderColor() { return bordercolor; }
void setBorderWidth(int b) { borderwidth = b; }
int borderWidth() { return borderwidth; }
ACCESS(double, majorticks, MajorTicks);
ACCESS(int, minorticks, MinorTicks);
ACCESSFLAG(majorticks_enabled, MajorTicks);
ACCESSFLAG(minorticks_enabled, MinorTicks);
ACCESS(int, tickposition, TickPosition);
ACCESS(int, majortickwidth, majorTickWidth);
ACCESS(int, minortickwidth, minorTickWidth);
ACCESS(int, majorticklength, majorTickLength);
ACCESS(int, minorticklength, minorTickLength);
bool MajorGridEnabled() { return majorgrid_enabled; }
void enableMajorGrid(bool b=true) { majorgrid_enabled=b; }
bool MinorGridEnabled() { return minorgrid_enabled; }
void enableMinorGrid(bool b=true) { minorgrid_enabled=b; }
void setMajorGridColor(QColor c) { majorgridcolor = c; }
QColor majorGridColor() { return majorgridcolor; }
void setMinorGridColor(QColor c) { minorgridcolor = c; }
QColor minorGridColor() { return minorgridcolor; }
void setMajorGridType(Qt::PenStyle t) { majorgridtype = t; }
Qt::PenStyle MajorGridType() { return majorgridtype; }
void setMinorGridType(Qt::PenStyle t) { minorgridtype = t; }
Qt::PenStyle MinorGridType() { return minorgridtype; }
void setMajorGridWidth(int w) { majorgridwidth = w; }
int majorGridWidth() { return majorgridwidth; }
void setMinorGridWidth(int w) { minorgridwidth = w; }
int minorGridWidth() { return minorgridwidth; }
ACCESSFLAG(border_enabled, Border);
ACCESS(QColor, bordercolor, BorderColor);
ACCESS(int, borderwidth, BorderWidth);
ACCESSFLAG(majorgrid_enabled, MajorGrid);
ACCESSFLAG(minorgrid_enabled, MinorGrid);
ACCESS(QColor, majorgridcolor, MajorGridColor);
ACCESS(QColor, minorgridcolor, MinorGridColor);
ACCESS(Qt::PenStyle, majorgridtype, MajorGridType);
ACCESS(Qt::PenStyle, minorgridtype, MinorGridType);
ACCESS(int, majorgridwidth, MajorGridWidth);
ACCESS(int, minorgridwidth, MinorGridWidth);
private:
bool enabled; //!< axis enabled ?
bool enabled;
Label *label;
int position; //!< position : 0: normal 1: center
TScale scale;
double scaling, shift; //!< scaling and shift of axes tic values
int ticktype; //!< tick type. 0: NUMBER, 1: INCREMENT
bool ticklabel_enabled; //!< tick label enabled?
double ticklabelrotation; //!< tick label rotation
double scaling, shift; //!< scaling and shift of axes tick values
int ticktype; //!< tick type. 0: NUMBER, 1: INCREMENT
bool ticklabel_enabled; //!< tick label enabled?
double ticklabelrotation; //!< tick label rotation
QString ticklabelprefix, ticklabelsuffix; //!< tick label prefix and suffix
QFont tickfont; //!< axis/tics label font
QFont tickfont; //!< axis/tics label font
QColor tickcolor, ticklabelcolor;
TFormat ticklabelformat; //!< tick label format
QString datetimeformat; //!< format for time tick label
int ticklabelprecision; //!< tick label precision
int tickpos; //!< tick label position 0:out 1:in 2:in&out 3:none
double majorticks; //!< number of / increment for major ticks
int minorticks; //!< number of minor ticks
bool majorticks_enabled; //!< major ticks enabled ?
bool minorticks_enabled; //!< minor ticks enabled ?
TFormat ticklabelformat;
QString datetimeformat; //!< format for time tick label
int ticklabelprecision;
int tickposition; //!< tick label position 0:out 1:in 2:in&out 3:none
double majorticks; //!< number of / increment for major ticks
int minorticks; //!< number of minor ticks
bool majorticks_enabled, minorticks_enabled;
int gap; //!< gap between tick label and axis
bool border_enabled; //!< border enabled
QColor bordercolor; //!< border color
bool border_enabled;
QColor bordercolor;
int borderwidth;
bool majorgrid_enabled, minorgrid_enabled; //!< border enabled
QColor majorgridcolor, minorgridcolor; //<! major/minor grid color
bool majorgrid_enabled, minorgrid_enabled;
QColor majorgridcolor, minorgridcolor;
Qt::PenStyle majorgridtype; //!< major grid style (solid,dashed,dotted,...)
Qt::PenStyle minorgridtype; //!< minor grid style (solid,dashed,dotted,...)
int majortickwidth, minortickwidth;
......
......@@ -14,7 +14,6 @@ set(LabPlot_SRCS
Label.cc
LabPlot.cc
LegendDialog.cc
LRange.cc
MainWin.cc
Plot.cc
Plot2D.cc
......@@ -23,11 +22,13 @@ set(LabPlot_SRCS
Point.cc
Project.cc
ProjectDialog.cc
Range.cc
Set.cc
Set2D.cc
Spreadsheet.cc
Style.cc
Symbol.cc
TableModel.cc
TitleDialog.cc
Worksheet.cc
WorksheetDialog.cc
......
......@@ -25,8 +25,8 @@ protected:
QGridLayout *layout;
KDoubleNumInput *xni, *yni; // label widget
QTextEdit *labelte;
void labelWidget(QWidget *parent, Label *label);
void setupLabel(Label *label); // apply settings from label widget
void labelWidget(QWidget *parent, Label *label); //!< widget for label settings
void setupLabel(Label *label); //!< apply settings from label widget
private slots:
void setLabelFont(QFont font);
void setLabelSize(QString size);
......
......@@ -6,6 +6,7 @@
#include <QColor>
#include <QDomElement>
#include "errorbars.h"
#include "defs.h"
class Errorbar {
public:
......@@ -15,26 +16,16 @@ public:
void openXML(QDomNode node);
// void draw(QPainter *p, QPointArray pa, QPointArray hpa, QPointArray vpa);
QColor Color() { return color; }
void setColor(QColor c) { color=c; }
QColor BaseColor() { return basecolor; }
void setBaseColor(QColor c) { basecolor=c; }
int XSize() { return xsize; }
void setXSize(int s) { xsize=s; }
int YSize() { return ysize; }
void setYSize(int s) { ysize=s; }
Qt::PenStyle Style() { return style; }
void setStyle(Qt::PenStyle p) { style=p; }
Qt::PenStyle BaseStyle() { return basestyle; }
void setBaseStyle(Qt::PenStyle p) { basestyle=p; }
int Width() { return width; }
void setWidth(int w) { width=w; }
int BaseWidth() { return basewidth; }
void setBaseWidth(int w) { basewidth=w; }
EType XType() { return xtype; }
void setXType(EType e) { xtype=e; }
EType YType() { return ytype; }
void setYType(EType e) { ytype=e; }
ACCESS(QColor, color, Color);
ACCESS(QColor, basecolor, BaseColor);
ACCESS(int, xsize, XSize);
ACCESS(int, ysize, YSize);
ACCESS(Qt::PenStyle, style, Style);
ACCESS(Qt::PenStyle, basestyle, BaseStyle);
ACCESS(int, width, Width);
ACCESS(int, basewidth, BaseWidth);
ACCESS(EType, xtype, XType);
ACCESS(EType, ytype, YType);
private:
QColor color; // errorbar settings
int xsize, ysize;
......
......@@ -24,8 +24,8 @@ public:
long MaxRec() { return maxrec; }
long NVars() { return nvars; }
long NAtts() { return natts; }
QString Att(int aid); // get attribute aid
QString Var(int varid); // get variable varid description
QString Att(int aid); // get attribute aid
QString Var(int varid); // get variable varid description
QString VarName(int varid); // get variable varid name
long VarLen(QString name);
QStringList DataString(int varid); // data info
......@@ -40,8 +40,8 @@ protected:
double Value(void *value,long type);
#endif
private:
QString filename; // file name
bool fileok; // is a netcdf file and readable
QString filename;
bool fileok; //!< is a netcdf file and readable
#ifdef HAVE_CDF
CDFid id; // file id
long ndims, enc, nvars, natts, maj, maxrec;
......
......@@ -12,8 +12,6 @@
#include <hdf5.h>
#endif
using namespace std;
class FilterHDF5
{
public:
......@@ -30,7 +28,7 @@ public:
QString groupName(int set);
QString datasetName(int set);
QString columnName(int set, int col);
double Data(int set, int row, int col); //!< get data of column c and rows r of spreadsheet s
double Data(int set, int row, int col); //!< get data of column c and rows r of spreadsheet s
int Rows(int set);
int Cols(int set);
QString getAttribute(int i);
......@@ -38,7 +36,7 @@ public:
#endif
protected:
private:
bool fileok; // is a hdf5 file and is readable
bool fileok; //!< is a hdf5 file and is readable
QString filename;
};
......
......@@ -59,8 +59,8 @@ protected:
QString pr_att(int ncid,int varid,const char *varname, int ia);
#endif
private:
bool fileok; // is a netcdf file and readable
QString filename; // file
bool fileok; //!< is a netcdf file and readable
QString filename;
#ifdef HAVE_NETCDF
int ncid, ndims, nvars, natts, xdimid; // netcdf id / number of dimensions / vars / attributes / dim id
ncdim dims[NC_MAX_DIMS]; // nc dimensions
......
......@@ -45,6 +45,7 @@ int FilterOPJ::import() {
spread->setColumnName(j,name.replace(QRegExp(".*_"),""));
spread->setColumnType(j,opj.colType(s,j));
#ifndef TABLEVIEW
for (int i=0;i<opj.numRows(s,j);i++) {
double *v = (double *) opj.oData(s,j,i,true);
......@@ -61,6 +62,7 @@ int FilterOPJ::import() {
else // label
item->setText(QString((char *) opj.oData(s,j,i)));
}
#endif
}
}
// TODO
......
......@@ -441,8 +441,7 @@ void FunctionDialog::Apply() {
Set2D *g = new Set2D(f,data,NX);
setupLabel(g->getLabel());
// Set2D *g = new Set2D(f,title,range,SFUNCTION,type,style,symbol,ptr,NX);
// create Plot
// TODO : other plot types
// create plot, TODO : other plot types
mw->addSet(g,sheetcb->currentIndex(),PLOT2D);
}
......
......@@ -510,7 +510,7 @@ void ImportDialog::importBinary(QIODevice *file, Spreadsheet *s) {
break;
}
}
#ifndef TABLEVIEW
for ( int i=0; i<fields; i++ ) {
QTableWidgetItem *item = s->item(row,i);
if(item==0) {
......@@ -519,6 +519,7 @@ void ImportDialog::importBinary(QIODevice *file, Spreadsheet *s) {
}
item->setText(QString::number(getBinaryValue(&ds,(BinaryFormat) formatcb->currentIndex()),'g',10));
}
#endif
row++;
}
s->setRowCount(row);
......@@ -621,6 +622,7 @@ void ImportDialog::importASCII(QIODevice *file, Spreadsheet *s) {
s->setColumnName(i,oneline.at(i));
}
else {
#ifndef TABLEVIEW
for ( int i=0; i<oneline.size(); i++ ) {
QTableWidgetItem *item = s->item(actrow,i);
if(item==0) {
......@@ -629,6 +631,7 @@ void ImportDialog::importASCII(QIODevice *file, Spreadsheet *s) {
}
item->setText(oneline.at(i));
}
#endif
}
if(row>endRow())
break;
......
// LabPlot : LRange.cc
#include "LRange.h"
LRange::LRange(double a, double b)
{
min = a;
max = b;
}
......@@ -31,6 +31,8 @@
<Action name="plot settings" />
<Action name="worksheet settings" />
</Menu>
<Menu name="viewmenu"><text>&amp;View</text>
</Menu>
<Menu name="analysis"><text>&amp;Analysis</text>
</Menu>
<Menu name="drawing"><text>&amp;Drawing</text>
......
......@@ -115,7 +115,7 @@ void MainWin::setupActions() {
}
bool MainWin::warnModified() {
if(mdi->subWindowList().size() > 0 && modified) {
if(mdi->subWindowList().size() > 0 && project->Changed()) {
int want_save = KMessageBox::warningYesNoCancel( this,
i18n("The current project has been modified.\nDo you want to save it?"),
i18n("Save Project"));
......@@ -131,7 +131,7 @@ bool MainWin::warnModified() {
}
}
modified=false;
project->setChanged(false);
return 0;
}
......@@ -139,12 +139,38 @@ void MainWin::updateSheetList() {
// TODO
}
void MainWin::updateSetList() {
// TODO
}
void MainWin::updateGUI() {
updateSheetList();
updateSetList();
// TODO : disable/enable menu items, etc.
if(activeWorksheet() == 0) {
(static_cast<QMenu*> (guiFactory()->container("appearance",this)))->setEnabled(false);
(static_cast<QMenu*> (guiFactory()->container("viewmenu",this)))->setEnabled(false);
(static_cast<QMenu*> (guiFactory()->container("drawing",this)))->setEnabled(false);
if(activeSpreadsheet() == 0)
(static_cast<QMenu*> (guiFactory()->container("analysis",this)))->setEnabled(false);
else
(static_cast<QMenu*> (guiFactory()->container("analysis",this)))->setEnabled(true);
}
else {
(static_cast<QMenu*> (guiFactory()->container("appearance",this)))->setEnabled(true);
(static_cast<QMenu*> (guiFactory()->container("viewmenu",this)))->setEnabled(true);
(static_cast<QMenu*> (guiFactory()->container("drawing",this)))->setEnabled(true);
(static_cast<QMenu*> (guiFactory()->container("analysis",this)))->setEnabled(true);
}
}
void MainWin::openNew() {
kdDebug()<<"MainWin::New()"<<endl;
// if(warnModified()) return;
mdi->closeAllSubWindows();
updateSheetList();
updateGUI();
/* gvpart=0;