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