2 KSysGuard, the KDE System Guard
4 Copyright (c) 1999 - 2001 Chris Schlaeger <cs@kde.org>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License version 2 or at your option version 3 as published by
9 the Free Software Foundation.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef KSG_FANCYPLOTTER_H
23 #define KSG_FANCYPLOTTER_H
25 #include <SensorDisplay.h>
28 #include "SignalPlotter.h"
29 #include "SharedSettings.h"
31 class FancyPlotterSettings
;
34 class FancyPlotterLabel
;
36 class FPSensorProperties
: public KSGRD::SensorProperties
40 FPSensorProperties( const QString
&hostName
, const QString
&name
,
41 const QString
&type
, const QString
&description
,
42 const QColor
&color
, const QString
®expName
= QString(),
43 int beamId
= -1, const QString
&summationName
= QString());
44 ~FPSensorProperties();
46 void setColor( const QColor
&color
);
49 QString summationName
;
57 class FancyPlotter
: public KSGRD::SensorDisplay
62 FancyPlotter( QWidget
* parent
, const QString
& title
, SharedSettings
*workSheetSettings
);
63 virtual ~FancyPlotter();
65 void configureSettings();
67 bool addSensor( const QString
&hostName
, const QString
&name
,
68 const QString
&type
, const QString
&title
);
69 bool addSensor( const QString
&hostName
, const QString
&name
,
70 const QString
&type
, const QString
&title
,
71 const QColor
&color
, const QString
®expName
= QString(),
72 int sumToSensor
= -1, const QString
&summationName
= QString());
74 bool removeSensor( uint pos
);
76 virtual void setTitle( const QString
&title
);
78 virtual void answerReceived( int id
, const QList
<QByteArray
> &answerlist
);
80 virtual bool restoreSettings( QDomElement
&element
);
81 virtual bool saveSettings( QDomDocument
&doc
, QDomElement
&element
);
83 virtual bool hasSettingsDialog() const;
86 virtual void applyStyle();
88 void settingsFinished();
90 void plotterAxisScaleChanged();
93 /** When we receive a timer tick, draw the beams and request new information to update the beams*/
94 virtual void timerTick( );
95 virtual bool eventFilter( QObject
*, QEvent
* );
100 /** Number of beams we've received an answer from since asking last */
101 uint mNumAccountedFor
;
103 /** When we talk to the sensor, it tells us a range. Record the max here. equals 0 until we have an answer from it */
104 double mSensorReportedMax
;
105 /** When we talk to the sensor, it tells us a range. Record the min here. equals 0 until we have an answer from it */
106 double mSensorReportedMin
;
108 /** The widget that actually draws the beams */
109 KSignalPlotter
* mPlotter
;
112 The sample buffer and the flags are needed to store the incoming
113 samples for each beam until all samples of the period have been
114 received. The flags variable is used to ensure that all samples have
117 QList
<double> mSampleBuf
;
119 FancyPlotterSettings
* mSettingsDialog
;
124 QList
<SensorToAdd
*> mSensorsToAdd
;
125 QBoxLayout
*mLabelLayout
;
126 QChar mIndicatorSymbol
;