Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
bugfixes and version bump (#21)
Browse files Browse the repository at this point in the history
- ams_slot added as print param, default to 0.  0-based AMS slot array.  use_ams also must be set to true.
- bugfix 3MF file printing
- bugfix, when BB selected printer is changed,  AMS sync will occur each time in orca PE, including when starting a print
- added to BBL_RELEASE_TO_PUBLIC for noauth
  • Loading branch information
PilotMatt authored Mar 15, 2024
1 parent 92924bb commit c3fb588
Show file tree
Hide file tree
Showing 13 changed files with 176 additions and 139 deletions.
10 changes: 5 additions & 5 deletions src/OrcaSlicer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5611,12 +5611,12 @@ extern "C" {
argv_ptrs[i] = argv_narrow[i].data();

//BBS: register default exception handler
#if BBL_RELEASE_TO_PUBLIC
// #if BBL_RELEASE_TO_PUBLIC
SET_DEFULTER_HANDLER();
#else
//AddVectoredExceptionHandler(1, CBaseException::UnhandledExceptionFilter);
SET_DEFULTER_HANDLER();
#endif
// #else
// AddVectoredExceptionHandler(1, CBaseException::UnhandledExceptionFilter);
// SET_DEFULTER_HANDLER();
// #endif
std::set_new_handler([]() {
int *a = nullptr;
*a = 0;
Expand Down
16 changes: 8 additions & 8 deletions src/slic3r/GUI/DeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5205,11 +5205,11 @@ bool DeviceManager::set_selected_machine(std::string dev_id, bool need_disconnec
if (m_agent) {
if (!need_disconnect) {m_agent->disconnect_printer();}
it->second->reset();
#if !BBL_RELEASE_TO_PUBLIC
it->second->connect(false, Slic3r::GUI::wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false);
#else
// #if !BBL_RELEASE_TO_PUBLIC
// it->second->connect(false, Slic3r::GUI::wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false);
// #else
it->second->connect(false, it->second->local_use_ssl_for_mqtt);
#endif
// #endif
it->second->set_lan_mode_connection_state(true);
}
}
Expand All @@ -5228,11 +5228,11 @@ bool DeviceManager::set_selected_machine(std::string dev_id, bool need_disconnec
BOOST_LOG_TRIVIAL(info) << "static: set_selected_machine: same dev_id = empty";
m_agent->set_user_selected_machine("");
it->second->reset();
#if !BBL_RELEASE_TO_PUBLIC
it->second->connect(false, Slic3r::GUI::wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false);
#else
// #if !BBL_RELEASE_TO_PUBLIC
// it->second->connect(false, Slic3r::GUI::wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false);
// #else
it->second->connect(false, it->second->local_use_ssl_for_mqtt);
#endif
// #endif
it->second->set_lan_mode_connection_state(true);
}
}
Expand Down
19 changes: 11 additions & 8 deletions src/slic3r/GUI/Monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ void MonitorPanel::on_update_all(wxMouseEvent &event)

Layout();
Refresh();

wxGetApp().plater()->sidebar().sync_ams_list();

}

void MonitorPanel::on_printer_clicked(wxMouseEvent &event)
Expand Down Expand Up @@ -384,11 +387,11 @@ void MonitorPanel::update_all()
m_hms_panel->update(obj);
}

#if !BBL_RELEASE_TO_PUBLIC
if (m_upgrade_panel->IsShown()) {
m_upgrade_panel->update(obj);
}
#endif
// #if !BBL_RELEASE_TO_PUBLIC
// if (m_upgrade_panel->IsShown()) {
// m_upgrade_panel->update(obj);
// }
// #endif
}

bool MonitorPanel::Show(bool show)
Expand Down Expand Up @@ -460,9 +463,9 @@ void MonitorPanel::show_status(int status)
BOOST_LOG_TRIVIAL(info) << "monitor: show_status = " << status;


