PAC-Suite 2.0(r200)

WaveformInterface.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Matthias Nagl   *
00003  *   mnagl@uni-goettingen.de   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef PACWAVEFORMPLUGIN_H
00021 #define PACWAVEFORMPLUGIN_H
00022 
00023 #include <QtPlugin>
00024 #include "PropertyBranchInterface.h"
00025 
00030 class QwtPlot;
00031 class QWidget;
00032 class WaveformDataInterface;
00033 
00034 class WaveformProcessingInterface : public virtual PropertyBranchInterface
00035 {
00036   public:
00037     virtual ~WaveformProcessingInterface() {}
00038 
00039     virtual QString name() const = 0;
00040     virtual QString version() const = 0;
00044     virtual WaveformDataInterface ** createWaveformDataObjects(quint32 num) const = 0;
00049     virtual WaveformDataInterface * tryDeserialization(const QByteArray &serialized) const = 0;
00053     virtual void readUpdatedParameters() = 0;
00054 };
00055 
00056 class WaveformPresentationInterface
00057 {
00058   public:
00059     virtual ~WaveformPresentationInterface() {}
00063     virtual QObject * emptyClone() = 0;
00067     virtual QWidget * getWidget() = 0;
00071     virtual void setTitleString(const QString &) = 0;
00074     virtual void setWaveformData(WaveformDataInterface *data) = 0;
00075 };
00076 
00077 class WaveformDataInterface
00078 {
00079   public:
00080     virtual ~WaveformDataInterface() {}
00081     // Deserializing-constructor MUST be definded for WaveformDataInterface-derived classes!!!
00082     virtual void clone(const WaveformDataInterface *original) = 0;
00083     virtual QByteArray serialize(const QByteArray &childrensdata = QByteArray()) const = 0;
00084     virtual QByteArray deserialize(const QByteArray &serialized) = 0;
00085     virtual void setData(
00086       quint32 numsamples,
00087       const qint8 * dataArray,
00088       qulonglong triggertimestamp,
00089       qreal hpos,
00090       qint32 samplesbeforetrigger,
00091       qreal sampleinterval,
00092       qreal vgain,
00093       qreal voffset,
00094       qint8 polarity,
00095       qreal triggerlevel
00096     ) = 0;
00097     virtual qreal getCoulomb() const = 0;
00098     virtual qulonglong getSignalOnset() const = 0;
00099     virtual bool badWaveform() const = 0;
00100     virtual qint32 overflowSamples() const = 0;
00101     virtual void setNodeId(quint16 nodeid) = 0;
00102     virtual quint16 nodeId() const = 0;
00103     virtual QString toCSV() const = 0;
00104 };
00105 
00106 Q_DECLARE_INTERFACE(WaveformProcessingInterface, "de.uni-goettingen.Pac.WaveformProcessingInterface/1.0")
00107 Q_DECLARE_INTERFACE(WaveformPresentationInterface, "de.uni-goettingen.Pac.WaveformPresentationInterface/1.0")
00108 
00109 #endif
 All Classes Namespaces Files Functions Enumerations Enumerator Defines