[Kst] branches/work/kst/portto4/kst

Mike Fenton mike at staikos.net
Wed Nov 7 15:16:18 CET 2007


SVN commit 733896 by fenton:

Add Save/Restore for EventMonitorEntry.
Move EventMonitorEntry and EmailThread to libkstmath.
Fix crash in EventMonitorDialog.
Add Save for BasicPlugin.


 M  +1 -0      devel-docs/Kst2Specs/kstfile.txt  
 D             src/libkstapp/emailthread.cpp  
 D             src/libkstapp/emailthread.h  
 M  +6 -0      src/libkstapp/eventmonitordialog.cpp  
 M  +2 -0      src/libkstapp/eventmonitordialog.h  
 D             src/libkstapp/eventmonitorentry.cpp  
 D             src/libkstapp/eventmonitorentry.h  
 M  +0 -4      src/libkstapp/libkstapp.pro  
 M  +33 -26    src/libkstmath/basicplugin.cpp  
 M  +2 -1      src/libkstmath/basicplugin.h  
 M  +2 -0      src/libkstmath/builtinobjects.cpp  
 A             src/libkstmath/emailthread.cpp   src/libkstapp/emailthread.cpp#733617 [License: GPL (v2+)]
 A             src/libkstmath/emailthread.h   src/libkstapp/emailthread.h#733617 [License: GPL (v2+)]
 A             src/libkstmath/eventmonitorentry.cpp   src/libkstapp/eventmonitorentry.cpp#733617 [License: GPL (v2+)]
 A             src/libkstmath/eventmonitorentry.h   src/libkstapp/eventmonitorentry.h#733617 [License: GPL (v2+)]
 M  +6 -0      src/libkstmath/libkstmath.pro  


--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/kstfile.txt #733895:733896
@@ -30,6 +30,7 @@
     <equation tag="" expression="" xvector="" interpolate=""></equation>
     <histogram tag="" vector="" numberofbins="" realtimeautobin="" min="" max="" normalizationmode=""></histogram>
     <powerspectrum tag="" vector="" samplerate="" gaussiansigma="" average="" fftlength="" removemean="" apodize="" apodizefunction="" interpolateholes="" vectorunits="" rateunits="" outputtype=""></powerspectrum>
+    <eventmonitor tag="" equation="" description="" logdebug="" loglevel="" logemail="" logelog="" emailrecipients="" script=""></eventmonitor>
   </objects>
   <relations>
     <xycurve name="" xvector="" yvector="">
--- branches/work/kst/portto4/kst/src/libkstapp/eventmonitordialog.cpp #733895:733896
@@ -81,6 +81,12 @@
 }
 
 
