1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
  
     | 
    
      // Copyright 2008 Simon Edwards <simon@simonzone.com>
//                 Generated by twine
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details
// You should have received a copy of the GNU Library General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
namespace Plasma
{
class PlotColor
{
%TypeHeaderCode
#include <plasma/widgets/signalplotter.h>
%End
public:
    QColor color;
    QColor darkColor;
};
// PlotColor
class SignalPlotter : QGraphicsWidget
{
%TypeHeaderCode
#include <plasma/widgets/signalplotter.h>
%End
public:
                            SignalPlotter (QGraphicsItem* parent = 0);
    void                    addPlot (const QColor& color);
    void                    addSample (const QList<double>& samples);
    void                    reorderPlots (const QList<uint>& newOrder);
    void                    removePlot (uint pos);
    QList<Plasma::PlotColor>&  plotColors ();
    void                    setTitle (const QString& title);
    QString                 title () const;
    void                    setUnit (const QString& unit);
    QString                 unit () const;
    void                    scale (qreal delta);
    qreal                   scaledBy () const;
    void                    setUseAutoRange (bool value);
    bool                    useAutoRange () const;
    void                    setVerticalRange (double min, double max);
    double                  verticalMinValue () const;
    double                  verticalMaxValue () const;
    void                    setHorizontalScale (uint scale);
    uint                    horizontalScale () const;
    void                    setShowVerticalLines (bool value);
    bool                    showVerticalLines () const;
    void                    setVerticalLinesColor (const QColor& color);
    QColor                  verticalLinesColor () const;
    void                    setVerticalLinesDistance (uint distance);
    uint                    verticalLinesDistance () const;
    void                    setVerticalLinesScroll (bool value);
    bool                    verticalLinesScroll () const;
    void                    setShowHorizontalLines (bool value);
    bool                    showHorizontalLines () const;
    void                    setHorizontalLinesColor (const QColor& color);
    QColor                  horizontalLinesColor () const;
    void                    setFontColor (const QColor& color);
    QColor                  fontColor () const;
    void                    setFont (const QFont& font);
    QFont                   font () const;
    void                    setHorizontalLinesCount (uint count);
    uint                    horizontalLinesCount () const;
    void                    setShowLabels (bool value);
    bool                    showLabels () const;
    void                    setShowTopBar (bool value);
    bool                    showTopBar () const;
    void                    setBackgroundColor (const QColor& color);
    QColor                  backgroundColor () const;
    void                    setSvgBackground (const QString& filename);
    QString                 svgBackground ();
    double                  lastValue (uint i) const;
    QString                 lastValueAsString (uint i) const;
    void                    setThinFrame (bool set);
    void                    setStackPlots (bool stack);
    bool                    stackPlots () const;
    QPixmap                 getSnapshotImage (uint width, uint height);
    virtual void            setGeometry (const QRectF& geometry);
protected:
    void                    updateDataBuffers ();
    void                    calculateNiceRange ();
    void                    paint (QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
    void                    drawWidget (QPainter* p, uint w, uint height, int horizontalScale);
    void                    drawBackground (QPainter* p, int w, int h);
    void                    drawThinFrame (QPainter* p, int w, int h);
    void                    drawTopBarFrame (QPainter* p, int separatorX, int height);
    void                    drawTopBarContents (QPainter* p, int x, int width, int height);
    void                    drawVerticalLines (QPainter* p, int top, int w, int h);
    void                    drawPlots (QPainter* p, int top, int w, int h, int horizontalScale);
    void                    drawAxisText (QPainter* p, int top, int h);
    void                    drawHorizontalLines (QPainter* p, int top, int w, int h);
public:
    ~SignalPlotter ();
    bool                    thinFrame () const;
};
// SignalPlotter
};
// Plasma
 
     |