discover-frame.h
Go to the documentation of this file.
1 /*
2  * rcdiscover - the network discovery tool for Roboception devices
3  *
4  * Copyright (c) 2017 Roboception GmbH
5  * All rights reserved
6  *
7  * Author: Raphael Schaller
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  *
19  * 3. Neither the name of the copyright holder nor the names of its contributors
20  * may be used to endorse or promote products derived from this software without
21  * specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #ifndef DISCOVERFRAME_H
37 #define DISCOVERFRAME_H
38 
39 #include <memory>
40 #include <vector>
41 
42 #include <wx/frame.h>
43 #include <wx/animate.h>
44 
45 class wxDataViewListCtrl;
46 class wxButton;
47 class wxDataViewEvent;
48 class wxPanel;
49 class wxHtmlHelpController;
50 
51 class ResetDialog;
52 class ForceIpDialog;
53 class ReconnectDialog;
54 class AboutDialog;
55 
59 class DiscoverFrame : public wxFrame
60 {
61  public:
67  DiscoverFrame(const wxString& title,
68  const wxPoint& pos);
69 
70  virtual ~DiscoverFrame() = default;
71 
72  enum COLUMNS
73  {
74  NAME = 0,
76  MODEL = 2,
77  SERIAL = 3,
78  IP = 4,
79  MAC = 5,
80  IFACE = 6,
81  REACHABLE = 7,
82 
84  };
85 
86  private:
90  void setBusy();
94  void clearBusy();
95 
99  void onDiscoverButton(wxCommandEvent &);
100 
105  void onDiscoveryCompleted(wxThreadEvent &event);
106 
110  void onHelpDiscovery(wxCommandEvent &);
111 
116  void onDiscoveryError(wxThreadEvent &event);
117 
121  void onResetButton(wxCommandEvent &);
122 
126  void onForceIpButton(wxCommandEvent &);
127 
131  void onReconnectButton(wxCommandEvent &);
132 
137  void onDeviceDoubleClick(wxDataViewEvent &event);
138 
143  void onDeviceSelection(wxDataViewEvent &event);
144 
149  void onDataViewContextMenu(wxDataViewEvent &event);
150 
154  void onCopy(wxMenuEvent &);
155 
159  void onOpenWebGUI(wxMenuEvent &);
160 
164  void onResetContextMenu(wxMenuEvent &);
165 
169  void onForceIpContextMenu(wxMenuEvent &);
170 
174  void onReconnectContextMenu(wxMenuEvent &);
175 
179  void onExit(wxCommandEvent &);
180 
184  void onHelp(wxCommandEvent &);
185 
189  void onAbout(wxCommandEvent &);
190 
195  void openResetDialog(int row);
196 
201  void openForceIpDialog(int row);
202 
207  void openReconnectDialog(int row);
208 
213  void onOnlyRcCheckbox(wxCommandEvent &evt);
214 
219  void onFilterTextChange(wxCommandEvent &evt);
220 
225  void updateDeviceList(const std::vector<wxVector<wxVariant>> &d);
226 
230  void openWebGUI(int row);
231 
233 
234  private:
235  wxDataViewListCtrl *device_list_;
236  wxButton *discover_button_;
237  wxTextCtrl *filter_input_;
238  wxButton *reset_button_;
239  wxButton *force_ip_button_;
240  wxButton *reconnect_button_;
245  wxAnimation spinner_;
246  wxAnimationCtrl *spinner_ctrl_;
247  wxHtmlHelpController *help_ctrl_;
248  std::unique_ptr<std::pair<int, int>> menu_event_item_;
250  std::string filter_text_;
251  std::vector<wxVector<wxVariant>> last_data_;
252 };
253 
254 #endif // DISCOVERFRAME_H
void openResetDialog(int row)
Open device reset dialog.
void onFilterTextChange(wxCommandEvent &evt)
Event handler for change of the filter text box.
void openReconnectDialog(int row)
Open Reconnect dialog.
Dialog for Magic Packets reset of rc_visard.
Definition: reset-dialog.h:48
void onHelp(wxCommandEvent &)
Event handler for "help" item in window menu.
void onForceIpButton(wxCommandEvent &)
Event handler for ForceIP button click.
DiscoverFrame(const wxString &title, const wxPoint &pos)
Constructor.
void onReconnectButton(wxCommandEvent &)
Event handler for Reconnect button click.
std::vector< wxVector< wxVariant > > last_data_
virtual ~DiscoverFrame()=default
std::unique_ptr< std::pair< int, int > > menu_event_item_
std::string filter_text_
ReconnectDialog * reconnect_dialog_
void onDeviceDoubleClick(wxDataViewEvent &event)
Event handler for double click on a device.
void onDiscoveryError(wxThreadEvent &event)
Event handler for erroneous device discovery.
void onOpenWebGUI(wxMenuEvent &)
Event handler for "open web gui" context menu item.
void onResetContextMenu(wxMenuEvent &)
Event handler for "reset" context menu item.
ResetDialog * reset_dialog_
Dialog for sending FORCEIP_CMD to camera.
void onOnlyRcCheckbox(wxCommandEvent &evt)
Event handler for change of the "only RC cameras" checkbox.
void onResetButton(wxCommandEvent &)
Event handler for Reset button click.
Main window in which the table of discovered devices is displayed.
void updateDeviceList(const std::vector< wxVector< wxVariant >> &d)
Updates the device table.
void openForceIpDialog(int row)
Open Force IP dialog.
About dialog.
Definition: about-dialog.h:44
wxButton * force_ip_button_
ForceIpDialog * force_ip_dialog_
AboutDialog * about_dialog_
void onCopy(wxMenuEvent &)
Event handler for "copy" context menu item.
wxAnimationCtrl * spinner_ctrl_
wxButton * discover_button_
wxAnimation spinner_
Dialog for sending FORCEIP_CMD with IP set to 0 to camera.
void onDataViewContextMenu(wxDataViewEvent &event)
Event handler for right mouse button click on device.
void openWebGUI(int row)
Open WebGUI for device in specific row.
void onDiscoveryCompleted(wxThreadEvent &event)
Event handler for completed device discovery.
wxButton * reset_button_
void clearBusy()
Stop spinner rotation.
wxTextCtrl * filter_input_
void onDiscoverButton(wxCommandEvent &)
Event handler for Discovery button click.
void onExit(wxCommandEvent &)
Event handler for exit command.
wxHtmlHelpController * help_ctrl_
wxButton * reconnect_button_
void onForceIpContextMenu(wxMenuEvent &)
Event handler for "force ip" context menu item.
void onDeviceSelection(wxDataViewEvent &event)
Event handler for selection of a device.
void onReconnectContextMenu(wxMenuEvent &)
Event handler for "reconnect" context menu item.
wxDataViewListCtrl * device_list_
void onHelpDiscovery(wxCommandEvent &)
Event handler for help button.
void onAbout(wxCommandEvent &)
Event handler for "about" item in window menu.
void setBusy()
Let spinner rotate.


rcdiscover
Author(s): Heiko Hirschmueller , Raphael Schaller
autogenerated on Sun Apr 18 2021 02:16:32