The Inspector (GNU Radio module gr-inspector)
vis3d_vf_form.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2016 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * This is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this software; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef GR_INSPECTOR_INSPECTOR_FAMFORM_H
24 #define GR_INSPECTOR_INSPECTOR_FAMFORM_H
25 
26 
27 #include <QTimer>
28 #include <QWidget>
29 #include <QtGui/QtGui>
30 #include <gnuradio/msg_queue.h>
31 #include <qwt3d_surfaceplot.h>
32 #include <qwt3d_function.h>
33 #include <gnuradio/io_signature.h>
34 #include "signal_marker.h"
35 
36 namespace Qwt3D
37 {
38  class Plot : public SurfacePlot
39  {
40  public:
41  void adjustScales();
42  void calculateHull();
43  Plot();
44  int minx;
45  int miny;
46  int maxx;
47  int maxy;
48  int maxz;
49  };
50 
51 }
52 
53 namespace gr
54 {
55 
56  namespace inspector
57  {
58 
59 
60  const QEvent::Type UPDATE_EVENT = static_cast<QEvent::Type>(QEvent::User + 1);
61 
62  const QEvent::Type ROT_EVENT = static_cast<QEvent::Type>(QEvent::User + 2);
63 
64 
65  class UpdateEvent : public QEvent
66  {
67  public:
68  UpdateEvent( double **data, const double zaxis):
69  QEvent(UPDATE_EVENT),
70  m_data(data),
71  m_zaxis(zaxis)
72  {
73  }
74 
75  double ** getData() const
76  {
77  return m_data;
78  }
79 
80 
81  double getZaxis() const
82  {
83  return m_zaxis;
84  }
85 
86  private:
87  double ** m_data;
88  double m_zaxis;
89  };
90 
91  class RotEvent : public QEvent
92  {
93  public:
94  RotEvent(bool rotation):
95  QEvent(ROT_EVENT),
96  m_rotation(rotation)
97  {
98  }
99 
100  bool getRotation() const
101  {
102  return m_rotation;
103  }
104 
105  private:
106  bool m_rotation;
107  };
108 
109  class vis3d_vf_form : public QMainWindow
110  {
111  Q_OBJECT
112 
113  public:
115  vis3d_vf_form(QWidget *parent,int,int,int,int,char*,char*,char*);
116  ~vis3d_vf_form();
117 
118  private:
119  // Width of data
120  int width;
121  // Height of data
122  int height;
123  // Graph width
124  int gwidth;
125  // Graph height
126  int gheight;
127  // X axis
128  char *xaxis;
129  // Y axis
130  char *yaxis;
131  // Z axis
132  char *zaxis;
133  public slots:
134  // 3D button press
135  void btn3d();
136  // 2D button press
137  void btn2d();
138  // Update the plot
139  void update(double * *d,double maxz);
140  protected:
141  // Handle custom QT events
142  void customEvent(QEvent *event);
143  private:
144 
145  // Handle updating of plot
146  void handleUpdateEvent(const UpdateEvent *event);
147 
148  // Handle rotation of plot
149  void handleRotEvent(const RotEvent *event);
150 
151  };
152 
153  }
154 }
155 
156 #endif
RotEvent(bool rotation)
Definition: vis3d_vf_form.h:94
int miny
Definition: vis3d_vf_form.h:45
int maxz
Definition: vis3d_vf_form.h:48
void customEvent(QEvent *event)
Definition: ofdm_bouzegzi_c.h:30
double getZaxis() const
Definition: vis3d_vf_form.h:81
double ** getData() const
Definition: vis3d_vf_form.h:75
Definition: vis3d_vf_form.h:91
int maxx
Definition: vis3d_vf_form.h:46
Qwt3D::Plot * plot
Definition: vis3d_vf_form.h:114
bool getRotation() const
Definition: vis3d_vf_form.h:100
int minx
Definition: vis3d_vf_form.h:44
Definition: vis3d_vf_form.h:109
void adjustScales()
Definition: vis3d_vf_form.h:36
UpdateEvent(double **data, const double zaxis)
Definition: vis3d_vf_form.h:68
const QEvent::Type UPDATE_EVENT
Definition: vis3d_vf_form.h:60
void update(double **d, double maxz)
vis3d_vf_form(QWidget *parent, int, int, int, int, char *, char *, char *)
Definition: vis3d_vf_form.h:65
void calculateHull()
Definition: vis3d_vf_form.h:38
const QEvent::Type ROT_EVENT
Definition: vis3d_vf_form.h:62
int maxy
Definition: vis3d_vf_form.h:47