File indexing completed on 2024-12-22 04:18:02
0001 /*************************************************************************** 0002 * * 0003 * copyright : (C) 2007 The University of Toronto * 0004 * netterfield@astro.utoronto.ca * 0005 * copyright : (C) 2005 University of British Columbia * 0006 * dscott@phas.ubc.ca * 0007 * * 0008 * This program is free software; you can redistribute it and/or modify * 0009 * it under the terms of the GNU General Public License as published by * 0010 * the Free Software Foundation; either version 2 of the License, or * 0011 * (at your option) any later version. * 0012 * * 0013 ***************************************************************************/ 0014 0015 #ifndef CROSSSPECTRUMPLUGIN_H 0016 #define CROSSSPECTRUMPLUGIN_H 0017 0018 #include <QFile> 0019 0020 #include <basicplugin.h> 0021 #include <dataobjectplugin.h> 0022 #include "psdcalculator.h" 0023 0024 class CrossSpectrumSource : public Kst::BasicPlugin { 0025 Q_OBJECT 0026 0027 public: 0028 virtual QString _automaticDescriptiveName() const; 0029 0030 Kst::VectorPtr vectorOne() const; 0031 Kst::VectorPtr vectorTwo() const; 0032 Kst::ScalarPtr scalarFFT() const; 0033 Kst::ScalarPtr scalarRate() const; 0034 0035 virtual void change(Kst::DataObjectConfigWidget *configWidget); 0036 0037 void setupOutputs(); 0038 virtual bool algorithm(); 0039 0040 virtual QStringList inputVectorList() const; 0041 virtual QStringList inputScalarList() const; 0042 virtual QStringList inputStringList() const; 0043 virtual QStringList outputVectorList() const; 0044 virtual QStringList outputScalarList() const; 0045 virtual QStringList outputStringList() const; 0046 0047 virtual void saveProperties(QXmlStreamWriter &s); 0048 0049 protected: 0050 CrossSpectrumSource(Kst::ObjectStore *store); 0051 ~CrossSpectrumSource(); 0052 0053 PSDCalculator _psdCalculator; 0054 0055 0056 friend class Kst::ObjectStore; 0057 0058 0059 }; 0060 0061 0062 class CrossSpectrumPlugin : public QObject, public Kst::DataObjectPluginInterface { 0063 Q_OBJECT 0064 Q_INTERFACES(Kst::DataObjectPluginInterface) 0065 Q_PLUGIN_METADATA(IID "com.kst.DataObjectPluginInterface/2.0") 0066 public: 0067 virtual ~CrossSpectrumPlugin() {} 0068 0069 virtual QString pluginName() const; 0070 virtual QString pluginDescription() const; 0071 0072 virtual DataObjectPluginInterface::PluginTypeID pluginType() const { return Generic; } 0073 0074 virtual bool hasConfigWidget() const { return true; } 0075 0076 virtual Kst::DataObject *create(Kst::ObjectStore *store, Kst::DataObjectConfigWidget *configWidget, bool setupInputsOutputs = true) const; 0077 0078 virtual Kst::DataObjectConfigWidget *configWidget(QSettings *settingsObject) const; 0079 }; 0080 0081 #endif 0082 // vim: ts=2 sw=2 et