mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 03:13:39 +00:00
ENH:add "SyncAmsInfoDialog"
JIRA: none Change-Id: I8e26178f6da816e102a40b429c565696924c58ea (cherry picked from commit 2a46460d5a65279cbb42c8aef2474172b1e1ae30) (cherry picked from commit f7995d5a9f682107bd629841e2f903b0e6a0e7f2)
This commit is contained in:
@@ -336,6 +336,8 @@ set(SLIC3R_GUI_SOURCES
|
||||
GUI/SendSystemInfoDialog.hpp
|
||||
GUI/StepMeshDialog.cpp
|
||||
GUI/StepMeshDialog.hpp
|
||||
GUI/SyncAmsInfoDialog.cpp
|
||||
GUI/SyncAmsInfoDialog.hpp
|
||||
GUI/SurfaceDrag.cpp
|
||||
GUI/SurfaceDrag.hpp
|
||||
GUI/TextLines.cpp
|
||||
|
||||
@@ -875,7 +875,7 @@ void MappingItem::send_event(int fliament_id)
|
||||
event.SetString(param);
|
||||
|
||||
if (send_win) {
|
||||
event.SetEventObject(send_win);
|
||||
event.SetEventObject(send_win);
|
||||
wxPostEvent(send_win, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ struct ThumbnailData;
|
||||
struct ThumbnailsParams;
|
||||
class ModelObject;
|
||||
class ModelInstance;
|
||||
struct TextInfo;
|
||||
class PrintObject;
|
||||
class Print;
|
||||
class SLAPrint;
|
||||
|
||||
@@ -103,6 +103,7 @@
|
||||
#include "PublishDialog.hpp"
|
||||
#include "ModelMall.hpp"
|
||||
#include "ConfigWizard.hpp"
|
||||
#include "SyncAmsInfoDialog.hpp"
|
||||
#include "../Utils/ASCIIFolding.hpp"
|
||||
#include "../Utils/FixModelByWin10.hpp"
|
||||
#include "../Utils/UndoRedo.hpp"
|
||||
@@ -2475,11 +2476,13 @@ std::map<int, DynamicPrintConfig> Sidebar::build_filament_ams_list(MachineObject
|
||||
std::map<int, DynamicPrintConfig> filament_ams_list;
|
||||
if (!obj) return filament_ams_list;
|
||||
|
||||
auto build_tray_config = [](AmsTray const & tray, std::string const & name) {
|
||||
auto build_tray_config = [](AmsTray const &tray, std::string const &name, std::string ams_id, std::string slot_id) {
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": name %1% setting_id %2% color %3%") % name % tray.setting_id % tray.color;
|
||||
DynamicPrintConfig tray_config;
|
||||
tray_config.set_key_value("filament_id", new ConfigOptionStrings{tray.setting_id});
|
||||
tray_config.set_key_value("tag_uid", new ConfigOptionStrings{tray.tag_uid});
|
||||
tray_config.set_key_value("ams_id", new ConfigOptionStrings{ams_id});
|
||||
tray_config.set_key_value("slot_id", new ConfigOptionStrings{slot_id});
|
||||
tray_config.set_key_value("filament_type", new ConfigOptionStrings{tray.type});
|
||||
tray_config.set_key_value("tray_name", new ConfigOptionStrings{ name });
|
||||
tray_config.set_key_value("filament_colour", new ConfigOptionStrings{into_u8(wxColour("#" + tray.color).GetAsString(wxC2S_HTML_SYNTAX))});
|
||||
@@ -2495,7 +2498,7 @@ std::map<int, DynamicPrintConfig> Sidebar::build_filament_ams_list(MachineObject
|
||||
if (obj->ams_support_virtual_tray) {
|
||||
int extruder = 0x10000; // Main (first) extruder at right
|
||||
for (auto & vt_tray : obj->vt_slot) {
|
||||
filament_ams_list.emplace(extruder + stoi(vt_tray.id), build_tray_config(vt_tray, "Ext"));
|
||||
filament_ams_list.emplace(extruder + stoi(vt_tray.id), build_tray_config(vt_tray, "Ext",vt_tray.id, "0"));//254 or 255
|
||||
extruder = 0;
|
||||
}
|
||||
}
|
||||
@@ -2519,7 +2522,7 @@ std::map<int, DynamicPrintConfig> Sidebar::build_filament_ams_list(MachineObject
|
||||
for (auto tray : ams.second->trayList) {
|
||||
int slot_id = std::stoi(tray.first);
|
||||
filament_ams_list.emplace(extruder + (ams_id * 4 + slot_id),
|
||||
build_tray_config(*tray.second, get_ams_name(ams_id, slot_id)));
|
||||
build_tray_config(*tray.second, get_ams_name(ams_id, slot_id), std::to_string(ams_id), std::to_string(slot_id)));
|
||||
}
|
||||
}
|
||||
return filament_ams_list;
|
||||
@@ -2577,40 +2580,32 @@ void Sidebar::sync_ams_list()
|
||||
|
||||
auto & list = wxGetApp().preset_bundle->filament_ams_list;
|
||||
if (list.empty()) {
|
||||
MessageDialog dlg(this,
|
||||
_L("No AMS filaments. Please select a printer in 'Device' page to load AMS info."),
|
||||
_L("Sync filaments with AMS"), wxOK);
|
||||
dlg.ShowModal();
|
||||
SyncAmsInfoDialog::SyncInfo temp_info;
|
||||
SyncAmsInfoDialog sync_dlg(this, temp_info);
|
||||
sync_dlg.ShowModal();//printer is not connected
|
||||
return;
|
||||
}
|
||||
std::string ams_filament_ids = wxGetApp().app_config->get("ams_filament_ids", p->ams_list_device);
|
||||
std::vector<std::string> list2;
|
||||
if (!ams_filament_ids.empty())
|
||||
if (!ams_filament_ids.empty()) {
|
||||
boost::algorithm::split(list2, ams_filament_ids, boost::algorithm::is_any_of(","));
|
||||
struct SyncAmsDialog : MessageDialog {
|
||||
SyncAmsDialog(wxWindow * parent, bool first): MessageDialog(parent,
|
||||
first
|
||||
? _L("Sync filaments with AMS will drop all current selected filament presets and colors. Do you want to continue?")
|
||||
: _L("Already did a synchronization, do you want to sync only changes or resync all?"),
|
||||
_L("Sync filaments with AMS"), 0)
|
||||
{
|
||||
if (first) {
|
||||
add_button(wxID_YES, true, _L("Yes"));
|
||||
} else {
|
||||
add_button(wxID_OK, true, _L("Sync"));
|
||||
add_button(wxID_YES, false, _L("Resync"));
|
||||
}
|
||||
add_button(wxID_CANCEL, false, _L("Cancel"));
|
||||
}
|
||||
} dlg(this, ams_filament_ids.empty());
|
||||
auto res = dlg.ShowModal();
|
||||
if (res == wxID_CANCEL) return;
|
||||
}
|
||||
wxGetApp().plater()->update_all_plate_thumbnails(true);//preview thumbnail for sync_dlg
|
||||
SyncAmsInfoDialog::SyncInfo temp_info;
|
||||
temp_info.connected_printer = true;
|
||||
temp_info.first_sync = ams_filament_ids.empty();
|
||||
SyncAmsInfoDialog sync_dlg(this, temp_info);
|
||||
auto dlg_res = sync_dlg.ShowModal();
|
||||
if (dlg_res == wxID_CANCEL)
|
||||
return;
|
||||
auto sync_result = sync_dlg.get_result();
|
||||
|
||||
list2.resize(list.size());
|
||||
auto iter = list.begin();
|
||||
for (int i = 0; i < list.size(); ++i, ++iter) {
|
||||
auto & ams = iter->second;
|
||||
auto filament_id = ams.opt_string("filament_id", 0u);
|
||||
ams.set_key_value("filament_changed", new ConfigOptionBool{res == wxID_YES || list2[i] != filament_id});
|
||||
ams.set_key_value("filament_changed", new ConfigOptionBool{dlg_res == wxID_YES || list2[i] != filament_id});
|
||||
list2[i] = filament_id;
|
||||
}
|
||||
|
||||
@@ -2623,9 +2618,10 @@ void Sidebar::sync_ams_list()
|
||||
is_support_before.push_back(is_support_filament(i));
|
||||
color_before_sync.push_back(color_opt->values[i]);
|
||||
}
|
||||
|
||||
MergeFilamentInfo merge_info;
|
||||
unsigned int unknowns = 0;
|
||||
auto n = wxGetApp().preset_bundle->sync_ams_list(unknowns);
|
||||
auto enable_append = wxGetApp().app_config->get_bool("enable_append_color_by_sync_ams");
|
||||
auto n = wxGetApp().preset_bundle->sync_ams_list(unknowns, !sync_result.direct_sync, sync_result.sync_maps, enable_append, merge_info);
|
||||
if (n == 0) {
|
||||
MessageDialog dlg(this,
|
||||
_L("There are no compatible filaments, and sync is not performed."),
|
||||
@@ -2668,6 +2664,26 @@ void Sidebar::sync_ams_list()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!merge_info.is_empty() && wxGetApp().app_config->get_bool("enable_merge_color_by_sync_ams")) { // merge same color and preset filament//use same ams
|
||||
auto reduce_index = [](MergeFilamentInfo &merge_info,int value) {
|
||||
for (size_t i = 0; i < merge_info.merges.size(); i++) {
|
||||
auto &cur = merge_info.merges[i];
|
||||
for (size_t j = 0; j < cur.size(); j++) {
|
||||
if (value < cur[j]) {
|
||||
cur[j] = cur[j] - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
for (size_t i = 0; i < merge_info.merges.size(); i++) {
|
||||
auto& cur = merge_info.merges[i];
|
||||
for (size_t j = cur.size() -1; j >= 1 ; j--) {
|
||||
change_filament(cur[j], cur[0]);
|
||||
cur.erase(cur.begin() + j);
|
||||
reduce_index(merge_info, cur[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Layout();
|
||||
}
|
||||
|
||||
|
||||
@@ -1047,7 +1047,12 @@ void PlaterPresetComboBox::update()
|
||||
filament_color = m_preset_bundle->project_config.opt_string("filament_colour", (unsigned int) m_filament_idx);
|
||||
wxColor clr(filament_color);
|
||||
clr_picker->SetBackgroundColour(clr);
|
||||
clr_picker->SetBitmap(*get_extruder_color_icons(true)[m_filament_idx]);
|
||||
std::vector<wxBitmap *> bitmaps = get_extruder_color_icons(true);
|
||||
if (m_filament_idx < bitmaps.size()) {
|
||||
clr_picker->SetBitmap(*bitmaps[m_filament_idx]);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
#ifdef __WXOSX__
|
||||
clr_picker->SetLabel(clr_picker->GetLabel()); // Let setBezelStyle: be called
|
||||
clr_picker->Refresh();
|
||||
|
||||
@@ -42,15 +42,8 @@ wxDEFINE_EVENT(EVT_CLEAR_IPADDRESS, wxCommandEvent);
|
||||
#define WRAP_GAP FromDIP(2)
|
||||
|
||||
static wxString task_canceled_text = _L("Task canceled");
|
||||
static wxString MACHINE_BED_TYPE_STRING[BED_TYPE_COUNT] = {
|
||||
//_L("Auto"),
|
||||
_L("Bambu Cool Plate") + " / " + _L("PLA Plate"),
|
||||
_L("Bambu Engineering Plate"),
|
||||
_L("Bambu Smooth PEI Plate") + "/" + _L("High temperature Plate"),
|
||||
_L("Bambu Textured PEI Plate")
|
||||
};
|
||||
|
||||
static std::string get_nozzle_volume_type_cloud_string(NozzleVolumeType nozzle_volume_type)
|
||||
std::string get_nozzle_volume_type_cloud_string(NozzleVolumeType nozzle_volume_type)
|
||||
{
|
||||
if (nozzle_volume_type == NozzleVolumeType::nvtStandard) {
|
||||
return "standard_flow";
|
||||
@@ -109,6 +102,22 @@ wxString SelectMachineDialog::format_text(wxString &m_msg)
|
||||
}
|
||||
return out_txt;
|
||||
}
|
||||
std::vector<wxString> SelectMachineDialog::MACHINE_BED_TYPE_STRING;
|
||||
std::vector<string> SelectMachineDialog::MachineBedTypeString;
|
||||
void SelectMachineDialog::init_machine_bed_types()
|
||||
{
|
||||
if (MACHINE_BED_TYPE_STRING.size() == 0) {
|
||||
MACHINE_BED_TYPE_STRING = {//_L("Auto"),
|
||||
_L("Bambu Cool Plate") + " / " + _L("PLA Plate"),
|
||||
_L("Bamabu Engineering Plate"),
|
||||
_L("Bamabu Smooth PEI Plate") + "/" + _L("High temperature Plate"),
|
||||
_L("Bamabu Textured PEI Plate"),
|
||||
_L("Bambu Cool Plate SuperTack")
|
||||
};
|
||||
MachineBedTypeString = {//"auto",
|
||||
"pc", "pe", "pei", "pte", "suprtack"};
|
||||
}
|
||||
}
|
||||
SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
||||
: DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, _L("Send print job to"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
|
||||
, m_plater(plater), m_export_3mf_cancel(false)
|
||||
@@ -116,6 +125,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
||||
, m_mapping_tip_popup(AmsMapingTipPopup(this))
|
||||
, m_mapping_tutorial_popup(AmsTutorialPopup(this))
|
||||
{
|
||||
init_machine_bed_types();
|
||||
#ifdef __WINDOWS__
|
||||
SetDoubleBuffered(true);
|
||||
#endif //__WINDOWS__
|
||||
@@ -3798,8 +3808,8 @@ void SelectMachineDialog::reset_and_sync_ams_list()
|
||||
m_mapping_popup.set_parent_item(item);
|
||||
m_mapping_popup.set_current_filament_id(extruder);
|
||||
m_mapping_popup.set_tag_texture(materials[extruder]);
|
||||
m_mapping_popup.set_send_win(this);//fix bug:fisrt click is not valid
|
||||
m_mapping_popup.update(obj_);
|
||||
m_mapping_popup.set_send_win(this);
|
||||
m_mapping_popup.Popup();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
std::string get_nozzle_volume_type_cloud_string(NozzleVolumeType nozzle_volume_type);
|
||||
void print_ams_mapping_result(std::vector<FilamentInfo> &result);
|
||||
enum PrintFromType {
|
||||
FROM_NORMAL,
|
||||
@@ -397,6 +398,11 @@ protected:
|
||||
wxGridSizer* m_sizer_ams_mapping_left{ nullptr };
|
||||
wxGridSizer* m_sizer_ams_mapping_right{ nullptr };
|
||||
|
||||
public:
|
||||
static std::vector<wxString> MACHINE_BED_TYPE_STRING;
|
||||
static void init_machine_bed_types();
|
||||
static std::vector<std::string> MachineBedTypeString;
|
||||
|
||||
public:
|
||||
SelectMachineDialog(Plater *plater = nullptr);
|
||||
~SelectMachineDialog();
|
||||
|
||||
4159
src/slic3r/GUI/SyncAmsInfoDialog.cpp
Normal file
4159
src/slic3r/GUI/SyncAmsInfoDialog.cpp
Normal file
File diff suppressed because it is too large
Load Diff
290
src/slic3r/GUI/SyncAmsInfoDialog.hpp
Normal file
290
src/slic3r/GUI/SyncAmsInfoDialog.hpp
Normal file
@@ -0,0 +1,290 @@
|
||||
#ifndef _SyncAmsInfo_DIALOG_H_
|
||||
#define _SyncAmsInfo_DIALOG_H_
|
||||
|
||||
#include <future>
|
||||
#include <thread>
|
||||
#include "GUI_App.hpp"
|
||||
#include "GUI_Utils.hpp"
|
||||
#include "Widgets/Button.hpp"
|
||||
#include "SelectMachine.hpp"
|
||||
#include "DeviceManager.hpp"
|
||||
class Button;
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
class SyncAmsInfoDialog : public DPIDialog
|
||||
{
|
||||
int m_current_filament_id{0};
|
||||
int m_print_plate_idx{0};
|
||||
int m_print_plate_total{0};
|
||||
int m_timeout_count{0};
|
||||
int m_print_error_code{0};
|
||||
bool m_is_in_sending_mode{false};
|
||||
bool m_ams_mapping_res{false};
|
||||
bool m_ams_mapping_valid{false};
|
||||
bool m_export_3mf_cancel{false};
|
||||
bool m_is_canceled{false};
|
||||
bool m_is_rename_mode{false};
|
||||
bool m_check_flag{false};
|
||||
PrintPageMode m_print_page_mode{PrintPageMode::PrintPageModePrepare};
|
||||
std::string m_print_error_msg;
|
||||
std::string m_print_error_extra;
|
||||
std::string m_printer_last_select;
|
||||
std::string m_print_info;
|
||||
wxString m_current_project_name;
|
||||
PrintDialogStatus m_print_status{PrintStatusInit};
|
||||
wxColour m_colour_def_color{wxColour(255, 255, 255)};
|
||||
wxColour m_colour_bold_color{wxColour(38, 46, 48)};
|
||||
StateColor m_btn_bg_enable;
|
||||
Label * m_text_bed_type;
|
||||
|
||||
std::shared_ptr<int> m_token = std::make_shared<int>(0);
|
||||
std::map<std::string, PrintOption *> m_checkbox_list;
|
||||
std::vector<wxString> m_bedtype_list;
|
||||
std::vector<MachineObject *> m_list;
|
||||
std::vector<FilamentInfo> m_filaments;
|
||||
std::vector<FilamentInfo> m_ams_mapping_result;
|
||||
std::vector<int> m_filaments_map;
|
||||
std::shared_ptr<BBLStatusBarSend> m_status_bar;
|
||||
|
||||
// SendModeSwitchButton* m_mode_print {nullptr};
|
||||
// SendModeSwitchButton* m_mode_send {nullptr};
|
||||
wxStaticBitmap *m_printer_image{nullptr};
|
||||
wxStaticBitmap *m_bed_image{nullptr};
|
||||
|
||||
Slic3r::DynamicPrintConfig m_required_data_config;
|
||||
Slic3r::Model m_required_data_model;
|
||||
Slic3r::PlateDataPtrs m_required_data_plate_data_list;
|
||||
std::string m_required_data_file_name;
|
||||
std::string m_required_data_file_path;
|
||||
|
||||
std::vector<POItem> ops_auto;
|
||||
std::vector<POItem> ops_no_auto;
|
||||
|
||||
protected:
|
||||
PrintFromType m_print_type{FROM_NORMAL};
|
||||
AmsMapingPopup m_mapping_popup{nullptr};
|
||||
AmsMapingTipPopup m_mapping_tip_popup{nullptr};
|
||||
AmsTutorialPopup m_mapping_tutorial_popup{nullptr};
|
||||
MaterialHash m_materialList;
|
||||
Plater * m_plater{nullptr};
|
||||
wxPanel * m_options_other{nullptr};
|
||||
wxBoxSizer * m_sizer_options_timelapse{nullptr};
|
||||
wxBoxSizer * m_sizer_options_other{nullptr};
|
||||
wxBoxSizer * m_sizer_thumbnail{nullptr};
|
||||
|
||||
wxBoxSizer * m_sizer_main{nullptr};
|
||||
wxBoxSizer * m_basicl_sizer{nullptr};
|
||||
wxBoxSizer * rename_sizer_v{nullptr};
|
||||
wxBoxSizer * rename_sizer_h{nullptr};
|
||||
wxBoxSizer * m_sizer_autorefill{nullptr};
|
||||
ScalableButton * m_button_refresh{nullptr};
|
||||
Button * m_button_ensure{nullptr};
|
||||
wxStaticBitmap * m_rename_button{nullptr};
|
||||
ComboBox * m_comboBox_printer{nullptr};
|
||||
wxStaticBitmap * m_staticbitmap{nullptr};
|
||||
wxStaticBitmap * m_bitmap_last_plate{nullptr};
|
||||
wxStaticBitmap * m_bitmap_next_plate{nullptr};
|
||||
wxStaticBitmap * img_amsmapping_tip{nullptr};
|
||||
ThumbnailPanel * m_thumbnailPanel{nullptr};
|
||||
wxPanel * m_panel_status{nullptr};
|
||||
wxPanel * m_basic_panel;
|
||||
wxPanel * m_rename_normal_panel{nullptr};
|
||||
wxPanel * m_panel_sending{nullptr};
|
||||
wxPanel * m_panel_prepare{nullptr};
|
||||
wxPanel * m_panel_finish{nullptr};
|
||||
wxPanel * m_line_top{nullptr};
|
||||
Label * m_st_txt_error_code{nullptr};
|
||||
Label * m_st_txt_error_desc{nullptr};
|
||||
Label * m_st_txt_extra_info{nullptr};
|
||||
Label * m_ams_backup_tip{nullptr};
|
||||
wxHyperlinkCtrl * m_link_network_state{nullptr};
|
||||
wxSimplebook * m_rename_switch_panel{nullptr};
|
||||
wxSimplebook * m_simplebook{nullptr};
|
||||
wxStaticText * m_rename_text{nullptr};
|
||||
Label * m_stext_printer_title{nullptr};
|
||||
Label * m_statictext_ams_msg{nullptr};
|
||||
Label * m_text_printer_msg{nullptr};
|
||||
wxStaticText * m_staticText_bed_title{nullptr};
|
||||
wxStaticText * m_stext_sending{nullptr};
|
||||
wxStaticText * m_statictext_finish{nullptr};
|
||||
TextInput * m_rename_input{nullptr};
|
||||
wxTimer * m_refresh_timer{nullptr};
|
||||
std::unique_ptr<Worker> m_worker;
|
||||
wxScrolledWindow * m_sw_print_failed_info{nullptr};
|
||||
wxHyperlinkCtrl * m_hyperlink{nullptr};
|
||||
wxStaticBitmap * m_advanced_options_icon{nullptr};
|
||||
ScalableBitmap * rename_editable{nullptr};
|
||||
ScalableBitmap * rename_editable_light{nullptr};
|
||||
ScalableBitmap * ams_mapping_help_icon{nullptr};
|
||||
wxStaticBitmap * img_ams_backup{nullptr};
|
||||
ThumbnailData m_cur_input_thumbnail_data;
|
||||
ThumbnailData m_cur_no_light_thumbnail_data;
|
||||
ThumbnailData m_preview_thumbnail_data; // when ams map change
|
||||
std::vector<wxColour> m_preview_colors_in_thumbnail;
|
||||
std::vector<wxColour> m_cur_colors_in_thumbnail;
|
||||
std::vector<bool> m_edge_pixels;
|
||||
|
||||
StaticBox *m_filament_panel;
|
||||
StaticBox *m_filament_left_panel;
|
||||
StaticBox *m_filament_right_panel;
|
||||
|
||||
wxBoxSizer *m_filament_panel_sizer;
|
||||
wxBoxSizer *m_filament_panel_left_sizer;
|
||||
wxBoxSizer *m_filament_panel_right_sizer;
|
||||
wxBoxSizer *m_sizer_filament_2extruder;
|
||||
|
||||
wxGridSizer *m_sizer_ams_mapping{nullptr};
|
||||
wxGridSizer *m_sizer_ams_mapping_left{nullptr};
|
||||
wxGridSizer *m_sizer_ams_mapping_right{nullptr};
|
||||
|
||||
public:
|
||||
void init_bind();
|
||||
void init_timer();
|
||||
void check_focus(wxWindow *window);
|
||||
void show_print_failed_info(bool show, int code = 0, wxString description = wxEmptyString, wxString extra = wxEmptyString);
|
||||
void check_fcous_state(wxWindow *window);
|
||||
void popup_filament_backup();
|
||||
|
||||
void prepare_mode(bool refresh_button = true);
|
||||
void sending_mode();
|
||||
void finish_mode();
|
||||
void sync_ams_mapping_result(std::vector<FilamentInfo> &result);
|
||||
void prepare(int print_plate_idx);
|
||||
void show_status(PrintDialogStatus status, std::vector<wxString> params = std::vector<wxString>());
|
||||
void sys_color_changed();
|
||||
void reset_timeout();
|
||||
void update_user_printer();
|
||||
void reset_ams_material();
|
||||
void update_show_status();
|
||||
void on_rename_click(wxMouseEvent &event);
|
||||
void on_rename_enter();
|
||||
void update_printer_combobox(wxCommandEvent &event);
|
||||
void on_cancel(wxCloseEvent &event);
|
||||
void show_errors(wxString &info);
|
||||
void on_ok_btn(wxCommandEvent &event);
|
||||
void Enable_Auto_Refill(bool enable);
|
||||
void connect_printer_mqtt();
|
||||
void on_send_print();
|
||||
void clear_ip_address_config(wxCommandEvent &e);
|
||||
void on_refresh(wxCommandEvent &event);
|
||||
void on_set_finish_mapping(wxCommandEvent &evt);
|
||||
void on_print_job_cancel(wxCommandEvent &evt);
|
||||
void reset_and_sync_ams_list();
|
||||
void clone_thumbnail_data();
|
||||
void record_edge_pixels_data();
|
||||
wxColour adjust_color_for_render(const wxColour &color);
|
||||
void final_deal_edge_pixels_data(ThumbnailData &data);
|
||||
void updata_thumbnail_data_after_connected_printer();
|
||||
void unify_deal_thumbnail_data(ThumbnailData &input_data, ThumbnailData &no_light_data);
|
||||
void change_default_normal(int old_filament_id, wxColour temp_ams_color);
|
||||
void set_default_from_sdcard();
|
||||
void update_page_turn_state(bool show);
|
||||
void on_timer(wxTimerEvent &event);
|
||||
void on_selection_changed(wxCommandEvent &event);
|
||||
void update_flow_cali_check(MachineObject *obj);
|
||||
void Enable_Refresh_Button(bool en);
|
||||
void Enable_Send_Button(bool en);
|
||||
void update_user_machine_list();
|
||||
void update_lan_machine_list();
|
||||
void stripWhiteSpace(std::string &str);
|
||||
void update_ams_status_msg(wxString msg, bool is_warning = false);
|
||||
void update_priner_status_msg(wxString msg, bool is_warning = false);
|
||||
void update_print_status_msg(wxString msg, bool is_warning = false, bool is_printer = true);
|
||||
void update_print_error_info(int code, std::string msg, std::string extra);
|
||||
void set_flow_calibration_state(bool state, bool show_tips = true);
|
||||
bool has_timelapse_warning();
|
||||
void update_timelapse_enable_status();
|
||||
bool is_same_printer_model();
|
||||
bool is_blocking_printing(MachineObject *obj_);
|
||||
bool is_same_nozzle_diameters(NozzleType &tag_nozzle_type, float &nozzle_diameter);
|
||||
bool is_same_nozzle_type(std::string &filament_type, NozzleType &tag_nozzle_type);
|
||||
bool has_tips(MachineObject *obj);
|
||||
bool is_timeout();
|
||||
int update_print_required_data(Slic3r::DynamicPrintConfig config, Slic3r::Model model, Slic3r::PlateDataPtrs plate_data_list, std::string file_name, std::string file_path);
|
||||
void set_print_type(PrintFromType type) { m_print_type = type; };
|
||||
bool do_ams_mapping(MachineObject *obj_);
|
||||
bool get_ams_mapping_result(std::string &mapping_array_str, std::string &mapping_array_str2, std::string &ams_mapping_info);
|
||||
bool build_nozzles_info(std::string &nozzles_info);
|
||||
bool can_hybrid_mapping(ExtderData data);
|
||||
void auto_supply_with_ext(std::vector<AmsTray> slots);
|
||||
bool is_nozzle_type_match(ExtderData data);
|
||||
int convert_filament_map_nozzle_id_to_task_nozzle_id(int nozzle_id);
|
||||
|
||||
std::string get_print_status_info(PrintDialogStatus status);
|
||||
|
||||
PrintFromType get_print_type() { return m_print_type; };
|
||||
wxString format_bed_name(std::string plate_name);
|
||||
wxString format_steel_name(NozzleType type);
|
||||
wxString format_text(wxString &m_msg);
|
||||
PrintDialogStatus get_status() { return m_print_status; }
|
||||
std::vector<std::string> sort_string(std::vector<std::string> strArray);
|
||||
|
||||
const std::vector<FilamentInfo> &get_ams_mapping_result() { return m_ams_mapping_result; }
|
||||
|
||||
public:
|
||||
struct SyncInfo
|
||||
{
|
||||
bool connected_printer = false;
|
||||
bool first_sync = false;
|
||||
};
|
||||
struct SyncResult
|
||||
{
|
||||
bool direct_sync = true;
|
||||
std::map<int, AMSMapInfo> sync_maps;
|
||||
};
|
||||
SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info);
|
||||
~SyncAmsInfoDialog();
|
||||
void on_dpi_changed(const wxRect &suggested_rect) override;
|
||||
const SyncResult &get_result() { return m_result; }
|
||||
|
||||
public:
|
||||
bool Show(bool show) override;
|
||||
void updata_ui_data_after_connected_printer();
|
||||
void update_ams_check(MachineObject *obj);
|
||||
void set_default(bool hide_some = false);
|
||||
void update_select_layout(MachineObject *obj);
|
||||
void set_default_normal(const ThumbnailData &);
|
||||
bool is_must_finish_slice_then_connected_printer() ;
|
||||
void update_printer_name() ;
|
||||
void hide_no_use_controls();
|
||||
void show_sizer(wxSizer *sizer, bool show);
|
||||
void deal_ok();
|
||||
bool get_is_double_extruder();
|
||||
|
||||
private:
|
||||
wxBoxSizer *create_sizer_thumbnail(wxButton *image_button, bool left);
|
||||
void update_when_change_plate(int);
|
||||
|
||||
private:
|
||||
SyncInfo & m_input_info;
|
||||
SyncResult m_result;
|
||||
Button * m_button_ok = nullptr;
|
||||
Button * m_button_cancel = nullptr;
|
||||
|
||||
wxStaticText* m_tip_text{nullptr};
|
||||
wxStaticText* m_used_colors_tip_text{nullptr};
|
||||
wxStaticText* m_warning_text{nullptr};
|
||||
wxBoxSizer * m_left_sizer_thumbnail{nullptr};
|
||||
wxBoxSizer * m_right_sizer_thumbnail{nullptr};
|
||||
wxButton * m_left_image_button = nullptr;
|
||||
wxButton * m_right_image_button = nullptr;
|
||||
wxBoxSizer * sizer_basic_right_info = nullptr;
|
||||
wxBoxSizer * sizer_advanced_options_title = nullptr;
|
||||
wxPanel * m_rename_edit_panel = nullptr;
|
||||
wxStaticText * m_confirm_title = nullptr;
|
||||
wxStaticText * m_are_you_sure_title = nullptr;
|
||||
wxStaticText * m_specify_color_cluster_title = nullptr;
|
||||
wxBoxSizer * m_plate_combox_sizer = nullptr;
|
||||
wxBoxSizer * m_sizer_two_image = nullptr;
|
||||
wxStaticText * m_printer_title = nullptr;
|
||||
|
||||
wxCheckBox* m_append_color_checkbox = nullptr;
|
||||
wxCheckBox* m_merge_color_checkbox = nullptr;
|
||||
bool m_is_empty_project = true;
|
||||
|
||||
const int THUMBNAIL_SIZE_WIDTH = 200;
|
||||
int m_specify_plate_idx{-1};
|
||||
wxString m_printer_name;
|
||||
};
|
||||
}} // namespace Slic3r::GUI
|
||||
#endif // _STEP_MESH_DIALOG_H_
|
||||
Reference in New Issue
Block a user