mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 21:27:52 -06:00
NEW: add NetworkTestDialog
test www.bing.com test bambulab host test http service test storage upload and upgrade test storage downloading Change-Id: Ia2aca1d3fdff5dd4e930df138e8c6a1b5aad2585 Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
9c00469d7f
commit
63809c63da
6 changed files with 830 additions and 1 deletions
115
src/slic3r/GUI/NetworkTestDialog.hpp
Normal file
115
src/slic3r/GUI/NetworkTestDialog.hpp
Normal file
|
@ -0,0 +1,115 @@
|
|||
#ifndef slic3r_GUI_NetworkTestDialog_hpp_
|
||||
#define slic3r_GUI_NetworkTestDialog_hpp_
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
#include "GUI_Utils.hpp"
|
||||
#include "wxExtensions.hpp"
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/grid.h>
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/srchctrl.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <iomanip>
|
||||
#include <sys/timeb.h>
|
||||
#include <time.h>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
enum TestJob {
|
||||
TEST_BING_JOB = 0,
|
||||
TEST_BAMBULAB_JOB = 1,
|
||||
TEST_IOT_JOB = 2,
|
||||
TEST_OSS_JOB = 3,
|
||||
TEST_OSS_UPGRADE_JOB = 4,
|
||||
TEST_OSS_DOWNLOAD_JOB = 5,
|
||||
TEST_OSS_UPLOAD_JOB = 6,
|
||||
TEST_JOB_MAX = 7
|
||||
};
|
||||
|
||||
class NetworkTestDialog : public DPIDialog
|
||||
{
|
||||
protected:
|
||||
wxButton* btn_start;
|
||||
wxButton* btn_download_log;
|
||||
wxStaticText* text_basic_info;
|
||||
wxStaticText* text_version_title;
|
||||
wxStaticText* text_version_val;
|
||||
wxStaticText* txt_sys_info_title;
|
||||
wxStaticText* txt_sys_info_value;
|
||||
wxStaticText* txt_dns_info_title;
|
||||
wxStaticText* txt_dns_info_value;
|
||||
wxStaticText* text_link_title;
|
||||
wxStaticText* text_link_val;
|
||||
wxStaticText* text_bing_title;
|
||||
wxStaticText* text_bing_val;
|
||||
wxStaticText* text_iot_title;
|
||||
wxStaticText* text_iot_value;
|
||||
wxStaticText* text_oss_title;
|
||||
wxStaticText* text_oss_value;
|
||||
wxStaticText* text_oss_upgrade_title;
|
||||
wxStaticText* text_oss_upgrade_value;
|
||||
wxStaticText* text_oss_download_title;
|
||||
wxStaticText* text_oss_download_value;
|
||||
wxStaticText* text_oss_upload_title;
|
||||
wxStaticText* text_oss_upload_value;
|
||||
wxStaticText* text_result;
|
||||
wxTextCtrl* txt_log;
|
||||
|
||||
wxBoxSizer* create_top_sizer(wxWindow* parent);
|
||||
wxBoxSizer* create_info_sizer(wxWindow* parent);
|
||||
wxBoxSizer* create_content_sizer(wxWindow* parent);
|
||||
wxBoxSizer* create_result_sizer(wxWindow* parent);
|
||||
|
||||
boost::thread* test_job[TEST_JOB_MAX];
|
||||
bool m_in_testing[TEST_JOB_MAX];
|
||||
bool m_download_cancel = false;
|
||||
|
||||
void init_bind();
|
||||
|
||||
public:
|
||||
NetworkTestDialog(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(605, 375), long style = wxDEFAULT_DIALOG_STYLE);
|
||||
|
||||
~NetworkTestDialog();
|
||||
|
||||
void on_dpi_changed(const wxRect& suggested_rect);
|
||||
|
||||
void set_default();
|
||||
wxString get_studio_version();
|
||||
wxString get_os_info();
|
||||
wxString get_dns_info();
|
||||
|
||||
void start_all_job();
|
||||
void start_test_bing_thread();
|
||||
void start_test_bambulab_thread();
|
||||
void start_test_iot_thread();
|
||||
void start_test_oss_thread();
|
||||
void start_test_oss_upgrade_thread();
|
||||
void start_test_oss_download_thread();
|
||||
void start_test_oss_upload_thread();
|
||||
|
||||
void on_close(wxCloseEvent& event);
|
||||
|
||||
void update_status(int job_id, wxString info);
|
||||
};
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue