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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
/*
* This file is part of the DSLogic-gui project.
* DSLogic-gui is based on PulseView.
*
* Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
* Copyright (C) 2013 DreamSourceLab <dreamsourcelab@dreamsourcelab.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, 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 General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DSLOGIC_PV_MAINWINDOW_H
#define DSLOGIC_PV_MAINWINDOW_H
#include <list>
#include <QMainWindow>
#include "sigsession.h"
class QAction;
class QMenuBar;
class QMenu;
class QVBoxLayout;
class QStatusBar;
class QToolBar;
class QWidget;
class QDockWidget;
namespace pv {
class DeviceManager;
namespace toolbars {
class SamplingBar;
class DeviceBar;
class TrigBar;
class FileBar;
class LogoBar;
}
namespace dock{
class ProtocolDock;
class TriggerDock;
class DsoTriggerDock;
class MeasureDock;
class SearchDock;
}
namespace view {
class View;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
private:
static const int DefaultDSODepth = 8192;
static const int DefaultDSORate = 100000000;
public:
explicit MainWindow(DeviceManager &device_manager,
const char *open_file_name = NULL,
QWidget *parent = 0);
private:
void setup_ui();
void session_error(const QString text, const QString info_text);
/**
* Updates the device list in the sampling bar, and updates the
* selection.
* @param selected_device The device to select, or NULL if the
* first device in the device list should be selected.
*/
void update_device_list(
struct sr_dev_inst *selected_device = NULL);
void device_change();
private slots:
void load_file(QString file_name);
void show_session_error(
const QString text, const QString info_text);
void device_selected();
void run_stop();
void test_data_error();
void capture_state_changed(int state);
void init();
void update();
void on_protocol(bool visible);
void on_trigger(bool visible);
void on_measure(bool visible);
void on_search(bool visible);
void on_screenShot();
/*
* hotplug slot function
*/
void device_attach();
void device_detach();
/* */
void dso_ch_changed(uint16_t num);
private:
DeviceManager &_device_manager;
SigSession _session;
pv::view::View *_view;
QMenuBar *_menu_bar;
QMenu *_menu_file;
QAction *_action_open;
QAction *_action_connect;
QAction *_action_quit;
QMenu *_menu_view;
QAction *_action_view_zoom_in;
QAction *_action_view_zoom_out;
QAction *_action_view_show_cursors;
QMenu *_menu_help;
QAction *_action_about;
QWidget *_central_widget;
QVBoxLayout *_vertical_layout;
toolbars::SamplingBar *_sampling_bar;
toolbars::DeviceBar *_device_bar;
toolbars::TrigBar *_trig_bar;
toolbars::FileBar *_file_bar;
toolbars::LogoBar *_logo_bar;
QDockWidget *_protocol_dock;
dock::ProtocolDock *_protocol_widget;
QDockWidget *_trigger_dock;
QDockWidget *_dso_trigger_dock;
dock::TriggerDock *_trigger_widget;
dock::DsoTriggerDock *_dso_trigger_widget;
QDockWidget *_measure_dock;
QDockWidget *_search_dock;
dock::SearchDock * _search_widget;
};
} // namespace pv
#endif // DSLOGIC_PV_MAINWINDOW_H
|