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

Proposed by Alex Valavanis on 2010-07-12
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 Team 2010-07-12 Pending
Registry Administrators 2010-07-12 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
1=== added directory '.pc'
2=== added file '.pc/.version'
3--- .pc/.version 1970-01-01 00:00:00 +0000
4+++ .pc/.version 2010-07-12 22:57:40 +0000
5@@ -0,0 +1,1 @@
6+2
7
8=== added file '.pc/applied-patches'
9--- .pc/applied-patches 1970-01-01 00:00:00 +0000
10+++ .pc/applied-patches 2010-07-12 22:57:40 +0000
11@@ -0,0 +1,2 @@
12+sourcefiles_pri.diff
13+scidavis_pro.diff
14
15=== added directory '.pc/scidavis_pro.diff'
16=== added directory '.pc/scidavis_pro.diff/scidavis'
17=== added file '.pc/scidavis_pro.diff/scidavis/scidavis.pro'
18--- .pc/scidavis_pro.diff/scidavis/scidavis.pro 1970-01-01 00:00:00 +0000
19+++ .pc/scidavis_pro.diff/scidavis/scidavis.pro 2010-07-12 22:57:40 +0000
20@@ -0,0 +1,145 @@
21+### General remark: lines prefixed with "unix:" are for Linux/MacOS X/*BSD only, they are ignored on Windows
22+### lines prefixed with "win32:" are Windows only
23+
24+### a console displaying output of scripts; particularly useful on Windows
25+### where running SciDAVis from a terminal is inconvenient
26+DEFINES += SCRIPTING_CONSOLE
27+### a dialog for selecting the scripting language on a per-project basis
28+DEFINES += SCRIPTING_DIALOG
29+
30+CONFIG += release
31+### use the next line to compile with debugging symbols instead of the line obove
32+#CONFIG += debug
33+
34+### what to install
35+INSTALLS += target # this is the program itself
36+INSTALLS += documentation # README, INSTALL.html, manual (if present in the manual subfolder), etc.
37+### Comment out the next line if you do not want automatic compilation and installation of the translations
38+INSTALLS += translationfiles
39+
40+### names of the lupdate and lrelease programs (needed if you want to compile and install the translations automatically)
41+### possibly needs to be adapted if you have an unusual installation
42+exists(/usr/bin/lupdate-qt4) {
43+ # Debian, Ubuntu, Fedora
44+ LUPDATE_BIN = lupdate-qt4
45+ LRELEASE_BIN = lrelease-qt4
46+} else {
47+ # anything else
48+ LUPDATE_BIN = lupdate
49+ LRELEASE_BIN = lrelease
50+}
51+
52+### 64 Linux only suffix
53+linux-g++-64: libsuff = 64
54+
55+### where to install
56+unix: INSTALLBASE = /usr # this is what is called "prefix" when using GNU autotools
57+win32: INSTALLBASE = c:/scidavis
58+unix: target.path = "$$INSTALLBASE/bin" # where to install the binary on Linux/MacOS X
59+win32: target.path = "$$INSTALLBASE" # where to install the exe on Windows
60+unix: documentation.path = "$$INSTALLBASE/share/doc/scidavis" # where to install the documentation files on Linux/MacOS X
61+win32: documentation.path = "$$INSTALLBASE" # ... on Winodws
62+### Usually, the manual will be expected in the "manual" subfolder of "documentation.path" (see above).
63+### You can override this, uncomment and adjust the path behind the '=' in the next line.
64+# manual.path = $$INSTALLBASE/share/doc/scidavis/manual
65+### Enables choosing of help folder at runtime, instead of relying on the above path only.
66+### The downside is that the help folder will be remembered as a configuration option, so a binary
67+### package cannot easily update the path for its users.
68+### Dynamic selection of the manual path was the only available option up until SciDAVis 0.2.3.
69+DEFINES += DYNAMIC_MANUAL_PATH
70+### Important: translationfiles.path will be the directory where scidavis expects
71+### the translation .qm files at runtime. Therefore you need to set it corretly even if
72+### you do not use this project file to generate the translation files.
73+unix: translationfiles.path = "$$INSTALLBASE/share/scidavis/translations"
74+win32: translationfiles.path = "$$INSTALLBASE/translations"
75+### Important (if you use Python): the following two paths are where the application will expect
76+### scidavisrc.py and scidavisUtil.py, respectively. Alternatively you can also put scidavisrc.py
77+### (or ".scidavis.py") into the users home directory. scidavisUtil.py must be either in the
78+### directory specified here or somewhere else in the python path (sys.path) where "import" can find it
79+unix: pythonconfig.path = /etc # where scidavisrc.py is installed
80+win32: pythonconfig.path = $$INSTALLBASE
81+unix: pythonutils.path = $$INSTALLBASE/share/scidavis # where the scidavisUtil python modules is installed
82+win32: pythonutils.path = $$INSTALLBASE
83+
84+### (remark: muparser.pri and python.pri must be included after defining INSTALLBASE )
85+### building without muParser does not work yet (but will in a future version)
86+include( muparser.pri )
87+### comment out the following line to deactivate Python scripting support
88+include( python.pri )
89+
90+################### start of liborigin block
91+############ liborigin support has been discontinued due to the lack
92+############ of a developer who maintains the Origin import code;
93+############ if you are interested in reviving Origin support, please contact
94+############ the SciDAVis developers
95+### Note to packagers: If you want to use systemwide installed liborigin
96+### instead of the one provided in "3rdparty", uncomment the following 2 lines:
97+# CONFIG += dynamic_liborigin
98+# LIBS += -lorigin
99+### Unfortunately, due to liborigin being in alpha stage, we cannot promise
100+### that SciDAVis works with any other version that the one in "3rdparty".
101+################### end of liborigin block
102+
103+#############################################################################
104+### Default settings for Linux / Mac OS X
105+#############################################################################
106+### Link statically against Qwt and Qwtplot3D (in order to make sure they
107+### are compiled against Qt4), dynamically against everything else.
108+#############################################################################
109+
110+unix:INCLUDEPATH += ../3rdparty/qwtplot3d/include
111+unix:LIBS += ../3rdparty/qwtplot3d/lib/libqwtplot3d.a
112+
113+unix:INCLUDEPATH += ../3rdparty/qwt/src
114+unix:LIBS += ../3rdparty/qwt/lib/libqwt.a
115+
116+unix:LIBS += -L/usr/lib$${libsuff}
117+unix:LIBS += -lgsl -lgslcblas -lz
118+unix:LIBS += -lmuparser
119+unix:INCLUDEPATH += /usr/include/muParser
120+
121+#############################################################################
122+### Link everything dynamically
123+#############################################################################
124+
125+#unix:INCLUDEPATH += /usr/include/qwt5
126+#unix:LIBS += -L/usr/lib$${libsuff}
127+## dynamically link against Qwt(3D) installed system-wide
128+## WARNING: make sure they are compiled against >= Qt4.2
129+## Mixing Qt 4.2 and Qt >= 4.3 compiled stuff may also
130+## cause problems.
131+#unix:INCLUDEPATH += /usr/include/qwtplot3d
132+#unix:LIBS += -lqwtplot3d
133+#unix:LIBS += -lqwt
134+##dynamically link against GSL and zlib installed system-wide
135+#unix:LIBS += -lgsl -lgslcblas -lz -lmuparser
136+
137+#############################################################################
138+### Default settings for Windows
139+#############################################################################
140+### Static linking mostly, except Qt, Python and QwtPlot3D.
141+### The latter seems to be impossible to link statically on Windows.
142+#############################################################################
143+
144+win32:INCLUDEPATH += c:/qwtplot3d/include
145+win32:INCLUDEPATH += c:/qwt-5.0.2/include
146+win32:INCLUDEPATH += c:/gsl/include
147+win32:INCLUDEPATH += c:/zlib/include
148+win32:INCLUDEPATH += c:/muparser/include
149+
150+win32:LIBS += c:/qwtplot3d/lib/qwtplot3d.dll
151+win32:LIBS += c:/qwt-5.0.2/lib/libqwt.a
152+win32:LIBS += c:/gsl/lib/libgsl.a
153+win32:LIBS += c:/gsl/lib/libgslcblas.a
154+win32:LIBS += c:/zlib/lib/libz.a
155+win32:LIBS += c:/muparser/lib/libmuparser.a
156+
157+#############################################################################
158+### END OF USER-SERVICEABLE PART ###
159+#############################################################################
160+
161+include( basic.pri )
162+include( sourcefiles.pri )
163+
164+#############################################################################
165+#############################################################################
166
167=== added directory '.pc/sourcefiles_pri.diff'
168=== added directory '.pc/sourcefiles_pri.diff/scidavis'
169=== added file '.pc/sourcefiles_pri.diff/scidavis/sourcefiles.pri'
170--- .pc/sourcefiles_pri.diff/scidavis/sourcefiles.pri 1970-01-01 00:00:00 +0000
171+++ .pc/sourcefiles_pri.diff/scidavis/sourcefiles.pri 2010-07-12 22:57:40 +0000
172@@ -0,0 +1,425 @@
173+#############################################################################
174+###################### PROJECT FILES SECTION ################################
175+#############################################################################
176+
177+###################### ICONS ################################################
178+RESOURCES += appicons.qrc
179+RESOURCES += icons.qrc
180+RC_FILE = scidavis.rc
181+
182+###################### TRANSLATIONS #########################################
183+
184+TRANSLATIONS = translations/scidavis_de.ts \
185+ translations/scidavis_es.ts \
186+ translations/scidavis_fr.ts \
187+ translations/scidavis_ru.ts \
188+ translations/scidavis_ja.ts \
189+ translations/scidavis_sv.ts \
190+ translations/scidavis_pt-br.ts \
191+ translations/scidavis_cs.ts \
192+ translations/scidavis_cs-alt.ts \
193+
194+contains( INSTALLS, translationfiles ){
195+ exists(translations/scidavis_de.ts){
196+ translationfiles.files = translations/scidavis_de.qm \
197+ translations/scidavis_es.qm \
198+ translations/scidavis_fr.qm \
199+ translations/scidavis_ru.qm \
200+ translations/scidavis_ja.qm \
201+ translations/scidavis_sv.qm \
202+ translations/scidavis_pt-br.qm \
203+ translations/scidavis_cs.qm \
204+ translations/scidavis_cs-alt.qm \
205+
206+ unix: tstarget.target = translations/scidavis_de.qm
207+ win32: tstarget.target = translations\scidavis_de.qm
208+ tstarget.commands = $$LUPDATE_BIN scidavis.pro && $$LRELEASE_BIN scidavis.pro
209+
210+ QMAKE_EXTRA_TARGETS += tstarget
211+ PRE_TARGETDEPS += translations/scidavis_de.qm
212+ }
213+ !exists(translations/scidavis_de.ts){
214+ message("=======================================")
215+ message("Could not find translation (.ts) files.")
216+ message("=======================================")
217+ }
218+}
219+
220+###################### DOCUMENTATION ########################################
221+
222+documentation.files += ../manual/html \
223+ ../INSTALL.html \
224+ ../scidavis.css \
225+ ../scidavis-logo.png \
226+ ../README \
227+ ../CHANGES \
228+ ../gpl.txt
229+
230+###################### DESKTOP INTEGRATION ##################################
231+
232+unix {
233+ desktop_entry.files = scidavis.desktop
234+ desktop_entry.path = "$$INSTALLBASE/share/applications"
235+ INSTALLS += desktop_entry
236+
237+ mime_package.files = scidavis.xml
238+ mime_package.path = "$$INSTALLBASE/share/mime/packages"
239+ INSTALLS += mime_package
240+
241+ #deprecated
242+ mime_entry.files = x-sciprj.desktop
243+ mime_entry.path = "$$INSTALLBASE/share/mimelnk/application"
244+ INSTALLS += mime_entry
245+
246+ icon_hicolor_scalable.files = icons/scidavis.svg
247+ icon_hicolor_scalable.path = "$$INSTALLBASE/share/icons/hicolor/scalable/apps"
248+ INSTALLS += icon_hicolor_scalable
249+
250+ resolutions = 16 22 32 48 64 128
251+ for(res, resolutions) {
252+ eval(icon_hicolor_$${res}.files = icons/hicolor-$${res}/scidavis.png)
253+ eval(icon_hicolor_$${res}.path = "$$INSTALLBASE/share/icons/hicolor/$${res}x$${res}/apps")
254+ INSTALLS += icon_hicolor_$${res}
255+ }
256+
257+ resolutions = 16 22 32
258+ for(res, resolutions) {
259+ eval(icon_locolor_$${res}.files = icons/locolor-$${res}/scidavis.png)
260+ eval(icon_locolor_$${res}.path = "$$INSTALLBASE/share/icons/locolor/$${res}x$${res}/apps")
261+
262+ INSTALLS += icon_locolor_$${res}
263+ }
264+}
265+
266+###################### HEADERS ##############################################
267+
268+HEADERS += src/ApplicationWindow.h \
269+ src/globals.h\
270+ src/Graph.h \
271+ src/Graph3D.h \
272+ src/Table.h \
273+ src/CurvesDialog.h \
274+ src/PlotDialog.h \
275+ src/Plot3DDialog.h \
276+ src/PlotWizard.h \
277+ src/ExportDialog.h \
278+ src/AxesDialog.h \
279+ src/PolynomFitDialog.h \
280+ src/ExpDecayDialog.h \
281+ src/FunctionDialog.h \
282+ src/FitDialog.h \
283+ src/SurfaceDialog.h \
284+ src/TextDialog.h \
285+ src/LineDialog.h \
286+ src/ScalePicker.h \
287+ src/TitlePicker.h \
288+ src/CanvasPicker.h \
289+ src/PlotCurve.h \
290+ src/QwtErrorPlotCurve.h \
291+ src/QwtPieCurve.h \
292+ src/ErrDialog.h \
293+ src/Legend.h \
294+ src/ArrowMarker.h \
295+ src/ImageMarker.h \
296+ src/ImageDialog.h \
297+ src/fit_gsl.h \
298+ src/nrutil.h\
299+ src/MultiLayer.h\
300+ src/LayerDialog.h \
301+ src/IntDialog.h \
302+ src/Bar.h \
303+ src/Cone3D.h \
304+ src/ConfigDialog.h \
305+ src/QwtBarCurve.h \
306+ src/BoxCurve.h \
307+ src/QwtHistogram.h \
308+ src/VectorCurve.h \
309+ src/ScaleDraw.h \
310+ src/Matrix.h \
311+ src/DataSetDialog.h \
312+ src/MyParser.h \
313+ src/ColorBox.h \
314+ src/SymbolBox.h \
315+ src/PatternBox.h \
316+# src/importOPJ.h\
317+ src/SymbolDialog.h \
318+ src/Plot.h \
319+ src/ColorButton.h \
320+ src/AssociationsDialog.h \
321+ src/RenameWindowDialog.h \
322+ src/MyWidget.h \
323+ src/InterpolationDialog.h\
324+ src/ImportASCIIDialog.h \
325+ src/ImageExportDialog.h\
326+ src/SmoothCurveDialog.h\
327+ src/FilterDialog.h\
328+ src/FFTDialog.h\
329+ src/Note.h\
330+ src/Folder.h\
331+ src/FindDialog.h\
332+ src/ScriptingEnv.h\
333+ src/Script.h\
334+ src/ScriptEdit.h\
335+ src/FunctionCurve.h\
336+ src/Fit.h\
337+ src/MultiPeakFit.h\
338+ src/ExponentialFit.h\
339+ src/PolynomialFit.h\
340+ src/NonLinearFit.h\
341+ src/PluginFit.h\
342+ src/SigmoidalFit.h\
343+ src/customevents.h\
344+ src/ScriptingLangDialog.h\
345+ src/TextFormatButtons.h\
346+ src/TableStatistics.h\
347+ src/Spectrogram.h\
348+ src/ColorMapEditor.h\
349+ src/SelectionMoveResizer.h\
350+ src/Filter.h\
351+ src/Differentiation.h\
352+ src/Integration.h\
353+ src/Interpolation.h\
354+ src/SmoothFilter.h\
355+ src/FFTFilter.h\
356+ src/FFT.h\
357+ src/Convolution.h\
358+ src/Correlation.h\
359+ src/PlotToolInterface.h\
360+ src/ScreenPickerTool.h\
361+ src/DataPickerTool.h\
362+ src/RangeSelectorTool.h\
363+ src/TranslateCurveTool.h\
364+ src/MultiPeakFitTool.h\
365+ src/CurveRangeDialog.h\
366+ src/LineProfileTool.h\
367+ src/PlotEnrichement.h\
368+ src/ExtensibleFileDialog.h\
369+ src/OpenProjectDialog.h\
370+ src/Grid.h\
371+ src/DataPointPicker.h \
372+
373+###################### SOURCES ##############################################
374+
375+SOURCES += src/ApplicationWindow.cpp \
376+ src/Graph.cpp \
377+ src/Graph3D.cpp \
378+ src/Table.cpp \
379+ src/CurvesDialog.cpp \
380+ src/PlotDialog.cpp \
381+ src/Plot3DDialog.cpp \
382+ src/PlotWizard.cpp \
383+ src/ExportDialog.cpp \
384+ src/AxesDialog.cpp \
385+ src/PolynomFitDialog.cpp \
386+ src/TextDialog.cpp \
387+ src/ScalePicker.cpp\
388+ src/TitlePicker.cpp \
389+ src/CanvasPicker.cpp \
390+ src/ExpDecayDialog.cpp \
391+ src/FunctionDialog.cpp \
392+ src/FitDialog.cpp \
393+ src/SurfaceDialog.cpp \
394+ src/LineDialog.cpp \
395+ src/PlotCurve.cpp \
396+ src/QwtErrorPlotCurve.cpp \
397+ src/QwtPieCurve.cpp \
398+ src/ErrDialog.cpp \
399+ src/Legend.cpp \
400+ src/ArrowMarker.cpp \
401+ src/ImageMarker.cpp \
402+ src/ImageDialog.cpp \
403+ src/MultiLayer.cpp\
404+ src/LayerDialog.cpp \
405+ src/IntDialog.cpp \
406+ src/Bar.cpp \
407+ src/Cone3D.cpp \
408+ src/DataSetDialog.cpp \
409+ src/ConfigDialog.cpp \
410+ src/QwtBarCurve.cpp \
411+ src/BoxCurve.cpp \
412+ src/QwtHistogram.cpp \
413+ src/VectorCurve.cpp \
414+ src/Matrix.cpp \
415+ src/MyParser.cpp\
416+ src/ColorBox.cpp \
417+ src/SymbolBox.cpp \
418+ src/PatternBox.cpp \
419+# src/importOPJ.cpp\
420+ src/main.cpp \
421+ src/SymbolDialog.cpp \
422+ src/Plot.cpp \
423+ src/ColorButton.cpp \
424+ src/AssociationsDialog.cpp \
425+ src/RenameWindowDialog.cpp \
426+ src/MyWidget.cpp\
427+ src/InterpolationDialog.cpp\
428+ src/nrutil.cpp\
429+ src/fit_gsl.cpp\
430+ src/SmoothCurveDialog.cpp\
431+ src/FilterDialog.cpp\
432+ src/FFTDialog.cpp\
433+ src/Note.cpp\
434+ src/Folder.cpp\
435+ src/FindDialog.cpp\
436+ src/TextFormatButtons.cpp\
437+ src/ScriptEdit.cpp\
438+ src/ImportASCIIDialog.cpp\
439+ src/ImageExportDialog.cpp\
440+ src/ScaleDraw.cpp\
441+ src/FunctionCurve.cpp\
442+ src/Fit.cpp\
443+ src/MultiPeakFit.cpp\
444+ src/ExponentialFit.cpp\
445+ src/PolynomialFit.cpp\
446+ src/PluginFit.cpp\
447+ src/NonLinearFit.cpp\
448+ src/SigmoidalFit.cpp\
449+ src/ScriptingEnv.cpp\
450+ src/Script.cpp\
451+ src/ScriptingLangDialog.cpp\
452+ src/TableStatistics.cpp\
453+ src/Spectrogram.cpp\
454+ src/ColorMapEditor.cpp\
455+ src/SelectionMoveResizer.cpp\
456+ src/Filter.cpp\
457+ src/Differentiation.cpp\
458+ src/Integration.cpp\
459+ src/Interpolation.cpp\
460+ src/SmoothFilter.cpp\
461+ src/FFTFilter.cpp\
462+ src/FFT.cpp\
463+ src/Convolution.cpp\
464+ src/Correlation.cpp\
465+ src/ScreenPickerTool.cpp\
466+ src/DataPickerTool.cpp\
467+ src/RangeSelectorTool.cpp\
468+ src/TranslateCurveTool.cpp\
469+ src/MultiPeakFitTool.cpp\
470+ src/CurveRangeDialog.cpp\
471+ src/LineProfileTool.cpp\
472+ src/PlotEnrichement.cpp\
473+ src/ExtensibleFileDialog.cpp\
474+ src/OpenProjectDialog.cpp\
475+ src/Grid.cpp\
476+ src/globals.cpp \
477+ src/DataPointPicker.cpp \
478+
479+###################### FORMS ##############################################
480+FORMS += src/SciDAVisAbout.ui
481+
482+########### Future code backported from the aspect framework ##################
483+DEFINES += LEGACY_CODE_0_2_x
484+INCLUDEPATH += src
485+INCLUDEPATH += src/future
486+
487+FORMS += src/future/matrix/matrixcontroltabs.ui \
488+ src/future/core/ProjectConfigPage.ui \
489+ src/future/table/controltabs.ui \
490+ src/future/table/DimensionsDialog.ui
491+
492+HEADERS += src/future/core/AbstractAspect.h \
493+ src/future/core/AbstractPart.h \
494+ src/future/core/AspectPrivate.h \
495+ src/future/core/aspectcommands.h \
496+ src/future/core/future_Folder.h \
497+ src/future/core/Project.h \
498+ src/future/core/ProjectConfigPage.h \
499+ src/future/core/PartMdiView.h \
500+ src/future/core/AbstractColumn.h \
501+ src/future/core/column/Column.h \
502+ src/future/core/column/ColumnPrivate.h \
503+ src/future/core/column/columncommands.h \
504+ src/future/core/AbstractFilter.h \
505+ src/future/core/AbstractSimpleFilter.h \
506+ src/future/core/datatypes/SimpleCopyThroughFilter.h \
507+ src/future/core/datatypes/DateTime2DoubleFilter.h \
508+ src/future/core/datatypes/DateTime2StringFilter.h \
509+ src/future/core/datatypes/DayOfWeek2DoubleFilter.h \
510+ src/future/core/datatypes/Double2DateTimeFilter.h \
511+ src/future/core/datatypes/Double2DayOfWeekFilter.h \
512+ src/future/core/datatypes/Double2MonthFilter.h \
513+ src/future/core/datatypes/Double2StringFilter.h \
514+ src/future/core/datatypes/Month2DoubleFilter.h \
515+ src/future/core/datatypes/String2DateTimeFilter.h \
516+ src/future/core/datatypes/String2DayOfWeekFilter.h \
517+ src/future/core/datatypes/String2DoubleFilter.h \
518+ src/future/core/datatypes/String2MonthFilter.h \
519+ src/future/lib/macros.h \
520+ src/future/lib/XmlStreamReader.h \
521+ src/future/lib/ActionManager.h \
522+ src/future/lib/ConfigPageWidget.h \
523+ src/future/lib/Interval.h \
524+ src/future/lib/IntervalAttribute.h \
525+ src/future/matrix/future_Matrix.h \
526+ src/future/matrix/MatrixModel.h \
527+ src/future/matrix/MatrixView.h \
528+ src/future/matrix/matrixcommands.h \
529+ src/future/table/future_Table.h \
530+ src/future/table/TableModel.h \
531+ src/future/table/TableView.h \
532+ src/future/table/tablecommands.h \
533+ src/future/table/TableDoubleHeaderView.h \
534+ src/future/table/TableItemDelegate.h \
535+ src/future/table/TableCommentsHeaderModel.h \
536+ src/future/table/future_SortDialog.h \
537+ src/future/table/AsciiTableImportFilter.h \
538+ src/future/core/AbstractImportFilter.h \
539+ src/future/core/interfaces.h \
540+
541+SOURCES += src/future/core/AbstractAspect.cpp \
542+ src/future/core/AbstractPart.cpp \
543+ src/future/core/AspectPrivate.cpp \
544+ src/future/core/future_Folder.cpp \
545+ src/future/core/PartMdiView.cpp \
546+ src/future/core/Project.cpp \
547+ src/future/core/column/Column.cpp \
548+ src/future/core/column/ColumnPrivate.cpp \
549+ src/future/core/column/columncommands.cpp \
550+ src/future/core/datatypes/DateTime2StringFilter.cpp \
551+ src/future/core/datatypes/String2DateTimeFilter.cpp \
552+ src/future/core/datatypes/Double2StringFilter.cpp \
553+ src/future/core/datatypes/Double2DateTimeFilter.cpp \
554+ src/future/core/AbstractSimpleFilter.cpp \
555+ src/future/core/AbstractFilter.cpp \
556+ src/future/core/ProjectConfigPage.cpp \
557+ src/future/lib/XmlStreamReader.cpp \
558+ src/future/lib/ActionManager.cpp \
559+ src/future/lib/ConfigPageWidget.cpp \
560+ src/future/matrix/future_Matrix.cpp \
561+ src/future/matrix/MatrixModel.cpp \
562+ src/future/matrix/MatrixView.cpp \
563+ src/future/matrix/matrixcommands.cpp \
564+ src/future/table/future_Table.cpp \
565+ src/future/table/TableModel.cpp \
566+ src/future/table/TableView.cpp \
567+ src/future/table/tablecommands.cpp \
568+ src/future/table/TableDoubleHeaderView.cpp \
569+ src/future/table/TableItemDelegate.cpp \
570+ src/future/table/TableCommentsHeaderModel.cpp \
571+ src/future/table/future_SortDialog.cpp \
572+ src/future/table/AsciiTableImportFilter.cpp \
573+
574+###############################################################
575+##################### Compression #############################
576+############### (mini gzip implementation) ####################
577+################# requires zlib >= 1.2.3 ######################
578+###############################################################
579+
580+SOURCES += ../3rdparty/minigzip/minigzip.c
581+
582+###############################################################
583+################# Origin Import (liborigin) ###################
584+###############################################################
585+
586+############ liborigin support has been discontinued due to the lack
587+############ of a developer who maintains the Origin import code;
588+############ if you are interested in reviving Origin support, please contact
589+############ the SciDAVis developers
590+
591+#!dynamic_liborigin{
592+#INCLUDEPATH += ../3rdparty/liborigin
593+#
594+#HEADERS += ../3rdparty/liborigin/OPJFile.h
595+#SOURCES += ../3rdparty/liborigin/OPJFile.cpp
596+#}
597+
598
599=== modified file 'CHANGES'
600--- CHANGES 2009-09-06 11:34:04 +0000
601+++ CHANGES 2010-07-12 22:57:40 +0000
602@@ -180,3 +180,52 @@
603 Note.exportASCII(filename)
604 Note.importASCII(filename)
605
606+=== Release 0.2.4, 2010-03-12 ===
607+Most important changes (since 0.2.3)
608+- Some parts of the Python API have been marked as deprecated and generate warnings when used. This
609+ may be a bit unusual for a bugfix release; on the other hand, they won't be removed any time soon
610+ and inserting the deprecation warnings now will give everyone as much time as possible for getting
611+ accustomed to the API we're moving towards.
612+ Most prominently,
613+ Table.cell(column,row) and
614+ Table.setCell(column,row,value)
615+ are deprecated in favour of
616+ Table.column(column - 1).valueAt(row - 1) and
617+ Table.column(column - 1).setValueAt(row - 1, value)
618+ (note that the column/row INDICES DIFFER BY ONE!); the same goes for
619+ Table.text(c,r) -> Table.column(c - 1).textAt(r - 1) and
620+ Table.setText(c,r,text) -> Table.column(c - 1).setTextAt(r - 1,text).
621+ This serves multiple purposes. It simplifies the interfaces by grouping all functionality specific
622+ to a certain column in the Column class; it allows column objects to be stored and passed around;
623+ and it moves from the unconventional 1-based indexing to the more conventional 0-based indexing.
624+ Future additions to the API will increasingly make use of the columns-as-objects paradigm.
625+- lots of bugfixes, again including crashes
626+- fixed compatibility issues with Qt 4.6 and SIP 4.9
627+- performance improvements
628+- substantially improved support for plots involving date/time data
629+- added two Czech translations: a default one by Pavel Fric (feedback requested via
630+ http://fripohled.blogspot.com) and an alternative one by Jan Helebrant
631+- updated Spanish translation, thanks to Mauricio Troviano; Brazilian Portuguese translation, thanks
632+ to Fellyp do Nascimento; and German translation
633+- fixed and extended many parts of the API for Python scripts, including the new methods
634+ Layer.pickPoint()
635+ MDIWindow.clone()
636+ Folder.save(filename)
637+ newGraph(string)
638+ Layer.printDialog()
639+ Graph.printDialog()
640+ Layer.setRightTitle(string)
641+ Layer.setTopTitle(string)
642+ Layer.grid() # => returns an instance of the new class Grid
643+ Layer.insertFunctionCurve(formula,from=0,to=1,points=100,title="")
644+ Layer.insertPolarCurve(radial_formula,angular_formula,from=0,to=2*pi,parameter="t",points=100,title="")
645+ Layer.insertParametricCurve(x_formal,y_formula,from=0,to=1,parameter="t",points=100,title="")
646+ Matrix.recalculate()
647+ the constants QwtPlot.yLeft, QwtPlot.yRight, QwtPlot.xBottom, QwtPlot.xTop for specifying axes
648+ and the Grid class
649+- multiple graphs can have active tools simultaneously
650+- based on user feedback, the default behaviour when importing ASCII files has been changed to
651+ interpret the data as numeric (only applies to fresh installations of SciDAVis)
652+- automatic resizing of table rows for multi-line cells intentionally dropped, because this seems
653+ to be rarely needed and has a huge impact on performance for large tables
654+
655
656=== modified file 'Doxyfile'
657--- Doxyfile 2009-09-06 11:34:04 +0000
658+++ Doxyfile 2010-07-12 22:57:40 +0000
659@@ -2,7 +2,7 @@
660 # Project related configuration options
661 #---------------------------------------------------------------------------
662 PROJECT_NAME = SciDAVis
663-PROJECT_NUMBER = 0.2.3
664+PROJECT_NUMBER = 0.2.4
665 OUTPUT_DIRECTORY = API
666 CREATE_SUBDIRS = NO
667 OUTPUT_LANGUAGE = English
668
669=== modified file 'README'
670--- README 2009-09-06 11:34:04 +0000
671+++ README 2010-07-12 22:57:40 +0000
672@@ -62,8 +62,11 @@
673 Rémy Claverie,
674 f0ma,
675 Jose Antonio Lorenzo Fernandez,
676+Pavel Fric,
677+Jan Helebrant,
678 Daniel Klaer,
679 Peter Landgren,
680+Fellype do Nascimento,
681 Tomomasa Ohkubo,
682 Mikhail Shevyakov,
683 Mauricio Troviano
684
685=== modified file 'README.installer'
686--- README.installer 2009-09-06 11:34:04 +0000
687+++ README.installer 2010-07-12 22:57:40 +0000
688@@ -35,6 +35,25 @@
689 - from fitPlugins\* -
690 plugins\fitRational0.dll
691 plugins\fitRational1.dll
692+ - from <Python directory>\Lib\site-packages
693+ sip.pyd
694+ PyQt4\__init__.py
695+ PyQt4\__init__.pyc
696+ PyQt4\Qt.pyd
697+ PyQt4\QtAssistant.pyd
698+ PyQt4\QtCore.pyd
699+ PyQt4\QtDesigner.pyd
700+ PyQt4\QtGui.pyd
701+ PyQt4\QtHelp.pyd
702+ PyQt4\QtNetwork.pyd
703+ PyQt4\QtOpenGL.pyd
704+ PyQt4\QtScript.pyd
705+ PyQt4\QtSql.pyd
706+ PyQt4\QtSvg.pyd
707+ PyQt4\QtTest.pyd
708+ PyQt4\QtWebKit.pyd
709+ PyQt4\QtXml.pyd
710+ PyQt4\QtXmlPatterns.pyd
711
712 4) Right click on scidavisScriptInstall.nsi and select compile.
713
714
715=== modified file 'debian/changelog'
716--- debian/changelog 2010-03-15 13:04:45 +0000
717+++ debian/changelog 2010-07-12 22:57:40 +0000
718@@ -1,3 +1,24 @@
719+scidavis (0.2.4-1ubuntu1~ppa4) maverick; urgency=low
720+
721+ * Merge from Debian unstable (LP: #604811, LP: #565206)
722+ * debian/control: Fix FTBFS with Qt 4.7 (LP: #601617)
723+ + add Build-Depends libqt4assistantclient-dev
724+ + add Recommends: qt-assistant-compat
725+
726+ -- Alexander Valavanis <valavanisalex@googlemail.com> Mon, 12 Jul 2010 23:50:09 +0100
727+
728+scidavis (0.2.4-1) unstable; urgency=low
729+
730+ * New upstream version
731+ + Should fix various crashes (Closes: #583226, #571462).
732+ * debian/source/: migrate format to '3.0' in order to use bz2 tarballs
733+ * debian/control: remove Build-Depends on quilt (not needed with 3.0)
734+ * debian/control: bump Standards-Version to 3.8.4 (no changes needed)
735+ * debian/control: set Priority to extra because libmuparser0 is extra
736+ * debian/watch: update for bz2 tarballs
737+
738+ -- Ruben Molina <rmolina@udea.edu.co> Fri, 21 May 2010 11:55:33 -0500
739+
740 scidavis (0.2.3-1ubuntu1) lucid; urgency=low
741
742 * New patch reorder-updatehorizontalheader.patch to fix Segmentation
743
744=== modified file 'debian/control'
745--- debian/control 2010-03-15 13:04:45 +0000
746+++ debian/control 2010-07-12 22:57:40 +0000
747@@ -3,17 +3,18 @@
748 Priority: optional
749 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
750 XSBC-Original-Maintainer: Ruben Molina <rmolina@udea.edu.co>
751-Build-Depends: cdbs, debhelper (>= 7), quilt, docbook-to-man, python,
752- pyqt4-dev-tools, sip4,
753- libqt4-dev, libqt4-opengl-dev, libqwt5-qt4-dev, libqwtplot3d-qt4-dev,
754- libmuparser-dev, libgsl0-dev, zlib1g-dev, libglu1-mesa-dev, python-dev,
755- python-qt4-dev, python-sip4-dev, python-support
756-Standards-Version: 3.8.3
757+Build-Depends: cdbs, debhelper (>= 7), docbook-to-man, python,
758+ pyqt4-dev-tools, sip4, libqt4-dev, libqt4-opengl-dev, libqwt5-qt4-dev,
759+ libqwtplot3d-qt4-dev, libmuparser-dev, libgsl0-dev, zlib1g-dev,
760+ libglu1-mesa-dev, python-dev, python-qt4-dev, python-sip4-dev,
761+ python-support, libqtassistantclient-dev
762+Standards-Version: 3.8.4
763 Homepage: http://scidavis.sourceforge.net/
764
765 Package: scidavis
766 Architecture: any
767 Depends: ${shlibs:Depends}, ${misc:Depends}
768+Recommends: qt-assistant-compat
769 Description: application for scientific data analysis and visualization
770 SciDAVis is a free interactive application aimed at data analysis and
771 publication-quality plotting. It combines a shallow learning curve and
772
773=== removed file 'debian/patches/makefile.patch'
774--- debian/patches/makefile.patch 2009-09-06 11:34:04 +0000
775+++ debian/patches/makefile.patch 1970-01-01 00:00:00 +0000
776@@ -1,42 +0,0 @@
777-Description: Sets 'unix:INCLUDEPATH' and 'unix:LIBS' in scidavis.pro
778- We want to link dynamically against qwt-qt4, qwtplot3d-qt4, and
779- muparser packages.
780-Forwarded: not-needed
781-Author: Ruben Molina <rmolina@udea.edu.co>
782---- scidavis-0.2.3.orig/scidavis/scidavis.pro
783-+++ scidavis-0.2.3/0scidavis/scidavis.pro
784-@@ -82,18 +82,11 @@
785- ### are compiled against Qt4), dynamically against everything else.
786- #############################################################################
787-
788--unix:INCLUDEPATH += ../3rdparty/qwtplot3d/include
789--unix:LIBS += ../3rdparty/qwtplot3d/lib/libqwtplot3d.a
790-
791--unix:INCLUDEPATH += ../3rdparty/qwt/src
792--unix:LIBS += ../3rdparty/qwt/lib/libqwt.a
793-
794- unix:LIBS += -L/usr/lib$${libsuff}
795- unix:LIBS += -lgsl -lgslcblas -lz
796- ### muparser 1.30 does not compile as a shared lib on Linux
797--unix:LIBS += -L/usr/local/lib$${libsuff}
798--unix:LIBS += /usr/local/lib/libmuparser.a
799--unix:INCLUDEPATH += /usr/local/include
800-
801- #############################################################################
802- ### Link everything dynamically
803-@@ -105,9 +98,12 @@
804- ## WARNING: make sure they are compiled against >= Qt4.2
805- ## Mixing Qt 4.2 and Qt >= 4.3 compiled stuff may also
806- ## cause problems.
807--#unix:INCLUDEPATH += /usr/include/qwtplot3d
808--#unix:LIBS += -lqwtplot3d
809--#unix:LIBS += -lqwt
810-+unix:INCLUDEPATH += /usr/include/qwtplot3d-qt4
811-+unix:LIBS += -lqwtplot3d-qt4
812-+unix:INCLUDEPATH += /usr/include/qwt-qt4
813-+unix:LIBS += -lqwt-qt4
814-+unix:INCLUDEPATH += /usr/include/muParser
815-+unix:LIBS += -lmuparser
816- ##dynamically link against GSL and zlib installed system-wide
817- #unix:LIBS += -lgsl -lgslcblas -lz -lmuparser
818-
819
820=== removed file 'debian/patches/package-contains-upstream-install-documentation.patch'
821--- debian/patches/package-contains-upstream-install-documentation.patch 2009-09-06 11:34:04 +0000
822+++ debian/patches/package-contains-upstream-install-documentation.patch 1970-01-01 00:00:00 +0000
823@@ -1,15 +0,0 @@
824-Description: Remove INSTALL.html from 'documentation.files'
825- Solves a 'package-contains-upstream-install-documentation' lintian warning
826-Forwarded: not-needed
827-Author: Ruben Molina <rmolina@udea.edu.co>
828---- scidavis-0.2.3.orig/scidavis/sourcefiles.pri
829-+++ scidavis-0.2.3/scidavis/sourcefiles.pri
830-@@ -44,7 +44,7 @@
831- ###################### DOCUMENTATION ########################################
832-
833- documentation.files += ../manual/html \
834-- ../INSTALL.html \
835-+# ../INSTALL.html \
836- ../scidavis.css \
837- ../scidavis-logo.png \
838- ../README \
839
840=== removed file 'debian/patches/reorder-updatehorizontalheader.patch'
841--- debian/patches/reorder-updatehorizontalheader.patch 2010-03-15 13:04:45 +0000
842+++ debian/patches/reorder-updatehorizontalheader.patch 1970-01-01 00:00:00 +0000
843@@ -1,16 +0,0 @@
844-Description: Reorder updateHorizontalHeador for FTBS fix
845-Author: knut_f
846-Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=2965581&group_id=199120&atid=968214
847-
848---- a/scidavis/src/future/table/future_Table.cpp
849-+++ b/scidavis/src/future/table/future_Table.cpp
850-@@ -2309,8 +2309,8 @@
851- d_column_widths.insert(before, Table::defaultColumnWidth());
852- }
853- d_column_count += count;
854-- updateHorizontalHeader(before, before+count-1);
855- emit d_owner->columnsInserted(before, cols.count());
856-+ updateHorizontalHeader(before, before+count-1);
857- }
858-
859- void Table::Private::removeColumns(int first, int count)
860
861=== added file 'debian/patches/scidavis_pro.diff'
862--- debian/patches/scidavis_pro.diff 1970-01-01 00:00:00 +0000
863+++ debian/patches/scidavis_pro.diff 2010-07-12 22:57:40 +0000
864@@ -0,0 +1,40 @@
865+Description: Link everything dynamically
866+ Define unix:INCLUDEPATH for muparser, qwtplot3d-qt4, and qwt-qt4
867+Author: Ruben Molina <rmolina@udea.edu.co>
868+Forwarded: not-needed
869+Last-Update: 2010-05-21
870+Index: scidavis-0.2.4/scidavis/scidavis.pro
871+--- scidavis-0.2.4.orig/scidavis/scidavis.pro 2010-05-21 11:09:17.112674761 -0500
872++++ scidavis-0.2.4/scidavis/scidavis.pro 2010-05-21 11:16:28.160673262 -0500
873+@@ -87,11 +87,7 @@
874+ ### are compiled against Qt4), dynamically against everything else.
875+ #############################################################################
876+
877+-unix:INCLUDEPATH += ../3rdparty/qwtplot3d/include
878+-unix:LIBS += ../3rdparty/qwtplot3d/lib/libqwtplot3d.a
879+
880+-unix:INCLUDEPATH += ../3rdparty/qwt/src
881+-unix:LIBS += ../3rdparty/qwt/lib/libqwt.a
882+
883+ unix:LIBS += -L/usr/lib$${libsuff}
884+ unix:LIBS += -lgsl -lgslcblas -lz
885+@@ -102,15 +98,15 @@
886+ ### Link everything dynamically
887+ #############################################################################
888+
889+-#unix:INCLUDEPATH += /usr/include/qwt5
890++unix:INCLUDEPATH += /usr/include/qwt-qt4
891+ #unix:LIBS += -L/usr/lib$${libsuff}
892+ ## dynamically link against Qwt(3D) installed system-wide
893+ ## WARNING: make sure they are compiled against >= Qt4.2
894+ ## Mixing Qt 4.2 and Qt >= 4.3 compiled stuff may also
895+ ## cause problems.
896+-#unix:INCLUDEPATH += /usr/include/qwtplot3d
897+-#unix:LIBS += -lqwtplot3d
898+-#unix:LIBS += -lqwt
899++unix:INCLUDEPATH += /usr/include/qwtplot3d-qt4
900++unix:LIBS += -lqwtplot3d-qt4
901++unix:LIBS += -lqwt-qt4
902+ ##dynamically link against GSL and zlib installed system-wide
903+ #unix:LIBS += -lgsl -lgslcblas -lz -lmuparser
904+
905
906=== modified file 'debian/patches/series'
907--- debian/patches/series 2010-03-15 13:04:45 +0000
908+++ debian/patches/series 2010-07-12 22:57:40 +0000
909@@ -1,4 +1,2 @@
910-reorder-updatehorizontalheader.patch
911-makefile.patch
912-package-contains-upstream-install-documentation.patch
913-sip49.patch
914+sourcefiles_pri.diff
915+scidavis_pro.diff
916
917=== removed file 'debian/patches/sip49.patch'
918--- debian/patches/sip49.patch 2009-09-06 11:34:04 +0000
919+++ debian/patches/sip49.patch 1970-01-01 00:00:00 +0000
920@@ -1,29 +0,0 @@
921-Description: Remove INSTALL.html from 'documentation.files'
922- Solves a 'package-contains-upstream-install-documentation' lintian warning
923-Origin: arch, http://aur.archlinux.org/packages/scidavis/scidavis/sip-4.9.patch
924---- scidavis-0.2.3.orig/scidavis/python.pri
925-+++ scidavis-0.2.3/scidavis/python.pri
926-@@ -53,7 +53,6 @@
927- $${SIP_DIR}/sipscidavisPythonScript.cpp\
928- $${SIP_DIR}/sipscidavisPythonScripting.cpp\
929- $${SIP_DIR}/sipscidavisFolder.cpp\
930-- $${SIP_DIR}/sipscidavisQList.cpp\
931- $${SIP_DIR}/sipscidavisFit.cpp \
932- $${SIP_DIR}/sipscidavisExponentialFit.cpp \
933- $${SIP_DIR}/sipscidavisTwoExpFit.cpp \
934-@@ -82,4 +81,15 @@
935- $${SIP_DIR}/sipscidavisQwtSymbol.cpp \
936- $${SIP_DIR}/sipscidavisQwtPlotCurve.cpp \
937-
938-+exists($${SIP_DIR}/sipscidavisQList.cpp) {
939-+# SIP < 4.9
940-+ SOURCES += $${SIP_DIR}/sipscidavisQList.cpp
941-+} else {
942-+ SOURCES += \
943-+ $${SIP_DIR}/sipscidavisQList0100QDateTime.cpp\
944-+ $${SIP_DIR}/sipscidavisQList0101Folder.cpp\
945-+ $${SIP_DIR}/sipscidavisQList0101MyWidget.cpp\
946-+ $${SIP_DIR}/sipscidavisQList0101AbstractAspect.cpp\
947-+}
948-+
949- ###############################################################
950
951=== added file 'debian/patches/sourcefiles_pri.diff'
952--- debian/patches/sourcefiles_pri.diff 1970-01-01 00:00:00 +0000
953+++ debian/patches/sourcefiles_pri.diff 2010-07-12 22:57:40 +0000
954@@ -0,0 +1,17 @@
955+Description: package-contains-upstream-install-documentation
956+ Remove INSTALL.html from the list of installable documents
957+Author: Ruben Molina <rmolina@udea.edu.co>
958+Forwarded: not-needed
959+Last-Update: 2010-05-21
960+Index: scidavis-0.2.4/scidavis/sourcefiles.pri
961+===================================================================
962+--- scidavis-0.2.4.orig/scidavis/sourcefiles.pri 2010-05-21 10:54:38.012672730 -0500
963++++ scidavis-0.2.4/scidavis/sourcefiles.pri 2010-05-21 10:54:56.828672914 -0500
964+@@ -48,7 +48,6 @@
965+ ###################### DOCUMENTATION ########################################
966+
967+ documentation.files += ../manual/html \
968+- ../INSTALL.html \
969+ ../scidavis.css \
970+ ../scidavis-logo.png \
971+ ../README \
972
973=== modified file 'debian/rules'
974--- debian/rules 2009-09-06 11:34:04 +0000
975+++ debian/rules 2010-07-12 22:57:40 +0000
976@@ -2,7 +2,6 @@
977
978 include /usr/share/cdbs/1/rules/debhelper.mk
979 include /usr/share/cdbs/1/class/qmake.mk
980-include /usr/share/cdbs/1/rules/patchsys-quilt.mk
981
982 QMAKE = qmake-qt4
983
984
985=== added directory 'debian/source'
986=== added file 'debian/source/format'
987--- debian/source/format 1970-01-01 00:00:00 +0000
988+++ debian/source/format 2010-07-12 22:57:40 +0000
989@@ -0,0 +1,1 @@
990+3.0 (quilt)
991
992=== added file 'debian/source/options'
993--- debian/source/options 1970-01-01 00:00:00 +0000
994+++ debian/source/options 2010-07-12 22:57:40 +0000
995@@ -0,0 +1,2 @@
996+compression = "bzip2"
997+compression-level = 9
998
999=== added file 'debian/stamp-patched'
1000=== modified file 'debian/watch'
1001--- debian/watch 2009-09-06 11:34:04 +0000
1002+++ debian/watch 2010-07-12 22:57:40 +0000
1003@@ -1,2 +1,3 @@
1004 version=3
1005-http://sf.net/scidavis/scidavis-(.*)\.tar\.gz
1006+http://sf.net/scidavis/scidavis-(\d+\.\d+\.\d+)\.tar\.bz2
1007+
1008
1009=== modified file 'scidavis/icons/scidavis-splash.png'
1010Binary 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
1011=== modified file 'scidavis/icons/scidavis-splash.xcf'
1012Binary 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
1013=== modified file 'scidavis/python-sipcmd.py'
1014--- scidavis/python-sipcmd.py 2009-09-06 11:34:04 +0000
1015+++ scidavis/python-sipcmd.py 2010-07-12 22:57:40 +0000
1016@@ -1,4 +1,8 @@
1017 #!/usr/bin/python
1018 from PyQt4 import pyqtconfig
1019 config = pyqtconfig.Configuration()
1020-print " ".join([config.sip_bin, "-I", config.pyqt_sip_dir, config.pyqt_sip_flags])
1021+flags = []
1022+if config.sip_version >= 0x040a00:
1023+ # make use of docstring generation feature in SIP >= 4.10
1024+ flags.append("-o")
1025+print " ".join([config.sip_bin, "-I", config.pyqt_sip_dir, config.pyqt_sip_flags] + flags)
1026
1027=== modified file 'scidavis/python.pri'
1028--- scidavis/python.pri 2009-09-06 11:34:04 +0000
1029+++ scidavis/python.pri 2010-07-12 22:57:40 +0000
1030@@ -53,7 +53,6 @@
1031 $${SIP_DIR}/sipscidavisPythonScript.cpp\
1032 $${SIP_DIR}/sipscidavisPythonScripting.cpp\
1033 $${SIP_DIR}/sipscidavisFolder.cpp\
1034- $${SIP_DIR}/sipscidavisQList.cpp\
1035 $${SIP_DIR}/sipscidavisFit.cpp \
1036 $${SIP_DIR}/sipscidavisExponentialFit.cpp \
1037 $${SIP_DIR}/sipscidavisTwoExpFit.cpp \
1038@@ -81,5 +80,18 @@
1039 $${SIP_DIR}/sipscidavisColumn.cpp \
1040 $${SIP_DIR}/sipscidavisQwtSymbol.cpp \
1041 $${SIP_DIR}/sipscidavisQwtPlotCurve.cpp \
1042+ $${SIP_DIR}/sipscidavisQwtPlot.cpp \
1043+ $${SIP_DIR}/sipscidavisGrid.cpp \
1044+
1045+exists($${SIP_DIR}/sipscidavisQList.cpp) {
1046+# SIP < 4.9
1047+ SOURCES += $${SIP_DIR}/sipscidavisQList.cpp
1048+} else {
1049+ SOURCES += \
1050+ $${SIP_DIR}/sipscidavisQList0100QDateTime.cpp\
1051+ $${SIP_DIR}/sipscidavisQList0101Folder.cpp\
1052+ $${SIP_DIR}/sipscidavisQList0101MyWidget.cpp\
1053+ $${SIP_DIR}/sipscidavisQList0101QwtPlotCurve.cpp\
1054+}
1055
1056 ###############################################################
1057
1058=== modified file 'scidavis/scidavis.pro'
1059--- scidavis/scidavis.pro 2009-09-06 11:34:04 +0000
1060+++ scidavis/scidavis.pro 2010-07-12 22:57:40 +0000
1061@@ -18,7 +18,7 @@
1062 INSTALLS += translationfiles
1063
1064 ### names of the lupdate and lrelease programs (needed if you want to compile and install the translations automatically)
1065-### possibly needs to be adapted if you have an usual installation
1066+### possibly needs to be adapted if you have an unusual installation
1067 exists(/usr/bin/lupdate-qt4) {
1068 # Debian, Ubuntu, Fedora
1069 LUPDATE_BIN = lupdate-qt4
1070@@ -42,6 +42,11 @@
1071 ### Usually, the manual will be expected in the "manual" subfolder of "documentation.path" (see above).
1072 ### You can override this, uncomment and adjust the path behind the '=' in the next line.
1073 # manual.path = $$INSTALLBASE/share/doc/scidavis/manual
1074+### Enables choosing of help folder at runtime, instead of relying on the above path only.
1075+### The downside is that the help folder will be remembered as a configuration option, so a binary
1076+### package cannot easily update the path for its users.
1077+### Dynamic selection of the manual path was the only available option up until SciDAVis 0.2.3.
1078+DEFINES += DYNAMIC_MANUAL_PATH
1079 ### Important: translationfiles.path will be the directory where scidavis expects
1080 ### the translation .qm files at runtime. Therefore you need to set it corretly even if
1081 ### you do not use this project file to generate the translation files.
1082@@ -82,32 +87,26 @@
1083 ### are compiled against Qt4), dynamically against everything else.
1084 #############################################################################
1085
1086-unix:INCLUDEPATH += ../3rdparty/qwtplot3d/include
1087-unix:LIBS += ../3rdparty/qwtplot3d/lib/libqwtplot3d.a
1088
1089-unix:INCLUDEPATH += ../3rdparty/qwt/src
1090-unix:LIBS += ../3rdparty/qwt/lib/libqwt.a
1091
1092 unix:LIBS += -L/usr/lib$${libsuff}
1093 unix:LIBS += -lgsl -lgslcblas -lz
1094-### muparser 1.30 does not compile as a shared lib on Linux
1095-unix:LIBS += -L/usr/local/lib$${libsuff}
1096-unix:LIBS += /usr/local/lib/libmuparser.a
1097-unix:INCLUDEPATH += /usr/local/include
1098+unix:LIBS += -lmuparser
1099+unix:INCLUDEPATH += /usr/include/muParser
1100
1101 #############################################################################
1102 ### Link everything dynamically
1103 #############################################################################
1104
1105-#unix:INCLUDEPATH += /usr/include/qwt5
1106+unix:INCLUDEPATH += /usr/include/qwt-qt4
1107 #unix:LIBS += -L/usr/lib$${libsuff}
1108 ## dynamically link against Qwt(3D) installed system-wide
1109 ## WARNING: make sure they are compiled against >= Qt4.2
1110 ## Mixing Qt 4.2 and Qt >= 4.3 compiled stuff may also
1111 ## cause problems.
1112-#unix:INCLUDEPATH += /usr/include/qwtplot3d
1113-#unix:LIBS += -lqwtplot3d
1114-#unix:LIBS += -lqwt
1115+unix:INCLUDEPATH += /usr/include/qwtplot3d-qt4
1116+unix:LIBS += -lqwtplot3d-qt4
1117+unix:LIBS += -lqwt-qt4
1118 ##dynamically link against GSL and zlib installed system-wide
1119 #unix:LIBS += -lgsl -lgslcblas -lz -lmuparser
1120
1121
1122=== modified file 'scidavis/scidavisrc.py'
1123--- scidavis/scidavisrc.py 2009-09-06 11:34:04 +0000
1124+++ scidavis/scidavisrc.py 2010-07-12 22:57:40 +0000
1125@@ -245,6 +245,47 @@
1126 for name in appImports:
1127 setattr(__main__,name,getattr(__main__.scidavis.app,name))
1128
1129+# make Y columns indexable (using lookup in corresponding X column)
1130+def __column_getitem(self, index):
1131+ if self.plotDesignation() != "Y":
1132+ return None
1133+ x = self.x()
1134+ for row in range(self.rowCount()):
1135+ if x.columnMode() == "Numeric":
1136+ xval = x.valueAt(row)
1137+ elif x.columnMode() == "Text":
1138+ xval = x.textAt(row)
1139+ else:
1140+ xval = x.dateTimeAt(row)
1141+ if xval == index:
1142+ if self.columnMode() == "Numeric":
1143+ return self.valueAt(row)
1144+ elif self.columnMode() == "Text":
1145+ return self.textAt(row)
1146+ else:
1147+ return self.dateTimeAt(row)
1148+__main__.scidavis.Column.__getitem__ = __column_getitem
1149+
1150+def __column_setitem(self, index, value):
1151+ if self.plotDesignation() != "Y":
1152+ return None
1153+ x = self.x()
1154+ for row in range(x.rowCount()):
1155+ if x.columnMode() == "Numeric":
1156+ xval = x.valueAt(row)
1157+ elif x.columnMode() == "Text":
1158+ xval = x.textAt(row)
1159+ else:
1160+ xval = x.dateTimeAt(row)
1161+ if xval == index:
1162+ if self.columnMode() == "Numeric":
1163+ return self.setValueAt(row, value)
1164+ elif self.columnMode() == "Text":
1165+ return self.setTextAt(row, value)
1166+ else:
1167+ return self.setDateTimeAt(row, value)
1168+__main__.scidavis.Column.__setitem__ = __column_setitem
1169+
1170 # import utility module
1171 import sys
1172 sys.path.append(".")
1173
1174=== modified file 'scidavis/sourcefiles.pri'
1175--- scidavis/sourcefiles.pri 2009-09-06 11:34:04 +0000
1176+++ scidavis/sourcefiles.pri 2010-07-12 22:57:40 +0000
1177@@ -15,7 +15,9 @@
1178 translations/scidavis_ru.ts \
1179 translations/scidavis_ja.ts \
1180 translations/scidavis_sv.ts \
1181- translations/scidavis_pt-br.ts \
1182+ translations/scidavis_pt-br.ts \
1183+ translations/scidavis_cs.ts \
1184+ translations/scidavis_cs-alt.ts \
1185
1186 contains( INSTALLS, translationfiles ){
1187 exists(translations/scidavis_de.ts){
1188@@ -25,7 +27,9 @@
1189 translations/scidavis_ru.qm \
1190 translations/scidavis_ja.qm \
1191 translations/scidavis_sv.qm \
1192- translations/scidavis_pt-br.qm \
1193+ translations/scidavis_pt-br.qm \
1194+ translations/scidavis_cs.qm \
1195+ translations/scidavis_cs-alt.qm \
1196
1197 unix: tstarget.target = translations/scidavis_de.qm
1198 win32: tstarget.target = translations\scidavis_de.qm
1199@@ -44,7 +48,6 @@
1200 ###################### DOCUMENTATION ########################################
1201
1202 documentation.files += ../manual/html \
1203- ../INSTALL.html \
1204 ../scidavis.css \
1205 ../scidavis-logo.png \
1206 ../README \
1207@@ -123,7 +126,6 @@
1208 src/MultiLayer.h\
1209 src/LayerDialog.h \
1210 src/IntDialog.h \
1211- src/SortDialog.h\
1212 src/Bar.h \
1213 src/Cone3D.h \
1214 src/ConfigDialog.h \
1215@@ -193,6 +195,7 @@
1216 src/ExtensibleFileDialog.h\
1217 src/OpenProjectDialog.h\
1218 src/Grid.h\
1219+ src/DataPointPicker.h \
1220
1221 ###################### SOURCES ##############################################
1222
1223@@ -227,7 +230,6 @@
1224 src/MultiLayer.cpp\
1225 src/LayerDialog.cpp \
1226 src/IntDialog.cpp \
1227- src/SortDialog.cpp\
1228 src/Bar.cpp \
1229 src/Cone3D.cpp \
1230 src/DataSetDialog.cpp \
1231@@ -299,6 +301,7 @@
1232 src/OpenProjectDialog.cpp\
1233 src/Grid.cpp\
1234 src/globals.cpp \
1235+ src/DataPointPicker.cpp \
1236
1237 ###################### FORMS ##############################################
1238 FORMS += src/SciDAVisAbout.ui
1239@@ -360,6 +363,7 @@
1240 src/future/table/future_SortDialog.h \
1241 src/future/table/AsciiTableImportFilter.h \
1242 src/future/core/AbstractImportFilter.h \
1243+ src/future/core/interfaces.h \
1244
1245 SOURCES += src/future/core/AbstractAspect.cpp \
1246 src/future/core/AbstractPart.cpp \
1247@@ -373,6 +377,7 @@
1248 src/future/core/datatypes/DateTime2StringFilter.cpp \
1249 src/future/core/datatypes/String2DateTimeFilter.cpp \
1250 src/future/core/datatypes/Double2StringFilter.cpp \
1251+ src/future/core/datatypes/Double2DateTimeFilter.cpp \
1252 src/future/core/AbstractSimpleFilter.cpp \
1253 src/future/core/AbstractFilter.cpp \
1254 src/future/core/ProjectConfigPage.cpp \
1255
1256=== modified file 'scidavis/src/ApplicationWindow.cpp'
1257--- scidavis/src/ApplicationWindow.cpp 2009-09-06 11:34:04 +0000
1258+++ scidavis/src/ApplicationWindow.cpp 2010-07-12 22:57:40 +0000
1259@@ -82,7 +82,6 @@
1260 #include "FunctionCurve.h"
1261 #include "QwtPieCurve.h"
1262 #include "Spectrogram.h"
1263-#include "Integration.h"
1264 #include "Differentiation.h"
1265 #include "SmoothFilter.h"
1266 #include "FFTFilter.h"
1267@@ -915,7 +914,9 @@
1268 help->setFont(appFont);
1269
1270 help->addAction(actionShowHelp);
1271+#ifdef DYNAMIC_MANUAL_PATH
1272 help->addAction(actionChooseHelpFolder);
1273+#endif
1274 help->addSeparator();
1275 help->addAction(actionHomePage);
1276 help->addAction(actionCheckUpdates);
1277@@ -1195,6 +1196,41 @@
1278 matrix_plot_tools->setEnabled (false);
1279
1280 Graph *g = static_cast<MultiLayer*>(w)->activeGraph();
1281+ if (g) {
1282+ dataTools->blockSignals(true);
1283+ if (g->rangeSelectorsEnabled())
1284+ btnSelect->setChecked(true);
1285+ else if (g->zoomOn())
1286+ btnZoomIn->setChecked(true);
1287+ else if (g->drawArrow())
1288+ btnArrow->setChecked(true);
1289+ else if (g->drawLineActive())
1290+ btnLine->setChecked(true);
1291+ else if (g->activeTool() == 0)
1292+ btnPointer->setChecked(true);
1293+ else switch (g->activeTool()->rtti()) {
1294+ case PlotToolInterface::DataPicker:
1295+ switch (static_cast<DataPickerTool*>(g->activeTool())->mode()) {
1296+ case DataPickerTool::Display:
1297+ btnCursor->setChecked(true);
1298+ break;
1299+ case DataPickerTool::Move:
1300+ btnMovePoints->setChecked(true);
1301+ break;
1302+ case DataPickerTool::Remove:
1303+ btnRemovePoints->setChecked(true);
1304+ break;
1305+ }
1306+ break;
1307+ case PlotToolInterface::ScreenPicker:
1308+ btnPicker->setChecked(true);
1309+ break;
1310+ default:
1311+ btnPointer->setChecked(true);
1312+ break;
1313+ }
1314+ dataTools->blockSignals(false);
1315+ }
1316 if (g && g->curves() > 0) {
1317 plot_tools->setEnabled(true);
1318 QwtPlotCurve *c = g->curve(g->curves()-1);
1319@@ -1437,7 +1473,7 @@
1320
1321 Table * table = static_cast<Table *>(d_workspace->activeWindow());
1322
1323- if (!validFor2DPlot(table))
1324+ if (!validFor2DPlot(table, Graph::VectXYXY))
1325 return;
1326
1327 QStringList s = table->selectedColumns();
1328@@ -1456,7 +1492,7 @@
1329
1330 Table * table = static_cast<Table *>(d_workspace->activeWindow());
1331
1332- if (!validFor2DPlot(table))
1333+ if (!validFor2DPlot(table, Graph::VectXYAM))
1334 return;
1335
1336 QStringList s = table->selectedColumns();
1337@@ -2164,14 +2200,19 @@
1338 return 0;
1339
1340 Table* w = (Table*)d_workspace->activeWindow();
1341- if (!validFor2DPlot(w))
1342+ if (!validFor2DPlot(w, style))
1343 return 0;
1344
1345- QStringList list=w->selectedYColumns();
1346- if((int)list.count() < 1)
1347- {
1348- QMessageBox::warning(this, tr("Plot error"), tr("Please select a Y column to plot!"));
1349- return 0;
1350+ QStringList list;
1351+ switch (style) {
1352+ case Graph::Histogram:
1353+ case Graph::Pie:
1354+ case Graph::Box:
1355+ list = w->selectedColumns();
1356+ break;
1357+ default:
1358+ list = w->selectedYColumns();
1359+ break;
1360 }
1361
1362 int curves = (int)list.count();
1363@@ -3304,7 +3345,8 @@
1364 {
1365 int missing_columns = temp->columnCount() - table->columnCount();
1366 for (int col=0; col<missing_columns; col++) {
1367- Column * new_col = new Column(tr("new_by_import") + QString::number(col+1), SciDAVis::Text);
1368+ Column * new_col = new Column(tr("new_by_import") + QString::number(col+1),
1369+ local_convert_to_numeric ? SciDAVis::Numeric : SciDAVis::Text);
1370 new_col->setPlotDesignation(SciDAVis::Y);
1371 table->d_future_table->addChild(new_col);
1372 }
1373@@ -3317,6 +3359,7 @@
1374 Column * dst_col = table->column(col);
1375 Q_ASSERT(src_col->dataType() == dst_col->dataType());
1376 dst_col->copy(src_col, 0, start_row, src_col->rowCount());
1377+ if (local_rename_columns) dst_col->setName(src_col->name());
1378 }
1379 break;
1380 }
1381@@ -3330,6 +3373,7 @@
1382 Column * dst_col = table->column(col);
1383 Q_ASSERT(src_col->dataType() == dst_col->dataType());
1384 dst_col->copy(src_col, 0, 0, temp->rowCount());
1385+ if (local_rename_columns) dst_col->setName(src_col->name());
1386 }
1387 if (temp->columnCount() > table->columnCount())
1388 {
1389@@ -3653,14 +3697,8 @@
1390 {
1391 title = titleBase + QString::number(++aux)+"/"+QString::number(widgets);
1392 progress.setLabelText(title);
1393- QStringList lst;
1394- while ( s!="</table>" )
1395- {
1396- s=t.readLine();
1397- lst<<s;
1398- }
1399- lst.pop_back();
1400- openTable(app,lst);
1401+
1402+ openTable(app, t);
1403 progress.setValue(aux);
1404 }
1405 else if (s.left(17)=="<TableStatistics>")
1406@@ -3712,7 +3750,7 @@
1407 {
1408 Folder *parent = (Folder *)app->current_folder->parent();
1409 if (!parent)
1410- app->current_folder = projectFolder();
1411+ app->current_folder = app->projectFolder();
1412 else
1413 app->current_folder = parent;
1414 }
1415@@ -4111,7 +4149,7 @@
1416 temp_locale.setNumberOptions(temp_locale.numberOptions() | QLocale::OmitGroupSeparator);
1417 QLocale::setDefault(temp_locale);
1418
1419- d_decimal_digits = settings.value("/DecimalDigits", 14).toInt();
1420+ d_decimal_digits = settings.value("/DecimalDigits", 6).toInt();
1421 d_default_numeric_format = settings.value("/DefaultNumericFormat", 'g').toChar().toAscii();
1422
1423 //restore geometry of main window
1424@@ -4148,41 +4186,26 @@
1425 settings.beginGroup("/Paths");
1426 workingDir = settings.value("/WorkingDir", qApp->applicationDirPath()).toString();
1427
1428+#ifdef DYNAMIC_MANUAL_PATH
1429 #ifdef MANUAL_PATH
1430 helpFilePath = settings.value("/HelpFile", MANUAL_PATH "/index.html").toString();
1431 #elif defined(DOC_PATH)
1432 helpFilePath = settings.value("/HelpFile", DOC_PATH "/manual/index.html").toString();
1433-#elif defined(Q_OS_WIN)
1434- helpFilePath = settings.value("/HelpFile", qApp->applicationDirPath()+"/manual/index.html").toString();
1435 #else
1436 QVariant help_file_setting = settings.value("/HelpFile");
1437 if (help_file_setting.isValid())
1438 helpFilePath = help_file_setting.toString();
1439- else {
1440- QFileInfo help_file_info;
1441- QString help_dir_base = QString("/usr/share/doc/scidavis-%1.%2.%3")
1442- .arg((scidavis_version & 0xff0000) >> 16)
1443- .arg((scidavis_version & 0x00ff00) >> 8)
1444- .arg(scidavis_version & 0x0000ff);
1445- help_file_info.setFile(help_dir_base);
1446- if (!help_file_info.exists())
1447- help_dir_base = "/usr/share/doc/scidavis";
1448- QStringList help_dir_suffixes;
1449- QString locale = QLocale().name(); // language_country according to ISO 639 and 3166, respectively
1450- help_dir_suffixes
1451- << QString("-") + locale
1452- << QString("-") + locale.section('_',0,0)
1453- << QString("-") + appLanguage
1454- << "-en"
1455- << "";
1456- foreach (QString suffix, help_dir_suffixes) {
1457- help_file_info.setFile(help_dir_base + QString("/manual%1/index.html").arg(suffix));
1458- if (help_file_info.exists())
1459- break;
1460- }
1461- // intentionally defaults to /usr/share/doc/scidavis/manual/index.html even if it doesn't exist
1462- helpFilePath = help_file_info.absoluteFilePath();
1463- }
1464+ else
1465+ helpFilePath = guessHelpFolder();
1466+#endif
1467+#else // ifdef DYNAMIC_MANUAL_PATH
1468+#ifdef MANUAL_PATH
1469+ helpFilePath = MANUAL_PATH "/index.html";
1470+#elif defined(DOC_PATH)
1471+ helpFilePath = DOC_PATH "/manual/index.html";
1472+#else
1473+ helpFilePath = guessHelpFolder();
1474+#endif
1475 #endif
1476
1477 #ifdef Q_OS_WIN
1478@@ -4349,7 +4372,7 @@
1479 simplify_spaces = settings.value("/SimplifySpaces", false).toBool();
1480 d_ASCII_file_filter = settings.value("/AsciiFileTypeFilter", "*").toString();
1481 d_ASCII_import_locale = settings.value("/AsciiImportLocale", "C").toString();
1482- d_convert_to_numeric = settings.value("/ConvertToNumeric", false).toBool();
1483+ d_convert_to_numeric = settings.value("/ConvertToNumeric", true).toBool();
1484 settings.endGroup(); // Import ASCII
1485
1486 settings.beginGroup("/ExportImage");
1487@@ -8202,13 +8225,8 @@
1488 tr("Please indicate the location of the help file!")+"<br>"+
1489 tr("The manual can be downloaded from the following internet address:")+
1490 "<p><a href = http://sourceforge.net/project/showfiles.php?group_id=199120>http://sourceforge.net/project/showfiles.php?group_id=199120</a></p>");
1491- QString fn = QFileDialog::getOpenFileName(QDir::currentDirPath(), "*.html", this );
1492- if (!fn.isEmpty())
1493- {
1494- QFileInfo fi(fn);
1495- helpFilePath=fi.absFilePath();
1496- saveSettings();
1497- }
1498+ chooseHelpFolder();
1499+ saveSettings();
1500 }
1501
1502 QFileInfo fi(helpFilePath);
1503@@ -9201,10 +9219,17 @@
1504 }
1505
1506 // TODO: most of this code belongs into Table
1507-Table* ApplicationWindow::openTable(ApplicationWindow* app, const QStringList &flist)
1508+Table* ApplicationWindow::openTable(ApplicationWindow* app, QTextStream &stream)
1509 {
1510 if (app->d_file_version < 0x000200)
1511 {
1512+ QStringList flist;
1513+ QString s;
1514+ while (s != "</table>") {
1515+ s = stream.readLine();
1516+ flist << s;
1517+ }
1518+ flist.pop_back();
1519 QStringList::const_iterator line = flist.begin();
1520
1521 QStringList list=(*line).split("\t");
1522@@ -9294,13 +9319,35 @@
1523 }
1524 else
1525 {
1526+ QString s = stream.readLine();
1527+ int length = s.toInt();
1528+
1529+ // On Windows, loading large tables to a QString has been observed to crash
1530+ // (apparently due to excessive memory usage).
1531+ // => use temporary file if possible
1532+ QTemporaryFile tmp_file;
1533+ QString tmp_string;
1534+ if (tmp_file.open()) {
1535+ QTextStream tmp(&tmp_file);
1536+ tmp.setEncoding(QTextStream::UnicodeUTF8);
1537+ int read = 0;
1538+ while (length - read >= 1024) {
1539+ tmp << stream.read(1024);
1540+ read += 1024;
1541+ }
1542+ tmp << stream.read(length - read);
1543+ tmp.flush();
1544+ tmp_file.seek(0);
1545+ stream.readLine(); // skip to next newline
1546+ } else
1547+ while (tmp_string.length() < length)
1548+ tmp_string += '\n' + stream.readLine();
1549+
1550+ XmlStreamReader reader(tmp_string);
1551+ if (tmp_file.isOpen())
1552+ reader.setDevice(&tmp_file);
1553+
1554 Table* w = app->newTable("table", 1, 1);
1555- int length = flist.at(0).toInt();
1556- int index = 1;
1557- QString xml(flist.at(index++));
1558- while (xml.length() < length && index < flist.size())
1559- xml += '\n' + flist.at(index++);
1560- XmlStreamReader reader(xml);
1561 reader.readNext();
1562 reader.readNext(); // read the start document
1563 if (w->d_future_table->load(&reader) == false)
1564@@ -9317,7 +9364,11 @@
1565 QMessageBox::warning(this, tr("Project loading partly failed"), msg_text);
1566 }
1567 w->setBirthDate(w->d_future_table->creationTime().toString(Qt::LocalDate));
1568- restoreWindowGeometry(app, w, flist.at(index));
1569+
1570+ s = stream.readLine();
1571+ restoreWindowGeometry(app, w, s);
1572+
1573+ s = stream.readLine(); // </table>
1574
1575 return w;
1576 }
1577@@ -9609,6 +9660,20 @@
1578 else if(plotType == Graph::Box) {
1579 ag->openBoxDiagram(w, curve, d_file_version);
1580 curve_loaded = true;
1581+ } else if (plotType == Graph::Histogram) {
1582+ if (d_file_version < 90)
1583+ curve_loaded = ag->plotHistogram(w, QStringList() << curve[2]);
1584+ else
1585+ curve_loaded = ag->plotHistogram(w, QStringList() << curve[2],
1586+ curve[curve.count()-3].toInt(), curve[curve.count()-2].toInt());
1587+ if (curve_loaded) {
1588+ QwtHistogram *h = (QwtHistogram *)ag->curve(curveID);
1589+ if (d_file_version <= 76)
1590+ h->setBinning(curve[16].toInt(),curve[17].toDouble(),curve[18].toDouble(),curve[19].toDouble());
1591+ else
1592+ h->setBinning(curve[17].toInt(),curve[18].toDouble(),curve[19].toDouble(),curve[20].toDouble());
1593+ h->loadData();
1594+ }
1595 } else {
1596 if (d_file_version < 72)
1597 curve_loaded = ag->insertCurve(w, curve[1].toInt(), curve[2], plotType);
1598@@ -9622,16 +9687,6 @@
1599 }
1600 }
1601
1602- if(curve_loaded && plotType == Graph::Histogram)
1603- {
1604- QwtHistogram *h = (QwtHistogram *)ag->curve(curveID);
1605- if (d_file_version <= 76)
1606- h->setBinning(curve[16].toInt(),curve[17].toDouble(),curve[18].toDouble(),curve[19].toDouble());
1607- else
1608- h->setBinning(curve[17].toInt(),curve[18].toDouble(),curve[19].toDouble(),curve[20].toDouble());
1609- h->loadData();
1610- }
1611-
1612 if(curve_loaded && (plotType == Graph::VerticalBars || plotType == Graph::HorizontalBars ||
1613 plotType == Graph::Histogram))
1614 {
1615@@ -10184,27 +10239,18 @@
1616 btnPointer->setChecked(true);
1617 }
1618
1619-void ApplicationWindow::disableTools()
1620-{
1621- QWidgetList *windows = windowsList();
1622- foreach(QWidget *w, *windows)
1623- {
1624- if (w->inherits("MultiLayer"))
1625- {
1626- QWidgetList lst= ((MultiLayer *)w)->graphPtrs();
1627- foreach(QWidget *widget, lst)
1628- ((Graph *)widget)->disableTools();
1629- }
1630- }
1631- delete windows;
1632-}
1633-
1634 void ApplicationWindow::pickDataTool( QAction* action )
1635 {
1636 if (!action)
1637 return;
1638
1639- disableTools();
1640+ MultiLayer *m = qobject_cast<MultiLayer*>(d_workspace->activeWindow());
1641+ if (!m) return;
1642+
1643+ Graph *g = m->activeGraph();
1644+ if (!g) return;
1645+
1646+ g->disableTools();
1647
1648 if (action == btnCursor)
1649 showCursor();
1650@@ -10695,8 +10741,10 @@
1651 actionShowHelp->setShortcut( tr("Ctrl+H") );
1652 connect(actionShowHelp, SIGNAL(activated()), this, SLOT(showHelp()));
1653
1654+#ifdef DYNAMIC_MANUAL_PATH
1655 actionChooseHelpFolder = new QAction(tr("&Choose Help Folder..."), this);
1656 connect(actionChooseHelpFolder, SIGNAL(activated()), this, SLOT(chooseHelpFolder()));
1657+#endif
1658
1659 actionRename = new QAction(tr("&Rename Window"), this);
1660 connect(actionRename, SIGNAL(activated()), this, SLOT(renameActiveWindow()));
1661@@ -11161,7 +11209,10 @@
1662 actionShowHelp->setMenuText(tr("&Help"));
1663 actionShowHelp->setShortcut(tr("Ctrl+H"));
1664
1665+#ifdef DYNAMIC_MANUAL_PATH
1666 actionChooseHelpFolder->setMenuText(tr("&Choose Help Folder..."));
1667+#endif
1668+
1669 actionRename->setMenuText(tr("&Rename Window"));
1670
1671 actionCloseWindow->setMenuText(tr("Close &Window"));
1672@@ -12083,13 +12134,7 @@
1673 }
1674 else if (s == "<table>")
1675 {
1676- while ( s!="</table>" )
1677- {
1678- s=t.readLine();
1679- lst<<s;
1680- }
1681- lst.pop_back();
1682- openTable(this,lst);
1683+ openTable(this, t);
1684 }
1685 else if (s == "<matrix>")
1686 {
1687@@ -12220,6 +12265,29 @@
1688 QApplication::restoreOverrideCursor();
1689 }
1690
1691+void ApplicationWindow::rawSaveFolder(Folder *folder, QIODevice *device)
1692+{
1693+ QTextStream stream(device);
1694+ stream.setEncoding(QTextStream::UnicodeUTF8);
1695+ foreach (MyWidget *w, folder->windowsList()) {
1696+ Table *t = qobject_cast<Table*>(w);
1697+ if (t)
1698+ t->saveToDevice(device, windowGeometryInfo(w));
1699+ else
1700+ stream << w->saveToString(windowGeometryInfo(w));
1701+ }
1702+ foreach (Folder *subfolder, folder->folders()) {
1703+ stream << "<folder>\t"+QString(subfolder->name())+"\t"+subfolder->birthDate()+"\t"+subfolder->modificationDate();
1704+ if (subfolder == current_folder)
1705+ stream << "\tcurrent\n";
1706+ else
1707+ stream << "\n"; // FIXME: Having no 5th string here is not a good idea
1708+ stream.flush();
1709+ rawSaveFolder(subfolder, device);
1710+ stream << "</folder>\n";
1711+ }
1712+}
1713+
1714 void ApplicationWindow::saveFolder(Folder *folder, const QString& fn)
1715 {
1716 // file saving procedure follows
1717@@ -12240,62 +12308,14 @@
1718
1719 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
1720
1721- QList<MyWidget *> lst = folder->windowsList();
1722- int windows = 0;
1723- QString text;
1724- foreach(MyWidget *w, lst)
1725- {
1726- text += w->saveToString(windowGeometryInfo(w));
1727- windows++;
1728- }
1729-
1730- FolderListItem *fi = folder->folderListItem();
1731- FolderListItem *item = (FolderListItem *)fi->firstChild();
1732- int opened_folders = 0;
1733- int initial_depth = fi->depth();
1734- while (item && item->depth() > initial_depth)
1735- {
1736- Folder *dir = (Folder *)item->folder();
1737- text += "<folder>\t"+QString(dir->name())+"\t"+dir->birthDate()+"\t"+dir->modificationDate();
1738- if (dir == current_folder)
1739- text += "\tcurrent\n";
1740- else
1741- text += "\n"; // FIXME: Having no 5th string here is not a good idea
1742-
1743- lst = dir->windowsList();
1744- foreach(MyWidget *w, lst)
1745- {
1746- text += w->saveToString(windowGeometryInfo(w));
1747- windows++;
1748- }
1749-
1750- if ( (dir->children()).isEmpty() )
1751- text += "</folder>\n";
1752- else
1753- opened_folders++;
1754-
1755- int depth = item->depth();
1756- item = (FolderListItem *)item->itemBelow();
1757- if (item && item->depth() < depth && item->depth() > initial_depth)
1758- {
1759- text += "</folder>\n";
1760- opened_folders--;
1761- }
1762- else if (!item)
1763- {
1764- for (int i = 0; i<opened_folders; i++)
1765- text += "</folder>\n";
1766- opened_folders = 0;
1767- }
1768- }
1769- text += "<log>\n"+logInfo+"</log>";
1770- text.prepend("<windows>\t"+QString::number(windows)+"\n");
1771- text.prepend("<scripting-lang>\t"+QString(scriptEnv->name())+"\n");
1772- text.prepend(SciDAVis::versionString() + " project file\n");
1773-
1774 QTextStream t( &f );
1775 t.setEncoding(QTextStream::UnicodeUTF8);
1776- t << text;
1777+ t << SciDAVis::versionString() + " project file\n";
1778+ t << "<scripting-lang>\t"+QString(scriptEnv->name())+"\n";
1779+ t << "<windows>\t"+QString::number(folder->windowCount(true))+"\n";
1780+ t.flush();
1781+ rawSaveFolder(folder, &f);
1782+ t << "<log>\n"+logInfo+"</log>";
1783
1784 // second part of secure file saving (see comment at the start of this method)
1785 #ifdef Q_OS_WIN
1786@@ -13133,6 +13153,7 @@
1787 folders->setCurrentItem(dest_f->folderListItem());
1788 changeFolder(dest_f, true);
1789 folders->setFocus();
1790+ modifiedProject();
1791 }
1792
1793 void ApplicationWindow::moveFolder(FolderListItem *src, FolderListItem *dest)
1794@@ -13561,22 +13582,29 @@
1795 return true;
1796 }
1797
1798-bool ApplicationWindow::validFor2DPlot(Table *table)
1799+bool ApplicationWindow::validFor2DPlot(Table *table, int type)
1800 {
1801- if (table->selectedColumnCount(SciDAVis::Y) < 1)
1802- {
1803- QMessageBox::warning(this, tr("Error"), tr("Please select a Y column to plot!"));
1804- return false;
1805- }
1806- else if (table->numCols() < 2)
1807- {
1808- QMessageBox::critical(this, tr("Error"),tr("You need at least two columns for this operation!"));
1809- return false;
1810- }
1811- else if (table->noXColumn())
1812- {
1813- QMessageBox::critical(this, tr("Error"), tr("Please set a default X column for this table, first!"));
1814- return false;
1815+ switch (type) {
1816+ case Graph::Histogram:
1817+ case Graph::Pie:
1818+ case Graph::Box:
1819+ if (table->selectedColumnCount() < 1) {
1820+ QMessageBox::warning(this, tr("Error"), tr("Please select a column to plot!"));
1821+ return false;
1822+ }
1823+ break;
1824+ default:
1825+ if (table->selectedColumnCount(SciDAVis::Y) < 1) {
1826+ QMessageBox::warning(this, tr("Error"), tr("Please select a Y column to plot!"));
1827+ return false;
1828+ } else if (table->numCols() < 2) {
1829+ QMessageBox::critical(this, tr("Error"),tr("You need at least two columns for this operation!"));
1830+ return false;
1831+ } else if (table->noXColumn()) {
1832+ QMessageBox::critical(this, tr("Error"), tr("Please set a default X column for this table, first!"));
1833+ return false;
1834+ }
1835+ break;
1836 }
1837
1838 return true;
1839@@ -13588,9 +13616,19 @@
1840 return;
1841
1842 Table *table = qobject_cast<Table *>(d_workspace->activeWindow());
1843- if (table && validFor2DPlot(table)) {
1844- multilayerPlot(table, table->drawableColumnSelection(), (Graph::CurveType)type,
1845- table->firstSelectedRow(), table->lastSelectedRow());
1846+ if (table && validFor2DPlot(table, type)) {
1847+ switch (type) {
1848+ case Graph::Histogram:
1849+ case Graph::Pie:
1850+ case Graph::Box:
1851+ multilayerPlot(table, table->selectedColumns(), (Graph::CurveType)type,
1852+ table->firstSelectedRow(), table->lastSelectedRow());
1853+ break;
1854+ default:
1855+ multilayerPlot(table, table->drawableColumnSelection(), (Graph::CurveType)type,
1856+ table->firstSelectedRow(), table->lastSelectedRow());
1857+ break;
1858+ }
1859 return;
1860 }
1861
1862@@ -13669,3 +13707,34 @@
1863 result.append(aspect->name());
1864 return result;
1865 }
1866+
1867+QString ApplicationWindow::guessHelpFolder()
1868+{
1869+#if defined(Q_OS_WIN)
1870+ return qApp->applicationDirPath()+"/manual/index.html";
1871+#else
1872+ QFileInfo help_file_info;
1873+ QString help_dir_base = QString("/usr/share/doc/scidavis-%1.%2.%3")
1874+ .arg((SciDAVis::version() & 0xff0000) >> 16)
1875+ .arg((SciDAVis::version() & 0x00ff00) >> 8)
1876+ .arg(SciDAVis::version() & 0x0000ff);
1877+ help_file_info.setFile(help_dir_base);
1878+ if (!help_file_info.exists())
1879+ help_dir_base = "/usr/share/doc/scidavis";
1880+ QStringList help_dir_suffixes;
1881+ QString locale = QLocale().name(); // language_country according to ISO 639 and 3166, respectively
1882+ help_dir_suffixes
1883+ << QString("-") + locale
1884+ << QString("-") + locale.section('_',0,0)
1885+ << QString("-") + appLanguage
1886+ << "-en"
1887+ << "";
1888+ foreach (QString suffix, help_dir_suffixes) {
1889+ help_file_info.setFile(help_dir_base + QString("/manual%1/index.html").arg(suffix));
1890+ if (help_file_info.exists())
1891+ break;
1892+ }
1893+ // intentionally defaults to /usr/share/doc/scidavis/manual/index.html even if it doesn't exist
1894+ return help_file_info.absoluteFilePath();
1895+#endif
1896+}
1897
1898=== modified file 'scidavis/src/ApplicationWindow.h'
1899--- scidavis/src/ApplicationWindow.h 2009-09-06 11:34:04 +0000
1900+++ scidavis/src/ApplicationWindow.h 2010-07-12 22:57:40 +0000
1901@@ -496,7 +496,7 @@
1902 //! \name Reading from a Project File
1903 //@{
1904 Matrix* openMatrix(ApplicationWindow* app, const QStringList &flist);
1905- Table* openTable(ApplicationWindow* app, const QStringList &flist);
1906+ Table* openTable(ApplicationWindow* app, QTextStream &stream);
1907 TableStatistics* openTableStatistics(const QStringList &flist);
1908 Graph3D* openSurfacePlot(ApplicationWindow* app, const QStringList &lst);
1909 Graph* openGraph(ApplicationWindow* app, MultiLayer *plot, const QStringList &list);
1910@@ -549,7 +549,6 @@
1911 void showCursor();
1912 void showScreenReader();
1913 void pickPointerCursor();
1914- void disableTools();
1915 void pickDataTool( QAction* action );
1916
1917 void updateLog(const QString& result);
1918@@ -639,6 +638,7 @@
1919 void showHelp();
1920 static void showStandAloneHelp();
1921 void chooseHelpFolder();
1922+ QString guessHelpFolder();
1923 void showPlotWizard();
1924 void showFitPolynomDialog();
1925 void showIntegrationDialog();
1926@@ -830,6 +830,7 @@
1927 void saveAsProject();
1928 void saveFolderAsProject(Folder *f);
1929 void saveFolder(Folder *folder, const QString& fn);
1930+ void rawSaveFolder(Folder *folder, QIODevice *device);
1931
1932 //! adds a folder list item to the list view "lv"
1933 void addFolderListViewItem(Folder *f);
1934@@ -1008,7 +1009,7 @@
1935 //! Check whether a table is valid for a 3D plot and display an appropriate error if not
1936 bool validFor3DPlot(Table *table);
1937 //! Check whether a table is valid for a 2D plot and display an appropriate error if not
1938- bool validFor2DPlot(Table *table);
1939+ bool validFor2DPlot(Table *table, int type);
1940
1941 //! Workaround for the new colors introduced in rev 447
1942 int convertOldToNewColorIndex(int cindex);
1943@@ -1058,7 +1059,10 @@
1944 QAction *actionShowExpDecayDialog, *actionShowTwoExpDecayDialog, *actionShowExpDecay3Dialog;
1945 QAction *actionFitExpGrowth, *actionFitSigmoidal, *actionFitGauss, *actionFitLorentz, *actionShowFitDialog;
1946 QAction *actionShowAxisDialog, *actionShowTitleDialog;
1947- QAction *actionAbout, *actionShowHelp, *actionChooseHelpFolder;
1948+ QAction *actionAbout, *actionShowHelp;
1949+#ifdef DYNAMIC_MANUAL_PATH
1950+ QAction *actionChooseHelpFolder;
1951+#endif
1952 QAction *actionRename, *actionCloseWindow, *actionConvertTable;
1953 QAction *actionAddColToTable, *actionDeleteLayer, *actionInterpolate;
1954 QAction *actionResizeActiveWindow, *actionHideActiveWindow;
1955
1956=== modified file 'scidavis/src/AssociationsDialog.cpp'
1957--- scidavis/src/AssociationsDialog.cpp 2009-09-06 11:34:04 +0000
1958+++ scidavis/src/AssociationsDialog.cpp 2010-07-12 22:57:40 +0000
1959@@ -45,7 +45,7 @@
1960 #include <QMessageBox>
1961
1962 AssociationsDialog::AssociationsDialog( QWidget* parent, Qt::WFlags fl )
1963- : QDialog( parent, fl )
1964+ : QDialog( parent, fl ), graph(0)
1965 {
1966 setWindowTitle( tr( "Plot Associations" ) );
1967 setSizeGripEnabled(true);
1968
1969=== modified file 'scidavis/src/AxesDialog.cpp'
1970--- scidavis/src/AxesDialog.cpp 2009-09-06 11:34:04 +0000
1971+++ scidavis/src/AxesDialog.cpp 2010-07-12 22:57:40 +0000
1972@@ -1310,7 +1310,16 @@
1973 else if (format == Graph::Time || format == Graph::Date || format == Graph::DateTime)
1974 {
1975 QStringList lst = formatInfo[axis].split(";", QString::KeepEmptyParts);
1976- if ((int)lst.count() >= 2)
1977+ if (lst.size() < 2 || lst[0].isEmpty()) {
1978+ lst = QStringList();
1979+ if (format == Graph::Time)
1980+ lst << QTime(0,0,0).toString();
1981+ else if (format == Graph::Date)
1982+ lst << QDate(1,1,1).toString("YYYY-MM-DD");
1983+ else
1984+ lst << QDateTime(QDate(1,1,1), QTime(0,0,0)).toString("YYYY-MM-DDTHH:MM:SS");
1985+ lst << boxFormat->currentText();
1986+ } else
1987 lst[1] = boxFormat->currentText();
1988 formatInfo[axis] = lst.join(";");
1989 }
1990@@ -1600,7 +1609,17 @@
1991 else if (type == Graph::Time || type == Graph::Date || type == Graph::DateTime)
1992 {
1993 QStringList lst = formatInfo[axis].split(";", QString::SkipEmptyParts);
1994- lst[1] = boxFormat->currentText();
1995+ if (lst.size() < 2 || lst[0].isEmpty()) {
1996+ lst = QStringList();
1997+ if (type == Graph::Time)
1998+ lst << QTime(0,0,0).toString();
1999+ else if (type == Graph::Date)
2000+ lst << QDate(1,1,1).toString("YYYY-MM-DD");
2001+ else
2002+ lst << QDateTime(QDate(1,1,1), QTime(0,0,0)).toString("YYYY-MM-DDTHH:MM:SS");
2003+ lst << boxFormat->currentText();
2004+ } else
2005+ lst[1] = boxFormat->currentText();
2006 formatInfo[axis] = lst.join(";");
2007 }
2008 else
2009@@ -1676,7 +1695,17 @@
2010 else if (type == Graph::Time || type == Graph::Date || type == Graph::DateTime)
2011 {
2012 QStringList lst = formatInfo[axis].split(";", QString::KeepEmptyParts);
2013- lst[1] = boxFormat->currentText();
2014+ if (lst.size() < 2 || lst[0].isEmpty()) {
2015+ lst = QStringList();
2016+ if (type == Graph::Time)
2017+ lst << QTime(0,0,0).toString();
2018+ else if (type == Graph::Date)
2019+ lst << QDate(1,1,1).toString("YYYY-MM-DD");
2020+ else
2021+ lst << QDateTime(QDate(1,1,1), QTime(0,0,0)).toString("YYYY-MM-DDTHH:MM:SS");
2022+ lst << boxFormat->currentText();
2023+ } else
2024+ lst[1] = boxFormat->currentText();
2025 formatInfo[axis] = lst.join(";");
2026 }
2027 else
2028
2029=== modified file 'scidavis/src/BoxCurve.cpp'
2030--- scidavis/src/BoxCurve.cpp 2009-09-06 11:34:04 +0000
2031+++ scidavis/src/BoxCurve.cpp 2010-07-12 22:57:40 +0000
2032@@ -329,7 +329,7 @@
2033 return rect;
2034 }
2035
2036-void BoxCurve::loadData()
2037+bool BoxCurve::loadData()
2038 {
2039 QVector<double> Y(abs(d_end_row - d_start_row) + 1);
2040 int ycol = d_table->colIndex(title().text());
2041@@ -358,5 +358,7 @@
2042 setData(QwtSingleArrayData(this->x(0), Y, size));
2043 } else
2044 remove();
2045+
2046+ return true;
2047 }
2048
2049
2050=== modified file 'scidavis/src/BoxCurve.h'
2051--- scidavis/src/BoxCurve.h 2009-09-06 11:34:04 +0000
2052+++ scidavis/src/BoxCurve.h 2010-07-12 22:57:40 +0000
2053@@ -75,7 +75,7 @@
2054 int whiskersRangeType(){return w_range;};
2055 void setWhiskersRange(int type, double coeff);
2056
2057- void loadData();
2058+ virtual bool loadData();
2059
2060 private:
2061 void draw(QPainter *painter,const QwtScaleMap &xMap,
2062
2063=== modified file 'scidavis/src/Correlation.cpp'
2064--- scidavis/src/Correlation.cpp 2009-09-06 11:34:04 +0000
2065+++ scidavis/src/Correlation.cpp 2010-07-12 22:57:40 +0000
2066@@ -149,17 +149,15 @@
2067 double x_temp[rows], y_temp[rows];
2068 for (int i = 0; i<rows; i++)
2069 {
2070- double x = i - n;
2071- x_temp[i] = x;
2072+ x_temp[i] = i - n;
2073
2074- double y;
2075 if(i < n)
2076 y_temp[i] = d_x[d_n - n + i];
2077 else
2078 y_temp[i] = d_x[i-n];
2079
2080- d_table->column(cols)->setValueAt(i, x);
2081- d_table->column(cols2)->setValueAt(i, y);
2082+ d_table->column(cols)->setValueAt(i, x_temp[i]);
2083+ d_table->column(cols2)->setValueAt(i, y_temp[i]);
2084 }
2085
2086 QStringList l = d_table->colNames().grep(tr("Lag"));
2087
2088=== modified file 'scidavis/src/DataPickerTool.cpp'
2089--- scidavis/src/DataPickerTool.cpp 2009-09-06 11:34:04 +0000
2090+++ scidavis/src/DataPickerTool.cpp 2010-07-12 22:57:40 +0000
2091@@ -195,9 +195,10 @@
2092 {
2093 int n_curves = d_graph->curves();
2094 int start = d_graph->curveIndex(d_selected_curve) + 1;
2095+ QwtPlotCurve *c;
2096 for (int i = start; i < start + n_curves; ++i)
2097- if (d_graph->curve(i % n_curves)->dataSize() > 0) {
2098- setSelection(d_graph->curve(i % n_curves), 0);
2099+ if ((c=d_graph->curve(i % n_curves))->dataSize() > 0) {
2100+ setSelection(c, qMin(c->dataSize()-1, d_selected_point));
2101 break;
2102 }
2103 d_graph->plotWidget()->replot();
2104@@ -208,9 +209,10 @@
2105 {
2106 int n_curves = d_graph->curves();
2107 int start = d_graph->curveIndex(d_selected_curve) + n_curves - 1;
2108+ QwtPlotCurve *c;
2109 for (int i = start; i > start - n_curves; --i)
2110- if (d_graph->curve(i % n_curves)->dataSize() > 0) {
2111- setSelection(d_graph->curve(i % n_curves), 0);
2112+ if ((c=d_graph->curve(i % n_curves))->dataSize() > 0) {
2113+ setSelection(c, qMin(c->dataSize()-1, d_selected_point));
2114 break;
2115 }
2116 d_graph->plotWidget()->replot();
2117
2118=== modified file 'scidavis/src/DataPickerTool.h'
2119--- scidavis/src/DataPickerTool.h 2009-09-06 11:34:04 +0000
2120+++ scidavis/src/DataPickerTool.h 2010-07-12 22:57:40 +0000
2121@@ -47,6 +47,8 @@
2122 enum Mode { Display, Move, Remove };
2123 enum MoveMode {Free, Vertical, Horizontal};
2124 DataPickerTool(Graph *graph, ApplicationWindow *app, Mode mode, const QObject *status_target=NULL, const char *status_slot="");
2125+ virtual RTTI rtti() const { return DataPicker; }
2126+ Mode mode() const { return d_mode; }
2127 virtual ~DataPickerTool();
2128 virtual bool eventFilter(QObject *obj, QEvent *event);
2129 bool keyEventFilter(QKeyEvent *ke);
2130
2131=== added file 'scidavis/src/DataPointPicker.cpp'
2132--- scidavis/src/DataPointPicker.cpp 1970-01-01 00:00:00 +0000
2133+++ scidavis/src/DataPointPicker.cpp 2010-07-12 22:57:40 +0000
2134@@ -0,0 +1,80 @@
2135+/***************************************************************************
2136+ File : DataPointPicker.cpp
2137+ Project : SciDAVis
2138+ --------------------------------------------------------------------
2139+ Copyright : (C) 2010 Knut Franke
2140+ Email (use @ for *) : Knut.Franke*gmx.net
2141+ Description : Let the user pick single data points from a plot.
2142+
2143+ ***************************************************************************/
2144+
2145+/***************************************************************************
2146+ * *
2147+ * This program is free software; you can redistribute it and/or modify *
2148+ * it under the terms of the GNU General Public License as published by *
2149+ * the Free Software Foundation; either version 2 of the License, or *
2150+ * (at your option) any later version. *
2151+ * *
2152+ * This program is distributed in the hope that it will be useful, *
2153+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
2154+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
2155+ * GNU General Public License for more details. *
2156+ * *
2157+ * You should have received a copy of the GNU General Public License *
2158+ * along with this program; if not, write to the Free Software *
2159+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
2160+ * Boston, MA 02110-1301 USA *
2161+ * *
2162+ ***************************************************************************/
2163+
2164+#include "DataPointPicker.h"
2165+#include "Graph.h"
2166+#include "DataPickerTool.h"
2167+
2168+/**
2169+ * \class DataPointPicker
2170+ * \brief Let the user pick single data points from a plot.
2171+ *
2172+ * While DataPickerTool does the actual selection work, DataPointPicker provides the framework
2173+ * necessary for script-driven usage. In particular, the event-oriented interface of DataPickerTool
2174+ * doesn't fit very well into the typical imparative structure of simple scripts. DataPointPicker
2175+ * bridges this gap by starting a new event loop (see QEventLoop) which allows the user to pick a
2176+ * data point while the script is still running within the main event loop. The inner event loop
2177+ * exits when the user has selected a data point, pick() returns its coordinates and control flows
2178+ * back to the caller.
2179+ */
2180+
2181+//! Constructor.
2182+DataPointPicker::DataPointPicker(Graph *g, ApplicationWindow *app)
2183+ : m_graph(g), m_app(app), m_result(NAN,NAN)
2184+{
2185+}
2186+
2187+//! Destructor (exits the event loop).
2188+DataPointPicker::~DataPointPicker() {
2189+ m_picking_loop.exit(1);
2190+}
2191+
2192+/**
2193+ * \brief Let the user pick a single data point and return its coordinates.
2194+ *
2195+ * Starts a new event loop, which runs until either the user has selected a point or the
2196+ * DataPointPicker is destructed.
2197+ */
2198+QPointF DataPointPicker::pick() {
2199+ if (m_graph->isPiePlot() || !m_graph->validCurvesDataSize())
2200+ return m_result;
2201+ DataPickerTool *tool = new DataPickerTool(m_graph, m_app, DataPickerTool::Display);
2202+ connect(tool, SIGNAL(selected(QwtPlotCurve*,int)),
2203+ this, SLOT(pointSelected(QwtPlotCurve*,int)));
2204+ m_graph->setActiveTool(tool);
2205+ m_picking_loop.exec();
2206+ m_graph->setActiveTool(0);
2207+ return m_result;
2208+}
2209+
2210+//! Handle selection of a point by the user.
2211+void DataPointPicker::pointSelected(QwtPlotCurve *curve, int pointIndex) {
2212+ m_result = QPointF(curve->x(pointIndex), curve->y(pointIndex));
2213+ m_picking_loop.exit(0);
2214+}
2215
2216=== added file 'scidavis/src/DataPointPicker.h'
2217--- scidavis/src/DataPointPicker.h 1970-01-01 00:00:00 +0000
2218+++ scidavis/src/DataPointPicker.h 2010-07-12 22:57:40 +0000
2219@@ -0,0 +1,57 @@
2220+/***************************************************************************
2221+ File : DataPointPicker.h
2222+ Project : SciDAVis
2223+ --------------------------------------------------------------------
2224+ Copyright : (C) 2010 Knut Franke
2225+ Email (use @ for *) : Knut.Franke*gmx.net
2226+ Description : Let the user pick single data points from a plot.
2227+
2228+ ***************************************************************************/
2229+
2230+/***************************************************************************
2231+ * *
2232+ * This program is free software; you can redistribute it and/or modify *
2233+ * it under the terms of the GNU General Public License as published by *
2234+ * the Free Software Foundation; either version 2 of the License, or *
2235+ * (at your option) any later version. *
2236+ * *
2237+ * This program is distributed in the hope that it will be useful, *
2238+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
2239+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
2240+ * GNU General Public License for more details. *
2241+ * *
2242+ * You should have received a copy of the GNU General Public License *
2243+ * along with this program; if not, write to the Free Software *
2244+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
2245+ * Boston, MA 02110-1301 USA *
2246+ * *
2247+ ***************************************************************************/
2248+
2249+#ifndef DATA_POINT_PICKER_H
2250+#define DATA_POINT_PICKER_H
2251+
2252+#include <QEventLoop>
2253+#include <QPointF>
2254+
2255+class Graph;
2256+class ApplicationWindow;
2257+class QwtPlotCurve;
2258+
2259+class DataPointPicker : public QObject
2260+{
2261+ Q_OBJECT
2262+
2263+ public:
2264+ DataPointPicker(Graph *g, ApplicationWindow *app);
2265+ ~DataPointPicker();
2266+ QPointF pick();
2267+ protected slots:
2268+ void pointSelected(QwtPlotCurve *curve, int pointIndex);
2269+ private:
2270+ QEventLoop m_picking_loop;
2271+ Graph *m_graph;
2272+ ApplicationWindow *m_app;
2273+ QPointF m_result;
2274+};
2275+
2276+#endif // ifndef DATA_POINT_PICKER_H
2277
2278=== modified file 'scidavis/src/Differentiation.cpp'
2279--- scidavis/src/Differentiation.cpp 2009-09-06 11:34:04 +0000
2280+++ scidavis/src/Differentiation.cpp 2010-07-12 22:57:40 +0000
2281@@ -61,28 +61,22 @@
2282
2283 void Differentiation::output()
2284 {
2285- double *result = new double[d_n-1];
2286- for (int i = 1; i < d_n-1; i++)
2287- 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]));
2288-
2289- ApplicationWindow *app = (ApplicationWindow *)parent();
2290- QString tableName = app->generateUniqueName(QString(name()));
2291- QString curveTitle = d_curve->title().text();
2292 Column *xCol = new Column(tr("1", "differention table x column name"), SciDAVis::Numeric);
2293 Column *yCol = new Column(tr("2", "differention table y column name"), SciDAVis::Numeric);
2294 xCol->setPlotDesignation(SciDAVis::X);
2295 yCol->setPlotDesignation(SciDAVis::Y);
2296- Table *t = app->newHiddenTable(tableName, tr("Derivative") + " " + tr("of","Derivative of") + " " + curveTitle, QList<Column *>() << xCol << yCol);
2297- for (int i = 1; i < d_n-1; i++)
2298- {
2299+ for (int i = 1; i < d_n-1; i++) {
2300 xCol->setValueAt(i-1, d_x[i]);
2301- yCol->setValueAt(i-1, result[i]);
2302+ 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])));
2303 }
2304- delete[] result;
2305
2306- MultiLayer *ml = app->newGraph(tr("Plot")+tr("Derivative"));
2307- ml->activeGraph()->insertCurve(t, tableName + "_" + yCol->name(), 0);
2308- Legend *l = ml->activeGraph()->legend();
2309- l->setText("\\c{1}" + tr("Derivative") + " " + tr("of","Derivative of") + " " + curveTitle);
2310+ ApplicationWindow *app = (ApplicationWindow *)parent();
2311+ QString tableName = app->generateUniqueName(QString(name()));
2312+ QString curveTitle = d_curve->title().text();
2313+ Table *t = app->newHiddenTable(tableName, tr("Derivative") + " " + tr("of","Derivative of") + " " + curveTitle, QList<Column *>() << xCol << yCol);
2314+ MultiLayer *ml = app->newGraph(tr("Plot")+tr("Derivative"));
2315+ ml->activeGraph()->insertCurve(t, tableName + "_" + yCol->name(), 0);
2316+ Legend *l = ml->activeGraph()->legend();
2317+ l->setText("\\c{1}" + tr("Derivative") + " " + tr("of","Derivative of") + " " + curveTitle);
2318 }
2319
2320
2321=== modified file 'scidavis/src/Filter.cpp'
2322--- scidavis/src/Filter.cpp 2009-09-06 11:34:04 +0000
2323+++ scidavis/src/Filter.cpp 2010-07-12 22:57:40 +0000
2324@@ -97,25 +97,24 @@
2325 else
2326 d_n = curveData(d_curve, start, end, &d_x, &d_y);
2327
2328- if (d_n == -1)
2329- {
2330- QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
2331- tr("Several data points have the same x value causing divisions by zero, operation aborted!"));
2332- d_init_err = true;
2333- return;
2334- }
2335- else if (d_n < d_min_points)
2336- {
2337- QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
2338- tr("You need at least %1 points in order to perform this operation!").arg(d_min_points));
2339- d_init_err = true;
2340- return;
2341+ if (!isDataAcceptable()) {
2342+ d_init_err = true;
2343+ return;
2344 }
2345
2346 d_from = start;
2347 d_to = end;
2348 }
2349
2350+bool Filter::isDataAcceptable() {
2351+ if (d_n < d_min_points) {
2352+ QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
2353+ tr("You need at least %1 points in order to perform this operation!").arg(d_min_points));
2354+ return false;
2355+ }
2356+ return true;
2357+}
2358+
2359 int Filter::curveIndex(const QString& curveTitle, Graph *g)
2360 {
2361 if (curveTitle.isEmpty())
2362@@ -229,74 +228,61 @@
2363
2364 int Filter::sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y)
2365 {
2366- if (!c)
2367+ if (!c || c->rtti() != QwtPlotItem::Rtti_PlotCurve)
2368 return 0;
2369-
2370- int i_start = 0, i_end = c->dataSize();
2371- for (int i = 0; i < i_end; i++)
2372- if (c->x(i) >= start)
2373- {
2374- i_start = i;
2375- break;
2376- }
2377- for (int i = i_end-1; i >= 0; i--)
2378- if (c->x(i) <= end)
2379- {
2380- i_end = i;
2381- break;
2382- }
2383- int n = i_end - i_start + 1;
2384- (*x) = new double[n];
2385- (*y) = new double[n];
2386- double *xtemp = new double[n];
2387- double *ytemp = new double[n];
2388-
2389- int j=0;
2390- for (int i = i_start; i <= i_end; i++)
2391- {
2392- xtemp[j] = c->x(i);
2393- ytemp[j++] = c->y(i);
2394- }
2395- size_t *p = new size_t[n];
2396- gsl_sort_index(p, xtemp, 1, n);
2397- for (int i=0; i<n; i++)
2398- {
2399- (*x)[i] = xtemp[p[i]];
2400- (*y)[i] = ytemp[p[i]];
2401- }
2402+
2403+ // start/end finding only works on nondecreasing data, so sort first
2404+ int datasize = c->dataSize();
2405+ double *xtemp = new double[datasize];
2406+ for (int i = 0; i < datasize; i++) {
2407+ xtemp[i] = c->x(i);
2408+ }
2409+ size_t *p = new size_t[datasize];
2410+ gsl_sort_index(p, xtemp, 1, datasize);
2411 delete[] xtemp;
2412- delete[] ytemp;
2413+
2414+ // find indices that, when permuted by the sort result, give start and end
2415+ int i_start, i_end;
2416+ for (i_start = 0; i_start < datasize; i_start++)
2417+ if (c->x(p[i_start]) >= start)
2418+ break;
2419+ for (i_end = datasize-1; i_end >= 0; i_end--)
2420+ if (c->x(p[i_end]) <= end)
2421+ break;
2422+
2423+ // make result arrays
2424+ int n = i_end - i_start + 1;
2425+ (*x) = new double[n];
2426+ (*y) = new double[n];
2427+ for (int j = 0, i = i_start; i <= i_end; i++, j++) {
2428+ (*x)[j] = c->x(p[i]);
2429+ (*y)[j] = c->y(p[i]);
2430+ }
2431 delete[] p;
2432 return n;
2433 }
2434
2435 int Filter::curveData(QwtPlotCurve *c, double start, double end, double **x, double **y)
2436 {
2437- if (!c)
2438+ if (!c || c->rtti() != QwtPlotItem::Rtti_PlotCurve)
2439 return 0;
2440
2441+ int datasize = c->dataSize();
2442 int i_start = 0, i_end = c->dataSize();
2443- for (int i = 0; i < i_end; i++)
2444- if (c->x(i) >= start)
2445- {
2446- i_start = i;
2447- break;
2448- }
2449- for (int i = i_end-1; i >= 0; i--)
2450- if (c->x(i) <= end)
2451- {
2452- i_end = i;
2453- break;
2454- }
2455+ for (i_start = 0; i_start < datasize; i_start++)
2456+ if (c->x(i_start) >= start)
2457+ break;
2458+ for (i_end = datasize-1; i_end >= 0; i_end--)
2459+ if (c->x(i_end) <= end)
2460+ break;
2461+
2462 int n = i_end - i_start + 1;
2463 (*x) = new double[n];
2464 (*y) = new double[n];
2465
2466- int j=0;
2467- for (int i = i_start; i <= i_end; i++)
2468- {
2469+ for (int j = 0, i = i_start; i <= i_end; i++, j++) {
2470 (*x)[j] = c->x(i);
2471- (*y)[j++] = c->y(i);
2472+ (*y)[j] = c->y(i);
2473 }
2474 return n;
2475 }
2476
2477=== modified file 'scidavis/src/Filter.h'
2478--- scidavis/src/Filter.h 2009-09-06 11:34:04 +0000
2479+++ scidavis/src/Filter.h 2010-07-12 22:57:40 +0000
2480@@ -89,11 +89,17 @@
2481 protected:
2482 void init();
2483
2484- //! Sets x and y to the curve points between start and end. Memory will be allocated with new double[].
2485- //! Returns the number of points within range == size of x and y arrays.
2486- virtual int curveData(QwtPlotCurve *c, double start, double end, double **x, double **y);
2487+ /**
2488+ * \brief Sets x and y to the curve points between start and end.
2489+ *
2490+ * \returns the number of points within range == size of x and y arrays.
2491+ * Memory will be allocated with new double[].
2492+ */
2493+ int curveData(QwtPlotCurve *c, double start, double end, double **x, double **y);
2494 //! Same as curveData, but sorts the points by their x value.
2495- virtual int sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y);
2496+ int sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y);
2497+
2498+ virtual bool isDataAcceptable();
2499
2500 //! Adds the result curve to the target output plot window. Creates a hidden table and frees the input data from memory.
2501 QwtPlotCurve* addResultCurve(double *x, double *y);
2502
2503=== modified file 'scidavis/src/Folder.cpp'
2504--- scidavis/src/Folder.cpp 2009-09-06 11:34:04 +0000
2505+++ scidavis/src/Folder.cpp 2010-07-12 22:57:40 +0000
2506@@ -62,7 +62,7 @@
2507 // lstWindows.setAutoDelete( true );
2508 }
2509
2510-QList<Folder*> Folder::folders()
2511+QList<Folder*> Folder::folders() const
2512 {
2513 QList<Folder*> lst;
2514 foreach(QObject *f, children())
2515
2516=== modified file 'scidavis/src/Folder.h'
2517--- scidavis/src/Folder.h 2009-09-06 11:34:04 +0000
2518+++ scidavis/src/Folder.h 2010-07-12 22:57:40 +0000
2519@@ -66,15 +66,29 @@
2520
2521 QList<MyWidget *> windowsList(){return lstWindows;};
2522
2523- void addWindow( MyWidget *w ){ lstWindows.append( w );};
2524- void removeWindow( MyWidget *w ){ lstWindows.takeAt( lstWindows.indexOf(w) );
2525- if (w==d_active_window) d_active_window=0; };
2526+ void addWindow( MyWidget *w ) {
2527+ w->setFolder(this);
2528+ lstWindows.append( w );
2529+ };
2530+ void removeWindow( MyWidget *w ){
2531+ w->setFolder(0);
2532+ lstWindows.removeAll(w);
2533+ if (w==d_active_window) d_active_window=0;
2534+ };
2535+
2536+ int windowCount(bool recursive = false) const {
2537+ int result = lstWindows.size();
2538+ if (recursive)
2539+ foreach (Folder *folder, folders())
2540+ result += folder->windowCount(true);
2541+ return result;
2542+ };
2543
2544 //! The list of subfolder names, including first generation children only
2545 QStringList subfolders();
2546
2547 //! The list of subfolders
2548- QList<Folder*> folders();
2549+ QList<Folder*> folders() const;
2550
2551 //! Pointer to the subfolder called s
2552 Folder* findSubfolder(const QString& s, bool caseSensitive = true, bool partialMatch = false);
2553
2554=== modified file 'scidavis/src/FunctionCurve.cpp'
2555--- scidavis/src/FunctionCurve.cpp 2009-09-06 11:34:04 +0000
2556+++ scidavis/src/FunctionCurve.cpp 2010-07-12 22:57:40 +0000
2557@@ -87,7 +87,8 @@
2558 if (!points)
2559 points = dataSize();
2560
2561- double X[points], Y[points];
2562+ double * X = new double[points];
2563+ double * Y = new double[points];
2564 double step = (d_to - d_from)/(double)(points - 1);
2565
2566 switch(d_function_type) {
2567@@ -102,8 +103,11 @@
2568 X[i] = x;
2569 script->setDouble(x, d_variable.toAscii().constData());
2570 QVariant result = script->eval();
2571- if (result.type() != QVariant::Double)
2572+ if (result.type() != QVariant::Double) {
2573+ delete[] X;
2574+ delete[] Y;
2575 return false;
2576+ }
2577 Y[i] = result.toDouble();
2578 }
2579 break;
2580@@ -120,8 +124,11 @@
2581 script_y->setDouble(par, d_variable.toAscii().constData());
2582 QVariant result_x = script_x->eval();
2583 QVariant result_y = script_y->eval();
2584- if (result_x.type() != QVariant::Double || result_y.type() != QVariant::Double)
2585+ if (result_x.type() != QVariant::Double || result_y.type() != QVariant::Double) {
2586+ delete[] X;
2587+ delete[] Y;
2588 return false;
2589+ }
2590 if (d_function_type == Polar) {
2591 X[i] = result_x.toDouble()*cos(result_y.toDouble());
2592 Y[i] = result_x.toDouble()*sin(result_y.toDouble());
2593@@ -135,6 +142,8 @@
2594
2595 }
2596 setData(X, Y, points);
2597+ delete[] X;
2598+ delete[] Y;
2599 return true;
2600 }
2601
2602
2603=== modified file 'scidavis/src/Graph.cpp'
2604--- scidavis/src/Graph.cpp 2009-09-06 11:34:04 +0000
2605+++ scidavis/src/Graph.cpp 2010-07-12 22:57:40 +0000
2606@@ -54,7 +54,6 @@
2607 #include "PlotCurve.h"
2608 #include "ApplicationWindow.h"
2609 #include "core/column/Column.h"
2610-#include "core/datatypes/DateTime2StringFilter.h"
2611
2612 #include <QApplication>
2613 #include <QBitmap>
2614@@ -70,6 +69,7 @@
2615 #include <QPrintDialog>
2616 #include <QImageWriter>
2617 #include <QFileInfo>
2618+#include <QRegExp>
2619
2620 #if QT_VERSION >= 0x040300
2621 #include <QSvgGenerator>
2622@@ -385,12 +385,12 @@
2623 const QwtScaleDiv div = sd_old->scaleDiv ();
2624
2625 if (format == Plot::Superscripts){
2626- QwtSupersciptsScaleDraw *sd = new QwtSupersciptsScaleDraw(formula.toAscii().constData());
2627+ QwtSupersciptsScaleDraw *sd = new QwtSupersciptsScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), formula.toAscii().constData());
2628 sd->setLabelFormat('s', prec);
2629 sd->setScaleDiv(div);
2630 d_plot->setAxisScaleDraw (axis, sd);
2631 } else {
2632- ScaleDraw *sd = new ScaleDraw(formula.toAscii().constData());
2633+ ScaleDraw *sd = new ScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), formula.toAscii().constData());
2634 sd->setScaleDiv(div);
2635
2636 if (format == Plot::Automatic)
2637@@ -726,7 +726,7 @@
2638 ScaleDraw *sd_old = (ScaleDraw *)d_plot->axisScaleDraw (axis);
2639 const QwtScaleDiv div = sd_old->scaleDiv ();
2640
2641- WeekDayScaleDraw *sd = new WeekDayScaleDraw((WeekDayScaleDraw::NameFormat)format);
2642+ WeekDayScaleDraw *sd = new WeekDayScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), (WeekDayScaleDraw::NameFormat)format);
2643 sd->setScaleDiv(div);
2644 d_plot->setAxisScaleDraw (axis, sd);
2645 }
2646@@ -739,7 +739,7 @@
2647 ScaleDraw *sd_old = (ScaleDraw *)d_plot->axisScaleDraw (axis);
2648 const QwtScaleDiv div = sd_old->scaleDiv ();
2649
2650- MonthScaleDraw *sd = new MonthScaleDraw((MonthScaleDraw::NameFormat)format);
2651+ MonthScaleDraw *sd = new MonthScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), (MonthScaleDraw::NameFormat)format);
2652 sd->setScaleDiv(div);
2653 d_plot->setAxisScaleDraw (axis, sd);
2654 }
2655@@ -754,6 +754,7 @@
2656 if (!column) return;
2657 future::Table *table = qobject_cast<future::Table*>(column->parentAspect());
2658 if (!table) return;
2659+ if (axis < 0 || axis > 3) return;
2660
2661 axisType[axis] = Txt;
2662 axesFormatInfo[axis] = table->name() + "_" + column->name();
2663@@ -762,7 +763,7 @@
2664 for (int row = startRow; row <= endRow; row++)
2665 if (!column->isInvalid(row))
2666 list.insert(row+1, column->textAt(row));
2667- d_plot->setAxisScaleDraw(axis, new QwtTextScaleDraw(list));
2668+ d_plot->setAxisScaleDraw(axis, new QwtTextScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), list));
2669 }
2670
2671 void Graph::setLabelsTextFormat(int axis, Table *table, const QString& columnName) {
2672@@ -791,13 +792,13 @@
2673 for (int col=0; col < table->columnCount(); col++)
2674 if (table->colPlotDesignation(col) == SciDAVis::Y)
2675 list.insert(col, table->colLabel(col));
2676- d_plot->setAxisScaleDraw(axis, new QwtTextScaleDraw(list));
2677+ d_plot->setAxisScaleDraw(axis, new QwtTextScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)), list));
2678 }
2679
2680 void Graph::setLabelsDateTimeFormat(int axis, int type, const QString& formatInfo)
2681 {
2682 QStringList list = formatInfo.split(";", QString::KeepEmptyParts);
2683- if ((int)list.count() < 2 || list[0].isEmpty() || list[1].isEmpty()) {
2684+ if ((int)list.count() < 2 || list[1].isEmpty()) {
2685 QMessageBox::critical(this, tr("Error"), tr("Couldn't change the axis type to the requested format!"));
2686 return;
2687 }
2688@@ -805,21 +806,24 @@
2689 switch(type) {
2690 case Time:
2691 {
2692- TimeScaleDraw *sd = new TimeScaleDraw (QTime::fromString (list[0]), list[1]);
2693+ TimeScaleDraw *sd = new TimeScaleDraw (*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)),
2694+ list[0].isEmpty() ? QTime(12,0,0,0) : QTime::fromString (list[0]), list[1]);
2695 sd->enableComponent (QwtAbstractScaleDraw::Backbone, drawAxesBackbone);
2696 d_plot->setAxisScaleDraw (axis, sd);
2697 break;
2698 }
2699 case Date:
2700 {
2701- DateScaleDraw *sd = new DateScaleDraw (QDate::fromString (list[0], "YYYY-MM-DD"), list[1]);
2702+ DateScaleDraw *sd = new DateScaleDraw(*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)),
2703+ QDate::fromString(list[0], "YYYY-MM-DD"), list[1]);
2704 sd->enableComponent (QwtAbstractScaleDraw::Backbone, drawAxesBackbone);
2705 d_plot->setAxisScaleDraw (axis, sd);
2706 break;
2707 }
2708 case DateTime:
2709 {
2710- DateTimeScaleDraw *sd = new DateTimeScaleDraw (QDateTime::fromString (list[0], "YYYY-MM-DDTHH:MM:SS"), list[1]);
2711+ DateTimeScaleDraw *sd = new DateTimeScaleDraw (*static_cast<const ScaleDraw*>(d_plot->axisScaleDraw(axis)),
2712+ QDateTime::fromString (list[0], "YYYY-MM-DDTHH:MM:SS"), list[1]);
2713 sd->enableComponent (QwtAbstractScaleDraw::Backbone, drawAxesBackbone);
2714 d_plot->setAxisScaleDraw (axis, sd);
2715 break;
2716@@ -1764,7 +1768,7 @@
2717 {
2718 int index = d_texts.indexOf(legendMarkerID);
2719 int texts = d_texts.size();
2720- for (int i=index; i<texts; i++)
2721+ for (int i=index; i<texts-1; i++)
2722 d_texts[i]=d_texts[i+1];
2723 d_texts.resize(--texts);
2724
2725@@ -1895,10 +1899,8 @@
2726 if (m_autoscale) {
2727 for (int i = 0; i < QwtPlot::axisCnt; i++)
2728 d_plot->setAxisAutoScale(i);
2729- d_plot->replot();
2730 }
2731- else
2732- updateScale();
2733+ d_plot->replot();
2734 }
2735 }
2736 }
2737@@ -3168,6 +3170,37 @@
2738 updateScale();
2739 }
2740
2741+bool Graph::plotHistogram(Table *w, QStringList names, int startRow, int endRow)
2742+{
2743+ if (!w) return false;
2744+ if (endRow < 0 || endRow >= w->numRows())
2745+ endRow = w->numRows() - 1;
2746+
2747+ bool success = false;
2748+ foreach(QString col, names) {
2749+ Column *col_ptr = w->column(col);
2750+ if (!col_ptr || col_ptr->columnMode() != SciDAVis::Numeric) continue;
2751+
2752+ QwtHistogram *c = new QwtHistogram(w, col, startRow, endRow);
2753+ c->loadData();
2754+ c->setStyle(QwtPlotCurve::UserCurve);
2755+
2756+ c_type.resize(++n_curves);
2757+ c_type[n_curves-1] = Histogram;
2758+ c_keys.resize(n_curves);
2759+ c_keys[n_curves-1] = d_plot->insertCurve(c);
2760+
2761+ CurveLayout cl = initCurveLayout(Histogram, names.size());
2762+ updateCurveLayout(n_curves-1, &cl);
2763+
2764+ addLegendItem(col);
2765+
2766+ success = true;
2767+ }
2768+
2769+ return success;
2770+}
2771+
2772 void Graph::insertPlotItem(QwtPlotItem *i, int type)
2773 {
2774 c_type.resize(++n_curves);
2775@@ -3187,52 +3220,60 @@
2776 plotPie(w, names[0], startRow, endRow);
2777 else if (style == Box)
2778 plotBoxDiagram(w, names, startRow, endRow);
2779+ else if (style == Histogram)
2780+ plotHistogram(w, names, startRow, endRow);
2781 else if (style==Graph::VectXYXY || style==Graph::VectXYAM)
2782 plotVectorCurve(w, names, style, startRow, endRow);
2783 else
2784 {
2785- int curves = (int)names.count();
2786- int errCurves = 0;
2787- QStringList lst = QStringList();
2788- for (int i=0; i<curves; i++)
2789- {//We rearrange the list so that the error bars are placed at the end
2790- int j = w->colIndex(names[i]);
2791- if (j < 0) continue;
2792- if (w->colPlotDesignation(j) == SciDAVis::xErr || w->colPlotDesignation(j) == SciDAVis::yErr)
2793- {
2794- errCurves++;
2795- lst << names[i];
2796+ QStringList errorCurves, otherCurves;
2797+ foreach(QString col, names) {
2798+ int colIndex = w->colIndex(col);
2799+ if (colIndex < 0) continue;
2800+ switch (w->colPlotDesignation(colIndex)) {
2801+ case SciDAVis::xErr:
2802+ case SciDAVis::yErr:
2803+ errorCurves << col;
2804+ break;
2805+ default:
2806+ otherCurves << col;
2807+ break;
2808 }
2809- else
2810- lst.prepend(names[i]);
2811- }
2812+ }
2813+ QStringList lst = otherCurves + errorCurves;
2814
2815- for (int i=0; i<curves; i++)
2816+ for (int i=0; i<lst.size(); i++)
2817 {
2818 CurveType type_of_i;
2819- int j = w->colIndex(names[i]);
2820+ int j = w->colIndex(lst[i]);
2821 if (j < 0) continue;
2822 bool ok = false;
2823- if (w->colPlotDesignation(j) == SciDAVis::xErr || w->colPlotDesignation(j) == SciDAVis::yErr)
2824- {
2825+ if (i >= otherCurves.size()) {
2826 type_of_i = ErrorBars;
2827- int ycol = w->colY(w->colIndex(names[i]));
2828+ int ycol = -1;
2829+ for (int k=otherCurves.size()-1; k >= 0; k--) {
2830+ int index = w->colIndex(lst[k]);
2831+ if (w->colPlotDesignation(index) == SciDAVis::Y)
2832+ ycol = index;
2833+ }
2834+ if (ycol < 0)
2835+ ycol = w->colY(w->colIndex(lst[i]));
2836 if (ycol < 0)
2837 return false;
2838
2839 if (w->colPlotDesignation(j) == SciDAVis::xErr)
2840- ok = addErrorBars(w->colName(ycol), w, names[i], (int)QwtErrorPlotCurve::Horizontal);
2841+ ok = addErrorBars(w->colName(ycol), w, lst[i], (int)QwtErrorPlotCurve::Horizontal);
2842 else
2843- ok = addErrorBars(w->colName(ycol), w, names[i]);
2844+ ok = addErrorBars(w->colName(ycol), w, lst[i]);
2845 }
2846 else {
2847 type_of_i = (CurveType) style;
2848- ok = insertCurve(w, names[i], style, startRow, endRow);
2849+ ok = insertCurve(w, lst[i], style, startRow, endRow);
2850 }
2851
2852 if (ok)
2853 {
2854- CurveLayout cl = initCurveLayout(type_of_i, curves - errCurves);
2855+ CurveLayout cl = initCurveLayout(type_of_i, otherCurves.size());
2856 cl.sSize = sSize;
2857 cl.lWidth = lWidth;
2858 updateCurveLayout(i, &cl);
2859@@ -3264,150 +3305,25 @@
2860 bool Graph::insertCurve(Table* w, const QString& xColName, const QString& yColName, int style, int startRow, int endRow)
2861 {
2862 if (!w) return false;
2863- Column *x_col_ptr = w->column(xColName);
2864- Column *y_col_ptr = w->column(yColName);
2865- if (!x_col_ptr || !y_col_ptr)
2866- return false;
2867-
2868- int xColType = x_col_ptr->columnMode();
2869- int yColType = y_col_ptr->columnMode();
2870- int row, size=0;
2871- QString date_time_fmt;
2872- if (xColType == SciDAVis::DateTime || xColType == SciDAVis::Month || xColType == SciDAVis::Day)
2873- date_time_fmt = static_cast<DateTime2StringFilter *>(x_col_ptr->outputFilter())->format();
2874-
2875- QTime time0;
2876- QDate date0;
2877- QDateTime date_time0;
2878- QLocale locale;
2879-
2880- if (endRow < 0)
2881- endRow = w->numRows() - 1;
2882-
2883- if (endRow >= x_col_ptr->rowCount())
2884- endRow = x_col_ptr->rowCount() - 1;
2885- if (endRow >= y_col_ptr->rowCount())
2886- endRow = y_col_ptr->rowCount() - 1;
2887-
2888- int r = abs(endRow - startRow) + 1;
2889- QVector<double> X(r), Y(r);
2890- if (xColType == Table::Time){
2891- for (row = startRow; row<=endRow; row++ ){
2892- if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
2893- time0 = x_col_ptr->timeAt(row);
2894- if (time0.isValid())
2895- break;
2896- }
2897- }
2898- }
2899- else if (xColType == Table::Date){
2900- for (row = startRow; row<=endRow; row++ ){
2901- if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
2902- date0 = x_col_ptr->dateAt(row);
2903- if (date0.isValid())
2904- break;
2905- }
2906- }
2907- }
2908- else if (xColType == Table::DateTime) {
2909- for (row = startRow; row<=endRow; row++ ) {
2910- if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
2911- date_time0 = x_col_ptr->dateTimeAt(row);
2912- if (date_time0.isValid())
2913- break;
2914- }
2915- }
2916- }
2917-
2918- for (row = startRow; row<=endRow; row++ ) {
2919- if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
2920- if (xColType == Table::Text) {
2921- X[size] = (double)(row+1);
2922- }
2923- else if (xColType == Table::Time) {
2924- QTime time = x_col_ptr->timeAt(row);
2925- if (time.isValid())
2926- X[size] = time0.msecsTo (time);
2927- else
2928- continue;
2929- }
2930- else if (xColType == Table::Date) {
2931- QDate d = x_col_ptr->dateAt(row);
2932- if (d.isValid())
2933- X[size] = (double) date0.daysTo(d);
2934- else
2935- continue;
2936- }
2937- else if (xColType == Table::DateTime) {
2938- QDateTime dt = x_col_ptr->dateTimeAt(row);
2939- if (dt.isValid())
2940- {
2941- X[size] = double(dt.date().toJulianDay()) +
2942- double( -dt.time().msecsTo(QTime(12,0,0,0)) ) / 86400000.0;
2943- }
2944- else
2945- continue;
2946- }
2947- else
2948- X[size] = x_col_ptr->valueAt(row);
2949-
2950- if (yColType == Table::Text) {
2951- Y[size] = (double) (row + 1);
2952- }
2953- else if (yColType == Table::Time) {
2954- QTime yval = y_col_ptr->timeAt(row);
2955- if (yval.isValid()) {
2956- Y[size] = double( -yval.msecsTo(QTime(12,0,0,0)) );
2957- }
2958- else
2959- Y[size] = 0.0;
2960- }
2961- else if (yColType == Table::Date) {
2962- QDate yval = y_col_ptr->dateAt(row);
2963- if (yval.isValid()) {
2964- Y[size] = double( yval.toJulianDay() );
2965- }
2966- else
2967- Y[size] = 0.0;
2968- }
2969- else if (yColType == Table::DateTime) {
2970- QDateTime yval = y_col_ptr->dateTimeAt(row);
2971- if (yval.isValid()) {
2972- Y[size] = double(yval.date().toJulianDay()) +
2973- double( -yval.time().msecsTo(QTime(12,0,0,0)) ) / 86400000.0;
2974- }
2975- else
2976- Y[size] = 0.0;
2977- }
2978- else
2979- Y[size] = y_col_ptr->valueAt(row);
2980-
2981- size++;
2982- }
2983- }
2984-
2985- if (!size)
2986- return false;
2987-
2988- X.resize(size);
2989- Y.resize(size);
2990-
2991 DataCurve *c = 0;
2992- if (style == VerticalBars){
2993- c = new QwtBarCurve(QwtBarCurve::Vertical, w, xColName, yColName, startRow, endRow);
2994- c->setStyle(QwtPlotCurve::UserCurve);
2995- }
2996- else if (style == HorizontalBars){
2997- c = new QwtBarCurve(QwtBarCurve::Horizontal, w, xColName, yColName, startRow, endRow);
2998- c->setStyle(QwtPlotCurve::UserCurve);
2999- }
3000- else if (style == Histogram){
3001- c = new QwtHistogram(w, xColName, yColName, startRow, endRow);
3002- ((QwtHistogram *)c)->initData(Y, size);
3003- c->setStyle(QwtPlotCurve::UserCurve);
3004- }
3005- else
3006- c = new DataCurve(w, xColName, yColName, startRow, endRow);
3007+
3008+ switch (style) {
3009+ case Histogram:
3010+ case Box:
3011+ case Pie:
3012+ return false;
3013+ case VerticalBars:
3014+ c = new QwtBarCurve(QwtBarCurve::Vertical, w, xColName, yColName, startRow, endRow);
3015+ c->setStyle(QwtPlotCurve::UserCurve);
3016+ break;
3017+ case HorizontalBars:
3018+ c = new QwtBarCurve(QwtBarCurve::Horizontal, w, xColName, yColName, startRow, endRow);
3019+ c->setStyle(QwtPlotCurve::UserCurve);
3020+ break;
3021+ default:
3022+ c = new DataCurve(w, xColName, yColName, startRow, endRow);
3023+ break;
3024+ };
3025
3026 c_type.resize(++n_curves);
3027 c_type[n_curves-1] = style;
3028@@ -3416,53 +3332,8 @@
3029
3030 c->setPen(QPen(Qt::black,widthLine));
3031
3032- if (style == HorizontalBars)
3033- c->setData(Y.data(), X.data(), size);
3034- else if (style != Histogram)
3035- c->setData(X.data(), Y.data(), size);
3036-
3037- if (xColType == Table::Text ){
3038- if (style == HorizontalBars){
3039- setLabelsTextFormat(QwtPlot::yLeft, x_col_ptr, startRow, endRow);
3040- // change default for right axis, but don't mess up an existing one
3041- if (!d_plot->axisEnabled(QwtPlot::yRight))
3042- axesFormatInfo[QwtPlot::yRight] = xColName;
3043- }
3044- else{
3045- setLabelsTextFormat(QwtPlot::xBottom, x_col_ptr, startRow, endRow);
3046- // change default for top axis, but don't mess up an existing one
3047- if (!d_plot->axisEnabled(QwtPlot::xTop))
3048- axesFormatInfo[QwtPlot::xTop] = xColName;
3049- }
3050- }
3051- else if (xColType == Table::Time){
3052- QString fmtInfo = time0.toString() + ";" + date_time_fmt;
3053- if (style == HorizontalBars)
3054- setLabelsDateTimeFormat(QwtPlot::yLeft, Time, fmtInfo);
3055- else
3056- setLabelsDateTimeFormat(QwtPlot::xBottom, Time, fmtInfo);
3057- }
3058- else if (xColType == Table::Date ){
3059- QString fmtInfo = date0.toString("YYYY-MM-DD") + ";" + date_time_fmt;
3060- if (style == HorizontalBars)
3061- setLabelsDateTimeFormat(QwtPlot::yLeft, Date, fmtInfo);
3062- else
3063- setLabelsDateTimeFormat(QwtPlot::xBottom, Date, fmtInfo);
3064- }
3065- else if (xColType == Table::DateTime ){
3066- QString fmtInfo = date_time0.toString("YYYY-MM-DDTHH:MM:SS") + ";" + date_time_fmt;
3067- if (style == HorizontalBars)
3068- setLabelsDateTimeFormat(QwtPlot::yLeft, DateTime, fmtInfo);
3069- else
3070- setLabelsDateTimeFormat(QwtPlot::xBottom, DateTime, fmtInfo);
3071- }
3072-
3073- if (yColType == Table::Text){
3074- setLabelsTextFormat(QwtPlot::yLeft, y_col_ptr, startRow, endRow);
3075- // change default for right axis, but don't mess up an existing one
3076- if (!d_plot->axisEnabled(QwtPlot::yRight))
3077- axesFormatInfo[QwtPlot::yRight] = yColName;
3078- }
3079+ if (!c->loadData())
3080+ return false;
3081
3082 addLegendItem(yColName);
3083 updatePlot();
3084@@ -3711,20 +3582,22 @@
3085 return;
3086
3087 QStringList l = items.filter( "\\c{" + QString::number(index+1) + "}" );
3088- items.remove(l[0]);//remove the corresponding legend string
3089-
3090- int cv=0;
3091- for (int i=0; i< (int)items.count(); i++)
3092- {//set new curves indexes in legend text
3093- QString item = (items[i]).trimmed();
3094- if (item.startsWith("\\c{", true))
3095- {
3096- item.remove(0, item.find("}", 0));
3097- item.prepend("\\c{"+QString::number(++cv));
3098- }
3099- items[i]=item;
3100- }
3101+ if (!l.isEmpty())
3102+ items.remove(l[0]);//remove the corresponding legend string
3103 text=items.join ( "\n" ) + "\n";
3104+
3105+ QRegExp itemCmd("\\\\c\\{(\\d+)\\}");
3106+ int pos=0;
3107+ while ((pos = itemCmd.indexIn(text, pos)) != -1) {
3108+ int nr = itemCmd.cap(1).toInt();
3109+ if (nr > index) {
3110+ QString subst = QString("\\c{") + QString::number(nr-1) + "}";
3111+ text.replace(pos, itemCmd.matchedLength(), subst);
3112+ pos += subst.length();
3113+ } else
3114+ pos += itemCmd.matchedLength();
3115+ }
3116+
3117 mrk->setText(text);
3118 }
3119
3120@@ -4662,7 +4535,7 @@
3121 }
3122 else if (style == Histogram)
3123 {
3124- c = new QwtHistogram(cv->table(), cv->xColumnName(), cv->title().text(), cv->startRow(), cv->endRow());
3125+ c = new QwtHistogram(cv->table(), cv->title().text(), cv->startRow(), cv->endRow());
3126 ((QwtHistogram *)c)->copy((const QwtHistogram*)cv);
3127 }
3128 else if (style == VectXYXY || style == VectXYAM)
3129
3130=== modified file 'scidavis/src/Graph.h'
3131--- scidavis/src/Graph.h 2009-09-06 11:34:04 +0000
3132+++ scidavis/src/Graph.h 2010-07-12 22:57:40 +0000
3133@@ -569,6 +569,9 @@
3134 */
3135 bool enableRangeSelectors(const QObject *status_target=NULL, const char *status_slot="");
3136
3137+ //! Check wether range selectors are currently enabled.
3138+ bool rangeSelectorsEnabled() const { return !d_range_selector.isNull(); }
3139+
3140 //! \name Border and Margin
3141 //@{
3142 void setMargin (int d);
3143@@ -623,6 +626,8 @@
3144 void plotBoxDiagram(Table *w, const QStringList& names, int startRow = 0, int endRow = -1);
3145 //@}
3146
3147+ bool plotHistogram(Table *w, QStringList names, int startRow=0, int endRow=-1);
3148+
3149 void setCurveSymbol(int index, const QwtSymbol& s);
3150 void setCurvePen(int index, const QPen& p);
3151 void setCurveBrush(int index, const QBrush& b);
3152
3153=== modified file 'scidavis/src/IntDialog.cpp'
3154--- scidavis/src/IntDialog.cpp 2009-09-06 11:34:04 +0000
3155+++ scidavis/src/IntDialog.cpp 2010-07-12 22:57:40 +0000
3156@@ -55,21 +55,12 @@
3157 boxName = new QComboBox();
3158 gl1->addWidget(boxName, 0, 1);
3159
3160- gl1->addWidget(new QLabel(tr("Order (1 - 5, 1 = Trapezoid Rule)")), 1, 0);
3161- boxOrder = new QSpinBox();
3162- boxOrder->setRange(1, 5);
3163- gl1->addWidget(boxOrder, 1, 1);
3164-
3165- gl1->addWidget(new QLabel(tr("Number of iterations (Max=40)")), 2, 0);
3166- boxSteps = new QSpinBox();
3167- boxSteps->setRange(2, 40);
3168- boxSteps->setValue(40);
3169- gl1->addWidget(boxSteps, 2, 1);
3170-
3171- gl1->addWidget(new QLabel(tr("Tolerance")), 3, 0);
3172- boxTol = new QLineEdit();
3173- boxTol->setText("0.01");
3174- gl1->addWidget(boxTol, 3, 1);
3175+ gl1->addWidget(new QLabel(tr("Interpolation")), 1, 0);
3176+ boxMethod = new QComboBox();
3177+ boxMethod->insertItem(tr("Linear"));
3178+ boxMethod->insertItem(tr("Cubic"));
3179+ boxMethod->insertItem(tr("Non-rounded Akima"));
3180+ gl1->addWidget(boxMethod, 1, 1);
3181
3182 gl1->addWidget(new QLabel(tr("Lower limit")), 4, 0);
3183 boxStart = new QLineEdit();
3184@@ -115,20 +106,6 @@
3185 return;
3186 }
3187
3188-try
3189- {
3190- mu::Parser parser;
3191- parser.SetExpr(boxTol->text().toAscii().constData());
3192- parser.Eval();
3193- }
3194-catch(mu::ParserError &e)
3195- {
3196- QMessageBox::critical((ApplicationWindow *)parent(),tr("Tolerance value error"),QString::fromStdString(e.GetMsg()));
3197- boxTol->clear();
3198- boxTol->setFocus();
3199- return;
3200- }
3201-
3202 double start = 0, stop = 0;
3203 double minx = c->minXValue();
3204 double maxx = c->maxXValue();
3205@@ -229,9 +206,7 @@
3206
3207 Integration *i = new Integration((ApplicationWindow *)this->parent(), graph, curveName,
3208 boxStart->text().toDouble(), boxEnd->text().toDouble());
3209-i->setTolerance(boxTol->text().toDouble());
3210-i->setMaximumIterations(boxSteps->value());
3211-i->setMethodOrder(boxOrder->value());
3212+i->setMethod((Integration::InterpolationMethod)boxMethod->currentIndex());
3213 i->run();
3214 delete i;
3215 }
3216
3217=== modified file 'scidavis/src/IntDialog.h'
3218--- scidavis/src/IntDialog.h 2009-09-06 11:34:04 +0000
3219+++ scidavis/src/IntDialog.h 2010-07-12 22:57:40 +0000
3220@@ -52,11 +52,9 @@
3221 QPushButton* buttonHelp;
3222 QCheckBox* boxShowFormula;
3223 QComboBox* boxName;
3224- QSpinBox* boxOrder;
3225- QSpinBox* boxSteps;
3226+ QComboBox* boxMethod;
3227 QLineEdit* boxStart;
3228 QLineEdit* boxEnd;
3229- QLineEdit* boxTol;
3230
3231 public slots:
3232 void accept();
3233
3234=== modified file 'scidavis/src/Integration.cpp'
3235--- scidavis/src/Integration.cpp 2009-09-06 11:34:04 +0000
3236+++ scidavis/src/Integration.cpp 2010-07-12 22:57:40 +0000
3237@@ -27,7 +27,6 @@
3238 * *
3239 ***************************************************************************/
3240 #include "Integration.h"
3241-#include "nrutil.h"
3242 #include "MultiLayer.h"
3243 #include "Legend.h"
3244
3245@@ -62,136 +61,89 @@
3246 void Integration::init()
3247 {
3248 setName(tr("Integration"));
3249- d_method = 1;
3250- d_max_iterations = 40;
3251- d_sort_data = true;
3252+ d_method = Linear;
3253+ d_sort_data = true;
3254+}
3255+
3256+bool Integration::isDataAcceptable()
3257+{
3258+ const gsl_interp_type *method_t;
3259+ switch (d_method) {
3260+ case Linear:
3261+ method_t = gsl_interp_linear;
3262+ break;
3263+ case Cubic:
3264+ method_t = gsl_interp_cspline;
3265+ break;
3266+ case Akima:
3267+ method_t = gsl_interp_akima;
3268+ break;
3269+ }
3270+ // GSL interpolation routines fail with division by zero on such data
3271+ for (int i=1; i<d_n; i++)
3272+ if (d_x[i-1] == d_x[i]) {
3273+ QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
3274+ tr("Several data points have the same x value causing divisions by zero, operation aborted!"));
3275+ return false;
3276+ }
3277+
3278+ return Filter::isDataAcceptable();
3279 }
3280
3281 QString Integration::logInfo()
3282 {
3283- // Do the interpolation, use GSL libraries for that
3284- gsl_interp_accel *acc = gsl_interp_accel_alloc();
3285- const gsl_interp_type *method;
3286- // The method for interpolation is chosen based on the number of points
3287- if(d_n>3)
3288- method=gsl_interp_linear;
3289- else if(d_n>4)
3290- method=gsl_interp_cspline;
3291- else if(d_n>5)
3292- method=gsl_interp_akima;
3293-
3294- // If we have enough points use GSL libraries for interpolation, else use the polint algorithm
3295- gsl_spline *interp ;
3296- if(d_n>3)
3297- {
3298- interp = gsl_spline_alloc (method, d_n);
3299- gsl_spline_init (interp, d_x, d_y, d_n);
3300- }
3301-
3302- // Using Numerical Recipes
3303- // This is Romberg Integration method
3304- // This method uses the Nevilles' algorithm for interpollation;
3305- double yup, ylow;
3306- double xx,tnm,sum,del,ss,dss,error,tsum;
3307- if(d_n > 3)
3308- {
3309- yup = gsl_spline_eval (interp, d_to, acc);
3310- ylow = gsl_spline_eval (interp, d_from, acc);
3311- }
3312- else if (d_n<=3)
3313- {
3314- polint(d_x,d_y,d_n,d_to,&yup,&dss);
3315- polint(d_x,d_y,d_n,d_from,&ylow,&dss);
3316- }
3317-
3318- double *S = new double[d_max_iterations];
3319- double *h = new double[d_max_iterations];
3320- int j,it,l;
3321- bool success = false;
3322- h[0]=1.0;
3323- for(j=0; j < d_max_iterations; j++)
3324- {//Trapezoid Rule
3325- if(j==0)
3326- S[0]=0.5*(d_to-d_from)*(ylow+yup);
3327- else
3328- {
3329- h[j] = 0.25*h[j-1];
3330- S[j] = S[j-1];
3331- for(it=1,l=1;l<j-1;l++)it<<=1;
3332- tnm=it;
3333- del=(d_to-d_from)/tnm;
3334- xx=d_from+0.5*del;
3335- for(sum=0.0,l=1;l<=it;l++)
3336- {
3337- if(d_n>3)
3338- sum+=gsl_spline_eval (interp,xx, acc);
3339- else if(d_n<=3)
3340- {
3341- polint(d_x,d_y,d_n,xx,&tsum,&dss);
3342- sum+=tsum;
3343- }
3344- xx+=del;
3345- }
3346- S[j]=0.5*(S[j-1]+(d_to-d_from)*sum/tnm);
3347-
3348- }
3349- if(j>=d_method)
3350- {
3351- polint(&h[j-d_method],&S[j-d_method],d_method,0,&ss,&dss);
3352- S[j]=ss;
3353- }
3354- error=fabs(S[j]-S[j-1]);
3355- if(error<=d_tolerance) success = true;
3356- if(success) break;
3357+ const gsl_interp_type *method_t;
3358+ QString method_name;
3359+ switch (d_method) {
3360+ case Linear:
3361+ method_t = gsl_interp_linear;
3362+ method_name = tr("Linear");
3363+ break;
3364+ case Cubic:
3365+ method_t = gsl_interp_cspline;
3366+ method_name = tr("Cubic");
3367+ break;
3368+ case Akima:
3369+ method_t = gsl_interp_akima;
3370+ method_name = tr("Akima");
3371+ break;
3372+ }
3373+
3374+ gsl_interp *interpolation = gsl_interp_alloc(method_t, d_n);
3375+ gsl_interp_init(interpolation, d_x, d_y, d_n);
3376+
3377+ if (d_n < gsl_interp_min_size(interpolation))
3378+ {
3379+ QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
3380+ tr("You need at least %1 points in order to perform this operation!").arg(gsl_interp_min_size(interpolation)));
3381+ d_init_err = true;
3382+ return "";
3383 }
3384
3385 QString logInfo = "[" + QDateTime::currentDateTime().toString(Qt::LocalDate) + "\t" + tr("Plot")+ ": ''" + d_graph->parentPlotName() + "'']\n";
3386- logInfo += "\n" + tr("Numerical integration of") + ": " + d_curve->title().text() + " " + tr("using a %1 order method").arg(d_method)+"\n";
3387- if(success)
3388- logInfo += tr("Iterations") + ": " + QString::number(j)+"\n";
3389- if(!success)
3390- logInfo += tr("Iterations") + ": " + QString::number(j-1)+"\n";
3391+ logInfo += "\n" + tr("Numerical integration of") + ": " + d_curve->title().text() + tr(" using ") + method_name + tr("Interpolation") + "\n";
3392
3393- ApplicationWindow *app = (ApplicationWindow *)parent();
3394- int prec = app->d_decimal_digits;
3395- logInfo += tr("Tolerance") + "(" + tr("max") + " = " + QLocale().toString(d_tolerance, 'g', prec)+"): " + QString::number(error)+ "\n";
3396+ ApplicationWindow *app = (ApplicationWindow *)parent();
3397+ int prec = app->d_decimal_digits;
3398 logInfo += tr("Points") + ": "+QString::number(d_n) + " " + tr("from") + " x = " +QLocale().toString(d_from, 'g', prec) + " ";
3399- logInfo += tr("to") + " x = " + QLocale().toString(d_to, 'g', prec) + "\n";
3400-
3401- // using GSL to find maximum value of data set
3402- gsl_vector *aux = gsl_vector_alloc(d_n);
3403- for(int i=0; i < d_n; i++)
3404- gsl_vector_set (aux, i, fabs(d_y[i]));
3405- int maxID=gsl_vector_max_index (aux);
3406- gsl_vector_free (aux);
3407-
3408- logInfo += tr("Peak at") + " x = " + QLocale().toString(d_x[maxID], 'g', prec)+"\t";
3409+ logInfo += tr("to") + " x = " + QLocale().toString(d_to, 'g', prec) + "\n";
3410+
3411+ // using GSL to find maximum value of data set
3412+ gsl_vector *aux = gsl_vector_alloc(d_n);
3413+ for(int i=0; i < d_n; i++)
3414+ gsl_vector_set (aux, i, fabs(d_y[i]));
3415+ int maxID=gsl_vector_max_index (aux);
3416+ gsl_vector_free (aux);
3417+
3418+ logInfo += tr("Peak at") + " x = " + QLocale().toString(d_x[maxID], 'g', prec)+"\t";
3419 logInfo += "y = " + QLocale().toString(d_y[maxID], 'g', prec)+"\n";
3420
3421 logInfo += tr("Area") + "=";
3422- if(success)
3423- logInfo += QLocale().toString(S[j], 'g', prec);
3424- if(!success)
3425- logInfo += QLocale().toString(S[j-1], 'g', prec);
3426+ logInfo += QLocale().toString(gsl_interp_eval_integ(interpolation, d_x, d_y, d_from, d_to, 0), 'g', prec);
3427 logInfo += "\n-------------------------------------------------------------\n";
3428
3429- if(d_n>3)
3430- gsl_spline_free (interp);
3431-
3432- gsl_interp_accel_free (acc);
3433- delete[] S;
3434- delete[] h;
3435- return logInfo;
3436-}
3437-
3438-void Integration::setMethodOrder(int n)
3439-{
3440-if (n < 1 || n > 5)
3441- {
3442- QMessageBox::critical((ApplicationWindow *)parent(), tr("Error"),
3443- tr("Unknown integration method. Valid values must be in the range: 1 (Trapezoidal Method) to 5."));
3444- return;
3445- }
3446-
3447-d_method = n;
3448-}
3449+ gsl_interp_free(interpolation);
3450+
3451+ return logInfo;
3452+}
3453+
3454
3455=== modified file 'scidavis/src/Integration.h'
3456--- scidavis/src/Integration.h 2009-09-06 11:34:04 +0000
3457+++ scidavis/src/Integration.h 2010-07-12 22:57:40 +0000
3458@@ -36,21 +36,30 @@
3459 Q_OBJECT
3460
3461 public:
3462+ enum InterpolationMethod{Linear, Cubic, Akima};
3463+
3464 Integration(ApplicationWindow *parent, Graph *g);
3465 Integration(ApplicationWindow *parent, Graph *g, const QString& curveTitle);
3466 Integration(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
3467
3468- int method(){return d_method;};
3469- void setMethodOrder(int n);
3470+ InterpolationMethod method(){return d_method;};
3471+ void setMethod(InterpolationMethod method) {
3472+ InterpolationMethod backup = d_method;
3473+ d_method = method;
3474+ if (!isDataAcceptable())
3475+ d_method = backup;
3476+ };
3477+
3478+protected:
3479+ virtual bool isDataAcceptable();
3480
3481 private:
3482 void init();
3483- //!Uses code originally written by Vasileios Gkanis. It needs some more checking.
3484 QString logInfo();
3485 void output(){};
3486
3487- //! the integration method: 1 = trapezoidal, max = 5!
3488- int d_method;
3489+ //! The method for computing the interpolation used for integrating.
3490+ InterpolationMethod d_method;
3491 };
3492
3493 #endif
3494
3495=== modified file 'scidavis/src/Interpolation.cpp'
3496--- scidavis/src/Interpolation.cpp 2009-09-06 11:34:04 +0000
3497+++ scidavis/src/Interpolation.cpp 2010-07-12 22:57:40 +0000
3498@@ -131,53 +131,15 @@
3499 gsl_interp_accel_free (acc);
3500 }
3501
3502-int Interpolation::sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y)
3503+bool Interpolation::isDataAcceptable()
3504 {
3505- if (!c || c->rtti() != QwtPlotItem::Rtti_PlotCurve)
3506- return 0;
3507-
3508- int i_start = 0, i_end = c->dataSize();
3509- for (int i = 0; i < i_end; i++)
3510- if (c->x(i) > start && i)
3511- {
3512- i_start = i - 1;
3513- break;
3514- }
3515- for (int i = i_end-1; i >= 0; i--)
3516- if (c->x(i) < end && i < c->dataSize())
3517- {
3518- i_end = i + 1;
3519- break;
3520- }
3521- int n = i_end - i_start + 1;
3522- (*x) = new double[n];
3523- (*y) = new double[n];
3524- double *xtemp = new double[n];
3525- double *ytemp = new double[n];
3526-
3527- double pr_x;
3528- int j=0;
3529- for (int i = i_start; i <= i_end; i++)
3530- {
3531- xtemp[j] = c->x(i);
3532- if (xtemp[j] == pr_x)
3533- {
3534- delete (*x);
3535- delete (*y);
3536- return -1;//this kind of data causes division by zero in GSL interpolation routines
3537- }
3538- pr_x = xtemp[j];
3539- ytemp[j++] = c->y(i);
3540- }
3541- size_t *p = new size_t[n];
3542- gsl_sort_index(p, xtemp, 1, n);
3543- for (int i=0; i<n; i++)
3544- {
3545- (*x)[i] = xtemp[p[i]];
3546- (*y)[i] = ytemp[p[i]];
3547- }
3548- delete[] xtemp;
3549- delete[] ytemp;
3550- delete[] p;
3551- return n;
3552+ // GSL interpolation routines fail with division by zero on such data
3553+ for (int i=1; i<d_n; i++)
3554+ if (d_x[i-1] == d_x[i]) {
3555+ QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
3556+ tr("Several data points have the same x value causing divisions by zero, operation aborted!"));
3557+ return false;
3558+ }
3559+
3560+ return Filter::isDataAcceptable();
3561 }
3562
3563=== modified file 'scidavis/src/Interpolation.h'
3564--- scidavis/src/Interpolation.h 2009-09-06 11:34:04 +0000
3565+++ scidavis/src/Interpolation.h 2010-07-12 22:57:40 +0000
3566@@ -46,10 +46,12 @@
3567 void setMethod(int m);
3568 void setMethod(InterpolationMethod m){setMethod((int)m);};
3569
3570+protected:
3571+ virtual bool isDataAcceptable();
3572+
3573 private:
3574 void init(int m);
3575 void calculateOutputData(double *x, double *y);
3576- int sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y);
3577
3578 //! the interpolation method
3579 int d_method;
3580
3581=== modified file 'scidavis/src/LineDialog.cpp'
3582--- scidavis/src/LineDialog.cpp 2009-09-06 11:34:04 +0000
3583+++ scidavis/src/LineDialog.cpp 2010-07-12 22:57:40 +0000
3584@@ -179,7 +179,7 @@
3585 QGridLayout *gl1 = new QGridLayout();
3586 gl1->addWidget(new QLabel( tr("X")), 0, 0);
3587 gl1->addWidget(xStartBox, 0, 1);
3588- gl1->addWidget(new QLabel(tr("To")), 1, 0);
3589+ gl1->addWidget(new QLabel(tr("Y")), 1, 0);
3590 gl1->addWidget(yStartBox, 1, 1);
3591 gb1->setLayout(gl1);
3592
3593@@ -190,7 +190,7 @@
3594 QGridLayout *gl2 = new QGridLayout();
3595 gl2->addWidget(new QLabel( tr("X")), 0, 0);
3596 gl2->addWidget(xEndBox, 0, 1);
3597- gl2->addWidget(new QLabel(tr("To")), 1, 0);
3598+ gl2->addWidget(new QLabel(tr("Y")), 1, 0);
3599 gl2->addWidget(yEndBox, 1, 1);
3600 gb2->setLayout(gl2);
3601
3602
3603=== modified file 'scidavis/src/LineProfileTool.h'
3604--- scidavis/src/LineProfileTool.h 2009-09-06 11:34:04 +0000
3605+++ scidavis/src/LineProfileTool.h 2010-07-12 22:57:40 +0000
3606@@ -67,6 +67,7 @@
3607 public:
3608 //! Standard constructor.
3609 LineProfileTool(Graph *graph, int average_pixels);
3610+ virtual RTTI rtti() const { return LineProfile; }
3611 void calculateLineProfile(const QPoint &start, const QPoint &end);
3612
3613 signals:
3614
3615=== modified file 'scidavis/src/Matrix.cpp'
3616--- scidavis/src/Matrix.cpp 2009-09-06 11:34:04 +0000
3617+++ scidavis/src/Matrix.cpp 2010-07-12 22:57:40 +0000
3618@@ -421,11 +421,18 @@
3619 script->setInt(col+1, "col");
3620 script->setDouble(xStart()+col*dx, "x");
3621 ret = script->eval();
3622+ if (!ret.isValid()) {
3623+ forgetSavedCells();
3624+ blockSignals(false);
3625+ emit modifiedWindow(this);
3626+ QApplication::restoreOverrideCursor();
3627+ return false;
3628+ }
3629 setCell(row, col, ret.toDouble());
3630 }
3631 forgetSavedCells();
3632
3633- this->blockSignals(false);
3634+ blockSignals(false);
3635 emit modifiedWindow(this);
3636 QApplication::restoreOverrideCursor();
3637 return true;
3638
3639=== modified file 'scidavis/src/MuParserScript.cpp'
3640--- scidavis/src/MuParserScript.cpp 2009-09-06 11:34:04 +0000
3641+++ scidavis/src/MuParserScript.cpp 2010-07-12 22:57:40 +0000
3642@@ -232,12 +232,7 @@
3643 /**
3644 * \brief Implements column() function for tables.
3645 *
3646- * \arg \c columnPath Path to the column to read data from.
3647- * Currently, only "column" (referring to the named column of the current table) and
3648- * "table/column" (referring to the name column of the named table somewhere in the project)
3649- * are supported. A future version of SciDAVis will allow table names to be non-unique across
3650- * different folders, at which point this argument is planned to be extended to a full path
3651- * specification; either absolute (starting with "/") or relative to the current Aspect.
3652+ * \arg \c columnPath Path to the column to read data from. See resolveColumnPath().
3653 *
3654 * The row to read from is determined by the muParser variable "i" set during iteration of a column
3655 * formula. For explicitly specifying the row, use cell() instead.
3656@@ -481,8 +476,8 @@
3657 * - col(arg) with column("arg") if the current table contains a column named "arg" and
3658 * with column_(arg) otherwise
3659 * - col("name", row) with cell("name", row)
3660- * - col(arg, row) with column("arg", row) if the current table contains a column named "arg" and
3661- * with column_(arg, row) otherwise
3662+ * - col(arg, row) with cell("arg", row) if the current table contains a column named "arg" and
3663+ * with cell_(arg, row) otherwise
3664 * - tablecol("tableName", "columnName") with column("tableName/columnName")
3665 * - tablecol("tableName", columnIndex) with column__("tableName", columnIndex)
3666 * - cell(columnIndex, rowIndex) with cell_(columnIndex, rowIndex)
3667@@ -650,7 +645,26 @@
3668 QString intermediate = Code.trimmed(); // pre-processed version of #Code
3669
3670 // remove comments
3671- intermediate.remove(QRegExp("#[^\n]*(\n|$)"));
3672+ bool inString = false;
3673+ int commentStart = -1;
3674+ for (int i=0; i<intermediate.size(); i++)
3675+ switch (intermediate.at(i).toAscii()) {
3676+ case '"':
3677+ if (commentStart < 0) inString = !inString;
3678+ break;
3679+ case '#':
3680+ if (!inString) commentStart = i;
3681+ break;
3682+ case '\n':
3683+ if (commentStart >= 0) {
3684+ intermediate.remove(commentStart, i-commentStart);
3685+ i = commentStart;
3686+ commentStart = -1;
3687+ }
3688+ break;
3689+ }
3690+ if (commentStart >= 0)
3691+ intermediate.remove(commentStart, intermediate.size()-commentStart);
3692
3693 // simplify statement separators
3694 intermediate.replace(QRegExp("([;\\n]\\s*)+"),"; ");
3695
3696=== modified file 'scidavis/src/MuParserScripting.cpp'
3697--- scidavis/src/MuParserScripting.cpp 2009-09-06 11:34:04 +0000
3698+++ scidavis/src/MuParserScripting.cpp 2010-07-12 22:57:40 +0000
3699@@ -44,53 +44,53 @@
3700 // functions without function pointer (fun1,fun2,fun3 == NULL,NULL,NULL) are implemented
3701 // in mu::Parser
3702 const MuParserScripting::mathFunction MuParserScripting::math_functions[] = {
3703- { "abs", 1, NULL,NULL,NULL, "abs(x):\n Absolute value of x." },
3704- { "acos", 1, NULL,NULL,NULL, "acos(x):\n Inverse cos function." },
3705- { "acosh", 1, NULL,NULL,NULL, "acosh(x):\n Hyperbolic inverse cos function." },
3706- { "asin", 1, NULL,NULL,NULL, "asin(x):\n Inverse sin function." },
3707- { "asinh", 1, NULL,NULL,NULL, "asinh(x):\n Hyperbolic inverse sin function." },
3708- { "atan", 1, NULL,NULL,NULL, "atan(x):\n Inverse tan function." },
3709- { "atanh", 1, NULL,NULL,NULL, "atanh(x):\n Hyperbolic inverse tan function." },
3710- { "avg", -1, NULL,NULL,NULL, "avg(x,y,...):\n Mean value of all arguments." },
3711- { "bessel_j0", 1, bessel_J0,NULL,NULL, "bessel_j0(x):\n Regular cylindrical Bessel function of zeroth order, J_0(x)." },
3712- { "bessel_j1", 1, bessel_J1,NULL,NULL, "bessel_j1(x):\n Regular cylindrical Bessel function of first order, J_1(x)." },
3713- { "bessel_jn", 2, NULL,bessel_Jn,NULL, "bessel_jn(double x, int n):\n Regular cylindrical Bessel function of order n, J_n(x)." },
3714- { "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" },
3715- { "bessel_y0", 1, bessel_Y0, NULL,NULL, "bessel_y0(x):\n Irregular cylindrical Bessel function of zeroth order, Y_0(x), for x>0." },
3716- { "bessel_y1", 1, bessel_Y1, NULL,NULL, "bessel_y1(x):\n Irregular cylindrical Bessel function of first order, Y_1(x), for x>0." },
3717- { "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." },
3718- { "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." },
3719- { "ceil", 1, ceil,NULL,NULL, "ceil(x):\n Round to the next larger integer,\n smallest integer larger or equal to x." },
3720- { "cos", 1, NULL,NULL,NULL, "cos(x):\n Calculate cosine." },
3721- { "cosh", 1, NULL,NULL,NULL, "cosh(x):\n Hyperbolic cos function." },
3722- { "erf", 1, erf, NULL,NULL, "erf(x):\n The error function." },
3723- { "erfc", 1, erfc, NULL,NULL, "erfc(x):\n Complementary error function erfc(x) = 1 - erf(x)." },
3724- { "erfz", 1, erf_Z, NULL,NULL, "erfz(x):\n The Gaussian probability density function Z(x)." },
3725- { "erfq", 1, erf_Q, NULL,NULL, "erfq(x):\n The upper tail of the Gaussian probability function Q(x)." },
3726- { "exp", 1, NULL,NULL,NULL, "exp(x):\n Exponential function: e raised to the power of x." },
3727- { "floor", 1, floor,NULL,NULL, "floor(x):\n Round to the next smaller integer,\n largest integer smaller or equal to x." },
3728- { "gamma", 1, gamma, NULL,NULL, "gamma(x):\n Computes the Gamma function, subject to x not being a negative integer." },
3729- { "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." },
3730- { "hazard", 1, hazard,NULL,NULL, "hazard(x):\n Computes the hazard function for the normal distribution h(x) = erfz(x)/erfq(x)." },
3731- { "if", 3, NULL,NULL,NULL, "if(e1, e2, e3):\n if e1 then e2 else e3." },
3732- { "ln", 1, NULL,NULL,NULL, "ln(x):\n Calculate natural logarithm log_e." },
3733- { "log", 1, NULL,NULL,NULL, "log(x):\n Calculate decimal logarithm log_10." },
3734- { "log10", 1, NULL,NULL,NULL, "log10(x):\n Calculate decimal logarithm log_10." },
3735- { "log2", 1, NULL,NULL,NULL, "log2(x):\n Calculate binary logarithm log_2." },
3736- { "min", -1, NULL,NULL,NULL, "min(x,y,...):\n Calculate minimum of all arguments." },
3737- { "max", -1, NULL,NULL,NULL, "max(x,y,...):\n Calculate maximum of all arguments." },
3738- { "mod", 2, NULL,mod,NULL, "mod(x,y):\n Calculate rest of integer division x/y,\n x modulo y." },
3739- { "pow", 2, NULL,mypow,NULL, "pow(x,y):\n Raise x to the power of y, x^y." },
3740- { "rint", 1, NULL,NULL,NULL, "rint(x):\n Round to nearest integer." },
3741- { "sign", 1, NULL,NULL,NULL, "sign(x):\n Sign function: -1 if x<0; 1 if x>0." },
3742- { "sin", 1, NULL,NULL,NULL, "sin(x):\n Calculate sine." },
3743- { "sinh", 1, NULL,NULL,NULL, "sinh(x):\n Hyperbolic sin function." },
3744- { "sqrt", 1, NULL,NULL,NULL, "sqrt(x):\n Square root function." },
3745- { "sum", -1, NULL,NULL,NULL, "sum(x,y,...):\n Calculate sum of all arguments." },
3746- { "tan", 1, NULL,NULL,NULL, "tan(x):\n Calculate tangent function." },
3747- { "tanh", 1, NULL,NULL,NULL, "tanh(x):\n Hyperbolic tan function." },
3748- { "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))." },
3749- { "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))." },
3750+ { "abs", 1, NULL,NULL,NULL, QT_TR_NOOP("abs(x):\n Absolute value of x.") },
3751+ { "acos", 1, NULL,NULL,NULL, QT_TR_NOOP("acos(x):\n Inverse cos function.") },
3752+ { "acosh", 1, NULL,NULL,NULL, QT_TR_NOOP("acosh(x):\n Hyperbolic inverse cos function.") },
3753+ { "asin", 1, NULL,NULL,NULL, QT_TR_NOOP("asin(x):\n Inverse sin function.") },
3754+ { "asinh", 1, NULL,NULL,NULL, QT_TR_NOOP("asinh(x):\n Hyperbolic inverse sin function.") },
3755+ { "atan", 1, NULL,NULL,NULL, QT_TR_NOOP("atan(x):\n Inverse tan function.") },
3756+ { "atanh", 1, NULL,NULL,NULL, QT_TR_NOOP("atanh(x):\n Hyperbolic inverse tan function.") },
3757+ { "avg", -1, NULL,NULL,NULL, QT_TR_NOOP("avg(x,y,...):\n Mean value of all arguments.") },
3758+ { "bessel_j0", 1, bessel_J0,NULL,NULL, QT_TR_NOOP("bessel_j0(x):\n Regular cylindrical Bessel function of zeroth order, J_0(x).") },
3759+ { "bessel_j1", 1, bessel_J1,NULL,NULL, QT_TR_NOOP("bessel_j1(x):\n Regular cylindrical Bessel function of first order, J_1(x).") },
3760+ { "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).") },
3761+ { "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") },
3762+ { "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.") },
3763+ { "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.") },
3764+ { "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.") },
3765+ { "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.") },
3766+ { "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.") },
3767+ { "cos", 1, NULL,NULL,NULL, QT_TR_NOOP("cos(x):\n Calculate cosine.") },
3768+ { "cosh", 1, NULL,NULL,NULL, QT_TR_NOOP("cosh(x):\n Hyperbolic cos function.") },
3769+ { "erf", 1, erf, NULL,NULL, QT_TR_NOOP("erf(x):\n The error function.") },
3770+ { "erfc", 1, erfc, NULL,NULL, QT_TR_NOOP("erfc(x):\n Complementary error function erfc(x) = 1 - erf(x).") },
3771+ { "erfz", 1, erf_Z, NULL,NULL, QT_TR_NOOP("erfz(x):\n The Gaussian probability density function Z(x).") },
3772+ { "erfq", 1, erf_Q, NULL,NULL, QT_TR_NOOP("erfq(x):\n The upper tail of the Gaussian probability function Q(x).") },
3773+ { "exp", 1, NULL,NULL,NULL, QT_TR_NOOP("exp(x):\n Exponential function: e raised to the power of x.") },
3774+ { "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.") },
3775+ { "gamma", 1, gamma, NULL,NULL, QT_TR_NOOP("gamma(x):\n Computes the Gamma function, subject to x not being a negative integer.") },
3776+ { "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.") },
3777+ { "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).") },
3778+ { "if", 3, NULL,NULL,NULL, QT_TR_NOOP("if(e1, e2, e3):\n if e1 then e2 else e3.") },
3779+ { "ln", 1, NULL,NULL,NULL, QT_TR_NOOP("ln(x):\n Calculate natural logarithm log_e.") },
3780+ { "log", 1, NULL,NULL,NULL, QT_TR_NOOP("log(x):\n Calculate decimal logarithm log_10.") },
3781+ { "log10", 1, NULL,NULL,NULL, QT_TR_NOOP("log10(x):\n Calculate decimal logarithm log_10.") },
3782+ { "log2", 1, NULL,NULL,NULL, QT_TR_NOOP("log2(x):\n Calculate binary logarithm log_2.") },
3783+ { "min", -1, NULL,NULL,NULL, QT_TR_NOOP("min(x,y,...):\n Calculate minimum of all arguments.") },
3784+ { "max", -1, NULL,NULL,NULL, QT_TR_NOOP("max(x,y,...):\n Calculate maximum of all arguments.") },
3785+ { "mod", 2, NULL,mod,NULL, QT_TR_NOOP("mod(x,y):\n Calculate rest of integer division x/y,\n x modulo y.") },
3786+ { "pow", 2, NULL,mypow,NULL, QT_TR_NOOP("pow(x,y):\n Raise x to the power of y, x^y.") },
3787+ { "rint", 1, NULL,NULL,NULL, QT_TR_NOOP("rint(x):\n Round to nearest integer.") },
3788+ { "sign", 1, NULL,NULL,NULL, QT_TR_NOOP("sign(x):\n Sign function: -1 if x<0; 1 if x>0.") },
3789+ { "sin", 1, NULL,NULL,NULL, QT_TR_NOOP("sin(x):\n Calculate sine.") },
3790+ { "sinh", 1, NULL,NULL,NULL, QT_TR_NOOP("sinh(x):\n Hyperbolic sin function.") },
3791+ { "sqrt", 1, NULL,NULL,NULL, QT_TR_NOOP("sqrt(x):\n Square root function.") },
3792+ { "sum", -1, NULL,NULL,NULL, QT_TR_NOOP("sum(x,y,...):\n Calculate sum of all arguments.") },
3793+ { "tan", 1, NULL,NULL,NULL, QT_TR_NOOP("tan(x):\n Calculate tangent function.") },
3794+ { "tanh", 1, NULL,NULL,NULL, QT_TR_NOOP("tanh(x):\n Hyperbolic tan function.") },
3795+ { "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)).") },
3796+ { "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)).") },
3797 {0,0,NULL,NULL,NULL,0}
3798 };
3799
3800@@ -106,6 +106,6 @@
3801 {
3802 for (const mathFunction *i=math_functions; i->name; i++)
3803 if (name==i->name)
3804- return i->description;
3805+ return tr(i->description);
3806 return QString::null;
3807 }
3808
3809=== modified file 'scidavis/src/MuParserScripting.h'
3810--- scidavis/src/MuParserScripting.h 2009-09-06 11:34:04 +0000
3811+++ scidavis/src/MuParserScripting.h 2010-07-12 22:57:40 +0000
3812@@ -76,7 +76,7 @@
3813 double (*fun1)(double);
3814 double (*fun2)(double,double);
3815 double (*fun3)(double,double,double);
3816- char *description;
3817+ QString description;
3818 };
3819 static const mathFunction math_functions[];
3820
3821
3822=== modified file 'scidavis/src/MultiLayer.cpp'
3823--- scidavis/src/MultiLayer.cpp 2009-09-06 11:34:04 +0000
3824+++ scidavis/src/MultiLayer.cpp 2010-07-12 22:57:40 +0000
3825@@ -123,6 +123,7 @@
3826 layout->addWidget(canvas, 1);
3827 layout->setMargin(0);
3828 layout->setSpacing(0);
3829+ setMinimumHeight(50);
3830 setGeometry(QRect( 0, 0, graph_width, graph_height ));
3831 setFocusPolicy(Qt::StrongFocus);
3832 }
3833
3834=== modified file 'scidavis/src/MultiLayer.h'
3835--- scidavis/src/MultiLayer.h 2009-09-06 11:34:04 +0000
3836+++ scidavis/src/MultiLayer.h 2010-07-12 22:57:40 +0000
3837@@ -71,6 +71,7 @@
3838 MultiLayer (const QString& label, QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
3839 QWidgetList graphPtrs(){return graphsList;};
3840 Graph *layer(int num);
3841+ QWidgetList layerWidgets() const { return graphsList; }
3842 LayerButton* addLayerButton();
3843 void copy(ApplicationWindow * parent, MultiLayer* ml);
3844
3845
3846=== modified file 'scidavis/src/MultiPeakFitTool.h'
3847--- scidavis/src/MultiPeakFitTool.h 2009-09-06 11:34:04 +0000
3848+++ scidavis/src/MultiPeakFitTool.h 2010-07-12 22:57:40 +0000
3849@@ -52,6 +52,7 @@
3850 Q_OBJECT
3851 public:
3852 MultiPeakFitTool(Graph *graph, ApplicationWindow *app, MultiPeakFit::PeakProfile profile, int num_peaks, const QObject *status_target, const char *status_slot);
3853+ virtual RTTI rtti() const { return MultiPeak; }
3854 virtual ~MultiPeakFitTool();
3855 signals:
3856 /*! Emitted whenever a new message should be presented to the user.
3857
3858=== modified file 'scidavis/src/Plot3DDialog.cpp'
3859--- scidavis/src/Plot3DDialog.cpp 2009-09-06 11:34:04 +0000
3860+++ scidavis/src/Plot3DDialog.cpp 2010-07-12 22:57:40 +0000
3861@@ -35,6 +35,7 @@
3862 #include <QLineEdit>
3863 #include <QLayout>
3864 #include <QSpinBox>
3865+#include <QDoubleSpinBox>
3866 #include <QPushButton>
3867 #include <QLabel>
3868 #include <QStackedWidget>
3869@@ -325,26 +326,30 @@
3870
3871 QGridLayout *gl2 = new QGridLayout();
3872 gl2->addWidget(new QLabel(tr( "Zoom (%)" )), 0, 0);
3873- boxZoom = new QSpinBox();
3874- boxZoom->setRange(1, 10000);
3875+ boxZoom = new QDoubleSpinBox();
3876+ boxZoom->setMinimum(0);
3877+ boxZoom->setMaximum(1e15);
3878 boxZoom->setSingleStep(10);
3879
3880 gl2->addWidget(boxZoom, 0, 1);
3881 gl2->addWidget(new QLabel(tr( "X Zoom (%)" )), 1, 0);
3882- boxXScale = new QSpinBox();
3883- boxXScale->setRange(1, 10000);
3884+ boxXScale = new QDoubleSpinBox();
3885+ boxXScale->setMinimum(0);
3886+ boxXScale->setMaximum(1e15);
3887 boxXScale->setSingleStep(10);
3888 gl2->addWidget(boxXScale, 1, 1);
3889
3890 gl2->addWidget(new QLabel(tr( "Y Zoom (%)" )), 2, 0);
3891- boxYScale = new QSpinBox();
3892- boxYScale->setRange(1, 10000);
3893+ boxYScale = new QDoubleSpinBox();
3894+ boxYScale->setMinimum(0);
3895+ boxYScale->setMaximum(1e15);
3896 boxYScale->setSingleStep(10);
3897 gl2->addWidget(boxYScale, 2, 1);
3898
3899 gl2->addWidget(new QLabel(tr( "Z Zoom (%)" )), 3, 0);
3900- boxZScale = new QSpinBox();
3901- boxZScale->setRange(1, 10000);
3902+ boxZScale = new QDoubleSpinBox();
3903+ boxZScale->setMinimum(0);
3904+ boxZScale->setMaximum(1e15);
3905 boxZScale->setSingleStep(10);
3906 gl2->addWidget(boxZScale, 3, 1);
3907 gl2->setRowStretch(4, 1);
3908@@ -365,10 +370,10 @@
3909 connect( boxMeshLineWidth, SIGNAL(valueChanged(int)), this, SIGNAL(updateMeshLineWidth(int)));
3910 connect( boxOrthogonal, SIGNAL(toggled(bool)), this, SIGNAL(setOrtho(bool)));
3911 connect( boxLegend, SIGNAL(toggled(bool)), this, SIGNAL(showColorLegend(bool)));
3912- connect( boxZoom, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));
3913- connect( boxXScale, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));
3914- connect( boxYScale, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));
3915- connect( boxZScale, SIGNAL(valueChanged(int)), this, SLOT(changeZoom(int)));
3916+ connect( boxZoom, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
3917+ connect( boxXScale, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
3918+ connect( boxYScale, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
3919+ connect( boxZScale, SIGNAL(valueChanged(double)), this, SLOT(changeZoom(double)));
3920 connect( btnNumbersFont, SIGNAL(clicked()), this, SLOT(pickNumbersFont() ) );
3921 }
3922
3923@@ -756,13 +761,13 @@
3924 boxLegend->setChecked(show);
3925 }
3926
3927-void Plot3DDialog::changeZoom(int)
3928+void Plot3DDialog::changeZoom(double)
3929 {
3930 if (generalDialog->currentWidget() != (QWidget*)general)
3931 return;
3932
3933 emit updateZoom(boxZoom->value()*0.01);
3934- emit updateScaling(boxXScale->value()*0.01,boxYScale->value()*0.01,
3935+ emit updateScaling(boxXScale->value(),boxYScale->value()*0.01,
3936 boxZScale->value()*0.01);
3937 }
3938
3939@@ -881,7 +886,7 @@
3940 QStringList Plot3DDialog::scaleOptions(int axis, double start, double end,
3941 const QString& majors, const QString& minors)
3942 {
3943- Q_ASSERT(0 <= axis < scales.size()/5 - 1);
3944+ Q_ASSERT(0 <= axis); Q_ASSERT(5*axis+4 < scales.size());
3945 QStringList l;
3946 l<<QString::number(start);
3947 l<<QString::number(end);
3948@@ -970,14 +975,14 @@
3949
3950 void Plot3DDialog::setZoom(double zoom)
3951 {
3952- boxZoom->setValue(int(zoom*100));
3953+ boxZoom->setValue(zoom*100);
3954 }
3955
3956 void Plot3DDialog::setScaling(double xVal, double yVal, double zVal)
3957 {
3958- boxXScale->setValue(int(xVal*100));
3959- boxYScale->setValue(int(yVal*100));
3960- boxZScale->setValue(int(zVal*100));
3961+ boxXScale->setValue(xVal*100);
3962+ boxYScale->setValue(yVal*100);
3963+ boxZScale->setValue(zVal*100);
3964 }
3965
3966 void Plot3DDialog::showGeneralTab()
3967
3968=== modified file 'scidavis/src/Plot3DDialog.h'
3969--- scidavis/src/Plot3DDialog.h 2009-09-06 11:34:04 +0000
3970+++ scidavis/src/Plot3DDialog.h 2010-07-12 22:57:40 +0000
3971@@ -39,6 +39,7 @@
3972 class QPushButton;
3973 class QRadioButton;
3974 class QSpinBox;
3975+class QDoubleSpinBox;
3976 class QTabWidget;
3977 class QWidget;
3978 class QStringList;
3979@@ -117,7 +118,7 @@
3980 void showAxisTab();
3981
3982 void initPointsOptionsStack();
3983- void changeZoom(int);
3984+ void changeZoom(double);
3985 void changeTransparency(int val);
3986
3987 void showLowerGreek();
3988@@ -182,7 +183,8 @@
3989 QListWidget *axesList, *axesList2;
3990 QComboBox *boxType, *boxPointStyle;
3991 QLineEdit *boxMajorLength, *boxMinorLength, *boxConesRad;
3992- QSpinBox *boxZoom, *boxXScale, *boxYScale, *boxZScale, *boxQuality;
3993+ QDoubleSpinBox *boxZoom, *boxXScale, *boxYScale, *boxZScale;
3994+ QSpinBox *boxQuality;
3995 QLineEdit *boxSize, *boxBarsRad, *boxCrossRad, *boxCrossLinewidth;
3996 QStackedWidget *optionStack;
3997 QWidget *dotsPage, *conesPage, *crossPage;
3998
3999=== modified file 'scidavis/src/PlotCurve.cpp'
4000--- scidavis/src/PlotCurve.cpp 2009-09-06 11:34:04 +0000
4001+++ scidavis/src/PlotCurve.cpp 2010-07-12 22:57:40 +0000
4002@@ -29,6 +29,7 @@
4003 #include "PlotCurve.h"
4004 #include "ScaleDraw.h"
4005 #include "core/column/Column.h"
4006+#include "core/datatypes/DateTime2StringFilter.h"
4007 #include <QDateTime>
4008 #include <QMessageBox>
4009 #include <qwt_symbol.h>
4010@@ -116,190 +117,187 @@
4011 return true;
4012 }
4013
4014-void DataCurve::loadData()
4015+QList< QVector<double> > DataCurve::convertData(const QList<Column*> &cols, const QList<int> &axes) const {
4016+ Graph *g = 0;
4017+ if (plot())
4018+ g = static_cast<Graph*>(plot()->parent());
4019+
4020+ int end_row = d_end_row;
4021+ // make sure end_row is a valid index for all columns
4022+ foreach(Column *col, cols)
4023+ if (end_row >= col->rowCount())
4024+ end_row = col->rowCount() - 1;
4025+
4026+ // determine rows for which all columns have valid content
4027+ QList<int> valid_rows;
4028+ for (int row = d_start_row; row <= end_row; row++) {
4029+ bool all_valid = true;
4030+ foreach(Column *col, cols)
4031+ if (col->isInvalid(row)) {
4032+ all_valid = false;
4033+ break;
4034+ }
4035+ if (all_valid)
4036+ valid_rows.push_back(row);
4037+ }
4038+
4039+ // initialize result list
4040+ QList< QVector<double> > result;
4041+ for (int i=0; i<cols.size(); i++)
4042+ result.push_back(QVector<double>(valid_rows.size()));
4043+
4044+ // For date and time (but not DateTime) values, numbers are relative to the first valid row's
4045+ // content. We can't change this easily without breaking backwards compatibility (think of
4046+ // scale ranges, placement of labels and arrows etc).
4047+ QList<QDate> reference_dates;
4048+ QList<QTime> reference_times;
4049+ for(int i=0; i<cols.size(); i++) {
4050+ Column *col = cols[i];
4051+
4052+ switch (col->columnMode()) {
4053+ case Table::Time:
4054+ {
4055+ QTime time;
4056+ QString format;
4057+ if (g && g->axesType()[axes[i]] == Table::Time) {
4058+ QStringList lst = g->axisFormatInfo(axes[i]).split(";");
4059+ time = QTime::fromString(lst[0]);
4060+ if (lst.size() >= 2) format = lst[1];
4061+ }
4062+ if (!time.isValid()) {
4063+ foreach (int row, valid_rows) {
4064+ time = col->timeAt(row);
4065+ if (time.isValid()) break;
4066+ }
4067+ }
4068+
4069+ if (format.isEmpty())
4070+ format = static_cast<DateTime2StringFilter *>(col->outputFilter())->format();
4071+
4072+ reference_dates.push_back(QDate());
4073+ reference_times.push_back(time);
4074+ if (g)
4075+ g->setLabelsDateTimeFormat(axes[i], Graph::Time, time.toString() + ";" + format);
4076+ break;
4077+ }
4078+ case Table::Date:
4079+ {
4080+ QDate date;
4081+ QString format;
4082+
4083+ if (g && g->axesType()[axes[i]] == Table::Time) {
4084+ QStringList lst = g->axisFormatInfo(axes[i]).split(";");
4085+ date = QDate::fromString(lst[0], "YYYY-MM-DD");
4086+ if (lst.size() >= 2) format = lst[1];
4087+ }
4088+
4089+ if (!date.isValid()) {
4090+ foreach (int row, valid_rows) {
4091+ date = col->dateAt(row);
4092+ if (date.isValid()) break;
4093+ }
4094+ }
4095+
4096+ if (format.isEmpty())
4097+ format = static_cast<DateTime2StringFilter *>(col->outputFilter())->format();
4098+
4099+ reference_dates.push_back(date);
4100+ reference_times.push_back(QTime());
4101+ if (g)
4102+ g->setLabelsDateTimeFormat(axes[i], Graph::Date, date.toString("YYYY-MM-DD") + ";" + format);
4103+ break;
4104+ }
4105+ case Table::DateTime:
4106+ {
4107+ QDateTime datetime;
4108+ QString format;
4109+
4110+ if (g && g->axesType()[axes[i]] == Table::DateTime) {
4111+ QStringList lst = g->axisFormatInfo(axes[i]).split(";");
4112+ datetime = QDateTime::fromString(lst[0], "YYYY-MM-DDTHH:MM:SS");
4113+ if (lst.size() >= 2) format = lst[1];
4114+ }
4115+
4116+ if (!datetime.isValid()) {
4117+ foreach (int row, valid_rows) {
4118+ datetime = col->dateTimeAt(row);
4119+ if (datetime.isValid()) break;
4120+ }
4121+ }
4122+
4123+ if (format.isEmpty())
4124+ format = static_cast<DateTime2StringFilter *>(col->outputFilter())->format();
4125+
4126+ reference_dates.push_back(QDate());
4127+ reference_times.push_back(QTime());
4128+ if (g)
4129+ g->setLabelsDateTimeFormat(axes[i], Graph::DateTime, datetime.toString("YYYY-MM-DDTHH:MM:SS") + ";" + format);
4130+ break;
4131+ }
4132+ case Table::Text:
4133+ if (g)
4134+ g->setLabelsTextFormat(axes[i], col, d_start_row, end_row);
4135+ reference_dates.push_back(QDate());
4136+ reference_times.push_back(QTime());
4137+ break;
4138+ default:
4139+ reference_dates.push_back(QDate());
4140+ reference_times.push_back(QTime());
4141+ break;
4142+ };
4143+ }
4144+
4145+ // convert data to numeric representation used for plotting
4146+ for (int i=0; i<valid_rows.size(); i++)
4147+ for (int j=0; j<cols.size(); j++)
4148+ switch (cols[j]->columnMode()) {
4149+ case Table::Text:
4150+ result[j][i] = static_cast<double>(valid_rows[i] + 1);
4151+ break;
4152+ case Table::Time:
4153+ result[j][i] = reference_times[j].msecsTo(cols[j]->timeAt(valid_rows[i]));
4154+ break;
4155+ case Table::Date:
4156+ result[j][i] = reference_dates[j].daysTo(cols[j]->dateAt(valid_rows[i]));
4157+ break;
4158+ case Table::DateTime:
4159+ {
4160+ QDateTime dt = cols[j]->dateTimeAt(valid_rows[i]);
4161+ result[j][i] = double(dt.date().toJulianDay()) +
4162+ double( -dt.time().msecsTo(QTime(12,0,0,0)) ) / 86400000.0;
4163+ break;
4164+ }
4165+ default:
4166+ result[j][i] = cols[j]->valueAt(valid_rows[i]);
4167+ break;
4168+ };
4169+
4170+ return result;
4171+}
4172+
4173+bool DataCurve::loadData()
4174 {
4175- Graph *g = (Graph *)plot()->parent();
4176- if (!g)
4177- return;
4178-
4179- int xcol = d_table->colIndex(d_x_column);
4180- int ycol = d_table->colIndex(title().text());
4181-
4182- if (xcol < 0 || ycol < 0){
4183- remove();
4184- return;
4185- }
4186-
4187- Column *x_col_ptr = d_table->column(xcol);
4188- Column *y_col_ptr = d_table->column(ycol);
4189-
4190- int endRow = d_end_row;
4191- if (d_end_row >= x_col_ptr->rowCount())
4192- endRow = x_col_ptr->rowCount() - 1;
4193-
4194- if (d_end_row >= y_col_ptr->rowCount())
4195- endRow = y_col_ptr->rowCount() - 1;
4196-
4197- int r = abs(endRow - d_start_row) + 1;
4198- QVarLengthArray<double> X(r), Y(r);
4199- int xColType = d_table->columnType(xcol);
4200- int yColType = d_table->columnType(ycol);
4201-
4202- QTime time0;
4203- QDate date0;
4204- QDateTime date_time0;
4205- QString date_time_fmt = d_table->columnFormat(xcol);
4206- if (xColType == Table::Time){
4207- for (int row = d_start_row; row <= endRow; row++ ) {
4208- if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
4209- time0 = x_col_ptr->timeAt(row);
4210- if (time0.isValid())
4211- break;
4212- }
4213- }
4214- } else if (xColType == Table::Date){
4215- for (int row = d_start_row; row <= endRow; row++ ){
4216- QString xval=d_table->text(row,xcol);
4217- if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
4218- date0 = x_col_ptr->dateAt(row);
4219- if (date0.isValid())
4220- break;
4221- }
4222- }
4223- } else if (xColType == Table::DateTime){
4224- for (int row = d_start_row; row <= endRow; row++ ){
4225- QString xval=d_table->text(row,xcol);
4226- if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
4227- date_time0 = x_col_ptr->dateTimeAt(row);
4228- if (date_time0.isValid())
4229- break;
4230- }
4231- }
4232- }
4233-
4234- int size = 0;
4235- for (int row = d_start_row; row <= endRow; row++ ) {
4236- if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row)) {
4237- if (xColType == Table::Text) {
4238- X[size] = (double) (row + 1);
4239- }
4240- else if (xColType == Table::Time) {
4241- QTime time = x_col_ptr->timeAt(row);
4242- if (time.isValid())
4243- X[size] = time0.msecsTo (time);
4244- else
4245- continue;
4246- }
4247- else if (xColType == Table::Date) {
4248- QDate d = x_col_ptr->dateAt(row);
4249- if (d.isValid())
4250- X[size] = (double) date0.daysTo(d);
4251- else
4252- continue;
4253- }
4254- else if (xColType == Table::DateTime) {
4255- QDateTime dt = x_col_ptr->dateTimeAt(row);
4256- if (dt.isValid())
4257- {
4258- X[size] = double(dt.date().toJulianDay()) +
4259- double( -dt.time().msecsTo(QTime(12,0,0,0)) ) / 86400000.0;
4260- }
4261- else
4262- continue;
4263- }
4264- else
4265- X[size] = x_col_ptr->valueAt(row);
4266-
4267- if (yColType == Table::Text) {
4268- Y[size] = (double) (row + 1);
4269- }
4270- else if (yColType == Table::Time) {
4271- QTime yval = y_col_ptr->timeAt(row);
4272- if (yval.isValid()) {
4273- Y[size] = double( -yval.msecsTo(QTime(12,0,0,0)) );
4274- }
4275- else
4276- Y[size] = 0.0;
4277- }
4278- else if (yColType == Table::Date) {
4279- QDate yval = y_col_ptr->dateAt(row);
4280- if (yval.isValid()) {
4281- Y[size] = double( yval.toJulianDay() );
4282- }
4283- else
4284- Y[size] = 0.0;
4285- }
4286- else if (yColType == Table::DateTime) {
4287- QDateTime yval = y_col_ptr->dateTimeAt(row);
4288- if (yval.isValid()) {
4289- Y[size] = double(yval.date().toJulianDay()) +
4290- double( -yval.time().msecsTo(QTime(12,0,0,0)) ) / 86400000.0;
4291- }
4292- else
4293- Y[size] = 0.0;
4294- }
4295- else
4296- Y[size] = y_col_ptr->valueAt(row);
4297-
4298- size++;
4299- }
4300- }
4301-
4302- X.resize(size);
4303- Y.resize(size);
4304-
4305- if (!size){
4306- remove();
4307- return;
4308- } else {
4309- if (d_type == Graph::HorizontalBars){
4310- setData(Y.data(), X.data(), size);
4311- foreach(DataCurve *c, d_error_bars)
4312- c->setData(Y.data(), X.data(), size);
4313- } else {
4314- setData(X.data(), Y.data(), size);
4315- foreach(DataCurve *c, d_error_bars)
4316- c->setData(X.data(), Y.data(), size);
4317- }
4318-
4319- if (xColType == Table::Text){
4320- g->setLabelsTextFormat(d_type == Graph::HorizontalBars ? QwtPlot::yLeft : QwtPlot::xBottom,
4321- x_col_ptr, d_start_row, endRow);
4322- } else if (xColType == Table::Time ){
4323- if (d_type == Graph::HorizontalBars){
4324- QStringList lst = g->axisFormatInfo(QwtPlot::yLeft).split(";");
4325- QString fmtInfo = time0.toString() + ";" + lst[1];
4326- g->setLabelsDateTimeFormat(QwtPlot::yLeft, Graph::Time, fmtInfo);
4327- } else {
4328- QStringList lst = g->axisFormatInfo(QwtPlot::xBottom).split(";");
4329- QString fmtInfo = time0.toString() + ";" + lst[1];
4330- g->setLabelsDateTimeFormat(QwtPlot::xBottom, Graph::Time, fmtInfo);
4331- }
4332- } else if (xColType == Table::Date ) {
4333- if (d_type == Graph::HorizontalBars){
4334- QStringList lst = g->axisFormatInfo(QwtPlot::yLeft).split(";");
4335- QString fmtInfo = date0.toString("YYYY-MM-DD") + ";" + lst[1];
4336- g->setLabelsDateTimeFormat(QwtPlot::yLeft, Graph::Date, fmtInfo);
4337- } else {
4338- QStringList lst = g->axisFormatInfo(QwtPlot::xBottom).split(";");
4339- QString fmtInfo = date0.toString("YYYY-MM-DD") + ";" + lst[1];
4340- g->setLabelsDateTimeFormat(QwtPlot::xBottom, Graph::Date, fmtInfo);
4341- }
4342- } else if (xColType == Table::DateTime ) {
4343- if (d_type == Graph::HorizontalBars){
4344- QStringList lst = g->axisFormatInfo(QwtPlot::yLeft).split(";");
4345- QString fmtInfo = date_time0.toString("YYYY-MM-DDTHH:MM:SS") + ";" + lst[1];
4346- g->setLabelsDateTimeFormat(QwtPlot::yLeft, Graph::DateTime, fmtInfo);
4347- } else {
4348- QStringList lst = g->axisFormatInfo(QwtPlot::xBottom).split(";");
4349- QString fmtInfo = date_time0.toString("YYYY-MM-DDTHH:MM:SS") + ";" + lst[1];
4350- g->setLabelsDateTimeFormat(QwtPlot::xBottom, Graph::DateTime, fmtInfo);
4351- }
4352- }
4353-
4354- if (yColType == Table::Text)
4355- g->setLabelsTextFormat(QwtPlot::yLeft, y_col_ptr, d_start_row, endRow);
4356- }
4357+ Column *x_col_ptr = d_table->column(d_x_column);
4358+ Column *y_col_ptr = d_table->column(title().text());
4359+ if (!x_col_ptr || !y_col_ptr) {
4360+ remove();
4361+ return false;
4362+ }
4363+
4364+ QList< QVector<double> > points = convertData(
4365+ d_type == Graph::HorizontalBars ? (QList<Column*>() << y_col_ptr << x_col_ptr) : (QList<Column*>() << x_col_ptr << y_col_ptr),
4366+ QList<int>() << xAxis() << yAxis());
4367+
4368+ if (points.isEmpty() || points[0].size() == 0) {
4369+ remove();
4370+ return false;
4371+ }
4372+
4373+ setData(points[0].data(), points[1].data(), points[0].size());
4374+ foreach(DataCurve *c, d_error_bars)
4375+ c->setData(points[0].data(), points[1].data(), points[0].size());
4376+
4377+ return true;
4378 }
4379
4380 void DataCurve::removeErrorBars(DataCurve *c)
4381@@ -323,9 +321,9 @@
4382
4383 void DataCurve::remove()
4384 {
4385+ if (!plot()) return;
4386 Graph *g = (Graph *)plot()->parent();
4387- if (!g)
4388- return;
4389+ if (!g) return;
4390
4391 g->removeCurve(title().text());
4392 }
4393
4394=== modified file 'scidavis/src/PlotCurve.h'
4395--- scidavis/src/PlotCurve.h 2009-09-06 11:34:04 +0000
4396+++ scidavis/src/PlotCurve.h 2010-07-12 22:57:40 +0000
4397@@ -70,7 +70,8 @@
4398 void setFullRange();
4399
4400 virtual bool updateData(Table *t, const QString& colName);
4401- virtual void loadData();
4402+ virtual bool loadData();
4403+ QList< QVector<double> > convertData(const QList<Column*> &cols, const QList<int> &axes) const;
4404
4405 //! Returns the row index in the data source table corresponding to the data point index.
4406 int tableRow(int point);
4407
4408=== modified file 'scidavis/src/PlotToolInterface.h'
4409--- scidavis/src/PlotToolInterface.h 2009-09-06 11:34:04 +0000
4410+++ scidavis/src/PlotToolInterface.h 2010-07-12 22:57:40 +0000
4411@@ -59,6 +59,9 @@
4412 class PlotToolInterface
4413 {
4414 public:
4415+ enum RTTI { DataPicker, ScreenPicker, LineProfile, MultiPeak, RangeSelector, TranslateCurve };
4416+ virtual RTTI rtti() const = 0;
4417+
4418 PlotToolInterface(Graph *graph) { d_graph = graph; }
4419 virtual ~PlotToolInterface() {};
4420 protected:
4421
4422=== modified file 'scidavis/src/PythonScript.cpp'
4423--- scidavis/src/PythonScript.cpp 2009-09-06 11:34:04 +0000
4424+++ scidavis/src/PythonScript.cpp 2010-07-12 22:57:40 +0000
4425@@ -70,14 +70,14 @@
4426 PyDict_GetItemString(env()->globalDict(), "__builtins__"));
4427 PyObject *ret = PyRun_String(
4428 "def col(c,*arg):\n"
4429- "\ttry: return self.cell(c,arg[0])\n"
4430- "\texcept(IndexError): return self.cell(c,i)\n"
4431+ "\ttry: return self.column(type(c)==str and c or c-1).valueAt(arg[0]-1)\n"
4432+ "\texcept(IndexError): return self.column(type(c)==str and c or c-1).valueAt(i-1)\n"
4433 "def cell(c,r):\n"
4434 "\treturn self.cell(c,r)\n"
4435 "def tablecol(t,c):\n"
4436- "\treturn self.folder().rootFolder().table(t,True).cell(c,i)\n"
4437+ "\treturn self.folder().rootFolder().table(t,True).column(type(c)==str and c or c-1).valuetAt(i-1)\n"
4438 "def _meth_table_col_(t,c):\n"
4439- "\treturn t.cell(c,i)\n"
4440+ "\treturn t.column(type(c)==str and c or c-1).valueAt(i-1)\n"
4441 "self.__class__.col = _meth_table_col_",
4442 Py_file_input, localDict, localDict);
4443 if (ret)
4444
4445=== modified file 'scidavis/src/QwtErrorPlotCurve.cpp'
4446--- scidavis/src/QwtErrorPlotCurve.cpp 2009-09-06 11:34:04 +0000
4447+++ scidavis/src/QwtErrorPlotCurve.cpp 2010-07-12 22:57:40 +0000
4448@@ -276,73 +276,34 @@
4449 loadData();
4450 }
4451
4452-void QwtErrorPlotCurve::loadData()
4453+bool QwtErrorPlotCurve::loadData()
4454 {
4455- if (!d_master_curve)
4456- return;
4457-
4458+ if (!d_master_curve) return false;
4459 Table *mt = d_master_curve->table();
4460- if (!mt)
4461- return;
4462-
4463- int xcol = mt->colIndex(d_master_curve->xColumnName());
4464- int ycol = mt->colIndex(d_master_curve->title().text());
4465-
4466- int errcol = d_table->colIndex(title().text());
4467- if (xcol<0 || ycol<0 || errcol<0)
4468- return;
4469-
4470- Column *x_col_ptr = d_table->column(xcol);
4471- Column *y_col_ptr = d_table->column(ycol);
4472- Column *err_col_ptr = d_table->column(errcol);
4473- int xColType = mt->columnType(xcol);
4474- int yColType = mt->columnType(ycol);
4475- int errColType = mt->columnType(errcol);
4476-
4477- d_start_row = d_master_curve->startRow();
4478- d_end_row = d_master_curve->endRow();
4479-
4480- int endRow = d_end_row;
4481- if (d_end_row >= x_col_ptr->rowCount())
4482- endRow = x_col_ptr->rowCount() - 1;
4483-
4484- if (d_end_row >= y_col_ptr->rowCount())
4485- endRow = y_col_ptr->rowCount() - 1;
4486-
4487- int r = abs(endRow - d_start_row) + 1;
4488- QVector<double> X(r), Y(r), err(r);
4489- int size = 0;
4490-
4491-
4492- for (int row = d_start_row; row <= endRow; row++) {
4493- if (!x_col_ptr->isInvalid(row) && !y_col_ptr->isInvalid(row) && !err_col_ptr->isInvalid(row)) {
4494- if (xColType == Table::Text) {
4495- QString xval = x_col_ptr->textAt(row);
4496- X[size] = (double)(row+1);
4497- } else
4498- X[size] = x_col_ptr->valueAt(row);
4499-
4500- if (yColType == Table::Text) {
4501- QString yval = y_col_ptr->textAt(row);
4502- Y[size] = (double)(row+1);
4503- } else
4504- Y[size] = y_col_ptr->valueAt(row);
4505-
4506- err[size] = err_col_ptr->valueAt(row);
4507-
4508- size++;
4509- }
4510- }
4511-
4512- if (size == 0)
4513- remove();
4514-
4515- X.resize(size);
4516- Y.resize(size);
4517- err.resize(size);
4518-
4519- setData(X.data(), Y.data(), size);
4520- setErrors(err);
4521+ if (!mt) return false;
4522+ Column *x = mt->column(d_master_curve->xColumnName());
4523+ Column *y = mt->column(d_master_curve->title().text());
4524+
4525+ Column *err = d_table->column(title().text());
4526+
4527+ if (!x || !y || !err) {
4528+ remove();
4529+ return false;
4530+ }
4531+
4532+ QList< QVector<double> > data = convertData(
4533+ d_master_curve->type() == Graph::HorizontalBars ? (QList<Column*>() << y << x << err) : (QList<Column*>() << x << y << err),
4534+ QList<int>() << xAxis() << yAxis() << (type==Horizontal ? xAxis() : yAxis()) );
4535+
4536+ if (data.isEmpty() || data[0].size() == 0) {
4537+ remove();
4538+ return false;
4539+ }
4540+
4541+ setData(data[0].data(), data[1].data(), data[0].size());
4542+ setErrors(data[2]);
4543+
4544+ return true;
4545 }
4546
4547 QString QwtErrorPlotCurve::plotAssociation()
4548
4549=== modified file 'scidavis/src/QwtErrorPlotCurve.h'
4550--- scidavis/src/QwtErrorPlotCurve.h 2009-09-06 11:34:04 +0000
4551+++ scidavis/src/QwtErrorPlotCurve.h 2010-07-12 22:57:40 +0000
4552@@ -83,7 +83,7 @@
4553 QString plotAssociation();
4554
4555 bool updateData(Table *t, const QString& colName);
4556- void loadData();
4557+ virtual bool loadData();
4558
4559 private:
4560 virtual void draw(QPainter *painter,const QwtScaleMap &xMap,
4561
4562=== modified file 'scidavis/src/QwtHistogram.cpp'
4563--- scidavis/src/QwtHistogram.cpp 2009-09-06 11:34:04 +0000
4564+++ scidavis/src/QwtHistogram.cpp 2010-07-12 22:57:40 +0000
4565@@ -34,8 +34,8 @@
4566 #include <gsl/gsl_vector.h>
4567 #include <gsl/gsl_histogram.h>
4568
4569-QwtHistogram::QwtHistogram(Table *t, const QString& xColName, const char *name, int startRow, int endRow):
4570- QwtBarCurve(QwtBarCurve::Vertical, t, xColName, name, startRow, endRow)
4571+QwtHistogram::QwtHistogram(Table *t, const char *name, int startRow, int endRow):
4572+ QwtBarCurve(QwtBarCurve::Vertical, t, "dummy", name, startRow, endRow)
4573 {
4574 d_autoBin = true;
4575 }
4576@@ -96,7 +96,7 @@
4577 d_end = end;
4578 }
4579
4580-void QwtHistogram::loadData()
4581+bool QwtHistogram::loadData()
4582 {
4583 int r = abs(d_end_row - d_start_row) + 1;
4584 QVarLengthArray<double> Y(r);
4585@@ -128,7 +128,7 @@
4586 X[i] = 0;
4587 }
4588 setData(X, Y.data(), 2);
4589- return;
4590+ return false;
4591 }
4592
4593 int n;
4594@@ -137,7 +137,7 @@
4595 n = 10;
4596 h = gsl_histogram_alloc (n);
4597 if (!h)
4598- return;
4599+ return false;
4600
4601 gsl_vector *v = gsl_vector_alloc (size);
4602 for (int i = 0; i<size; i++ )
4603@@ -156,7 +156,7 @@
4604 n = int((d_end - d_begin)/d_bin_size + 1);
4605 h = gsl_histogram_alloc (n);
4606 if (!h)
4607- return;
4608+ return false;
4609
4610 double *range = new double[n+2];
4611 for (int i = 0; i<= n+1; i++ )
4612@@ -185,6 +185,8 @@
4613 d_max = gsl_histogram_max_val(h);
4614
4615 gsl_histogram_free (h);
4616+
4617+ return true;
4618 }
4619
4620 void QwtHistogram::initData(const QVector<double>& Y, int size)
4621
4622=== modified file 'scidavis/src/QwtHistogram.h'
4623--- scidavis/src/QwtHistogram.h 2009-09-06 11:34:04 +0000
4624+++ scidavis/src/QwtHistogram.h 2010-07-12 22:57:40 +0000
4625@@ -32,7 +32,7 @@
4626 class QwtHistogram: public QwtBarCurve
4627 {
4628 public:
4629- QwtHistogram(Table *t, const QString& xColName, const char *name, int startRow, int endRow);
4630+ QwtHistogram(Table *t, const char *name, int startRow, int endRow);
4631
4632 void copy(const QwtHistogram *h);
4633
4634@@ -44,7 +44,7 @@
4635 double end(){return d_end;};
4636 double binSize(){return d_bin_size;};
4637
4638- void loadData();
4639+ virtual bool loadData();
4640 void initData(const QVector<double>& Y, int size);
4641
4642 double mean(){return d_mean;};
4643
4644=== modified file 'scidavis/src/QwtPieCurve.cpp'
4645--- scidavis/src/QwtPieCurve.cpp 2009-09-06 11:34:04 +0000
4646+++ scidavis/src/QwtPieCurve.cpp 2010-07-12 22:57:40 +0000
4647@@ -111,7 +111,7 @@
4648 setBrush(br);
4649 }
4650
4651-void QwtPieCurve::loadData()
4652+bool QwtPieCurve::loadData()
4653 {
4654 QVarLengthArray<double> Y(abs(d_end_row - d_start_row) + 1);
4655 int size = 0;
4656@@ -136,6 +136,8 @@
4657 }
4658 Y.resize(size);
4659 setData(Y.data(), Y.data(), size);
4660+
4661+ return true;
4662 }
4663
4664 void QwtPieCurve::updateBoundingRect()
4665
4666=== modified file 'scidavis/src/QwtPieCurve.h'
4667--- scidavis/src/QwtPieCurve.h 2009-09-06 11:34:04 +0000
4668+++ scidavis/src/QwtPieCurve.h 2010-07-12 22:57:40 +0000
4669@@ -47,7 +47,7 @@
4670 void setFirstColor(int index){d_first_color = index;};
4671 int firstColor(){return d_first_color;};
4672
4673- void loadData();
4674+ virtual bool loadData();
4675 void updateBoundingRect();
4676
4677 private:
4678
4679=== modified file 'scidavis/src/RangeSelectorTool.h'
4680--- scidavis/src/RangeSelectorTool.h 2009-09-06 11:34:04 +0000
4681+++ scidavis/src/RangeSelectorTool.h 2010-07-12 22:57:40 +0000
4682@@ -57,6 +57,7 @@
4683 public:
4684 RangeSelectorTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
4685 virtual ~RangeSelectorTool();
4686+ virtual RTTI rtti() const { return RangeSelector; }
4687 double minXValue() const { return qMin(d_active_marker.xValue(), d_inactive_marker.xValue()); }
4688 double maxXValue() const { return qMax(d_active_marker.xValue(), d_inactive_marker.xValue()); }
4689 int dataSize() const { return qAbs(d_active_point - d_inactive_point); }
4690
4691=== modified file 'scidavis/src/ScaleDraw.cpp'
4692--- scidavis/src/ScaleDraw.cpp 2009-09-06 11:34:04 +0000
4693+++ scidavis/src/ScaleDraw.cpp 2010-07-12 22:57:40 +0000
4694@@ -36,13 +36,23 @@
4695 #include <qwt_text.h>
4696
4697 ScaleDraw::ScaleDraw(const QString& s):
4698+ formula_string (s),
4699 d_fmt('g'),
4700 d_prec(4),
4701- formula_string (s),
4702- d_majTicks(Out),
4703- d_minTicks(Out)
4704+ d_minTicks(Out),
4705+ d_majTicks(Out)
4706 {};
4707
4708+ScaleDraw::ScaleDraw(const ScaleDraw &other, const QString &s) :
4709+ QwtScaleDraw(other),
4710+ formula_string(s),
4711+ d_minTicks(other.majorTicksStyle()),
4712+ d_majTicks(other.minorTicksStyle())
4713+{
4714+ other.labelFormat(d_fmt, d_prec);
4715+ invalidateCache();
4716+}
4717+
4718 double ScaleDraw::transformValue(double value) const
4719 {
4720 if (!formula_string.isEmpty())
4721@@ -188,7 +198,11 @@
4722
4723 QwtText DateScaleDraw::label(double value) const
4724 {
4725-QDate t = t_origin.addDays( (int) value );
4726+QDate t;
4727+if (t_origin.isValid())
4728+ t = t_origin.addDays((int) floor(value));
4729+else
4730+ t = QDate::fromJulianDay((int) floor(value));
4731 return QwtText(t.toString ( t_format ));
4732 }
4733
4734@@ -211,7 +225,7 @@
4735 QwtText DateTimeScaleDraw::label(double value) const
4736 {
4737 QDate date = QDate::fromJulianDay(qRound(value));
4738- QTime time = QTime(12,0,0,0).addMSecs(int( (value - int(value)) * 86400000.0 ));
4739+ QTime time = QTime(12,0,0,0).addMSecs(int( (value - floor(value)) * 86400000.0 ));
4740 QDateTime dt = QDateTime(date, time);
4741 return QwtText(dt.toString(d_format));
4742 }
4743
4744=== modified file 'scidavis/src/ScaleDraw.h'
4745--- scidavis/src/ScaleDraw.h 2009-09-06 11:34:04 +0000
4746+++ scidavis/src/ScaleDraw.h 2010-07-12 22:57:40 +0000
4747@@ -43,6 +43,7 @@
4748 enum TicksStyle{None = 0, Out = 1, Both = 2, In = 3};
4749
4750 ScaleDraw(const QString& s = QString::null);
4751+ ScaleDraw(const ScaleDraw &other, const QString &s = QString::null);
4752 virtual ~ScaleDraw(){};
4753
4754 QString formulaString() {return formula_string;};
4755@@ -58,12 +59,12 @@
4756 void labelFormat(char &f, int &prec) const;
4757 void setLabelFormat(char f, int prec);
4758
4759- int labelNumericPrecision(){return d_prec;};
4760+ int labelNumericPrecision() const { return d_prec; };
4761
4762- int majorTicksStyle(){return d_majTicks;};
4763+ int majorTicksStyle() const { return d_majTicks; };
4764 void setMajorTicksStyle(TicksStyle type){d_majTicks = type;};
4765
4766- int minorTicksStyle(){return d_minTicks;};
4767+ int minorTicksStyle() const { return d_minTicks; };
4768 void setMinorTicksStyle(TicksStyle type){d_minTicks = type;};
4769
4770 protected:
4771@@ -80,12 +81,16 @@
4772 {
4773 public:
4774 QwtTextScaleDraw(const QMap<int, QString>& list);
4775+ QwtTextScaleDraw(const ScaleDraw &other, const QMap<int, QString>& list) :
4776+ ScaleDraw(other), labels(list)
4777+ {}
4778 ~QwtTextScaleDraw(){};
4779
4780 QwtText label(double value) const;
4781
4782 QStringList labelsList() { return QStringList(labels.values()); }
4783 QMap<int, QString> labelsMap() { return labels; }
4784+ void setLabelsMap(const QMap<int, QString>& list) { labels = list; }
4785 private:
4786 QMap<int, QString> labels;
4787 };
4788@@ -94,6 +99,9 @@
4789 {
4790 public:
4791 TimeScaleDraw(const QTime& t, const QString& format);
4792+ TimeScaleDraw(const ScaleDraw &other, const QTime& t, const QString& format) :
4793+ ScaleDraw(other), t_origin(t), t_format(format)
4794+ {}
4795 ~TimeScaleDraw(){};
4796
4797 QString origin();
4798@@ -110,6 +118,9 @@
4799 {
4800 public:
4801 DateScaleDraw(const QDate& t, const QString& format);
4802+ DateScaleDraw(const ScaleDraw &other, const QDate& t, const QString& format) :
4803+ ScaleDraw(other), t_origin(t), t_format(format)
4804+ {}
4805 ~DateScaleDraw(){};
4806
4807 QString origin();
4808@@ -126,6 +137,9 @@
4809 {
4810 public:
4811 DateTimeScaleDraw(const QDateTime & origin, const QString & format);
4812+ DateTimeScaleDraw(const ScaleDraw &other, const QDateTime & origin, const QString & format)
4813+ : ScaleDraw(other), d_origin(origin), d_format(format)
4814+ {}
4815 ~DateTimeScaleDraw(){};
4816
4817 QString origin();
4818@@ -144,6 +158,9 @@
4819 enum NameFormat{ShortName, LongName, Initial};
4820
4821 WeekDayScaleDraw(NameFormat format = ShortName);
4822+ WeekDayScaleDraw(const ScaleDraw &other, NameFormat format = ShortName) :
4823+ ScaleDraw(other), d_format(format)
4824+ {}
4825 ~WeekDayScaleDraw(){};
4826
4827 NameFormat format() {return d_format;};
4828@@ -159,6 +176,9 @@
4829 enum NameFormat{ShortName, LongName, Initial};
4830
4831 MonthScaleDraw(NameFormat format = ShortName);
4832+ MonthScaleDraw(const ScaleDraw &other, NameFormat format = ShortName) :
4833+ ScaleDraw(other), d_format(format)
4834+ {}
4835 ~MonthScaleDraw(){};
4836
4837 NameFormat format() {return d_format;};
4838@@ -172,6 +192,11 @@
4839 {
4840 public:
4841 QwtSupersciptsScaleDraw(const QString& s = QString::null);
4842+ QwtSupersciptsScaleDraw(const ScaleDraw &other, const QString& s = QString::null) :
4843+ ScaleDraw(other)
4844+ {
4845+ setFormulaString(s);
4846+ }
4847 ~QwtSupersciptsScaleDraw(){};
4848
4849 QwtText label(double value) const;
4850
4851=== modified file 'scidavis/src/ScreenPickerTool.h'
4852--- scidavis/src/ScreenPickerTool.h 2009-09-06 11:34:04 +0000
4853+++ scidavis/src/ScreenPickerTool.h 2010-07-12 22:57:40 +0000
4854@@ -48,6 +48,7 @@
4855 public:
4856 ScreenPickerTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
4857 virtual ~ScreenPickerTool();
4858+ virtual RTTI rtti() const { return ScreenPicker; }
4859 virtual bool eventFilter(QObject *obj, QEvent *event);
4860 signals:
4861 /*! Emitted whenever a new message should be presented to the user.
4862
4863=== modified file 'scidavis/src/ScriptEdit.cpp'
4864--- scidavis/src/ScriptEdit.cpp 2009-09-06 11:34:04 +0000
4865+++ scidavis/src/ScriptEdit.cpp 2010-07-12 22:57:40 +0000
4866@@ -41,7 +41,7 @@
4867 #include <QTextStream>
4868
4869 ScriptEdit::ScriptEdit(ScriptingEnv *env, QWidget *parent, const char *name)
4870- : QTextEdit(parent, name), scripted(env), d_error(false)
4871+ : QTextEdit(parent, name), scripted(env), d_error(false), d_changing_fmt(false)
4872 {
4873 myScript = scriptEnv->newScript("", this, name);
4874 connect(myScript, SIGNAL(error(const QString&,const QString&,int)), this, SLOT(insertErrorMsg(const QString&)));
4875
4876=== modified file 'scidavis/src/SelectionMoveResizer.cpp'
4877--- scidavis/src/SelectionMoveResizer.cpp 2009-09-06 11:34:04 +0000
4878+++ scidavis/src/SelectionMoveResizer.cpp 2010-07-12 22:57:40 +0000
4879@@ -221,13 +221,13 @@
4880 {
4881 switch(op) {
4882 case Resize_N:
4883- return QRect( QPoint(rect.center().x()-handler_size/2, rect.top()),
4884+ return QRect( QPoint(rect.center().x()-handler_size/2, rect.top()+1),
4885 QSize(handler_size,handler_size));
4886 case Resize_NE:
4887- return QRect( QPoint(rect.right()-handler_size+1, rect.top()),
4888+ return QRect( QPoint(rect.right()-handler_size+1, rect.top()+1),
4889 QSize(handler_size,handler_size));
4890 case Resize_E:
4891- return QRect( QPoint(rect.right()-handler_size+1, rect.center().y()-handler_size/2),
4892+ return QRect( QPoint(rect.right()-handler_size+1, rect.center().y()-handler_size/2+1),
4893 QSize(handler_size,handler_size));
4894 case Resize_SE:
4895 return QRect( QPoint(rect.right()-handler_size+1, rect.bottom()-handler_size+1),
4896@@ -239,10 +239,10 @@
4897 return QRect( QPoint(rect.left(),rect.bottom()-handler_size+1),
4898 QSize(handler_size,handler_size));
4899 case Resize_W:
4900- return QRect( QPoint(rect.left(), rect.center().y()-handler_size/2),
4901+ return QRect( QPoint(rect.left(), rect.center().y()-handler_size/2+1),
4902 QSize(handler_size,handler_size));
4903 case Resize_NW:
4904- return QRect( rect.topLeft(),
4905+ return QRect( rect.topLeft()+QPoint(0,1),
4906 QSize(handler_size,handler_size));
4907 default:
4908 return QRect( rect.topLeft(), QSize(0,0));
4909
4910=== removed file 'scidavis/src/SortDialog.cpp'
4911--- scidavis/src/SortDialog.cpp 2009-09-06 11:34:04 +0000
4912+++ scidavis/src/SortDialog.cpp 1970-01-01 00:00:00 +0000
4913@@ -1,103 +0,0 @@
4914-/***************************************************************************
4915- File : SortDialog.cpp
4916- Project : SciDAVis
4917- --------------------------------------------------------------------
4918- Copyright : (C) 2006 by Ion Vasilief, Tilman Benkert
4919- Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
4920- Description : Sorting options dialog
4921-
4922- ***************************************************************************/
4923-
4924-/***************************************************************************
4925- * *
4926- * This program is free software; you can redistribute it and/or modify *
4927- * it under the terms of the GNU General Public License as published by *
4928- * the Free Software Foundation; either version 2 of the License, or *
4929- * (at your option) any later version. *
4930- * *
4931- * This program is distributed in the hope that it will be useful, *
4932- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
4933- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
4934- * GNU General Public License for more details. *
4935- * *
4936- * You should have received a copy of the GNU General Public License *
4937- * along with this program; if not, write to the Free Software *
4938- * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
4939- * Boston, MA 02110-1301 USA *
4940- * *
4941- ***************************************************************************/
4942-#include "SortDialog.h"
4943-
4944-#include <QPushButton>
4945-#include <QLabel>
4946-#include <QComboBox>
4947-#include <QGroupBox>
4948-#include <QLayout>
4949-#include <QApplication>
4950-
4951-SortDialog::SortDialog( QWidget* parent, Qt::WFlags fl )
4952- : QDialog( parent, fl )
4953-{
4954- setWindowIcon(qApp->windowIcon());
4955- setWindowTitle(tr("Sorting Options"));
4956- setSizeGripEnabled(true);
4957-
4958- QGroupBox *groupBox1 = new QGroupBox();
4959- QGridLayout * topLayout = new QGridLayout(groupBox1);
4960- QHBoxLayout * hl = new QHBoxLayout();
4961- hl->addStretch();
4962-
4963- topLayout->addWidget( new QLabel(tr("Sort columns")), 0, 0 );
4964- boxType = new QComboBox();
4965- boxType->addItem(tr("Separately"));
4966- boxType->addItem(tr("Together"));
4967- topLayout->addWidget(boxType, 0, 1 );
4968-
4969- topLayout->addWidget( new QLabel( tr("Order")), 1, 0 );
4970- boxOrder = new QComboBox();
4971- boxOrder->addItem(tr("Ascending"));
4972- boxOrder->addItem(tr("Descending"));
4973- topLayout->addWidget(boxOrder, 1, 1 );
4974-
4975- topLayout->addWidget( new QLabel(tr("Leading column")), 2, 0 );
4976- columnsList = new QComboBox();
4977- topLayout->addWidget(columnsList, 2, 1);
4978- topLayout->setRowStretch(3, 1);
4979-
4980- buttonOk = new QPushButton(tr("&Sort"));
4981- buttonOk->setDefault( true );
4982- hl->addWidget(buttonOk);
4983-
4984- buttonCancel = new QPushButton(tr("&Close"));
4985- hl->addWidget(buttonCancel);
4986-
4987- QVBoxLayout * mainlayout = new QVBoxLayout(this);
4988- mainlayout->addWidget(groupBox1);
4989- mainlayout->addLayout(hl);
4990-
4991- connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
4992- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
4993- connect( boxType, SIGNAL( activated(int) ), this, SLOT(changeType(int)));
4994-}
4995-
4996-void SortDialog::accept()
4997-{
4998- emit sort(boxType->currentIndex(),boxOrder->currentIndex(),columnsList->currentText());
4999-}
5000-
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: