mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
print_host
This commit is contained in:
@@ -339,6 +339,7 @@ void PrinterWebView::AddButton(const wxString & devi
|
|||||||
const wxString & machine_type,
|
const wxString & machine_type,
|
||||||
const wxString & fullname,
|
const wxString & fullname,
|
||||||
bool isSelected,
|
bool isSelected,
|
||||||
|
bool isQIDI,
|
||||||
DynamicPrintConfig * cfg_t)
|
DynamicPrintConfig * cfg_t)
|
||||||
{
|
{
|
||||||
wxString Machine_Name = Machine_Name.Format("%s%s", machine_type, "_thumbnail");
|
wxString Machine_Name = Machine_Name.Format("%s%s", machine_type, "_thumbnail");
|
||||||
@@ -358,24 +359,13 @@ void PrinterWebView::AddButton(const wxString & devi
|
|||||||
customButton->SetIPText(ip);
|
customButton->SetIPText(ip);
|
||||||
customButton->SetStateText("standby");
|
customButton->SetStateText("standby");
|
||||||
customButton->SetProgressText("(0%)");
|
customButton->SetProgressText("(0%)");
|
||||||
const auto opt = cfg_t->option<ConfigOptionEnum<PrintHostType>>("host_type");
|
|
||||||
const auto host_type = opt != nullptr ? opt->value : htOctoPrint;
|
|
||||||
wxString formattedHost = ip;
|
|
||||||
if (!formattedHost.Lower().starts_with("http"))
|
|
||||||
formattedHost = wxString::Format("http://%s", formattedHost);
|
|
||||||
if (host_type == htMoonraker) {
|
|
||||||
if (!formattedHost.Lower().ends_with("10088"))
|
|
||||||
formattedHost = wxString::Format("%s:10088", formattedHost);
|
|
||||||
}
|
|
||||||
|
|
||||||
customButton->Bind(wxEVT_BUTTON, [this, ip, customButton, cfg_t](wxCommandEvent &event) {
|
customButton->Bind(wxEVT_BUTTON, [this, ip, customButton, isQIDI](wxCommandEvent &event) {
|
||||||
//B55
|
//B55
|
||||||
const auto opt = cfg_t->option<ConfigOptionEnum<PrintHostType>>("host_type");
|
|
||||||
const auto host_type = opt != nullptr ? opt->value : htOctoPrint;
|
|
||||||
wxString formattedHost = ip;
|
wxString formattedHost = ip;
|
||||||
if (!formattedHost.Lower().starts_with("http"))
|
if (!formattedHost.Lower().starts_with("http"))
|
||||||
formattedHost = wxString::Format("http://%s", formattedHost);
|
formattedHost = wxString::Format("http://%s", formattedHost);
|
||||||
if (host_type == htMoonraker) {
|
if (isQIDI) {
|
||||||
if (!formattedHost.Lower().ends_with("10088"))
|
if (!formattedHost.Lower().ends_with("10088"))
|
||||||
formattedHost = wxString::Format("%s:10088", formattedHost);
|
formattedHost = wxString::Format("%s:10088", formattedHost);
|
||||||
}
|
}
|
||||||
@@ -581,8 +571,7 @@ void PrinterWebView::OnAddButtonClick(wxCommandEvent &event)
|
|||||||
UnSelectedButton();
|
UnSelectedButton();
|
||||||
if (isValidIPAddress)
|
if (isValidIPAddress)
|
||||||
AddButton(
|
AddButton(
|
||||||
printer_name, host, model_id, fullname,
|
printer_name, host,model_id, fullname, true, (host_type == htMoonraker), cfg_t);
|
||||||
true, cfg_t);
|
|
||||||
load_url(formattedHost);
|
load_url(formattedHost);
|
||||||
UpdateLayout();
|
UpdateLayout();
|
||||||
Refresh();
|
Refresh();
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ public:
|
|||||||
const wxString & machine_type,
|
const wxString & machine_type,
|
||||||
const wxString & fullname,
|
const wxString & fullname,
|
||||||
bool isSelected,
|
bool isSelected,
|
||||||
|
bool isQIDI,
|
||||||
DynamicPrintConfig * cfg_t);
|
DynamicPrintConfig * cfg_t);
|
||||||
void DeleteButton();
|
void DeleteButton();
|
||||||
void PauseButton();
|
void PauseButton();
|
||||||
|
|||||||
Reference in New Issue
Block a user