Merge lp:~valavanisalex/ubuntu/maverick/scidavis/fix-604811 into lp:ubuntu/maverick/scidavis

Proposed by Alex Valavanis
Status: Merged
Merge reported by: Benjamin Drung
Merged at revision: not available
Proposed branch: lp:~valavanisalex/ubuntu/maverick/scidavis/fix-604811
Merge into: lp:ubuntu/maverick/scidavis
Diff against target: 140484 lines (+71072/-37806)
150 files modified
.pc/.version (+1/-0)
.pc/applied-patches (+2/-0)
.pc/scidavis_pro.diff/scidavis/scidavis.pro (+145/-0)
.pc/sourcefiles_pri.diff/scidavis/sourcefiles.pri (+425/-0)
CHANGES (+49/-0)
Doxyfile (+1/-1)
README (+3/-0)
README.installer (+19/-0)
debian/changelog (+21/-0)
debian/control (+7/-6)
debian/patches/makefile.patch (+0/-42)
debian/patches/package-contains-upstream-install-documentation.patch (+0/-15)
debian/patches/reorder-updatehorizontalheader.patch (+0/-16)
debian/patches/scidavis_pro.diff (+40/-0)
debian/patches/series (+2/-4)
debian/patches/sip49.patch (+0/-29)
debian/patches/sourcefiles_pri.diff (+17/-0)
debian/rules (+0/-1)
debian/source/format (+1/-0)
debian/source/options (+2/-0)
debian/watch (+2/-1)
scidavis/python-sipcmd.py (+5/-1)
scidavis/python.pri (+13/-1)
scidavis/scidavis.pro (+12/-13)
scidavis/scidavisrc.py (+41/-0)
scidavis/sourcefiles.pri (+10/-5)
scidavis/src/ApplicationWindow.cpp (+237/-168)
scidavis/src/ApplicationWindow.h (+8/-4)
scidavis/src/AssociationsDialog.cpp (+1/-1)
scidavis/src/AxesDialog.cpp (+32/-3)
scidavis/src/BoxCurve.cpp (+3/-1)
scidavis/src/BoxCurve.h (+1/-1)
scidavis/src/Correlation.cpp (+3/-5)
scidavis/src/DataPickerTool.cpp (+6/-4)
scidavis/src/DataPickerTool.h (+2/-0)
scidavis/src/DataPointPicker.cpp (+80/-0)
scidavis/src/DataPointPicker.h (+57/-0)
scidavis/src/Differentiation.cpp (+10/-16)
scidavis/src/Filter.cpp (+51/-65)
scidavis/src/Filter.h (+10/-4)
scidavis/src/Folder.cpp (+1/-1)
scidavis/src/Folder.h (+18/-4)
scidavis/src/FunctionCurve.cpp (+12/-3)
scidavis/src/Graph.cpp (+115/-242)
scidavis/src/Graph.h (+5/-0)
scidavis/src/IntDialog.cpp (+7/-32)
scidavis/src/IntDialog.h (+1/-3)
scidavis/src/Integration.cpp (+72/-120)
scidavis/src/Integration.h (+14/-5)
scidavis/src/Interpolation.cpp (+10/-48)
scidavis/src/Interpolation.h (+3/-1)
scidavis/src/LineDialog.cpp (+2/-2)
scidavis/src/LineProfileTool.h (+1/-0)
scidavis/src/Matrix.cpp (+8/-1)
scidavis/src/MuParserScript.cpp (+23/-9)
scidavis/src/MuParserScripting.cpp (+48/-48)
scidavis/src/MuParserScripting.h (+1/-1)
scidavis/src/MultiLayer.cpp (+1/-0)
scidavis/src/MultiLayer.h (+1/-0)
scidavis/src/MultiPeakFitTool.h (+1/-0)
scidavis/src/Plot3DDialog.cpp (+24/-19)
scidavis/src/Plot3DDialog.h (+4/-2)
scidavis/src/PlotCurve.cpp (+183/-185)
scidavis/src/PlotCurve.h (+2/-1)
scidavis/src/PlotToolInterface.h (+3/-0)
scidavis/src/PythonScript.cpp (+4/-4)
scidavis/src/QwtErrorPlotCurve.cpp (+26/-65)
scidavis/src/QwtErrorPlotCurve.h (+1/-1)
scidavis/src/QwtHistogram.cpp (+8/-6)
scidavis/src/QwtHistogram.h (+2/-2)
scidavis/src/QwtPieCurve.cpp (+3/-1)
scidavis/src/QwtPieCurve.h (+1/-1)
scidavis/src/RangeSelectorTool.h (+1/-0)
scidavis/src/ScaleDraw.cpp (+19/-5)
scidavis/src/ScaleDraw.h (+28/-3)
scidavis/src/ScreenPickerTool.h (+1/-0)
scidavis/src/ScriptEdit.cpp (+1/-1)
scidavis/src/SelectionMoveResizer.cpp (+5/-5)
scidavis/src/SortDialog.cpp (+0/-103)
scidavis/src/SortDialog.h (+0/-62)
scidavis/src/Table.cpp (+84/-31)
scidavis/src/Table.h (+1/-0)
scidavis/src/TranslateCurveTool.h (+1/-0)
scidavis/src/VectorCurve.cpp (+33/-45)
scidavis/src/VectorCurve.h (+1/-1)
scidavis/src/future/core/AbstractColumn.h (+1/-1)
scidavis/src/future/core/AbstractExportFilter.h (+0/-60)
scidavis/src/future/core/AbstractFit.cpp (+0/-79)
scidavis/src/future/core/AbstractFit.h (+0/-129)
scidavis/src/future/core/AbstractScript.cpp (+0/-42)
scidavis/src/future/core/AbstractScript.h (+0/-111)
scidavis/src/future/core/AbstractScriptingEngine.cpp (+0/-81)
scidavis/src/future/core/AbstractScriptingEngine.h (+0/-171)
scidavis/src/future/core/CopyThroughFilter.h (+0/-54)
scidavis/src/future/core/Filter.cpp (+0/-334)
scidavis/src/future/core/Filter.h (+0/-162)
scidavis/src/future/core/FilterDialog.cpp (+0/-191)
scidavis/src/future/core/FilterDialog.h (+0/-70)
scidavis/src/future/core/MyParser.cpp (+0/-192)
scidavis/src/future/core/MyParser.h (+0/-119)
scidavis/src/future/core/Project.cpp (+1/-1)
scidavis/src/future/core/ScriptEdit.cpp (+0/-370)
scidavis/src/future/core/ScriptEdit.h (+0/-89)
scidavis/src/future/core/ScriptingEngineManager.cpp (+0/-72)
scidavis/src/future/core/ScriptingEngineManager.h (+0/-54)
scidavis/src/future/core/ScriptingLangDialog.cpp (+0/-82)
scidavis/src/future/core/ScriptingLangDialog.h (+0/-57)
scidavis/src/future/core/column/Column.cpp (+2/-2)
scidavis/src/future/core/column/Column.h (+1/-1)
scidavis/src/future/core/column/ColumnPrivate.cpp (+42/-20)
scidavis/src/future/core/column/ColumnPrivate.h (+1/-1)
scidavis/src/future/core/column/columncommands.cpp (+6/-4)
scidavis/src/future/core/column/columncommands.h (+4/-1)
scidavis/src/future/core/core.pro (+0/-179)
scidavis/src/future/core/customevents.h (+0/-43)
scidavis/src/future/core/datatypes/Double2DateTimeFilter.cpp (+104/-0)
scidavis/src/future/core/datatypes/Double2DateTimeFilter.h (+23/-15)
scidavis/src/future/core/globals.h (+0/-123)
scidavis/src/future/matrix/MatrixConfigPage.ui (+0/-27)
scidavis/src/future/matrix/MatrixModule.cpp (+0/-127)
scidavis/src/future/matrix/MatrixModule.h (+0/-76)
scidavis/src/future/matrix/MatrixView.h (+1/-1)
scidavis/src/future/matrix/future_Matrix.cpp (+2/-1)
scidavis/src/future/matrix/matrix.pro (+0/-42)
scidavis/src/future/table/ExportTableDialog.cpp (+0/-186)
scidavis/src/future/table/ExportTableDialog.h (+0/-104)
scidavis/src/future/table/ImportTableDialog.cpp (+0/-273)
scidavis/src/future/table/ImportTableDialog.h (+0/-116)
scidavis/src/future/table/TableModule.cpp (+0/-141)
scidavis/src/future/table/TableModule.h (+0/-76)
scidavis/src/future/table/TableView.cpp (+97/-21)
scidavis/src/future/table/TableView.h (+1/-0)
scidavis/src/future/table/controltabs.ui (+202/-171)
scidavis/src/future/table/future_Table.cpp (+55/-68)
scidavis/src/future/table/future_Table.h (+0/-1)
scidavis/src/future/table/table.pro (+0/-55)
scidavis/src/globals.cpp (+5/-4)
scidavis/src/nrutil.cpp (+0/-50)
scidavis/src/nrutil.h (+0/-4)
scidavis/src/scidavis.sip (+315/-39)
scidavis/translations/scidavis_cs-alt.ts (+14257/-0)
scidavis/translations/scidavis_cs.ts (+20518/-0)
scidavis/translations/scidavis_de.ts (+2133/-1673)
scidavis/translations/scidavis_es.ts (+21418/-22392)
scidavis/translations/scidavis_fr.ts (+2056/-1663)
scidavis/translations/scidavis_ja.ts (+2061/-1668)
scidavis/translations/scidavis_pt-br.ts (+1548/-1118)
scidavis/translations/scidavis_ru.ts (+2055/-1662)
scidavis/translations/scidavis_sv.ts (+2056/-1663)
scidavisScriptInstall.nsi (+8/-4)
To merge this branch: bzr merge lp:~valavanisalex/ubuntu/maverick/scidavis/fix-604811
Reviewer Review Type Date Requested Status
Ubuntu Sponsors Pending
Registry Administrators Pending
Review via email: mp+29757@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory '.pc'
=== added file '.pc/.version'
--- .pc/.version 1970-01-01 00:00:00 +0000
+++ .pc/.version 2010-07-12 22:57:40 +0000
@@ -0,0 +1,1 @@
12
02
=== added file '.pc/applied-patches'
--- .pc/applied-patches 1970-01-01 00:00:00 +0000
+++ .pc/applied-patches 2010-07-12 22:57:40 +0000
@@ -0,0 +1,2 @@
1sourcefiles_pri.diff
2scidavis_pro.diff
03
=== added directory '.pc/scidavis_pro.diff'
=== added directory '.pc/scidavis_pro.diff/scidavis'
=== added file '.pc/scidavis_pro.diff/scidavis/scidavis.pro'
--- .pc/scidavis_pro.diff/scidavis/scidavis.pro 1970-01-01 00:00:00 +0000
+++ .pc/scidavis_pro.diff/scidavis/scidavis.pro 2010-07-12 22:57:40 +0000
@@ -0,0 +1,145 @@
1### General remark: lines prefixed with "unix:" are for Linux/MacOS X/*BSD only, they are ignored on Windows
2### lines prefixed with "win32:" are Windows only
3
4### a console displaying output of scripts; particularly useful on Windows
5### where running SciDAVis from a terminal is inconvenient
6DEFINES += SCRIPTING_CONSOLE
7### a dialog for selecting the scripting language on a per-project basis
8DEFINES += SCRIPTING_DIALOG
9
10CONFIG += release
11### use the next line to compile with debugging symbols instead of the line obove
12#CONFIG += debug
13
14### what to install
15INSTALLS += target # this is the program itself
16INSTALLS += documentation # README, INSTALL.html, manual (if present in the manual subfolder), etc.
17### Comment out the next line if you do not want automatic compilation and installation of the translations
18INSTALLS += translationfiles
19
20### names of the lupdate and lrelease programs (needed if you want to compile and install the translations automatically)
21### possibly needs to be adapted if you have an unusual installation
22exists(/usr/bin/lupdate-qt4) {
23 # Debian, Ubuntu, Fedora
24 LUPDATE_BIN = lupdate-qt4
25 LRELEASE_BIN = lrelease-qt4
26} else {
27 # anything else
28 LUPDATE_BIN = lupdate
29 LRELEASE_BIN = lrelease
30}
31
32### 64 Linux only suffix
33linux-g++-64: libsuff = 64
34
35### where to install
36unix: INSTALLBASE = /usr # this is what is called "prefix" when using GNU autotools
37win32: INSTALLBASE = c:/scidavis
38unix: target.path = "$$INSTALLBASE/bin" # where to install the binary on Linux/MacOS X
39win32: target.path = "$$INSTALLBASE" # where to install the exe on Windows
40unix: documentation.path = "$$INSTALLBASE/share/doc/scidavis" # where to install the documentation files on Linux/MacOS X
41win32: documentation.path = "$$INSTALLBASE" # ... on Winodws
42### Usually, the manual will be expected in the "manual" subfolder of "documentation.path" (see above).
43### You can override this, uncomment and adjust the path behind the '=' in the next line.
44# manual.path = $$INSTALLBASE/share/doc/scidavis/manual
45### Enables choosing of help folder at runtime, instead of relying on the above path only.
46### The downside is that the help folder will be remembered as a configuration option, so a binary
47### package cannot easily update the path for its users.
48### Dynamic selection of the manual path was the only available option up until SciDAVis 0.2.3.
49DEFINES += DYNAMIC_MANUAL_PATH
50### Important: translationfiles.path will be the directory where scidavis expects
51### the translation .qm files at runtime. Therefore you need to set it corretly even if
52### you do not use this project file to generate the translation files.
53unix: translationfiles.path = "$$INSTALLBASE/share/scidavis/translations"
54win32: translationfiles.path = "$$INSTALLBASE/translations"
55### Important (if you use Python): the following two paths are where the application will expect
56### scidavisrc.py and scidavisUtil.py, respectively. Alternatively you can also put scidavisrc.py
57### (or ".scidavis.py") into the users home directory. scidavisUtil.py must be either in the
58### directory specified here or somewhere else in the python path (sys.path) where "import" can find it
59unix: pythonconfig.path = /etc # where scidavisrc.py is installed
60win32: pythonconfig.path = $$INSTALLBASE
61unix: pythonutils.path = $$INSTALLBASE/share/scidavis # where the scidavisUtil python modules is installed
62win32: pythonutils.path = $$INSTALLBASE
63
64### (remark: muparser.pri and python.pri must be included after defining INSTALLBASE )
65### building without muParser does not work yet (but will in a future version)
66include( muparser.pri )
67### comment out the following line to deactivate Python scripting support
68include( python.pri )
69
70################### start of liborigin block
71############ liborigin support has been discontinued due to the lack
72############ of a developer who maintains the Origin import code;
73############ if you are interested in reviving Origin support, please contact
74############ the SciDAVis developers
75### Note to packagers: If you want to use systemwide installed liborigin
76### instead of the one provided in "3rdparty", uncomment the following 2 lines:
77# CONFIG += dynamic_liborigin
78# LIBS += -lorigin
79### Unfortunately, due to liborigin being in alpha stage, we cannot promise
80### that SciDAVis works with any other version that the one in "3rdparty".
81################### end of liborigin block
82
83#############################################################################
84### Default settings for Linux / Mac OS X
85#############################################################################
86### Link statically against Qwt and Qwtplot3D (in order to make sure they
87### are compiled against Qt4), dynamically against everything else.
88#############################################################################
89
90unix:INCLUDEPATH += ../3rdparty/qwtplot3d/include
91unix:LIBS += ../3rdparty/qwtplot3d/lib/libqwtplot3d.a
92
93unix:INCLUDEPATH += ../3rdparty/qwt/src
94unix:LIBS += ../3rdparty/qwt/lib/libqwt.a
95
96unix:LIBS += -L/usr/lib$${libsuff}
97unix:LIBS += -lgsl -lgslcblas -lz
98unix:LIBS += -lmuparser
99unix:INCLUDEPATH += /usr/include/muParser
100
101#############################################################################
102### Link everything dynamically
103#############################################################################
104
105#unix:INCLUDEPATH += /usr/include/qwt5
106#unix:LIBS += -L/usr/lib$${libsuff}
107## dynamically link against Qwt(3D) installed system-wide
108## WARNING: make sure they are compiled against >= Qt4.2
109## Mixing Qt 4.2 and Qt >= 4.3 compiled stuff may also
110## cause problems.
111#unix:INCLUDEPATH += /usr/include/qwtplot3d
112#unix:LIBS += -lqwtplot3d
113#unix:LIBS += -lqwt
114##dynamically link against GSL and zlib installed system-wide
115#unix:LIBS += -lgsl -lgslcblas -lz -lmuparser
116
117#############################################################################
118### Default settings for Windows
119#############################################################################
120### Static linking mostly, except Qt, Python and QwtPlot3D.
121### The latter seems to be impossible to link statically on Windows.
122#############################################################################
123
124win32:INCLUDEPATH += c:/qwtplot3d/include
125win32:INCLUDEPATH += c:/qwt-5.0.2/include
126win32:INCLUDEPATH += c:/gsl/include
127win32:INCLUDEPATH += c:/zlib/include
128win32:INCLUDEPATH += c:/muparser/include
129
130win32:LIBS += c:/qwtplot3d/lib/qwtplot3d.dll
131win32:LIBS += c:/qwt-5.0.2/lib/libqwt.a
132win32:LIBS += c:/gsl/lib/libgsl.a
133win32:LIBS += c:/gsl/lib/libgslcblas.a
134win32:LIBS += c:/zlib/lib/libz.a
135win32:LIBS += c:/muparser/lib/libmuparser.a
136
137#############################################################################
138### END OF USER-SERVICEABLE PART ###
139#############################################################################
140
141include( basic.pri )
142include( sourcefiles.pri )
143
144#############################################################################
145#############################################################################
0146
=== added directory '.pc/sourcefiles_pri.diff'
=== added directory '.pc/sourcefiles_pri.diff/scidavis'
=== added file '.pc/sourcefiles_pri.diff/scidavis/sourcefiles.pri'
--- .pc/sourcefiles_pri.diff/scidavis/sourcefiles.pri 1970-01-01 00:00:00 +0000
+++ .pc/sourcefiles_pri.diff/scidavis/sourcefiles.pri 2010-07-12 22:57:40 +0000
@@ -0,0 +1,425 @@
1#############################################################################
2###################### PROJECT FILES SECTION ################################
3#############################################################################
4
5###################### ICONS ################################################
6RESOURCES += appicons.qrc
7RESOURCES += icons.qrc
8RC_FILE = scidavis.rc
9
10###################### TRANSLATIONS #########################################
11
12TRANSLATIONS = translations/scidavis_de.ts \
13 translations/scidavis_es.ts \
14 translations/scidavis_fr.ts \
15 translations/scidavis_ru.ts \
16 translations/scidavis_ja.ts \
17 translations/scidavis_sv.ts \
18 translations/scidavis_pt-br.ts \
19 translations/scidavis_cs.ts \
20 translations/scidavis_cs-alt.ts \
21
22contains( INSTALLS, translationfiles ){
23 exists(translations/scidavis_de.ts){
24 translationfiles.files = translations/scidavis_de.qm \
25 translations/scidavis_es.qm \
26 translations/scidavis_fr.qm \
27 translations/scidavis_ru.qm \
28 translations/scidavis_ja.qm \
29 translations/scidavis_sv.qm \
30 translations/scidavis_pt-br.qm \
31 translations/scidavis_cs.qm \
32 translations/scidavis_cs-alt.qm \
33
34 unix: tstarget.target = translations/scidavis_de.qm
35 win32: tstarget.target = translations\scidavis_de.qm
36 tstarget.commands = $$LUPDATE_BIN scidavis.pro && $$LRELEASE_BIN scidavis.pro
37
38 QMAKE_EXTRA_TARGETS += tstarget
39 PRE_TARGETDEPS += translations/scidavis_de.qm
40 }
41 !exists(translations/scidavis_de.ts){
42 message("=======================================")
43 message("Could not find translation (.ts) files.")
44 message("=======================================")
45 }
46}
47
48###################### DOCUMENTATION ########################################
49
50documentation.files += ../manual/html \
51 ../INSTALL.html \
52 ../scidavis.css \
53 ../scidavis-logo.png \
54 ../README \
55 ../CHANGES \
56 ../gpl.txt
57
58###################### DESKTOP INTEGRATION ##################################
59
60unix {
61 desktop_entry.files = scidavis.desktop
62 desktop_entry.path = "$$INSTALLBASE/share/applications"
63 INSTALLS += desktop_entry
64
65 mime_package.files = scidavis.xml
66 mime_package.path = "$$INSTALLBASE/share/mime/packages"
67 INSTALLS += mime_package
68
69 #deprecated
70 mime_entry.files = x-sciprj.desktop
71 mime_entry.path = "$$INSTALLBASE/share/mimelnk/application"
72 INSTALLS += mime_entry
73
74 icon_hicolor_scalable.files = icons/scidavis.svg
75 icon_hicolor_scalable.path = "$$INSTALLBASE/share/icons/hicolor/scalable/apps"
76 INSTALLS += icon_hicolor_scalable
77
78 resolutions = 16 22 32 48 64 128
79 for(res, resolutions) {
80 eval(icon_hicolor_$${res}.files = icons/hicolor-$${res}/scidavis.png)
81 eval(icon_hicolor_$${res}.path = "$$INSTALLBASE/share/icons/hicolor/$${res}x$${res}/apps")
82 INSTALLS += icon_hicolor_$${res}
83 }
84
85 resolutions = 16 22 32
86 for(res, resolutions) {
87 eval(icon_locolor_$${res}.files = icons/locolor-$${res}/scidavis.png)
88 eval(icon_locolor_$${res}.path = "$$INSTALLBASE/share/icons/locolor/$${res}x$${res}/apps")
89
90 INSTALLS += icon_locolor_$${res}
91 }
92}
93
94###################### HEADERS ##############################################
95
96HEADERS += src/ApplicationWindow.h \
97 src/globals.h\
98 src/Graph.h \
99 src/Graph3D.h \
100 src/Table.h \
101 src/CurvesDialog.h \
102 src/PlotDialog.h \
103 src/Plot3DDialog.h \
104 src/PlotWizard.h \
105 src/ExportDialog.h \
106 src/AxesDialog.h \
107 src/PolynomFitDialog.h \
108 src/ExpDecayDialog.h \
109 src/FunctionDialog.h \
110 src/FitDialog.h \
111 src/SurfaceDialog.h \
112 src/TextDialog.h \
113 src/LineDialog.h \
114 src/ScalePicker.h \
115 src/TitlePicker.h \
116 src/CanvasPicker.h \
117 src/PlotCurve.h \
118 src/QwtErrorPlotCurve.h \
119 src/QwtPieCurve.h \
120 src/ErrDialog.h \
121 src/Legend.h \
122 src/ArrowMarker.h \
123 src/ImageMarker.h \
124 src/ImageDialog.h \
125 src/fit_gsl.h \
126 src/nrutil.h\
127 src/MultiLayer.h\
128 src/LayerDialog.h \
129 src/IntDialog.h \
130 src/Bar.h \
131 src/Cone3D.h \
132 src/ConfigDialog.h \
133 src/QwtBarCurve.h \
134 src/BoxCurve.h \
135 src/QwtHistogram.h \
136 src/VectorCurve.h \
137 src/ScaleDraw.h \
138 src/Matrix.h \
139 src/DataSetDialog.h \
140 src/MyParser.h \
141 src/ColorBox.h \
142 src/SymbolBox.h \
143 src/PatternBox.h \
144# src/importOPJ.h\
145 src/SymbolDialog.h \
146 src/Plot.h \
147 src/ColorButton.h \
148 src/AssociationsDialog.h \
149 src/RenameWindowDialog.h \
150 src/MyWidget.h \
151 src/InterpolationDialog.h\
152 src/ImportASCIIDialog.h \
153 src/ImageExportDialog.h\
154 src/SmoothCurveDialog.h\
155 src/FilterDialog.h\
156 src/FFTDialog.h\
157 src/Note.h\
158 src/Folder.h\
159 src/FindDialog.h\
160 src/ScriptingEnv.h\
161 src/Script.h\
162 src/ScriptEdit.h\
163 src/FunctionCurve.h\
164 src/Fit.h\
165 src/MultiPeakFit.h\
166 src/ExponentialFit.h\
167 src/PolynomialFit.h\
168 src/NonLinearFit.h\
169 src/PluginFit.h\
170 src/SigmoidalFit.h\
171 src/customevents.h\
172 src/ScriptingLangDialog.h\
173 src/TextFormatButtons.h\
174 src/TableStatistics.h\
175 src/Spectrogram.h\
176 src/ColorMapEditor.h\
177 src/SelectionMoveResizer.h\
178 src/Filter.h\
179 src/Differentiation.h\
180 src/Integration.h\
181 src/Interpolation.h\
182 src/SmoothFilter.h\
183 src/FFTFilter.h\
184 src/FFT.h\
185 src/Convolution.h\
186 src/Correlation.h\
187 src/PlotToolInterface.h\
188 src/ScreenPickerTool.h\
189 src/DataPickerTool.h\
190 src/RangeSelectorTool.h\
191 src/TranslateCurveTool.h\
192 src/MultiPeakFitTool.h\
193 src/CurveRangeDialog.h\
194 src/LineProfileTool.h\
195 src/PlotEnrichement.h\
196 src/ExtensibleFileDialog.h\
197 src/OpenProjectDialog.h\
198 src/Grid.h\
199 src/DataPointPicker.h \
200
201###################### SOURCES ##############################################
202
203SOURCES += src/ApplicationWindow.cpp \
204 src/Graph.cpp \
205 src/Graph3D.cpp \
206 src/Table.cpp \
207 src/CurvesDialog.cpp \
208 src/PlotDialog.cpp \
209 src/Plot3DDialog.cpp \
210 src/PlotWizard.cpp \
211 src/ExportDialog.cpp \
212 src/AxesDialog.cpp \
213 src/PolynomFitDialog.cpp \
214 src/TextDialog.cpp \
215 src/ScalePicker.cpp\
216 src/TitlePicker.cpp \
217 src/CanvasPicker.cpp \
218 src/ExpDecayDialog.cpp \
219 src/FunctionDialog.cpp \
220 src/FitDialog.cpp \
221 src/SurfaceDialog.cpp \
222 src/LineDialog.cpp \
223 src/PlotCurve.cpp \
224 src/QwtErrorPlotCurve.cpp \
225 src/QwtPieCurve.cpp \
226 src/ErrDialog.cpp \
227 src/Legend.cpp \
228 src/ArrowMarker.cpp \
229 src/ImageMarker.cpp \
230 src/ImageDialog.cpp \
231 src/MultiLayer.cpp\
232 src/LayerDialog.cpp \
233 src/IntDialog.cpp \
234 src/Bar.cpp \
235 src/Cone3D.cpp \
236 src/DataSetDialog.cpp \
237 src/ConfigDialog.cpp \
238 src/QwtBarCurve.cpp \
239 src/BoxCurve.cpp \
240 src/QwtHistogram.cpp \
241 src/VectorCurve.cpp \
242 src/Matrix.cpp \
243 src/MyParser.cpp\
244 src/ColorBox.cpp \
245 src/SymbolBox.cpp \
246 src/PatternBox.cpp \
247# src/importOPJ.cpp\
248 src/main.cpp \
249 src/SymbolDialog.cpp \
250 src/Plot.cpp \
251 src/ColorButton.cpp \
252 src/AssociationsDialog.cpp \
253 src/RenameWindowDialog.cpp \
254 src/MyWidget.cpp\
255 src/InterpolationDialog.cpp\
256 src/nrutil.cpp\
257 src/fit_gsl.cpp\
258 src/SmoothCurveDialog.cpp\
259 src/FilterDialog.cpp\
260 src/FFTDialog.cpp\
261 src/Note.cpp\
262 src/Folder.cpp\
263 src/FindDialog.cpp\
264 src/TextFormatButtons.cpp\
265 src/ScriptEdit.cpp\
266 src/ImportASCIIDialog.cpp\
267 src/ImageExportDialog.cpp\
268 src/ScaleDraw.cpp\
269 src/FunctionCurve.cpp\
270 src/Fit.cpp\
271 src/MultiPeakFit.cpp\
272 src/ExponentialFit.cpp\
273 src/PolynomialFit.cpp\
274 src/PluginFit.cpp\
275 src/NonLinearFit.cpp\
276 src/SigmoidalFit.cpp\
277 src/ScriptingEnv.cpp\
278 src/Script.cpp\
279 src/ScriptingLangDialog.cpp\
280 src/TableStatistics.cpp\
281 src/Spectrogram.cpp\
282 src/ColorMapEditor.cpp\
283 src/SelectionMoveResizer.cpp\
284 src/Filter.cpp\
285 src/Differentiation.cpp\
286 src/Integration.cpp\
287 src/Interpolation.cpp\
288 src/SmoothFilter.cpp\
289 src/FFTFilter.cpp\
290 src/FFT.cpp\
291 src/Convolution.cpp\
292 src/Correlation.cpp\
293 src/ScreenPickerTool.cpp\
294 src/DataPickerTool.cpp\
295 src/RangeSelectorTool.cpp\
296 src/TranslateCurveTool.cpp\
297 src/MultiPeakFitTool.cpp\
298 src/CurveRangeDialog.cpp\
299 src/LineProfileTool.cpp\
300 src/PlotEnrichement.cpp\
301 src/ExtensibleFileDialog.cpp\
302 src/OpenProjectDialog.cpp\
303 src/Grid.cpp\
304 src/globals.cpp \
305 src/DataPointPicker.cpp \
306
307###################### FORMS ##############################################
308FORMS += src/SciDAVisAbout.ui
309
310########### Future code backported from the aspect framework ##################
311DEFINES += LEGACY_CODE_0_2_x
312INCLUDEPATH += src
313INCLUDEPATH += src/future
314
315FORMS += src/future/matrix/matrixcontroltabs.ui \
316 src/future/core/ProjectConfigPage.ui \
317 src/future/table/controltabs.ui \
318 src/future/table/DimensionsDialog.ui
319
320HEADERS += src/future/core/AbstractAspect.h \
321 src/future/core/AbstractPart.h \
322 src/future/core/AspectPrivate.h \
323 src/future/core/aspectcommands.h \
324 src/future/core/future_Folder.h \
325 src/future/core/Project.h \
326 src/future/core/ProjectConfigPage.h \
327 src/future/core/PartMdiView.h \
328 src/future/core/AbstractColumn.h \
329 src/future/core/column/Column.h \
330 src/future/core/column/ColumnPrivate.h \
331 src/future/core/column/columncommands.h \
332 src/future/core/AbstractFilter.h \
333 src/future/core/AbstractSimpleFilter.h \
334 src/future/core/datatypes/SimpleCopyThroughFilter.h \
335 src/future/core/datatypes/DateTime2DoubleFilter.h \
336 src/future/core/datatypes/DateTime2StringFilter.h \
337 src/future/core/datatypes/DayOfWeek2DoubleFilter.h \
338 src/future/core/datatypes/Double2DateTimeFilter.h \
339 src/future/core/datatypes/Double2DayOfWeekFilter.h \
340 src/future/core/datatypes/Double2MonthFilter.h \
341 src/future/core/datatypes/Double2StringFilter.h \
342 src/future/core/datatypes/Month2DoubleFilter.h \
343 src/future/core/datatypes/String2DateTimeFilter.h \
344 src/future/core/datatypes/String2DayOfWeekFilter.h \
345 src/future/core/datatypes/String2DoubleFilter.h \
346 src/future/core/datatypes/String2MonthFilter.h \
347 src/future/lib/macros.h \
348 src/future/lib/XmlStreamReader.h \
349 src/future/lib/ActionManager.h \
350 src/future/lib/ConfigPageWidget.h \
351 src/future/lib/Interval.h \
352 src/future/lib/IntervalAttribute.h \
353 src/future/matrix/future_Matrix.h \
354 src/future/matrix/MatrixModel.h \
355 src/future/matrix/MatrixView.h \
356 src/future/matrix/matrixcommands.h \
357 src/future/table/future_Table.h \
358 src/future/table/TableModel.h \
359 src/future/table/TableView.h \
360 src/future/table/tablecommands.h \
361 src/future/table/TableDoubleHeaderView.h \
362 src/future/table/TableItemDelegate.h \
363 src/future/table/TableCommentsHeaderModel.h \
364 src/future/table/future_SortDialog.h \
365 src/future/table/AsciiTableImportFilter.h \
366 src/future/core/AbstractImportFilter.h \
367 src/future/core/interfaces.h \
368
369SOURCES += src/future/core/AbstractAspect.cpp \
370 src/future/core/AbstractPart.cpp \
371 src/future/core/AspectPrivate.cpp \
372 src/future/core/future_Folder.cpp \
373 src/future/core/PartMdiView.cpp \
374 src/future/core/Project.cpp \
375 src/future/core/column/Column.cpp \
376 src/future/core/column/ColumnPrivate.cpp \
377 src/future/core/column/columncommands.cpp \
378 src/future/core/datatypes/DateTime2StringFilter.cpp \
379 src/future/core/datatypes/String2DateTimeFilter.cpp \
380 src/future/core/datatypes/Double2StringFilter.cpp \
381 src/future/core/datatypes/Double2DateTimeFilter.cpp \
382 src/future/core/AbstractSimpleFilter.cpp \
383 src/future/core/AbstractFilter.cpp \
384 src/future/core/ProjectConfigPage.cpp \
385 src/future/lib/XmlStreamReader.cpp \
386 src/future/lib/ActionManager.cpp \
387 src/future/lib/ConfigPageWidget.cpp \
388 src/future/matrix/future_Matrix.cpp \
389 src/future/matrix/MatrixModel.cpp \
390 src/future/matrix/MatrixView.cpp \
391 src/future/matrix/matrixcommands.cpp \
392 src/future/table/future_Table.cpp \
393 src/future/table/TableModel.cpp \
394 src/future/table/TableView.cpp \
395 src/future/table/tablecommands.cpp \
396 src/future/table/TableDoubleHeaderView.cpp \
397 src/future/table/TableItemDelegate.cpp \
398 src/future/table/TableCommentsHeaderModel.cpp \
399 src/future/table/future_SortDialog.cpp \
400 src/future/table/AsciiTableImportFilter.cpp \
401
402###############################################################
403##################### Compression #############################
404############### (mini gzip implementation) ####################
405################# requires zlib >= 1.2.3 ######################
406###############################################################
407
408SOURCES += ../3rdparty/minigzip/minigzip.c
409
410###############################################################
411################# Origin Import (liborigin) ###################
412###############################################################
413
414############ liborigin support has been discontinued due to the lack
415############ of a developer who maintains the Origin import code;
416############ if you are interested in reviving Origin support, please contact
417############ the SciDAVis developers
418
419#!dynamic_liborigin{
420#INCLUDEPATH += ../3rdparty/liborigin
421#
422#HEADERS += ../3rdparty/liborigin/OPJFile.h
423#SOURCES += ../3rdparty/liborigin/OPJFile.cpp
424#}
425
0426
=== modified file 'CHANGES'
--- CHANGES 2009-09-06 11:34:04 +0000
+++ CHANGES 2010-07-12 22:57:40 +0000
@@ -180,3 +180,52 @@
180 Note.exportASCII(filename)180 Note.exportASCII(filename)
181 Note.importASCII(filename)181 Note.importASCII(filename)
182182
183=== Release 0.2.4, 2010-03-12 ===
184Most important changes (since 0.2.3)
185- Some parts of the Python API have been marked as deprecated and generate warnings when used. This
186 may be a bit unusual for a bugfix release; on the other hand, they won't be removed any time soon
187 and inserting the deprecation warnings now will give everyone as much time as possible for getting
188 accustomed to the API we're moving towards.
189 Most prominently,
190 Table.cell(column,row) and
191 Table.setCell(column,row,value)
192 are deprecated in favour of
193 Table.column(column - 1).valueAt(row - 1) and
194 Table.column(column - 1).setValueAt(row - 1, value)
195 (note that the column/row INDICES DIFFER BY ONE!); the same goes for
196 Table.text(c,r) -> Table.column(c - 1).textAt(r - 1) and
197 Table.setText(c,r,text) -> Table.column(c - 1).setTextAt(r - 1,text).
198 This serves multiple purposes. It simplifies the interfaces by grouping all functionality specific
199 to a certain column in the Column class; it allows column objects to be stored and passed around;
200 and it moves from the unconventional 1-based indexing to the more conventional 0-based indexing.
201 Future additions to the API will increasingly make use of the columns-as-objects paradigm.
202- lots of bugfixes, again including crashes
203- fixed compatibility issues with Qt 4.6 and SIP 4.9
204- performance improvements
205- substantially improved support for plots involving date/time data
206- added two Czech translations: a default one by Pavel Fric (feedback requested via
207 http://fripohled.blogspot.com) and an alternative one by Jan Helebrant
208- updated Spanish translation, thanks to Mauricio Troviano; Brazilian Portuguese translation, thanks
209 to Fellyp do Nascimento; and German translation
210- fixed and extended many parts of the API for Python scripts, including the new methods
211 Layer.pickPoint()
212 MDIWindow.clone()
213 Folder.save(filename)
214 newGraph(string)
215 Layer.printDialog()
216 Graph.printDialog()
217 Layer.setRightTitle(string)
218 Layer.setTopTitle(string)
219 Layer.grid() # => returns an instance of the new class Grid
220 Layer.insertFunctionCurve(formula,from=0,to=1,points=100,title="")
221 Layer.insertPolarCurve(radial_formula,angular_formula,from=0,to=2*pi,parameter="t",points=100,title="")
222 Layer.insertParametricCurve(x_formal,y_formula,from=0,to=1,parameter="t",points=100,title="")
223 Matrix.recalculate()
224 the constants QwtPlot.yLeft, QwtPlot.yRight, QwtPlot.xBottom, QwtPlot.xTop for specifying axes
225 and the Grid class
226- multiple graphs can have active tools simultaneously
227- based on user feedback, the default behaviour when importing ASCII files has been changed to
228 interpret the data as numeric (only applies to fresh installations of SciDAVis)
229- automatic resizing of table rows for multi-line cells intentionally dropped, because this seems
230 to be rarely needed and has a huge impact on performance for large tables
231
183232
=== modified file 'Doxyfile'
--- Doxyfile 2009-09-06 11:34:04 +0000
+++ Doxyfile 2010-07-12 22:57:40 +0000
@@ -2,7 +2,7 @@
2# Project related configuration options2# Project related configuration options
3#---------------------------------------------------------------------------3#---------------------------------------------------------------------------
4PROJECT_NAME = SciDAVis4PROJECT_NAME = SciDAVis
5PROJECT_NUMBER = 0.2.35PROJECT_NUMBER = 0.2.4
6OUTPUT_DIRECTORY = API6OUTPUT_DIRECTORY = API
7CREATE_SUBDIRS = NO7CREATE_SUBDIRS = NO
8OUTPUT_LANGUAGE = English8OUTPUT_LANGUAGE = English
99
=== modified file 'README'
--- README 2009-09-06 11:34:04 +0000
+++ README 2010-07-12 22:57:40 +0000
@@ -62,8 +62,11 @@
62Rémy Claverie,62Rémy Claverie,
63f0ma,63f0ma,
64Jose Antonio Lorenzo Fernandez,64Jose Antonio Lorenzo Fernandez,
65Pavel Fric,
66Jan Helebrant,
65Daniel Klaer,67Daniel Klaer,
66Peter Landgren,68Peter Landgren,
69Fellype do Nascimento,
67Tomomasa Ohkubo,70Tomomasa Ohkubo,
68Mikhail Shevyakov,71Mikhail Shevyakov,
69Mauricio Troviano72Mauricio Troviano
7073
=== modified file 'README.installer'
--- README.installer 2009-09-06 11:34:04 +0000
+++ README.installer 2010-07-12 22:57:40 +0000
@@ -35,6 +35,25 @@
35 - from fitPlugins\* -35 - from fitPlugins\* -
36 plugins\fitRational0.dll36 plugins\fitRational0.dll
37 plugins\fitRational1.dll37 plugins\fitRational1.dll
38 - from <Python directory>\Lib\site-packages
39 sip.pyd
40 PyQt4\__init__.py
41 PyQt4\__init__.pyc
42 PyQt4\Qt.pyd
43 PyQt4\QtAssistant.pyd
44 PyQt4\QtCore.pyd
45 PyQt4\QtDesigner.pyd
46 PyQt4\QtGui.pyd
47 PyQt4\QtHelp.pyd
48 PyQt4\QtNetwork.pyd
49 PyQt4\QtOpenGL.pyd
50 PyQt4\QtScript.pyd
51 PyQt4\QtSql.pyd
52 PyQt4\QtSvg.pyd
53 PyQt4\QtTest.pyd
54 PyQt4\QtWebKit.pyd
55 PyQt4\QtXml.pyd
56 PyQt4\QtXmlPatterns.pyd
3857
394) Right click on scidavisScriptInstall.nsi and select compile.584) Right click on scidavisScriptInstall.nsi and select compile.
4059
4160
=== modified file 'debian/changelog'
--- debian/changelog 2010-03-15 13:04:45 +0000
+++ debian/changelog 2010-07-12 22:57:40 +0000
@@ -1,3 +1,24 @@
1scidavis (0.2.4-1ubuntu1~ppa4) maverick; urgency=low
2
3 * Merge from Debian unstable (LP: #604811, LP: #565206)
4 * debian/control: Fix FTBFS with Qt 4.7 (LP: #601617)
5 + add Build-Depends libqt4assistantclient-dev
6 + add Recommends: qt-assistant-compat
7
8 -- Alexander Valavanis <valavanisalex@googlemail.com> Mon, 12 Jul 2010 23:50:09 +0100
9
10scidavis (0.2.4-1) unstable; urgency=low
11
12 * New upstream version
13 + Should fix various crashes (Closes: #583226, #571462).
14 * debian/source/: migrate format to '3.0' in order to use bz2 tarballs
15 * debian/control: remove Build-Depends on quilt (not needed with 3.0)
16 * debian/control: bump Standards-Version to 3.8.4 (no changes needed)
17 * debian/control: set Priority to extra because libmuparser0 is extra
18 * debian/watch: update for bz2 tarballs
19
20 -- Ruben Molina <rmolina@udea.edu.co> Fri, 21 May 2010 11:55:33 -0500
21
1scidavis (0.2.3-1ubuntu1) lucid; urgency=low22scidavis (0.2.3-1ubuntu1) lucid; urgency=low
223
3 * New patch reorder-updatehorizontalheader.patch to fix Segmentation24 * New patch reorder-updatehorizontalheader.patch to fix Segmentation
425
=== modified file 'debian/control'
--- debian/control 2010-03-15 13:04:45 +0000
+++ debian/control 2010-07-12 22:57:40 +0000
@@ -3,17 +3,18 @@
3Priority: optional3Priority: optional
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Ruben Molina <rmolina@udea.edu.co>5XSBC-Original-Maintainer: Ruben Molina <rmolina@udea.edu.co>
6Build-Depends: cdbs, debhelper (>= 7), quilt, docbook-to-man, python,6Build-Depends: cdbs, debhelper (>= 7), docbook-to-man, python,
7 pyqt4-dev-tools, sip4,7 pyqt4-dev-tools, sip4, libqt4-dev, libqt4-opengl-dev, libqwt5-qt4-dev,
8 libqt4-dev, libqt4-opengl-dev, libqwt5-qt4-dev, libqwtplot3d-qt4-dev, 8 libqwtplot3d-qt4-dev, libmuparser-dev, libgsl0-dev, zlib1g-dev,
9 libmuparser-dev, libgsl0-dev, zlib1g-dev, libglu1-mesa-dev, python-dev,9 libglu1-mesa-dev, python-dev, python-qt4-dev, python-sip4-dev,
10 python-qt4-dev, python-sip4-dev, python-support10 python-support, libqtassistantclient-dev
11Standards-Version: 3.8.311Standards-Version: 3.8.4
12Homepage: http://scidavis.sourceforge.net/12Homepage: http://scidavis.sourceforge.net/
1313
14Package: scidavis14Package: scidavis
15Architecture: any15Architecture: any
16Depends: ${shlibs:Depends}, ${misc:Depends}16Depends: ${shlibs:Depends}, ${misc:Depends}
17Recommends: qt-assistant-compat
17Description: application for scientific data analysis and visualization18Description: application for scientific data analysis and visualization
18 SciDAVis is a free interactive application aimed at data analysis and 19 SciDAVis is a free interactive application aimed at data analysis and
19 publication-quality plotting. It combines a shallow learning curve and 20 publication-quality plotting. It combines a shallow learning curve and
2021
=== removed file 'debian/patches/makefile.patch'
--- debian/patches/makefile.patch 2009-09-06 11:34:04 +0000
+++ debian/patches/makefile.patch 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1Description: Sets 'unix:INCLUDEPATH' and 'unix:LIBS' in scidavis.pro
2 We want to link dynamically against qwt-qt4, qwtplot3d-qt4, and
3 muparser packages.
4Forwarded: not-needed
5Author: Ruben Molina <rmolina@udea.edu.co>
6--- scidavis-0.2.3.orig/scidavis/scidavis.pro
7+++ scidavis-0.2.3/0scidavis/scidavis.pro
8@@ -82,18 +82,11 @@
9 ### are compiled against Qt4), dynamically against everything else.
10 #############################################################################
11
12-unix:INCLUDEPATH += ../3rdparty/qwtplot3d/include
13-unix:LIBS += ../3rdparty/qwtplot3d/lib/libqwtplot3d.a
14
15-unix:INCLUDEPATH += ../3rdparty/qwt/src
16-unix:LIBS += ../3rdparty/qwt/lib/libqwt.a
17
18 unix:LIBS += -L/usr/lib$${libsuff}
19 unix:LIBS += -lgsl -lgslcblas -lz
20 ### muparser 1.30 does not compile as a shared lib on Linux
21-unix:LIBS += -L/usr/local/lib$${libsuff}
22-unix:LIBS += /usr/local/lib/libmuparser.a
23-unix:INCLUDEPATH += /usr/local/include
24
25 #############################################################################
26 ### Link everything dynamically
27@@ -105,9 +98,12 @@
28 ## WARNING: make sure they are compiled against >= Qt4.2
29 ## Mixing Qt 4.2 and Qt >= 4.3 compiled stuff may also
30 ## cause problems.
31-#unix:INCLUDEPATH += /usr/include/qwtplot3d
32-#unix:LIBS += -lqwtplot3d
33-#unix:LIBS += -lqwt
34+unix:INCLUDEPATH += /usr/include/qwtplot3d-qt4
35+unix:LIBS += -lqwtplot3d-qt4
36+unix:INCLUDEPATH += /usr/include/qwt-qt4
37+unix:LIBS += -lqwt-qt4
38+unix:INCLUDEPATH += /usr/include/muParser
39+unix:LIBS += -lmuparser
40 ##dynamically link against GSL and zlib installed system-wide
41 #unix:LIBS += -lgsl -lgslcblas -lz -lmuparser
42
430
=== removed file 'debian/patches/package-contains-upstream-install-documentation.patch'
--- debian/patches/package-contains-upstream-install-documentation.patch 2009-09-06 11:34:04 +0000
+++ debian/patches/package-contains-upstream-install-documentation.patch 1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
1Description: Remove INSTALL.html from 'documentation.files'
2 Solves a 'package-contains-upstream-install-documentation' lintian warning
3Forwarded: not-needed
4Author: Ruben Molina <rmolina@udea.edu.co>
5--- scidavis-0.2.3.orig/scidavis/sourcefiles.pri
6+++ scidavis-0.2.3/scidavis/sourcefiles.pri
7@@ -44,7 +44,7 @@
8 ###################### DOCUMENTATION ########################################
9
10 documentation.files += ../manual/html \
11- ../INSTALL.html \
12+# ../INSTALL.html \
13 ../scidavis.css \
14 ../scidavis-logo.png \
15 ../README \
160
=== removed file 'debian/patches/reorder-updatehorizontalheader.patch'
--- debian/patches/reorder-updatehorizontalheader.patch 2010-03-15 13:04:45 +0000
+++ debian/patches/reorder-updatehorizontalheader.patch 1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
1Description: Reorder updateHorizontalHeador for FTBS fix
2Author: knut_f
3Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=2965581&group_id=199120&atid=968214
4
5--- a/scidavis/src/future/table/future_Table.cpp
6+++ b/scidavis/src/future/table/future_Table.cpp
7@@ -2309,8 +2309,8 @@
8 d_column_widths.insert(before, Table::defaultColumnWidth());
9 }
10 d_column_count += count;
11- updateHorizontalHeader(before, before+count-1);
12 emit d_owner->columnsInserted(before, cols.count());
13+ updateHorizontalHeader(before, before+count-1);
14 }
15
16 void Table::Private::removeColumns(int first, int count)
170
=== added file 'debian/patches/scidavis_pro.diff'
--- debian/patches/scidavis_pro.diff 1970-01-01 00:00:00 +0000
+++ debian/patches/scidavis_pro.diff 2010-07-12 22:57:40 +0000
@@ -0,0 +1,40 @@
1Description: Link everything dynamically
2 Define unix:INCLUDEPATH for muparser, qwtplot3d-qt4, and qwt-qt4
3Author: Ruben Molina <rmolina@udea.edu.co>
4Forwarded: not-needed
5Last-Update: 2010-05-21
6Index: scidavis-0.2.4/scidavis/scidavis.pro
7--- scidavis-0.2.4.orig/scidavis/scidavis.pro 2010-05-21 11:09:17.112674761 -0500
8+++ scidavis-0.2.4/scidavis/scidavis.pro 2010-05-21 11:16:28.160673262 -0500
9@@ -87,11 +87,7 @@
10 ### are compiled against Qt4), dynamically against everything else.
11 #############################################################################
12
13-unix:INCLUDEPATH += ../3rdparty/qwtplot3d/include
14-unix:LIBS += ../3rdparty/qwtplot3d/lib/libqwtplot3d.a
15
16-unix:INCLUDEPATH += ../3rdparty/qwt/src
17-unix:LIBS += ../3rdparty/qwt/lib/libqwt.a
18
19 unix:LIBS += -L/usr/lib$${libsuff}
20 unix:LIBS += -lgsl -lgslcblas -lz
21@@ -102,15 +98,15 @@
22 ### Link everything dynamically
23 #############################################################################
24
25-#unix:INCLUDEPATH += /usr/include/qwt5
26+unix:INCLUDEPATH += /usr/include/qwt-qt4
27 #unix:LIBS += -L/usr/lib$${libsuff}
28 ## dynamically link against Qwt(3D) installed system-wide
29 ## WARNING: make sure they are compiled against >= Qt4.2
30 ## Mixing Qt 4.2 and Qt >= 4.3 compiled stuff may also
31 ## cause problems.
32-#unix:INCLUDEPATH += /usr/include/qwtplot3d
33-#unix:LIBS += -lqwtplot3d
34-#unix:LIBS += -lqwt
35+unix:INCLUDEPATH += /usr/include/qwtplot3d-qt4
36+unix:LIBS += -lqwtplot3d-qt4
37+unix:LIBS += -lqwt-qt4
38 ##dynamically link against GSL and zlib installed system-wide
39 #unix:LIBS += -lgsl -lgslcblas -lz -lmuparser
40
041
=== modified file 'debian/patches/series'
--- debian/patches/series 2010-03-15 13:04:45 +0000
+++ debian/patches/series 2010-07-12 22:57:40 +0000
@@ -1,4 +1,2 @@
1reorder-updatehorizontalheader.patch1sourcefiles_pri.diff
2makefile.patch2scidavis_pro.diff
3package-contains-upstream-install-documentation.patch
4sip49.patch
53
=== removed file 'debian/patches/sip49.patch'
--- debian/patches/sip49.patch 2009-09-06 11:34:04 +0000
+++ debian/patches/sip49.patch 1970-01-01 00:00:00 +0000
@@ -1,29 +0,0 @@
1Description: Remove INSTALL.html from 'documentation.files'
2 Solves a 'package-contains-upstream-install-documentation' lintian warning
3Origin: arch, http://aur.archlinux.org/packages/scidavis/scidavis/sip-4.9.patch
4--- scidavis-0.2.3.orig/scidavis/python.pri
5+++ scidavis-0.2.3/scidavis/python.pri
6@@ -53,7 +53,6 @@
7 $${SIP_DIR}/sipscidavisPythonScript.cpp\
8 $${SIP_DIR}/sipscidavisPythonScripting.cpp\
9 $${SIP_DIR}/sipscidavisFolder.cpp\
10- $${SIP_DIR}/sipscidavisQList.cpp\
11 $${SIP_DIR}/sipscidavisFit.cpp \
12 $${SIP_DIR}/sipscidavisExponentialFit.cpp \
13 $${SIP_DIR}/sipscidavisTwoExpFit.cpp \
14@@ -82,4 +81,15 @@
15 $${SIP_DIR}/sipscidavisQwtSymbol.cpp \
16 $${SIP_DIR}/sipscidavisQwtPlotCurve.cpp \
17
18+exists($${SIP_DIR}/sipscidavisQList.cpp) {
19+# SIP < 4.9
20+ SOURCES += $${SIP_DIR}/sipscidavisQList.cpp
21+} else {
22+ SOURCES += \
23+ $${SIP_DIR}/sipscidavisQList0100QDateTime.cpp\
24+ $${SIP_DIR}/sipscidavisQList0101Folder.cpp\
25+ $${SIP_DIR}/sipscidavisQList0101MyWidget.cpp\
26+ $${SIP_DIR}/sipscidavisQList0101AbstractAspect.cpp\
27+}
28+
29 ###############################################################
300
=== added file 'debian/patches/sourcefiles_pri.diff'
--- debian/patches/sourcefiles_pri.diff 1970-01-01 00:00:00 +0000
+++ debian/patches/sourcefiles_pri.diff 2010-07-12 22:57:40 +0000
@@ -0,0 +1,17 @@
1Description: package-contains-upstream-install-documentation
2 Remove INSTALL.html from the list of installable documents
3Author: Ruben Molina <rmolina@udea.edu.co>
4Forwarded: not-needed
5Last-Update: 2010-05-21
6Index: scidavis-0.2.4/scidavis/sourcefiles.pri
7===================================================================
8--- scidavis-0.2.4.orig/scidavis/sourcefiles.pri 2010-05-21 10:54:38.012672730 -0500
9+++ scidavis-0.2.4/scidavis/sourcefiles.pri 2010-05-21 10:54:56.828672914 -0500
10@@ -48,7 +48,6 @@
11 ###################### DOCUMENTATION ########################################
12
13 documentation.files += ../manual/html \
14- ../INSTALL.html \
15 ../scidavis.css \
16 ../scidavis-logo.png \
17 ../README \
018
=== modified file 'debian/rules'
--- debian/rules 2009-09-06 11:34:04 +0000
+++ debian/rules 2010-07-12 22:57:40 +0000
@@ -2,7 +2,6 @@
22
3include /usr/share/cdbs/1/rules/debhelper.mk3include /usr/share/cdbs/1/rules/debhelper.mk
4include /usr/share/cdbs/1/class/qmake.mk4include /usr/share/cdbs/1/class/qmake.mk
5include /usr/share/cdbs/1/rules/patchsys-quilt.mk
65
7QMAKE = qmake-qt46QMAKE = qmake-qt4
87
98
=== added directory 'debian/source'
=== added file 'debian/source/format'
--- debian/source/format 1970-01-01 00:00:00 +0000
+++ debian/source/format 2010-07-12 22:57:40 +0000
@@ -0,0 +1,1 @@
13.0 (quilt)
02
=== added file 'debian/source/options'
--- debian/source/options 1970-01-01 00:00:00 +0000
+++ debian/source/options 2010-07-12 22:57:40 +0000
@@ -0,0 +1,2 @@
1compression = "bzip2"
2compression-level = 9
03
=== added file 'debian/stamp-patched'
=== modified file 'debian/watch'
--- debian/watch 2009-09-06 11:34:04 +0000
+++ debian/watch 2010-07-12 22:57:40 +0000
@@ -1,2 +1,3 @@
1version=31version=3
2http://sf.net/scidavis/scidavis-(.*)\.tar\.gz2http://sf.net/scidavis/scidavis-(\d+\.\d+\.\d+)\.tar\.bz2
3
34
=== modified file 'scidavis/icons/scidavis-splash.png'
4Binary files scidavis/icons/scidavis-splash.png 2009-09-06 11:34:04 +0000 and scidavis/icons/scidavis-splash.png 2010-07-12 22:57:40 +0000 differ5Binary files scidavis/icons/scidavis-splash.png 2009-09-06 11:34:04 +0000 and scidavis/icons/scidavis-splash.png 2010-07-12 22:57:40 +0000 differ
=== modified file 'scidavis/icons/scidavis-splash.xcf'
5Binary files scidavis/icons/scidavis-splash.xcf 2009-09-06 11:34:04 +0000 and scidavis/icons/scidavis-splash.xcf 2010-07-12 22:57:40 +0000 differ6Binary files scidavis/icons/scidavis-splash.xcf 2009-09-06 11:34:04 +0000 and scidavis/icons/scidavis-splash.xcf 2010-07-12 22:57:40 +0000 differ
=== modified file 'scidavis/python-sipcmd.py'
--- scidavis/python-sipcmd.py 2009-09-06 11:34:04 +0000
+++ scidavis/python-sipcmd.py 2010-07-12 22:57:40 +0000
@@ -1,4 +1,8 @@
1#!/usr/bin/python1#!/usr/bin/python
2from PyQt4 import pyqtconfig2from PyQt4 import pyqtconfig
3config = pyqtconfig.Configuration()3config = pyqtconfig.Configuration()
4print " ".join([config.sip_bin, "-I", config.pyqt_sip_dir, config.pyqt_sip_flags])4flags = []
5if config.sip_version >= 0x040a00:
6 # make use of docstring generation feature in SIP >= 4.10
7 flags.append("-o")
8print " ".join([config.sip_bin, "-I", config.pyqt_sip_dir, config.pyqt_sip_flags] + flags)
59
=== modified file 'scidavis/python.pri'
--- scidavis/python.pri 2009-09-06 11:34:04 +0000
+++ scidavis/python.pri 2010-07-12 22:57:40 +0000
@@ -53,7 +53,6 @@
53 $${SIP_DIR}/sipscidavisPythonScript.cpp\53 $${SIP_DIR}/sipscidavisPythonScript.cpp\
54 $${SIP_DIR}/sipscidavisPythonScripting.cpp\54 $${SIP_DIR}/sipscidavisPythonScripting.cpp\
55 $${SIP_DIR}/sipscidavisFolder.cpp\55 $${SIP_DIR}/sipscidavisFolder.cpp\
56 $${SIP_DIR}/sipscidavisQList.cpp\
57 $${SIP_DIR}/sipscidavisFit.cpp \56 $${SIP_DIR}/sipscidavisFit.cpp \
58 $${SIP_DIR}/sipscidavisExponentialFit.cpp \57 $${SIP_DIR}/sipscidavisExponentialFit.cpp \
59 $${SIP_DIR}/sipscidavisTwoExpFit.cpp \58 $${SIP_DIR}/sipscidavisTwoExpFit.cpp \
@@ -81,5 +80,18 @@
81 $${SIP_DIR}/sipscidavisColumn.cpp \80 $${SIP_DIR}/sipscidavisColumn.cpp \
82 $${SIP_DIR}/sipscidavisQwtSymbol.cpp \81 $${SIP_DIR}/sipscidavisQwtSymbol.cpp \
83 $${SIP_DIR}/sipscidavisQwtPlotCurve.cpp \82 $${SIP_DIR}/sipscidavisQwtPlotCurve.cpp \
83 $${SIP_DIR}/sipscidavisQwtPlot.cpp \
84 $${SIP_DIR}/sipscidavisGrid.cpp \
85
86exists($${SIP_DIR}/sipscidavisQList.cpp) {
87# SIP < 4.9
88 SOURCES += $${SIP_DIR}/sipscidavisQList.cpp
89} else {
90 SOURCES += \
91 $${SIP_DIR}/sipscidavisQList0100QDateTime.cpp\
92 $${SIP_DIR}/sipscidavisQList0101Folder.cpp\
93 $${SIP_DIR}/sipscidavisQList0101MyWidget.cpp\
94 $${SIP_DIR}/sipscidavisQList0101QwtPlotCurve.cpp\
95}
8496
85###############################################################97###############################################################
8698
=== modified file 'scidavis/scidavis.pro'
--- scidavis/scidavis.pro 2009-09-06 11:34:04 +0000
+++ scidavis/scidavis.pro 2010-07-12 22:57:40 +0000
@@ -18,7 +18,7 @@
18INSTALLS += translationfiles18INSTALLS += translationfiles
1919
20### names of the lupdate and lrelease programs (needed if you want to compile and install the translations automatically)20### names of the lupdate and lrelease programs (needed if you want to compile and install the translations automatically)
21### possibly needs to be adapted if you have an usual installation21### possibly needs to be adapted if you have an unusual installation
22exists(/usr/bin/lupdate-qt4) {22exists(/usr/bin/lupdate-qt4) {
23 # Debian, Ubuntu, Fedora23 # Debian, Ubuntu, Fedora
24 LUPDATE_BIN = lupdate-qt424 LUPDATE_BIN = lupdate-qt4
@@ -42,6 +42,11 @@
42### Usually, the manual will be expected in the "manual" subfolder of "documentation.path" (see above).42### Usually, the manual will be expected in the "manual" subfolder of "documentation.path" (see above).
43### You can override this, uncomment and adjust the path behind the '=' in the next line.43### You can override this, uncomment and adjust the path behind the '=' in the next line.
44# manual.path = $$INSTALLBASE/share/doc/scidavis/manual44# manual.path = $$INSTALLBASE/share/doc/scidavis/manual
45### Enables choosing of help folder at runtime, instead of relying on the above path only.
46### The downside is that the help folder will be remembered as a configuration option, so a binary
47### package cannot easily update the path for its users.
48### Dynamic selection of the manual path was the only available option up until SciDAVis 0.2.3.
49DEFINES += DYNAMIC_MANUAL_PATH
45### Important: translationfiles.path will be the directory where scidavis expects50### Important: translationfiles.path will be the directory where scidavis expects
46### the translation .qm files at runtime. Therefore you need to set it corretly even if 51### the translation .qm files at runtime. Therefore you need to set it corretly even if
47### you do not use this project file to generate the translation files.52### you do not use this project file to generate the translation files.
@@ -82,32 +87,26 @@
82### are compiled against Qt4), dynamically against everything else.87### are compiled against Qt4), dynamically against everything else.
83#############################################################################88#############################################################################
8489
85unix:INCLUDEPATH += ../3rdparty/qwtplot3d/include
86unix:LIBS += ../3rdparty/qwtplot3d/lib/libqwtplot3d.a
8790
88unix:INCLUDEPATH += ../3rdparty/qwt/src
89unix:LIBS += ../3rdparty/qwt/lib/libqwt.a
9091
91unix:LIBS += -L/usr/lib$${libsuff}92unix:LIBS += -L/usr/lib$${libsuff}
92unix:LIBS += -lgsl -lgslcblas -lz93unix:LIBS += -lgsl -lgslcblas -lz
93### muparser 1.30 does not compile as a shared lib on Linux94unix:LIBS += -lmuparser
94unix:LIBS += -L/usr/local/lib$${libsuff}95unix:INCLUDEPATH += /usr/include/muParser
95unix:LIBS += /usr/local/lib/libmuparser.a
96unix:INCLUDEPATH += /usr/local/include
9796
98#############################################################################97#############################################################################
99### Link everything dynamically98### Link everything dynamically
100#############################################################################99#############################################################################
101100
102#unix:INCLUDEPATH += /usr/include/qwt5101unix:INCLUDEPATH += /usr/include/qwt-qt4
103#unix:LIBS += -L/usr/lib$${libsuff}102#unix:LIBS += -L/usr/lib$${libsuff}
104## dynamically link against Qwt(3D) installed system-wide103## dynamically link against Qwt(3D) installed system-wide
105## WARNING: make sure they are compiled against >= Qt4.2104## WARNING: make sure they are compiled against >= Qt4.2
106## Mixing Qt 4.2 and Qt >= 4.3 compiled stuff may also 105## Mixing Qt 4.2 and Qt >= 4.3 compiled stuff may also
107## cause problems.106## cause problems.
108#unix:INCLUDEPATH += /usr/include/qwtplot3d107unix:INCLUDEPATH += /usr/include/qwtplot3d-qt4
109#unix:LIBS += -lqwtplot3d108unix:LIBS += -lqwtplot3d-qt4
110#unix:LIBS += -lqwt109unix:LIBS += -lqwt-qt4
111##dynamically link against GSL and zlib installed system-wide110##dynamically link against GSL and zlib installed system-wide
112#unix:LIBS += -lgsl -lgslcblas -lz -lmuparser111#unix:LIBS += -lgsl -lgslcblas -lz -lmuparser
113112
114113
=== modified file 'scidavis/scidavisrc.py'
--- scidavis/scidavisrc.py 2009-09-06 11:34:04 +0000
+++ scidavis/scidavisrc.py 2010-07-12 22:57:40 +0000
@@ -245,6 +245,47 @@
245for name in appImports:245for name in appImports:
246 setattr(__main__,name,getattr(__main__.scidavis.app,name))246 setattr(__main__,name,getattr(__main__.scidavis.app,name))
247247
248# make Y columns indexable (using lookup in corresponding X column)
249def __column_getitem(self, index):
250 if self.plotDesignation() != "Y":
251 return None
252 x = self.x()
253 for row in range(self.rowCount()):
254 if x.columnMode() == "Numeric":
255 xval = x.valueAt(row)
256 elif x.columnMode() == "Text":
257 xval = x.textAt(row)
258 else:
259 xval = x.dateTimeAt(row)
260 if xval == index:
261 if self.columnMode() == "Numeric":
262 return self.valueAt(row)
263 elif self.columnMode() == "Text":
264 return self.textAt(row)
265 else:
266 return self.dateTimeAt(row)
267__main__.scidavis.Column.__getitem__ = __column_getitem
268
269def __column_setitem(self, index, value):
270 if self.plotDesignation() != "Y":
271 return None
272 x = self.x()
273 for row in range(x.rowCount()):
274 if x.columnMode() == "Numeric":
275 xval = x.valueAt(row)
276 elif x.columnMode() == "Text":
277 xval = x.textAt(row)
278 else:
279 xval = x.dateTimeAt(row)
280 if xval == index:
281 if self.columnMode() == "Numeric":
282 return self.setValueAt(row, value)
283 elif self.columnMode() == "Text":
284 return self.setTextAt(row, value)
285 else:
286 return self.setDateTimeAt(row, value)
287__main__.scidavis.Column.__setitem__ = __column_setitem
288
248# import utility module289# import utility module
249import sys290import sys
250sys.path.append(".")291sys.path.append(".")
251292
=== modified file 'scidavis/sourcefiles.pri'
--- scidavis/sourcefiles.pri 2009-09-06 11:34:04 +0000
+++ scidavis/sourcefiles.pri 2010-07-12 22:57:40 +0000
@@ -15,7 +15,9 @@
15 translations/scidavis_ru.ts \15 translations/scidavis_ru.ts \
16 translations/scidavis_ja.ts \16 translations/scidavis_ja.ts \
17 translations/scidavis_sv.ts \17 translations/scidavis_sv.ts \
18 translations/scidavis_pt-br.ts \18 translations/scidavis_pt-br.ts \
19 translations/scidavis_cs.ts \
20 translations/scidavis_cs-alt.ts \
1921
20contains( INSTALLS, translationfiles ){22contains( INSTALLS, translationfiles ){
21 exists(translations/scidavis_de.ts){23 exists(translations/scidavis_de.ts){
@@ -25,7 +27,9 @@
25 translations/scidavis_ru.qm \27 translations/scidavis_ru.qm \
26 translations/scidavis_ja.qm \28 translations/scidavis_ja.qm \
27 translations/scidavis_sv.qm \29 translations/scidavis_sv.qm \
28 translations/scidavis_pt-br.qm \30 translations/scidavis_pt-br.qm \
31 translations/scidavis_cs.qm \
32 translations/scidavis_cs-alt.qm \
2933
30 unix: tstarget.target = translations/scidavis_de.qm34 unix: tstarget.target = translations/scidavis_de.qm
31 win32: tstarget.target = translations\scidavis_de.qm35 win32: tstarget.target = translations\scidavis_de.qm
@@ -44,7 +48,6 @@
44###################### DOCUMENTATION ########################################48###################### DOCUMENTATION ########################################
4549
46documentation.files += ../manual/html \50documentation.files += ../manual/html \
47 ../INSTALL.html \
48 ../scidavis.css \51 ../scidavis.css \
49 ../scidavis-logo.png \52 ../scidavis-logo.png \
50 ../README \53 ../README \
@@ -123,7 +126,6 @@
123 src/MultiLayer.h\126 src/MultiLayer.h\
124 src/LayerDialog.h \127 src/LayerDialog.h \
125 src/IntDialog.h \128 src/IntDialog.h \
126 src/SortDialog.h\
127 src/Bar.h \129 src/Bar.h \
128 src/Cone3D.h \130 src/Cone3D.h \
129 src/ConfigDialog.h \131 src/ConfigDialog.h \
@@ -193,6 +195,7 @@
193 src/ExtensibleFileDialog.h\195 src/ExtensibleFileDialog.h\
194 src/OpenProjectDialog.h\196 src/OpenProjectDialog.h\
195 src/Grid.h\197 src/Grid.h\
198 src/DataPointPicker.h \
196199
197###################### SOURCES ##############################################200###################### SOURCES ##############################################
198201
@@ -227,7 +230,6 @@
227 src/MultiLayer.cpp\230 src/MultiLayer.cpp\
228 src/LayerDialog.cpp \231 src/LayerDialog.cpp \
229 src/IntDialog.cpp \232 src/IntDialog.cpp \
230 src/SortDialog.cpp\
231 src/Bar.cpp \233 src/Bar.cpp \
232 src/Cone3D.cpp \234 src/Cone3D.cpp \
233 src/DataSetDialog.cpp \235 src/DataSetDialog.cpp \
@@ -299,6 +301,7 @@
299 src/OpenProjectDialog.cpp\301 src/OpenProjectDialog.cpp\
300 src/Grid.cpp\302 src/Grid.cpp\
301 src/globals.cpp \303 src/globals.cpp \
304 src/DataPointPicker.cpp \
302305
303###################### FORMS ##############################################306###################### FORMS ##############################################
304FORMS += src/SciDAVisAbout.ui307FORMS += src/SciDAVisAbout.ui
@@ -360,6 +363,7 @@
360 src/future/table/future_SortDialog.h \363 src/future/table/future_SortDialog.h \
361 src/future/table/AsciiTableImportFilter.h \364 src/future/table/AsciiTableImportFilter.h \
362 src/future/core/AbstractImportFilter.h \365 src/future/core/AbstractImportFilter.h \
366 src/future/core/interfaces.h \
363367
364SOURCES += src/future/core/AbstractAspect.cpp \368SOURCES += src/future/core/AbstractAspect.cpp \
365 src/future/core/AbstractPart.cpp \369 src/future/core/AbstractPart.cpp \
@@ -373,6 +377,7 @@
373 src/future/core/datatypes/DateTime2StringFilter.cpp \377 src/future/core/datatypes/DateTime2StringFilter.cpp \
374 src/future/core/datatypes/String2DateTimeFilter.cpp \378 src/future/core/datatypes/String2DateTimeFilter.cpp \
375 src/future/core/datatypes/Double2StringFilter.cpp \379 src/future/core/datatypes/Double2StringFilter.cpp \
380 src/future/core/datatypes/Double2DateTimeFilter.cpp \
376 src/future/core/AbstractSimpleFilter.cpp \381 src/future/core/AbstractSimpleFilter.cpp \
377 src/future/core/AbstractFilter.cpp \382 src/future/core/AbstractFilter.cpp \
378 src/future/core/ProjectConfigPage.cpp \383 src/future/core/ProjectConfigPage.cpp \
379384
=== modified file 'scidavis/src/ApplicationWindow.cpp'
--- scidavis/src/ApplicationWindow.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/ApplicationWindow.cpp 2010-07-12 22:57:40 +0000
@@ -82,7 +82,6 @@
82#include "FunctionCurve.h"82#include "FunctionCurve.h"
83#include "QwtPieCurve.h"83#include "QwtPieCurve.h"
84#include "Spectrogram.h"84#include "Spectrogram.h"
85#include "Integration.h"
86#include "Differentiation.h"85#include "Differentiation.h"
87#include "SmoothFilter.h"86#include "SmoothFilter.h"
88#include "FFTFilter.h"87#include "FFTFilter.h"
@@ -915,7 +914,9 @@
915 help->setFont(appFont);914 help->setFont(appFont);
916915
917 help->addAction(actionShowHelp);916 help->addAction(actionShowHelp);
917#ifdef DYNAMIC_MANUAL_PATH
918 help->addAction(actionChooseHelpFolder);918 help->addAction(actionChooseHelpFolder);
919#endif
919 help->addSeparator();920 help->addSeparator();
920 help->addAction(actionHomePage);921 help->addAction(actionHomePage);
921 help->addAction(actionCheckUpdates);922 help->addAction(actionCheckUpdates);
@@ -1195,6 +1196,41 @@
1195 matrix_plot_tools->setEnabled (false);1196 matrix_plot_tools->setEnabled (false);
11961197
1197 Graph *g = static_cast<MultiLayer*>(w)->activeGraph();1198 Graph *g = static_cast<MultiLayer*>(w)->activeGraph();
1199 if (g) {
1200 dataTools->blockSignals(true);
1201 if (g->rangeSelectorsEnabled())
1202 btnSelect->setChecked(true);
1203 else if (g->zoomOn())
1204 btnZoomIn->setChecked(true);
1205 else if (g->drawArrow())
1206 btnArrow->setChecked(true);
1207 else if (g->drawLineActive())
1208 btnLine->setChecked(true);
1209 else if (g->activeTool() == 0)
1210 btnPointer->setChecked(true);
1211 else switch (g->activeTool()->rtti()) {
1212 case PlotToolInterface::DataPicker:
1213 switch (static_cast<DataPickerTool*>(g->activeTool())->mode()) {
1214 case DataPickerTool::Display:
1215 btnCursor->setChecked(true);
1216 break;
1217 case DataPickerTool::Move:
1218 btnMovePoints->setChecked(true);
1219 break;
1220 case DataPickerTool::Remove:
1221 btnRemovePoints->setChecked(true);
1222 break;
1223 }
1224 break;
1225 case PlotToolInterface::ScreenPicker:
1226 btnPicker->setChecked(true);
1227 break;
1228 default:
1229 btnPointer->setChecked(true);
1230 break;
1231 }
1232 dataTools->blockSignals(false);
1233 }
1198 if (g && g->curves() > 0) {1234 if (g && g->curves() > 0) {
1199 plot_tools->setEnabled(true);1235 plot_tools->setEnabled(true);
1200 QwtPlotCurve *c = g->curve(g->curves()-1);1236 QwtPlotCurve *c = g->curve(g->curves()-1);
@@ -1437,7 +1473,7 @@
14371473
1438 Table * table = static_cast<Table *>(d_workspace->activeWindow());1474 Table * table = static_cast<Table *>(d_workspace->activeWindow());
14391475
1440 if (!validFor2DPlot(table))1476 if (!validFor2DPlot(table, Graph::VectXYXY))
1441 return;1477 return;
14421478
1443 QStringList s = table->selectedColumns();1479 QStringList s = table->selectedColumns();
@@ -1456,7 +1492,7 @@
14561492
1457 Table * table = static_cast<Table *>(d_workspace->activeWindow());1493 Table * table = static_cast<Table *>(d_workspace->activeWindow());
14581494
1459 if (!validFor2DPlot(table))1495 if (!validFor2DPlot(table, Graph::VectXYAM))
1460 return;1496 return;
14611497
1462 QStringList s = table->selectedColumns();1498 QStringList s = table->selectedColumns();
@@ -2164,14 +2200,19 @@
2164 return 0;2200 return 0;
21652201
2166 Table* w = (Table*)d_workspace->activeWindow();2202 Table* w = (Table*)d_workspace->activeWindow();
2167 if (!validFor2DPlot(w))2203 if (!validFor2DPlot(w, style))
2168 return 0;2204 return 0;
21692205
2170 QStringList list=w->selectedYColumns();2206 QStringList list;
2171 if((int)list.count() < 1)2207 switch (style) {
2172 {2208 case Graph::Histogram:
2173 QMessageBox::warning(this, tr("Plot error"), tr("Please select a Y column to plot!"));2209 case Graph::Pie:
2174 return 0;2210 case Graph::Box:
2211 list = w->selectedColumns();
2212 break;
2213 default:
2214 list = w->selectedYColumns();
2215 break;
2175 }2216 }
21762217
2177 int curves = (int)list.count();2218 int curves = (int)list.count();
@@ -3304,7 +3345,8 @@
3304 {3345 {
3305 int missing_columns = temp->columnCount() - table->columnCount(); 3346 int missing_columns = temp->columnCount() - table->columnCount();
3306 for (int col=0; col<missing_columns; col++) {3347 for (int col=0; col<missing_columns; col++) {
3307 Column * new_col = new Column(tr("new_by_import") + QString::number(col+1), SciDAVis::Text);3348 Column * new_col = new Column(tr("new_by_import") + QString::number(col+1),
3349 local_convert_to_numeric ? SciDAVis::Numeric : SciDAVis::Text);
3308 new_col->setPlotDesignation(SciDAVis::Y);3350 new_col->setPlotDesignation(SciDAVis::Y);
3309 table->d_future_table->addChild(new_col);3351 table->d_future_table->addChild(new_col);
3310 }3352 }
@@ -3317,6 +3359,7 @@
3317 Column * dst_col = table->column(col);3359 Column * dst_col = table->column(col);
3318 Q_ASSERT(src_col->dataType() == dst_col->dataType());3360 Q_ASSERT(src_col->dataType() == dst_col->dataType());
3319 dst_col->copy(src_col, 0, start_row, src_col->rowCount());3361 dst_col->copy(src_col, 0, start_row, src_col->rowCount());
3362 if (local_rename_columns) dst_col->setName(src_col->name());
3320 }3363 }
3321 break;3364 break;
3322 }3365 }
@@ -3330,6 +3373,7 @@
3330 Column * dst_col = table->column(col);3373 Column * dst_col = table->column(col);
3331 Q_ASSERT(src_col->dataType() == dst_col->dataType());3374 Q_ASSERT(src_col->dataType() == dst_col->dataType());
3332 dst_col->copy(src_col, 0, 0, temp->rowCount());3375 dst_col->copy(src_col, 0, 0, temp->rowCount());
3376 if (local_rename_columns) dst_col->setName(src_col->name());
3333 }3377 }
3334 if (temp->columnCount() > table->columnCount())3378 if (temp->columnCount() > table->columnCount())
3335 {3379 {
@@ -3653,14 +3697,8 @@
3653 {3697 {
3654 title = titleBase + QString::number(++aux)+"/"+QString::number(widgets);3698 title = titleBase + QString::number(++aux)+"/"+QString::number(widgets);
3655 progress.setLabelText(title);3699 progress.setLabelText(title);
3656 QStringList lst;3700
3657 while ( s!="</table>" )3701 openTable(app, t);
3658 {
3659 s=t.readLine();
3660 lst<<s;
3661 }
3662 lst.pop_back();
3663 openTable(app,lst);
3664 progress.setValue(aux);3702 progress.setValue(aux);
3665 }3703 }
3666 else if (s.left(17)=="<TableStatistics>")3704 else if (s.left(17)=="<TableStatistics>")
@@ -3712,7 +3750,7 @@
3712 {3750 {
3713 Folder *parent = (Folder *)app->current_folder->parent();3751 Folder *parent = (Folder *)app->current_folder->parent();
3714 if (!parent)3752 if (!parent)
3715 app->current_folder = projectFolder();3753 app->current_folder = app->projectFolder();
3716 else3754 else
3717 app->current_folder = parent;3755 app->current_folder = parent;
3718 }3756 }
@@ -4111,7 +4149,7 @@
4111 temp_locale.setNumberOptions(temp_locale.numberOptions() | QLocale::OmitGroupSeparator);4149 temp_locale.setNumberOptions(temp_locale.numberOptions() | QLocale::OmitGroupSeparator);
4112 QLocale::setDefault(temp_locale);4150 QLocale::setDefault(temp_locale);
41134151
4114 d_decimal_digits = settings.value("/DecimalDigits", 14).toInt();4152 d_decimal_digits = settings.value("/DecimalDigits", 6).toInt();
4115 d_default_numeric_format = settings.value("/DefaultNumericFormat", 'g').toChar().toAscii();4153 d_default_numeric_format = settings.value("/DefaultNumericFormat", 'g').toChar().toAscii();
41164154
4117 //restore geometry of main window4155 //restore geometry of main window
@@ -4148,41 +4186,26 @@
4148 settings.beginGroup("/Paths");4186 settings.beginGroup("/Paths");
4149 workingDir = settings.value("/WorkingDir", qApp->applicationDirPath()).toString();4187 workingDir = settings.value("/WorkingDir", qApp->applicationDirPath()).toString();
41504188
4189#ifdef DYNAMIC_MANUAL_PATH
4151#ifdef MANUAL_PATH4190#ifdef MANUAL_PATH
4152 helpFilePath = settings.value("/HelpFile", MANUAL_PATH "/index.html").toString();4191 helpFilePath = settings.value("/HelpFile", MANUAL_PATH "/index.html").toString();
4153#elif defined(DOC_PATH)4192#elif defined(DOC_PATH)
4154 helpFilePath = settings.value("/HelpFile", DOC_PATH "/manual/index.html").toString();4193 helpFilePath = settings.value("/HelpFile", DOC_PATH "/manual/index.html").toString();
4155#elif defined(Q_OS_WIN)
4156 helpFilePath = settings.value("/HelpFile", qApp->applicationDirPath()+"/manual/index.html").toString();
4157#else4194#else
4158 QVariant help_file_setting = settings.value("/HelpFile");4195 QVariant help_file_setting = settings.value("/HelpFile");
4159 if (help_file_setting.isValid())4196 if (help_file_setting.isValid())
4160 helpFilePath = help_file_setting.toString();4197 helpFilePath = help_file_setting.toString();
4161 else {4198 else
4162 QFileInfo help_file_info;4199 helpFilePath = guessHelpFolder();
4163 QString help_dir_base = QString("/usr/share/doc/scidavis-%1.%2.%3")4200#endif
4164 .arg((scidavis_version & 0xff0000) >> 16)4201#else // ifdef DYNAMIC_MANUAL_PATH
4165 .arg((scidavis_version & 0x00ff00) >> 8)4202#ifdef MANUAL_PATH
4166 .arg(scidavis_version & 0x0000ff);4203 helpFilePath = MANUAL_PATH "/index.html";
4167 help_file_info.setFile(help_dir_base);4204#elif defined(DOC_PATH)
4168 if (!help_file_info.exists())4205 helpFilePath = DOC_PATH "/manual/index.html";
4169 help_dir_base = "/usr/share/doc/scidavis";4206#else
4170 QStringList help_dir_suffixes;4207 helpFilePath = guessHelpFolder();
4171 QString locale = QLocale().name(); // language_country according to ISO 639 and 3166, respectively4208#endif
4172 help_dir_suffixes
4173 << QString("-") + locale
4174 << QString("-") + locale.section('_',0,0)
4175 << QString("-") + appLanguage
4176 << "-en"
4177 << "";
4178 foreach (QString suffix, help_dir_suffixes) {
4179 help_file_info.setFile(help_dir_base + QString("/manual%1/index.html").arg(suffix));
4180 if (help_file_info.exists())
4181 break;
4182 }
4183 // intentionally defaults to /usr/share/doc/scidavis/manual/index.html even if it doesn't exist
4184 helpFilePath = help_file_info.absoluteFilePath();
4185 }
4186#endif4209#endif
41874210
4188#ifdef Q_OS_WIN4211#ifdef Q_OS_WIN
@@ -4349,7 +4372,7 @@
4349 simplify_spaces = settings.value("/SimplifySpaces", false).toBool();4372 simplify_spaces = settings.value("/SimplifySpaces", false).toBool();
4350 d_ASCII_file_filter = settings.value("/AsciiFileTypeFilter", "*").toString();4373 d_ASCII_file_filter = settings.value("/AsciiFileTypeFilter", "*").toString();
4351 d_ASCII_import_locale = settings.value("/AsciiImportLocale", "C").toString();4374 d_ASCII_import_locale = settings.value("/AsciiImportLocale", "C").toString();
4352 d_convert_to_numeric = settings.value("/ConvertToNumeric", false).toBool();4375 d_convert_to_numeric = settings.value("/ConvertToNumeric", true).toBool();
4353 settings.endGroup(); // Import ASCII4376 settings.endGroup(); // Import ASCII
43544377
4355 settings.beginGroup("/ExportImage");4378 settings.beginGroup("/ExportImage");
@@ -8202,13 +8225,8 @@
8202 tr("Please indicate the location of the help file!")+"<br>"+8225 tr("Please indicate the location of the help file!")+"<br>"+
8203 tr("The manual can be downloaded from the following internet address:")+8226 tr("The manual can be downloaded from the following internet address:")+
8204 "<p><a href = http://sourceforge.net/project/showfiles.php?group_id=199120>http://sourceforge.net/project/showfiles.php?group_id=199120</a></p>");8227 "<p><a href = http://sourceforge.net/project/showfiles.php?group_id=199120>http://sourceforge.net/project/showfiles.php?group_id=199120</a></p>");
8205 QString fn = QFileDialog::getOpenFileName(QDir::currentDirPath(), "*.html", this );8228 chooseHelpFolder();
8206 if (!fn.isEmpty())8229 saveSettings();
8207 {
8208 QFileInfo fi(fn);
8209 helpFilePath=fi.absFilePath();
8210 saveSettings();
8211 }
8212 }8230 }
82138231
8214 QFileInfo fi(helpFilePath);8232 QFileInfo fi(helpFilePath);
@@ -9201,10 +9219,17 @@
9201}9219}
92029220
9203// TODO: most of this code belongs into Table9221// TODO: most of this code belongs into Table
9204Table* ApplicationWindow::openTable(ApplicationWindow* app, const QStringList &flist)9222Table* ApplicationWindow::openTable(ApplicationWindow* app, QTextStream &stream)
9205{9223{
9206 if (app->d_file_version < 0x000200)9224 if (app->d_file_version < 0x000200)
9207 {9225 {
9226 QStringList flist;
9227 QString s;
9228 while (s != "</table>") {
9229 s = stream.readLine();
9230 flist << s;
9231 }
9232 flist.pop_back();
9208 QStringList::const_iterator line = flist.begin();9233 QStringList::const_iterator line = flist.begin();
92099234
9210 QStringList list=(*line).split("\t");9235 QStringList list=(*line).split("\t");
@@ -9294,13 +9319,35 @@
9294 }9319 }
9295 else9320 else
9296 {9321 {
9322 QString s = stream.readLine();
9323 int length = s.toInt();
9324
9325 // On Windows, loading large tables to a QString has been observed to crash
9326 // (apparently due to excessive memory usage).
9327 // => use temporary file if possible
9328 QTemporaryFile tmp_file;
9329 QString tmp_string;
9330 if (tmp_file.open()) {
9331 QTextStream tmp(&tmp_file);
9332 tmp.setEncoding(QTextStream::UnicodeUTF8);
9333 int read = 0;
9334 while (length - read >= 1024) {
9335 tmp << stream.read(1024);
9336 read += 1024;
9337 }
9338 tmp << stream.read(length - read);
9339 tmp.flush();
9340 tmp_file.seek(0);
9341 stream.readLine(); // skip to next newline
9342 } else
9343 while (tmp_string.length() < length)
9344 tmp_string += '\n' + stream.readLine();
9345
9346 XmlStreamReader reader(tmp_string);
9347 if (tmp_file.isOpen())
9348 reader.setDevice(&tmp_file);
9349
9297 Table* w = app->newTable("table", 1, 1);9350 Table* w = app->newTable("table", 1, 1);
9298 int length = flist.at(0).toInt();
9299 int index = 1;
9300 QString xml(flist.at(index++));
9301 while (xml.length() < length && index < flist.size())
9302 xml += '\n' + flist.at(index++);
9303 XmlStreamReader reader(xml);
9304 reader.readNext();9351 reader.readNext();
9305 reader.readNext(); // read the start document9352 reader.readNext(); // read the start document
9306 if (w->d_future_table->load(&reader) == false)9353 if (w->d_future_table->load(&reader) == false)
@@ -9317,7 +9364,11 @@
9317 QMessageBox::warning(this, tr("Project loading partly failed"), msg_text);9364 QMessageBox::warning(this, tr("Project loading partly failed"), msg_text);
9318 }9365 }
9319 w->setBirthDate(w->d_future_table->creationTime().toString(Qt::LocalDate));9366 w->setBirthDate(w->d_future_table->creationTime().toString(Qt::LocalDate));
9320 restoreWindowGeometry(app, w, flist.at(index));9367
9368 s = stream.readLine();
9369 restoreWindowGeometry(app, w, s);
9370
9371 s = stream.readLine(); // </table>
93219372
9322 return w;9373 return w;
9323 }9374 }
@@ -9609,6 +9660,20 @@
9609 else if(plotType == Graph::Box) {9660 else if(plotType == Graph::Box) {
9610 ag->openBoxDiagram(w, curve, d_file_version);9661 ag->openBoxDiagram(w, curve, d_file_version);
9611 curve_loaded = true;9662 curve_loaded = true;
9663 } else if (plotType == Graph::Histogram) {
9664 if (d_file_version < 90)
9665 curve_loaded = ag->plotHistogram(w, QStringList() << curve[2]);
9666 else
9667 curve_loaded = ag->plotHistogram(w, QStringList() << curve[2],
9668 curve[curve.count()-3].toInt(), curve[curve.count()-2].toInt());
9669 if (curve_loaded) {
9670 QwtHistogram *h = (QwtHistogram *)ag->curve(curveID);
9671 if (d_file_version <= 76)
9672 h->setBinning(curve[16].toInt(),curve[17].toDouble(),curve[18].toDouble(),curve[19].toDouble());
9673 else
9674 h->setBinning(curve[17].toInt(),curve[18].toDouble(),curve[19].toDouble(),curve[20].toDouble());
9675 h->loadData();
9676 }
9612 } else {9677 } else {
9613 if (d_file_version < 72)9678 if (d_file_version < 72)
9614 curve_loaded = ag->insertCurve(w, curve[1].toInt(), curve[2], plotType);9679 curve_loaded = ag->insertCurve(w, curve[1].toInt(), curve[2], plotType);
@@ -9622,16 +9687,6 @@
9622 }9687 }
9623 }9688 }
96249689
9625 if(curve_loaded && plotType == Graph::Histogram)
9626 {
9627 QwtHistogram *h = (QwtHistogram *)ag->curve(curveID);
9628 if (d_file_version <= 76)
9629 h->setBinning(curve[16].toInt(),curve[17].toDouble(),curve[18].toDouble(),curve[19].toDouble());
9630 else
9631 h->setBinning(curve[17].toInt(),curve[18].toDouble(),curve[19].toDouble(),curve[20].toDouble());
9632 h->loadData();
9633 }
9634
9635 if(curve_loaded && (plotType == Graph::VerticalBars || plotType == Graph::HorizontalBars ||9690 if(curve_loaded && (plotType == Graph::VerticalBars || plotType == Graph::HorizontalBars ||
9636 plotType == Graph::Histogram))9691 plotType == Graph::Histogram))
9637 {9692 {
@@ -10184,27 +10239,18 @@
10184 btnPointer->setChecked(true);10239 btnPointer->setChecked(true);
10185}10240}
1018610241
10187void ApplicationWindow::disableTools()
10188{
10189 QWidgetList *windows = windowsList();
10190 foreach(QWidget *w, *windows)
10191 {
10192 if (w->inherits("MultiLayer"))
10193 {
10194 QWidgetList lst= ((MultiLayer *)w)->graphPtrs();
10195 foreach(QWidget *widget, lst)
10196 ((Graph *)widget)->disableTools();
10197 }
10198 }
10199 delete windows;
10200}
10201
10202void ApplicationWindow::pickDataTool( QAction* action )10242void ApplicationWindow::pickDataTool( QAction* action )
10203{10243{
10204 if (!action)10244 if (!action)
10205 return;10245 return;
1020610246
10207 disableTools();10247 MultiLayer *m = qobject_cast<MultiLayer*>(d_workspace->activeWindow());
10248 if (!m) return;
10249
10250 Graph *g = m->activeGraph();
10251 if (!g) return;
10252
10253 g->disableTools();
1020810254
10209 if (action == btnCursor)10255 if (action == btnCursor)
10210 showCursor();10256 showCursor();
@@ -10695,8 +10741,10 @@
10695 actionShowHelp->setShortcut( tr("Ctrl+H") );10741 actionShowHelp->setShortcut( tr("Ctrl+H") );
10696 connect(actionShowHelp, SIGNAL(activated()), this, SLOT(showHelp()));10742 connect(actionShowHelp, SIGNAL(activated()), this, SLOT(showHelp()));
1069710743
10744#ifdef DYNAMIC_MANUAL_PATH
10698 actionChooseHelpFolder = new QAction(tr("&Choose Help Folder..."), this);10745 actionChooseHelpFolder = new QAction(tr("&Choose Help Folder..."), this);
10699 connect(actionChooseHelpFolder, SIGNAL(activated()), this, SLOT(chooseHelpFolder()));10746 connect(actionChooseHelpFolder, SIGNAL(activated()), this, SLOT(chooseHelpFolder()));
10747#endif
1070010748
10701 actionRename = new QAction(tr("&Rename Window"), this);10749 actionRename = new QAction(tr("&Rename Window"), this);
10702 connect(actionRename, SIGNAL(activated()), this, SLOT(renameActiveWindow()));10750 connect(actionRename, SIGNAL(activated()), this, SLOT(renameActiveWindow()));
@@ -11161,7 +11209,10 @@
11161 actionShowHelp->setMenuText(tr("&Help"));11209 actionShowHelp->setMenuText(tr("&Help"));
11162 actionShowHelp->setShortcut(tr("Ctrl+H"));11210 actionShowHelp->setShortcut(tr("Ctrl+H"));
1116311211
11212#ifdef DYNAMIC_MANUAL_PATH
11164 actionChooseHelpFolder->setMenuText(tr("&Choose Help Folder..."));11213 actionChooseHelpFolder->setMenuText(tr("&Choose Help Folder..."));
11214#endif
11215
11165 actionRename->setMenuText(tr("&Rename Window"));11216 actionRename->setMenuText(tr("&Rename Window"));
1116611217
11167 actionCloseWindow->setMenuText(tr("Close &Window"));11218 actionCloseWindow->setMenuText(tr("Close &Window"));
@@ -12083,13 +12134,7 @@
12083 }12134 }
12084 else if (s == "<table>")12135 else if (s == "<table>")
12085 {12136 {
12086 while ( s!="</table>" )12137 openTable(this, t);
12087 {
12088 s=t.readLine();
12089 lst<<s;
12090 }
12091 lst.pop_back();
12092 openTable(this,lst);
12093 }12138 }
12094 else if (s == "<matrix>")12139 else if (s == "<matrix>")
12095 {12140 {
@@ -12220,6 +12265,29 @@
12220 QApplication::restoreOverrideCursor();12265 QApplication::restoreOverrideCursor();
12221}12266}
1222212267
12268void ApplicationWindow::rawSaveFolder(Folder *folder, QIODevice *device)
12269{
12270 QTextStream stream(device);
12271 stream.setEncoding(QTextStream::UnicodeUTF8);
12272 foreach (MyWidget *w, folder->windowsList()) {
12273 Table *t = qobject_cast<Table*>(w);
12274 if (t)
12275 t->saveToDevice(device, windowGeometryInfo(w));
12276 else
12277 stream << w->saveToString(windowGeometryInfo(w));
12278 }
12279 foreach (Folder *subfolder, folder->folders()) {
12280 stream << "<folder>\t"+QString(subfolder->name())+"\t"+subfolder->birthDate()+"\t"+subfolder->modificationDate();
12281 if (subfolder == current_folder)
12282 stream << "\tcurrent\n";
12283 else
12284 stream << "\n"; // FIXME: Having no 5th string here is not a good idea
12285 stream.flush();
12286 rawSaveFolder(subfolder, device);
12287 stream << "</folder>\n";
12288 }
12289}
12290
12223void ApplicationWindow::saveFolder(Folder *folder, const QString& fn)12291void ApplicationWindow::saveFolder(Folder *folder, const QString& fn)
12224{12292{
12225 // file saving procedure follows12293 // file saving procedure follows
@@ -12240,62 +12308,14 @@
1224012308
12241 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));12309 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
1224212310
12243 QList<MyWidget *> lst = folder->windowsList();
12244 int windows = 0;
12245 QString text;
12246 foreach(MyWidget *w, lst)
12247 {
12248 text += w->saveToString(windowGeometryInfo(w));
12249 windows++;
12250 }
12251
12252 FolderListItem *fi = folder->folderListItem();
12253 FolderListItem *item = (FolderListItem *)fi->firstChild();
12254 int opened_folders = 0;
12255 int initial_depth = fi->depth();
12256 while (item && item->depth() > initial_depth)
12257 {
12258 Folder *dir = (Folder *)item->folder();
12259 text += "<folder>\t"+QString(dir->name())+"\t"+dir->birthDate()+"\t"+dir->modificationDate();
12260 if (dir == current_folder)
12261 text += "\tcurrent\n";
12262 else
12263 text += "\n"; // FIXME: Having no 5th string here is not a good idea
12264
12265 lst = dir->windowsList();
12266 foreach(MyWidget *w, lst)
12267 {
12268 text += w->saveToString(windowGeometryInfo(w));
12269 windows++;
12270 }
12271
12272 if ( (dir->children()).isEmpty() )
12273 text += "</folder>\n";
12274 else
12275 opened_folders++;
12276
12277 int depth = item->depth();
12278 item = (FolderListItem *)item->itemBelow();
12279 if (item && item->depth() < depth && item->depth() > initial_depth)
12280 {
12281 text += "</folder>\n";
12282 opened_folders--;
12283 }
12284 else if (!item)
12285 {
12286 for (int i = 0; i<opened_folders; i++)
12287 text += "</folder>\n";
12288 opened_folders = 0;
12289 }
12290 }
12291 text += "<log>\n"+logInfo+"</log>";
12292 text.prepend("<windows>\t"+QString::number(windows)+"\n");
12293 text.prepend("<scripting-lang>\t"+QString(scriptEnv->name())+"\n");
12294 text.prepend(SciDAVis::versionString() + " project file\n");
12295
12296 QTextStream t( &f );12311 QTextStream t( &f );
12297 t.setEncoding(QTextStream::UnicodeUTF8);12312 t.setEncoding(QTextStream::UnicodeUTF8);
12298 t << text;12313 t << SciDAVis::versionString() + " project file\n";
12314 t << "<scripting-lang>\t"+QString(scriptEnv->name())+"\n";
12315 t << "<windows>\t"+QString::number(folder->windowCount(true))+"\n";
12316 t.flush();
12317 rawSaveFolder(folder, &f);
12318 t << "<log>\n"+logInfo+"</log>";
1229912319
12300 // second part of secure file saving (see comment at the start of this method)12320 // second part of secure file saving (see comment at the start of this method)
12301#ifdef Q_OS_WIN12321#ifdef Q_OS_WIN
@@ -13133,6 +13153,7 @@
13133 folders->setCurrentItem(dest_f->folderListItem());13153 folders->setCurrentItem(dest_f->folderListItem());
13134 changeFolder(dest_f, true);13154 changeFolder(dest_f, true);
13135 folders->setFocus();13155 folders->setFocus();
13156 modifiedProject();
13136}13157}
1313713158
13138void ApplicationWindow::moveFolder(FolderListItem *src, FolderListItem *dest)13159void ApplicationWindow::moveFolder(FolderListItem *src, FolderListItem *dest)
@@ -13561,22 +13582,29 @@
13561 return true;13582 return true;
13562}13583}
1356313584
13564bool ApplicationWindow::validFor2DPlot(Table *table)13585bool ApplicationWindow::validFor2DPlot(Table *table, int type)
13565{13586{
13566 if (table->selectedColumnCount(SciDAVis::Y) < 1)13587 switch (type) {
13567 {13588 case Graph::Histogram:
13568 QMessageBox::warning(this, tr("Error"), tr("Please select a Y column to plot!"));13589 case Graph::Pie:
13569 return false;13590 case Graph::Box:
13570 }13591 if (table->selectedColumnCount() < 1) {
13571 else if (table->numCols() < 2)13592 QMessageBox::warning(this, tr("Error"), tr("Please select a column to plot!"));
13572 {13593 return false;
13573 QMessageBox::critical(this, tr("Error"),tr("You need at least two columns for this operation!"));13594 }
13574 return false;13595 break;
13575 }13596 default:
13576 else if (table->noXColumn())13597 if (table->selectedColumnCount(SciDAVis::Y) < 1) {
13577 {13598 QMessageBox::warning(this, tr("Error"), tr("Please select a Y column to plot!"));
13578 QMessageBox::critical(this, tr("Error"), tr("Please set a default X column for this table, first!"));13599 return false;
13579 return false;13600 } else if (table->numCols() < 2) {
13601 QMessageBox::critical(this, tr("Error"),tr("You need at least two columns for this operation!"));
13602 return false;
13603 } else if (table->noXColumn()) {
13604 QMessageBox::critical(this, tr("Error"), tr("Please set a default X column for this table, first!"));
13605 return false;
13606 }
13607 break;
13580 }13608 }
1358113609
13582 return true;13610 return true;
@@ -13588,9 +13616,19 @@
13588 return;13616 return;
1358913617
13590 Table *table = qobject_cast<Table *>(d_workspace->activeWindow());13618 Table *table = qobject_cast<Table *>(d_workspace->activeWindow());
13591 if (table && validFor2DPlot(table)) {13619 if (table && validFor2DPlot(table, type)) {
13592 multilayerPlot(table, table->drawableColumnSelection(), (Graph::CurveType)type, 13620 switch (type) {
13593 table->firstSelectedRow(), table->lastSelectedRow());13621 case Graph::Histogram:
13622 case Graph::Pie:
13623 case Graph::Box:
13624 multilayerPlot(table, table->selectedColumns(), (Graph::CurveType)type,
13625 table->firstSelectedRow(), table->lastSelectedRow());
13626 break;
13627 default:
13628 multilayerPlot(table, table->drawableColumnSelection(), (Graph::CurveType)type,
13629 table->firstSelectedRow(), table->lastSelectedRow());
13630 break;
13631 }
13594 return;13632 return;
13595 }13633 }
1359613634
@@ -13669,3 +13707,34 @@
13669 result.append(aspect->name());13707 result.append(aspect->name());
13670 return result;13708 return result;
13671}13709}
13710
13711QString ApplicationWindow::guessHelpFolder()
13712{
13713#if defined(Q_OS_WIN)
13714 return qApp->applicationDirPath()+"/manual/index.html";
13715#else
13716 QFileInfo help_file_info;
13717 QString help_dir_base = QString("/usr/share/doc/scidavis-%1.%2.%3")
13718 .arg((SciDAVis::version() & 0xff0000) >> 16)
13719 .arg((SciDAVis::version() & 0x00ff00) >> 8)
13720 .arg(SciDAVis::version() & 0x0000ff);
13721 help_file_info.setFile(help_dir_base);
13722 if (!help_file_info.exists())
13723 help_dir_base = "/usr/share/doc/scidavis";
13724 QStringList help_dir_suffixes;
13725 QString locale = QLocale().name(); // language_country according to ISO 639 and 3166, respectively
13726 help_dir_suffixes
13727 << QString("-") + locale
13728 << QString("-") + locale.section('_',0,0)
13729 << QString("-") + appLanguage
13730 << "-en"
13731 << "";
13732 foreach (QString suffix, help_dir_suffixes) {
13733 help_file_info.setFile(help_dir_base + QString("/manual%1/index.html").arg(suffix));
13734 if (help_file_info.exists())
13735 break;
13736 }
13737 // intentionally defaults to /usr/share/doc/scidavis/manual/index.html even if it doesn't exist
13738 return help_file_info.absoluteFilePath();
13739#endif
13740}
1367213741
=== modified file 'scidavis/src/ApplicationWindow.h'
--- scidavis/src/ApplicationWindow.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/ApplicationWindow.h 2010-07-12 22:57:40 +0000
@@ -496,7 +496,7 @@
496 //! \name Reading from a Project File496 //! \name Reading from a Project File
497 //@{497 //@{
498 Matrix* openMatrix(ApplicationWindow* app, const QStringList &flist);498 Matrix* openMatrix(ApplicationWindow* app, const QStringList &flist);
499 Table* openTable(ApplicationWindow* app, const QStringList &flist);499 Table* openTable(ApplicationWindow* app, QTextStream &stream);
500 TableStatistics* openTableStatistics(const QStringList &flist);500 TableStatistics* openTableStatistics(const QStringList &flist);
501 Graph3D* openSurfacePlot(ApplicationWindow* app, const QStringList &lst);501 Graph3D* openSurfacePlot(ApplicationWindow* app, const QStringList &lst);
502 Graph* openGraph(ApplicationWindow* app, MultiLayer *plot, const QStringList &list);502 Graph* openGraph(ApplicationWindow* app, MultiLayer *plot, const QStringList &list);
@@ -549,7 +549,6 @@
549 void showCursor();549 void showCursor();
550 void showScreenReader();550 void showScreenReader();
551 void pickPointerCursor();551 void pickPointerCursor();
552 void disableTools();
553 void pickDataTool( QAction* action );552 void pickDataTool( QAction* action );
554553
555 void updateLog(const QString& result);554 void updateLog(const QString& result);
@@ -639,6 +638,7 @@
639 void showHelp();638 void showHelp();
640 static void showStandAloneHelp();639 static void showStandAloneHelp();
641 void chooseHelpFolder();640 void chooseHelpFolder();
641 QString guessHelpFolder();
642 void showPlotWizard();642 void showPlotWizard();
643 void showFitPolynomDialog();643 void showFitPolynomDialog();
644 void showIntegrationDialog();644 void showIntegrationDialog();
@@ -830,6 +830,7 @@
830 void saveAsProject();830 void saveAsProject();
831 void saveFolderAsProject(Folder *f);831 void saveFolderAsProject(Folder *f);
832 void saveFolder(Folder *folder, const QString& fn);832 void saveFolder(Folder *folder, const QString& fn);
833 void rawSaveFolder(Folder *folder, QIODevice *device);
833834
834 //! adds a folder list item to the list view "lv"835 //! adds a folder list item to the list view "lv"
835 void addFolderListViewItem(Folder *f);836 void addFolderListViewItem(Folder *f);
@@ -1008,7 +1009,7 @@
1008 //! Check whether a table is valid for a 3D plot and display an appropriate error if not1009 //! Check whether a table is valid for a 3D plot and display an appropriate error if not
1009 bool validFor3DPlot(Table *table);1010 bool validFor3DPlot(Table *table);
1010 //! Check whether a table is valid for a 2D plot and display an appropriate error if not1011 //! Check whether a table is valid for a 2D plot and display an appropriate error if not
1011 bool validFor2DPlot(Table *table);1012 bool validFor2DPlot(Table *table, int type);
10121013
1013 //! Workaround for the new colors introduced in rev 4471014 //! Workaround for the new colors introduced in rev 447
1014 int convertOldToNewColorIndex(int cindex);1015 int convertOldToNewColorIndex(int cindex);
@@ -1058,7 +1059,10 @@
1058 QAction *actionShowExpDecayDialog, *actionShowTwoExpDecayDialog, *actionShowExpDecay3Dialog;1059 QAction *actionShowExpDecayDialog, *actionShowTwoExpDecayDialog, *actionShowExpDecay3Dialog;
1059 QAction *actionFitExpGrowth, *actionFitSigmoidal, *actionFitGauss, *actionFitLorentz, *actionShowFitDialog;1060 QAction *actionFitExpGrowth, *actionFitSigmoidal, *actionFitGauss, *actionFitLorentz, *actionShowFitDialog;
1060 QAction *actionShowAxisDialog, *actionShowTitleDialog;1061 QAction *actionShowAxisDialog, *actionShowTitleDialog;
1061 QAction *actionAbout, *actionShowHelp, *actionChooseHelpFolder;1062 QAction *actionAbout, *actionShowHelp;
1063#ifdef DYNAMIC_MANUAL_PATH
1064 QAction *actionChooseHelpFolder;
1065#endif
1062 QAction *actionRename, *actionCloseWindow, *actionConvertTable;1066 QAction *actionRename, *actionCloseWindow, *actionConvertTable;
1063 QAction *actionAddColToTable, *actionDeleteLayer, *actionInterpolate;1067 QAction *actionAddColToTable, *actionDeleteLayer, *actionInterpolate;
1064 QAction *actionResizeActiveWindow, *actionHideActiveWindow;1068 QAction *actionResizeActiveWindow, *actionHideActiveWindow;
10651069
=== modified file 'scidavis/src/AssociationsDialog.cpp'
--- scidavis/src/AssociationsDialog.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/AssociationsDialog.cpp 2010-07-12 22:57:40 +0000
@@ -45,7 +45,7 @@
45#include <QMessageBox>45#include <QMessageBox>
4646
47AssociationsDialog::AssociationsDialog( QWidget* parent, Qt::WFlags fl )47AssociationsDialog::AssociationsDialog( QWidget* parent, Qt::WFlags fl )
48 : QDialog( parent, fl )48 : QDialog( parent, fl ), graph(0)
49{49{
50 setWindowTitle( tr( "Plot Associations" ) );50 setWindowTitle( tr( "Plot Associations" ) );
51 setSizeGripEnabled(true);51 setSizeGripEnabled(true);
5252
=== modified file 'scidavis/src/AxesDialog.cpp'
--- scidavis/src/AxesDialog.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/AxesDialog.cpp 2010-07-12 22:57:40 +0000
@@ -1310,7 +1310,16 @@
1310 else if (format == Graph::Time || format == Graph::Date || format == Graph::DateTime)1310 else if (format == Graph::Time || format == Graph::Date || format == Graph::DateTime)
1311 {1311 {
1312 QStringList lst = formatInfo[axis].split(";", QString::KeepEmptyParts);1312 QStringList lst = formatInfo[axis].split(";", QString::KeepEmptyParts);
1313 if ((int)lst.count() >= 2)1313 if (lst.size() < 2 || lst[0].isEmpty()) {
1314 lst = QStringList();
1315 if (format == Graph::Time)
1316 lst << QTime(0,0,0).toString();
1317 else if (format == Graph::Date)
1318 lst << QDate(1,1,1).toString("YYYY-MM-DD");
1319 else
1320 lst << QDateTime(QDate(1,1,1), QTime(0,0,0)).toString("YYYY-MM-DDTHH:MM:SS");
1321 lst << boxFormat->currentText();
1322 } else
1314 lst[1] = boxFormat->currentText();1323 lst[1] = boxFormat->currentText();
1315 formatInfo[axis] = lst.join(";");1324 formatInfo[axis] = lst.join(";");
1316 }1325 }
@@ -1600,7 +1609,17 @@
1600 else if (type == Graph::Time || type == Graph::Date || type == Graph::DateTime)1609 else if (type == Graph::Time || type == Graph::Date || type == Graph::DateTime)
1601 {1610 {
1602 QStringList lst = formatInfo[axis].split(";", QString::SkipEmptyParts);1611 QStringList lst = formatInfo[axis].split(";", QString::SkipEmptyParts);
1603 lst[1] = boxFormat->currentText();1612 if (lst.size() < 2 || lst[0].isEmpty()) {
1613 lst = QStringList();
1614 if (type == Graph::Time)
1615 lst << QTime(0,0,0).toString();
1616 else if (type == Graph::Date)
1617 lst << QDate(1,1,1).toString("YYYY-MM-DD");
1618 else
1619 lst << QDateTime(QDate(1,1,1), QTime(0,0,0)).toString("YYYY-MM-DDTHH:MM:SS");
1620 lst << boxFormat->currentText();
1621 } else
1622 lst[1] = boxFormat->currentText();
1604 formatInfo[axis] = lst.join(";");1623 formatInfo[axis] = lst.join(";");
1605 }1624 }
1606 else1625 else
@@ -1676,7 +1695,17 @@
1676 else if (type == Graph::Time || type == Graph::Date || type == Graph::DateTime)1695 else if (type == Graph::Time || type == Graph::Date || type == Graph::DateTime)
1677 {1696 {
1678 QStringList lst = formatInfo[axis].split(";", QString::KeepEmptyParts);1697 QStringList lst = formatInfo[axis].split(";", QString::KeepEmptyParts);
1679 lst[1] = boxFormat->currentText();1698 if (lst.size() < 2 || lst[0].isEmpty()) {
1699 lst = QStringList();
1700 if (type == Graph::Time)
1701 lst << QTime(0,0,0).toString();
1702 else if (type == Graph::Date)
1703 lst << QDate(1,1,1).toString("YYYY-MM-DD");
1704 else
1705 lst << QDateTime(QDate(1,1,1), QTime(0,0,0)).toString("YYYY-MM-DDTHH:MM:SS");
1706 lst << boxFormat->currentText();
1707 } else
1708 lst[1] = boxFormat->currentText();
1680 formatInfo[axis] = lst.join(";");1709 formatInfo[axis] = lst.join(";");
1681 }1710 }
1682 else1711 else
16831712
=== modified file 'scidavis/src/BoxCurve.cpp'
--- scidavis/src/BoxCurve.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/BoxCurve.cpp 2010-07-12 22:57:40 +0000
@@ -329,7 +329,7 @@
329 return rect;329 return rect;
330}330}
331331
332void BoxCurve::loadData()332bool BoxCurve::loadData()
333{333{
334 QVector<double> Y(abs(d_end_row - d_start_row) + 1);334 QVector<double> Y(abs(d_end_row - d_start_row) + 1);
335 int ycol = d_table->colIndex(title().text());335 int ycol = d_table->colIndex(title().text());
@@ -358,5 +358,7 @@
358 setData(QwtSingleArrayData(this->x(0), Y, size));358 setData(QwtSingleArrayData(this->x(0), Y, size));
359 } else359 } else
360 remove();360 remove();
361
362 return true;
361}363}
362364
363365
=== modified file 'scidavis/src/BoxCurve.h'
--- scidavis/src/BoxCurve.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/BoxCurve.h 2010-07-12 22:57:40 +0000
@@ -75,7 +75,7 @@
75 int whiskersRangeType(){return w_range;};75 int whiskersRangeType(){return w_range;};
76 void setWhiskersRange(int type, double coeff);76 void setWhiskersRange(int type, double coeff);
7777
78 void loadData();78 virtual bool loadData();
7979
80private:80private:
81 void draw(QPainter *painter,const QwtScaleMap &xMap,81 void draw(QPainter *painter,const QwtScaleMap &xMap,
8282
=== modified file 'scidavis/src/Correlation.cpp'
--- scidavis/src/Correlation.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/Correlation.cpp 2010-07-12 22:57:40 +0000
@@ -149,17 +149,15 @@
149 double x_temp[rows], y_temp[rows];149 double x_temp[rows], y_temp[rows];
150 for (int i = 0; i<rows; i++)150 for (int i = 0; i<rows; i++)
151 {151 {
152 double x = i - n;152 x_temp[i] = i - n;
153 x_temp[i] = x;
154153
155 double y;
156 if(i < n)154 if(i < n)
157 y_temp[i] = d_x[d_n - n + i];155 y_temp[i] = d_x[d_n - n + i];
158 else156 else
159 y_temp[i] = d_x[i-n];157 y_temp[i] = d_x[i-n];
160158
161 d_table->column(cols)->setValueAt(i, x);159 d_table->column(cols)->setValueAt(i, x_temp[i]);
162 d_table->column(cols2)->setValueAt(i, y);160 d_table->column(cols2)->setValueAt(i, y_temp[i]);
163 }161 }
164162
165 QStringList l = d_table->colNames().grep(tr("Lag"));163 QStringList l = d_table->colNames().grep(tr("Lag"));
166164
=== modified file 'scidavis/src/DataPickerTool.cpp'
--- scidavis/src/DataPickerTool.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/DataPickerTool.cpp 2010-07-12 22:57:40 +0000
@@ -195,9 +195,10 @@
195 {195 {
196 int n_curves = d_graph->curves();196 int n_curves = d_graph->curves();
197 int start = d_graph->curveIndex(d_selected_curve) + 1;197 int start = d_graph->curveIndex(d_selected_curve) + 1;
198 QwtPlotCurve *c;
198 for (int i = start; i < start + n_curves; ++i)199 for (int i = start; i < start + n_curves; ++i)
199 if (d_graph->curve(i % n_curves)->dataSize() > 0) {200 if ((c=d_graph->curve(i % n_curves))->dataSize() > 0) {
200 setSelection(d_graph->curve(i % n_curves), 0);201 setSelection(c, qMin(c->dataSize()-1, d_selected_point));
201 break;202 break;
202 }203 }
203 d_graph->plotWidget()->replot();204 d_graph->plotWidget()->replot();
@@ -208,9 +209,10 @@
208 {209 {
209 int n_curves = d_graph->curves();210 int n_curves = d_graph->curves();
210 int start = d_graph->curveIndex(d_selected_curve) + n_curves - 1;211 int start = d_graph->curveIndex(d_selected_curve) + n_curves - 1;
212 QwtPlotCurve *c;
211 for (int i = start; i > start - n_curves; --i)213 for (int i = start; i > start - n_curves; --i)
212 if (d_graph->curve(i % n_curves)->dataSize() > 0) {214 if ((c=d_graph->curve(i % n_curves))->dataSize() > 0) {
213 setSelection(d_graph->curve(i % n_curves), 0);215 setSelection(c, qMin(c->dataSize()-1, d_selected_point));
214 break;216 break;
215 }217 }
216 d_graph->plotWidget()->replot();218 d_graph->plotWidget()->replot();
217219
=== modified file 'scidavis/src/DataPickerTool.h'
--- scidavis/src/DataPickerTool.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/DataPickerTool.h 2010-07-12 22:57:40 +0000
@@ -47,6 +47,8 @@
47 enum Mode { Display, Move, Remove };47 enum Mode { Display, Move, Remove };
48 enum MoveMode {Free, Vertical, Horizontal};48 enum MoveMode {Free, Vertical, Horizontal};
49 DataPickerTool(Graph *graph, ApplicationWindow *app, Mode mode, const QObject *status_target=NULL, const char *status_slot="");49 DataPickerTool(Graph *graph, ApplicationWindow *app, Mode mode, const QObject *status_target=NULL, const char *status_slot="");
50 virtual RTTI rtti() const { return DataPicker; }
51 Mode mode() const { return d_mode; }
50 virtual ~DataPickerTool();52 virtual ~DataPickerTool();
51 virtual bool eventFilter(QObject *obj, QEvent *event);53 virtual bool eventFilter(QObject *obj, QEvent *event);
52 bool keyEventFilter(QKeyEvent *ke);54 bool keyEventFilter(QKeyEvent *ke);
5355
=== added file 'scidavis/src/DataPointPicker.cpp'
--- scidavis/src/DataPointPicker.cpp 1970-01-01 00:00:00 +0000
+++ scidavis/src/DataPointPicker.cpp 2010-07-12 22:57:40 +0000
@@ -0,0 +1,80 @@
1/***************************************************************************
2 File : DataPointPicker.cpp
3 Project : SciDAVis
4 --------------------------------------------------------------------
5 Copyright : (C) 2010 Knut Franke
6 Email (use @ for *) : Knut.Franke*gmx.net
7 Description : Let the user pick single data points from a plot.
8
9 ***************************************************************************/
10
11/***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 * This program is distributed in the hope that it will be useful, *
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21 * GNU General Public License for more details. *
22 * *
23 * You should have received a copy of the GNU General Public License *
24 * along with this program; if not, write to the Free Software *
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26 * Boston, MA 02110-1301 USA *
27 * *
28 ***************************************************************************/
29
30#include "DataPointPicker.h"
31#include "Graph.h"
32#include "DataPickerTool.h"
33
34/**
35 * \class DataPointPicker
36 * \brief Let the user pick single data points from a plot.
37 *
38 * While DataPickerTool does the actual selection work, DataPointPicker provides the framework
39 * necessary for script-driven usage. In particular, the event-oriented interface of DataPickerTool
40 * doesn't fit very well into the typical imparative structure of simple scripts. DataPointPicker
41 * bridges this gap by starting a new event loop (see QEventLoop) which allows the user to pick a
42 * data point while the script is still running within the main event loop. The inner event loop
43 * exits when the user has selected a data point, pick() returns its coordinates and control flows
44 * back to the caller.
45 */
46
47//! Constructor.
48DataPointPicker::DataPointPicker(Graph *g, ApplicationWindow *app)
49 : m_graph(g), m_app(app), m_result(NAN,NAN)
50{
51}
52
53//! Destructor (exits the event loop).
54DataPointPicker::~DataPointPicker() {
55 m_picking_loop.exit(1);
56}
57
58/**
59 * \brief Let the user pick a single data point and return its coordinates.
60 *
61 * Starts a new event loop, which runs until either the user has selected a point or the
62 * DataPointPicker is destructed.
63 */
64QPointF DataPointPicker::pick() {
65 if (m_graph->isPiePlot() || !m_graph->validCurvesDataSize())
66 return m_result;
67 DataPickerTool *tool = new DataPickerTool(m_graph, m_app, DataPickerTool::Display);
68 connect(tool, SIGNAL(selected(QwtPlotCurve*,int)),
69 this, SLOT(pointSelected(QwtPlotCurve*,int)));
70 m_graph->setActiveTool(tool);
71 m_picking_loop.exec();
72 m_graph->setActiveTool(0);
73 return m_result;
74}
75
76//! Handle selection of a point by the user.
77void DataPointPicker::pointSelected(QwtPlotCurve *curve, int pointIndex) {
78 m_result = QPointF(curve->x(pointIndex), curve->y(pointIndex));
79 m_picking_loop.exit(0);
80}
081
=== added file 'scidavis/src/DataPointPicker.h'
--- scidavis/src/DataPointPicker.h 1970-01-01 00:00:00 +0000
+++ scidavis/src/DataPointPicker.h 2010-07-12 22:57:40 +0000
@@ -0,0 +1,57 @@
1/***************************************************************************
2 File : DataPointPicker.h
3 Project : SciDAVis
4 --------------------------------------------------------------------
5 Copyright : (C) 2010 Knut Franke
6 Email (use @ for *) : Knut.Franke*gmx.net
7 Description : Let the user pick single data points from a plot.
8
9 ***************************************************************************/
10
11/***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 * This program is distributed in the hope that it will be useful, *
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21 * GNU General Public License for more details. *
22 * *
23 * You should have received a copy of the GNU General Public License *
24 * along with this program; if not, write to the Free Software *
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26 * Boston, MA 02110-1301 USA *
27 * *
28 ***************************************************************************/
29
30#ifndef DATA_POINT_PICKER_H
31#define DATA_POINT_PICKER_H
32
33#include <QEventLoop>
34#include <QPointF>
35
36class Graph;
37class ApplicationWindow;
38class QwtPlotCurve;
39
40class DataPointPicker : public QObject
41{
42 Q_OBJECT
43
44 public:
45 DataPointPicker(Graph *g, ApplicationWindow *app);
46 ~DataPointPicker();
47 QPointF pick();
48 protected slots:
49 void pointSelected(QwtPlotCurve *curve, int pointIndex);
50 private:
51 QEventLoop m_picking_loop;
52 Graph *m_graph;
53 ApplicationWindow *m_app;
54 QPointF m_result;
55};
56
57#endif // ifndef DATA_POINT_PICKER_H
058
=== modified file 'scidavis/src/Differentiation.cpp'
--- scidavis/src/Differentiation.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/Differentiation.cpp 2010-07-12 22:57:40 +0000
@@ -61,28 +61,22 @@
6161
62void Differentiation::output()62void Differentiation::output()
63{63{
64 double *result = new double[d_n-1];
65 for (int i = 1; i < d_n-1; i++)
66 result[i]=0.5*((d_y[i+1]-d_y[i])/(d_x[i+1]-d_x[i]) + (d_y[i]-d_y[i-1])/(d_x[i]-d_x[i-1]));
67
68 ApplicationWindow *app = (ApplicationWindow *)parent();
69 QString tableName = app->generateUniqueName(QString(name()));
70 QString curveTitle = d_curve->title().text();
71 Column *xCol = new Column(tr("1", "differention table x column name"), SciDAVis::Numeric);64 Column *xCol = new Column(tr("1", "differention table x column name"), SciDAVis::Numeric);
72 Column *yCol = new Column(tr("2", "differention table y column name"), SciDAVis::Numeric);65 Column *yCol = new Column(tr("2", "differention table y column name"), SciDAVis::Numeric);
73 xCol->setPlotDesignation(SciDAVis::X);66 xCol->setPlotDesignation(SciDAVis::X);
74 yCol->setPlotDesignation(SciDAVis::Y);67 yCol->setPlotDesignation(SciDAVis::Y);
75 Table *t = app->newHiddenTable(tableName, tr("Derivative") + " " + tr("of","Derivative of") + " " + curveTitle, QList<Column *>() << xCol << yCol);68 for (int i = 1; i < d_n-1; i++) {
76 for (int i = 1; i < d_n-1; i++)
77 {
78 xCol->setValueAt(i-1, d_x[i]);69 xCol->setValueAt(i-1, d_x[i]);
79 yCol->setValueAt(i-1, result[i]);70 yCol->setValueAt(i-1, 0.5*((d_y[i+1]-d_y[i])/(d_x[i+1]-d_x[i]) + (d_y[i]-d_y[i-1])/(d_x[i]-d_x[i-1])));
80 }71 }
81 delete[] result;
8272
83 MultiLayer *ml = app->newGraph(tr("Plot")+tr("Derivative"));73 ApplicationWindow *app = (ApplicationWindow *)parent();
84 ml->activeGraph()->insertCurve(t, tableName + "_" + yCol->name(), 0);74 QString tableName = app->generateUniqueName(QString(name()));
85 Legend *l = ml->activeGraph()->legend();75 QString curveTitle = d_curve->title().text();
86 l->setText("\\c{1}" + tr("Derivative") + " " + tr("of","Derivative of") + " " + curveTitle);76 Table *t = app->newHiddenTable(tableName, tr("Derivative") + " " + tr("of","Derivative of") + " " + curveTitle, QList<Column *>() << xCol << yCol);
77 MultiLayer *ml = app->newGraph(tr("Plot")+tr("Derivative"));
78 ml->activeGraph()->insertCurve(t, tableName + "_" + yCol->name(), 0);
79 Legend *l = ml->activeGraph()->legend();
80 l->setText("\\c{1}" + tr("Derivative") + " " + tr("of","Derivative of") + " " + curveTitle);
87}81}
8882
8983
=== modified file 'scidavis/src/Filter.cpp'
--- scidavis/src/Filter.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/Filter.cpp 2010-07-12 22:57:40 +0000
@@ -97,25 +97,24 @@
97 else97 else
98 d_n = curveData(d_curve, start, end, &d_x, &d_y);98 d_n = curveData(d_curve, start, end, &d_x, &d_y);
9999
100 if (d_n == -1)100 if (!isDataAcceptable()) {
101 {101 d_init_err = true;
102 QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),102 return;
103 tr("Several data points have the same x value causing divisions by zero, operation aborted!"));
104 d_init_err = true;
105 return;
106 }
107 else if (d_n < d_min_points)
108 {
109 QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
110 tr("You need at least %1 points in order to perform this operation!").arg(d_min_points));
111 d_init_err = true;
112 return;
113 }103 }
114104
115 d_from = start;105 d_from = start;
116 d_to = end;106 d_to = end;
117}107}
118108
109bool Filter::isDataAcceptable() {
110 if (d_n < d_min_points) {
111 QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
112 tr("You need at least %1 points in order to perform this operation!").arg(d_min_points));
113 return false;
114 }
115 return true;
116}
117
119int Filter::curveIndex(const QString& curveTitle, Graph *g)118int Filter::curveIndex(const QString& curveTitle, Graph *g)
120{119{
121 if (curveTitle.isEmpty())120 if (curveTitle.isEmpty())
@@ -229,74 +228,61 @@
229228
230int Filter::sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y)229int Filter::sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y)
231{230{
232 if (!c)231 if (!c || c->rtti() != QwtPlotItem::Rtti_PlotCurve)
233 return 0;232 return 0;
234233
235 int i_start = 0, i_end = c->dataSize();234 // start/end finding only works on nondecreasing data, so sort first
236 for (int i = 0; i < i_end; i++)235 int datasize = c->dataSize();
237 if (c->x(i) >= start)236 double *xtemp = new double[datasize];
238 {237 for (int i = 0; i < datasize; i++) {
239 i_start = i;238 xtemp[i] = c->x(i);
240 break;239 }
241 }240 size_t *p = new size_t[datasize];
242 for (int i = i_end-1; i >= 0; i--)241 gsl_sort_index(p, xtemp, 1, datasize);
243 if (c->x(i) <= end)
244 {
245 i_end = i;
246 break;
247 }
248 int n = i_end - i_start + 1;
249 (*x) = new double[n];
250 (*y) = new double[n];
251 double *xtemp = new double[n];
252 double *ytemp = new double[n];
253
254 int j=0;
255 for (int i = i_start; i <= i_end; i++)
256 {
257 xtemp[j] = c->x(i);
258 ytemp[j++] = c->y(i);
259 }
260 size_t *p = new size_t[n];
261 gsl_sort_index(p, xtemp, 1, n);
262 for (int i=0; i<n; i++)
263 {
264 (*x)[i] = xtemp[p[i]];
265 (*y)[i] = ytemp[p[i]];
266 }
267 delete[] xtemp;242 delete[] xtemp;
268 delete[] ytemp;243
244 // find indices that, when permuted by the sort result, give start and end
245 int i_start, i_end;
246 for (i_start = 0; i_start < datasize; i_start++)
247 if (c->x(p[i_start]) >= start)
248 break;
249 for (i_end = datasize-1; i_end >= 0; i_end--)
250 if (c->x(p[i_end]) <= end)
251 break;
252
253 // make result arrays
254 int n = i_end - i_start + 1;
255 (*x) = new double[n];
256 (*y) = new double[n];
257 for (int j = 0, i = i_start; i <= i_end; i++, j++) {
258 (*x)[j] = c->x(p[i]);
259 (*y)[j] = c->y(p[i]);
260 }
269 delete[] p;261 delete[] p;
270 return n;262 return n;
271}263}
272264
273int Filter::curveData(QwtPlotCurve *c, double start, double end, double **x, double **y)265int Filter::curveData(QwtPlotCurve *c, double start, double end, double **x, double **y)
274{266{
275 if (!c)267 if (!c || c->rtti() != QwtPlotItem::Rtti_PlotCurve)
276 return 0;268 return 0;
277269
270 int datasize = c->dataSize();
278 int i_start = 0, i_end = c->dataSize();271 int i_start = 0, i_end = c->dataSize();
279 for (int i = 0; i < i_end; i++)272 for (i_start = 0; i_start < datasize; i_start++)
280 if (c->x(i) >= start)273 if (c->x(i_start) >= start)
281 {274 break;
282 i_start = i;275 for (i_end = datasize-1; i_end >= 0; i_end--)
283 break;276 if (c->x(i_end) <= end)
284 }277 break;
285 for (int i = i_end-1; i >= 0; i--)278
286 if (c->x(i) <= end)
287 {
288 i_end = i;
289 break;
290 }
291 int n = i_end - i_start + 1;279 int n = i_end - i_start + 1;
292 (*x) = new double[n];280 (*x) = new double[n];
293 (*y) = new double[n];281 (*y) = new double[n];
294282
295 int j=0;283 for (int j = 0, i = i_start; i <= i_end; i++, j++) {
296 for (int i = i_start; i <= i_end; i++)
297 {
298 (*x)[j] = c->x(i);284 (*x)[j] = c->x(i);
299 (*y)[j++] = c->y(i);285 (*y)[j] = c->y(i);
300 }286 }
301 return n;287 return n;
302}288}
303289
=== modified file 'scidavis/src/Filter.h'
--- scidavis/src/Filter.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/Filter.h 2010-07-12 22:57:40 +0000
@@ -89,11 +89,17 @@
89 protected:89 protected:
90 void init();90 void init();
9191
92 //! Sets x and y to the curve points between start and end. Memory will be allocated with new double[].92 /**
93 //! Returns the number of points within range == size of x and y arrays.93 * \brief Sets x and y to the curve points between start and end.
94 virtual int curveData(QwtPlotCurve *c, double start, double end, double **x, double **y);94 *
95 * \returns the number of points within range == size of x and y arrays.
96 * Memory will be allocated with new double[].
97 */
98 int curveData(QwtPlotCurve *c, double start, double end, double **x, double **y);
95 //! Same as curveData, but sorts the points by their x value.99 //! Same as curveData, but sorts the points by their x value.
96 virtual int sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y);100 int sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y);
101
102 virtual bool isDataAcceptable();
97103
98 //! Adds the result curve to the target output plot window. Creates a hidden table and frees the input data from memory.104 //! Adds the result curve to the target output plot window. Creates a hidden table and frees the input data from memory.
99 QwtPlotCurve* addResultCurve(double *x, double *y);105 QwtPlotCurve* addResultCurve(double *x, double *y);
100106
=== modified file 'scidavis/src/Folder.cpp'
--- scidavis/src/Folder.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/Folder.cpp 2010-07-12 22:57:40 +0000
@@ -62,7 +62,7 @@
62 // lstWindows.setAutoDelete( true );62 // lstWindows.setAutoDelete( true );
63}63}
6464
65QList<Folder*> Folder::folders()65QList<Folder*> Folder::folders() const
66{66{
67 QList<Folder*> lst;67 QList<Folder*> lst;
68 foreach(QObject *f, children())68 foreach(QObject *f, children())
6969
=== modified file 'scidavis/src/Folder.h'
--- scidavis/src/Folder.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/Folder.h 2010-07-12 22:57:40 +0000
@@ -66,15 +66,29 @@
6666
67 QList<MyWidget *> windowsList(){return lstWindows;};67 QList<MyWidget *> windowsList(){return lstWindows;};
6868
69 void addWindow( MyWidget *w ){ lstWindows.append( w );};69 void addWindow( MyWidget *w ) {
70 void removeWindow( MyWidget *w ){ lstWindows.takeAt( lstWindows.indexOf(w) );70 w->setFolder(this);
71 if (w==d_active_window) d_active_window=0; };71 lstWindows.append( w );
72 };
73 void removeWindow( MyWidget *w ){
74 w->setFolder(0);
75 lstWindows.removeAll(w);
76 if (w==d_active_window) d_active_window=0;
77 };
78
79 int windowCount(bool recursive = false) const {
80 int result = lstWindows.size();
81 if (recursive)
82 foreach (Folder *folder, folders())
83 result += folder->windowCount(true);
84 return result;
85 };
7286
73 //! The list of subfolder names, including first generation children only87 //! The list of subfolder names, including first generation children only
74 QStringList subfolders();88 QStringList subfolders();
7589
76 //! The list of subfolders90 //! The list of subfolders
77 QList<Folder*> folders();91 QList<Folder*> folders() const;
7892
79 //! Pointer to the subfolder called s93 //! Pointer to the subfolder called s
80 Folder* findSubfolder(const QString& s, bool caseSensitive = true, bool partialMatch = false);94 Folder* findSubfolder(const QString& s, bool caseSensitive = true, bool partialMatch = false);
8195
=== modified file 'scidavis/src/FunctionCurve.cpp'
--- scidavis/src/FunctionCurve.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/FunctionCurve.cpp 2010-07-12 22:57:40 +0000
@@ -87,7 +87,8 @@
87 if (!points)87 if (!points)
88 points = dataSize();88 points = dataSize();
8989
90 double X[points], Y[points];90 double * X = new double[points];
91 double * Y = new double[points];
91 double step = (d_to - d_from)/(double)(points - 1);92 double step = (d_to - d_from)/(double)(points - 1);
9293
93 switch(d_function_type) {94 switch(d_function_type) {
@@ -102,8 +103,11 @@
102 X[i] = x;103 X[i] = x;
103 script->setDouble(x, d_variable.toAscii().constData());104 script->setDouble(x, d_variable.toAscii().constData());
104 QVariant result = script->eval();105 QVariant result = script->eval();
105 if (result.type() != QVariant::Double)106 if (result.type() != QVariant::Double) {
107 delete[] X;
108 delete[] Y;
106 return false;109 return false;
110 }
107 Y[i] = result.toDouble();111 Y[i] = result.toDouble();
108 }112 }
109 break;113 break;
@@ -120,8 +124,11 @@
120 script_y->setDouble(par, d_variable.toAscii().constData());124 script_y->setDouble(par, d_variable.toAscii().constData());
121 QVariant result_x = script_x->eval();125 QVariant result_x = script_x->eval();
122 QVariant result_y = script_y->eval();126 QVariant result_y = script_y->eval();
123 if (result_x.type() != QVariant::Double || result_y.type() != QVariant::Double)127 if (result_x.type() != QVariant::Double || result_y.type() != QVariant::Double) {
128 delete[] X;
129 delete[] Y;
124 return false;130 return false;
131 }
125 if (d_function_type == Polar) {132 if (d_function_type == Polar) {
126 X[i] = result_x.toDouble()*cos(result_y.toDouble());133 X[i] = result_x.toDouble()*cos(result_y.toDouble());
127 Y[i] = result_x.toDouble()*sin(result_y.toDouble());134 Y[i] = result_x.toDouble()*sin(result_y.toDouble());
@@ -135,6 +142,8 @@
135142
136 }143 }
137 setData(X, Y, points);144 setData(X, Y, points);
145 delete[] X;
146 delete[] Y;
138 return true;147 return true;
139}148}
140149
141150
=== modified file 'scidavis/src/Graph.cpp'
--- scidavis/src/Graph.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/Graph.cpp 2010-07-12 22:57:40 +0000
@@ -54,7 +54,6 @@
54#include "PlotCurve.h"54#include "PlotCurve.h"
55#include "ApplicationWindow.h"55#include "ApplicationWindow.h"
56#include "core/column/Column.h"56#include "core/column/Column.h"
57#include "core/datatypes/DateTime2StringFilter.h"
5857
59#include <QApplication>58#include <QApplication>
60#include <QBitmap>59#include <QBitmap>
@@ -70,6 +69,7 @@
70#include <QPrintDialog>69#include <QPrintDialog>
71#include <QImageWriter>70#include <QImageWriter>
72#include <QFileInfo>71#include <QFileInfo>
72#include <QRegExp>
7373
74#if QT_VERSION >= 0x04030074#if QT_VERSION >= 0x040300
75 #include <QSvgGenerator>75 #include <QSvgGenerator>
@@ -385,12 +385,12 @@
385 const QwtScaleDiv div = sd_old->scaleDiv ();385 const QwtScaleDiv div = sd_old->scaleDiv ();
386386
387 if (format == Plot::Superscripts){387 if (format == Plot::Superscripts){
388 QwtSupersciptsScaleDraw *sd = new QwtSupersciptsScaleDraw(formula.toAscii().constData());388 QwtSupersciptsScaleDraw *sd = new QwtSupersciptsScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), formula.toAscii().constData());
389 sd->setLabelFormat('s', prec);389 sd->setLabelFormat('s', prec);
390 sd->setScaleDiv(div);390 sd->setScaleDiv(div);
391 d_plot->setAxisScaleDraw (axis, sd);391 d_plot->setAxisScaleDraw (axis, sd);
392 } else {392 } else {
393 ScaleDraw *sd = new ScaleDraw(formula.toAscii().constData());393 ScaleDraw *sd = new ScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), formula.toAscii().constData());
394 sd->setScaleDiv(div);394 sd->setScaleDiv(div);
395395
396 if (format == Plot::Automatic)396 if (format == Plot::Automatic)
@@ -726,7 +726,7 @@
726 ScaleDraw *sd_old = (ScaleDraw *)d_plot->axisScaleDraw (axis);726 ScaleDraw *sd_old = (ScaleDraw *)d_plot->axisScaleDraw (axis);
727 const QwtScaleDiv div = sd_old->scaleDiv ();727 const QwtScaleDiv div = sd_old->scaleDiv ();
728728
729 WeekDayScaleDraw *sd = new WeekDayScaleDraw((WeekDayScaleDraw::NameFormat)format);729 WeekDayScaleDraw *sd = new WeekDayScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), (WeekDayScaleDraw::NameFormat)format);
730 sd->setScaleDiv(div);730 sd->setScaleDiv(div);
731 d_plot->setAxisScaleDraw (axis, sd);731 d_plot->setAxisScaleDraw (axis, sd);
732}732}
@@ -739,7 +739,7 @@
739 ScaleDraw *sd_old = (ScaleDraw *)d_plot->axisScaleDraw (axis);739 ScaleDraw *sd_old = (ScaleDraw *)d_plot->axisScaleDraw (axis);
740 const QwtScaleDiv div = sd_old->scaleDiv ();740 const QwtScaleDiv div = sd_old->scaleDiv ();
741741
742 MonthScaleDraw *sd = new MonthScaleDraw((MonthScaleDraw::NameFormat)format);742 MonthScaleDraw *sd = new MonthScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), (MonthScaleDraw::NameFormat)format);
743 sd->setScaleDiv(div);743 sd->setScaleDiv(div);
744 d_plot->setAxisScaleDraw (axis, sd);744 d_plot->setAxisScaleDraw (axis, sd);
745}745}
@@ -754,6 +754,7 @@
754 if (!column) return;754 if (!column) return;
755 future::Table *table = qobject_cast<future::Table*>(column->parentAspect());755 future::Table *table = qobject_cast<future::Table*>(column->parentAspect());
756 if (!table) return;756 if (!table) return;
757 if (axis < 0 || axis > 3) return;
757758
758 axisType[axis] = Txt;759 axisType[axis] = Txt;
759 axesFormatInfo[axis] = table->name() + "_" + column->name();760 axesFormatInfo[axis] = table->name() + "_" + column->name();
@@ -762,7 +763,7 @@
762 for (int row = startRow; row <= endRow; row++)763 for (int row = startRow; row <= endRow; row++)
763 if (!column->isInvalid(row))764 if (!column->isInvalid(row))
764 list.insert(row+1, column->textAt(row));765 list.insert(row+1, column->textAt(row));
765 d_plot->setAxisScaleDraw(axis, new QwtTextScaleDraw(list));766 d_plot->setAxisScaleDraw(axis, new QwtTextScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), list));
766}767}
767768
768void Graph::setLabelsTextFormat(int axis, Table *table, const QString& columnName) {769void Graph::setLabelsTextFormat(int axis, Table *table, const QString& columnName) {
@@ -791,13 +792,13 @@
791 for (int col=0; col < table->columnCount(); col++)792 for (int col=0; col < table->columnCount(); col++)
792 if (table->colPlotDesignation(col) == SciDAVis::Y)793 if (table->colPlotDesignation(col) == SciDAVis::Y)
793 list.insert(col, table->colLabel(col));794 list.insert(col, table->colLabel(col));
794 d_plot->setAxisScaleDraw(axis, new QwtTextScaleDraw(list));795 d_plot->setAxisScaleDraw(axis, new QwtTextScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), list));
795}796}
796797
797void Graph::setLabelsDateTimeFormat(int axis, int type, const QString& formatInfo)798void Graph::setLabelsDateTimeFormat(int axis, int type, const QString& formatInfo)
798{799{
799 QStringList list = formatInfo.split(";", QString::KeepEmptyParts);800 QStringList list = formatInfo.split(";", QString::KeepEmptyParts);
800 if ((int)list.count() < 2 || list[0].isEmpty() || list[1].isEmpty()) {801 if ((int)list.count() < 2 || list[1].isEmpty()) {
801 QMessageBox::critical(this, tr("Error"), tr("Couldn't change the axis type to the requested format!"));802 QMessageBox::critical(this, tr("Error"), tr("Couldn't change the axis type to the requested format!"));
802 return;803 return;
803 }804 }
@@ -805,21 +806,24 @@
805 switch(type) {806 switch(type) {
806 case Time:807 case Time:
807 {808 {
808 TimeScaleDraw *sd = new TimeScaleDraw (QTime::fromString (list[0]), list[1]);809 TimeScaleDraw *sd = new TimeScaleDraw (*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)),
810 list[0].isEmpty() ? QTime(12,0,0,0) : QTime::fromString (list[0]), list[1]);
809 sd->enableComponent (QwtAbstractScaleDraw::Backbone, drawAxesBackbone);811 sd->enableComponent (QwtAbstractScaleDraw::Backbone, drawAxesBackbone);
810 d_plot->setAxisScaleDraw (axis, sd);812 d_plot->setAxisScaleDraw (axis, sd);
811 break;813 break;
812 }814 }
813 case Date:815 case Date:
814 {816 {
815 DateScaleDraw *sd = new DateScaleDraw (QDate::fromString (list[0], "YYYY-MM-DD"), list[1]);817 DateScaleDraw *sd = new DateScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)),
818 QDate::fromString(list[0], "YYYY-MM-DD"), list[1]);
816 sd->enableComponent (QwtAbstractScaleDraw::Backbone, drawAxesBackbone);819 sd->enableComponent (QwtAbstractScaleDraw::Backbone, drawAxesBackbone);
817 d_plot->setAxisScaleDraw (axis, sd);820 d_plot->setAxisScaleDraw (axis, sd);
818 break;821 break;
819 }822 }
820 case DateTime:823 case DateTime:
821 {824 {
822 DateTimeScaleDraw *sd = new DateTimeScaleDraw (QDateTime::fromString (list[0], "YYYY-MM-DDTHH:MM:SS"), list[1]);825 DateTimeScaleDraw *sd = new DateTimeScaleDraw (*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)),
826 QDateTime::fromString (list[0], "YYYY-MM-DDTHH:MM:SS"), list[1]);
823 sd->enableComponent (QwtAbstractScaleDraw::Backbone, drawAxesBackbone);827 sd->enableComponent (QwtAbstractScaleDraw::Backbone, drawAxesBackbone);
824 d_plot->setAxisScaleDraw (axis, sd);828 d_plot->setAxisScaleDraw (axis, sd);
825 break;829 break;
@@ -1764,7 +1768,7 @@
1764 {1768 {
1765 int index = d_texts.indexOf(legendMarkerID);1769 int index = d_texts.indexOf(legendMarkerID);
1766 int texts = d_texts.size();1770 int texts = d_texts.size();
1767 for (int i=index; i<texts; i++)1771 for (int i=index; i<texts-1; i++)
1768 d_texts[i]=d_texts[i+1];1772 d_texts[i]=d_texts[i+1];
1769 d_texts.resize(--texts);1773 d_texts.resize(--texts);
17701774
@@ -1895,10 +1899,8 @@
1895 if (m_autoscale) {1899 if (m_autoscale) {
1896 for (int i = 0; i < QwtPlot::axisCnt; i++)1900 for (int i = 0; i < QwtPlot::axisCnt; i++)
1897 d_plot->setAxisAutoScale(i);1901 d_plot->setAxisAutoScale(i);
1898 d_plot->replot();
1899 }1902 }
1900 else1903 d_plot->replot();
1901 updateScale();
1902 }1904 }
1903 }1905 }
1904}1906}
@@ -3168,6 +3170,37 @@
3168 updateScale();3170 updateScale();
3169}3171}
31703172
3173bool Graph::plotHistogram(Table *w, QStringList names, int startRow, int endRow)
3174{
3175 if (!w) return false;
3176 if (endRow < 0 || endRow >= w->numRows())
3177 endRow = w->numRows() - 1;
3178
3179 bool success = false;
3180 foreach(QString col, names) {
3181 Column *col_ptr = w->column(col);
3182 if (!col_ptr || col_ptr->columnMode() != SciDAVis::Numeric) continue;
3183
3184 QwtHistogram *c = new QwtHistogram(w, col, startRow, endRow);
3185 c->loadData();
3186 c->setStyle(QwtPlotCurve::UserCurve);
3187
3188 c_type.resize(++n_curves);
3189 c_type[n_curves-1] = Histogram;
3190 c_keys.resize(n_curves);
3191 c_keys[n_curves-1] = d_plot->insertCurve(c);
3192
3193 CurveLayout cl = initCurveLayout(Histogram, names.size());
3194 updateCurveLayout(n_curves-1, &cl);
3195
3196 addLegendItem(col);
3197
3198 success = true;
3199 }
3200
3201 return success;
3202}
3203
3171void Graph::insertPlotItem(QwtPlotItem *i, int type)3204void Graph::insertPlotItem(QwtPlotItem *i, int type)
3172{3205{
3173 c_type.resize(++n_curves);3206 c_type.resize(++n_curves);
@@ -3187,52 +3220,60 @@
3187 plotPie(w, names[0], startRow, endRow);3220 plotPie(w, names[0], startRow, endRow);
3188 else if (style == Box)3221 else if (style == Box)
3189 plotBoxDiagram(w, names, startRow, endRow);3222 plotBoxDiagram(w, names, startRow, endRow);
3223 else if (style == Histogram)
3224 plotHistogram(w, names, startRow, endRow);
3190 else if (style==Graph::VectXYXY || style==Graph::VectXYAM)3225 else if (style==Graph::VectXYXY || style==Graph::VectXYAM)
3191 plotVectorCurve(w, names, style, startRow, endRow);3226 plotVectorCurve(w, names, style, startRow, endRow);
3192 else3227 else
3193 {3228 {
3194 int curves = (int)names.count();3229 QStringList errorCurves, otherCurves;
3195 int errCurves = 0;3230 foreach(QString col, names) {
3196 QStringList lst = QStringList();3231 int colIndex = w->colIndex(col);
3197 for (int i=0; i<curves; i++)3232 if (colIndex < 0) continue;
3198 {//We rearrange the list so that the error bars are placed at the end3233 switch (w->colPlotDesignation(colIndex)) {
3199 int j = w->colIndex(names[i]);3234 case SciDAVis::xErr:
3200 if (j < 0) continue;3235 case SciDAVis::yErr:
3201 if (w->colPlotDesignation(j) == SciDAVis::xErr || w->colPlotDesignation(j) == SciDAVis::yErr)3236 errorCurves << col;
3202 {3237 break;
3203 errCurves++;3238 default:
3204 lst << names[i];3239 otherCurves << col;
3240 break;
3205 }3241 }
3206 else3242 }
3207 lst.prepend(names[i]);3243 QStringList lst = otherCurves + errorCurves;
3208 }
32093244
3210 for (int i=0; i<curves; i++)3245 for (int i=0; i<lst.size(); i++)
3211 {3246 {
3212 CurveType type_of_i;3247 CurveType type_of_i;
3213 int j = w->colIndex(names[i]);3248 int j = w->colIndex(lst[i]);
3214 if (j < 0) continue;3249 if (j < 0) continue;
3215 bool ok = false;3250 bool ok = false;
3216 if (w->colPlotDesignation(j) == SciDAVis::xErr || w->colPlotDesignation(j) == SciDAVis::yErr)3251 if (i >= otherCurves.size()) {
3217 {
3218 type_of_i = ErrorBars;3252 type_of_i = ErrorBars;
3219 int ycol = w->colY(w->colIndex(names[i]));3253 int ycol = -1;
3254 for (int k=otherCurves.size()-1; k >= 0; k--) {
3255 int index = w->colIndex(lst[k]);
3256 if (w->colPlotDesignation(index) == SciDAVis::Y)
3257 ycol = index;
3258 }
3259 if (ycol < 0)
3260 ycol = w->colY(w->colIndex(lst[i]));
3220 if (ycol < 0)3261 if (ycol < 0)
3221 return false;3262 return false;
32223263
3223 if (w->colPlotDesignation(j) == SciDAVis::xErr)3264 if (w->colPlotDesignation(j) == SciDAVis::xErr)
3224 ok = addErrorBars(w->colName(ycol), w, names[i], (int)QwtErrorPlotCurve::Horizontal);3265 ok = addErrorBars(w->colName(ycol), w, lst[i], (int)QwtErrorPlotCurve::Horizontal);
3225 else3266 else
3226 ok = addErrorBars(w->colName(ycol), w, names[i]);3267 ok = addErrorBars(w->colName(ycol), w, lst[i]);
3227 }3268 }
3228 else {3269 else {
3229 type_of_i = (CurveType) style;3270 type_of_i = (CurveType) style;
3230 ok = insertCurve(w, names[i], style, startRow, endRow);3271 ok = insertCurve(w, lst[i], style, startRow, endRow);
3231 }3272 }
32323273
3233 if (ok)3274 if (ok)
3234 {3275 {
3235 CurveLayout cl = initCurveLayout(type_of_i, curves - errCurves);3276 CurveLayout cl = initCurveLayout(type_of_i, otherCurves.size());
3236 cl.sSize = sSize;3277 cl.sSize = sSize;
3237 cl.lWidth = lWidth;3278 cl.lWidth = lWidth;
3238 updateCurveLayout(i, &cl);3279 updateCurveLayout(i, &cl);
@@ -3264,150 +3305,25 @@
3264bool Graph::insertCurve(Table* w, const QString& xColName, const QString& yColName, int style, int startRow, int endRow)3305bool Graph::insertCurve(Table* w, const QString& xColName, const QString& yColName, int style, int startRow, int endRow)
3265{3306{
3266 if (!w) return false;3307 if (!w) return false;
3267 Column *x_col_ptr = w->column(xColName);
3268 Column *y_col_ptr = w->column(yColName);
3269 if (!x_col_ptr || !y_col_ptr)
3270 return false;
3271
3272 int xColType = x_col_ptr->columnMode();
3273 int yColType = y_col_ptr->columnMode();
3274 int row, size=0;
3275 QString date_time_fmt;
3276 if (xColType == SciDAVis::DateTime || xColType == SciDAVis::Month || xColType == SciDAVis::Day)
3277 date_time_fmt = static_cast<DateTime2StringFilter *>(x_col_ptr->outputFilter())->format();
3278
3279 QTime time0;
3280 QDate date0;
3281 QDateTime date_time0;
3282 QLocale locale;
3283
3284 if (endRow < 0)
3285 endRow = w->numRows() - 1;
3286
3287 if (endRow >= x_col_ptr->rowCount())
3288 endRow = x_col_ptr->rowCount() - 1;
3289 if (endRow >= y_col_ptr->rowCount())
3290 endRow = y_col_ptr->rowCount() - 1;
3291
3292 int r = abs(endRow - startRow) + 1;
3293 QVector<double> X(r), Y(r);
3294 if (xColType == Table::Time){
3295 for (row = startRow; row<=endRow; row++ ){
3296 if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
3297 time0 = x_col_ptr->timeAt(row);
3298 if (time0.isValid())
3299 break;
3300 }
3301 }
3302 }
3303 else if (xColType == Table::Date){
3304 for (row = startRow; row<=endRow; row++ ){
3305 if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
3306 date0 = x_col_ptr->dateAt(row);
3307 if (date0.isValid())
3308 break;
3309 }
3310 }
3311 }
3312 else if (xColType == Table::DateTime) {
3313 for (row = startRow; row<=endRow; row++ ) {
3314 if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
3315 date_time0 = x_col_ptr->dateTimeAt(row);
3316 if (date_time0.isValid())
3317 break;
3318 }
3319 }
3320 }
3321
3322 for (row = startRow; row<=endRow; row++ ) {
3323 if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
3324 if (xColType == Table::Text) {
3325 X[size] = (double)(row+1);
3326 }
3327 else if (xColType == Table::Time) {
3328 QTime time = x_col_ptr->timeAt(row);
3329 if (time.isValid())
3330 X[size] = time0.msecsTo (time);
3331 else
3332 continue;
3333 }
3334 else if (xColType == Table::Date) {
3335 QDate d = x_col_ptr->dateAt(row);
3336 if (d.isValid())
3337 X[size] = (double) date0.daysTo(d);
3338 else
3339 continue;
3340 }
3341 else if (xColType == Table::DateTime) {
3342 QDateTime dt = x_col_ptr->dateTimeAt(row);
3343 if (dt.isValid())
3344 {
3345 X[size] = double(dt.date().toJulianDay()) +
3346 double( -dt.time().msecsTo(QTime(12,0,0,0)) ) / 86400000.0;
3347 }
3348 else
3349 continue;
3350 }
3351 else
3352 X[size] = x_col_ptr->valueAt(row);
3353
3354 if (yColType == Table::Text) {
3355 Y[size] = (double) (row + 1);
3356 }
3357 else if (yColType == Table::Time) {
3358 QTime yval = y_col_ptr->timeAt(row);
3359 if (yval.isValid()) {
3360 Y[size] = double( -yval.msecsTo(QTime(12,0,0,0)) );
3361 }
3362 else
3363 Y[size] = 0.0;
3364 }
3365 else if (yColType == Table::Date) {
3366 QDate yval = y_col_ptr->dateAt(row);
3367 if (yval.isValid()) {
3368 Y[size] = double( yval.toJulianDay() );
3369 }
3370 else
3371 Y[size] = 0.0;
3372 }
3373 else if (yColType == Table::DateTime) {
3374 QDateTime yval = y_col_ptr->dateTimeAt(row);
3375 if (yval.isValid()) {
3376 Y[size] = double(yval.date().toJulianDay()) +
3377 double( -yval.time().msecsTo(QTime(12,0,0,0)) ) / 86400000.0;
3378 }
3379 else
3380 Y[size] = 0.0;
3381 }
3382 else
3383 Y[size] = y_col_ptr->valueAt(row);
3384
3385 size++;
3386 }
3387 }
3388
3389 if (!size)
3390 return false;
3391
3392 X.resize(size);
3393 Y.resize(size);
3394
3395 DataCurve *c = 0;3308 DataCurve *c = 0;
3396 if (style == VerticalBars){3309
3397 c = new QwtBarCurve(QwtBarCurve::Vertical, w, xColName, yColName, startRow, endRow);3310 switch (style) {
3398 c->setStyle(QwtPlotCurve::UserCurve);3311 case Histogram:
3399 }3312 case Box:
3400 else if (style == HorizontalBars){3313 case Pie:
3401 c = new QwtBarCurve(QwtBarCurve::Horizontal, w, xColName, yColName, startRow, endRow);3314 return false;
3402 c->setStyle(QwtPlotCurve::UserCurve);3315 case VerticalBars:
3403 }3316 c = new QwtBarCurve(QwtBarCurve::Vertical, w, xColName, yColName, startRow, endRow);
3404 else if (style == Histogram){3317 c->setStyle(QwtPlotCurve::UserCurve);
3405 c = new QwtHistogram(w, xColName, yColName, startRow, endRow);3318 break;
3406 ((QwtHistogram *)c)->initData(Y, size);3319 case HorizontalBars:
3407 c->setStyle(QwtPlotCurve::UserCurve);3320 c = new QwtBarCurve(QwtBarCurve::Horizontal, w, xColName, yColName, startRow, endRow);
3408 }3321 c->setStyle(QwtPlotCurve::UserCurve);
3409 else3322 break;
3410 c = new DataCurve(w, xColName, yColName, startRow, endRow);3323 default:
3324 c = new DataCurve(w, xColName, yColName, startRow, endRow);
3325 break;
3326 };
34113327
3412 c_type.resize(++n_curves);3328 c_type.resize(++n_curves);
3413 c_type[n_curves-1] = style;3329 c_type[n_curves-1] = style;
@@ -3416,53 +3332,8 @@
34163332
3417 c->setPen(QPen(Qt::black,widthLine));3333 c->setPen(QPen(Qt::black,widthLine));
34183334
3419 if (style == HorizontalBars)3335 if (!c->loadData())
3420 c->setData(Y.data(), X.data(), size);3336 return false;
3421 else if (style != Histogram)
3422 c->setData(X.data(), Y.data(), size);
3423
3424 if (xColType == Table::Text ){
3425 if (style == HorizontalBars){
3426 setLabelsTextFormat(QwtPlot::yLeft, x_col_ptr, startRow, endRow);
3427 // change default for right axis, but don't mess up an existing one
3428 if (!d_plot->axisEnabled(QwtPlot::yRight))
3429 axesFormatInfo[QwtPlot::yRight] = xColName;
3430 }
3431 else{
3432 setLabelsTextFormat(QwtPlot::xBottom, x_col_ptr, startRow, endRow);
3433 // change default for top axis, but don't mess up an existing one
3434 if (!d_plot->axisEnabled(QwtPlot::xTop))
3435 axesFormatInfo[QwtPlot::xTop] = xColName;
3436 }
3437 }
3438 else if (xColType == Table::Time){
3439 QString fmtInfo = time0.toString() + ";" + date_time_fmt;
3440 if (style == HorizontalBars)
3441 setLabelsDateTimeFormat(QwtPlot::yLeft, Time, fmtInfo);
3442 else
3443 setLabelsDateTimeFormat(QwtPlot::xBottom, Time, fmtInfo);
3444 }
3445 else if (xColType == Table::Date ){
3446 QString fmtInfo = date0.toString("YYYY-MM-DD") + ";" + date_time_fmt;
3447 if (style == HorizontalBars)
3448 setLabelsDateTimeFormat(QwtPlot::yLeft, Date, fmtInfo);
3449 else
3450 setLabelsDateTimeFormat(QwtPlot::xBottom, Date, fmtInfo);
3451 }
3452 else if (xColType == Table::DateTime ){
3453 QString fmtInfo = date_time0.toString("YYYY-MM-DDTHH:MM:SS") + ";" + date_time_fmt;
3454 if (style == HorizontalBars)
3455 setLabelsDateTimeFormat(QwtPlot::yLeft, DateTime, fmtInfo);
3456 else
3457 setLabelsDateTimeFormat(QwtPlot::xBottom, DateTime, fmtInfo);
3458 }
3459
3460 if (yColType == Table::Text){
3461 setLabelsTextFormat(QwtPlot::yLeft, y_col_ptr, startRow, endRow);
3462 // change default for right axis, but don't mess up an existing one
3463 if (!d_plot->axisEnabled(QwtPlot::yRight))
3464 axesFormatInfo[QwtPlot::yRight] = yColName;
3465 }
34663337
3467 addLegendItem(yColName);3338 addLegendItem(yColName);
3468 updatePlot();3339 updatePlot();
@@ -3711,20 +3582,22 @@
3711 return;3582 return;
37123583
3713 QStringList l = items.filter( "\\c{" + QString::number(index+1) + "}" );3584 QStringList l = items.filter( "\\c{" + QString::number(index+1) + "}" );
3714 items.remove(l[0]);//remove the corresponding legend string3585 if (!l.isEmpty())
37153586 items.remove(l[0]);//remove the corresponding legend string
3716 int cv=0;
3717 for (int i=0; i< (int)items.count(); i++)
3718 {//set new curves indexes in legend text
3719 QString item = (items[i]).trimmed();
3720 if (item.startsWith("\\c{", true))
3721 {
3722 item.remove(0, item.find("}", 0));
3723 item.prepend("\\c{"+QString::number(++cv));
3724 }
3725 items[i]=item;
3726 }
3727 text=items.join ( "\n" ) + "\n";3587 text=items.join ( "\n" ) + "\n";
3588
3589 QRegExp itemCmd("\\\\c\\{(\\d+)\\}");
3590 int pos=0;
3591 while ((pos = itemCmd.indexIn(text, pos)) != -1) {
3592 int nr = itemCmd.cap(1).toInt();
3593 if (nr > index) {
3594 QString subst = QString("\\c{") + QString::number(nr-1) + "}";
3595 text.replace(pos, itemCmd.matchedLength(), subst);
3596 pos += subst.length();
3597 } else
3598 pos += itemCmd.matchedLength();
3599 }
3600
3728 mrk->setText(text);3601 mrk->setText(text);
3729}3602}
37303603
@@ -4662,7 +4535,7 @@
4662 }4535 }
4663 else if (style == Histogram)4536 else if (style == Histogram)
4664 {4537 {
4665 c = new QwtHistogram(cv->table(), cv->xColumnName(), cv->title().text(), cv->startRow(), cv->endRow());4538 c = new QwtHistogram(cv->table(), cv->title().text(), cv->startRow(), cv->endRow());
4666 ((QwtHistogram *)c)->copy((const QwtHistogram*)cv);4539 ((QwtHistogram *)c)->copy((const QwtHistogram*)cv);
4667 }4540 }
4668 else if (style == VectXYXY || style == VectXYAM)4541 else if (style == VectXYXY || style == VectXYAM)
46694542
=== modified file 'scidavis/src/Graph.h'
--- scidavis/src/Graph.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/Graph.h 2010-07-12 22:57:40 +0000
@@ -569,6 +569,9 @@
569 */569 */
570 bool enableRangeSelectors(const QObject *status_target=NULL, const char *status_slot="");570 bool enableRangeSelectors(const QObject *status_target=NULL, const char *status_slot="");
571571
572 //! Check wether range selectors are currently enabled.
573 bool rangeSelectorsEnabled() const { return !d_range_selector.isNull(); }
574
572 //! \name Border and Margin575 //! \name Border and Margin
573 //@{576 //@{
574 void setMargin (int d);577 void setMargin (int d);
@@ -623,6 +626,8 @@
623 void plotBoxDiagram(Table *w, const QStringList& names, int startRow = 0, int endRow = -1);626 void plotBoxDiagram(Table *w, const QStringList& names, int startRow = 0, int endRow = -1);
624 //@}627 //@}
625628
629 bool plotHistogram(Table *w, QStringList names, int startRow=0, int endRow=-1);
630
626 void setCurveSymbol(int index, const QwtSymbol& s);631 void setCurveSymbol(int index, const QwtSymbol& s);
627 void setCurvePen(int index, const QPen& p);632 void setCurvePen(int index, const QPen& p);
628 void setCurveBrush(int index, const QBrush& b);633 void setCurveBrush(int index, const QBrush& b);
629634
=== modified file 'scidavis/src/IntDialog.cpp'
--- scidavis/src/IntDialog.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/IntDialog.cpp 2010-07-12 22:57:40 +0000
@@ -55,21 +55,12 @@
55 boxName = new QComboBox();55 boxName = new QComboBox();
56 gl1->addWidget(boxName, 0, 1);56 gl1->addWidget(boxName, 0, 1);
5757
58 gl1->addWidget(new QLabel(tr("Order (1 - 5, 1 = Trapezoid Rule)")), 1, 0);58 gl1->addWidget(new QLabel(tr("Interpolation")), 1, 0);
59 boxOrder = new QSpinBox();59 boxMethod = new QComboBox();
60 boxOrder->setRange(1, 5);60 boxMethod->insertItem(tr("Linear"));
61 gl1->addWidget(boxOrder, 1, 1);61 boxMethod->insertItem(tr("Cubic"));
6262 boxMethod->insertItem(tr("Non-rounded Akima"));
63 gl1->addWidget(new QLabel(tr("Number of iterations (Max=40)")), 2, 0);63 gl1->addWidget(boxMethod, 1, 1);
64 boxSteps = new QSpinBox();
65 boxSteps->setRange(2, 40);
66 boxSteps->setValue(40);
67 gl1->addWidget(boxSteps, 2, 1);
68
69 gl1->addWidget(new QLabel(tr("Tolerance")), 3, 0);
70 boxTol = new QLineEdit();
71 boxTol->setText("0.01");
72 gl1->addWidget(boxTol, 3, 1);
7364
74 gl1->addWidget(new QLabel(tr("Lower limit")), 4, 0);65 gl1->addWidget(new QLabel(tr("Lower limit")), 4, 0);
75 boxStart = new QLineEdit();66 boxStart = new QLineEdit();
@@ -115,20 +106,6 @@
115 return;106 return;
116 }107 }
117108
118try
119 {
120 mu::Parser parser;
121 parser.SetExpr(boxTol->text().toAscii().constData());
122 parser.Eval();
123 }
124catch(mu::ParserError &e)
125 {
126 QMessageBox::critical((ApplicationWindow *)parent(),tr("Tolerance value error"),QString::fromStdString(e.GetMsg()));
127 boxTol->clear();
128 boxTol->setFocus();
129 return;
130 }
131
132double start = 0, stop = 0;109double start = 0, stop = 0;
133double minx = c->minXValue();110double minx = c->minXValue();
134double maxx = c->maxXValue();111double maxx = c->maxXValue();
@@ -229,9 +206,7 @@
229206
230Integration *i = new Integration((ApplicationWindow *)this->parent(), graph, curveName,207Integration *i = new Integration((ApplicationWindow *)this->parent(), graph, curveName,
231 boxStart->text().toDouble(), boxEnd->text().toDouble());208 boxStart->text().toDouble(), boxEnd->text().toDouble());
232i->setTolerance(boxTol->text().toDouble());209i->setMethod((Integration::InterpolationMethod)boxMethod->currentIndex());
233i->setMaximumIterations(boxSteps->value());
234i->setMethodOrder(boxOrder->value());
235i->run();210i->run();
236delete i;211delete i;
237}212}
238213
=== modified file 'scidavis/src/IntDialog.h'
--- scidavis/src/IntDialog.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/IntDialog.h 2010-07-12 22:57:40 +0000
@@ -52,11 +52,9 @@
52 QPushButton* buttonHelp;52 QPushButton* buttonHelp;
53 QCheckBox* boxShowFormula;53 QCheckBox* boxShowFormula;
54 QComboBox* boxName;54 QComboBox* boxName;
55 QSpinBox* boxOrder;55 QComboBox* boxMethod;
56 QSpinBox* boxSteps;
57 QLineEdit* boxStart;56 QLineEdit* boxStart;
58 QLineEdit* boxEnd;57 QLineEdit* boxEnd;
59 QLineEdit* boxTol;
6058
61public slots:59public slots:
62 void accept();60 void accept();
6361
=== modified file 'scidavis/src/Integration.cpp'
--- scidavis/src/Integration.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/Integration.cpp 2010-07-12 22:57:40 +0000
@@ -27,7 +27,6 @@
27 * *27 * *
28 ***************************************************************************/28 ***************************************************************************/
29#include "Integration.h"29#include "Integration.h"
30#include "nrutil.h"
31#include "MultiLayer.h"30#include "MultiLayer.h"
32#include "Legend.h"31#include "Legend.h"
3332
@@ -62,136 +61,89 @@
62void Integration::init()61void Integration::init()
63{62{
64 setName(tr("Integration"));63 setName(tr("Integration"));
65 d_method = 1;64 d_method = Linear;
66 d_max_iterations = 40;65 d_sort_data = true;
67 d_sort_data = true;66}
67
68bool Integration::isDataAcceptable()
69{
70 const gsl_interp_type *method_t;
71 switch (d_method) {
72 case Linear:
73 method_t = gsl_interp_linear;
74 break;
75 case Cubic:
76 method_t = gsl_interp_cspline;
77 break;
78 case Akima:
79 method_t = gsl_interp_akima;
80 break;
81 }
82 // GSL interpolation routines fail with division by zero on such data
83 for (int i=1; i<d_n; i++)
84 if (d_x[i-1] == d_x[i]) {
85 QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
86 tr("Several data points have the same x value causing divisions by zero, operation aborted!"));
87 return false;
88 }
89
90 return Filter::isDataAcceptable();
68}91}
6992
70QString Integration::logInfo()93QString Integration::logInfo()
71{94{
72 // Do the interpolation, use GSL libraries for that95 const gsl_interp_type *method_t;
73 gsl_interp_accel *acc = gsl_interp_accel_alloc();96 QString method_name;
74 const gsl_interp_type *method;97 switch (d_method) {
75 // The method for interpolation is chosen based on the number of points98 case Linear:
76 if(d_n>3)99 method_t = gsl_interp_linear;
77 method=gsl_interp_linear;100 method_name = tr("Linear");
78 else if(d_n>4)101 break;
79 method=gsl_interp_cspline;102 case Cubic:
80 else if(d_n>5)103 method_t = gsl_interp_cspline;
81 method=gsl_interp_akima;104 method_name = tr("Cubic");
82105 break;
83 // If we have enough points use GSL libraries for interpolation, else use the polint algorithm106 case Akima:
84 gsl_spline *interp ;107 method_t = gsl_interp_akima;
85 if(d_n>3)108 method_name = tr("Akima");
86 {109 break;
87 interp = gsl_spline_alloc (method, d_n);110 }
88 gsl_spline_init (interp, d_x, d_y, d_n);111
89 }112 gsl_interp *interpolation = gsl_interp_alloc(method_t, d_n);
90113 gsl_interp_init(interpolation, d_x, d_y, d_n);
91 // Using Numerical Recipes114
92 // This is Romberg Integration method115 if (d_n < gsl_interp_min_size(interpolation))
93 // This method uses the Nevilles' algorithm for interpollation;116 {
94 double yup, ylow;117 QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
95 double xx,tnm,sum,del,ss,dss,error,tsum;118 tr("You need at least %1 points in order to perform this operation!").arg(gsl_interp_min_size(interpolation)));
96 if(d_n > 3)119 d_init_err = true;
97 {120 return "";
98 yup = gsl_spline_eval (interp, d_to, acc);
99 ylow = gsl_spline_eval (interp, d_from, acc);
100 }
101 else if (d_n<=3)
102 {
103 polint(d_x,d_y,d_n,d_to,&yup,&dss);
104 polint(d_x,d_y,d_n,d_from,&ylow,&dss);
105 }
106
107 double *S = new double[d_max_iterations];
108 double *h = new double[d_max_iterations];
109 int j,it,l;
110 bool success = false;
111 h[0]=1.0;
112 for(j=0; j < d_max_iterations; j++)
113 {//Trapezoid Rule
114 if(j==0)
115 S[0]=0.5*(d_to-d_from)*(ylow+yup);
116 else
117 {
118 h[j] = 0.25*h[j-1];
119 S[j] = S[j-1];
120 for(it=1,l=1;l<j-1;l++)it<<=1;
121 tnm=it;
122 del=(d_to-d_from)/tnm;
123 xx=d_from+0.5*del;
124 for(sum=0.0,l=1;l<=it;l++)
125 {
126 if(d_n>3)
127 sum+=gsl_spline_eval (interp,xx, acc);
128 else if(d_n<=3)
129 {
130 polint(d_x,d_y,d_n,xx,&tsum,&dss);
131 sum+=tsum;
132 }
133 xx+=del;
134 }
135 S[j]=0.5*(S[j-1]+(d_to-d_from)*sum/tnm);
136
137 }
138 if(j>=d_method)
139 {
140 polint(&h[j-d_method],&S[j-d_method],d_method,0,&ss,&dss);
141 S[j]=ss;
142 }
143 error=fabs(S[j]-S[j-1]);
144 if(error<=d_tolerance) success = true;
145 if(success) break;
146 }121 }
147122
148 QString logInfo = "[" + QDateTime::currentDateTime().toString(Qt::LocalDate) + "\t" + tr("Plot")+ ": ''" + d_graph->parentPlotName() + "'']\n";123 QString logInfo = "[" + QDateTime::currentDateTime().toString(Qt::LocalDate) + "\t" + tr("Plot")+ ": ''" + d_graph->parentPlotName() + "'']\n";
149 logInfo += "\n" + tr("Numerical integration of") + ": " + d_curve->title().text() + " " + tr("using a %1 order method").arg(d_method)+"\n";124 logInfo += "\n" + tr("Numerical integration of") + ": " + d_curve->title().text() + tr(" using ") + method_name + tr("Interpolation") + "\n";
150 if(success)
151 logInfo += tr("Iterations") + ": " + QString::number(j)+"\n";
152 if(!success)
153 logInfo += tr("Iterations") + ": " + QString::number(j-1)+"\n";
154125
155 ApplicationWindow *app = (ApplicationWindow *)parent();126 ApplicationWindow *app = (ApplicationWindow *)parent();
156 int prec = app->d_decimal_digits;127 int prec = app->d_decimal_digits;
157 logInfo += tr("Tolerance") + "(" + tr("max") + " = " + QLocale().toString(d_tolerance, 'g', prec)+"): " + QString::number(error)+ "\n";
158 logInfo += tr("Points") + ": "+QString::number(d_n) + " " + tr("from") + " x = " +QLocale().toString(d_from, 'g', prec) + " ";128 logInfo += tr("Points") + ": "+QString::number(d_n) + " " + tr("from") + " x = " +QLocale().toString(d_from, 'g', prec) + " ";
159 logInfo += tr("to") + " x = " + QLocale().toString(d_to, 'g', prec) + "\n";129 logInfo += tr("to") + " x = " + QLocale().toString(d_to, 'g', prec) + "\n";
160130
161 // using GSL to find maximum value of data set131 // using GSL to find maximum value of data set
162 gsl_vector *aux = gsl_vector_alloc(d_n);132 gsl_vector *aux = gsl_vector_alloc(d_n);
163 for(int i=0; i < d_n; i++)133 for(int i=0; i < d_n; i++)
164 gsl_vector_set (aux, i, fabs(d_y[i]));134 gsl_vector_set (aux, i, fabs(d_y[i]));
165 int maxID=gsl_vector_max_index (aux);135 int maxID=gsl_vector_max_index (aux);
166 gsl_vector_free (aux);136 gsl_vector_free (aux);
167137
168 logInfo += tr("Peak at") + " x = " + QLocale().toString(d_x[maxID], 'g', prec)+"\t";138 logInfo += tr("Peak at") + " x = " + QLocale().toString(d_x[maxID], 'g', prec)+"\t";
169 logInfo += "y = " + QLocale().toString(d_y[maxID], 'g', prec)+"\n";139 logInfo += "y = " + QLocale().toString(d_y[maxID], 'g', prec)+"\n";
170140
171 logInfo += tr("Area") + "=";141 logInfo += tr("Area") + "=";
172 if(success)142 logInfo += QLocale().toString(gsl_interp_eval_integ(interpolation, d_x, d_y, d_from, d_to, 0), 'g', prec);
173 logInfo += QLocale().toString(S[j], 'g', prec);
174 if(!success)
175 logInfo += QLocale().toString(S[j-1], 'g', prec);
176 logInfo += "\n-------------------------------------------------------------\n";143 logInfo += "\n-------------------------------------------------------------\n";
177144
178 if(d_n>3)145 gsl_interp_free(interpolation);
179 gsl_spline_free (interp);146
180147 return logInfo;
181 gsl_interp_accel_free (acc);148}
182 delete[] S;149
183 delete[] h;
184 return logInfo;
185}
186
187void Integration::setMethodOrder(int n)
188{
189if (n < 1 || n > 5)
190 {
191 QMessageBox::critical((ApplicationWindow *)parent(), tr("Error"),
192 tr("Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5."));
193 return;
194 }
195
196d_method = n;
197}
198150
=== modified file 'scidavis/src/Integration.h'
--- scidavis/src/Integration.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/Integration.h 2010-07-12 22:57:40 +0000
@@ -36,21 +36,30 @@
36Q_OBJECT36Q_OBJECT
3737
38public:38public:
39 enum InterpolationMethod{Linear, Cubic, Akima};
40
39 Integration(ApplicationWindow *parent, Graph *g);41 Integration(ApplicationWindow *parent, Graph *g);
40 Integration(ApplicationWindow *parent, Graph *g, const QString& curveTitle);42 Integration(ApplicationWindow *parent, Graph *g, const QString& curveTitle);
41 Integration(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);43 Integration(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
4244
43 int method(){return d_method;};45 InterpolationMethod method(){return d_method;};
44 void setMethodOrder(int n);46 void setMethod(InterpolationMethod method) {
47 InterpolationMethod backup = d_method;
48 d_method = method;
49 if (!isDataAcceptable())
50 d_method = backup;
51 };
52
53protected:
54 virtual bool isDataAcceptable();
4555
46private:56private:
47 void init();57 void init();
48 //!Uses code originally written by Vasileios Gkanis. It needs some more checking.
49 QString logInfo();58 QString logInfo();
50 void output(){};59 void output(){};
5160
52 //! the integration method: 1 = trapezoidal, max = 5!61 //! The method for computing the interpolation used for integrating.
53 int d_method;62 InterpolationMethod d_method;
54};63};
5564
56#endif65#endif
5766
=== modified file 'scidavis/src/Interpolation.cpp'
--- scidavis/src/Interpolation.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/Interpolation.cpp 2010-07-12 22:57:40 +0000
@@ -131,53 +131,15 @@
131 gsl_interp_accel_free (acc);131 gsl_interp_accel_free (acc);
132}132}
133133
134int Interpolation::sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y)134bool Interpolation::isDataAcceptable()
135{135{
136 if (!c || c->rtti() != QwtPlotItem::Rtti_PlotCurve)136 // GSL interpolation routines fail with division by zero on such data
137 return 0;137 for (int i=1; i<d_n; i++)
138138 if (d_x[i-1] == d_x[i]) {
139 int i_start = 0, i_end = c->dataSize();139 QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
140 for (int i = 0; i < i_end; i++)140 tr("Several data points have the same x value causing divisions by zero, operation aborted!"));
141 if (c->x(i) > start && i)141 return false;
142 {142 }
143 i_start = i - 1;143
144 break;144 return Filter::isDataAcceptable();
145 }
146 for (int i = i_end-1; i >= 0; i--)
147 if (c->x(i) < end && i < c->dataSize())
148 {
149 i_end = i + 1;
150 break;
151 }
152 int n = i_end - i_start + 1;
153 (*x) = new double[n];
154 (*y) = new double[n];
155 double *xtemp = new double[n];
156 double *ytemp = new double[n];
157
158 double pr_x;
159 int j=0;
160 for (int i = i_start; i <= i_end; i++)
161 {
162 xtemp[j] = c->x(i);
163 if (xtemp[j] == pr_x)
164 {
165 delete (*x);
166 delete (*y);
167 return -1;//this kind of data causes division by zero in GSL interpolation routines
168 }
169 pr_x = xtemp[j];
170 ytemp[j++] = c->y(i);
171 }
172 size_t *p = new size_t[n];
173 gsl_sort_index(p, xtemp, 1, n);
174 for (int i=0; i<n; i++)
175 {
176 (*x)[i] = xtemp[p[i]];
177 (*y)[i] = ytemp[p[i]];
178 }
179 delete[] xtemp;
180 delete[] ytemp;
181 delete[] p;
182 return n;
183}145}
184146
=== modified file 'scidavis/src/Interpolation.h'
--- scidavis/src/Interpolation.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/Interpolation.h 2010-07-12 22:57:40 +0000
@@ -46,10 +46,12 @@
46 void setMethod(int m);46 void setMethod(int m);
47 void setMethod(InterpolationMethod m){setMethod((int)m);};47 void setMethod(InterpolationMethod m){setMethod((int)m);};
4848
49protected:
50 virtual bool isDataAcceptable();
51
49private:52private:
50 void init(int m);53 void init(int m);
51 void calculateOutputData(double *x, double *y);54 void calculateOutputData(double *x, double *y);
52 int sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y);
5355
54 //! the interpolation method56 //! the interpolation method
55 int d_method;57 int d_method;
5658
=== modified file 'scidavis/src/LineDialog.cpp'
--- scidavis/src/LineDialog.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/LineDialog.cpp 2010-07-12 22:57:40 +0000
@@ -179,7 +179,7 @@
179 QGridLayout *gl1 = new QGridLayout();179 QGridLayout *gl1 = new QGridLayout();
180 gl1->addWidget(new QLabel( tr("X")), 0, 0);180 gl1->addWidget(new QLabel( tr("X")), 0, 0);
181 gl1->addWidget(xStartBox, 0, 1);181 gl1->addWidget(xStartBox, 0, 1);
182 gl1->addWidget(new QLabel(tr("To")), 1, 0);182 gl1->addWidget(new QLabel(tr("Y")), 1, 0);
183 gl1->addWidget(yStartBox, 1, 1);183 gl1->addWidget(yStartBox, 1, 1);
184 gb1->setLayout(gl1);184 gb1->setLayout(gl1);
185185
@@ -190,7 +190,7 @@
190 QGridLayout *gl2 = new QGridLayout();190 QGridLayout *gl2 = new QGridLayout();
191 gl2->addWidget(new QLabel( tr("X")), 0, 0);191 gl2->addWidget(new QLabel( tr("X")), 0, 0);
192 gl2->addWidget(xEndBox, 0, 1);192 gl2->addWidget(xEndBox, 0, 1);
193 gl2->addWidget(new QLabel(tr("To")), 1, 0);193 gl2->addWidget(new QLabel(tr("Y")), 1, 0);
194 gl2->addWidget(yEndBox, 1, 1);194 gl2->addWidget(yEndBox, 1, 1);
195 gb2->setLayout(gl2);195 gb2->setLayout(gl2);
196196
197197
=== modified file 'scidavis/src/LineProfileTool.h'
--- scidavis/src/LineProfileTool.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/LineProfileTool.h 2010-07-12 22:57:40 +0000
@@ -67,6 +67,7 @@
67 public:67 public:
68 //! Standard constructor.68 //! Standard constructor.
69 LineProfileTool(Graph *graph, int average_pixels);69 LineProfileTool(Graph *graph, int average_pixels);
70 virtual RTTI rtti() const { return LineProfile; }
70 void calculateLineProfile(const QPoint &start, const QPoint &end);71 void calculateLineProfile(const QPoint &start, const QPoint &end);
7172
72 signals:73 signals:
7374
=== modified file 'scidavis/src/Matrix.cpp'
--- scidavis/src/Matrix.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/Matrix.cpp 2010-07-12 22:57:40 +0000
@@ -421,11 +421,18 @@
421 script->setInt(col+1, "col");421 script->setInt(col+1, "col");
422 script->setDouble(xStart()+col*dx, "x");422 script->setDouble(xStart()+col*dx, "x");
423 ret = script->eval();423 ret = script->eval();
424 if (!ret.isValid()) {
425 forgetSavedCells();
426 blockSignals(false);
427 emit modifiedWindow(this);
428 QApplication::restoreOverrideCursor();
429 return false;
430 }
424 setCell(row, col, ret.toDouble());431 setCell(row, col, ret.toDouble());
425 }432 }
426 forgetSavedCells();433 forgetSavedCells();
427434
428 this->blockSignals(false);435 blockSignals(false);
429 emit modifiedWindow(this);436 emit modifiedWindow(this);
430 QApplication::restoreOverrideCursor();437 QApplication::restoreOverrideCursor();
431 return true;438 return true;
432439
=== modified file 'scidavis/src/MuParserScript.cpp'
--- scidavis/src/MuParserScript.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/MuParserScript.cpp 2010-07-12 22:57:40 +0000
@@ -232,12 +232,7 @@
232/**232/**
233 * \brief Implements column() function for tables.233 * \brief Implements column() function for tables.
234 *234 *
235 * \arg \c columnPath Path to the column to read data from.235 * \arg \c columnPath Path to the column to read data from. See resolveColumnPath().
236 * Currently, only "column" (referring to the named column of the current table) and
237 * "table/column" (referring to the name column of the named table somewhere in the project)
238 * are supported. A future version of SciDAVis will allow table names to be non-unique across
239 * different folders, at which point this argument is planned to be extended to a full path
240 * specification; either absolute (starting with "/") or relative to the current Aspect.
241 *236 *
242 * The row to read from is determined by the muParser variable "i" set during iteration of a column237 * The row to read from is determined by the muParser variable "i" set during iteration of a column
243 * formula. For explicitly specifying the row, use cell() instead.238 * formula. For explicitly specifying the row, use cell() instead.
@@ -481,8 +476,8 @@
481 * - col(arg) with column("arg") if the current table contains a column named "arg" and476 * - col(arg) with column("arg") if the current table contains a column named "arg" and
482 * with column_(arg) otherwise477 * with column_(arg) otherwise
483 * - col("name", row) with cell("name", row)478 * - col("name", row) with cell("name", row)
484 * - col(arg, row) with column("arg", row) if the current table contains a column named "arg" and479 * - col(arg, row) with cell("arg", row) if the current table contains a column named "arg" and
485 * with column_(arg, row) otherwise480 * with cell_(arg, row) otherwise
486 * - tablecol("tableName", "columnName") with column("tableName/columnName")481 * - tablecol("tableName", "columnName") with column("tableName/columnName")
487 * - tablecol("tableName", columnIndex) with column__("tableName", columnIndex)482 * - tablecol("tableName", columnIndex) with column__("tableName", columnIndex)
488 * - cell(columnIndex, rowIndex) with cell_(columnIndex, rowIndex)483 * - cell(columnIndex, rowIndex) with cell_(columnIndex, rowIndex)
@@ -650,7 +645,26 @@
650 QString intermediate = Code.trimmed(); // pre-processed version of #Code645 QString intermediate = Code.trimmed(); // pre-processed version of #Code
651646
652 // remove comments647 // remove comments
653 intermediate.remove(QRegExp("#[^\n]*(\n|$)"));648 bool inString = false;
649 int commentStart = -1;
650 for (int i=0; i<intermediate.size(); i++)
651 switch (intermediate.at(i).toAscii()) {
652 case '"':
653 if (commentStart < 0) inString = !inString;
654 break;
655 case '#':
656 if (!inString) commentStart = i;
657 break;
658 case '\n':
659 if (commentStart >= 0) {
660 intermediate.remove(commentStart, i-commentStart);
661 i = commentStart;
662 commentStart = -1;
663 }
664 break;
665 }
666 if (commentStart >= 0)
667 intermediate.remove(commentStart, intermediate.size()-commentStart);
654668
655 // simplify statement separators669 // simplify statement separators
656 intermediate.replace(QRegExp("([;\\n]\\s*)+"),"; ");670 intermediate.replace(QRegExp("([;\\n]\\s*)+"),"; ");
657671
=== modified file 'scidavis/src/MuParserScripting.cpp'
--- scidavis/src/MuParserScripting.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/MuParserScripting.cpp 2010-07-12 22:57:40 +0000
@@ -44,53 +44,53 @@
44// functions without function pointer (fun1,fun2,fun3 == NULL,NULL,NULL) are implemented44// functions without function pointer (fun1,fun2,fun3 == NULL,NULL,NULL) are implemented
45// in mu::Parser45// in mu::Parser
46const MuParserScripting::mathFunction MuParserScripting::math_functions[] = {46const MuParserScripting::mathFunction MuParserScripting::math_functions[] = {
47 { "abs", 1, NULL,NULL,NULL, "abs(x):\n Absolute value of x." },47 { "abs", 1, NULL,NULL,NULL, QT_TR_NOOP("abs(x):\n Absolute value of x.") },
48 { "acos", 1, NULL,NULL,NULL, "acos(x):\n Inverse cos function." },48 { "acos", 1, NULL,NULL,NULL, QT_TR_NOOP("acos(x):\n Inverse cos function.") },
49 { "acosh", 1, NULL,NULL,NULL, "acosh(x):\n Hyperbolic inverse cos function." },49 { "acosh", 1, NULL,NULL,NULL, QT_TR_NOOP("acosh(x):\n Hyperbolic inverse cos function.") },
50 { "asin", 1, NULL,NULL,NULL, "asin(x):\n Inverse sin function." },50 { "asin", 1, NULL,NULL,NULL, QT_TR_NOOP("asin(x):\n Inverse sin function.") },
51 { "asinh", 1, NULL,NULL,NULL, "asinh(x):\n Hyperbolic inverse sin function." },51 { "asinh", 1, NULL,NULL,NULL, QT_TR_NOOP("asinh(x):\n Hyperbolic inverse sin function.") },
52 { "atan", 1, NULL,NULL,NULL, "atan(x):\n Inverse tan function." },52 { "atan", 1, NULL,NULL,NULL, QT_TR_NOOP("atan(x):\n Inverse tan function.") },
53 { "atanh", 1, NULL,NULL,NULL, "atanh(x):\n Hyperbolic inverse tan function." },53 { "atanh", 1, NULL,NULL,NULL, QT_TR_NOOP("atanh(x):\n Hyperbolic inverse tan function.") },
54 { "avg", -1, NULL,NULL,NULL, "avg(x,y,...):\n Mean value of all arguments." },54 { "avg", -1, NULL,NULL,NULL, QT_TR_NOOP("avg(x,y,...):\n Mean value of all arguments.") },
55 { "bessel_j0", 1, bessel_J0,NULL,NULL, "bessel_j0(x):\n Regular cylindrical Bessel function of zeroth order, J_0(x)." },55 { "bessel_j0", 1, bessel_J0,NULL,NULL, QT_TR_NOOP("bessel_j0(x):\n Regular cylindrical Bessel function of zeroth order, J_0(x).") },
56 { "bessel_j1", 1, bessel_J1,NULL,NULL, "bessel_j1(x):\n Regular cylindrical Bessel function of first order, J_1(x)." },56 { "bessel_j1", 1, bessel_J1,NULL,NULL, QT_TR_NOOP("bessel_j1(x):\n Regular cylindrical Bessel function of first order, J_1(x).") },
57 { "bessel_jn", 2, NULL,bessel_Jn,NULL, "bessel_jn(double x, int n):\n Regular cylindrical Bessel function of order n, J_n(x)." },57 { "bessel_jn", 2, NULL,bessel_Jn,NULL, QT_TR_NOOP("bessel_jn(double x, int n):\n Regular cylindrical Bessel function of order n, J_n(x).") },
58 { "bessel_jn_zero", 2, NULL,bessel_Jn_zero,NULL, "bessel_jn_zero(double n, unsigned int s):\n s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0" },58 { "bessel_jn_zero", 2, NULL,bessel_Jn_zero,NULL, QT_TR_NOOP("bessel_jn_zero(double n, unsigned int s):\n s-th positive zero x_s of regular cylindrical Bessel function of order n, J_n(x_s)=0") },
59 { "bessel_y0", 1, bessel_Y0, NULL,NULL, "bessel_y0(x):\n Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0." },59 { "bessel_y0", 1, bessel_Y0, NULL,NULL, QT_TR_NOOP("bessel_y0(x):\n Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0.") },
60 { "bessel_y1", 1, bessel_Y1, NULL,NULL, "bessel_y1(x):\n Irregular cylindrical Bessel function of first order, Y_1(x), for x>0." },60 { "bessel_y1", 1, bessel_Y1, NULL,NULL, QT_TR_NOOP("bessel_y1(x):\n Irregular cylindrical Bessel function of first order, Y_1(x), for x>0.") },
61 { "bessel_yn", 2, NULL,bessel_Yn,NULL, "bessel_yn(double x, int n):\n Irregular cylindrical Bessel function of order n, Y_n(x), for x>0." },61 { "bessel_yn", 2, NULL,bessel_Yn,NULL, QT_TR_NOOP("bessel_yn(double x, int n):\n Irregular cylindrical Bessel function of order n, Y_n(x), for x>0.") },
62 { "beta", 2, NULL,beta,NULL, "beta(a,b):\n Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0." },62 { "beta", 2, NULL,beta,NULL, QT_TR_NOOP("beta(a,b):\n Computes the Beta Function, B(a,b) = Gamma(a)*Gamma(b)/Gamma(a+b) for a > 0, b > 0.") },
63 { "ceil", 1, ceil,NULL,NULL, "ceil(x):\n Round to the next larger integer,\n smallest integer larger or equal to x." },63 { "ceil", 1, ceil,NULL,NULL, QT_TR_NOOP("ceil(x):\n Round to the next larger integer,\n smallest integer larger or equal to x.") },
64 { "cos", 1, NULL,NULL,NULL, "cos(x):\n Calculate cosine." },64 { "cos", 1, NULL,NULL,NULL, QT_TR_NOOP("cos(x):\n Calculate cosine.") },
65 { "cosh", 1, NULL,NULL,NULL, "cosh(x):\n Hyperbolic cos function." },65 { "cosh", 1, NULL,NULL,NULL, QT_TR_NOOP("cosh(x):\n Hyperbolic cos function.") },
66 { "erf", 1, erf, NULL,NULL, "erf(x):\n The error function." },66 { "erf", 1, erf, NULL,NULL, QT_TR_NOOP("erf(x):\n The error function.") },
67 { "erfc", 1, erfc, NULL,NULL, "erfc(x):\n Complementary error function erfc(x) = 1 - erf(x)." },67 { "erfc", 1, erfc, NULL,NULL, QT_TR_NOOP("erfc(x):\n Complementary error function erfc(x) = 1 - erf(x).") },
68 { "erfz", 1, erf_Z, NULL,NULL, "erfz(x):\n The Gaussian probability density function Z(x)." },68 { "erfz", 1, erf_Z, NULL,NULL, QT_TR_NOOP("erfz(x):\n The Gaussian probability density function Z(x).") },
69 { "erfq", 1, erf_Q, NULL,NULL, "erfq(x):\n The upper tail of the Gaussian probability function Q(x)." },69 { "erfq", 1, erf_Q, NULL,NULL, QT_TR_NOOP("erfq(x):\n The upper tail of the Gaussian probability function Q(x).") },
70 { "exp", 1, NULL,NULL,NULL, "exp(x):\n Exponential function: e raised to the power of x." },70 { "exp", 1, NULL,NULL,NULL, QT_TR_NOOP("exp(x):\n Exponential function: e raised to the power of x.") },
71 { "floor", 1, floor,NULL,NULL, "floor(x):\n Round to the next smaller integer,\n largest integer smaller or equal to x." },71 { "floor", 1, floor,NULL,NULL, QT_TR_NOOP("floor(x):\n Round to the next smaller integer,\n largest integer smaller or equal to x.") },
72 { "gamma", 1, gamma, NULL,NULL, "gamma(x):\n Computes the Gamma function, subject to x not being a negative integer." },72 { "gamma", 1, gamma, NULL,NULL, QT_TR_NOOP("gamma(x):\n Computes the Gamma function, subject to x not being a negative integer.") },
73 { "gammaln", 1, lngamma,NULL,NULL, "gammaln(x):\n Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned." },73 { "gammaln", 1, lngamma,NULL,NULL, QT_TR_NOOP("gammaln(x):\n Computes the logarithm of the Gamma function, subject to x not a being negative integer. For x<0, log(|Gamma(x)|) is returned.") },
74 { "hazard", 1, hazard,NULL,NULL, "hazard(x):\n Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x)." },74 { "hazard", 1, hazard,NULL,NULL, QT_TR_NOOP("hazard(x):\n Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x).") },
75 { "if", 3, NULL,NULL,NULL, "if(e1, e2, e3):\n if e1 then e2 else e3." },75 { "if", 3, NULL,NULL,NULL, QT_TR_NOOP("if(e1, e2, e3):\n if e1 then e2 else e3.") },
76 { "ln", 1, NULL,NULL,NULL, "ln(x):\n Calculate natural logarithm log_e." },76 { "ln", 1, NULL,NULL,NULL, QT_TR_NOOP("ln(x):\n Calculate natural logarithm log_e.") },
77 { "log", 1, NULL,NULL,NULL, "log(x):\n Calculate decimal logarithm log_10." },77 { "log", 1, NULL,NULL,NULL, QT_TR_NOOP("log(x):\n Calculate decimal logarithm log_10.") },
78 { "log10", 1, NULL,NULL,NULL, "log10(x):\n Calculate decimal logarithm log_10." },78 { "log10", 1, NULL,NULL,NULL, QT_TR_NOOP("log10(x):\n Calculate decimal logarithm log_10.") },
79 { "log2", 1, NULL,NULL,NULL, "log2(x):\n Calculate binary logarithm log_2." },79 { "log2", 1, NULL,NULL,NULL, QT_TR_NOOP("log2(x):\n Calculate binary logarithm log_2.") },
80 { "min", -1, NULL,NULL,NULL, "min(x,y,...):\n Calculate minimum of all arguments." },80 { "min", -1, NULL,NULL,NULL, QT_TR_NOOP("min(x,y,...):\n Calculate minimum of all arguments.") },
81 { "max", -1, NULL,NULL,NULL, "max(x,y,...):\n Calculate maximum of all arguments." },81 { "max", -1, NULL,NULL,NULL, QT_TR_NOOP("max(x,y,...):\n Calculate maximum of all arguments.") },
82 { "mod", 2, NULL,mod,NULL, "mod(x,y):\n Calculate rest of integer division x/y,\n x modulo y." },82 { "mod", 2, NULL,mod,NULL, QT_TR_NOOP("mod(x,y):\n Calculate rest of integer division x/y,\n x modulo y.") },
83 { "pow", 2, NULL,mypow,NULL, "pow(x,y):\n Raise x to the power of y, x^y." },83 { "pow", 2, NULL,mypow,NULL, QT_TR_NOOP("pow(x,y):\n Raise x to the power of y, x^y.") },
84 { "rint", 1, NULL,NULL,NULL, "rint(x):\n Round to nearest integer." },84 { "rint", 1, NULL,NULL,NULL, QT_TR_NOOP("rint(x):\n Round to nearest integer.") },
85 { "sign", 1, NULL,NULL,NULL, "sign(x):\n Sign function: -1 if x<0; 1 if x>0." },85 { "sign", 1, NULL,NULL,NULL, QT_TR_NOOP("sign(x):\n Sign function: -1 if x<0; 1 if x>0.") },
86 { "sin", 1, NULL,NULL,NULL, "sin(x):\n Calculate sine." },86 { "sin", 1, NULL,NULL,NULL, QT_TR_NOOP("sin(x):\n Calculate sine.") },
87 { "sinh", 1, NULL,NULL,NULL, "sinh(x):\n Hyperbolic sin function." },87 { "sinh", 1, NULL,NULL,NULL, QT_TR_NOOP("sinh(x):\n Hyperbolic sin function.") },
88 { "sqrt", 1, NULL,NULL,NULL, "sqrt(x):\n Square root function." },88 { "sqrt", 1, NULL,NULL,NULL, QT_TR_NOOP("sqrt(x):\n Square root function.") },
89 { "sum", -1, NULL,NULL,NULL, "sum(x,y,...):\n Calculate sum of all arguments." },89 { "sum", -1, NULL,NULL,NULL, QT_TR_NOOP("sum(x,y,...):\n Calculate sum of all arguments.") },
90 { "tan", 1, NULL,NULL,NULL, "tan(x):\n Calculate tangent function." },90 { "tan", 1, NULL,NULL,NULL, QT_TR_NOOP("tan(x):\n Calculate tangent function.") },
91 { "tanh", 1, NULL,NULL,NULL, "tanh(x):\n Hyperbolic tan function." },91 { "tanh", 1, NULL,NULL,NULL, QT_TR_NOOP("tanh(x):\n Hyperbolic tan function.") },
92 { "w0", 1, lambert_W0, NULL, NULL, "w0(x):\n Compute the principal branch of Lambert's W function, W_0(x).\n W is defined as a solution to the equation W(x)*exp(W(x))=x.\n For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x))." },92 { "w0", 1, lambert_W0, NULL, NULL, QT_TR_NOOP("w0(x):\n Compute the principal branch of Lambert's W function, W_0(x).\n W is defined as a solution to the equation W(x)*exp(W(x))=x.\n For x<0, there are two real-valued branches; this function computes the one where W>-1 for x<0 (also see wm1(x)).") },
93 { "wm1", 1, lambert_Wm1, NULL, NULL, "wm1(x):\n Compute the secondary branch of Lambert's W function, W_{-1}(x).\n W is defined as a solution to the equation W(x)*exp(W(x))=x.\n For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x))." },93 { "wm1", 1, lambert_Wm1, NULL, NULL, QT_TR_NOOP("wm1(x):\n Compute the secondary branch of Lambert's W function, W_{-1}(x).\n W is defined as a solution to the equation W(x)*exp(W(x))=x.\n For x<0, there are two real-valued branches; this function computes the one where W<-1 for x<0. (also see w0(x)).") },
94 {0,0,NULL,NULL,NULL,0}94 {0,0,NULL,NULL,NULL,0}
95};95};
96 96
@@ -106,6 +106,6 @@
106{106{
107 for (const mathFunction *i=math_functions; i->name; i++)107 for (const mathFunction *i=math_functions; i->name; i++)
108 if (name==i->name)108 if (name==i->name)
109 return i->description;109 return tr(i->description);
110 return QString::null;110 return QString::null;
111}111}
112112
=== modified file 'scidavis/src/MuParserScripting.h'
--- scidavis/src/MuParserScripting.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/MuParserScripting.h 2010-07-12 22:57:40 +0000
@@ -76,7 +76,7 @@
76 double (*fun1)(double);76 double (*fun1)(double);
77 double (*fun2)(double,double);77 double (*fun2)(double,double);
78 double (*fun3)(double,double,double);78 double (*fun3)(double,double,double);
79 char *description;79 QString description;
80 };80 };
81 static const mathFunction math_functions[];81 static const mathFunction math_functions[];
8282
8383
=== modified file 'scidavis/src/MultiLayer.cpp'
--- scidavis/src/MultiLayer.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/MultiLayer.cpp 2010-07-12 22:57:40 +0000
@@ -123,6 +123,7 @@
123 layout->addWidget(canvas, 1);123 layout->addWidget(canvas, 1);
124 layout->setMargin(0);124 layout->setMargin(0);
125 layout->setSpacing(0);125 layout->setSpacing(0);
126 setMinimumHeight(50);
126 setGeometry(QRect( 0, 0, graph_width, graph_height ));127 setGeometry(QRect( 0, 0, graph_width, graph_height ));
127 setFocusPolicy(Qt::StrongFocus);128 setFocusPolicy(Qt::StrongFocus);
128}129}
129130
=== modified file 'scidavis/src/MultiLayer.h'
--- scidavis/src/MultiLayer.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/MultiLayer.h 2010-07-12 22:57:40 +0000
@@ -71,6 +71,7 @@
71 MultiLayer (const QString& label, QWidget* parent=0, const char* name=0, Qt::WFlags f=0);71 MultiLayer (const QString& label, QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
72 QWidgetList graphPtrs(){return graphsList;};72 QWidgetList graphPtrs(){return graphsList;};
73 Graph *layer(int num);73 Graph *layer(int num);
74 QWidgetList layerWidgets() const { return graphsList; }
74 LayerButton* addLayerButton();75 LayerButton* addLayerButton();
75 void copy(ApplicationWindow * parent, MultiLayer* ml);76 void copy(ApplicationWindow * parent, MultiLayer* ml);
7677
7778
=== modified file 'scidavis/src/MultiPeakFitTool.h'
--- scidavis/src/MultiPeakFitTool.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/MultiPeakFitTool.h 2010-07-12 22:57:40 +0000
@@ -52,6 +52,7 @@
52 Q_OBJECT52 Q_OBJECT
53 public:53 public:
54 MultiPeakFitTool(Graph *graph, ApplicationWindow *app, MultiPeakFit::PeakProfile profile, int num_peaks, const QObject *status_target, const char *status_slot);54 MultiPeakFitTool(Graph *graph, ApplicationWindow *app, MultiPeakFit::PeakProfile profile, int num_peaks, const QObject *status_target, const char *status_slot);
55 virtual RTTI rtti() const { return MultiPeak; }
55 virtual ~MultiPeakFitTool();56 virtual ~MultiPeakFitTool();
56 signals:57 signals:
57 /*! Emitted whenever a new message should be presented to the user.58 /*! Emitted whenever a new message should be presented to the user.
5859
=== modified file 'scidavis/src/Plot3DDialog.cpp'
--- scidavis/src/Plot3DDialog.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/Plot3DDialog.cpp 2010-07-12 22:57:40 +0000
@@ -35,6 +35,7 @@
35#include <QLineEdit>35#include <QLineEdit>
36#include <QLayout>36#include <QLayout>
37#include <QSpinBox>37#include <QSpinBox>
38#include <QDoubleSpinBox>
38#include <QPushButton>39#include <QPushButton>
39#include <QLabel>40#include <QLabel>
40#include <QStackedWidget>41#include <QStackedWidget>
@@ -325,26 +326,30 @@
325326
326 QGridLayout *gl2 = new QGridLayout();327 QGridLayout *gl2 = new QGridLayout();
327 gl2->addWidget(new QLabel(tr( "Zoom (%)" )), 0, 0);328 gl2->addWidget(new QLabel(tr( "Zoom (%)" )), 0, 0);
328 boxZoom = new QSpinBox();329 boxZoom = new QDoubleSpinBox();
329 boxZoom->setRange(1, 10000);330 boxZoom->setMinimum(0);
331 boxZoom->setMaximum(1e15);
330 boxZoom->setSingleStep(10);332 boxZoom->setSingleStep(10);
331333
332 gl2->addWidget(boxZoom, 0, 1);334 gl2->addWidget(boxZoom, 0, 1);
333 gl2->addWidget(new QLabel(tr( "X Zoom (%)" )), 1, 0);335 gl2->addWidget(new QLabel(tr( "X Zoom (%)" )), 1, 0);
334 boxXScale = new QSpinBox();336 boxXScale = new QDoubleSpinBox();
335 boxXScale->setRange(1, 10000);337 boxXScale->setMinimum(0);
338 boxXScale->setMaximum(1e15);
336 boxXScale->setSingleStep(10);339 boxXScale->setSingleStep(10);
337 gl2->addWidget(boxXScale, 1, 1);340 gl2->addWidget(boxXScale, 1, 1);
338341
339 gl2->addWidget(new QLabel(tr( "Y Zoom (%)" )), 2, 0);342 gl2->addWidget(new QLabel(tr( "Y Zoom (%)" )), 2, 0);
340 boxYScale = new QSpinBox();343 boxYScale = new QDoubleSpinBox();
341 boxYScale->setRange(1, 10000);344 boxYScale->setMinimum(0);
345 boxYScale->setMaximum(1e15);
342 boxYScale->setSingleStep(10);346 boxYScale->setSingleStep(10);
343 gl2->addWidget(boxYScale, 2, 1);347 gl2->addWidget(boxYScale, 2, 1);
344348
345 gl2->addWidget(new QLabel(tr( "Z Zoom (%)" )), 3, 0);349 gl2->addWidget(new QLabel(tr( "Z Zoom (%)" )), 3, 0);
346 boxZScale = new QSpinBox();350 boxZScale = new QDoubleSpinBox();
347 boxZScale->setRange(1, 10000);351 boxZScale->setMinimum(0);
352 boxZScale->setMaximum(1e15);
348 boxZScale->setSingleStep(10);353 boxZScale->setSingleStep(10);
349 gl2->addWidget(boxZScale, 3, 1);354 gl2->addWidget(boxZScale, 3, 1);
350 gl2->setRowStretch(4, 1);355 gl2->setRowStretch(4, 1);
@@ -365,10 +370,10 @@
365 connect( boxMeshLineWidth, SIGNAL(valueChanged(int)), this, SIGNAL(updateMeshLineWidth(int)));370 connect( boxMeshLineWidth, SIGNAL(valueChanged(int)), this, SIGNAL(updateMeshLineWidth(int)));
366 connect( boxOrthogonal, SIGNAL(toggled(bool)), this, SIGNAL(setOrtho(bool)));371 connect( boxOrthogonal, SIGNAL(toggled(bool)), this, SIGNAL(setOrtho(bool)));
367 connect( boxLegend, SIGNAL(toggled(bool)), this, SIGNAL(showColorLegend(bool)));372 connect( boxLegend, SIGNAL(toggled(bool)), this, SIGNAL(showColorLegend(bool)));
368 connect( boxZoom, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));373 connect( boxZoom, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
369 connect( boxXScale, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));374 connect( boxXScale, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
370 connect( boxYScale, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));375 connect( boxYScale, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
371 connect( boxZScale, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));376 connect( boxZScale, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
372 connect( btnNumbersFont, SIGNAL(clicked()), this, SLOT(pickNumbersFont() ) );377 connect( btnNumbersFont, SIGNAL(clicked()), this, SLOT(pickNumbersFont() ) );
373}378}
374379
@@ -756,13 +761,13 @@
756 boxLegend->setChecked(show);761 boxLegend->setChecked(show);
757}762}
758763
759void Plot3DDialog::changeZoom(int)764void Plot3DDialog::changeZoom(double)
760{765{
761 if (generalDialog->currentWidget() != (QWidget*)general)766 if (generalDialog->currentWidget() != (QWidget*)general)
762 return;767 return;
763768
764 emit updateZoom(boxZoom->value()*0.01);769 emit updateZoom(boxZoom->value()*0.01);
765 emit updateScaling(boxXScale->value()*0.01,boxYScale->value()*0.01,770 emit updateScaling(boxXScale->value(),boxYScale->value()*0.01,
766 boxZScale->value()*0.01);771 boxZScale->value()*0.01);
767}772}
768773
@@ -881,7 +886,7 @@
881QStringList Plot3DDialog::scaleOptions(int axis, double start, double end,886QStringList Plot3DDialog::scaleOptions(int axis, double start, double end,
882 const QString& majors, const QString& minors)887 const QString& majors, const QString& minors)
883{888{
884 Q_ASSERT(0 <= axis < scales.size()/5 - 1);889 Q_ASSERT(0 <= axis); Q_ASSERT(5*axis+4 < scales.size());
885 QStringList l;890 QStringList l;
886 l<<QString::number(start);891 l<<QString::number(start);
887 l<<QString::number(end);892 l<<QString::number(end);
@@ -970,14 +975,14 @@
970975
971void Plot3DDialog::setZoom(double zoom)976void Plot3DDialog::setZoom(double zoom)
972{977{
973 boxZoom->setValue(int(zoom*100));978 boxZoom->setValue(zoom*100);
974}979}
975980
976void Plot3DDialog::setScaling(double xVal, double yVal, double zVal)981void Plot3DDialog::setScaling(double xVal, double yVal, double zVal)
977{982{
978 boxXScale->setValue(int(xVal*100));983 boxXScale->setValue(xVal*100);
979 boxYScale->setValue(int(yVal*100));984 boxYScale->setValue(yVal*100);
980 boxZScale->setValue(int(zVal*100));985 boxZScale->setValue(zVal*100);
981}986}
982987
983void Plot3DDialog::showGeneralTab()988void Plot3DDialog::showGeneralTab()
984989
=== modified file 'scidavis/src/Plot3DDialog.h'
--- scidavis/src/Plot3DDialog.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/Plot3DDialog.h 2010-07-12 22:57:40 +0000
@@ -39,6 +39,7 @@
39class QPushButton;39class QPushButton;
40class QRadioButton;40class QRadioButton;
41class QSpinBox;41class QSpinBox;
42class QDoubleSpinBox;
42class QTabWidget;43class QTabWidget;
43class QWidget;44class QWidget;
44class QStringList;45class QStringList;
@@ -117,7 +118,7 @@
117 void showAxisTab();118 void showAxisTab();
118 119
119 void initPointsOptionsStack();120 void initPointsOptionsStack();
120 void changeZoom(int);121 void changeZoom(double);
121 void changeTransparency(int val);122 void changeTransparency(int val);
122123
123 void showLowerGreek();124 void showLowerGreek();
@@ -182,7 +183,8 @@
182 QListWidget *axesList, *axesList2;183 QListWidget *axesList, *axesList2;
183 QComboBox *boxType, *boxPointStyle;184 QComboBox *boxType, *boxPointStyle;
184 QLineEdit *boxMajorLength, *boxMinorLength, *boxConesRad;185 QLineEdit *boxMajorLength, *boxMinorLength, *boxConesRad;
185 QSpinBox *boxZoom, *boxXScale, *boxYScale, *boxZScale, *boxQuality;186 QDoubleSpinBox *boxZoom, *boxXScale, *boxYScale, *boxZScale;
187 QSpinBox *boxQuality;
186 QLineEdit *boxSize, *boxBarsRad, *boxCrossRad, *boxCrossLinewidth;188 QLineEdit *boxSize, *boxBarsRad, *boxCrossRad, *boxCrossLinewidth;
187 QStackedWidget *optionStack;189 QStackedWidget *optionStack;
188 QWidget *dotsPage, *conesPage, *crossPage;190 QWidget *dotsPage, *conesPage, *crossPage;
189191
=== modified file 'scidavis/src/PlotCurve.cpp'
--- scidavis/src/PlotCurve.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/PlotCurve.cpp 2010-07-12 22:57:40 +0000
@@ -29,6 +29,7 @@
29#include "PlotCurve.h"29#include "PlotCurve.h"
30#include "ScaleDraw.h"30#include "ScaleDraw.h"
31#include "core/column/Column.h"31#include "core/column/Column.h"
32#include "core/datatypes/DateTime2StringFilter.h"
32#include <QDateTime>33#include <QDateTime>
33#include <QMessageBox>34#include <QMessageBox>
34#include <qwt_symbol.h>35#include <qwt_symbol.h>
@@ -116,190 +117,187 @@
116 return true;117 return true;
117}118}
118119
119void DataCurve::loadData()120QList< QVector<double> > DataCurve::convertData(const QList<Column*> &cols, const QList<int> &axes) const {
121 Graph *g = 0;
122 if (plot())
123 g = static_cast<Graph*>(plot()->parent());
124
125 int end_row = d_end_row;
126 // make sure end_row is a valid index for all columns
127 foreach(Column *col, cols)
128 if (end_row >= col->rowCount())
129 end_row = col->rowCount() - 1;
130
131 // determine rows for which all columns have valid content
132 QList<int> valid_rows;
133 for (int row = d_start_row; row <= end_row; row++) {
134 bool all_valid = true;
135 foreach(Column *col, cols)
136 if (col->isInvalid(row)) {
137 all_valid = false;
138 break;
139 }
140 if (all_valid)
141 valid_rows.push_back(row);
142 }
143
144 // initialize result list
145 QList< QVector<double> > result;
146 for (int i=0; i<cols.size(); i++)
147 result.push_back(QVector<double>(valid_rows.size()));
148
149 // For date and time (but not DateTime) values, numbers are relative to the first valid row's
150 // content. We can't change this easily without breaking backwards compatibility (think of
151 // scale ranges, placement of labels and arrows etc).
152 QList<QDate> reference_dates;
153 QList<QTime> reference_times;
154 for(int i=0; i<cols.size(); i++) {
155 Column *col = cols[i];
156
157 switch (col->columnMode()) {
158 case Table::Time:
159 {
160 QTime time;
161 QString format;
162 if (g && g->axesType()[axes[i]] == Table::Time) {
163 QStringList lst = g->axisFormatInfo(axes[i]).split(";");
164 time = QTime::fromString(lst[0]);
165 if (lst.size() >= 2) format = lst[1];
166 }
167 if (!time.isValid()) {
168 foreach (int row, valid_rows) {
169 time = col->timeAt(row);
170 if (time.isValid()) break;
171 }
172 }
173
174 if (format.isEmpty())
175 format = static_cast<DateTime2StringFilter *>(col->outputFilter())->format();
176
177 reference_dates.push_back(QDate());
178 reference_times.push_back(time);
179 if (g)
180 g->setLabelsDateTimeFormat(axes[i], Graph::Time, time.toString() + ";" + format);
181 break;
182 }
183 case Table::Date:
184 {
185 QDate date;
186 QString format;
187
188 if (g && g->axesType()[axes[i]] == Table::Time) {
189 QStringList lst = g->axisFormatInfo(axes[i]).split(";");
190 date = QDate::fromString(lst[0], "YYYY-MM-DD");
191 if (lst.size() >= 2) format = lst[1];
192 }
193
194 if (!date.isValid()) {
195 foreach (int row, valid_rows) {
196 date = col->dateAt(row);
197 if (date.isValid()) break;
198 }
199 }
200
201 if (format.isEmpty())
202 format = static_cast<DateTime2StringFilter *>(col->outputFilter())->format();
203
204 reference_dates.push_back(date);
205 reference_times.push_back(QTime());
206 if (g)
207 g->setLabelsDateTimeFormat(axes[i], Graph::Date, date.toString("YYYY-MM-DD") + ";" + format);
208 break;
209 }
210 case Table::DateTime:
211 {
212 QDateTime datetime;
213 QString format;
214
215 if (g && g->axesType()[axes[i]] == Table::DateTime) {
216 QStringList lst = g->axisFormatInfo(axes[i]).split(";");
217 datetime = QDateTime::fromString(lst[0], "YYYY-MM-DDTHH:MM:SS");
218 if (lst.size() >= 2) format = lst[1];
219 }
220
221 if (!datetime.isValid()) {
222 foreach (int row, valid_rows) {
223 datetime = col->dateTimeAt(row);
224 if (datetime.isValid()) break;
225 }
226 }
227
228 if (format.isEmpty())
229 format = static_cast<DateTime2StringFilter *>(col->outputFilter())->format();
230
231 reference_dates.push_back(QDate());
232 reference_times.push_back(QTime());
233 if (g)
234 g->setLabelsDateTimeFormat(axes[i], Graph::DateTime, datetime.toString("YYYY-MM-DDTHH:MM:SS") + ";" + format);
235 break;
236 }
237 case Table::Text:
238 if (g)
239 g->setLabelsTextFormat(axes[i], col, d_start_row, end_row);
240 reference_dates.push_back(QDate());
241 reference_times.push_back(QTime());
242 break;
243 default:
244 reference_dates.push_back(QDate());
245 reference_times.push_back(QTime());
246 break;
247 };
248 }
249
250 // convert data to numeric representation used for plotting
251 for (int i=0; i<valid_rows.size(); i++)
252 for (int j=0; j<cols.size(); j++)
253 switch (cols[j]->columnMode()) {
254 case Table::Text:
255 result[j][i] = static_cast<double>(valid_rows[i] + 1);
256 break;
257 case Table::Time:
258 result[j][i] = reference_times[j].msecsTo(cols[j]->timeAt(valid_rows[i]));
259 break;
260 case Table::Date:
261 result[j][i] = reference_dates[j].daysTo(cols[j]->dateAt(valid_rows[i]));
262 break;
263 case Table::DateTime:
264 {
265 QDateTime dt = cols[j]->dateTimeAt(valid_rows[i]);
266 result[j][i] = double(dt.date().toJulianDay()) +
267 double( -dt.time().msecsTo(QTime(12,0,0,0)) ) / 86400000.0;
268 break;
269 }
270 default:
271 result[j][i] = cols[j]->valueAt(valid_rows[i]);
272 break;
273 };
274
275 return result;
276}
277
278bool DataCurve::loadData()
120{279{
121 Graph *g = (Graph *)plot()->parent();280 Column *x_col_ptr = d_table->column(d_x_column);
122 if (!g)281 Column *y_col_ptr = d_table->column(title().text());
123 return;282 if (!x_col_ptr || !y_col_ptr) {
124283 remove();
125 int xcol = d_table->colIndex(d_x_column);284 return false;
126 int ycol = d_table->colIndex(title().text());285 }
127286
128 if (xcol < 0 || ycol < 0){287 QList< QVector<double> > points = convertData(
129 remove();288 d_type == Graph::HorizontalBars ? (QList<Column*>() << y_col_ptr << x_col_ptr) : (QList<Column*>() << x_col_ptr << y_col_ptr),
130 return;289 QList<int>() << xAxis() << yAxis());
131 }290
132 291 if (points.isEmpty() || points[0].size() == 0) {
133 Column *x_col_ptr = d_table->column(xcol);292 remove();
134 Column *y_col_ptr = d_table->column(ycol);293 return false;
135 294 }
136 int endRow = d_end_row;295
137 if (d_end_row >= x_col_ptr->rowCount())296 setData(points[0].data(), points[1].data(), points[0].size());
138 endRow = x_col_ptr->rowCount() - 1;297 foreach(DataCurve *c, d_error_bars)
139298 c->setData(points[0].data(), points[1].data(), points[0].size());
140 if (d_end_row >= y_col_ptr->rowCount())299
141 endRow = y_col_ptr->rowCount() - 1;300 return true;
142
143 int r = abs(endRow - d_start_row) + 1;
144 QVarLengthArray<double> X(r), Y(r);
145 int xColType = d_table->columnType(xcol);
146 int yColType = d_table->columnType(ycol);
147
148 QTime time0;
149 QDate date0;
150 QDateTime date_time0;
151 QString date_time_fmt = d_table->columnFormat(xcol);
152 if (xColType == Table::Time){
153 for (int row = d_start_row; row <= endRow; row++ ) {
154 if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
155 time0 = x_col_ptr->timeAt(row);
156 if (time0.isValid())
157 break;
158 }
159 }
160 } else if (xColType == Table::Date){
161 for (int row = d_start_row; row <= endRow; row++ ){
162 QString xval=d_table->text(row,xcol);
163 if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
164 date0 = x_col_ptr->dateAt(row);
165 if (date0.isValid())
166 break;
167 }
168 }
169 } else if (xColType == Table::DateTime){
170 for (int row = d_start_row; row <= endRow; row++ ){
171 QString xval=d_table->text(row,xcol);
172 if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
173 date_time0 = x_col_ptr->dateTimeAt(row);
174 if (date_time0.isValid())
175 break;
176 }
177 }
178 }
179
180 int size = 0;
181 for (int row = d_start_row; row <= endRow; row++ ) {
182 if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
183 if (xColType == Table::Text) {
184 X[size] = (double) (row + 1);
185 }
186 else if (xColType == Table::Time) {
187 QTime time = x_col_ptr->timeAt(row);
188 if (time.isValid())
189 X[size] = time0.msecsTo (time);
190 else
191 continue;
192 }
193 else if (xColType == Table::Date) {
194 QDate d = x_col_ptr->dateAt(row);
195 if (d.isValid())
196 X[size] = (double) date0.daysTo(d);
197 else
198 continue;
199 }
200 else if (xColType == Table::DateTime) {
201 QDateTime dt = x_col_ptr->dateTimeAt(row);
202 if (dt.isValid())
203 {
204 X[size] = double(dt.date().toJulianDay()) +
205 double( -dt.time().msecsTo(QTime(12,0,0,0)) ) / 86400000.0;
206 }
207 else
208 continue;
209 }
210 else
211 X[size] = x_col_ptr->valueAt(row);
212
213 if (yColType == Table::Text) {
214 Y[size] = (double) (row + 1);
215 }
216 else if (yColType == Table::Time) {
217 QTime yval = y_col_ptr->timeAt(row);
218 if (yval.isValid()) {
219 Y[size] = double( -yval.msecsTo(QTime(12,0,0,0)) );
220 }
221 else
222 Y[size] = 0.0;
223 }
224 else if (yColType == Table::Date) {
225 QDate yval = y_col_ptr->dateAt(row);
226 if (yval.isValid()) {
227 Y[size] = double( yval.toJulianDay() );
228 }
229 else
230 Y[size] = 0.0;
231 }
232 else if (yColType == Table::DateTime) {
233 QDateTime yval = y_col_ptr->dateTimeAt(row);
234 if (yval.isValid()) {
235 Y[size] = double(yval.date().toJulianDay()) +
236 double( -yval.time().msecsTo(QTime(12,0,0,0)) ) / 86400000.0;
237 }
238 else
239 Y[size] = 0.0;
240 }
241 else
242 Y[size] = y_col_ptr->valueAt(row);
243
244 size++;
245 }
246 }
247
248 X.resize(size);
249 Y.resize(size);
250
251 if (!size){
252 remove();
253 return;
254 } else {
255 if (d_type == Graph::HorizontalBars){
256 setData(Y.data(), X.data(), size);
257 foreach(DataCurve *c, d_error_bars)
258 c->setData(Y.data(), X.data(), size);
259 } else {
260 setData(X.data(), Y.data(), size);
261 foreach(DataCurve *c, d_error_bars)
262 c->setData(X.data(), Y.data(), size);
263 }
264
265 if (xColType == Table::Text){
266 g->setLabelsTextFormat(d_type == Graph::HorizontalBars ? QwtPlot::yLeft : QwtPlot::xBottom,
267 x_col_ptr, d_start_row, endRow);
268 } else if (xColType == Table::Time ){
269 if (d_type == Graph::HorizontalBars){
270 QStringList lst = g->axisFormatInfo(QwtPlot::yLeft).split(";");
271 QString fmtInfo = time0.toString() + ";" + lst[1];
272 g->setLabelsDateTimeFormat(QwtPlot::yLeft, Graph::Time, fmtInfo);
273 } else {
274 QStringList lst = g->axisFormatInfo(QwtPlot::xBottom).split(";");
275 QString fmtInfo = time0.toString() + ";" + lst[1];
276 g->setLabelsDateTimeFormat(QwtPlot::xBottom, Graph::Time, fmtInfo);
277 }
278 } else if (xColType == Table::Date ) {
279 if (d_type == Graph::HorizontalBars){
280 QStringList lst = g->axisFormatInfo(QwtPlot::yLeft).split(";");
281 QString fmtInfo = date0.toString("YYYY-MM-DD") + ";" + lst[1];
282 g->setLabelsDateTimeFormat(QwtPlot::yLeft, Graph::Date, fmtInfo);
283 } else {
284 QStringList lst = g->axisFormatInfo(QwtPlot::xBottom).split(";");
285 QString fmtInfo = date0.toString("YYYY-MM-DD") + ";" + lst[1];
286 g->setLabelsDateTimeFormat(QwtPlot::xBottom, Graph::Date, fmtInfo);
287 }
288 } else if (xColType == Table::DateTime ) {
289 if (d_type == Graph::HorizontalBars){
290 QStringList lst = g->axisFormatInfo(QwtPlot::yLeft).split(";");
291 QString fmtInfo = date_time0.toString("YYYY-MM-DDTHH:MM:SS") + ";" + lst[1];
292 g->setLabelsDateTimeFormat(QwtPlot::yLeft, Graph::DateTime, fmtInfo);
293 } else {
294 QStringList lst = g->axisFormatInfo(QwtPlot::xBottom).split(";");
295 QString fmtInfo = date_time0.toString("YYYY-MM-DDTHH:MM:SS") + ";" + lst[1];
296 g->setLabelsDateTimeFormat(QwtPlot::xBottom, Graph::DateTime, fmtInfo);
297 }
298 }
299
300 if (yColType == Table::Text)
301 g->setLabelsTextFormat(QwtPlot::yLeft, y_col_ptr, d_start_row, endRow);
302 }
303}301}
304302
305void DataCurve::removeErrorBars(DataCurve *c)303void DataCurve::removeErrorBars(DataCurve *c)
@@ -323,9 +321,9 @@
323321
324void DataCurve::remove()322void DataCurve::remove()
325{323{
324 if (!plot()) return;
326 Graph *g = (Graph *)plot()->parent();325 Graph *g = (Graph *)plot()->parent();
327 if (!g)326 if (!g) return;
328 return;
329327
330 g->removeCurve(title().text());328 g->removeCurve(title().text());
331}329}
332330
=== modified file 'scidavis/src/PlotCurve.h'
--- scidavis/src/PlotCurve.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/PlotCurve.h 2010-07-12 22:57:40 +0000
@@ -70,7 +70,8 @@
70 void setFullRange();70 void setFullRange();
7171
72 virtual bool updateData(Table *t, const QString& colName);72 virtual bool updateData(Table *t, const QString& colName);
73 virtual void loadData();73 virtual bool loadData();
74 QList< QVector<double> > convertData(const QList<Column*> &cols, const QList<int> &axes) const;
7475
75 //! Returns the row index in the data source table corresponding to the data point index.76 //! Returns the row index in the data source table corresponding to the data point index.
76 int tableRow(int point);77 int tableRow(int point);
7778
=== modified file 'scidavis/src/PlotToolInterface.h'
--- scidavis/src/PlotToolInterface.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/PlotToolInterface.h 2010-07-12 22:57:40 +0000
@@ -59,6 +59,9 @@
59class PlotToolInterface59class PlotToolInterface
60{60{
61 public:61 public:
62 enum RTTI { DataPicker, ScreenPicker, LineProfile, MultiPeak, RangeSelector, TranslateCurve };
63 virtual RTTI rtti() const = 0;
64
62 PlotToolInterface(Graph *graph) { d_graph = graph; }65 PlotToolInterface(Graph *graph) { d_graph = graph; }
63 virtual ~PlotToolInterface() {};66 virtual ~PlotToolInterface() {};
64 protected:67 protected:
6568
=== modified file 'scidavis/src/PythonScript.cpp'
--- scidavis/src/PythonScript.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/PythonScript.cpp 2010-07-12 22:57:40 +0000
@@ -70,14 +70,14 @@
70 PyDict_GetItemString(env()->globalDict(), "__builtins__"));70 PyDict_GetItemString(env()->globalDict(), "__builtins__"));
71 PyObject *ret = PyRun_String(71 PyObject *ret = PyRun_String(
72 "def col(c,*arg):\n"72 "def col(c,*arg):\n"
73 "\ttry: return self.cell(c,arg[0])\n"73 "\ttry: return self.column(type(c)==str and c or c-1).valueAt(arg[0]-1)\n"
74 "\texcept(IndexError): return self.cell(c,i)\n"74 "\texcept(IndexError): return self.column(type(c)==str and c or c-1).valueAt(i-1)\n"
75 "def cell(c,r):\n"75 "def cell(c,r):\n"
76 "\treturn self.cell(c,r)\n"76 "\treturn self.cell(c,r)\n"
77 "def tablecol(t,c):\n"77 "def tablecol(t,c):\n"
78 "\treturn self.folder().rootFolder().table(t,True).cell(c,i)\n"78 "\treturn self.folder().rootFolder().table(t,True).column(type(c)==str and c or c-1).valuetAt(i-1)\n"
79 "def _meth_table_col_(t,c):\n"79 "def _meth_table_col_(t,c):\n"
80 "\treturn t.cell(c,i)\n"80 "\treturn t.column(type(c)==str and c or c-1).valueAt(i-1)\n"
81 "self.__class__.col = _meth_table_col_",81 "self.__class__.col = _meth_table_col_",
82 Py_file_input, localDict, localDict);82 Py_file_input, localDict, localDict);
83 if (ret)83 if (ret)
8484
=== modified file 'scidavis/src/QwtErrorPlotCurve.cpp'
--- scidavis/src/QwtErrorPlotCurve.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/QwtErrorPlotCurve.cpp 2010-07-12 22:57:40 +0000
@@ -276,73 +276,34 @@
276 loadData();276 loadData();
277}277}
278278
279void QwtErrorPlotCurve::loadData()279bool QwtErrorPlotCurve::loadData()
280{280{
281 if (!d_master_curve)281 if (!d_master_curve) return false;
282 return;
283
284 Table *mt = d_master_curve->table();282 Table *mt = d_master_curve->table();
285 if (!mt)283 if (!mt) return false;
286 return;284 Column *x = mt->column(d_master_curve->xColumnName());
287285 Column *y = mt->column(d_master_curve->title().text());
288 int xcol = mt->colIndex(d_master_curve->xColumnName());286
289 int ycol = mt->colIndex(d_master_curve->title().text());287 Column *err = d_table->column(title().text());
290288
291 int errcol = d_table->colIndex(title().text());289 if (!x || !y || !err) {
292 if (xcol<0 || ycol<0 || errcol<0)290 remove();
293 return;291 return false;
294292 }
295 Column *x_col_ptr = d_table->column(xcol);293
296 Column *y_col_ptr = d_table->column(ycol);294 QList< QVector<double> > data = convertData(
297 Column *err_col_ptr = d_table->column(errcol);295 d_master_curve->type() == Graph::HorizontalBars ? (QList<Column*>() << y << x << err) : (QList<Column*>() << x << y << err),
298 int xColType = mt->columnType(xcol);296 QList<int>() << xAxis() << yAxis() << (type==Horizontal ? xAxis() : yAxis()) );
299 int yColType = mt->columnType(ycol);297
300 int errColType = mt->columnType(errcol);298 if (data.isEmpty() || data[0].size() == 0) {
301299 remove();
302 d_start_row = d_master_curve->startRow();300 return false;
303 d_end_row = d_master_curve->endRow();301 }
304302
305 int endRow = d_end_row;303 setData(data[0].data(), data[1].data(), data[0].size());
306 if (d_end_row >= x_col_ptr->rowCount())304 setErrors(data[2]);
307 endRow = x_col_ptr->rowCount() - 1;305
308306 return true;
309 if (d_end_row >= y_col_ptr->rowCount())
310 endRow = y_col_ptr->rowCount() - 1;
311
312 int r = abs(endRow - d_start_row) + 1;
313 QVector<double> X(r), Y(r), err(r);
314 int size = 0;
315
316
317 for (int row = d_start_row; row <= endRow; row++) {
318 if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row) && !err_col_ptr->isInvalid(row)) {
319 if (xColType == Table::Text) {
320 QString xval = x_col_ptr->textAt(row);
321 X[size] = (double)(row+1);
322 } else
323 X[size] = x_col_ptr->valueAt(row);
324
325 if (yColType == Table::Text) {
326 QString yval = y_col_ptr->textAt(row);
327 Y[size] = (double)(row+1);
328 } else
329 Y[size] = y_col_ptr->valueAt(row);
330
331 err[size] = err_col_ptr->valueAt(row);
332
333 size++;
334 }
335 }
336
337 if (size == 0)
338 remove();
339
340 X.resize(size);
341 Y.resize(size);
342 err.resize(size);
343
344 setData(X.data(), Y.data(), size);
345 setErrors(err);
346}307}
347308
348QString QwtErrorPlotCurve::plotAssociation()309QString QwtErrorPlotCurve::plotAssociation()
349310
=== modified file 'scidavis/src/QwtErrorPlotCurve.h'
--- scidavis/src/QwtErrorPlotCurve.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/QwtErrorPlotCurve.h 2010-07-12 22:57:40 +0000
@@ -83,7 +83,7 @@
83 QString plotAssociation();83 QString plotAssociation();
8484
85 bool updateData(Table *t, const QString& colName);85 bool updateData(Table *t, const QString& colName);
86 void loadData();86 virtual bool loadData();
8787
88private:88private:
89 virtual void draw(QPainter *painter,const QwtScaleMap &xMap,89 virtual void draw(QPainter *painter,const QwtScaleMap &xMap,
9090
=== modified file 'scidavis/src/QwtHistogram.cpp'
--- scidavis/src/QwtHistogram.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/QwtHistogram.cpp 2010-07-12 22:57:40 +0000
@@ -34,8 +34,8 @@
34#include <gsl/gsl_vector.h>34#include <gsl/gsl_vector.h>
35#include <gsl/gsl_histogram.h>35#include <gsl/gsl_histogram.h>
3636
37QwtHistogram::QwtHistogram(Table *t, const QString& xColName, const char *name, int startRow, int endRow):37QwtHistogram::QwtHistogram(Table *t, const char *name, int startRow, int endRow):
38 QwtBarCurve(QwtBarCurve::Vertical, t, xColName, name, startRow, endRow)38 QwtBarCurve(QwtBarCurve::Vertical, t, "dummy", name, startRow, endRow)
39{39{
40 d_autoBin = true;40 d_autoBin = true;
41}41}
@@ -96,7 +96,7 @@
96 d_end = end;96 d_end = end;
97}97}
9898
99void QwtHistogram::loadData()99bool QwtHistogram::loadData()
100{100{
101 int r = abs(d_end_row - d_start_row) + 1;101 int r = abs(d_end_row - d_start_row) + 1;
102 QVarLengthArray<double> Y(r);102 QVarLengthArray<double> Y(r);
@@ -128,7 +128,7 @@
128 X[i] = 0;128 X[i] = 0;
129 }129 }
130 setData(X, Y.data(), 2);130 setData(X, Y.data(), 2);
131 return;131 return false;
132 }132 }
133133
134 int n;134 int n;
@@ -137,7 +137,7 @@
137 n = 10;137 n = 10;
138 h = gsl_histogram_alloc (n);138 h = gsl_histogram_alloc (n);
139 if (!h)139 if (!h)
140 return;140 return false;
141141
142 gsl_vector *v = gsl_vector_alloc (size);142 gsl_vector *v = gsl_vector_alloc (size);
143 for (int i = 0; i<size; i++ )143 for (int i = 0; i<size; i++ )
@@ -156,7 +156,7 @@
156 n = int((d_end - d_begin)/d_bin_size + 1);156 n = int((d_end - d_begin)/d_bin_size + 1);
157 h = gsl_histogram_alloc (n);157 h = gsl_histogram_alloc (n);
158 if (!h)158 if (!h)
159 return;159 return false;
160160
161 double *range = new double[n+2];161 double *range = new double[n+2];
162 for (int i = 0; i<= n+1; i++ )162 for (int i = 0; i<= n+1; i++ )
@@ -185,6 +185,8 @@
185 d_max = gsl_histogram_max_val(h);185 d_max = gsl_histogram_max_val(h);
186186
187 gsl_histogram_free (h);187 gsl_histogram_free (h);
188
189 return true;
188}190}
189191
190void QwtHistogram::initData(const QVector<double>& Y, int size)192void QwtHistogram::initData(const QVector<double>& Y, int size)
191193
=== modified file 'scidavis/src/QwtHistogram.h'
--- scidavis/src/QwtHistogram.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/QwtHistogram.h 2010-07-12 22:57:40 +0000
@@ -32,7 +32,7 @@
32class QwtHistogram: public QwtBarCurve32class QwtHistogram: public QwtBarCurve
33{33{
34public:34public:
35 QwtHistogram(Table *t, const QString& xColName, const char *name, int startRow, int endRow);35 QwtHistogram(Table *t, const char *name, int startRow, int endRow);
3636
37 void copy(const QwtHistogram *h);37 void copy(const QwtHistogram *h);
3838
@@ -44,7 +44,7 @@
44 double end(){return d_end;};44 double end(){return d_end;};
45 double binSize(){return d_bin_size;};45 double binSize(){return d_bin_size;};
4646
47 void loadData();47 virtual bool loadData();
48 void initData(const QVector<double>& Y, int size);48 void initData(const QVector<double>& Y, int size);
4949
50 double mean(){return d_mean;};50 double mean(){return d_mean;};
5151
=== modified file 'scidavis/src/QwtPieCurve.cpp'
--- scidavis/src/QwtPieCurve.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/QwtPieCurve.cpp 2010-07-12 22:57:40 +0000
@@ -111,7 +111,7 @@
111 setBrush(br);111 setBrush(br);
112}112}
113113
114void QwtPieCurve::loadData()114bool QwtPieCurve::loadData()
115{115{
116 QVarLengthArray<double> Y(abs(d_end_row - d_start_row) + 1);116 QVarLengthArray<double> Y(abs(d_end_row - d_start_row) + 1);
117 int size = 0;117 int size = 0;
@@ -136,6 +136,8 @@
136 }136 }
137 Y.resize(size);137 Y.resize(size);
138 setData(Y.data(), Y.data(), size);138 setData(Y.data(), Y.data(), size);
139
140 return true;
139}141}
140142
141void QwtPieCurve::updateBoundingRect()143void QwtPieCurve::updateBoundingRect()
142144
=== modified file 'scidavis/src/QwtPieCurve.h'
--- scidavis/src/QwtPieCurve.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/QwtPieCurve.h 2010-07-12 22:57:40 +0000
@@ -47,7 +47,7 @@
47 void setFirstColor(int index){d_first_color = index;};47 void setFirstColor(int index){d_first_color = index;};
48 int firstColor(){return d_first_color;};48 int firstColor(){return d_first_color;};
4949
50 void loadData();50 virtual bool loadData();
51 void updateBoundingRect();51 void updateBoundingRect();
5252
53private:53private:
5454
=== modified file 'scidavis/src/RangeSelectorTool.h'
--- scidavis/src/RangeSelectorTool.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/RangeSelectorTool.h 2010-07-12 22:57:40 +0000
@@ -57,6 +57,7 @@
57 public:57 public:
58 RangeSelectorTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="");58 RangeSelectorTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
59 virtual ~RangeSelectorTool();59 virtual ~RangeSelectorTool();
60 virtual RTTI rtti() const { return RangeSelector; }
60 double minXValue() const { return qMin(d_active_marker.xValue(), d_inactive_marker.xValue()); }61 double minXValue() const { return qMin(d_active_marker.xValue(), d_inactive_marker.xValue()); }
61 double maxXValue() const { return qMax(d_active_marker.xValue(), d_inactive_marker.xValue()); }62 double maxXValue() const { return qMax(d_active_marker.xValue(), d_inactive_marker.xValue()); }
62 int dataSize() const { return qAbs(d_active_point - d_inactive_point); }63 int dataSize() const { return qAbs(d_active_point - d_inactive_point); }
6364
=== modified file 'scidavis/src/ScaleDraw.cpp'
--- scidavis/src/ScaleDraw.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/ScaleDraw.cpp 2010-07-12 22:57:40 +0000
@@ -36,13 +36,23 @@
36#include <qwt_text.h>36#include <qwt_text.h>
3737
38ScaleDraw::ScaleDraw(const QString& s):38ScaleDraw::ScaleDraw(const QString& s):
39 formula_string (s),
39 d_fmt('g'),40 d_fmt('g'),
40 d_prec(4),41 d_prec(4),
41 formula_string (s),42 d_minTicks(Out),
42 d_majTicks(Out),43 d_majTicks(Out)
43 d_minTicks(Out)
44 {};44 {};
4545
46ScaleDraw::ScaleDraw(const ScaleDraw &other, const QString &s) :
47 QwtScaleDraw(other),
48 formula_string(s),
49 d_minTicks(other.majorTicksStyle()),
50 d_majTicks(other.minorTicksStyle())
51{
52 other.labelFormat(d_fmt, d_prec);
53 invalidateCache();
54}
55
46double ScaleDraw::transformValue(double value) const56double ScaleDraw::transformValue(double value) const
47 {57 {
48 if (!formula_string.isEmpty())58 if (!formula_string.isEmpty())
@@ -188,7 +198,11 @@
188198
189QwtText DateScaleDraw::label(double value) const199QwtText DateScaleDraw::label(double value) const
190{200{
191QDate t = t_origin.addDays( (int) value );201QDate t;
202if (t_origin.isValid())
203 t = t_origin.addDays((int) floor(value));
204else
205 t = QDate::fromJulianDay((int) floor(value));
192return QwtText(t.toString ( t_format ));206return QwtText(t.toString ( t_format ));
193}207}
194208
@@ -211,7 +225,7 @@
211QwtText DateTimeScaleDraw::label(double value) const225QwtText DateTimeScaleDraw::label(double value) const
212{226{
213 QDate date = QDate::fromJulianDay(qRound(value));227 QDate date = QDate::fromJulianDay(qRound(value));
214 QTime time = QTime(12,0,0,0).addMSecs(int( (value - int(value)) * 86400000.0 ));228 QTime time = QTime(12,0,0,0).addMSecs(int( (value - floor(value)) * 86400000.0 ));
215 QDateTime dt = QDateTime(date, time);229 QDateTime dt = QDateTime(date, time);
216 return QwtText(dt.toString(d_format));230 return QwtText(dt.toString(d_format));
217}231}
218232
=== modified file 'scidavis/src/ScaleDraw.h'
--- scidavis/src/ScaleDraw.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/ScaleDraw.h 2010-07-12 22:57:40 +0000
@@ -43,6 +43,7 @@
43 enum TicksStyle{None = 0, Out = 1, Both = 2, In = 3};43 enum TicksStyle{None = 0, Out = 1, Both = 2, In = 3};
4444
45 ScaleDraw(const QString& s = QString::null);45 ScaleDraw(const QString& s = QString::null);
46 ScaleDraw(const ScaleDraw &other, const QString &s = QString::null);
46 virtual ~ScaleDraw(){};47 virtual ~ScaleDraw(){};
4748
48 QString formulaString() {return formula_string;};49 QString formulaString() {return formula_string;};
@@ -58,12 +59,12 @@
58 void labelFormat(char &f, int &prec) const;59 void labelFormat(char &f, int &prec) const;
59 void setLabelFormat(char f, int prec);60 void setLabelFormat(char f, int prec);
6061
61 int labelNumericPrecision(){return d_prec;};62 int labelNumericPrecision() const { return d_prec; };
6263
63 int majorTicksStyle(){return d_majTicks;};64 int majorTicksStyle() const { return d_majTicks; };
64 void setMajorTicksStyle(TicksStyle type){d_majTicks = type;};65 void setMajorTicksStyle(TicksStyle type){d_majTicks = type;};
6566
66 int minorTicksStyle(){return d_minTicks;};67 int minorTicksStyle() const { return d_minTicks; };
67 void setMinorTicksStyle(TicksStyle type){d_minTicks = type;};68 void setMinorTicksStyle(TicksStyle type){d_minTicks = type;};
6869
69protected:70protected:
@@ -80,12 +81,16 @@
80{81{
81public:82public:
82 QwtTextScaleDraw(const QMap<int, QString>& list);83 QwtTextScaleDraw(const QMap<int, QString>& list);
84 QwtTextScaleDraw(const ScaleDraw &other, const QMap<int, QString>& list) :
85 ScaleDraw(other), labels(list)
86 {}
83 ~QwtTextScaleDraw(){};87 ~QwtTextScaleDraw(){};
8488
85 QwtText label(double value) const;89 QwtText label(double value) const;
8690
87 QStringList labelsList() { return QStringList(labels.values()); }91 QStringList labelsList() { return QStringList(labels.values()); }
88 QMap<int, QString> labelsMap() { return labels; }92 QMap<int, QString> labelsMap() { return labels; }
93 void setLabelsMap(const QMap<int, QString>& list) { labels = list; }
89private:94private:
90 QMap<int, QString> labels;95 QMap<int, QString> labels;
91};96};
@@ -94,6 +99,9 @@
94{99{
95public:100public:
96 TimeScaleDraw(const QTime& t, const QString& format);101 TimeScaleDraw(const QTime& t, const QString& format);
102 TimeScaleDraw(const ScaleDraw &other, const QTime& t, const QString& format) :
103 ScaleDraw(other), t_origin(t), t_format(format)
104 {}
97 ~TimeScaleDraw(){};105 ~TimeScaleDraw(){};
98106
99 QString origin();107 QString origin();
@@ -110,6 +118,9 @@
110{118{
111public:119public:
112 DateScaleDraw(const QDate& t, const QString& format);120 DateScaleDraw(const QDate& t, const QString& format);
121 DateScaleDraw(const ScaleDraw &other, const QDate& t, const QString& format) :
122 ScaleDraw(other), t_origin(t), t_format(format)
123 {}
113 ~DateScaleDraw(){};124 ~DateScaleDraw(){};
114125
115 QString origin();126 QString origin();
@@ -126,6 +137,9 @@
126{137{
127public:138public:
128 DateTimeScaleDraw(const QDateTime & origin, const QString & format);139 DateTimeScaleDraw(const QDateTime & origin, const QString & format);
140 DateTimeScaleDraw(const ScaleDraw &other, const QDateTime & origin, const QString & format)
141 : ScaleDraw(other), d_origin(origin), d_format(format)
142 {}
129 ~DateTimeScaleDraw(){};143 ~DateTimeScaleDraw(){};
130144
131 QString origin();145 QString origin();
@@ -144,6 +158,9 @@
144 enum NameFormat{ShortName, LongName, Initial};158 enum NameFormat{ShortName, LongName, Initial};
145159
146 WeekDayScaleDraw(NameFormat format = ShortName);160 WeekDayScaleDraw(NameFormat format = ShortName);
161 WeekDayScaleDraw(const ScaleDraw &other, NameFormat format = ShortName) :
162 ScaleDraw(other), d_format(format)
163 {}
147 ~WeekDayScaleDraw(){};164 ~WeekDayScaleDraw(){};
148165
149 NameFormat format() {return d_format;};166 NameFormat format() {return d_format;};
@@ -159,6 +176,9 @@
159 enum NameFormat{ShortName, LongName, Initial};176 enum NameFormat{ShortName, LongName, Initial};
160177
161 MonthScaleDraw(NameFormat format = ShortName);178 MonthScaleDraw(NameFormat format = ShortName);
179 MonthScaleDraw(const ScaleDraw &other, NameFormat format = ShortName) :
180 ScaleDraw(other), d_format(format)
181 {}
162 ~MonthScaleDraw(){};182 ~MonthScaleDraw(){};
163183
164 NameFormat format() {return d_format;};184 NameFormat format() {return d_format;};
@@ -172,6 +192,11 @@
172{192{
173public:193public:
174 QwtSupersciptsScaleDraw(const QString& s = QString::null);194 QwtSupersciptsScaleDraw(const QString& s = QString::null);
195 QwtSupersciptsScaleDraw(const ScaleDraw &other, const QString& s = QString::null) :
196 ScaleDraw(other)
197 {
198 setFormulaString(s);
199 }
175 ~QwtSupersciptsScaleDraw(){};200 ~QwtSupersciptsScaleDraw(){};
176201
177 QwtText label(double value) const;202 QwtText label(double value) const;
178203
=== modified file 'scidavis/src/ScreenPickerTool.h'
--- scidavis/src/ScreenPickerTool.h 2009-09-06 11:34:04 +0000
+++ scidavis/src/ScreenPickerTool.h 2010-07-12 22:57:40 +0000
@@ -48,6 +48,7 @@
48 public:48 public:
49 ScreenPickerTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="");49 ScreenPickerTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
50 virtual ~ScreenPickerTool();50 virtual ~ScreenPickerTool();
51 virtual RTTI rtti() const { return ScreenPicker; }
51 virtual bool eventFilter(QObject *obj, QEvent *event);52 virtual bool eventFilter(QObject *obj, QEvent *event);
52 signals:53 signals:
53 /*! Emitted whenever a new message should be presented to the user.54 /*! Emitted whenever a new message should be presented to the user.
5455
=== modified file 'scidavis/src/ScriptEdit.cpp'
--- scidavis/src/ScriptEdit.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/ScriptEdit.cpp 2010-07-12 22:57:40 +0000
@@ -41,7 +41,7 @@
41#include <QTextStream>41#include <QTextStream>
4242
43ScriptEdit::ScriptEdit(ScriptingEnv *env, QWidget *parent, const char *name)43ScriptEdit::ScriptEdit(ScriptingEnv *env, QWidget *parent, const char *name)
44 : QTextEdit(parent, name), scripted(env), d_error(false)44 : QTextEdit(parent, name), scripted(env), d_error(false), d_changing_fmt(false)
45{45{
46 myScript = scriptEnv->newScript("", this, name);46 myScript = scriptEnv->newScript("", this, name);
47 connect(myScript, SIGNAL(error(const QString&,const QString&,int)), this, SLOT(insertErrorMsg(const QString&)));47 connect(myScript, SIGNAL(error(const QString&,const QString&,int)), this, SLOT(insertErrorMsg(const QString&)));
4848
=== modified file 'scidavis/src/SelectionMoveResizer.cpp'
--- scidavis/src/SelectionMoveResizer.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/SelectionMoveResizer.cpp 2010-07-12 22:57:40 +0000
@@ -221,13 +221,13 @@
221{221{
222 switch(op) {222 switch(op) {
223 case Resize_N:223 case Resize_N:
224 return QRect( QPoint(rect.center().x()-handler_size/2, rect.top()),224 return QRect( QPoint(rect.center().x()-handler_size/2, rect.top()+1),
225 QSize(handler_size,handler_size));225 QSize(handler_size,handler_size));
226 case Resize_NE:226 case Resize_NE:
227 return QRect( QPoint(rect.right()-handler_size+1, rect.top()),227 return QRect( QPoint(rect.right()-handler_size+1, rect.top()+1),
228 QSize(handler_size,handler_size));228 QSize(handler_size,handler_size));
229 case Resize_E:229 case Resize_E:
230 return QRect( QPoint(rect.right()-handler_size+1, rect.center().y()-handler_size/2),230 return QRect( QPoint(rect.right()-handler_size+1, rect.center().y()-handler_size/2+1),
231 QSize(handler_size,handler_size));231 QSize(handler_size,handler_size));
232 case Resize_SE:232 case Resize_SE:
233 return QRect( QPoint(rect.right()-handler_size+1, rect.bottom()-handler_size+1),233 return QRect( QPoint(rect.right()-handler_size+1, rect.bottom()-handler_size+1),
@@ -239,10 +239,10 @@
239 return QRect( QPoint(rect.left(),rect.bottom()-handler_size+1),239 return QRect( QPoint(rect.left(),rect.bottom()-handler_size+1),
240 QSize(handler_size,handler_size));240 QSize(handler_size,handler_size));
241 case Resize_W:241 case Resize_W:
242 return QRect( QPoint(rect.left(), rect.center().y()-handler_size/2),242 return QRect( QPoint(rect.left(), rect.center().y()-handler_size/2+1),
243 QSize(handler_size,handler_size));243 QSize(handler_size,handler_size));
244 case Resize_NW:244 case Resize_NW:
245 return QRect( rect.topLeft(),245 return QRect( rect.topLeft()+QPoint(0,1),
246 QSize(handler_size,handler_size));246 QSize(handler_size,handler_size));
247 default:247 default:
248 return QRect( rect.topLeft(), QSize(0,0));248 return QRect( rect.topLeft(), QSize(0,0));
249249
=== removed file 'scidavis/src/SortDialog.cpp'
--- scidavis/src/SortDialog.cpp 2009-09-06 11:34:04 +0000
+++ scidavis/src/SortDialog.cpp 1970-01-01 00:00:00 +0000
@@ -1,103 +0,0 @@
1/***************************************************************************
2 File : SortDialog.cpp
3 Project : SciDAVis
4 --------------------------------------------------------------------
5 Copyright : (C) 2006 by Ion Vasilief, Tilman Benkert
6 Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
7 Description : Sorting options dialog
8
9 ***************************************************************************/
10
11/***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 * This program is distributed in the hope that it will be useful, *
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21 * GNU General Public License for more details. *
22 * *
23 * You should have received a copy of the GNU General Public License *
24 * along with this program; if not, write to the Free Software *
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26 * Boston, MA 02110-1301 USA *
27 * *
28 ***************************************************************************/
29#include "SortDialog.h"
30
31#include <QPushButton>
32#include <QLabel>
33#include <QComboBox>
34#include <QGroupBox>
35#include <QLayout>
36#include <QApplication>
37
38SortDialog::SortDialog( QWidget* parent, Qt::WFlags fl )
39 : QDialog( parent, fl )
40{
41 setWindowIcon(qApp->windowIcon());
42 setWindowTitle(tr("Sorting Options"));
43 setSizeGripEnabled(true);
44
45 QGroupBox *groupBox1 = new QGroupBox();
46 QGridLayout * topLayout = new QGridLayout(groupBox1);
47 QHBoxLayout * hl = new QHBoxLayout();
48 hl->addStretch();
49
50 topLayout->addWidget( new QLabel(tr("Sort columns")), 0, 0 );
51 boxType = new QComboBox();
52 boxType->addItem(tr("Separately"));
53 boxType->addItem(tr("Together"));
54 topLayout->addWidget(boxType, 0, 1 );
55
56 topLayout->addWidget( new QLabel( tr("Order")), 1, 0 );
57 boxOrder = new QComboBox();
58 boxOrder->addItem(tr("Ascending"));
59 boxOrder->addItem(tr("Descending"));
60 topLayout->addWidget(boxOrder, 1, 1 );
61
62 topLayout->addWidget( new QLabel(tr("Leading column")), 2, 0 );
63 columnsList = new QComboBox();
64 topLayout->addWidget(columnsList, 2, 1);
65 topLayout->setRowStretch(3, 1);
66
67 buttonOk = new QPushButton(tr("&Sort"));
68 buttonOk->setDefault( true );
69 hl->addWidget(buttonOk);
70
71 buttonCancel = new QPushButton(tr("&Close"));
72 hl->addWidget(buttonCancel);
73
74 QVBoxLayout * mainlayout = new QVBoxLayout(this);
75 mainlayout->addWidget(groupBox1);
76 mainlayout->addLayout(hl);
77
78 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
79 connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
80 connect( boxType, SIGNAL( activated(int) ), this, SLOT(changeType(int)));
81}
82
83void SortDialog::accept()
84{
85 emit sort(boxType->currentIndex(),boxOrder->currentIndex(),columnsList->currentText());
86}
87
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: