21 #include <wx/button.h> 22 #include <wx/cshelp.h> 23 #include <wx/msgdlg.h> 26 wxHtmlHelpController *help_ctrl,
27 wxWindow *parent, wxWindowID
id,
28 const wxPoint &pos,
long style,
29 const wxString &name) :
36 auto *button_box =
new wxBoxSizer(wxHORIZONTAL);
37 auto *reconnect_button =
new wxButton(panel,
ID_Reconnect,
"Reconnect");
38 button_box->Add(reconnect_button, 1);
40 button_box->AddSpacer(20);
43 reconnect_button->GetSize(&w, &h);
45 wxDefaultPosition, wxSize(h,h));
46 button_box->Add(help_button, 0);
48 vbox->Add(button_box, 0, wxLEFT | wxRIGHT | wxBOTTOM, 15);
65 std::array<uint8_t, 6> mac =
getMac();
70 std::ostringstream oss;
71 oss <<
"Are you sure to reconnect device with MAC-address " 73 const int answer = wxMessageBox(oss.str(),
"", wxYES_NO);
78 m |=
static_cast<std::uint64_t
>(mac[0]) << 40;
79 m |=
static_cast<std::uint64_t
>(mac[1]) << 32;
80 m |=
static_cast<std::uint64_t
>(mac[2]) << 24;
81 m |=
static_cast<std::uint64_t
>(mac[3]) << 16;
82 m |=
static_cast<std::uint64_t
>(mac[4]) << 8;
83 m |=
static_cast<std::uint64_t
>(mac[5]) << 0;
89 catch(
const std::runtime_error &ex)
91 wxMessageBox(ex.what(),
"Error", wxOK | wxICON_ERROR);
void sendCommand(std::uint64_t mac, std::uint32_t ip, std::uint32_t subnet, std::uint32_t gateway)
Send FORCEIP_CMD.
std::string getMacString() const
wxBoxSizer * getVerticalBox()
Class for sending GigE Vision FORCEIP_CMD to camera.
void onReconnectButton(wxCommandEvent &event)
ReconnectDialog()=default
Dialog for sending FORCEIP_CMD with IP set to 0 to camera.
Base class for dialogs for sending commands to a camera.
void displayHelp(const std::string §ion)
void onHelpButton(wxCommandEvent &event)
std::array< uint8_t, 6 > getMac() const