[Kst] branches/work/kst/portto4/kst
Barth Netterfield
netterfield at astro.utoronto.ca
Fri Nov 7 15:47:22 CET 2008
SVN commit 881232 by netterfield:
Fix a couple bugs.
-edit vector from vector selector on slave vector now edits
provider
-edit scalar from scalar selector on slave scalar now edits
provider
Move some documentation around
M +0 -12 devel-docs/Kst2Specs/Bugs
M +12 -0 devel-docs/Kst2Specs/FixedBugs
A devel-docs/depricated/whatiswrongwithkst2dplot.txt devel-docs/whatiswrongwithkst2dplot.txt#877145
D devel-docs/whatiswrongwithkst2dplot.txt
M +1 -29 src/libkstapp/datamanager.cpp
M +45 -0 src/libkstapp/dialoglaunchergui.cpp
M +4 -0 src/libkstapp/dialoglaunchergui.h
M +1 -0 src/libkstapp/mainwindow.cpp
M +43 -1 src/libkstmath/dataobject.cpp
M +5 -0 src/libkstmath/dialoglauncher.cpp
M +3 -0 src/libkstmath/dialoglauncher.h
M +38 -0 src/libkstmath/relation.cpp
M +6 -2 src/widgets/scalarselector.cpp
M +6 -2 src/widgets/vectorselector.cpp
M +6 -0 tests/dirfile_maker/dirfile_maker.c
--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/Bugs #881231:881232
@@ -10,18 +10,6 @@
Now edit the curve, do nothing, and hit OK. Still no change.
Now do something to redraw the plot. 'm' mode now works.
------------
-Editing a slave vector from a vector selector should bring up the
-edit dialog for the provider. Instead it brings up a vector edit
-dialog.... not what is wanted and won't work anyway.
-(cbn to fix this)
-
------------
-Editing a slave scalar from a scalar selector should bring up the
-edit dialog for the provider. Instead it brings up a scalar edit
-dialog.... not what is wanted and won't work anyway.
-(cbn to fix this)
-
----------
Cur files no longer work.
Select a cur file from dirfile_maker. It thinks its a ascii file.
--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/FixedBugs #881231:881232
@@ -54,3 +54,15 @@
a file to get rid of all of the old tabs. As a temp hack (to allow file opening) clear() is not called on file open,
so all of the old tabs linger after opening a file. This should be reverted once the bug is fixed.
+-----------
+Editing a slave vector from a vector selector should bring up the
+edit dialog for the provider. Instead it brings up a vector edit
+dialog.... not what is wanted and won't work anyway.
+(cbn to fix this)
+
+-----------
+Editing a slave scalar from a scalar selector should bring up the
+edit dialog for the provider. Instead it brings up a scalar edit
+dialog.... not what is wanted and won't work anyway.
+(cbn to fix this)
+
--- branches/work/kst/portto4/kst/src/libkstapp/datamanager.cpp #881231:881232
@@ -307,35 +307,7 @@
}
void DataManager::showEditDialog() {
- if (CurvePtr curve = kst_cast<Curve>(_currentObject)) {
- DialogLauncher::self()->showCurveDialog(curve);
- } else if (EquationPtr equation = kst_cast<Equation>(_currentObject)) {
- DialogLauncher::self()->showEquationDialog(equation);
- } else if (HistogramPtr histogram = kst_cast<Histogram>(_currentObject)) {
- DialogLauncher::self()->showHistogramDialog(histogram);
- } else if (PSDPtr psd = kst_cast<PSD>(_currentObject)) {
- DialogLauncher::self()->showPowerSpectrumDialog(psd);
- } else if (EventMonitorEntryPtr eventMonitorEntry = kst_cast<EventMonitorEntry>(_currentObject)) {
- DialogLauncher::self()->showEventMonitorDialog(eventMonitorEntry);
- } else if (ImagePtr image = kst_cast<Image>(_currentObject)) {
- DialogLauncher::self()->showImageDialog(image);
- } else if (CSDPtr csd = kst_cast<CSD>(_currentObject)) {
- DialogLauncher::self()->showCSDDialog(csd);
- } else if (VectorPtr vector = kst_cast<Vector>(_currentObject)) {
- QString tmp;
- DialogLauncher::self()->showVectorDialog(tmp, vector);
- } else if (MatrixPtr matrix = kst_cast<Matrix>(_currentObject)) {
- QString tmp;
- DialogLauncher::self()->showMatrixDialog(tmp, matrix);
- } else if (BasicPluginPtr plugin = kst_cast<BasicPlugin>(_currentObject)) {
- DialogLauncher::self()->showBasicPluginDialog(plugin->pluginName(), plugin);
- } else if (ScalarPtr scalar = kst_cast<Scalar>(_currentObject)) {
- QString tmp;
- DialogLauncher::self()->showScalarDialog(tmp, scalar);
- } else if (StringPtr string = kst_cast<String>(_currentObject)) {
- QString tmp;
- DialogLauncher::self()->showStringDialog(tmp, string);
- }
+ DialogLauncher::self()->showObjectDialog(_currentObject);
_doc->session()->triggerReset();
}
--- branches/work/kst/portto4/kst/src/libkstapp/dialoglaunchergui.cpp #881231:881232
@@ -26,6 +26,17 @@
#include "basicplugindialog.h"
#include "filterfitdialog.h"
+#include "curve.h"
+#include "equation.h"
+#include "vector.h"
+#include "matrix.h"
+#include "histogram.h"
+#include "psd.h"
+#include "eventmonitorentry.h"
+#include "image.h"
+#include "csd.h"
+#include "basicplugin.h"
+
namespace Kst {
DialogLauncherGui::DialogLauncherGui() {
@@ -140,6 +151,40 @@
dialog.exec();
}
}
+
+
+void DialogLauncherGui::showObjectDialog(ObjectPtr objectPtr) {
+ if (CurvePtr curve = kst_cast<Curve>(objectPtr)) {
+ DialogLauncher::self()->showCurveDialog(curve);
+ } else if (EquationPtr equation = kst_cast<Equation>(objectPtr)) {
+ DialogLauncher::self()->showEquationDialog(equation);
+ } else if (HistogramPtr histogram = kst_cast<Histogram>(objectPtr)) {
+ DialogLauncher::self()->showHistogramDialog(histogram);
+ } else if (PSDPtr psd = kst_cast<PSD>(objectPtr)) {
+ DialogLauncher::self()->showPowerSpectrumDialog(psd);
+ } else if (EventMonitorEntryPtr eventMonitorEntry = kst_cast<EventMonitorEntry>(objectPtr)) {
+ DialogLauncher::self()->showEventMonitorDialog(eventMonitorEntry);
+ } else if (ImagePtr image = kst_cast<Image>(objectPtr)) {
+ DialogLauncher::self()->showImageDialog(image);
+ } else if (CSDPtr csd = kst_cast<CSD>(objectPtr)) {
+ DialogLauncher::self()->showCSDDialog(csd);
+ } else if (VectorPtr vector = kst_cast<Vector>(objectPtr)) {
+ QString tmp;
+ DialogLauncher::self()->showVectorDialog(tmp, vector);
+ } else if (MatrixPtr matrix = kst_cast<Matrix>(objectPtr)) {
+ QString tmp;
+ DialogLauncher::self()->showMatrixDialog(tmp, matrix);
+ } else if (BasicPluginPtr plugin = kst_cast<BasicPlugin>(objectPtr)) {
+ DialogLauncher::self()->showBasicPluginDialog(plugin->pluginName(), plugin);
+ } else if (ScalarPtr scalar = kst_cast<Scalar>(objectPtr)) {
+ QString tmp;
+ DialogLauncher::self()->showScalarDialog(tmp, scalar);
+ } else if (StringPtr string = kst_cast<String>(objectPtr)) {
+ QString tmp;
+ DialogLauncher::self()->showStringDialog(tmp, string);
+ }
}
+}
+
// vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/libkstapp/dialoglaunchergui.h #881231:881232
@@ -50,6 +50,10 @@
//plugins
virtual void showBasicPluginDialog(QString pluginName, ObjectPtr objectPtr = 0, VectorPtr vectorX = 0, VectorPtr vectorY = 0, PlotItemInterface *plotItem = 0 );
+
+ //show appropriate dialog
+ virtual void showObjectDialog(ObjectPtr objectPtr = 0);
+
};
}
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #881231:881232
@@ -721,6 +721,7 @@
_dataToolBar->addAction(_forwardAct);
_dataToolBar->addAction(_pauseAct);
_dataToolBar->addAction(_readFromEndAct);
+ //_dataToolBar->addAction(_dataWizardAct);
_layoutToggleToolBar = addToolBar(tr("Mode"));
_layoutToggleToolBar->addAction(_layoutModeAct);
--- branches/work/kst/portto4/kst/src/libkstmath/dataobject.cpp #881231:881232
@@ -715,6 +715,16 @@
}
}
}
+ // also replace dependencies on vector strings
+ QHashIterator<QString, String*> stringDictIter(j.value()->strings());
+ for (StringMap::Iterator k = _inputStrings.begin(); k != _inputStrings.end(); ++k) {
+ while (stringDictIter.hasNext()) {
+ stringDictIter.next();
+ if (stringDictIter.value() == k.value()) {
+ _inputStrings[k.key()] = (((newObject->outputVectors())[j.key()])->strings())[stringDictIter.key()];
+ }
+ }
+ }
}
// matrices
@@ -766,6 +776,7 @@
}
}
+ // slave scalars
QHashIterator<QString, Scalar*> scalarDictIter(oldVector->scalars());
for (ScalarMap::Iterator j = _inputScalars.begin(); j != _inputScalars.end(); ++j) {
while (scalarDictIter.hasNext()) {
@@ -775,6 +786,17 @@
}
}
}
+
+ // slave strings
+ QHashIterator<QString, String*> stringDictIter(oldVector->strings());
+ for (StringMap::Iterator j = _inputStrings.begin(); j != _inputStrings.end(); ++j) {
+ while (stringDictIter.hasNext()) {
+ stringDictIter.next();
+ if (stringDictIter.value() == j.value()) {
+ _inputStrings[j.key()] = (newVector->strings())[stringDictIter.key()];
+ }
+ }
+ }
}
@@ -814,6 +836,15 @@
}
}
}
+ QHashIterator<QString, String*> stringDictIter(v->strings());
+ for (StringMap::ConstIterator j = _inputStrings.begin(); j != _inputStrings.end(); ++j) {
+ while (stringDictIter.hasNext()) {
+ stringDictIter.next();
+ if (stringDictIter.value() == j.value()) {
+ return true;
+ }
+ }
+ }
} else if (MatrixPtr matrix = kst_cast<Matrix>(p)) {
for (MatrixMap::ConstIterator j = _inputMatrices.begin(); j != _inputMatrices.end(); ++j) {
if (j.value() == matrix) {
@@ -847,6 +878,17 @@
}
}
}
+ // also check dependencies on vector strings
+ QHashIterator<QString, String*> stringDictIter(j.value()->strings());
+ for (StringMap::ConstIterator k = _inputStrings.begin(); k != _inputStrings.end(); ++k) {
+ while (stringDictIter.hasNext()) {
+ stringDictIter.next();
+ if (stringDictIter.value() == k.value()) {
+ return true;
+ }
+ }
+ }
+
}
for (MatrixMap::Iterator j = obj->outputMatrices().begin(); j != obj->outputMatrices().end(); ++j) {
@@ -855,7 +897,7 @@
return true;
}
}
- // also check dependencies on vector stats
+ // also check dependencies on matrix stats
QHashIterator<QString, Scalar*> scalarDictIter(j.value()->scalars());
for (ScalarMap::ConstIterator k = _inputScalars.begin(); k != _inputScalars.end(); ++k) {
while (scalarDictIter.hasNext()) {
--- branches/work/kst/portto4/kst/src/libkstmath/dialoglauncher.cpp #881231:881232
@@ -124,6 +124,11 @@
Q_UNUSED(plotItem);
}
+
+void DialogLauncher::showObjectDialog(ObjectPtr objectPtr) {
+ Q_UNUSED(objectPtr);
}
+}
+
// vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/libkstmath/dialoglauncher.h #881231:881232
@@ -69,6 +69,9 @@
//plugins
virtual void showBasicPluginDialog(QString pluginName, ObjectPtr objectPtr = 0, VectorPtr vectorX = 0, VectorPtr vectorY = 0, PlotItemInterface *plotItem = 0);
+
+ //show appropriate dialog
+ virtual void showObjectDialog(ObjectPtr objectPtr = 0);
};
}
--- branches/work/kst/portto4/kst/src/libkstmath/relation.cpp #881231:881232
@@ -314,6 +314,15 @@
}
}
}
+ QHashIterator<QString, String*> stringDictIter(v->strings());
+ for (StringMap::ConstIterator j = _inputStrings.begin(); j != _inputStrings.end(); ++j) {
+ while (stringDictIter.hasNext()) {
+ stringDictIter.next();
+ if (stringDictIter.value() == j.value()) {
+ return true;
+ }
+ }
+ }
} else if (MatrixPtr matrix = kst_cast<Matrix>(p)) {
for (MatrixMap::ConstIterator j = _inputMatrices.begin(); j != _inputMatrices.end(); ++j) {
if (j.value() == matrix) {
@@ -347,6 +356,16 @@
}
}
}
+ // also check dependencies on vector strings
+ QHashIterator<QString, String*> stringDictIter(j.value()->strings());
+ for (StringMap::ConstIterator k = _inputStrings.begin(); k != _inputStrings.end(); ++k) {
+ while (stringDictIter.hasNext()) {
+ stringDictIter.next();
+ if (stringDictIter.value() == k.value()) {
+ return true;
+ }
+ }
+ }
}
for (MatrixMap::Iterator j = obj->outputMatrices().begin(); j != obj->outputMatrices().end(); ++j) {
@@ -409,6 +428,16 @@
}
}
}
+ // also replace dependencies on vector strings
+ QHashIterator<QString, String*> stringDictIter(j.value()->strings());
+ for (StringMap::Iterator k = _inputStrings.begin(); k != _inputStrings.end(); ++k) {
+ while (stringDictIter.hasNext()) {
+ stringDictIter.next();
+ if (stringDictIter.value() == k.value()) {
+ _inputStrings[k.key()] = (((newObject->outputVectors())[j.key()])->strings())[stringDictIter.key()];
+ }
+ }
+ }
}
// matrices
@@ -469,6 +498,15 @@
}
}
}
+ QHashIterator<QString, String*> stringDictIter(oldVector->strings());
+ for (StringMap::Iterator j = _inputStrings.begin(); j != _inputStrings.end(); ++j) {
+ while (stringDictIter.hasNext()) {
+ stringDictIter.next();
+ if (stringDictIter.value() == j.value()) {
+ _inputStrings[j.key()] = (newVector->strings())[stringDictIter.key()];
+ }
+ }
+ }
}
--- branches/work/kst/portto4/kst/src/widgets/scalarselector.cpp #881231:881232
@@ -100,8 +100,12 @@
void ScalarSelector::editScalar() {
- QString scalarName;
- DialogLauncher::self()->showScalarDialog(scalarName, ObjectPtr(selectedScalar()));
+ if (selectedScalar()->provider()) {
+ DialogLauncher::self()->showObjectDialog(selectedScalar()->provider());
+ } else {
+ QString scalarName;
+ DialogLauncher::self()->showScalarDialog(scalarName, ObjectPtr(selectedScalar()));
+ }
fillScalars();
}
--- branches/work/kst/portto4/kst/src/widgets/vectorselector.cpp #881231:881232
@@ -127,8 +127,12 @@
void VectorSelector::editVector() {
- QString vectorname;
- DialogLauncher::self()->showVectorDialog(vectorname, ObjectPtr(selectedVector()));
+ if (selectedVector()->provider()) {
+ DialogLauncher::self()->showObjectDialog(selectedVector()->provider());
+ } else {
+ QString vectorname;
+ DialogLauncher::self()->showVectorDialog(vectorname, ObjectPtr(selectedVector()));
+ }
fillVectors(); // we might have just changed the name, so refill the combo.
emit contentChanged();
--- branches/work/kst/portto4/kst/tests/dirfile_maker/dirfile_maker.c #881231:881232
@@ -55,6 +55,12 @@
sprintf(tmpstr,"%s/%s", dirfilename, df[i].field);
df[i].fp = open(tmpstr, O_WRONLY|O_CREAT, 00644);
}
+
+ fprintf(fpf,"CONST1 CONST FLOAT32 16.4\nCONST2 CONST DOUBLE 3.14159\n"
+ "STR1 STRING Test\\ String\n");
+ fprintf(fpf,"META cos metaC CONST FLOAT64 3.291882\n"
+ "META cos metaS STRING Test_String\n");
+
fclose(fpf);
/* make curfile */
More information about the Kst
mailing list