+void EventMonitorTab::setObjectStore(ObjectStore *store) {
+  _vectorSelector->setObjectStore(store);
+  _scalarSelector->setObjectStore(store);
+}
+
+
 EventMonitorDialog::EventMonitorDialog(ObjectPtr dataObject, QWidget *parent)
   : DataDialog(dataObject, parent) {
 
--- branches/work/kst/portto4/kst/src/libkstapp/eventmonitordialog.h #733895:733896
@@ -29,6 +29,8 @@
     EventMonitorTab(QWidget *parent = 0);
     virtual ~EventMonitorTab();
 
+    void setObjectStore(ObjectStore *store);
+
     QString script() const;
     QString event() const;
     QString description() const;
--- branches/work/kst/portto4/kst/src/libkstapp/libkstapp.pro #733895:733896
@@ -50,11 +50,9 @@
     differentiatecurvesdialog.cpp \
     document.cpp \
     editmultiplewidget.cpp \
-    emailthread.cpp \
     ellipseitem.cpp \
     equationdialog.cpp \
     eventmonitordialog.cpp \
-    eventmonitorentry.cpp \
     exportgraphicsdialog.cpp \
     filltab.cpp \
     generaltab.cpp \
@@ -138,10 +136,8 @@
     document.h \
     editmultiplewidget.h \
     ellipseitem.h \
-    emailthread.h \
     equationdialog.h \
     eventmonitordialog.h \
-    eventmonitorentry.h \
     exportgraphicsdialog.h \
     filltab.h \
     generaltab.h \
--- branches/work/kst/portto4/kst/src/libkstmath/basicplugin.cpp #733895:733896
@@ -11,7 +11,7 @@
 
 #include <stdlib.h>
 
-#include <QTextDocument>
+#include <QXmlStreamWriter>
 
 #ifndef Q_WS_WIN32
 #include <unistd.h>
@@ -28,6 +28,7 @@
 namespace Kst {
 
 const QString BasicPlugin::staticTypeString = I18N_NOOP("Plugin");
+const QString BasicPlugin::staticTypeTag = I18N_NOOP("plugin");
 
 BasicPlugin::BasicPlugin(ObjectStore *store, const ObjectTag& tag)
 : DataObject(store, tag), _isFit(false) {
@@ -348,45 +349,51 @@
 }
 
 
-void BasicPlugin::save(QTextStream& ts, const QString& indent) {
-  QString l2 = indent + "  ";
-  //The plugin name _must_ be the same as the entry in the .desktop file
-  ts << indent << "<plugin name=\"" << propertyString() << "\">" << endl;
-  ts << l2 << "<tag>" << Qt::escape(tag().tagString()) << "</tag>" << endl;
+
+void BasicPlugin::save(QXmlStreamWriter &s) {
+  s.writeStartElement(staticTypeTag);
+  s.writeAttribute("name", propertyString());
+  s.writeAttribute("tag", tag().tagString());
   for (VectorMap::Iterator i = _inputVectors.begin(); i != _inputVectors.end(); ++i) {
-    ts << l2 << "<ivector name=\"" << Qt::escape(i.key()) << "\">"
-        << Qt::escape(i.value()->tag().tagString())
-        << "</ivector>" << endl;
+    s.writeStartElement("ivector");
+    s.writeAttribute("name", i.key());
+    s.writeAttribute("tag", i.value()->tag().tagString());
+    s.writeEndElement();
   }
   for (ScalarMap::Iterator i = _inputScalars.begin(); i != _inputScalars.end(); ++i) {
-    ts << l2 << "<iscalar name=\"" << Qt::escape(i.key()) << "\">"
-        << Qt::escape(i.value()->tag().tagString())
-        << "</iscalar>" << endl;
+    s.writeStartElement("iscalar");
+    s.writeAttribute("name", i.key());
+    s.writeAttribute("tag", i.value()->tag().tagString());
+    s.writeEndElement();
   }
   for (StringMap::Iterator i = _inputStrings.begin(); i != _inputStrings.end(); ++i) {
-    ts << l2 << "<istring name=\"" << Qt::escape(i.key()) << "\">"
-        << Qt::escape(i.value()->tag().tagString())
-        << "</istring>" << endl;
+    s.writeStartElement("istring");
+    s.writeAttribute("name", i.key());
+    s.writeAttribute("tag", i.value()->tag().tagString());
+    s.writeEndElement();
   }
   for (VectorMap::Iterator i = _outputVectors.begin(); i != _outputVectors.end(); ++i) {
-    ts << l2 << "<ovector name=\"" << Qt::escape(i.key());
+    s.writeStartElement("ovector");
+    s.writeAttribute("name", i.key());
+    s.writeAttribute("tag", i.value()->tag().tagString());
     if (i.value()->isScalarList()) {
-      ts << "\" scalarList=\"1";
+      s.writeAttribute("scalarlist", "true");
     }
-    ts << "\">" << Qt::escape(i.value()->tag().name())  // FIXME: is this right?
-        << "</ovector>" << endl;
+    s.writeEndElement();
   }
   for (ScalarMap::Iterator i = _outputScalars.begin(); i != _outputScalars.end(); ++i) {
-    ts << l2 << "<oscalar name=\"" << Qt::escape(i.key()) << "\">"
-        << Qt::escape(i.value()->tag().name())  // FIXME: is this right?
-        << "</oscalar>" << endl;
+    s.writeStartElement("oscalar");
+    s.writeAttribute("name", i.key());
+    s.writeAttribute("tag", i.value()->tag().tagString());
+    s.writeEndElement();
   }
   for (StringMap::Iterator i = _outputStrings.begin(); i != _outputStrings.end(); ++i) {
-    ts << l2 << "<ostring name=\"" << Qt::escape(i.key()) << "\">"
-        << Qt::escape(i.value()->tag().name())  // FIXME: is this right?
-        << "</ostring>" << endl;
+    s.writeStartElement("ostring");
+    s.writeAttribute("name", i.key());
+    s.writeAttribute("tag", i.value()->tag().tagString());
+    s.writeEndElement();
   }
-  ts << indent << "</plugin>" << endl;
+  s.writeEndElement();
 }
 
 
--- branches/work/kst/portto4/kst/src/libkstmath/basicplugin.h #733895:733896
@@ -25,6 +25,7 @@
   public:
     static const QString staticTypeString;
     const QString& typeString() const { return staticTypeString; }
+    static const QString staticTypeTag;
 
     //The implementation of the algorithm the plugin provides.
     //Operates on the inputVectors, inputScalars, and inputStrings
@@ -78,7 +79,7 @@
 
     //Regular virtual methods from DataObject
     void load(const QDomElement &e);
-    void save(QTextStream& ts, const QString& indent = QString::null);
+    virtual void save(QXmlStreamWriter &s);
 
     bool isFit() const { return _isFit; }
     // FIXME: remove this
--- branches/work/kst/portto4/kst/src/libkstmath/builtinobjects.cpp #733895:733896
@@ -14,6 +14,7 @@
 #include "csdfactory.h"
 #include "histogramfactory.h"
 #include "psdfactory.h"
+#include "eventmonitorfactory.h"
 
 namespace Kst {
   namespace Builtins {
@@ -22,6 +23,7 @@
       new CSDFactory;
       new HistogramFactory;
       new PSDFactory;
+      new EventMonitorFactory;
     }
   }
 }
--- branches/work/kst/portto4/kst/src/libkstmath/libkstmath.pro #733895:733896
@@ -34,6 +34,7 @@
     dataobjectcollection.cpp \
     defaultnames.cpp \
     dialoglauncher.cpp \
+    emailthread.cpp \
     eparse.cpp \
     eparse-eh.cpp \
     enodes.cpp \
@@ -41,6 +42,8 @@
     escan.cpp \
     equation.cpp \
     equationfactory.cpp \
+    eventmonitorentry.cpp \
+    eventmonitorfactory.cpp \
     fftsg_h.c \
     histogram.cpp \
     histogramfactory.cpp \
@@ -75,8 +78,11 @@
     dataobjectcollection.h \
     dataobject.h \
     defaultnames.h \
+    emailthread.h \
     equation.h \
     equationfactory.h \
+    eventmonitorentry.h \
+    eventmonitorfactory.h \
     histogram.h \
     histogramfactory.h \
     image.h \


More information about the Kst mailing list