mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-03 20:13:59 -06:00
PrintHost: Don't offer print start for SL1
This commit is contained in:
parent
96d09ce0ad
commit
bd725a47f4
9 changed files with 36 additions and 15 deletions
|
@ -119,6 +119,11 @@ bool Duet::can_test() const
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Duet::can_start_print() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Duet::connect(wxString &msg) const
|
||||
{
|
||||
bool res = false;
|
||||
|
|
|
@ -25,6 +25,7 @@ public:
|
|||
virtual bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const;
|
||||
virtual bool has_auto_discovery() const;
|
||||
virtual bool can_test() const;
|
||||
virtual bool can_start_print() const;
|
||||
virtual std::string get_host() const { return host; }
|
||||
|
||||
private:
|
||||
|
|
|
@ -144,6 +144,11 @@ bool OctoPrint::can_test() const
|
|||
return true;
|
||||
}
|
||||
|
||||
bool OctoPrint::can_start_print() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OctoPrint::validate_version_text(const boost::optional<std::string> &version_text) const
|
||||
{
|
||||
return version_text ? boost::starts_with(*version_text, "OctoPrint") : true;
|
||||
|
@ -186,6 +191,11 @@ wxString SLAHost::get_test_failed_msg (wxString &msg) const
|
|||
return wxString::Format("%s: %s", _(L("Could not connect to Prusa SLA")), msg);
|
||||
}
|
||||
|
||||
bool SLAHost::can_start_print() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SLAHost::validate_version_text(const boost::optional<std::string> &version_text) const
|
||||
{
|
||||
return version_text ? boost::starts_with(*version_text, "Prusa SLA") : false;
|
||||
|
|
|
@ -26,6 +26,7 @@ public:
|
|||
virtual bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const;
|
||||
virtual bool has_auto_discovery() const;
|
||||
virtual bool can_test() const;
|
||||
virtual bool can_start_print() const;
|
||||
virtual std::string get_host() const { return host; }
|
||||
|
||||
protected:
|
||||
|
@ -49,6 +50,7 @@ public:
|
|||
|
||||
virtual wxString get_test_ok_msg () const;
|
||||
virtual wxString get_test_failed_msg (wxString &msg) const;
|
||||
virtual bool can_start_print() const ;
|
||||
protected:
|
||||
virtual bool validate_version_text(const boost::optional<std::string> &version_text) const;
|
||||
};
|
||||
|
|
|
@ -25,16 +25,16 @@ namespace Slic3r {
|
|||
|
||||
PrintHost::~PrintHost() {}
|
||||
|
||||
PrintHost* PrintHost::get_print_host(DynamicPrintConfig *config)
|
||||
PrintHost* PrintHost::get_print_host(DynamicPrintConfig *config, Slic3r::PrinterTechnology pt_fallback)
|
||||
{
|
||||
const auto opt = config->option<ConfigOptionEnum<PrintHostType>>("host_type");
|
||||
if (opt == nullptr) { return nullptr; }
|
||||
const auto host_type = opt != nullptr ? opt->value : (pt_fallback == ptFFF ? htOctoPrint : htSL1);
|
||||
|
||||
switch (opt->value) {
|
||||
switch (host_type) {
|
||||
case htOctoPrint: return new OctoPrint(config);
|
||||
case htDuet: return new Duet(config);
|
||||
case htSL1: return new SLAHost(config);
|
||||
default: return nullptr;
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <wx/string.h>
|
||||
|
||||
#include "libslic3r/PrintConfig.hpp"
|
||||
#include "Http.hpp"
|
||||
|
||||
|
||||
|
@ -38,9 +39,10 @@ public:
|
|||
virtual bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const = 0;
|
||||
virtual bool has_auto_discovery() const = 0;
|
||||
virtual bool can_test() const = 0;
|
||||
virtual bool can_start_print() const = 0;
|
||||
virtual std::string get_host() const = 0;
|
||||
|
||||
static PrintHost* get_print_host(DynamicPrintConfig *config);
|
||||
static PrintHost* get_print_host(DynamicPrintConfig *config, Slic3r::PrinterTechnology pt_fallback = ptFFF);
|
||||
|
||||
protected:
|
||||
virtual wxString format_error(const std::string &body, const std::string &error, unsigned status) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue