OrcaSlicer/src/slic3r/GUI/Jobs/UpgradeNetworkJob.hpp
lane.wei e9e4d75877 Update the codes to 01.01.00.10 for the formal release
1. first formal version of macos
2. add the bambu networking plugin install logic
3. auto compute the wipe volume when filament change
4. add the logic of wiping into support
5. refine the GUI layout and icons, improve the gui apperance in lots of
   small places
6. serveral improve to support
7. support AMS auto-mapping
8. disable lots of unstable features: such as params table, media file download, HMS
9. fix serveral kinds of bugs
10. update the document of building
11. ...
2022-07-22 20:35:34 +08:00

56 lines
1.4 KiB
C++

#ifndef __UpgradeNetworkJob_HPP__
#define __UpgradeNetworkJob_HPP__
#include <functional>
#include "Job.hpp"
namespace fs = boost::filesystem;
namespace Slic3r {
namespace GUI {
enum PluginInstallStatus {
InstallStatusNormal = 0,
InstallStatusDownloadFailed = 1,
InstallStatusDownloadCompleted = 2,
InstallStatusUnzipFailed = 3,
InstallStatusInstallCompleted = 4,
};
typedef std::function<void(int status, int percent, bool& cancel)> InstallProgressFn;
class UpgradeNetworkJob : public Job
{
wxWindow * m_event_handle{nullptr};
std::function<void()> m_success_fun{nullptr};
bool m_job_finished{ false };
int m_print_job_completed_id = 0;
InstallProgressFn pro_fn { nullptr };
protected:
void on_exception(const std::exception_ptr &) override;
public:
UpgradeNetworkJob(std::shared_ptr<ProgressIndicator> pri);
int status_range() const override
{
return 100;
}
bool is_finished() { return m_job_finished; }
void on_success(std::function<void()> success);
void update_status(int st, const wxString &msg);
void process() override;
void finalize() override;
void set_event_handle(wxWindow* hanle);
};
wxDECLARE_EVENT(EVT_UPGRADE_UPDATE_MESSAGE, wxCommandEvent);
wxDECLARE_EVENT(EVT_UPGRADE_NETWORK_SUCCESS, wxCommandEvent);
wxDECLARE_EVENT(EVT_UPGRADE_NETWORK_FAILED, wxCommandEvent);
}} // namespace Slic3r::GUI
#endif // ARRANGEJOB_HPP