#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/Utils/SimplyPrint.hpp>
Public Types | |
| typedef Http::ProgressFn | ProgressFn |
| typedef std::function< void(wxString)> | ErrorFn |
| typedef std::function< void(wxString, wxString)> | InfoFn |
Public Member Functions | |
| SimplyPrint (DynamicPrintConfig *config) | |
| ~SimplyPrint () override=default | |
| const char * | get_name () const override |
| bool | can_test () const override |
| bool | has_auto_discovery () const override |
| bool | is_cloud () const override |
| std::string | get_host () const override |
| GUI::OAuthParams | get_oauth_params () const |
| void | save_oauth_credential (const GUI::OAuthResult &cred) const |
| wxString | get_test_ok_msg () const override |
| wxString | get_test_failed_msg (wxString &msg) const override |
| bool | test (wxString &curl_msg) const override |
| PrintHostPostUploadActions | get_post_upload_actions () const override |
| bool | upload (PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const override |
| bool | is_logged_in () const override |
| void | log_out () const override |
| virtual bool | supports_multiple_printers () const |
| virtual std::string | get_sn () const |
| virtual bool | get_groups (wxArrayString &) const |
| virtual bool | get_printers (wxArrayString &) const |
| virtual bool | get_storage (wxArrayString &, wxArrayString &) const |
| virtual bool | get_login_url (wxString &auth_url) const |
Static Public Member Functions | |
| static PrintHost * | get_print_host (DynamicPrintConfig *config) |
| static std::string | get_print_host_webui (DynamicPrintConfig *config) |
| static int | get_err_code_from_body (const std::string &body) |
Protected Member Functions | |
| virtual wxString | format_error (const std::string &body, const std::string &error, unsigned status) const |
Static Protected Member Functions | |
| static wxString | timed_out_message () |
Private Member Functions | |
| void | load_oauth_credential () |
| bool | do_api_call (std::function< Http(bool)> build_request, std::function< bool(std::string, unsigned)> on_complete, std::function< bool(std::string, std::string, unsigned)> on_error) const |
| Call the given SimplyPrint API, and if the token expired do a token refresh then retry. | |
| bool | do_temp_upload (const boost::filesystem::path &file_path, const std::string &chunk_id, const std::string &filename, ProgressFn prorgess_fn, ErrorFn error_fn) const |
| Upload a temp file and open SimplyPrint panel for file importing. | |
| bool | do_chunk_upload (const boost::filesystem::path &file_path, const std::string &filename, ProgressFn prorgess_fn, ErrorFn error_fn) const |
Private Attributes | |
| std::string | cred_file |
| std::map< std::string, std::string > | cred |
|
inherited |
|
inherited |
|
inherited |
| Slic3r::SimplyPrint::SimplyPrint | ( | DynamicPrintConfig * | config | ) |
References SimplyPrint(), cred_file, Slic3r::data_dir(), load_oauth_credential(), and Slic3r::OAUTH_CREDENTIAL_PATH.
Referenced by SimplyPrint().
|
overridedefault |
|
inlineoverridevirtual |
Implements Slic3r::PrintHost.
|
private |
Call the given SimplyPrint API, and if the token expired do a token refresh then retry.
| build_request | the http request builder |
| on_complete | |
| on_error |
References Slic3r::GUI::OAuthResult::access_token, Slic3r::CLIENT_ID, cred, do_api_call(), Slic3r::GUI::OAuthResult::error_message, Slic3r::http, Slic3r::GUI::OAuthJob::parse_token_response(), Slic3r::Http::post(), save_oauth_credential(), Slic3r::set_auth(), Slic3r::GUI::OAuthResult::success, and Slic3r::TOKEN_URL.
Referenced by do_api_call(), do_chunk_upload(), do_temp_upload(), and test().
|
private |
References _L, Slic3r::CHUNCK_RECEIVE_URL, do_api_call(), do_chunk_upload(), do_temp_upload(), Slic3r::PrintHost::format_error(), Slic3r::Http::get(), Slic3r::http, Slic3r::length(), Slic3r::MAX_SINGLE_UPLOAD_FILE_SIZE, Slic3r::offset(), Slic3r::Http::post(), Slic3r::Http::Progress::ulnow, Slic3r::Http::Progress::ultotal, and Slic3r::url_encode().
Referenced by do_chunk_upload(), and upload().
|
private |
Upload a temp file and open SimplyPrint panel for file importing.
| file_path | for file smaller than 100MB, this is the file path, otherwise must left empty |
| chunk_id | for file greater than 100MB, this is the chunk id returned by the ChunkReceive API, otherwise must left empty |
| filename | the target file name |
| prorgess_fn | |
| error_fn |
References _L, do_api_call(), do_temp_upload(), Slic3r::PrintHost::format_error(), Slic3r::http, Slic3r::Http::post(), Slic3r::should_open_in_external_browser(), TAB_ID_MONITOR, URL_BASE_HOME, and Slic3r::url_encode().
Referenced by do_chunk_upload(), do_temp_upload(), and upload().
|
protectedvirtualinherited |
References _L, and timed_out_message().
Referenced by Slic3r::Duet::connect(), Slic3r::UltiMaker::connect(), Slic3r::SimplyPrint::do_chunk_upload(), Slic3r::SimplyPrint::do_temp_upload(), Slic3r::ElegooLink::elegoo_cc2_test(), Slic3r::ElegooLink::elegoo_test(), Slic3r::PrusaLink::post_inner(), Slic3r::PrusaLink::put_inner(), Slic3r::Flashforge::request_local_api_json(), Slic3r::Duet::start_print(), Slic3r::Moonraker::start_print(), Slic3r::UltiMaker::start_print(), Slic3r::AstroBox::test(), Slic3r::CrealityPrint::test(), Slic3r::ESP3D::test(), Slic3r::FlashAir::test(), Slic3r::Moonraker::test(), Slic3r::Obico::test(), Slic3r::OctoPrint::test(), Slic3r::PrusaLink::test(), Slic3r::Repetier::test(), Slic3r::UltiMaker::test(), Slic3r::PrusaLink::test_with_method_check(), Slic3r::AstroBox::upload(), Slic3r::C3DPrinterOS::upload(), Slic3r::CrealityPrint::upload(), Slic3r::Duet::upload(), Slic3r::ESP3D::upload(), Slic3r::FlashAir::upload(), Slic3r::MKS::upload(), Slic3r::Moonraker::upload(), Slic3r::Obico::upload(), Slic3r::Repetier::upload(), Slic3r::UltiMaker::upload(), Slic3r::OctoPrint::upload_inner_with_host(), Slic3r::Flashforge::upload_local_api(), Slic3r::ElegooLink::uploadPart(), and Slic3r::ElegooLink::uploadPartCC2().
|
staticinherited |
Referenced by Slic3r::Duet::connect(), Slic3r::UltiMaker::connect(), Slic3r::Duet::upload(), Slic3r::MKS::upload(), and Slic3r::UltiMaker::upload().
|
inlinevirtualinherited |
Reimplemented in Slic3r::Repetier.
|
inlineoverridevirtual |
Implements Slic3r::PrintHost.
|
inlinevirtualinherited |
Reimplemented in Slic3r::Obico.
Referenced by Slic3r::GUI::PrinterCloudAuthDialog::PrinterCloudAuthDialog().
|
inlineoverridevirtual |
Implements Slic3r::PrintHost.
| GUI::OAuthParams Slic3r::SimplyPrint::get_oauth_params | ( | ) | const |
References Slic3r::CALLBACK_PORT, Slic3r::CALLBACK_URL, Slic3r::CLIENT_ID, Slic3r::CLIENT_SCOPES, Slic3r::generate_verification_code(), get_oauth_params(), Slic3r::RESPONSE_TYPE, Slic3r::sha256b64(), Slic3r::TOKEN_URL, URL_BASE_HOME, and Slic3r::url_encode().
Referenced by get_oauth_params().
|
inlineoverridevirtual |
|
staticinherited |
References Slic3r::ht3DPrinterOS, Slic3r::htAstroBox, Slic3r::htCrealityPrint, Slic3r::htDuet, Slic3r::htElegooLink, Slic3r::htESP3D, Slic3r::htFlashAir, Slic3r::htFlashforge, Slic3r::htMKS, Slic3r::htMoonraker, Slic3r::htObico, Slic3r::htOctoPrint, Slic3r::htPrusaConnect, Slic3r::htPrusaLink, Slic3r::htRepetier, Slic3r::htSimplyPrint, Slic3r::htUltiMaker, Slic3r::ConfigBase::option(), and Slic3r::ptFFF.
Referenced by Slic3r::GUI::PhysicalPrinterDialog::build_printhost_settings(), Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::handle_get_sn_request(), Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::handle_upload_request(), Slic3r::GUI::PhysicalPrinterDialog::update_printers(), and Slic3r::GUI::PhysicalPrinterDialog::update_printhost_buttons().
|
staticinherited |
References Slic3r::ElegooLink::get_print_host_webui(), Slic3r::htElegooLink, Slic3r::htOctoPrint, Slic3r::DynamicConfig::opt_string(), Slic3r::ConfigBase::option(), and Slic3r::ConfigOptionSingle< T >::value.
Referenced by Slic3r::GUI::MainFrame::load_printer_url(), Slic3r::GUI::Plater::priv::on_tab_selection_changing(), and Slic3r::GUI::Sidebar::update_all_preset_comboboxes().
|
inlinevirtualinherited |
Reimplemented in Slic3r::Obico, and Slic3r::Repetier.
|
inlinevirtualinherited |
Get the serial number for connecting to the printer. For Elegoo CC2, the device details connection to the printer requires the serial number. Other print hosts do not need to implement this interface, and it returns an empty string by default.
Reimplemented in Slic3r::ElegooLink.
|
inlinevirtualinherited |
Reimplemented in Slic3r::Moonraker, Slic3r::PrusaConnect, and Slic3r::PrusaLink.
|
overridevirtual |
Implements Slic3r::PrintHost.
References _L, Slic3r::GUI::format_wxstr(), and get_test_failed_msg().
Referenced by get_test_failed_msg().
|
overridevirtual |
Implements Slic3r::PrintHost.
References _, get_test_ok_msg(), and L.
Referenced by get_test_ok_msg().
|
inlineoverridevirtual |
Implements Slic3r::PrintHost.
|
inlineoverridevirtual |
Reimplemented from Slic3r::PrintHost.
|
inlineoverridevirtual |
|
private |
References cred, cred_file, and load_oauth_credential().
Referenced by SimplyPrint(), and load_oauth_credential().
|
overridevirtual |
Reimplemented from Slic3r::PrintHost.
References cred_file, and log_out().
Referenced by log_out().
| void Slic3r::SimplyPrint::save_oauth_credential | ( | const GUI::OAuthResult & | cred | ) | const |
References cred, cred_file, and save_oauth_credential().
Referenced by do_api_call(), and save_oauth_credential().
|
inlinevirtualinherited |
Reimplemented in Slic3r::Repetier.
|
overridevirtual |
Implements Slic3r::PrintHost.
References cred, do_api_call(), Slic3r::Http::get(), Slic3r::http, test(), and URL_BASE_API.
Referenced by test().
|
staticprotectedinherited |
References _L.
Referenced by format_error(), and Slic3r::CrealityPrint::start_print().
|
overridevirtual |
Implements Slic3r::PrintHost.
References _L, cred, do_chunk_upload(), do_temp_upload(), Slic3r::MAX_SINGLE_UPLOAD_FILE_SIZE, Slic3r::PrintHostUpload::source_path, upload(), and Slic3r::PrintHostUpload::upload_path.
Referenced by upload().
|
private |
Referenced by do_api_call(), is_logged_in(), load_oauth_credential(), save_oauth_credential(), test(), and upload().
|
private |
Referenced by SimplyPrint(), load_oauth_credential(), log_out(), and save_oauth_credential().