NEW:support new mapping type

jira:[support new mapping]

Change-Id: I88e5d3b6966d4ed1e8098d13fe9335fecf6e01c4
This commit is contained in:
tao wang 2024-06-18 20:09:11 +08:00 committed by lane.wei
parent 0848c26da9
commit c0932e16ff
7 changed files with 566 additions and 352 deletions

View File

@ -0,0 +1,10 @@
<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_16379_26502)">
<path d="M2.77622 14.5154L3.31529 12.5773C3.41372 12.2274 3.59185 11.9072 3.8356 11.6492L10.9629 4.10007C11.5489 3.47966 12.4981 3.47966 13.084 4.10007L14.0075 5.07783C14.0801 5.15476 14.1458 5.23913 14.1997 5.32599C14.584 5.94143 14.5208 6.78022 14.0075 7.32369L6.88013 14.8728C6.84966 14.905 6.81919 14.9373 6.78638 14.9671C6.56138 15.178 6.29419 15.3344 6.00357 15.4237L4.1731 15.9945L3.18404 16.3022C2.98716 16.3642 2.77388 16.3071 2.62857 16.1508C2.48326 15.9945 2.42701 15.7736 2.4856 15.5627L2.77622 14.5154ZM4.23404 13.493L3.85435 14.8529L5.13872 14.4534L5.68716 14.2821C5.83716 14.235 5.97544 14.1481 6.0856 14.0315L11.4387 8.36101L9.9856 6.8224L4.63013 12.4904C4.61607 12.5053 4.60201 12.5202 4.59029 12.5351C4.49888 12.6443 4.43326 12.7733 4.39341 12.9123L4.23169 13.493H4.23404ZM8.27466 15.1358H15.3997C15.7114 15.1358 15.9622 15.4014 15.9622 15.7314C15.9622 16.0615 15.7114 16.327 15.3997 16.327H8.27466C7.96294 16.327 7.71216 16.0615 7.71216 15.7314C7.71216 15.4014 7.96294 15.1358 8.27466 15.1358Z" fill="#6B6B6B"/>
</g>
<defs>
<clipPath id="clip0_16379_26502">
<rect width="13.5" height="12.7059" fill="white" transform="translate(2.46216 3.62109)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -286,19 +286,19 @@ void MaterialItem::doRender(wxDC &dc)
AmsMapingPopup::AmsMapingPopup(wxWindow *parent)
: PopupWindow(parent, wxBORDER_NONE)
{
SetSize(wxSize(FromDIP(252), -1));
SetMinSize(wxSize(FromDIP(252), -1));
SetMaxSize(wxSize(FromDIP(252), -1));
Bind(wxEVT_PAINT, &AmsMapingPopup::paintEvent, this);
#if __APPLE__
Bind(wxEVT_LEFT_DOWN, &AmsMapingPopup::on_left_down, this);
#endif
SetBackgroundColour(*wxWHITE);
m_sizer_main = new wxBoxSizer(wxVERTICAL);
//m_sizer_main->Add(0, 0, 1, wxEXPAND, 0);
m_sizer_main = new wxBoxSizer(wxVERTICAL);
m_sizer_ams = new wxBoxSizer(wxHORIZONTAL);
m_sizer_ams_left = new wxBoxSizer(wxVERTICAL);
m_sizer_ams_right = new wxBoxSizer(wxVERTICAL);
auto title_panel = new wxPanel(this, wxID_ANY);
title_panel->SetBackgroundColour(wxColour(0xF8, 0xF8, 0xF8));
@ -307,7 +307,6 @@ void MaterialItem::doRender(wxDC &dc)
wxBoxSizer *title_sizer_h= new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *title_sizer_v = new wxBoxSizer(wxVERTICAL);
auto title_text = new wxStaticText(title_panel, wxID_ANY, _L("AMS Slots"));
@ -319,19 +318,15 @@ void MaterialItem::doRender(wxDC &dc)
title_panel->Layout();
title_panel->Fit();
m_sizer_list = new wxBoxSizer(wxVERTICAL);
for (auto i = 0; i < AMS_TOTAL_COUNT; i++) {
auto sizer_mapping_list = new wxBoxSizer(wxHORIZONTAL);
/*auto ams_mapping_item_container = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("ams_mapping_container", this, 78), wxDefaultPosition,
wxSize(FromDIP(230), FromDIP(78)), 0);*/
auto ams_mapping_item_container = new MappingContainer(this);
ams_mapping_item_container->SetSizer(sizer_mapping_list);
ams_mapping_item_container->Layout();
//ams_mapping_item_container->Hide();
m_amsmapping_container_sizer_list.push_back(sizer_mapping_list);
m_amsmapping_container_list.push_back(ams_mapping_item_container);
m_sizer_list->Add(ams_mapping_item_container, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, FromDIP(5));
}
auto left_ams_title_text = new wxStaticText(this, wxID_ANY, _L("Left Ams"));
auto right_ams_title_text = new wxStaticText(this, wxID_ANY, _L("Right Ams"));
m_sizer_ams_left->Add(left_ams_title_text, 0, wxALIGN_CENTER, 0);
m_sizer_ams_right->Add(right_ams_title_text, 0, wxALIGN_CENTER, 0);
m_sizer_ams->Add(m_sizer_ams_left, 0, wxEXPAND | wxALL, FromDIP(0));
m_sizer_ams->Add(m_sizer_ams_right, 0, wxEXPAND | wxALL, FromDIP(0));
m_warning_text = new wxStaticText(this, wxID_ANY, wxEmptyString);
m_warning_text->SetForegroundColour(wxColour(0xFF, 0x6F, 0x00));
@ -342,9 +337,7 @@ void MaterialItem::doRender(wxDC &dc)
m_warning_text->Wrap(FromDIP(248));
m_sizer_main->Add(title_panel, 0, wxEXPAND | wxALL, FromDIP(2));
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(5));
m_sizer_main->Add(m_sizer_list, 0, wxEXPAND | wxALL, FromDIP(0));
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(5));
m_sizer_main->Add(m_sizer_ams, 0, wxEXPAND | wxALL, FromDIP(2));
m_sizer_main->Add(m_warning_text, 0, wxEXPAND | wxALL, FromDIP(6));
SetSizer(m_sizer_main);
@ -457,73 +450,92 @@ void AmsMapingPopup::update_ams_data_multi_machines()
void AmsMapingPopup::update_ams_data(std::map<std::string, Ams*> amsList)
{
m_has_unmatch_filament = false;
//m_mapping_item_list.clear();
std::map<std::string, Ams *>::iterator ams_iter;
BOOST_LOG_TRIVIAL(trace) << "ams_mapping total count " << amsList.size();
for (auto& ams_container : m_amsmapping_container_list) {
ams_container->Hide();
ams_container->Destroy();
}
for (wxWindow *mitem : m_mapping_item_list) {
mitem->Destroy();
mitem = nullptr;
}
m_mapping_item_list.clear();
if (m_amsmapping_container_sizer_list.size() > 0) {
for (wxBoxSizer *siz : m_amsmapping_container_sizer_list) {
siz->Clear(true);
}
}
std::map<std::string, Ams *>::iterator ams_iter;
BOOST_LOG_TRIVIAL(trace) << "ams_mapping total count " << amsList.size();
int m_amsmapping_container_list_index = 0;
m_amsmapping_container_list.clear();
m_amsmapping_container_sizer_list.clear();
m_mapping_item_list.clear();
for (ams_iter = amsList.begin(); ams_iter != amsList.end(); ams_iter++) {
BOOST_LOG_TRIVIAL(trace) << "ams_mapping ams id " << ams_iter->first.c_str();
auto ams_indx = atoi(ams_iter->first.c_str());
Ams *ams_group = ams_iter->second;
std::vector<TrayData> tray_datas;
std::map<std::string, AmsTray *>::iterator tray_iter;
int ams_indx = atoi(ams_iter->first.c_str());
int ams_type = ams_iter->second->type;
int nozzle_id = ams_iter->second->nozzle;
for (tray_iter = ams_group->trayList.begin(); tray_iter != ams_group->trayList.end(); tray_iter++) {
AmsTray *tray_data = tray_iter->second;
TrayData td;
if (ams_type == 1) {
td.id = ams_indx * AMS_TOTAL_COUNT + atoi(tray_data->id.c_str());
auto sizer_mapping_list = new wxBoxSizer(wxHORIZONTAL);
auto ams_mapping_item_container = new MappingContainer(this);
ams_mapping_item_container->SetSizer(sizer_mapping_list);
ams_mapping_item_container->Layout();
m_has_unmatch_filament = false;
if (!tray_data->is_exists) {
td.type = EMPTY;
} else {
if (!tray_data->is_tray_info_ready()) {
td.type = THIRD;
} else {
td.type = NORMAL;
td.colour = AmsTray::decode_color(tray_data->color);
td.name = tray_data->get_display_filament_type();
td.filament_type = tray_data->get_filament_type();
td.ctype = tray_data->ctype;
for (auto col : tray_data->cols) {
td.material_cols.push_back(AmsTray::decode_color(col));
}
BOOST_LOG_TRIVIAL(trace) << "ams_mapping ams id " << ams_iter->first.c_str();
Ams* ams_group = ams_iter->second;
std::vector<TrayData> tray_datas;
std::map<std::string, AmsTray*>::iterator tray_iter;
for (tray_iter = ams_group->trayList.begin(); tray_iter != ams_group->trayList.end(); tray_iter++) {
AmsTray* tray_data = tray_iter->second;
TrayData td;
td.id = ams_indx * AMS_TOTAL_COUNT + atoi(tray_data->id.c_str());
if (!tray_data->is_exists) {
td.type = EMPTY;
}
else {
if (!tray_data->is_tray_info_ready()) {
td.type = THIRD;
}
else {
td.type = NORMAL;
td.colour = AmsTray::decode_color(tray_data->color);
td.name = tray_data->get_display_filament_type();
td.filament_type = tray_data->get_filament_type();
td.ctype = tray_data->ctype;
for (auto col : tray_data->cols) {
td.material_cols.push_back(AmsTray::decode_color(col));
}
}
td.ams_id = std::stoi(ams_iter->second->id);
td.slot_id = std::stoi(tray_iter->second->id);
}
tray_datas.push_back(td);
}
tray_datas.push_back(td);
}
ams_mapping_item_container->Show();
add_ams_mapping(tray_datas, ams_mapping_item_container, sizer_mapping_list);
m_amsmapping_container_list[m_amsmapping_container_list_index]->Show();
add_ams_mapping(tray_datas, m_amsmapping_container_list[m_amsmapping_container_list_index], m_amsmapping_container_sizer_list[m_amsmapping_container_list_index]);
m_amsmapping_container_list_index++;
m_amsmapping_container_sizer_list.push_back(sizer_mapping_list);
m_amsmapping_container_list.push_back(ams_mapping_item_container);
//main nozzle = right nozzle
if (nozzle_id == 0) {
m_sizer_ams_right->Add(ams_mapping_item_container, 0, wxALIGN_CENTER, 0);
}
else if (nozzle_id == 1) {
m_sizer_ams_left->Add(ams_mapping_item_container, 0, wxALIGN_CENTER, 0);
}
//m_warning_text->Show(m_has_unmatch_filament);
}
}
/*extra tray*/
m_warning_text->Show(m_has_unmatch_filament);
Layout();
Fit();
}
@ -584,6 +596,9 @@ void AmsMapingPopup::add_ams_mapping(std::vector<TrayData> tray_data, wxWindow*
// set button
MappingItem *m_mapping_item = new MappingItem(container);
m_mapping_item->m_ams_id = tray_data[i].ams_id;
m_mapping_item->m_slot_id = tray_data[i].slot_id;
m_mapping_item->SetSize(wxSize(FromDIP(68 * 0.7), FromDIP(100 * 0.6)));
m_mapping_item->SetMinSize(wxSize(FromDIP(68 * 0.7), FromDIP(100 * 0.6)));
m_mapping_item->SetMaxSize(wxSize(FromDIP(68 * 0.7), FromDIP(100 * 0.6)));
@ -677,7 +692,8 @@ void MappingItem::send_event(int fliament_id)
wxCommandEvent event(EVT_SET_FINISH_MAPPING);
event.SetInt(m_tray_data.id);
wxString param = wxString::Format("%d|%d|%d|%d|%s|%d", m_coloul.Red(), m_coloul.Green(), m_coloul.Blue(), m_coloul.Alpha(), number, fliament_id);
wxString param = wxString::Format("%d|%d|%d|%d|%s|%d|%d|%d", m_coloul.Red(), m_coloul.Green(), m_coloul.Blue(), m_coloul.Alpha(), number, fliament_id,
m_tray_data.ams_id, m_tray_data.slot_id);
event.SetString(param);
event.SetEventObject(this->GetParent()->GetParent());
wxPostEvent(this->GetParent()->GetParent()->GetParent(), event);

View File

@ -60,6 +60,9 @@ struct TrayData
std::string filament_type;
wxColour colour;
std::vector<wxColour> material_cols = std::vector<wxColour>();
int ams_id = 0;
int slot_id = 0;
};
class MaterialItem: public wxPanel
@ -116,6 +119,9 @@ public:
ScalableBitmap m_transparent_mapping_item;
bool m_unmatch{false};
int m_ams_id{255};
int m_slot_id{255};
void msw_rescale();
void paintEvent(wxPaintEvent &evt);
void render(wxDC &dc);
@ -150,6 +156,9 @@ public:
int m_current_filament_id;
std::string m_tag_material;
wxBoxSizer *m_sizer_main{nullptr};
wxBoxSizer *m_sizer_ams{nullptr};
wxBoxSizer *m_sizer_ams_left{nullptr};
wxBoxSizer *m_sizer_ams_right{nullptr};
wxBoxSizer *m_sizer_list{nullptr};
wxWindow *m_parent_item{nullptr};

View File

@ -4052,11 +4052,24 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
for (auto it = j_ams.begin(); it != j_ams.end(); it++) {
if (!it->contains("id")) continue;
std::string ams_id = (*it)["id"].get<std::string>();
int nozzle_id = 0; // Default nozzle id
int type_id = 1; // 0:dummy 1:ams 2:ams-lite 3:n3f 4:n3s
if (it->contains("nozzle")) {
nozzle_id = (*it)["nozzle"].get<int>();
}
if (it->contains("type")) {
type_id = (*it)["type"].get<int>();
}
ams_id_set.erase(ams_id);
Ams* curr_ams = nullptr;
auto ams_it = amsList.find(ams_id);
if (ams_it == amsList.end()) {
Ams* new_ams = new Ams(ams_id);
Ams* new_ams = new Ams(ams_id, nozzle_id, type_id);
try {
if (!ams_id.empty()) {
int ams_id_int = atoi(ams_id.c_str());
@ -4902,7 +4915,47 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
}
}
}
/*parse np*/
try
{
if (jj.contains("cfg") && jj.contains("fun") && jj.contains("aux") && jj.contains("stat")) {
is_enable_np = true;
}
else {
is_enable_np = false;
}
if (jj.contains("device")) {
json const & device = jj["device"];
if (device.contains("nozzle")) {
json const & nozzle = device["nozzle"];
m_np_nozzle_data = NozzleData();
m_np_nozzle_data.info = nozzle["info"].get<int>();
for (const auto& noz : nozzle.items()) {
std::string nozzle_id = noz.key();
json const & ndata = noz.value();
Nozzle n;
if (ndata.contains("info")) {n.info = ndata["info"].get<int>(); }
if (ndata.contains("snow")) {n.info = ndata["snow"].get<int>(); }
if (ndata.contains("spre")) {n.info = ndata["spre"].get<int>(); }
if (ndata.contains("star")) {n.info = ndata["star"].get<int>(); }
if (ndata.contains("stat")) {n.info = ndata["stat"].get<int>(); }
if (ndata.contains("temp")) {n.info = ndata["temp"].get<int>(); }
m_np_nozzle_data.nozzle[nozzle_id] = n;
}
}
}
}
catch (...)
{}
}
if (!key_field_only) {
try {
if (j.contains("camera")) {

View File

@ -135,6 +135,21 @@ enum ManualPaCaliMethod {
PA_PATTERN,
};
struct Nozzle
{
int info{0};
int snow{0};
int spre{0};
int star{0};
int stat{0};
int temp{0};
};
struct NozzleData
{
std::map<std::string, Nozzle> nozzle; /*0 - main nozzle 1 - slave nozzle*/
int info{0};
};
struct RatingInfo {
bool request_successful;
@ -226,8 +241,10 @@ public:
class Ams {
public:
Ams(std::string ams_id) {
Ams(std::string ams_id, int nozzle_id, int type_id) {
id = ams_id;
nozzle = nozzle_id;
type = type_id;
}
std::string id;
int humidity = 5;
@ -235,6 +252,9 @@ public:
bool tray_read_opt{false};
bool is_exists{false};
std::map<std::string, AmsTray*> trayList;
int nozzle;
int type{1}; //0:dummy 1:ams 2:ams-lite 3:n3f 4:n3s
};
enum PrinterFirmwareType {
@ -330,7 +350,6 @@ private:
// type, time stamp, delay
std::vector<std::tuple<std::string, uint64_t, uint64_t>> message_delay;
public:
enum LIGHT_EFFECT {
@ -484,6 +503,7 @@ public:
/* ams properties */
std::map<std::string, Ams*> amsList; // key: ams[id], start with 0
AmsTray vt_tray; // virtual tray
std::vector<AmsTray> vt_trays; // virtual tray for new
long ams_exist_bits = 0;
long tray_exist_bits = 0;
long tray_is_bbl_bits = 0;
@ -978,6 +998,10 @@ public:
bool is_firmware_info_valid();
std::string get_string_from_fantype(FanType type);
/*for more extruder*/
bool is_enable_np{ false };
NozzleData m_np_nozzle_data;
/* Device Filament Check */
std::set<std::string> m_checked_filament;
std::string m_printer_preset_name;
@ -986,6 +1010,7 @@ public:
int get_flag_bits(std::string str, int start, int count = 1);
int get_flag_bits(int num, int start, int count = 1);
void update_printer_preset_name(const std::string &nozzle_diameter_str);
};
class DeviceManager

View File

@ -961,6 +961,9 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
SetDoubleBuffered(true);
#endif //__WINDOWS__
SetMinSize(wxSize(FromDIP(688), -1));
SetMaxSize(wxSize(FromDIP(688), -1));
// bind
Bind(wxEVT_CLOSE_WINDOW, &SelectMachineDialog::on_cancel, this);
@ -977,54 +980,77 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
SetBackgroundColour(m_colour_def_color);
m_sizer_main = new wxBoxSizer(wxVERTICAL);
m_sizer_main->SetMinSize(wxSize(0, -1));
m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
m_line_top->SetBackgroundColour(wxColour(166, 169, 170));
m_scrollable_view = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
m_sizer_scrollable_view = new wxBoxSizer(wxVERTICAL);
m_scrollable_region = new wxPanel(m_scrollable_view, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_sizer_scrollable_region = new wxBoxSizer(wxVERTICAL);
m_basic_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_basic_panel->SetBackgroundColour(*wxWHITE);
m_basicl_sizer = new wxBoxSizer(wxHORIZONTAL);
/*basic info*/
//rename normal
m_rename_switch_panel = new wxSimplebook(m_scrollable_region);
m_rename_switch_panel->SetSize(wxSize(FromDIP(420), FromDIP(25)));
m_rename_switch_panel->SetMinSize(wxSize(FromDIP(420), FromDIP(25)));
m_rename_switch_panel->SetMaxSize(wxSize(FromDIP(420), FromDIP(25)));
/*thumbnail*/
auto m_sizer_thumbnail_area = new wxBoxSizer(wxHORIZONTAL);
auto m_panel_image = new wxPanel(m_basic_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_panel_image->SetBackgroundColour(m_colour_def_color);
m_sizer_thumbnail = new wxBoxSizer(wxHORIZONTAL);
m_thumbnailPanel = new ThumbnailPanel(m_panel_image);
m_thumbnailPanel->SetSize(wxSize(FromDIP(198), FromDIP(198)));
m_thumbnailPanel->SetMinSize(wxSize(FromDIP(198), FromDIP(198)));
m_thumbnailPanel->SetMaxSize(wxSize(FromDIP(198), FromDIP(198)));
m_thumbnailPanel->SetBackgroundColour(*wxWHITE);
m_sizer_thumbnail->Add(m_thumbnailPanel, 0, wxALIGN_CENTER, 0);
m_panel_image->SetSizer(m_sizer_thumbnail);
m_panel_image->Layout();
m_sizer_thumbnail_area->Add(m_panel_image, 0, wxALIGN_CENTER, 0);
m_sizer_thumbnail_area->Layout();
/*basic info right*/
auto sizer_basic_right_info = new wxBoxSizer(wxVERTICAL);
/*rename*/
auto sizer_rename = new wxBoxSizer(wxHORIZONTAL);
m_rename_switch_panel = new wxSimplebook(m_basic_panel);
m_rename_switch_panel->SetBackgroundColour(*wxWHITE);
m_rename_switch_panel->SetSize(wxSize(FromDIP(360), FromDIP(25)));
m_rename_switch_panel->SetMinSize(wxSize(FromDIP(360), FromDIP(25)));
m_rename_switch_panel->SetMaxSize(wxSize(FromDIP(360), FromDIP(25)));
m_rename_normal_panel = new wxPanel(m_rename_switch_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_rename_normal_panel->SetBackgroundColour(*wxWHITE);
rename_sizer_v = new wxBoxSizer(wxVERTICAL);
rename_sizer_h = new wxBoxSizer(wxHORIZONTAL);
m_rename_text = new wxStaticText(m_rename_normal_panel, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
m_rename_text = new wxStaticText(m_rename_normal_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
m_rename_text->SetFont(::Label::Body_13);
m_rename_text->SetMaxSize(wxSize(FromDIP(390), -1));
m_rename_button = new ScalableButton(m_rename_normal_panel, wxID_ANY, "ams_editable");
ams_editable = new ScalableBitmap(this, "ams_editable", 13);
ams_editable_light = new ScalableBitmap(this, "ams_editable_light", 13);
m_rename_button->SetBackgroundColour(*wxWHITE);
m_rename_text->SetBackgroundColour(*wxWHITE);
m_rename_text->SetMaxSize(wxSize(FromDIP(340), -1));
rename_editable = new ScalableBitmap(this, "rename_edit", 20);
rename_editable_light = new ScalableBitmap(this, "rename_edit", 20);
m_rename_button = new wxStaticBitmap(m_rename_normal_panel, wxID_ANY, rename_editable->bmp(), wxDefaultPosition, wxSize(FromDIP(20), FromDIP(20)), 0);
m_rename_button->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
m_rename_button->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
rename_sizer_h->Add(m_rename_text, 0, wxALIGN_CENTER, 0);
rename_sizer_h->Add(m_rename_text, 0, wxALIGN_CENTER|wxTOP, FromDIP(2));
rename_sizer_h->Add(m_rename_button, 0, wxALIGN_CENTER, 0);
rename_sizer_v->Add(rename_sizer_h, 1, wxALIGN_CENTER, 0);
rename_sizer_v->Add(rename_sizer_h, 1, wxTOP, 0);
m_rename_normal_panel->SetSizer(rename_sizer_v);
m_rename_normal_panel->Layout();
rename_sizer_v->Fit(m_rename_normal_panel);
//rename edit
auto m_rename_edit_panel = new wxPanel(m_rename_switch_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_rename_edit_panel->SetBackgroundColour(*wxWHITE);
auto rename_edit_sizer_v = new wxBoxSizer(wxVERTICAL);
m_rename_input = new ::TextInput(m_rename_edit_panel, wxEmptyString, wxEmptyString, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
m_rename_input->GetTextCtrl()->SetFont(::Label::Body_13);
m_rename_input->SetSize(wxSize(FromDIP(380), FromDIP(24)));
m_rename_input->SetMinSize(wxSize(FromDIP(380), FromDIP(24)));
m_rename_input->SetMaxSize(wxSize(FromDIP(380), FromDIP(24)));
m_rename_input->SetSize(wxSize(FromDIP(360), FromDIP(24)));
m_rename_input->SetMinSize(wxSize(FromDIP(360), FromDIP(24)));
m_rename_input->SetMaxSize(wxSize(FromDIP(360), FromDIP(24)));
m_rename_input->Bind(wxEVT_TEXT_ENTER, [this](auto& e) {on_rename_enter();});
m_rename_input->Bind(wxEVT_KILL_FOCUS, [this](auto& e) {
if (!m_rename_input->HasFocus() && !m_rename_text->HasFocus())
@ -1038,7 +1064,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
m_rename_edit_panel->Layout();
rename_edit_sizer_v->Fit(m_rename_edit_panel);
m_rename_button->Bind(wxEVT_BUTTON, &SelectMachineDialog::on_rename_click, this);
m_rename_button->Bind(wxEVT_LEFT_DOWN, &SelectMachineDialog::on_rename_click, this);
m_rename_switch_panel->AddPage(m_rename_normal_panel, wxEmptyString, true);
m_rename_switch_panel->AddPage(m_rename_edit_panel, wxEmptyString, false);
@ -1058,91 +1084,124 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
}
});
auto m_sizer_thumbnail_area = new wxBoxSizer(wxHORIZONTAL);
auto last_plate_panel = new wxWindow(m_scrollable_region, wxID_ANY);
last_plate_panel->SetBackgroundColour(*wxWHITE);
auto last_plate_sizer = new wxBoxSizer(wxVERTICAL);
last_plate_panel->SetMinSize(wxSize(FromDIP(32), FromDIP(32)));
m_bitmap_last_plate = new wxStaticBitmap(last_plate_panel, wxID_ANY, create_scaled_bitmap("go_last_plate", this, 32), wxDefaultPosition, wxSize(FromDIP(32), FromDIP(32)), 0);
last_plate_sizer->Add(m_bitmap_last_plate, 0, wxALIGN_CENTER, 0);
last_plate_panel->SetSizer(last_plate_sizer);
m_panel_image = new wxPanel(m_scrollable_region, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_panel_image->SetBackgroundColour(m_colour_def_color);
m_sizer_thumbnail = new wxBoxSizer(wxHORIZONTAL);
m_thumbnailPanel = new ThumbnailPanel(m_panel_image);
m_thumbnailPanel->SetSize(wxSize(FromDIP(256), FromDIP(256)));
m_thumbnailPanel->SetMinSize(wxSize(FromDIP(256), FromDIP(256)));
m_thumbnailPanel->SetMaxSize(wxSize(FromDIP(256), FromDIP(256)));
m_thumbnailPanel->SetBackgroundColour(*wxRED);
m_sizer_thumbnail->Add(m_thumbnailPanel, 0, wxALIGN_CENTER, 0);
m_panel_image->SetSizer(m_sizer_thumbnail);
m_panel_image->Layout();
auto next_plate_panel = new wxWindow(m_scrollable_region, wxID_ANY);
next_plate_panel->SetBackgroundColour(*wxWHITE);
auto next_plate_sizer = new wxBoxSizer(wxVERTICAL);
next_plate_panel->SetMinSize(wxSize(FromDIP(32), FromDIP(32)));
m_bitmap_next_plate = new wxStaticBitmap(next_plate_panel, wxID_ANY, create_scaled_bitmap("go_next_plate", this, 32), wxDefaultPosition, wxSize(FromDIP(32), FromDIP(32)), 0);
next_plate_sizer->Add(m_bitmap_next_plate, 0, wxALIGN_CENTER, 0);
next_plate_panel->SetSizer(next_plate_sizer);
m_sizer_thumbnail_area->Add(last_plate_panel, 0, wxALIGN_CENTER, 0);
m_sizer_thumbnail_area->Add(m_panel_image, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, FromDIP(24));
m_sizer_thumbnail_area->Add(next_plate_panel, 0, wxALIGN_CENTER, 0);
wxBoxSizer *m_sizer_basic = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *m_sizer_basic_weight = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *m_sizer_basic_time = new wxBoxSizer(wxHORIZONTAL);
/*weight & time*/
wxBoxSizer *m_sizer_basic_weight_time = new wxBoxSizer(wxHORIZONTAL);
print_time = new ScalableBitmap(this, "print-time", 18);
timeimg = new wxStaticBitmap(m_scrollable_region, wxID_ANY, print_time->bmp(), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18)), 0);
m_sizer_basic_weight->Add(timeimg, 1, wxEXPAND | wxALL, FromDIP(5));
m_stext_time = new wxStaticText(m_scrollable_region, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
m_sizer_basic_weight->Add(m_stext_time, 0, wxALL, FromDIP(5));
m_sizer_basic->Add(m_sizer_basic_weight, 0, wxALIGN_CENTER, 0);
m_sizer_basic->Add(0, 0, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(30));
timeimg = new wxStaticBitmap(m_basic_panel, wxID_ANY, print_time->bmp(), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18)), 0);
m_stext_time = new Label(m_basic_panel, wxEmptyString);
m_stext_time->SetFont(Label::Body_13);
print_weight = new ScalableBitmap(this, "print-weight", 18);
weightimg = new wxStaticBitmap(m_scrollable_region, wxID_ANY, print_weight->bmp(), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18)), 0);
m_sizer_basic_time->Add(weightimg, 1, wxEXPAND | wxALL, FromDIP(5));
m_stext_weight = new wxStaticText(m_scrollable_region, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
m_sizer_basic_time->Add(m_stext_weight, 0, wxALL, FromDIP(5));
m_sizer_basic->Add(m_sizer_basic_time, 0, wxALIGN_CENTER, 0);
weightimg = new wxStaticBitmap(m_basic_panel, wxID_ANY, print_weight->bmp(), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18)), 0);
m_stext_weight = new Label(m_basic_panel, wxEmptyString);
m_stext_weight->SetFont(Label::Body_13);
wxBoxSizer* m_sizer_material_area = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* m_sizer_material_tips = new wxBoxSizer(wxHORIZONTAL);
m_sizer_basic_weight_time->Add(timeimg, 0, wxALIGN_CENTER, 0);
m_sizer_basic_weight_time->Add(m_stext_time, 0, wxALIGN_CENTER|wxLEFT, FromDIP(6));
m_sizer_basic_weight_time->Add(weightimg, 0, wxALIGN_CENTER|wxLEFT, FromDIP(30));
m_sizer_basic_weight_time->Add(m_stext_weight, 0, wxALIGN_CENTER|wxLEFT, FromDIP(6));
enable_ams_mapping = new ScalableBitmap(this, "enable_ams", 16);
img_amsmapping_tip = new wxStaticBitmap(m_scrollable_region, wxID_ANY, enable_ams_mapping->bmp(), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
m_sizer_material_tips->Add(img_amsmapping_tip, 0, wxALIGN_CENTER | wxLEFT, FromDIP(5));
/*bed type*/
auto m_text_bed_type = new Label(m_basic_panel, "Plate: Textured PEI");
m_text_bed_type->SetFont(Label::Body_13);
img_amsmapping_tip->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {
wxPoint img_pos = img_amsmapping_tip->ClientToScreen(wxPoint(0, 0));
wxPoint popup_pos(img_pos.x, img_pos.y + img_amsmapping_tip->GetRect().height);
m_mapping_tutorial_popup.Position(popup_pos, wxSize(0, 0));
m_mapping_tutorial_popup.Popup();
if (m_mapping_tutorial_popup.ClientToScreen(wxPoint(0, 0)).y < img_pos.y) {
m_mapping_tutorial_popup.Dismiss();
popup_pos = wxPoint(img_pos.x, img_pos.y - m_mapping_tutorial_popup.GetRect().height);
m_mapping_tutorial_popup.Position(popup_pos, wxSize(0, 0));
m_mapping_tutorial_popup.Popup();
}
});
img_amsmapping_tip->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent& e) {
m_mapping_tutorial_popup.Dismiss();
});
m_sizer_material = new wxGridSizer(0, 4, 0, FromDIP(5));
/*last & next page*/
m_sizer_material_area->Add(m_sizer_material_tips, 0, wxALIGN_CENTER|wxLEFT, FromDIP(8));
m_sizer_material_area->Add(m_sizer_material, 0, wxLEFT, FromDIP(15));
auto last_plate_sizer = new wxBoxSizer(wxVERTICAL);
m_bitmap_last_plate = new wxStaticBitmap(m_basic_panel, wxID_ANY, create_scaled_bitmap("go_last_plate", this, 25), wxDefaultPosition, wxSize(FromDIP(25), FromDIP(25)), 0);
last_plate_sizer->Add(m_bitmap_last_plate, 0, wxALIGN_CENTER, 0);
m_sizer_backup = new wxBoxSizer(wxHORIZONTAL);
auto next_plate_sizer = new wxBoxSizer(wxVERTICAL);
m_bitmap_next_plate = new wxStaticBitmap(m_basic_panel, wxID_ANY, create_scaled_bitmap("go_next_plate", this, 25), wxDefaultPosition, wxSize(FromDIP(25), FromDIP(25)), 0);
next_plate_sizer->Add(m_bitmap_next_plate, 0, wxALIGN_CENTER, 0);
sizer_rename->Add(m_rename_switch_panel, 0, wxALIGN_CENTER, 0);
sizer_rename->Add(0, 0, 0, wxEXPAND, 0);
sizer_rename->Add(m_bitmap_last_plate, 0, wxALIGN_CENTER, 0);
sizer_rename->Add(m_bitmap_next_plate, 0, wxALIGN_CENTER, 0);
/*printer combobox*/
wxBoxSizer* m_sizer_printer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* sizer_split_printer = new wxBoxSizer(wxHORIZONTAL);
m_stext_printer_title = new Label(m_basic_panel, _L("Printer"));
m_stext_printer_title->SetFont(::Label::Body_14);
m_stext_printer_title->SetForegroundColour(0x909090);
auto m_split_line = new wxPanel(m_basic_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_split_line->SetBackgroundColour(0xeeeeee);
m_split_line->SetMinSize(wxSize(-1, 1));
m_split_line->SetMaxSize(wxSize(-1, 1));
sizer_split_printer->Add(0, 0, 0, wxEXPAND, 0);
sizer_split_printer->Add(m_stext_printer_title, 0, wxALIGN_CENTER, 0);
sizer_split_printer->Add(m_split_line, 1, wxALIGN_CENTER_VERTICAL, 0);
m_comboBox_printer = new ::ComboBox(m_basic_panel, wxID_ANY, "", wxDefaultPosition, wxSize(FromDIP(300), -1), 0, nullptr, wxCB_READONLY);
m_comboBox_printer->SetMinSize(wxSize(FromDIP(300), -1));
m_comboBox_printer->SetMaxSize(wxSize(FromDIP(300), -1));
m_comboBox_printer->Bind(wxEVT_COMBOBOX, &SelectMachineDialog::on_selection_changed, this);
m_btn_bg_enable = StateColor(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
m_button_refresh = new Button(m_basic_panel, _L("Refresh"));
m_button_refresh->SetBackgroundColor(m_btn_bg_enable);
m_button_refresh->SetBorderColor(m_btn_bg_enable);
m_button_refresh->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_refresh->SetSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_refresh->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_refresh->SetCornerRadius(FromDIP(10));
m_button_refresh->Bind(wxEVT_BUTTON, &SelectMachineDialog::on_refresh, this);
m_sizer_printer->Add(m_comboBox_printer, 0, wxEXPAND, 0);
m_sizer_printer->Add(m_button_refresh, 0, wxALL | wxLEFT, FromDIP(5));
m_text_printer_msg = new wxStaticText(m_basic_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
m_text_printer_msg->SetMinSize(wxSize(FromDIP(420), -1));
m_text_printer_msg->SetMaxSize(wxSize(FromDIP(420), -1));
m_text_printer_msg->SetFont(::Label::Body_13);
m_text_printer_msg->Hide();
sizer_basic_right_info->Add(sizer_rename, 0, wxTOP, 0);
sizer_basic_right_info->Add(0, 0, 0, wxTOP, FromDIP(5));
sizer_basic_right_info->Add(m_sizer_basic_weight_time, 0, wxTOP, 0);
sizer_basic_right_info->Add(0, 0, 0, wxTOP, FromDIP(10));
sizer_basic_right_info->Add(m_text_bed_type, 0, wxTOP, 0);
sizer_basic_right_info->Add(0, 0, 0, wxTOP, FromDIP(15));
sizer_basic_right_info->Add(sizer_split_printer, 1, wxEXPAND, 0);
sizer_basic_right_info->Add(0, 0, 0, wxTOP, FromDIP(8));
sizer_basic_right_info->Add(m_sizer_printer, 0, wxTOP, 0);
sizer_basic_right_info->Add(0, 0, 0, wxTOP, FromDIP(4));
sizer_basic_right_info->Add(m_text_printer_msg, 0, wxLEFT, 0);
m_basicl_sizer->Add(m_sizer_thumbnail_area, 0, wxLEFT, 0);
m_basicl_sizer->Add(0, 0, 0, wxLEFT, FromDIP(8));
m_basicl_sizer->Add(sizer_basic_right_info, 0, wxLEFT, 0);
m_basic_panel->SetSizer(m_basicl_sizer);
m_basic_panel->Layout();
/*filaments info*/
wxBoxSizer* sizer_split_filament = new wxBoxSizer(wxHORIZONTAL);
auto m_stext_filament_title = new Label(this, _L("Filament"));
m_stext_filament_title->SetFont(::Label::Body_14);
m_stext_filament_title->SetForegroundColour(0x909090);
auto m_split_line_filament = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
m_split_line_filament->SetBackgroundColour(0xeeeeee);
m_split_line_filament->SetMinSize(wxSize(-1, 1));
m_split_line_filament->SetMaxSize(wxSize(-1, 1));
m_sizer_autorefill = new wxBoxSizer(wxHORIZONTAL);
m_ams_backup_tip = new Label(this, _L("Auto Refill"));
m_ams_backup_tip->SetFont(::Label::Head_12);
m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42));
@ -1150,9 +1209,9 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
img_ams_backup = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("automatic_material_renewal", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
img_ams_backup->SetBackgroundColour(*wxWHITE);
m_sizer_backup->Add(0, 0, 1, wxEXPAND, 0);
m_sizer_backup->Add(img_ams_backup, 0, wxALL, FromDIP(3));
m_sizer_backup->Add(m_ams_backup_tip, 0, wxTOP, FromDIP(5));
m_sizer_autorefill->Add(0, 0, 1, wxEXPAND, 0);
m_sizer_autorefill->Add(img_ams_backup, 0, wxALL, FromDIP(3));
m_sizer_autorefill->Add(m_ams_backup_tip, 0, wxTOP, FromDIP(5));
m_ams_backup_tip->Hide();
img_ams_backup->Hide();
@ -1163,71 +1222,135 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
m_ams_backup_tip->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
img_ams_backup->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
m_ams_backup_tip->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { if (!m_is_in_sending_mode) {popup_filament_backup(); on_rename_enter();} });
img_ams_backup->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {if (!m_is_in_sending_mode) popup_filament_backup();on_rename_enter(); });
m_ams_backup_tip->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { if (!m_is_in_sending_mode) { popup_filament_backup(); on_rename_enter(); } });
img_ams_backup->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {if (!m_is_in_sending_mode) popup_filament_backup(); on_rename_enter(); });
sizer_split_filament->Add(0, 0, 0, wxEXPAND, 0);
sizer_split_filament->Add(m_stext_filament_title, 0, wxALIGN_CENTER, 0);
sizer_split_filament->Add(m_split_line_filament, 1, wxALIGN_CENTER_VERTICAL, 0);
sizer_split_filament->Add(m_sizer_autorefill, 0, wxALIGN_CENTER, 0);
//wxBoxSizer* m_sizer_ams_mapping_tips = new wxBoxSizer(wxHORIZONTAL);
/* ams_mapping_help_icon = new ScalableBitmap(this, "enable_ams", 16);
img_amsmapping_tip = new wxStaticBitmap(this, wxID_ANY, ams_mapping_help_icon->bmp(), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
m_sizer_ams_mapping_tips->Add(img_amsmapping_tip, 0, wxALIGN_CENTER | wxLEFT, FromDIP(5));
img_amsmapping_tip->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {
wxPoint img_pos = img_amsmapping_tip->ClientToScreen(wxPoint(0, 0));
wxPoint popup_pos(img_pos.x, img_pos.y + img_amsmapping_tip->GetRect().height);
m_mapping_tutorial_popup.Position(popup_pos, wxSize(0, 0));
m_mapping_tutorial_popup.Popup();
if (m_mapping_tutorial_popup.ClientToScreen(wxPoint(0, 0)).y < img_pos.y) {
m_mapping_tutorial_popup.Dismiss();
popup_pos = wxPoint(img_pos.x, img_pos.y - m_mapping_tutorial_popup.GetRect().height);
m_mapping_tutorial_popup.Position(popup_pos, wxSize(0, 0));
m_mapping_tutorial_popup.Popup();
}
});
img_amsmapping_tip->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent& e) {
m_mapping_tutorial_popup.Dismiss();
});
m_sizer_filament->Add(m_sizer_ams_mapping_tips, 0, wxALIGN_CENTER|wxLEFT, FromDIP(8));*/
/*filament area*/
/*1 extruder*/
m_filament_panel = new wxPanel(this, wxID_ANY);
m_filament_panel->SetBackgroundColour(wxColour(0xf8f8f8));
m_filament_panel->SetMinSize(wxSize(FromDIP(637), -1));
m_filament_panel->SetMaxSize(wxSize(FromDIP(637), -1));
m_filament_panel_sizer = new wxBoxSizer(wxVERTICAL);
m_sizer_ams_mapping = new wxGridSizer(0, 10, FromDIP(7), FromDIP(7));
m_filament_panel_sizer->Add(m_sizer_ams_mapping, 0, wxEXPAND|wxALL, FromDIP(10));
m_filament_panel->SetSizer(m_filament_panel_sizer);
m_filament_panel->Layout();
m_filament_panel->Fit();
/*left & right extruder*/
m_sizer_filament_2extruder = new wxBoxSizer(wxHORIZONTAL);
m_filament_left_panel = new wxPanel(this, wxID_ANY);
m_filament_right_panel = new wxPanel(this, wxID_ANY);
m_filament_left_panel->SetBackgroundColour(wxColour(0xf8f8f8));
m_filament_right_panel->SetBackgroundColour(wxColour(0xf8f8f8));
m_filament_left_panel->SetMinSize(wxSize(FromDIP(315), 180));
m_filament_left_panel->SetMaxSize(wxSize(FromDIP(315), 180));
m_filament_right_panel->SetMinSize(wxSize(FromDIP(315), 180));
m_filament_right_panel->SetMaxSize(wxSize(FromDIP(315), 180));
m_filament_panel_left_sizer = new wxBoxSizer(wxVERTICAL);
m_sizer_ams_mapping_left = new wxGridSizer(0, 5, FromDIP(7), FromDIP(7));
m_filament_panel_left_sizer->Add(m_sizer_ams_mapping_left, 0, wxEXPAND | wxALL, FromDIP(10));
m_filament_left_panel->SetSizer(m_filament_panel_left_sizer);
m_filament_left_panel->Layout();
m_filament_left_panel->Fit();
m_filament_panel_right_sizer = new wxBoxSizer(wxVERTICAL);
m_sizer_ams_mapping_right = new wxGridSizer(0, 5, FromDIP(7), FromDIP(7));
m_filament_panel_right_sizer->Add(m_sizer_ams_mapping_right, 0, wxEXPAND | wxALL, FromDIP(10));
m_filament_right_panel->SetSizer(m_filament_panel_right_sizer);
m_filament_right_panel->Layout();
m_filament_right_panel->Fit();
m_sizer_filament_2extruder->Add(m_filament_left_panel, 0, wxALIGN_CENTER, 0);
m_sizer_filament_2extruder->Add(0, 0, 0, wxLEFT, FromDIP(7));
m_sizer_filament_2extruder->Add(m_filament_right_panel, 0, wxALIGN_CENTER, 0);
m_sizer_filament_2extruder->Layout();
m_filament_left_panel->Hide();
m_filament_right_panel->Hide();
m_statictext_ams_msg = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
m_statictext_ams_msg->SetFont(::Label::Body_13);
m_statictext_ams_msg->Hide();
m_line_materia = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
m_line_materia->SetForegroundColour(wxColour(238, 238, 238));
m_line_materia->SetBackgroundColour(wxColour(238, 238, 238));
wxBoxSizer *m_sizer_printer = new wxBoxSizer(wxHORIZONTAL);
m_stext_printer_title = new wxStaticText(this, wxID_ANY, _L("Printer"), wxDefaultPosition, wxSize(-1, -1), 0);
m_stext_printer_title->SetFont(::Label::Head_14);
m_stext_printer_title->Wrap(-1);
m_stext_printer_title->SetForegroundColour(m_colour_bold_color);
m_stext_printer_title->SetBackgroundColour(m_colour_def_color);
/*options*/
wxBoxSizer* sizer_split_options = new wxBoxSizer(wxHORIZONTAL);
auto m_stext_options_title = new Label(this, _L("Print Options"));
m_stext_options_title->SetFont(::Label::Body_14);
m_stext_options_title->SetForegroundColour(0x909090);
auto m_split_options_line = new wxPanel(this, wxID_ANY);
m_split_options_line->SetBackgroundColour(0xeeeeee);
m_split_options_line->SetSize(wxSize(-1, FromDIP(1)));
m_split_options_line->SetMinSize(wxSize(-1, FromDIP(1)));
m_split_options_line->SetMaxSize(wxSize(-1, FromDIP(1)));
sizer_split_options->Add(0, 0, 0, wxEXPAND, 0);
sizer_split_options->Add(m_stext_options_title, 0, wxALIGN_CENTER, 0);
sizer_split_options->Add(m_split_options_line, 1, wxALIGN_CENTER_VERTICAL, 0);
m_sizer_printer->Add(m_stext_printer_title, 0, wxALL | wxLEFT, FromDIP(5));
m_sizer_printer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(12));
m_comboBox_printer = new ::ComboBox(this, wxID_ANY, "", wxDefaultPosition, wxSize(FromDIP(250), -1), 0, nullptr, wxCB_READONLY);
m_comboBox_printer->Bind(wxEVT_COMBOBOX, &SelectMachineDialog::on_selection_changed, this);
m_sizer_printer->Add(m_comboBox_printer, 1, wxEXPAND | wxRIGHT, FromDIP(5));
m_btn_bg_enable = StateColor(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
m_button_refresh = new Button(this, _L("Refresh"));
m_button_refresh->SetBackgroundColor(m_btn_bg_enable);
m_button_refresh->SetBorderColor(m_btn_bg_enable);
m_button_refresh->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_refresh->SetSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_refresh->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_refresh->SetCornerRadius(FromDIP(10));
m_button_refresh->Bind(wxEVT_BUTTON, &SelectMachineDialog::on_refresh, this);
m_sizer_printer->Add(m_button_refresh, 0, wxALL | wxLEFT, FromDIP(5));
m_statictext_printer_msg = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
m_statictext_printer_msg->SetFont(::Label::Body_13);
m_statictext_printer_msg->Hide();
//m_sizer_select = new wxGridSizer(0, 2, 0, 0);
m_sizer_select = new wxWrapSizer();
m_sizer_options = new wxBoxSizer(wxHORIZONTAL);
select_bed = create_item_checkbox(_L("Bed Leveling"), this, _L("Bed Leveling"), "bed_leveling");
select_flow = create_item_checkbox(_L("Flow Dynamics Calibration"), this, _L("Flow Dynamics Calibration"), "flow_cali");
select_timelapse = create_item_checkbox(_L("Timelapse"), this, _L("Timelapse"), "timelapse");
select_use_ams = create_ams_checkbox(_L("Enable AMS"), this, _L("Enable AMS"));
m_sizer_select->Add(select_bed, 0, wxLEFT | wxRIGHT, WRAP_GAP);
m_sizer_select->Add(select_flow, 0, wxLEFT | wxRIGHT, WRAP_GAP);
m_sizer_select->Add(select_timelapse, 0, wxLEFT | wxRIGHT, WRAP_GAP);
m_sizer_select->Add(select_use_ams, 0, wxLEFT | wxRIGHT, WRAP_GAP);
m_sizer_options->Add(select_bed, 0, wxLEFT | wxRIGHT, WRAP_GAP);
m_sizer_options->Add(select_flow, 0, wxLEFT | wxRIGHT, WRAP_GAP);
m_sizer_options->Add(select_timelapse, 0, wxLEFT | wxRIGHT, WRAP_GAP);
m_sizer_options->Add(select_use_ams, 0, wxLEFT | wxRIGHT, WRAP_GAP);
select_bed->Show(false);
select_flow->Show(false);
select_timelapse->Show(false);
select_use_ams->Show(false);
m_sizer_select->Layout();
m_sizer_options->Layout();
// line schedule
m_line_schedule = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1));
m_line_schedule->SetBackgroundColour(wxColour(238, 238, 238));
m_simplebook = new wxSimplebook(this, wxID_ANY, wxDefaultPosition, SELECT_MACHINE_DIALOG_SIMBOOK_SIZE, 0);
@ -1252,7 +1375,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
m_button_ensure->SetSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_ensure->SetMinSize(SELECT_MACHINE_DIALOG_BUTTON_SIZE);
m_button_ensure->SetCornerRadius(FromDIP(12));
m_button_ensure->SetCornerRadius(FromDIP(5));
m_button_ensure->Bind(wxEVT_BUTTON, &SelectMachineDialog::on_ok_btn, this);
m_sizer_pcont->Add(0, 0, 1, wxEXPAND, 0);
@ -1375,37 +1498,25 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
sizer_print_failed_info->Add(0, 0, 0, wxTOP, FromDIP(3));
sizer_print_failed_info->Add(sizer_extra_info, 0, wxLEFT, 5);
m_sizer_scrollable_region->Add(m_rename_switch_panel, 0, wxALIGN_CENTER_HORIZONTAL, 0);
m_sizer_scrollable_region->Add(0, 0, 0, wxTOP, FromDIP(8));
m_sizer_scrollable_region->Add(m_sizer_thumbnail_area, 0, wxALIGN_CENTER_HORIZONTAL, 0);
m_sizer_scrollable_region->Add(0, 0, 0, wxTOP, FromDIP(10));
m_sizer_scrollable_region->Add(m_sizer_basic, 0, wxALIGN_CENTER_HORIZONTAL, 0);
//m_sizer_scrollable_region->Add(m_sizer_material, 0, wxALIGN_CENTER_HORIZONTAL, 0);
m_sizer_scrollable_region->Add(m_sizer_material_area, 0, wxLEFT, FromDIP(10));
//m_basic_panel_sizer->Add(m_sizer_material_area, 0, wxLEFT, FromDIP(10));
m_scrollable_region->SetSizer(m_sizer_scrollable_region);
m_scrollable_region->Layout();
m_scrollable_view->SetSizer(m_sizer_scrollable_view);
m_scrollable_view->Layout();
m_sizer_scrollable_view->Add(m_scrollable_region, 0, wxEXPAND, 0);
m_sizer_main->Add(m_line_top, 0, wxEXPAND, 0);
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(13));
m_sizer_main->Add(m_scrollable_view, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, FromDIP(25));
m_sizer_main->Add(m_sizer_backup, 0, wxALIGN_CENTER_HORIZONTAL, 0);
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(12));
m_sizer_main->Add(m_basic_panel, 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(14));
m_sizer_main->Add(sizer_split_filament, 1, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
m_sizer_main->Add(m_filament_panel, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, FromDIP(15));
m_sizer_main->Add(m_sizer_filament_2extruder, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, FromDIP(15));
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(6));
m_sizer_main->Add(m_statictext_ams_msg, 0, wxALIGN_CENTER_HORIZONTAL, 0);
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(6));
m_sizer_main->Add(m_line_materia, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(30));
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(12));
m_sizer_main->Add(m_sizer_printer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(30));
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(11));
m_sizer_main->Add(m_statictext_printer_msg, 0, wxALIGN_CENTER_HORIZONTAL, 0);
m_sizer_main->Add(0, 1, 0, wxTOP, FromDIP(16));
m_sizer_main->Add(m_sizer_select, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT, FromDIP(30));
m_sizer_main->Add(0, 1, 0, wxTOP, FromDIP(10));
m_sizer_main->Add(m_line_schedule, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(30));
m_sizer_main->Add(m_statictext_ams_msg, 0, wxLEFT, 0);
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(16));
m_sizer_main->Add(sizer_split_options, 1, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
m_sizer_main->Add(m_sizer_options, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT| wxRIGHT, FromDIP(15));
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(10));
m_sizer_main->Add(m_simplebook, 0, wxALIGN_CENTER_HORIZONTAL, 0);
m_sizer_main->Add(m_sw_print_failed_info, 0, wxALIGN_CENTER, 0);
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(18));
@ -1433,7 +1544,7 @@ void SelectMachineDialog::init_bind()
Bind(EVT_SET_FINISH_MAPPING, &SelectMachineDialog::on_set_finish_mapping, this);
Bind(wxEVT_LEFT_DOWN, [this](auto& e) {check_fcous_state(this);e.Skip();});
m_panel_prepare->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {check_fcous_state(this);e.Skip();});
m_scrollable_region->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {check_fcous_state(this);e.Skip();});
m_basic_panel->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {check_fcous_state(this);e.Skip();});
m_bitmap_last_plate->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
m_bitmap_last_plate->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
m_bitmap_next_plate->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
@ -1686,7 +1797,7 @@ void SelectMachineDialog::update_select_layout(MachineObject *obj)
select_timelapse->Hide();
}
m_sizer_select->Layout();
m_sizer_options->Layout();
Layout();
Fit();
}
@ -1916,8 +2027,14 @@ bool SelectMachineDialog::get_ams_mapping_result(std::string &mapping_array_str,
/*new ams mapping data*/
mapping_item_v1["ams_id"] = m_ams_mapping_result[k].ams_id;
mapping_item_v1["slot_id"] = m_ams_mapping_result[k].slot_id;
try
{
mapping_item_v1["ams_id"] = std::stoi(m_ams_mapping_result[k].ams_id);
mapping_item_v1["slot_id"] = std::stoi(m_ams_mapping_result[k].slot_id);
}
catch (...)
{
}
}
}
mapping_v0_json.push_back(tray_id);
@ -1978,12 +2095,12 @@ void SelectMachineDialog::update_ams_status_msg(wxString msg, bool is_warning)
void SelectMachineDialog::update_priner_status_msg(wxString msg, bool is_warning)
{
auto colour = is_warning ? wxColour(0xFF, 0x6F, 0x00) : wxColour(0x6B, 0x6B, 0x6B);
m_statictext_printer_msg->SetForegroundColour(colour);
m_text_printer_msg->SetForegroundColour(colour);
if (msg.empty()) {
if (!m_statictext_printer_msg->GetLabel().empty()) {
m_statictext_printer_msg->SetLabel(wxEmptyString);
m_statictext_printer_msg->Hide();
if (!m_text_printer_msg->GetLabel().empty()) {
m_text_printer_msg->SetLabel(wxEmptyString);
m_text_printer_msg->Hide();
Layout();
Fit();
}
@ -1993,16 +2110,16 @@ void SelectMachineDialog::update_priner_status_msg(wxString msg, bool is_warning
auto str_new = msg.utf8_string();
stripWhiteSpace(str_new);
auto str_old = m_statictext_printer_msg->GetLabel().utf8_string();
auto str_old = m_text_printer_msg->GetLabel().utf8_string();
stripWhiteSpace(str_old);
if (str_new != str_old) {
if (m_statictext_printer_msg->GetLabel() != msg) {
m_statictext_printer_msg->SetLabel(msg);
m_statictext_printer_msg->SetMinSize(wxSize(FromDIP(400), -1));
m_statictext_printer_msg->SetMaxSize(wxSize(FromDIP(400), -1));
m_statictext_printer_msg->Wrap(FromDIP(400));
m_statictext_printer_msg->Show();
if (m_text_printer_msg->GetLabel() != msg) {
m_text_printer_msg->SetLabel(msg);
m_text_printer_msg->SetMinSize(wxSize(FromDIP(420), -1));
m_text_printer_msg->SetMaxSize(wxSize(FromDIP(420), -1));
m_text_printer_msg->Wrap(FromDIP(420));
m_text_printer_msg->Show();
Layout();
Fit();
}
@ -2963,7 +3080,7 @@ void SelectMachineDialog::on_set_finish_mapping(wxCommandEvent &evt)
BOOST_LOG_TRIVIAL(info) << "The ams mapping selection result: data is " << selection_data;
if (selection_data_arr.size() == 6) {
if (selection_data_arr.size() == 8) {
auto ams_colour = wxColour(wxAtoi(selection_data_arr[0]), wxAtoi(selection_data_arr[1]), wxAtoi(selection_data_arr[2]), wxAtoi(selection_data_arr[3]));
int old_filament_id = (int) wxAtoi(selection_data_arr[5]);
if (m_print_type == PrintFromType::FROM_NORMAL) {//todo:support sd card
@ -2995,6 +3112,9 @@ void SelectMachineDialog::on_set_finish_mapping(wxCommandEvent &evt)
m_ams_mapping_result[i].color = color.ToStdString();
m_ams_mapping_result[i].ctype = ctype;
m_ams_mapping_result[i].colors = tray_cols;
m_ams_mapping_result[i].ams_id = selection_data_arr[6].ToStdString();
m_ams_mapping_result[i].slot_id = selection_data_arr[7].ToStdString();
}
BOOST_LOG_TRIVIAL(trace) << "The ams mapping result: id is " << m_ams_mapping_result[i].id << "tray_id is " << m_ams_mapping_result[i].tray_id;
}
@ -3182,7 +3302,7 @@ void SelectMachineDialog::update_user_printer()
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "for send task, current printer id = " << m_printer_last_select << std::endl;
}
void SelectMachineDialog::on_rename_click(wxCommandEvent& event)
void SelectMachineDialog::on_rename_click(wxMouseEvent& event)
{
m_is_rename_mode = true;
m_rename_input->GetTextCtrl()->SetValue(m_current_project_name);
@ -3771,11 +3891,10 @@ void SelectMachineDialog::on_dpi_changed(const wxRect &suggested_rect)
timeimg->SetBitmap(print_time->bmp());
print_weight->msw_rescale();
weightimg->SetBitmap(print_weight->bmp());
m_rename_button->msw_rescale();
ams_editable->msw_rescale();
ams_editable_light->msw_rescale();
enable_ams_mapping->msw_rescale();
img_amsmapping_tip->SetBitmap(enable_ams_mapping->bmp());
rename_editable->msw_rescale();
rename_editable_light->msw_rescale();
ams_mapping_help_icon->msw_rescale();
img_amsmapping_tip->SetBitmap(ams_mapping_help_icon->bmp());
enable_ams->msw_rescale();
img_use_ams_tip->SetBitmap(enable_ams->bmp());
@ -4011,6 +4130,7 @@ void SelectMachineDialog::reset_and_sync_ams_list()
}
m_sizer_material->Clear();
m_sizer_ams_mapping->Clear();
m_materialList.clear();
m_filaments.clear();
@ -4023,8 +4143,8 @@ void SelectMachineDialog::reset_and_sync_ams_list()
auto colour_rgb = wxColour((int) rgb[0], (int) rgb[1], (int) rgb[2], (int) rgb[3]);
if (extruder >= materials.size() || extruder < 0 || extruder >= display_materials.size()) continue;
MaterialItem *item = new MaterialItem(m_scrollable_region, colour_rgb, _L(display_materials[extruder]));
m_sizer_material->Add(item, 0, wxALL, FromDIP(4));
MaterialItem *item = new MaterialItem(m_filament_panel, colour_rgb, _L(display_materials[extruder]));
m_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5));
item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent &e) {});
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent &e) {
@ -4081,12 +4201,16 @@ void SelectMachineDialog::reset_and_sync_ams_list()
}
}
if (extruders.size() <= 4) {
m_sizer_material->SetCols(extruders.size());
} else {
m_sizer_material->SetCols(4);
/*if (extruders.size() <= 10) {
m_sizer_ams_mapping->SetCols(extruders.size());
}
else {
m_sizer_ams_mapping->SetCols(10);
}*/
m_sizer_ams_mapping->SetCols(8);
m_sizer_ams_mapping->Layout();
m_filament_panel_sizer->Layout();
// reset_ams_material();//show "-"
}
@ -4357,16 +4481,12 @@ void SelectMachineDialog::set_default_normal(const ThumbnailData &data)
image.SetAlpha((int)c, (int)r, px[3]);
}
}
image = image.Rescale(FromDIP(256), FromDIP(256));
image = image.Rescale(FromDIP(198), FromDIP(198));
m_thumbnailPanel->set_thumbnail(image);
}
m_scrollable_region->Layout();
m_scrollable_region->Fit();
m_scrollable_view->SetSize(m_scrollable_region->GetSize());
m_scrollable_view->SetMinSize(m_scrollable_region->GetSize());
m_scrollable_view->SetMaxSize(m_scrollable_region->GetSize());
m_basic_panel->Layout();
m_basic_panel->Fit();
//disable pei bed
DeviceManager* dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager();
@ -4378,16 +4498,7 @@ void SelectMachineDialog::set_default_normal(const ThumbnailData &data)
auto dialogSize = this->GetSize();
#ifdef __WINDOWS__
if (screenSize.GetHeight() < dialogSize.GetHeight()) {
m_need_adaptation_screen = true;
m_scrollable_view->SetScrollRate(0, 5);
m_scrollable_view->SetSize(wxSize(-1, FromDIP(220)));
m_scrollable_view->SetMinSize(wxSize(-1, FromDIP(220)));
m_scrollable_view->SetMaxSize(wxSize(-1, FromDIP(220)));
}
else {
m_scrollable_view->SetScrollRate(0, 0);
}
#endif // __WXOSX_MAC__
// basic info
auto aprint_stats = m_plater->get_partplate_list().get_current_fff_print().print_statistics();
@ -4419,7 +4530,7 @@ void SelectMachineDialog::set_default_from_sdcard()
if (data.pixels.size() > 0) {
wxMemoryInputStream mis((unsigned char*)data.pixels.data(), data.pixels.size());
wxImage image = wxImage(mis);
image = image.Rescale(FromDIP(256), FromDIP(256));
image = image.Rescale(FromDIP(198), FromDIP(198));
m_thumbnailPanel->set_thumbnail(image);
}
@ -4446,7 +4557,7 @@ void SelectMachineDialog::set_default_from_sdcard()
}
m_ams_mapping_result.clear();
m_sizer_material->Clear();
m_sizer_ams_mapping->Clear();
m_materialList.clear();
m_filaments.clear();
@ -4454,8 +4565,8 @@ void SelectMachineDialog::set_default_from_sdcard()
for (auto i = 0; i < m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info.size(); i++) {
FilamentInfo fo = m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info[i];
MaterialItem* item = new MaterialItem(m_scrollable_region, wxColour(fo.color), fo.type);
m_sizer_material->Add(item, 0, wxALL, FromDIP(4));
MaterialItem* item = new MaterialItem(m_filament_panel, wxColour(fo.color), fo.type);
m_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5));
item->Bind(wxEVT_LEFT_UP, [this, item, materials](wxMouseEvent& e) {});
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, fo](wxMouseEvent& e) {
@ -4512,38 +4623,21 @@ void SelectMachineDialog::set_default_from_sdcard()
}
if (m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info.size() <= 4) {
m_sizer_material->SetCols(m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info.size());
m_sizer_ams_mapping->SetCols(m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info.size());
}
else {
m_sizer_material->SetCols(4);
m_sizer_ams_mapping->SetCols(4);
}
m_scrollable_region->Layout();
m_scrollable_region->Fit();
m_basic_panel->Layout();
m_basic_panel->Fit();
m_scrollable_view->SetSize(m_scrollable_region->GetSize());
m_scrollable_view->SetMinSize(m_scrollable_region->GetSize());
m_scrollable_view->SetMaxSize(m_scrollable_region->GetSize());
set_flow_calibration_state(true);
wxSize screenSize = wxGetDisplaySize();
auto dialogSize = this->GetSize();
#ifdef __WINDOWS__
if (screenSize.GetHeight() < dialogSize.GetHeight()) {
m_need_adaptation_screen = true;
m_scrollable_view->SetScrollRate(0, 5);
m_scrollable_view->SetSize(wxSize(-1, FromDIP(220)));
m_scrollable_view->SetMinSize(wxSize(-1, FromDIP(220)));
m_scrollable_view->SetMaxSize(wxSize(-1, FromDIP(220)));
}
else {
m_scrollable_view->SetScrollRate(0, 0);
}
#endif // __WXOSX_MAC__
reset_ams_material();
// basic info
@ -4562,32 +4656,32 @@ void SelectMachineDialog::set_default_from_sdcard()
void SelectMachineDialog::update_page_turn_state(bool show)
{
m_bitmap_last_plate->Show(show);
m_bitmap_next_plate->Show(show);
/* m_bitmap_last_plate->Show(show);
m_bitmap_next_plate->Show(show);
if (show) {
if (m_print_plate_idx <= 0) { m_bitmap_last_plate->Hide(); }
else { m_bitmap_last_plate->Show(); }
if (show) {
if (m_print_plate_idx <= 0) { m_bitmap_last_plate->Hide(); }
else { m_bitmap_last_plate->Show(); }
if ((m_print_plate_idx + 1) >= m_print_plate_total) { m_bitmap_next_plate->Hide(); }
else { m_bitmap_next_plate->Show(); }
if ((m_print_plate_idx + 1) >= m_print_plate_total) { m_bitmap_next_plate->Hide(); }
else { m_bitmap_next_plate->Show(); }
if (m_print_plate_total == 1) {
m_bitmap_last_plate->Show(false);
m_bitmap_next_plate->Show(false);
}
}
if (m_print_plate_total == 1) {
m_bitmap_last_plate->Show(false);
m_bitmap_next_plate->Show(false);
}
}*/
}
void SelectMachineDialog::sys_color_changed()
{
if (wxGetApp(). dark_mode()) {
//rename_button->SetIcon("ams_editable_light");
m_rename_button->SetBitmap(ams_editable_light->bmp());
m_rename_button->SetBitmap(rename_editable_light->bmp());
}
else {
m_rename_button->SetBitmap(ams_editable->bmp());
m_rename_button->SetBitmap(rename_editable->bmp());
}
m_rename_button->Refresh();
}