#if !BBL_RELEASE_TO_PUBLIC
m_upgrade_panel->update(nullptr);
#endif
// #if !BBL_RELEASE_TO_PUBLIC
// m_upgrade_panel->update(nullptr);
// #endif

Freeze();
// update panels
Expand Down
18 changes: 11 additions & 7 deletions src/slic3r/GUI/Plater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,11 @@ void Sidebar::sync_ams_list()
add_button(wxID_CANCEL, false, _L("Cancel"));
}
} dlg(this, ams_filament_ids.empty());
auto res = dlg.ShowModal();

//printago
// auto res = dlg.ShowModal();
auto res = wxID_YES;

if (res == wxID_CANCEL) return;
list2.resize(list.size());
auto iter = list.begin();
Expand Down Expand Up @@ -11682,12 +11686,12 @@ int Plater::send_gcode(int plate_idx, Export3mfProgressFn proFn)
}

SaveStrategy strategy = SaveStrategy::Silence | SaveStrategy::SkipModel | SaveStrategy::WithGcode;
#if !BBL_RELEASE_TO_PUBLIC
//only save model in QA environment
std::string sel = get_app_config()->get("iot_environment");
if (sel == ENV_PRE_HOST)
strategy = SaveStrategy::Silence | SaveStrategy::SplitModel | SaveStrategy::WithGcode;
#endif
// #if !BBL_RELEASE_TO_PUBLIC
// //only save model in QA environment
// std::string sel = get_app_config()->get("iot_environment");
// if (sel == ENV_PRE_HOST)
// strategy = SaveStrategy::Silence | SaveStrategy::SplitModel | SaveStrategy::WithGcode;
// #endif

result = export_3mf(p->m_print_job_data._3mf_path, strategy, plate_idx, proFn);

Expand Down
10 changes: 5 additions & 5 deletions src/slic3r/GUI/ReleaseNote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1430,13 +1430,13 @@ void InputIpAddressDialog::on_ok(wxMouseEvent& evt)
m_send_job->m_access_code = str_access_code.ToStdString();


#if !BBL_RELEASE_TO_PUBLIC
m_send_job->m_local_use_ssl_for_mqtt = wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false;
m_send_job->m_local_use_ssl_for_ftp = wxGetApp().app_config->get("enable_ssl_for_ftp") == "true" ? true : false;
#else
// #if !BBL_RELEASE_TO_PUBLIC
// m_send_job->m_local_use_ssl_for_mqtt = wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false;
// m_send_job->m_local_use_ssl_for_ftp = wxGetApp().app_config->get("enable_ssl_for_ftp") == "true" ? true : false;
// #else
m_send_job->m_local_use_ssl_for_mqtt = m_obj->local_use_ssl_for_mqtt;
m_send_job->m_local_use_ssl_for_ftp = m_obj->local_use_ssl_for_ftp;
#endif
// #endif

