void Plater::priv::on_action_send_bamcu_conect(SimpleEvent&)
{
auto gcodeResult = q->send_gcode(partplate_list.get_curr_plate_index(), [this](int export_stage, int current, int total, bool &cancel) {});
if (gcodeResult != 0) {
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ":send_gcode failed\n";
return;
}
PrintPrepareData data;
q->get_print_job_data(&data);
if (data._3mf_path.empty()) {
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ":3mf path is empty\n";
return;
}
wxString filename = q->get_export_gcode_filename("", true, partplate_list.get_curr_plate_index() == PLATE_ALL_IDX ? true : false);
wxString filepath = wxString::FromUTF8(data._3mf_path.string());
filepath.Replace("\\", "/");
std::string filePath = "?version=v1.0.0&path=" + filepath.ToStdString() + "&name=" + filename.utf8_string();
wxString url = "bambu-connect://import-file?path=" + Http::url_encode(filePath);
if (!wxLaunchDefaultBrowser(url)) {
GUI::MessageDialog msgdialog(nullptr, _L("Failed to start Bambu Farm Manager Client."), "", wxAPPLY | wxOK);
msgdialog.ShowModal();
}
return;
}