View File

@ -345,7 +345,6 @@ private:
bool m_is_in_sending_mode{ false };
bool m_ams_mapping_res{ false };
bool m_ams_mapping_valid{ false };
bool m_need_adaptation_screen{ false };
bool m_export_3mf_cancel{ false };
bool m_is_canceled{ false };
bool m_is_rename_mode{ false };
@ -382,18 +381,17 @@ protected:
AmsTutorialPopup m_mapping_tutorial_popup{ nullptr };
MaterialHash m_materialList;
Plater * m_plater{nullptr};
wxWrapSizer* m_sizer_select{ nullptr };
wxBoxSizer* m_sizer_options{ nullptr };
wxBoxSizer* m_sizer_thumbnail{ nullptr };
wxGridSizer* m_sizer_material{ nullptr };
wxBoxSizer* m_sizer_main{ nullptr };
wxBoxSizer* m_sizer_scrollable_view{ nullptr };
wxBoxSizer* m_sizer_scrollable_region{ nullptr };
wxBoxSizer* m_basicl_sizer{ nullptr };
wxBoxSizer* rename_sizer_v{ nullptr };
wxBoxSizer* rename_sizer_h{ nullptr };
wxBoxSizer* m_sizer_backup{ nullptr };
wxBoxSizer* m_sizer_autorefill{ nullptr };
Button* m_button_refresh{ nullptr };
Button* m_button_ensure{ nullptr };
ScalableButton * m_rename_button{nullptr};
wxStaticBitmap * m_rename_button{nullptr};
ComboBox* m_comboBox_printer{ nullptr };
wxStaticBitmap* m_staticbitmap{ nullptr };
wxStaticBitmap* m_bitmap_last_plate{ nullptr };
@ -405,15 +403,12 @@ protected:
wxWindow* select_timelapse{ nullptr };
wxWindow* select_use_ams{ nullptr };
wxPanel* m_panel_status{ nullptr };
wxPanel* m_scrollable_region;
wxPanel* m_basic_panel;
wxPanel* m_rename_normal_panel{nullptr};
wxPanel* m_line_schedule{nullptr};
wxPanel* m_panel_sending{nullptr};
wxPanel* m_panel_prepare{nullptr};
wxPanel* m_panel_finish{nullptr};
wxPanel* m_line_top{ nullptr };
wxPanel* m_panel_image{ nullptr };
wxPanel* m_line_materia{ nullptr };
Label* m_st_txt_error_code{nullptr};
Label* m_st_txt_error_desc{nullptr};
Label* m_st_txt_extra_info{nullptr};
@ -422,27 +417,26 @@ protected:
wxSimplebook* m_rename_switch_panel{nullptr};
wxSimplebook* m_simplebook{nullptr};
wxStaticText* m_rename_text{nullptr};
wxStaticText* m_stext_printer_title{nullptr};
wxStaticText* m_stext_time{ nullptr };
wxStaticText* m_stext_weight{ nullptr };
Label* m_stext_printer_title{nullptr};
Label* m_stext_time{ nullptr };
Label* m_stext_weight{ nullptr };
wxStaticText* m_statictext_ams_msg{ nullptr };
wxStaticText* m_statictext_printer_msg{ nullptr };
wxStaticText* 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::shared_ptr<PrintJob> m_print_job;
wxScrolledWindow* m_scrollable_view;
wxScrolledWindow* m_sw_print_failed_info{nullptr};
wxHyperlinkCtrl* m_hyperlink{nullptr};
ScalableBitmap * ams_editable{nullptr};
ScalableBitmap * ams_editable_light{nullptr};
ScalableBitmap * rename_editable{nullptr};
ScalableBitmap * rename_editable_light{nullptr};
wxStaticBitmap * timeimg{nullptr};
ScalableBitmap * print_time{nullptr};
wxStaticBitmap * weightimg{nullptr};
ScalableBitmap * print_weight{nullptr};
ScalableBitmap * enable_ams_mapping{nullptr};
ScalableBitmap * ams_mapping_help_icon{nullptr};
wxStaticBitmap * img_use_ams_tip{nullptr};
wxStaticBitmap * img_ams_backup{nullptr};
ScalableBitmap * enable_ams{nullptr};
@ -453,6 +447,19 @@ protected:
std::vector<wxColour> m_cur_colors_in_thumbnail;
std::vector<bool> m_edge_pixels;
wxPanel* m_filament_panel;
wxPanel* m_filament_left_panel;
wxPanel* 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:
SelectMachineDialog(Plater *plater = nullptr);
~SelectMachineDialog();
@ -476,7 +483,7 @@ public:
void reset_ams_material();
void update_show_status();
void update_ams_check(MachineObject* obj);
void on_rename_click(wxCommandEvent& event);
void on_rename_click(wxMouseEvent& event);
void on_rename_enter();
void update_printer_combobox(wxCommandEvent& event);
void on_cancel(wxCloseEvent& event);