m_send_job->connection_type = m_obj->connection_type();
m_send_job->cloud_print_only = true;
Expand Down
30 changes: 21 additions & 9 deletions src/slic3r/GUI/SelectMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2627,11 +2627,11 @@ void SelectMachineDialog::connect_printer_mqtt()
show_status(PrintDialogStatus::PrintStatusSending);
m_status_bar->disable_cancel_button();
m_status_bar->set_status_text(_L("Connecting to the printer. Unable to cancel during the connection process."));
#if !BBL_RELEASE_TO_PUBLIC
obj_->connect(false, wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false);
#else
// #if !BBL_RELEASE_TO_PUBLIC
// obj_->connect(false, wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false);
// #else
obj_->connect(false, obj_->local_use_ssl_for_mqtt);
#endif
// #endif
}
else {
on_send_print();
Expand Down Expand Up @@ -2743,13 +2743,13 @@ void SelectMachineDialog::on_send_print()
m_print_job->m_dev_ip = obj_->dev_ip;
m_print_job->m_ftp_folder = obj_->get_ftp_folder();
m_print_job->m_access_code = obj_->get_access_code();
#if !BBL_RELEASE_TO_PUBLIC
m_print_job->m_local_use_ssl_for_ftp = wxGetApp().app_config->get("enable_ssl_for_ftp") == "true" ? true : false;
m_print_job->m_local_use_ssl_for_mqtt = wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false;
#else
// #if !BBL_RELEASE_TO_PUBLIC
// m_print_job->m_local_use_ssl_for_ftp = wxGetApp().app_config->get("enable_ssl_for_ftp") == "true" ? true : false;
// m_print_job->m_local_use_ssl_for_mqtt = wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false;
// #else
m_print_job->m_local_use_ssl_for_ftp = obj_->local_use_ssl_for_ftp;
m_print_job->m_local_use_ssl_for_mqtt = obj_->local_use_ssl_for_mqtt;
#endif
// #endif
m_print_job->connection_type = obj_->connection_type();
m_print_job->cloud_print_only = obj_->is_support_cloud_print_only;

Expand Down Expand Up @@ -3955,6 +3955,7 @@ void SelectMachineDialog::set_default_normal()
info.color = wxString::Format("#%02X%02X%02X%02X", colour_rgb.Red(), colour_rgb.Green(), colour_rgb.Blue(), colour_rgb.Alpha()).ToStdString();
m_filaments.push_back(info);
}

}

if (extruders.size() <= 4) {
Expand Down Expand Up @@ -4319,6 +4320,17 @@ void SelectMachineDialog::SetCheckboxOption(const std::string& key, bool value)
}
}

//printago
void SelectMachineDialog::PrintagoMapAms(int ams_slot_id, bool mapFor3MF)
{
m_ams_mapping_result.clear();
m_ams_mapping_result = m_filaments; // UPDATE THIS MAPPING RESULT- Id == tray_id.
m_ams_mapping_res = true;
for (auto& elem : m_ams_mapping_result) {
mapFor3MF ? elem.tray_id = ams_slot_id : elem.tray_id = elem.id;
elem.tray_id = mapFor3MF ? elem.id : ams_slot_id;
}
}

EditDevNameDialog::EditDevNameDialog(Plater *plater /*= nullptr*/)
: DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, _L("Modifying the device name"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
Expand Down
1 change: 1 addition & 0 deletions src/slic3r/GUI/SelectMachine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ class SelectMachineDialog : public DPIDialog
//Printago
void SetPrinter(const std::string& printerLastSelect);
void SetCheckboxOption(const std::string& key, bool value);
void PrintagoMapAms(int ams_slot_id = 0, bool mapFor3MF = false);
};

wxDECLARE_EVENT(EVT_FINISHED_UPDATE_MACHINE_LIST, wxCommandEvent);
Expand Down
10 changes: 5 additions & 5 deletions src/slic3r/GUI/SendToPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,13 +772,13 @@ void SendToPrinterDialog::on_ok(wxCommandEvent &event)
m_send_job->m_access_code = obj_->get_access_code();


#if !BBL_RELEASE_TO_PUBLIC
m_send_job->m_local_use_ssl_for_ftp = wxGetApp().app_config->get("enable_ssl_for_ftp") == "true" ? true : false;
m_send_job->m_local_use_ssl_for_mqtt = wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false;
#else
// #if !BBL_RELEASE_TO_PUBLIC
// m_send_job->m_local_use_ssl_for_ftp = wxGetApp().app_config->get("enable_ssl_for_ftp") == "true" ? true : false;
// m_send_job->m_local_use_ssl_for_mqtt = wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false;
// #else
m_send_job->m_local_use_ssl_for_ftp = obj_->local_use_ssl_for_ftp;
m_send_job->m_local_use_ssl_for_mqtt = obj_->local_use_ssl_for_mqtt;
#endif
// #endif

m_send_job->connection_type = obj_->connection_type();
m_send_job->cloud_print_only = true;
Expand Down
Loading

0 comments on commit c3fb588

Please sign in to comment.