根据材料判断可显示内容。Gcode代码研究。其他bug修复
This commit is contained in:
parent
b04c4bbf55
commit
67099d8e5d
File diff suppressed because it is too large
Load Diff
|
@ -940,7 +940,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->enum_labels.emplace_back(L("No-brim"));
|
||||
|
||||
def->mode = comSimple;
|
||||
def->set_default_value(new ConfigOptionEnum<BrimType>(btAutoBrim));
|
||||
def->set_default_value(new ConfigOptionEnum<BrimType>(btOuterOnly));
|
||||
|
||||
def = this->add("brim_object_gap", coFloat);
|
||||
def->label = L("Brim-object gap");
|
||||
|
@ -1163,11 +1163,11 @@ void PrintConfigDef::init_fff_params()
|
|||
def->enum_values.push_back("monotonicline");
|
||||
def->enum_values.push_back("alignedrectilinear");
|
||||
//xiamian-
|
||||
//def->enum_values.push_back("hilbertcurve");
|
||||
//def->enum_values.push_back("archimedeanchords");
|
||||
//def->enum_values.push_back("octagramspiral");
|
||||
def->enum_values.push_back("hilbertcurve");
|
||||
def->enum_values.push_back("archimedeanchords");
|
||||
def->enum_values.push_back("octagramspiral");
|
||||
//xiamian+
|
||||
def->enum_values.push_back("fiberspiral");
|
||||
//def->enum_values.push_back("fiberspiral");
|
||||
|
||||
def->enum_labels.push_back(L("Concentric"));
|
||||
def->enum_labels.push_back(L("Rectilinear"));
|
||||
|
@ -1175,11 +1175,11 @@ void PrintConfigDef::init_fff_params()
|
|||
def->enum_labels.push_back(L("Monotonic line"));
|
||||
def->enum_labels.push_back(L("Aligned Rectilinear"));
|
||||
//xiamian-
|
||||
//def->enum_labels.push_back(L("Hilbert Curve"));
|
||||
//def->enum_labels.push_back(L("Archimedean Chords"));
|
||||
//def->enum_labels.push_back(L("Octagram Spiral"));
|
||||
def->enum_labels.push_back(L("Hilbert Curve"));
|
||||
def->enum_labels.push_back(L("Archimedean Chords"));
|
||||
def->enum_labels.push_back(L("Octagram Spiral"));
|
||||
//xiamian+
|
||||
def->enum_labels.push_back(L("Fiber Spiral"));
|
||||
//def->enum_labels.push_back(L("Fiber Spiral"));
|
||||
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipRectilinear));
|
||||
|
||||
def = this->add("bottom_surface_pattern", coEnum);
|
||||
|
@ -1618,14 +1618,14 @@ void PrintConfigDef::init_fff_params()
|
|||
def->enum_values.push_back("alignedrectilinear");
|
||||
def->enum_values.push_back("3dhoneycomb");
|
||||
//xiamian-
|
||||
//def->enum_values.push_back("hilbertcurve");
|
||||
//def->enum_values.push_back("archimedeanchords");
|
||||
//def->enum_values.push_back("octagramspiral");
|
||||
def->enum_values.push_back("hilbertcurve");
|
||||
def->enum_values.push_back("archimedeanchords");
|
||||
def->enum_values.push_back("octagramspiral");
|
||||
def->enum_values.push_back("supportcubic");
|
||||
def->enum_values.push_back("lightning");
|
||||
def->enum_values.push_back("crosshatch");
|
||||
//xiamian+
|
||||
def->enum_values.push_back("fiberspiral");
|
||||
//def->enum_values.push_back("fiberspiral");
|
||||
def->enum_labels.push_back(L("Concentric"));
|
||||
def->enum_labels.push_back(L("Rectilinear"));
|
||||
def->enum_labels.push_back(L("Grid"));
|
||||
|
@ -1639,15 +1639,15 @@ void PrintConfigDef::init_fff_params()
|
|||
def->enum_labels.push_back(L("Aligned Rectilinear"));
|
||||
def->enum_labels.push_back(L("3D Honeycomb"));
|
||||
//xiamian-
|
||||
//def->enum_labels.push_back(L("Hilbert Curve"));
|
||||
//def->enum_labels.push_back(L("Archimedean Chords"));
|
||||
//def->enum_labels.push_back(L("Octagram Spiral"));
|
||||
def->enum_labels.push_back(L("Hilbert Curve"));
|
||||
def->enum_labels.push_back(L("Archimedean Chords"));
|
||||
def->enum_labels.push_back(L("Octagram Spiral"));
|
||||
def->enum_labels.push_back(L("Support Cubic"));
|
||||
def->enum_labels.push_back(L("Lightning"));
|
||||
def->enum_labels.push_back(L("Cross Hatch"));
|
||||
//xiamian+
|
||||
def->enum_labels.push_back(L("Fiber Spiral"));
|
||||
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipCubic));
|
||||
//def->enum_labels.push_back(L("Fiber Spiral"));
|
||||
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipGrid));
|
||||
|
||||
def = this->add("top_surface_acceleration", coFloat);
|
||||
def->label = L("Top surface");
|
||||
|
@ -1776,8 +1776,18 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("Height of initial layer. Making initial layer height thick slightly can improve build plate adhension");
|
||||
def->sidetext = L("mm");
|
||||
def->min = 0;
|
||||
//def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(0.2));
|
||||
|
||||
//def = this->add("initial_layer_print_height", coFloat);
|
||||
//def->label = L("Initial layer height");
|
||||
//def->category = L("Quality");
|
||||
//def->tooltip = L("Height of initial layer. Making initial layer height thick slightly can improve build plate adhension");
|
||||
//def->sidetext = L("mm");
|
||||
//def->min = 0;
|
||||
//def->mode = comSimple;
|
||||
//def->set_default_value(new ConfigOptionFloat(0.2));
|
||||
|
||||
//def = this->add("adaptive_layer_height", coBool);
|
||||
//def->label = L("Adaptive layer height");
|
||||
//def->category = L("Quality");
|
||||
|
@ -1788,7 +1798,7 @@ void PrintConfigDef::init_fff_params()
|
|||
|
||||
def = this->add("default_print_speed", coFloat);
|
||||
def->label = L("Default print speed");
|
||||
def->tooltip = L("Speed of initial layer except the solid infill part");
|
||||
//def->tooltip = L("Speed of initial layer except the solid infill part");
|
||||
def->sidetext = L("mm/s");
|
||||
def->min = 0;
|
||||
def->mode = comAdvanced;
|
||||
|
@ -1857,6 +1867,16 @@ void PrintConfigDef::init_fff_params()
|
|||
def->mode = comSimple;
|
||||
def->set_default_value(new ConfigOptionFloat(0.3));
|
||||
|
||||
def = this->add("fibre_feed_rate", coFloat);
|
||||
def->label = L("Fibre feed rate");
|
||||
def->category = L("Others");
|
||||
//def->tooltip = L("The width within which to jitter. It's adversed to be below outer wall line width");
|
||||
def->sidetext = L("mm");
|
||||
def->min = 0;
|
||||
def->max = 1;
|
||||
def->mode = comSimple;
|
||||
def->set_default_value(new ConfigOptionFloat(0.3));
|
||||
|
||||
def = this->add("fuzzy_skin_point_distance", coFloat);
|
||||
def->label = L("Fuzzy skin point distance");
|
||||
def->category = L("Others");
|
||||
|
@ -3007,7 +3027,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->min = 0;
|
||||
def->max = 10;
|
||||
def->mode = comSimple;
|
||||
def->set_default_value(new ConfigOptionInt(1));
|
||||
def->set_default_value(new ConfigOptionInt(2));
|
||||
|
||||
def = this->add("slow_down_layer_time", coInts);
|
||||
def->label = L("Layer time");
|
||||
|
@ -3956,6 +3976,25 @@ void PrintConfigDef::init_fff_params()
|
|||
" Otherwise, rectilinear pattern is used defaultly.");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBool(true));
|
||||
|
||||
|
||||
//def = this->add("temp_fiber_pattern", coEnum);
|
||||
//def->enum_keys_map = &ConfigOptionEnum<InfillPattern>::get_enum_values();
|
||||
//def->enum_values.push_back("concentric");
|
||||
//def->enum_values.push_back("zig-zag");
|
||||
//def->enum_values.push_back("monotonic");
|
||||
//def->enum_values.push_back("monotonicline");
|
||||
//def->enum_values.push_back("alignedrectilinear");
|
||||
//def->enum_values.push_back("fiberspiral");
|
||||
|
||||
//def->enum_labels.push_back(L("Concentric"));
|
||||
//def->enum_labels.push_back(L("Rectilinear"));
|
||||
//def->enum_labels.push_back(L("Monotonic"));
|
||||
//def->enum_labels.push_back(L("Monotonic line"));
|
||||
//def->enum_labels.push_back(L("Aligned Rectilinear"));
|
||||
//def->enum_labels.push_back(L("Fiber Spiral"));
|
||||
//def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipRectilinear));
|
||||
|
||||
}
|
||||
|
||||
void PrintConfigDef::init_extruder_option_keys()
|
||||
|
|
|
@ -326,16 +326,9 @@ public:
|
|||
}
|
||||
}
|
||||
wxBitmap new_ground(groundImage);
|
||||
/* wxMask* mask = new wxMask(new_ground, *wxWHITE);
|
||||
wxMemoryDC memDC(mask->GetBitmap());
|
||||
wxBrush brush(*wxWHITE);
|
||||
memDC.SetBrush(brush);
|
||||
memDC.SetPen(*wxTRANSPARENT_PEN);
|
||||
int radius = 20;
|
||||
memDC.DrawRoundedRectangle(0, 0, groundWidth, groundHeight, radius);
|
||||
new_ground.SetMask(mask);*/
|
||||
|
||||
memDc.DrawBitmap(new_ground, 0, 50, true);
|
||||
//memDc.SelectObject(wxNullBitmap);
|
||||
|
||||
BitmapCache logo_cache;
|
||||
|
||||
|
@ -357,17 +350,34 @@ public:
|
|||
int split_width = (width + title_width - version_width) / 2;
|
||||
wxRect title_rect(wxPoint(150, 300), wxPoint(400,450));
|
||||
//memDc.SetTextForeground(StateColor::darkModeColorFor(wxColour(38, 46, 48)));
|
||||
memDc.SetTextForeground(StateColor::darkModeColorFor(wxColour(0, 0, 0)));
|
||||
memDc.SetFont(m_constant_text.title_font);
|
||||
//memDc.SetTextForeground(StateColor::darkModeColorFor(wxColour(0, 0, 0,255)));
|
||||
//memDc.SetFont(m_constant_text.title_font);
|
||||
//memDc.SetTextBackground(*wxBLACK);
|
||||
//memDc.DrawLabel(m_constant_text.title, title_rect, wxALIGN_RIGHT | wxALIGN_BOTTOM);
|
||||
memDc.DrawLabel(_L("Ui title"), title_rect, wxALIGN_CENTER_VERTICAL);
|
||||
//memDc.DrawLabel(_L("Ui title"), title_rect, wxALIGN_CENTER_VERTICAL);
|
||||
//memDc.DrawText(_L("Ui title"), 150, 300);
|
||||
//BBS align bottom of title and version text
|
||||
//wxRect version_rect(wxPoint(split_width + text_padding, top_margin), wxPoint(width, top_margin + title_height - text_padding));
|
||||
wxRect version_rect(wxPoint(50,550), wxPoint(300,550));
|
||||
memDc.SetFont(m_constant_text.version_font);
|
||||
memDc.SetTextForeground(StateColor::darkModeColorFor(wxColor(134, 134, 134)));
|
||||
memDc.DrawLabel(m_constant_text.version, version_rect, wxALIGN_LEFT | wxALIGN_BOTTOM);
|
||||
//memDc.SetFont(m_constant_text.version_font);
|
||||
//memDc.SetTextForeground(StateColor::darkModeColorFor(wxColor(0, 0, 0,255)));
|
||||
//memDc.SetTextForeground(*wxBLACK);
|
||||
//memDc.SetTextBackground(StateColor::darkModeColorFor(wxColor(0, 0, 0,255)));
|
||||
//memDc.SetTextBackground(*wxBLACK);
|
||||
//memDc.DrawLabel(m_constant_text.version, version_rect, wxALIGN_LEFT | wxALIGN_BOTTOM);
|
||||
//memDc.DrawText(m_constant_text.version, 50, 500);
|
||||
//version_title.svg
|
||||
BitmapCache version_cache;
|
||||
wxBitmap version_bmp = *version_cache.load_svg("version_title", FromDIP(600), FromDIP(600));
|
||||
memDc.DrawBitmap(version_bmp, 50, 500, false);
|
||||
|
||||
BitmapCache title_cache;
|
||||
wxBitmap title_bmp = *title_cache.load_svg("ui_title", FromDIP(600), FromDIP(600));
|
||||
memDc.DrawBitmap(title_bmp, 50, 350, false);
|
||||
|
||||
BitmapCache config_cache;
|
||||
wxBitmap config_bmp = *config_cache.load_svg("config_title", FromDIP(550), FromDIP(550));
|
||||
memDc.DrawBitmap(config_bmp, 515, 600, false);
|
||||
// draw title and version
|
||||
//int text_padding = FromDIP(3 * m_scale);
|
||||
//memDc.SetFont(m_constant_text.title_font);
|
||||
|
@ -402,6 +412,7 @@ public:
|
|||
//#endif
|
||||
// load bitmap for logo
|
||||
BitmapCache bmp_cache;
|
||||
|
||||
int logo_margin = FromDIP(72 * m_scale);
|
||||
int logo_size = FromDIP(122 * m_scale);
|
||||
int logo_width = FromDIP(94 * m_scale);
|
||||
|
@ -409,6 +420,7 @@ public:
|
|||
int logo_y = top_margin + title_rect.GetHeight() + logo_margin;
|
||||
memDc.DrawBitmap(logo_bmp, 900, 0, true);
|
||||
|
||||
|
||||
// calculate position for the dynamic text
|
||||
int text_margin = FromDIP(80 * m_scale);
|
||||
m_action_line_y_position = logo_y + logo_size + text_margin;
|
||||
|
@ -419,90 +431,93 @@ public:
|
|||
int width = FromDIP(1000, nullptr);
|
||||
int height = FromDIP(550, nullptr);
|
||||
|
||||
/*wxImage image(width, height);111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
|
||||
wxBitmap new_bmp(image);2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
|
||||
333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
|
||||
wxMemoryDC memDC;41234444444444444444444444444444444444344444444444444444555555555555555555555555555555555555555555555555555555555555555555555555555
|
||||
memDC.SelectObject(new_bmp);12344444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
|
||||
memDC.SetBrush(StateColor::darkModeColorFor(wxColor(0, 157, 244,128)));2341324132444444444444444444444444444444444444444444444444444444444444444442
|
||||
memDC.DrawRectangle(-1, -1, width + 2, height + 2);23411111111111111111111111111111111111111111111111111111111111111111111111111111111121341234234
|
||||
memDC.DrawBitmap(new_bmp, 0, 0, true);*/
|
||||
// StateColor::darkModeColorFor(wxColor(0, 157, 244)
|
||||
//fangfa1
|
||||
/* wxImage image(width, height, true);
|
||||
unsigned char* alpha = image.GetAlpha();
|
||||
if (alpha) {
|
||||
for (int i = 0; i < width * height; ++i) {
|
||||
alpha[i] = 0;
|
||||
}
|
||||
}
|
||||
/*wxImage image(width, height);
|
||||
wxBitmap new_bmp(image);
|
||||
|
||||
wxMemoryDC memDC;
|
||||
memDC.SelectObject(new_bmp);
|
||||
wxBrush brush(wxColor(254, 254, 254, 128));
|
||||
memDC.SetBrush(brush);
|
||||
memDC.SetBrush(StateColor::darkModeColorFor(*wxWHITE));
|
||||
memDC.DrawRectangle(-1, -1, width + 2, height + 2);
|
||||
memDC.DrawBitmap(new_bmp, 0, 0, true);*/
|
||||
|
||||
//fangfa2
|
||||
//wxBitmap new_bmp(width, height, 32);
|
||||
//wxImage image(width, height);
|
||||
//wxBitmap new_bmp(image);
|
||||
//wxMemoryDC memDC;
|
||||
//memDC.SelectObject(new_bmp);
|
||||
//memDC.SetBackground(*wxTRANSPARENT_BRUSH);
|
||||
//memDC.Clear();
|
||||
//wxGraphicsContext* gc = wxGraphicsContext::Create(memDC);
|
||||
//if (gc) {
|
||||
// gc->SetAntialiasMode(wxANTIALIAS_DEFAULT);
|
||||
// //wxColour semiTransparent(255, 255, 255, 128);
|
||||
// //gc->SetBrush(semiTransparent);
|
||||
// gc->DrawRectangle(0, 0, width, height);
|
||||
// delete gc;
|
||||
//}
|
||||
//fangfa3
|
||||
/*wxBitmap bitmap(width, height,32);
|
||||
{
|
||||
wxMemoryDC dc(bitmap);
|
||||
dc.SetBackground(*wxTRANSPARENT_BRUSH);
|
||||
dc.Clear();
|
||||
}
|
||||
{
|
||||
wxMemoryDC dc(bitmap);
|
||||
dc.SetBackground(*wxTRANSPARENT_BRUSH);
|
||||
dc.Clear();
|
||||
dc.SetPen(wxPen(wxColour(255, 0, 0, 128)));
|
||||
dc.SetBrush(wxBrush(wxColour(255, 0, 0, 128)));
|
||||
dc.DrawRectangle(0, 0, width, height);
|
||||
}*/
|
||||
|
||||
/* wxBitmap mask(100, 100);
|
||||
wxMemoryDC maskDC(mask);
|
||||
maskDC.SetBackground(*wxWHITE_BRUSH);
|
||||
maskDC.Clear();
|
||||
maskDC.SetPen(wxPen(wxColour(0, 0, 0)));
|
||||
maskDC.SetBrush(wxBrush(wxColour(0, 0, 0)));
|
||||
maskDC.DrawRectangle(0, 0, width, height);
|
||||
|
||||
bitmap.SetMask(new wxMask(mask, wxColour(0, 0, 0)));*/
|
||||
|
||||
//wxBitmap bitmap(width, height, 24);
|
||||
////wxBitmap bitmap("back.png", wxBITMAP_TYPE_PNG);
|
||||
//wxMemoryDC memDC;
|
||||
//memDC.SelectObject(bitmap);
|
||||
|
||||
//memDC.SetBackground(*wxWHITE_BRUSH);
|
||||
//memDC.Clear();
|
||||
//wxImage image = bitmap.ConvertToImage();
|
||||
//memDC.SetBrush(*wxWHITE_BRUSH);
|
||||
//wxMask* mask = new wxMask(new_bmp, *wxWHITE); // Make cyan areas transparent
|
||||
//new_bmp.SetMask(mask);
|
||||
//memDC.DrawRectangle(-1, -1, width + 2, height + 2);
|
||||
//memDC.DrawBitmap(new_bmp, 0, 0, true);
|
||||
/*
|
||||
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
|
||||
22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
|
||||
3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
|
||||
44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
|
||||
555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
|
||||
666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
|
||||
77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
|
||||
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
|
||||
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
|
||||
22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
|
||||
3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
|
||||
44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
|
||||
555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
|
||||
666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
|
||||
77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
|
||||
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
|
||||
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
|
||||
22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
|
||||
3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
|
||||
44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
|
||||
555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
|
||||
666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
|
||||
77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
|
||||
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
|
||||
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
|
||||
22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
|
||||
3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
|
||||
44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
|
||||
555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
|
||||
666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
|
||||
77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
|
||||
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
|
||||
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
|
||||
22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
|
||||
3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
|
||||
44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
|
||||
555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
|
||||
666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
|
||||
77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
|
||||
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
|
||||
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
|
||||
22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
|
||||
3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
|
||||
44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
|
||||
555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
|
||||
666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
|
||||
77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
|
||||
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
|
||||
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
*/
|
||||
|
||||
|
||||
//image.SetMask(true);
|
||||
//image.SetMaskColour(255,255,255);
|
||||
//bitmap = wxBitmap(image);
|
||||
//BitmapCache bmp_cache;
|
||||
//*bmp_cache.load_png
|
||||
wxBitmap new_bmp("E:\\Code\\Projects\\BambuStudio\\resources\\images\\back1234.png", wxBITMAP_TYPE_PNG);
|
||||
new_bmp.SetHeight(height);
|
||||
new_bmp.SetWidth(width);
|
||||
//wxBitmap new_bmp("D:\\Code\\Projects\\BambuStudio\\resources\\images\\back123.png", wxBITMAP_TYPE_PNG);
|
||||
BitmapCache new_cache;
|
||||
wxBitmap new_bmp = *new_cache.load_png("back123", width, height);
|
||||
//new_bmp.SetHeight(height);
|
||||
//new_bmp.SetWidth(width);
|
||||
return new_bmp;
|
||||
}
|
||||
|
||||
|
@ -2783,8 +2798,12 @@ bool GUI_App::on_init_inner()
|
|||
#ifndef __linux__
|
||||
wxYield();
|
||||
#endif
|
||||
//scrn->SetBackgroundColour(wxColor(0,0,0,0));
|
||||
//scrn->SetBackgroundColour(wxColor(0,0,0,255));
|
||||
//scrn->SetForegroundColour(wxColor(0, 0, 0, 255));
|
||||
//scrn->SetForegroundColour(*wxBLACK);
|
||||
scrn->SetText(_L("Loading configuration")+ dots);
|
||||
//scrn->SetBackgroundColour(wxColor(0,0,0,255));
|
||||
//scrn->SetForegroundColour(wxColor(0, 0, 0, 255));
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << "loading systen presets...";
|
||||
|
|
|
@ -0,0 +1,689 @@
|
|||
#ifndef slic3r_GUI_App_hpp_
|
||||
#define slic3r_GUI_App_hpp_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "ImGuiWrapper.hpp"
|
||||
#include "ConfigWizard.hpp"
|
||||
#include "OpenGLManager.hpp"
|
||||
#include "libslic3r/Preset.hpp"
|
||||
#include "libslic3r/PresetBundle.hpp"
|
||||
#include "libslic3r/Color.hpp"
|
||||
#include "slic3r/GUI/DeviceManager.hpp"
|
||||
#include "slic3r/GUI/UserNotification.hpp"
|
||||
#include "slic3r/Utils/NetworkAgent.hpp"
|
||||
#include "slic3r/GUI/WebViewDialog.hpp"
|
||||
#include "slic3r/GUI/WebUserLoginDialog.hpp"
|
||||
#include "slic3r/GUI/BindDialog.hpp"
|
||||
#include "slic3r/GUI/HMS.hpp"
|
||||
#include "slic3r/GUI/Jobs/UpgradeNetworkJob.hpp"
|
||||
#include "slic3r/GUI/HttpServer.hpp"
|
||||
#include "../Utils/PrintHost.hpp"
|
||||
|
||||
#include <wx/app.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/snglinst.h>
|
||||
#include <wx/msgdlg.h>
|
||||
|
||||
#include <mutex>
|
||||
#include <stack>
|
||||
|
||||
//#define BBL_HAS_FIRST_PAGE 1
|
||||
#define STUDIO_INACTIVE_TIMEOUT 15*60*1000
|
||||
#define LOG_FILES_MAX_NUM 30
|
||||
#define TIMEOUT_CONNECT 15
|
||||
#define TIMEOUT_RESPONSE 15
|
||||
|
||||
#define BE_UNACTED_ON 0x00200001
|
||||
#define SHOW_BACKGROUND_BITMAP_PIXEL_THRESHOLD 80
|
||||
#ifndef _MSW_DARK_MODE
|
||||
#define _MSW_DARK_MODE 1
|
||||
#endif // _MSW_DARK_MODE
|
||||
|
||||
class wxMenuItem;
|
||||
class wxMenuBar;
|
||||
class wxTopLevelWindow;
|
||||
class wxDataViewCtrl;
|
||||
class wxBookCtrlBase;
|
||||
// BBS
|
||||
class Notebook;
|
||||
struct wxLanguageInfo;
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
class AppConfig;
|
||||
class PresetBundle;
|
||||
class PresetUpdater;
|
||||
class ModelObject;
|
||||
class Model;
|
||||
class UserManager;
|
||||
class DeviceManager;
|
||||
class NetworkAgent;
|
||||
class TaskManager;
|
||||
|
||||
namespace GUI{
|
||||
|
||||
class RemovableDriveManager;
|
||||
class OtherInstanceMessageHandler;
|
||||
class MainFrame;
|
||||
class Sidebar;
|
||||
class ObjectSettings;
|
||||
class ObjectList;
|
||||
class ObjectLayers;
|
||||
class Plater;
|
||||
class ParamsPanel;
|
||||
class NotificationManager;
|
||||
struct GUI_InitParams;
|
||||
class ParamsDialog;
|
||||
class HMSQuery;
|
||||
class ModelMallDialog;
|
||||
class PingCodeBindDialog;
|
||||
|
||||
|
||||
enum FileType
|
||||
{
|
||||
FT_STEP,
|
||||
FT_STL,
|
||||
FT_OBJ,
|
||||
FT_AMF,
|
||||
FT_3MF,
|
||||
FT_GCODE_3MF,
|
||||
FT_GCODE,
|
||||
FT_MODEL,
|
||||
FT_PROJECT,
|
||||
FT_GALLERY,
|
||||
|
||||
FT_INI,
|
||||
FT_SVG,
|
||||
|
||||
FT_TEX,
|
||||
|
||||
FT_SL1,
|
||||
|
||||
FT_SIZE,
|
||||
};
|
||||
|
||||
extern wxString file_wildcards(FileType file_type, const std::string &custom_extension = std::string{});
|
||||
|
||||
enum ConfigMenuIDs {
|
||||
//ConfigMenuWizard,
|
||||
//ConfigMenuSnapshots,
|
||||
//ConfigMenuTakeSnapshot,
|
||||
//ConfigMenuUpdate,
|
||||
//ConfigMenuDesktopIntegration,
|
||||
ConfigMenuPreferences,
|
||||
ConfigMenuPrinter,
|
||||
//ConfigMenuModeSimple,
|
||||
//ConfigMenuModeAdvanced,
|
||||
//ConfigMenuLanguage,
|
||||
//ConfigMenuFlashFirmware,
|
||||
ConfigMenuCnt,
|
||||
};
|
||||
|
||||
enum BambuStudioMenuIDs {
|
||||
BambuStudioMenuAbout,
|
||||
BambuStudioMenuPreferences,
|
||||
};
|
||||
|
||||
enum CameraMenuIDs {
|
||||
wxID_CAMERA_PERSPECTIVE,
|
||||
wxID_CAMERA_ORTHOGONAL,
|
||||
wxID_CAMERA_COUNT,
|
||||
};
|
||||
|
||||
|
||||
class Tab;
|
||||
class ConfigWizard;
|
||||
class GizmoObjectManipulation;
|
||||
|
||||
static wxString dots("...", wxConvUTF8);
|
||||
|
||||
// Does our wxWidgets version support markup?
|
||||
#if wxUSE_MARKUP && wxCHECK_VERSION(3, 1, 1)
|
||||
#define SUPPORTS_MARKUP
|
||||
#endif
|
||||
|
||||
|
||||
#define VERSION_LEN 4
|
||||
class VersionInfo
|
||||
{
|
||||
public:
|
||||
std::string version_str;
|
||||
std::string version_name;
|
||||
std::string description;
|
||||
std::string url;
|
||||
bool force_upgrade{ false };
|
||||
int ver_items[VERSION_LEN]; // AA.BB.CC.DD
|
||||
VersionInfo() {
|
||||
for (int i = 0; i < VERSION_LEN; i++) {
|
||||
ver_items[i] = 0;
|
||||
}
|
||||
force_upgrade = false;
|
||||
version_str = "";
|
||||
}
|
||||
|
||||
void parse_version_str(std::string str) {
|
||||
version_str = str;
|
||||
std::vector<std::string> items;
|
||||
boost::split(items, str, boost::is_any_of("."));
|
||||
if (items.size() == VERSION_LEN) {
|
||||
try {
|
||||
for (int i = 0; i < VERSION_LEN; i++) {
|
||||
ver_items[i] = stoi(items[i]);
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
static std::string convert_full_version(std::string short_version);
|
||||
static std::string convert_short_version(std::string full_version);
|
||||
static std::string get_full_version() {
|
||||
return convert_full_version(SLIC3R_VERSION);
|
||||
}
|
||||
|
||||
/* return > 0, need update */
|
||||
int compare(std::string ver_str) {
|
||||
if (version_str.empty()) return -1;
|
||||
|
||||
int ver_target[VERSION_LEN];
|
||||
std::vector<std::string> items;
|
||||
boost::split(items, ver_str, boost::is_any_of("."));
|
||||
if (items.size() == VERSION_LEN) {
|
||||
try {
|
||||
for (int i = 0; i < VERSION_LEN; i++) {
|
||||
ver_target[i] = stoi(items[i]);
|
||||
if (ver_target[i] < ver_items[i]) {
|
||||
return 1;
|
||||
}
|
||||
else if (ver_target[i] == ver_items[i]) {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
class GUI_App : public wxApp
|
||||
{
|
||||
public:
|
||||
|
||||
//BBS: remove GCodeViewer as seperate APP logic
|
||||
enum class EAppMode : unsigned char
|
||||
{
|
||||
Editor,
|
||||
GCodeViewer
|
||||
};
|
||||
|
||||
private:
|
||||
bool m_initialized { false };
|
||||
bool m_post_initialized { false };
|
||||
bool m_app_conf_exists{ false };
|
||||
EAppMode m_app_mode{ EAppMode::Editor };
|
||||
bool m_is_recreating_gui{ false };
|
||||
#ifdef __linux__
|
||||
bool m_opengl_initialized{ false };
|
||||
#endif
|
||||
|
||||
//import model from mall
|
||||
wxString m_download_file_url;
|
||||
|
||||
//#ifdef _WIN32
|
||||
wxColour m_color_label_modified;
|
||||
wxColour m_color_label_sys;
|
||||
wxColour m_color_label_default;
|
||||
wxColour m_color_window_default;
|
||||
wxColour m_color_highlight_label_default;
|
||||
wxColour m_color_hovered_btn_label;
|
||||
wxColour m_color_default_btn_label;
|
||||
wxColour m_color_highlight_default;
|
||||
wxColour m_color_selected_btn_bg;
|
||||
bool m_force_colors_update { false };
|
||||
//#endif
|
||||
|
||||
wxFont m_small_font;
|
||||
wxFont m_bold_font;
|
||||
wxFont m_normal_font;
|
||||
wxFont m_code_font;
|
||||
wxFont m_link_font;
|
||||
|
||||
int m_em_unit; // width of a "m"-symbol in pixels for current system font
|
||||
// Note: for 100% Scale m_em_unit = 10 -> it's a good enough coefficient for a size setting of controls
|
||||
|
||||
std::unique_ptr<wxLocale> m_wxLocale;
|
||||
// System language, from locales, owned by wxWidgets.
|
||||
const wxLanguageInfo *m_language_info_system = nullptr;
|
||||
// Best translation language, provided by Windows or OSX, owned by wxWidgets.
|
||||
const wxLanguageInfo *m_language_info_best = nullptr;
|
||||
|
||||
OpenGLManager m_opengl_mgr;
|
||||
std::unique_ptr<RemovableDriveManager> m_removable_drive_manager;
|
||||
|
||||
std::unique_ptr<ImGuiWrapper> m_imgui;
|
||||
std::unique_ptr<PrintHostJobQueue> m_printhost_job_queue;
|
||||
std::unique_ptr <OtherInstanceMessageHandler> m_other_instance_message_handler;
|
||||
std::unique_ptr <wxSingleInstanceChecker> m_single_instance_checker;
|
||||
std::string m_instance_hash_string;
|
||||
size_t m_instance_hash_int;
|
||||
|
||||
//BBS
|
||||
bool m_is_closing {false};
|
||||
Slic3r::DeviceManager* m_device_manager { nullptr };
|
||||
Slic3r::UserManager* m_user_manager { nullptr };
|
||||
Slic3r::TaskManager* m_task_manager { nullptr };
|
||||
NetworkAgent* m_agent { nullptr };
|
||||
std::vector<std::string> need_delete_presets; // store setting ids of preset
|
||||
std::vector<bool> m_create_preset_blocked { false, false, false, false, false, false }; // excceed limit
|
||||
bool m_networking_compatible { false };
|
||||
bool m_networking_need_update { false };
|
||||
bool m_networking_cancel_update { false };
|
||||
std::shared_ptr<UpgradeNetworkJob> m_upgrade_network_job;
|
||||
|
||||
// login widget
|
||||
ZUserLogin* login_dlg { nullptr };
|
||||
|
||||
VersionInfo version_info;
|
||||
VersionInfo privacy_version_info;
|
||||
static std::string version_display;
|
||||
HMSQuery *hms_query { nullptr };
|
||||
|
||||
boost::thread m_sync_update_thread;
|
||||
std::shared_ptr<int> m_user_sync_token;
|
||||
bool m_is_dark_mode{ false };
|
||||
bool m_adding_script_handler { false };
|
||||
bool m_side_popup_status{false};
|
||||
bool m_show_http_errpr_msgdlg{false};
|
||||
wxString m_info_dialog_content;
|
||||
HttpServer m_http_server;
|
||||
|
||||
boost::thread m_check_network_thread;
|
||||
public:
|
||||
//try again when subscription fails
|
||||
void on_start_subscribe_again(std::string dev_id);
|
||||
void check_filaments_in_blacklist(std::string tag_supplier, std::string tag_material, bool& in_blacklist, std::string& action, std::string& info);
|
||||
std::string get_local_models_path();
|
||||
bool OnInit() override;
|
||||
int OnExit() override;
|
||||
bool initialized() const { return m_initialized; }
|
||||
inline bool is_enable_multi_machine() { return this->app_config&& this->app_config->get("enable_multi_machine") == "true"; }
|
||||
|
||||
std::map<std::string, bool> test_url_state;
|
||||
|
||||
//BBS: remove GCodeViewer as seperate APP logic
|
||||
explicit GUI_App();
|
||||
//explicit GUI_App(EAppMode mode = EAppMode::Editor);
|
||||
~GUI_App() override;
|
||||
|
||||
bool get_app_conf_exists() { return m_app_conf_exists; }
|
||||
void show_message_box(std::string msg) { wxMessageBox(msg); }
|
||||
EAppMode get_app_mode() const { return m_app_mode; }
|
||||
Slic3r::DeviceManager* getDeviceManager() { return m_device_manager; }
|
||||
Slic3r::TaskManager* getTaskManager() { return m_task_manager; }
|
||||
HMSQuery* get_hms_query() { return hms_query; }
|
||||
NetworkAgent* getAgent() { return m_agent; }
|
||||
bool is_editor() const { return m_app_mode == EAppMode::Editor; }
|
||||
bool is_gcode_viewer() const { return m_app_mode == EAppMode::GCodeViewer; }
|
||||
bool is_recreating_gui() const { return m_is_recreating_gui; }
|
||||
std::string logo_name() const { return is_editor() ? "BambuStudio" : "BambuStudio-gcodeviewer"; }
|
||||
wxString get_inf_dialog_contect () {return m_info_dialog_content;};
|
||||
|
||||
std::vector<std::string> split_str(std::string src, std::string separator);
|
||||
// To be called after the GUI is fully built up.
|
||||
// Process command line parameters cached in this->init_params,
|
||||
// load configs, STLs etc.
|
||||
void post_init();
|
||||
void shutdown();
|
||||
// If formatted for github, plaintext with OpenGL extensions enclosed into <details>.
|
||||
// Otherwise HTML formatted for the system info dialog.
|
||||
static std::string get_gl_info(bool for_github);
|
||||
wxGLContext* init_glcontext(wxGLCanvas& canvas);
|
||||
bool init_opengl();
|
||||
|
||||
void init_download_path();
|
||||
static unsigned get_colour_approx_luma(const wxColour& colour);
|
||||
static bool dark_mode();
|
||||
const wxColour get_label_default_clr_system();
|
||||
const wxColour get_label_default_clr_modified();
|
||||
void init_label_colours();
|
||||
void update_label_colours_from_appconfig();
|
||||
void update_publish_status();
|
||||
bool has_model_mall();
|
||||
void update_label_colours();
|
||||
// update color mode for window
|
||||
void UpdateDarkUI(wxWindow *window, bool highlited = false, bool just_font = false);
|
||||
void UpdateDarkUIWin(wxWindow* win);
|
||||
void Update_dark_mode_flag();
|
||||
// update color mode for whole dialog including all children
|
||||
void UpdateDlgDarkUI(wxDialog* dlg);
|
||||
void UpdateFrameDarkUI(wxFrame* dlg);
|
||||
// update color mode for DataViewControl
|
||||
void UpdateDVCDarkUI(wxDataViewCtrl* dvc, bool highlited = false);
|
||||
// update color mode for panel including all static texts controls
|
||||
void UpdateAllStaticTextDarkUI(wxWindow* parent);
|
||||
void init_fonts();
|
||||
void update_fonts(const MainFrame *main_frame = nullptr);
|
||||
void set_label_clr_modified(const wxColour& clr);
|
||||
void set_label_clr_sys(const wxColour& clr);
|
||||
//update side popup status
|
||||
bool get_side_menu_popup_status();
|
||||
void set_side_menu_popup_status(bool status);
|
||||
void link_to_network_check();
|
||||
|
||||
|
||||
const wxColour& get_label_clr_modified(){ return m_color_label_modified; }
|
||||
const wxColour& get_label_clr_sys() { return m_color_label_sys; }
|
||||
const wxColour& get_label_clr_default() { return m_color_label_default; }
|
||||
const wxColour& get_window_default_clr(){ return m_color_window_default; }
|
||||
|
||||
// BBS
|
||||
//#ifdef _WIN32
|
||||
const wxColour& get_label_highlight_clr() { return m_color_highlight_label_default; }
|
||||
const wxColour& get_highlight_default_clr() { return m_color_highlight_default; }
|
||||
const wxColour& get_color_hovered_btn_label() { return m_color_hovered_btn_label; }
|
||||
const wxColour& get_color_selected_btn_bg() { return m_color_selected_btn_bg; }
|
||||
void force_colors_update();
|
||||
#ifdef _MSW_DARK_MODE
|
||||
void force_menu_update();
|
||||
#endif //_MSW_DARK_MODE
|
||||
//#endif
|
||||
|
||||
const wxFont& small_font() { return m_small_font; }
|
||||
const wxFont& bold_font() { return m_bold_font; }
|
||||
const wxFont& normal_font() { return m_normal_font; }
|
||||
const wxFont& code_font() { return m_code_font; }
|
||||
const wxFont& link_font() { return m_link_font; }
|
||||
int em_unit() const { return m_em_unit; }
|
||||
bool tabs_as_menu() const;
|
||||
wxSize get_min_size() const;
|
||||
float toolbar_icon_scale(const bool is_limited = false) const;
|
||||
void set_auto_toolbar_icon_scale(float scale) const;
|
||||
void check_printer_presets();
|
||||
|
||||
void recreate_GUI(const wxString& message);
|
||||
void system_info();
|
||||
void keyboard_shortcuts();
|
||||
void load_project(wxWindow *parent, wxString& input_file) const;
|
||||
void import_model(wxWindow *parent, wxArrayString& input_files) const;
|
||||
void load_gcode(wxWindow* parent, wxString& input_file) const;
|
||||
|
||||
wxString transition_tridid(int trid_id);
|
||||
void ShowUserGuide();
|
||||
void ShowDownNetPluginDlg();
|
||||
void ShowUserLogin(bool show = true);
|
||||
void ShowOnlyFilament();
|
||||
//BBS
|
||||
void request_login(bool show_user_info = false);
|
||||
bool check_login();
|
||||
void get_login_info();
|
||||
bool is_user_login();
|
||||
|
||||
void request_user_login(int online_login = 0);
|
||||
void request_user_handle(int online_login = 0);
|
||||
void request_user_logout();
|
||||
int request_user_unbind(std::string dev_id);
|
||||
std::string handle_web_request(std::string cmd);
|
||||
void handle_script_message(std::string msg);
|
||||
void request_model_download(wxString url);
|
||||
void download_project(std::string project_id);
|
||||
void request_project_download(std::string project_id);
|
||||
void request_open_project(std::string project_id);
|
||||
void request_remove_project(std::string project_id);
|
||||
|
||||
void handle_http_error(unsigned int status, std::string body);
|
||||
void on_http_error(wxCommandEvent &evt);
|
||||
void on_set_selected_machine(wxCommandEvent& evt);
|
||||
void on_update_machine_list(wxCommandEvent& evt);
|
||||
void on_user_login(wxCommandEvent &evt);
|
||||
void on_user_login_handle(wxCommandEvent& evt);
|
||||
void enable_user_preset_folder(bool enable);
|
||||
|
||||
// BBS
|
||||
bool is_studio_active();
|
||||
void reset_to_active();
|
||||
bool m_studio_active = true;
|
||||
std::chrono::system_clock::time_point last_active_point;
|
||||
|
||||
void check_update(bool show_tips, int by_user);
|
||||
void check_new_version(bool show_tips = false, int by_user = 0);
|
||||
void request_new_version(int by_user);
|
||||
void enter_force_upgrade();
|
||||
void set_skip_version(bool skip = true);
|
||||
void no_new_version();
|
||||
static std::string format_display_version();
|
||||
std::string format_IP(const std::string& ip);
|
||||
void show_dialog(wxString msg);
|
||||
void push_notification(wxString msg, wxString title = wxEmptyString, UserNotificationStyle style = UserNotificationStyle::UNS_NORMAL);
|
||||
void reload_settings();
|
||||
void remove_user_presets();
|
||||
void sync_preset(Preset* preset);
|
||||
void start_sync_user_preset(bool with_progress_dlg = false);
|
||||
void stop_sync_user_preset();
|
||||
void start_http_server();
|
||||
void stop_http_server();
|
||||
void switch_staff_pick(bool on);
|
||||
|
||||
void on_show_check_privacy_dlg(int online_login = 0);
|
||||
void show_check_privacy_dlg(wxCommandEvent& evt);
|
||||
void on_check_privacy_update(wxCommandEvent &evt);
|
||||
bool check_privacy_update();
|
||||
void check_privacy_version(int online_login = 0);
|
||||
void check_track_enable();
|
||||
|
||||
static bool catch_error(std::function<void()> cb, const std::string& err);
|
||||
|
||||
void persist_window_geometry(wxTopLevelWindow *window, bool default_maximized = false);
|
||||
void update_ui_from_settings();
|
||||
|
||||
bool switch_language();
|
||||
bool load_language(wxString language, bool initial);
|
||||
|
||||
Tab* get_tab(Preset::Type type);
|
||||
Tab* get_plate_tab();
|
||||
Tab* get_model_tab(bool part = false);
|
||||
Tab* get_layer_tab();
|
||||
ConfigOptionMode get_mode();
|
||||
std::string get_mode_str();
|
||||
void save_mode(const /*ConfigOptionMode*/int mode) ;
|
||||
void update_mode();
|
||||
void update_internal_development();
|
||||
void show_ip_address_enter_dialog(wxString title = wxEmptyString);
|
||||
void show_ip_address_enter_dialog_handler(wxCommandEvent &evt);
|
||||
bool show_modal_ip_address_enter_dialog(wxString title = wxEmptyString);
|
||||
|
||||
// BBS
|
||||
//void add_config_menu(wxMenuBar *menu);
|
||||
//void add_config_menu(wxMenu* menu);
|
||||
bool has_unsaved_preset_changes() const;
|
||||
bool has_current_preset_changes() const;
|
||||
void update_saved_preset_from_current_preset();
|
||||
std::vector<std::pair<unsigned int, std::string>> get_selected_presets() const;
|
||||
bool check_and_save_current_preset_changes(const wxString& caption, const wxString& header, bool remember_choice = true, bool use_dont_save_insted_of_discard = false);
|
||||
void apply_keeped_preset_modifications();
|
||||
bool check_and_keep_current_preset_changes(const wxString& caption, const wxString& header, int action_buttons, bool* postponed_apply_of_keeped_changes = nullptr);
|
||||
bool can_load_project();
|
||||
bool check_print_host_queue();
|
||||
bool checked_tab(Tab* tab);
|
||||
//BBS: add preset combox re-active logic
|
||||
void load_current_presets(bool active_preset_combox = false, bool check_printer_presets = true);
|
||||
std::vector<std::string> &get_delete_cache_presets();
|
||||
std::vector<std::string> get_delete_cache_presets_lock();
|
||||
void delete_preset_from_cloud(std::string setting_id);
|
||||
void preset_deleted_from_cloud(std::string setting_id);
|
||||
|
||||
wxString filter_string(wxString str);
|
||||
wxString current_language_code() const { return m_wxLocale->GetCanonicalName(); }
|
||||
// Translate the language code to a code, for which Prusa Research maintains translations. Defaults to "en_US".
|
||||
wxString current_language_code_safe() const;
|
||||
bool is_localized() const { return m_wxLocale->GetLocale() != "English"; }
|
||||
|
||||
void open_preferences(size_t open_on_tab = 0, const std::string& highlight_option = std::string());
|
||||
|
||||
virtual bool OnExceptionInMainLoop() override;
|
||||
// Calls wxLaunchDefaultBrowser if user confirms in dialog.
|
||||
bool open_browser_with_warning_dialog(const wxString& url, int flags = 0);
|
||||
#ifdef __APPLE__
|
||||
void OSXStoreOpenFiles(const wxArrayString &files);
|
||||
// wxWidgets override to get an event on open files.
|
||||
void MacOpenFiles(const wxArrayString &fileNames) override;
|
||||
void MacOpenURL(const wxString& url) override;
|
||||
#endif /* __APPLE */
|
||||
|
||||
Sidebar& sidebar();
|
||||
GizmoObjectManipulation *obj_manipul();
|
||||
ObjectSettings* obj_settings();
|
||||
ObjectList* obj_list();
|
||||
ObjectLayers* obj_layers();
|
||||
Plater* plater();
|
||||
const Plater* plater() const;
|
||||
ParamsPanel* params_panel();
|
||||
ParamsDialog* params_dialog();
|
||||
Model& model();
|
||||
NotificationManager * notification_manager();
|
||||
|
||||
|
||||
std::string m_mall_model_download_url;
|
||||
std::string m_mall_model_download_name;
|
||||
ModelMallDialog* m_mall_publish_dialog{ nullptr };
|
||||
PingCodeBindDialog* m_ping_code_binding_dialog{ nullptr };
|
||||
|
||||
void set_download_model_url(std::string url) {m_mall_model_download_url = url;}
|
||||
void set_download_model_name(std::string name) {m_mall_model_download_name = name;}
|
||||
std::string get_download_model_url() {return m_mall_model_download_url;}
|
||||
std::string get_download_model_name() {return m_mall_model_download_name;}
|
||||
|
||||
void load_url(wxString url);
|
||||
void open_mall_page_dialog();
|
||||
void open_publish_page_dialog();
|
||||
void remove_mall_system_dialog();
|
||||
void run_script(wxString js);
|
||||
void run_script_left(wxString js);
|
||||
bool is_adding_script_handler() { return m_adding_script_handler; }
|
||||
void set_adding_script_handler(bool status) { m_adding_script_handler = status; }
|
||||
|
||||
char from_hex(char ch);
|
||||
std::string url_encode(std::string value);
|
||||
std::string url_decode(std::string value);
|
||||
|
||||
void popup_ping_bind_dialog();
|
||||
void remove_ping_bind_dialog();
|
||||
|
||||
// Parameters extracted from the command line to be passed to GUI after initialization.
|
||||
GUI_InitParams* init_params { nullptr };
|
||||
|
||||
AppConfig* app_config{ nullptr };
|
||||
PresetBundle* preset_bundle{ nullptr };
|
||||
PresetUpdater* preset_updater{ nullptr };
|
||||
MainFrame* mainframe{ nullptr };
|
||||
Plater* plater_{ nullptr };
|
||||
|
||||
PresetUpdater* get_preset_updater() { return preset_updater; }
|
||||
|
||||
Notebook* tab_panel() const ;
|
||||
int extruders_cnt() const;
|
||||
int extruders_edited_cnt() const;
|
||||
|
||||
// BBS
|
||||
int filaments_cnt() const;
|
||||
PrintSequence global_print_sequence() const;
|
||||
|
||||
std::vector<Tab *> tabs_list;
|
||||
std::vector<Tab *> model_tabs_list;
|
||||
Tab* plate_tab;
|
||||
|
||||
RemovableDriveManager* removable_drive_manager() { return m_removable_drive_manager.get(); }
|
||||
OtherInstanceMessageHandler* other_instance_message_handler() { return m_other_instance_message_handler.get(); }
|
||||
wxSingleInstanceChecker* single_instance_checker() {return m_single_instance_checker.get();}
|
||||
|
||||
void init_single_instance_checker(const std::string &name, const std::string &path);
|
||||
void set_instance_hash (const size_t hash) { m_instance_hash_int = hash; m_instance_hash_string = std::to_string(hash); }
|
||||
std::string get_instance_hash_string () { return m_instance_hash_string; }
|
||||
size_t get_instance_hash_int () { return m_instance_hash_int; }
|
||||
|
||||
ImGuiWrapper* imgui() { return m_imgui.get(); }
|
||||
|
||||
PrintHostJobQueue& printhost_job_queue() { return *m_printhost_job_queue.get(); }
|
||||
|
||||
void open_web_page_localized(const std::string &http_address);
|
||||
bool may_switch_to_SLA_preset(const wxString& caption);
|
||||
bool run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage start_page = ConfigWizard::SP_WELCOME);
|
||||
void show_desktop_integration_dialog();
|
||||
|
||||
#if ENABLE_THUMBNAIL_GENERATOR_DEBUG
|
||||
// temporary and debug only -> extract thumbnails from selected gcode and save them as png files
|
||||
void gcode_thumbnails_debug();
|
||||
#endif // ENABLE_THUMBNAIL_GENERATOR_DEBUG
|
||||
|
||||
OpenGLManager& get_opengl_manager() { return m_opengl_mgr; }
|
||||
GLShaderProgram* get_shader(const std::string& shader_name) { return m_opengl_mgr.get_shader(shader_name); }
|
||||
GLShaderProgram* get_current_shader() { return m_opengl_mgr.get_current_shader(); }
|
||||
|
||||
bool is_gl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const { return m_opengl_mgr.get_gl_info().is_version_greater_or_equal_to(major, minor); }
|
||||
bool is_glsl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const { return m_opengl_mgr.get_gl_info().is_glsl_version_greater_or_equal_to(major, minor); }
|
||||
int GetSingleChoiceIndex(const wxString& message, const wxString& caption, const wxArrayString& choices, int initialSelection);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// extend is stl/3mf/gcode/step etc
|
||||
void associate_files(std::wstring extend);
|
||||
void disassociate_files(std::wstring extend);
|
||||
#endif // __WXMSW__
|
||||
std::string get_plugin_url(std::string name, std::string country_code);
|
||||
int download_plugin(std::string name, std::string package_name, InstallProgressFn pro_fn = nullptr, WasCancelledFn cancel_fn = nullptr);
|
||||
int install_plugin(std::string name, std::string package_name, InstallProgressFn pro_fn = nullptr, WasCancelledFn cancel_fn = nullptr);
|
||||
std::string get_http_url(std::string country_code, std::string path = {});
|
||||
std::string get_model_http_url(std::string country_code);
|
||||
bool is_compatibility_version();
|
||||
bool check_networking_version();
|
||||
void cancel_networking_install();
|
||||
void restart_networking();
|
||||
void check_config_updates_from_updater() { check_updates(false); }
|
||||
|
||||
private:
|
||||
int updating_bambu_networking();
|
||||
bool on_init_inner();
|
||||
void copy_network_if_available();
|
||||
bool on_init_network(bool try_backup = false);
|
||||
void init_networking_callbacks();
|
||||
void init_app_config();
|
||||
void remove_old_networking_plugins();
|
||||
//BBS set extra header for http request
|
||||
std::map<std::string, std::string> get_extra_header();
|
||||
void init_http_extra_header();
|
||||
void update_http_extra_header();
|
||||
bool check_older_app_config(Semver current_version, bool backup);
|
||||
void copy_older_config();
|
||||
void window_pos_save(wxTopLevelWindow* window, const std::string &name);
|
||||
bool window_pos_restore(wxTopLevelWindow* window, const std::string &name, bool default_maximized = false);
|
||||
void window_pos_sanitize(wxTopLevelWindow* window);
|
||||
void window_pos_center(wxTopLevelWindow *window);
|
||||
bool select_language();
|
||||
|
||||
bool config_wizard_startup();
|
||||
void check_updates(const bool verbose);
|
||||
|
||||
bool m_init_app_config_from_older { false };
|
||||
bool m_datadir_redefined { false };
|
||||
std::string m_older_data_dir_path;
|
||||
boost::optional<Semver> m_last_config_version;
|
||||
std::string m_open_method;
|
||||
};
|
||||
|
||||
DECLARE_APP(GUI_App)
|
||||
wxDECLARE_EVENT(EVT_CONNECT_LAN_MODE_PRINT, wxCommandEvent);
|
||||
|
||||
bool is_support_filament(int extruder_id);
|
||||
} // namespace GUI
|
||||
} // Slic3r
|
||||
|
||||
#endif // slic3r_GUI_App_hpp_
|
|
@ -0,0 +1,178 @@
|
|||
#ifndef slic3r_params_panel_hpp_
|
||||
#define slic3r_params_panel_hpp_
|
||||
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/tglbtn.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/scrolwin.h>
|
||||
#include <wx/timer.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/wupdlock.h>
|
||||
|
||||
#include "wxExtensions.hpp"
|
||||
#include "GUI_Utils.hpp"
|
||||
#include "Widgets/Button.hpp"
|
||||
|
||||
class SwitchButton;
|
||||
class StaticBox;
|
||||
|
||||
#define TIPS_DIALOG_BUTTON_SIZE wxSize(FromDIP(60), FromDIP(24))
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class TipsDialog : public DPIDialog
|
||||
{
|
||||
private:
|
||||
bool m_show_again{false};
|
||||
std::string m_app_key;
|
||||
|
||||
public:
|
||||
TipsDialog(wxWindow *parent, const wxString &title, const wxString &description, std::string app_key = "");
|
||||
Button *m_confirm{nullptr};
|
||||
Button *m_cancel{nullptr};
|
||||
wxPanel *m_top_line{nullptr};
|
||||
wxStaticText *m_msg;
|
||||
|
||||
protected:
|
||||
void on_dpi_changed(const wxRect &suggested_rect) override;
|
||||
void on_ok(wxMouseEvent &event);
|
||||
wxBoxSizer *create_item_checkbox(wxString title, wxWindow *parent, wxString tooltip, std::string param);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class ParamsPanel
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class ParamsPanel : public wxPanel
|
||||
{
|
||||
#if __WXOSX__
|
||||
wxWindow* m_tmp_panel;
|
||||
int m_size_move = -1;
|
||||
#endif // __WXOSX__
|
||||
|
||||
private:
|
||||
void free_sizers();
|
||||
void delete_subwindows();
|
||||
void refresh_tabs();
|
||||
|
||||
protected:
|
||||
wxBoxSizer* m_top_sizer { nullptr };
|
||||
wxBoxSizer* m_left_sizer { nullptr };
|
||||
wxBoxSizer* m_mode_sizer { nullptr };
|
||||
// // BBS: new layout
|
||||
StaticBox* m_top_panel{ nullptr };
|
||||
ScalableButton* m_process_icon{ nullptr };
|
||||
wxStaticText* m_title_label { nullptr };
|
||||
SwitchButton* m_mode_region { nullptr };
|
||||
ScalableButton *m_tips_arrow{nullptr};
|
||||
bool m_tips_arror_blink{false};
|
||||
wxStaticText* m_title_view { nullptr };
|
||||
SwitchButton* m_mode_view { nullptr };
|
||||
//wxBitmapButton* m_search_button { nullptr };
|
||||
wxStaticLine* m_staticline_print { nullptr };
|
||||
//wxBoxSizer* m_print_sizer { nullptr };
|
||||
wxPanel* m_tab_print { nullptr };
|
||||
wxPanel* m_tab_print_plate { nullptr };
|
||||
wxPanel* m_tab_print_object { nullptr };
|
||||
wxStaticLine* m_staticline_print_object { nullptr };
|
||||
wxPanel* m_tab_print_part { nullptr };
|
||||
wxPanel* m_tab_print_layer { nullptr };
|
||||
wxStaticLine* m_staticline_print_part { nullptr };
|
||||
wxStaticLine* m_staticline_filament { nullptr };
|
||||
//wxBoxSizer* m_filament_sizer { nullptr };
|
||||
wxPanel* m_tab_filament { nullptr };
|
||||
wxStaticLine* m_staticline_printer { nullptr };
|
||||
//wxBoxSizer* m_printer_sizer { nullptr };
|
||||
wxPanel* m_tab_printer { nullptr };
|
||||
wxStaticLine* m_staticline_config{ nullptr };
|
||||
wxPanel* m_tab_config { nullptr };
|
||||
//wxStaticLine* m_staticline_buttons { nullptr };
|
||||
// BBS: new layout
|
||||
wxBoxSizer* m_button_sizer { nullptr };
|
||||
wxWindow* m_export_to_file { nullptr };
|
||||
wxWindow* m_import_from_file { nullptr };
|
||||
//wxStaticLine* m_staticline_middle{ nullptr };
|
||||
//wxBoxSizer* m_right_sizer { nullptr };
|
||||
wxScrolledWindow* m_page_view { nullptr };
|
||||
wxBoxSizer* m_page_sizer { nullptr };
|
||||
|
||||
ScalableButton* m_setting_btn { nullptr };
|
||||
ScalableButton* m_search_btn { nullptr };
|
||||
ScalableButton* m_compare_btn { nullptr };
|
||||
|
||||
wxBitmap m_toggle_on_icon;
|
||||
wxBitmap m_toggle_off_icon;
|
||||
|
||||
wxPanel* m_current_tab { nullptr };
|
||||
|
||||
bool m_has_object_config { false };
|
||||
|
||||
struct Highlighter
|
||||
{
|
||||
void set_timer_owner(wxEvtHandler *owner, int timerid = wxID_ANY);
|
||||
void init(std::pair<wxWindow *, bool *>, wxWindow *parent = nullptr);
|
||||
void blink();
|
||||
void invalidate();
|
||||
|
||||
private:
|
||||
wxWindow * m_bitmap{nullptr};
|
||||
bool * m_show_blink_ptr{nullptr};
|
||||
int m_blink_counter{0};
|
||||
wxTimer m_timer;
|
||||
wxWindow * m_parent { nullptr };
|
||||
} m_highlighter;
|
||||
|
||||
void OnToggled(wxCommandEvent& event);
|
||||
|
||||
public:
|
||||
ParamsPanel( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 1800,1080 ), long style = wxTAB_TRAVERSAL, const wxString& type = wxEmptyString );
|
||||
~ParamsPanel();
|
||||
|
||||
void rebuild_panels();
|
||||
void create_layout();
|
||||
//clear the right page
|
||||
void clear_page();
|
||||
void OnActivate();
|
||||
void set_active_tab(wxPanel*tab);
|
||||
bool is_active_and_shown_tab(wxPanel*tab);
|
||||
void update_mode();
|
||||
void msw_rescale();
|
||||
void switch_to_global();
|
||||
void switch_to_object(bool with_tips = false);
|
||||
|
||||
void notify_object_config_changed();
|
||||
void switch_to_object_if_has_object_configs();
|
||||
|
||||
StaticBox* get_top_panel() { return m_top_panel; }
|
||||
|
||||
wxPanel* filament_panel() { return m_tab_filament; }
|
||||
|
||||
wxScrolledWindow* get_paged_view() { return m_page_view;}
|
||||
wxPanel* get_current_tab() { return m_current_tab; }
|
||||
|
||||
};
|
||||
|
||||
} // GUI
|
||||
} // Slic3r
|
||||
|
||||
#endif //slic3r_params_panel_hpp_
|
|
@ -964,6 +964,7 @@ Sidebar::Sidebar(Plater *parent)
|
|||
{
|
||||
p->editing_filament = 0;
|
||||
combobox->switch_to_tab();
|
||||
p->combo_config->update();
|
||||
});
|
||||
combobox->edit_btn = edit_btn;
|
||||
|
||||
|
@ -6507,6 +6508,16 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
|
|||
if (flag != flag_is_change) {
|
||||
sidebar->auto_calc_flushing_volumes(idx);
|
||||
}
|
||||
//wxGetApp().get_tab(Preset::TYPE_CONFIG)->get_combo_box()->Update();
|
||||
//wxGetApp().preset_bundle->configs.get_preset_base()->Update();
|
||||
//p->combo_config->update();
|
||||
wxGetApp().sidebar().update_presets(Preset::TYPE_CONFIG);
|
||||
//wxGetApp().preset_bundle->configs.Update();
|
||||
//TabPresetComboBox* tabCombo = wxGetApp().get_tab(Preset::TYPE_CONFIG)->get_combo_box();
|
||||
//tabCombo->update();
|
||||
//wxGetApp().get_tab(Preset::TYPE_CONFIG)->get_combo_box()->presets()->reset(false);
|
||||
wxGetApp().get_tab(Preset::TYPE_CONFIG)->get_combo_box()->update();
|
||||
//wxGetApp().get_tab(Preset::TYPE_CONFIG)->load_current_preset();
|
||||
}
|
||||
bool select_preset = !combo->selection_is_changed_according_to_physical_printers();
|
||||
// TODO: ?
|
||||
|
|
|
@ -0,0 +1,788 @@
|
|||
#ifndef slic3r_Plater_hpp_
|
||||
#define slic3r_Plater_hpp_
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
#include <wx/panel.h>
|
||||
// BBS
|
||||
#include <wx/notebook.h>
|
||||
|
||||
#include "Selection.hpp"
|
||||
|
||||
#include "libslic3r/enum_bitmask.hpp"
|
||||
#include "libslic3r/Preset.hpp"
|
||||
#include "libslic3r/BoundingBox.hpp"
|
||||
#include "libslic3r/GCode/GCodeProcessor.hpp"
|
||||
#include "Jobs/Job.hpp"
|
||||
#include "Search.hpp"
|
||||
#include "PartPlate.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "Jobs/PrintJob.hpp"
|
||||
#include "Jobs/SendJob.hpp"
|
||||
#include "libslic3r/Model.hpp"
|
||||
#include "libslic3r/PrintBase.hpp"
|
||||
#include "libslic3r/Calib.hpp"
|
||||
#include "libslic3r/FlushVolCalc.hpp"
|
||||
|
||||
#define FILAMENT_SYSTEM_COLORS_NUM 16
|
||||
|
||||
class wxButton;
|
||||
class ScalableButton;
|
||||
class wxScrolledWindow;
|
||||
class wxString;
|
||||
class ComboBox;
|
||||
class Button;
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
class BuildVolume;
|
||||
class Model;
|
||||
class ModelObject;
|
||||
enum class ModelObjectCutAttribute : int;
|
||||
using ModelObjectCutAttributes = enum_bitmask<ModelObjectCutAttribute>;
|
||||
class ModelInstance;
|
||||
class Print;
|
||||
class SLAPrint;
|
||||
//BBS: add partplatelist and SlicingStatusEvent
|
||||
class PartPlateList;
|
||||
class SlicingStatusEvent;
|
||||
enum SLAPrintObjectStep : unsigned int;
|
||||
enum class ConversionType : int;
|
||||
class Ams;
|
||||
|
||||
using ModelInstancePtrs = std::vector<ModelInstance*>;
|
||||
|
||||
|
||||
namespace UndoRedo {
|
||||
class Stack;
|
||||
enum class SnapshotType : unsigned char;
|
||||
struct Snapshot;
|
||||
}
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class MainFrame;
|
||||
class ConfigOptionsGroup;
|
||||
class ObjectSettings;
|
||||
class ObjectLayers;
|
||||
class ObjectList;
|
||||
class GLCanvas3D;
|
||||
class Mouse3DController;
|
||||
class NotificationManager;
|
||||
class DailyTipsWindow;
|
||||
struct Camera;
|
||||
class GLToolbar;
|
||||
class PlaterPresetComboBox;
|
||||
class PartPlateList;
|
||||
|
||||
using t_optgroups = std::vector <std::shared_ptr<ConfigOptionsGroup>>;
|
||||
|
||||
class Plater;
|
||||
enum class ActionButtonType : int;
|
||||
|
||||
#define EVT_PUBLISHING_START 1
|
||||
#define EVT_PUBLISHING_STOP 2
|
||||
|
||||
//BBS: add EVT_SLICING_UPDATE declare here
|
||||
wxDECLARE_EVENT(EVT_SLICING_UPDATE, Slic3r::SlicingStatusEvent);
|
||||
wxDECLARE_EVENT(EVT_PUBLISH, wxCommandEvent);
|
||||
wxDECLARE_EVENT(EVT_OPEN_PLATESETTINGSDIALOG, wxCommandEvent);
|
||||
wxDECLARE_EVENT(EVT_REPAIR_MODEL, wxCommandEvent);
|
||||
wxDECLARE_EVENT(EVT_FILAMENT_COLOR_CHANGED, wxCommandEvent);
|
||||
wxDECLARE_EVENT(EVT_INSTALL_PLUGIN_NETWORKING, wxCommandEvent);
|
||||
wxDECLARE_EVENT(EVT_INSTALL_PLUGIN_HINT, wxCommandEvent);
|
||||
wxDECLARE_EVENT(EVT_UPDATE_PLUGINS_WHEN_LAUNCH, wxCommandEvent);
|
||||
wxDECLARE_EVENT(EVT_PREVIEW_ONLY_MODE_HINT, wxCommandEvent);
|
||||
wxDECLARE_EVENT(EVT_GLCANVAS_COLOR_MODE_CHANGED, SimpleEvent);
|
||||
wxDECLARE_EVENT(EVT_PRINT_FROM_SDCARD_VIEW, SimpleEvent);
|
||||
wxDECLARE_EVENT(EVT_CREATE_FILAMENT, SimpleEvent);
|
||||
wxDECLARE_EVENT(EVT_MODIFY_FILAMENT, SimpleEvent);
|
||||
wxDECLARE_EVENT(EVT_ADD_FILAMENT, SimpleEvent);
|
||||
wxDECLARE_EVENT(EVT_DEL_FILAMENT, SimpleEvent);
|
||||
using ColorEvent = Event<wxColour>;
|
||||
wxDECLARE_EVENT(EVT_ADD_CUSTOM_FILAMENT, ColorEvent);
|
||||
const wxString DEFAULT_PROJECT_NAME = "Untitled";
|
||||
|
||||
class Sidebar : public wxPanel
|
||||
{
|
||||
ConfigOptionMode m_mode;
|
||||
public:
|
||||
Sidebar(Plater *parent);
|
||||
Sidebar(Sidebar &&) = delete;
|
||||
Sidebar(const Sidebar &) = delete;
|
||||
Sidebar &operator=(Sidebar &&) = delete;
|
||||
Sidebar &operator=(const Sidebar &) = delete;
|
||||
~Sidebar();
|
||||
|
||||
void create_printer_preset();
|
||||
void init_filament_combo(PlaterPresetComboBox **combo, const int filament_idx);
|
||||
void remove_unused_filament_combos(const size_t current_extruder_count);
|
||||
void set_bed_by_curr_bed_type(AppConfig *config);
|
||||
void update_all_preset_comboboxes();
|
||||
//void update_partplate(PartPlateList& list);
|
||||
void update_presets(Slic3r::Preset::Type preset_type);
|
||||
//BBS
|
||||
void update_presets_from_to(Slic3r::Preset::Type preset_type, std::string from, std::string to);
|
||||
bool set_bed_type(const std::string& bed_type_name);
|
||||
void save_bed_type_to_config(const std::string &bed_type_name);
|
||||
bool use_default_bed_type(bool is_bbl_preset = true);
|
||||
void change_top_border_for_mode_sizer(bool increase_border);
|
||||
void msw_rescale();
|
||||
void sys_color_changed();
|
||||
void search();
|
||||
void jump_to_option(size_t selected);
|
||||
void jump_to_option(const std::string& opt_key, Preset::Type type, const std::wstring& category);
|
||||
// BBS. Add on_filaments_change() method.
|
||||
void on_filaments_change(size_t num_filaments);
|
||||
void add_filament();
|
||||
void delete_filament();
|
||||
void add_custom_filament(wxColour new_col);
|
||||
// BBS
|
||||
void on_bed_type_change(BedType bed_type);
|
||||
void load_ams_list(std::string const & device, MachineObject* obj);
|
||||
std::map<int, DynamicPrintConfig> build_filament_ams_list(MachineObject* obj);
|
||||
void sync_ams_list();
|
||||
|
||||
ObjectList* obj_list();
|
||||
ObjectSettings* obj_settings();
|
||||
ObjectLayers* obj_layers();
|
||||
wxPanel* scrolled_panel();
|
||||
wxPanel* print_panel();
|
||||
wxPanel* filament_panel();
|
||||
|
||||
ConfigOptionsGroup* og_freq_chng_params(const bool is_fff);
|
||||
wxButton* get_wiping_dialog_button();
|
||||
|
||||
// BBS
|
||||
void enable_buttons(bool enable);
|
||||
void set_btn_label(const ActionButtonType btn_type, const wxString& label) const;
|
||||
bool show_reslice(bool show) const;
|
||||
bool show_export(bool show) const;
|
||||
bool show_send(bool show) const;
|
||||
bool show_eject(bool show)const;
|
||||
bool show_export_removable(bool show) const;
|
||||
bool get_eject_shown() const;
|
||||
bool is_multifilament();
|
||||
void update_mode();
|
||||
bool is_collapsed();
|
||||
void collapse(bool collapse);
|
||||
void update_searcher();
|
||||
void update_ui_from_settings();
|
||||
bool show_object_list(bool show) const;
|
||||
void finish_param_edit();
|
||||
void auto_calc_flushing_volumes(const int modify_id);
|
||||
void jump_to_object(ObjectDataViewModelNode* item);
|
||||
void can_search();
|
||||
#ifdef _MSW_DARK_MODE
|
||||
void show_mode_sizer(bool show);
|
||||
#endif
|
||||
|
||||
std::vector<PlaterPresetComboBox*>& combos_filament();
|
||||
Search::OptionsSearcher& get_searcher();
|
||||
std::string& get_search_line();
|
||||
void set_is_gcode_file(bool flag);
|
||||
void update_soft_first_start_state() { m_soft_first_start = false; }
|
||||
void cancel_update_3d_state() { m_update_3d_state = false; }
|
||||
bool get_update_3d_state() { return m_update_3d_state; }
|
||||
private:
|
||||
struct priv;
|
||||
std::unique_ptr<priv> p;
|
||||
|
||||
wxBoxSizer* m_scrolled_sizer = nullptr;
|
||||
ComboBox* m_bed_type_list = nullptr;
|
||||
ScalableButton* connection_btn = nullptr;
|
||||
ScalableButton* ams_btn = nullptr;
|
||||
bool m_soft_first_start {true };
|
||||
bool m_is_gcode_file{ false };
|
||||
bool m_update_3d_state{false};
|
||||
};
|
||||
|
||||
class Plater: public wxPanel
|
||||
{
|
||||
public:
|
||||
using fs_path = boost::filesystem::path;
|
||||
|
||||
Plater(wxWindow *parent, MainFrame *main_frame);
|
||||
Plater(Plater &&) = delete;
|
||||
Plater(const Plater &) = delete;
|
||||
Plater &operator=(Plater &&) = delete;
|
||||
Plater &operator=(const Plater &) = delete;
|
||||
~Plater() = default;
|
||||
|
||||
bool Show(bool show = true);
|
||||
|
||||
bool is_project_dirty() const;
|
||||
bool is_presets_dirty() const;
|
||||
void set_plater_dirty(bool is_dirty);
|
||||
void update_project_dirty_from_presets();
|
||||
int save_project_if_dirty(const wxString& reason);
|
||||
void reset_project_dirty_after_save();
|
||||
void reset_project_dirty_initial_presets();
|
||||
#if ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW
|
||||
void render_project_state_debug_window() const;
|
||||
#endif // ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW
|
||||
|
||||
Sidebar& sidebar();
|
||||
const Model& model() const;
|
||||
Model& model();
|
||||
const Print& fff_print() const;
|
||||
Print& fff_print();
|
||||
const SLAPrint& sla_print() const;
|
||||
SLAPrint& sla_print();
|
||||
|
||||
int new_project(bool skip_confirm = false, bool silent = false, const wxString &project_name = wxString());
|
||||
// BBS: save & backup
|
||||
void load_project(wxString const & filename = "", wxString const & originfile = "-");
|
||||
int save_project(bool saveAs = false);
|
||||
//BBS download project by project id
|
||||
void import_model_id(wxString download_info);
|
||||
void download_project(const wxString& project_id);
|
||||
void request_model_download(wxString url);
|
||||
void request_download_project(std::string project_id);
|
||||
// BBS: check snapshot
|
||||
bool up_to_date(bool saved, bool backup);
|
||||
|
||||
bool open_3mf_file(const fs::path &file_path);
|
||||
int get_3mf_file_count(std::vector<fs::path> paths);
|
||||
void add_file();
|
||||
void add_model(bool imperial_units = false, std::string fname = "");
|
||||
void import_sl1_archive();
|
||||
void extract_config_from_project();
|
||||
void load_gcode();
|
||||
void load_gcode(const wxString& filename);
|
||||
void reload_gcode_from_disk();
|
||||
void refresh_print();
|
||||
|
||||
// OrcaSlicer calibration
|
||||
void calib_pa(const Calib_Params ¶ms);
|
||||
void calib_flowrate(int pass);
|
||||
void calib_temp(const Calib_Params ¶ms);
|
||||
void calib_max_vol_speed(const Calib_Params ¶ms);
|
||||
void calib_retraction(const Calib_Params ¶ms);
|
||||
void calib_VFA(const Calib_Params ¶ms);
|
||||
|
||||
//BBS: add only gcode mode
|
||||
bool only_gcode_mode() { return m_only_gcode; }
|
||||
void set_only_gcode(bool only_gcode) { m_only_gcode = only_gcode; }
|
||||
|
||||
//BBS: add only gcode mode
|
||||
bool using_exported_file() { return m_exported_file; }
|
||||
void set_using_exported_file(bool exported_file) {
|
||||
m_exported_file = exported_file;
|
||||
}
|
||||
|
||||
// BBS
|
||||
wxString get_project_name();
|
||||
void update_all_plate_thumbnails(bool force_update = false);
|
||||
void invalid_all_plate_thumbnails();
|
||||
void force_update_all_plate_thumbnails();
|
||||
|
||||
static wxColour get_next_color_for_filament();
|
||||
static wxString get_slice_warning_string(GCodeProcessorResult::SliceWarning& warning);
|
||||
|
||||
// BBS: restore
|
||||
std::vector<size_t> load_files(const std::vector<boost::filesystem::path>& input_files, LoadStrategy strategy = LoadStrategy::LoadModel | LoadStrategy::LoadConfig, bool ask_multi = false);
|
||||
// To be called when providing a list of files to the GUI slic3r on command line.
|
||||
std::vector<size_t> load_files(const std::vector<std::string>& input_files, LoadStrategy strategy = LoadStrategy::LoadModel | LoadStrategy::LoadConfig, bool ask_multi = false);
|
||||
// to be called on drag and drop
|
||||
bool load_files(const wxArrayString& filenames);
|
||||
|
||||
const wxString& get_last_loaded_gcode() const { return m_last_loaded_gcode; }
|
||||
|
||||
void update(bool conside_update_flag = false, bool force_background_processing_update = false);
|
||||
//BBS
|
||||
void object_list_changed();
|
||||
void stop_jobs();
|
||||
bool is_any_job_running() const;
|
||||
void select_view(const std::string& direction);
|
||||
//BBS: add no_slice logic
|
||||
void select_view_3D(const std::string& name, bool no_slice = true);
|
||||
|
||||
void reload_paint_after_background_process_apply();
|
||||
bool is_preview_shown() const;
|
||||
bool is_preview_loaded() const;
|
||||
bool is_view3D_shown() const;
|
||||
|
||||
bool are_view3D_labels_shown() const;
|
||||
void show_view3D_labels(bool show);
|
||||
|
||||
bool is_view3D_overhang_shown() const;
|
||||
void show_view3D_overhang(bool show);
|
||||
|
||||
bool is_sidebar_collapsed() const;
|
||||
void collapse_sidebar(bool show);
|
||||
|
||||
// Called after the Preferences dialog is closed and the program settings are saved.
|
||||
// Update the UI based on the current preferences.
|
||||
void update_ui_from_settings();
|
||||
|
||||
//BBS
|
||||
void select_curr_plate_all();
|
||||
void remove_curr_plate_all();
|
||||
|
||||
void select_all();
|
||||
void deselect_all();
|
||||
void exit_gizmo();
|
||||
void remove(size_t obj_idx);
|
||||
void reset(bool apply_presets_change = false);
|
||||
void reset_with_confirm();
|
||||
//BBS: return int for various result
|
||||
int close_with_confirm(std::function<bool(bool yes_or_no)> second_check = nullptr); // BBS close project
|
||||
//BBS: trigger a restore project event
|
||||
void trigger_restore_project(int skip_confirm = 0);
|
||||
bool delete_object_from_model(size_t obj_idx, bool refresh_immediately = true); // BBS support refresh immediately
|
||||
void delete_all_objects_from_model(); //BBS delete all objects from model
|
||||
void set_selected_visible(bool visible);
|
||||
void remove_selected();
|
||||
void increase_instances(size_t num = 1);
|
||||
void decrease_instances(size_t num = 1);
|
||||
void set_number_of_copies(/*size_t num*/);
|
||||
void fill_bed_with_instances();
|
||||
bool is_selection_empty() const;
|
||||
void scale_selection_to_fit_print_volume();
|
||||
void convert_unit(ConversionType conv_type);
|
||||
|
||||
// BBS: replace z with plane_points
|
||||
void cut(size_t obj_idx, size_t instance_idx, std::array<Vec3d, 4> plane_points, ModelObjectCutAttributes attributes);
|
||||
|
||||
// BBS: segment model with CGAL
|
||||
void segment(size_t obj_idx, size_t instance_idx, double smoothing_alpha=0.5, int segment_number=5);
|
||||
void apply_cut_object_to_model(size_t obj_idx, const ModelObjectPtrs &cut_objects);
|
||||
void merge(size_t obj_idx, std::vector<int> &vol_indeces);
|
||||
|
||||
void send_to_printer(bool isall = false);
|
||||
void export_gcode(bool prefer_removable);
|
||||
void export_gcode_3mf(bool export_all = false);
|
||||
void send_gcode_finish(wxString name);
|
||||
void export_core_3mf();
|
||||
static TriangleMesh combine_mesh_fff(const ModelObject& mo, int instance_id, std::function<void(const std::string&)> notify_func = {});
|
||||
void export_stl(bool extended = false, bool selection_only = false, bool multi_stls = false);
|
||||
//BBS: remove amf
|
||||
//void export_amf();
|
||||
//BBS add extra param for exporting 3mf silence
|
||||
// BBS: backup
|
||||
int export_3mf(const boost::filesystem::path& output_path = boost::filesystem::path(), SaveStrategy strategy = SaveStrategy::Default, int export_plate_idx = -1, Export3mfProgressFn proFn = nullptr);
|
||||
|
||||
//BBS
|
||||
void publish_project();
|
||||
|
||||
void reload_from_disk();
|
||||
void replace_with_stl();
|
||||
void reload_all_from_disk();
|
||||
bool has_toolpaths_to_export() const;
|
||||
void export_toolpaths_to_obj() const;
|
||||
void reslice();
|
||||
void record_slice_preset(std::string action);
|
||||
void reslice_SLA_supports(const ModelObject &object, bool postpone_error_messages = false);
|
||||
void reslice_SLA_hollowing(const ModelObject &object, bool postpone_error_messages = false);
|
||||
void reslice_SLA_until_step(SLAPrintObjectStep step, const ModelObject &object, bool postpone_error_messages = false);
|
||||
|
||||
void clear_before_change_mesh(int obj_idx);
|
||||
void changed_mesh(int obj_idx);
|
||||
|
||||
void changed_object(int obj_idx);
|
||||
void changed_objects(const std::vector<size_t>& object_idxs);
|
||||
void schedule_background_process(bool schedule = true);
|
||||
bool is_background_process_update_scheduled() const;
|
||||
void suppress_background_process(const bool stop_background_process) ;
|
||||
/* -1: send current gcode if not specified
|
||||
* -2: send all gcode to target machine */
|
||||
int send_gcode(int plate_idx = -1, Export3mfProgressFn proFn = nullptr);
|
||||
void send_gcode_legacy(int plate_idx = -1, Export3mfProgressFn proFn = nullptr);
|
||||
int export_config_3mf(int plate_idx = -1, Export3mfProgressFn proFn = nullptr);
|
||||
//BBS jump to nonitor after print job finished
|
||||
void send_calibration_job_finished(wxCommandEvent &evt);
|
||||
void print_job_finished(wxCommandEvent &evt);
|
||||
void send_job_finished(wxCommandEvent& evt);
|
||||
void publish_job_finished(wxCommandEvent& evt);
|
||||
void open_platesettings_dialog(wxCommandEvent& evt);
|
||||
void on_change_color_mode(SimpleEvent& evt);
|
||||
void eject_drive();
|
||||
|
||||
void take_snapshot(const std::string &snapshot_name);
|
||||
//void take_snapshot(const wxString &snapshot_name);
|
||||
void take_snapshot(const std::string &snapshot_name, UndoRedo::SnapshotType snapshot_type);
|
||||
//void take_snapshot(const wxString &snapshot_name, UndoRedo::SnapshotType snapshot_type);
|
||||
|
||||
void undo();
|
||||
void redo();
|
||||
void undo_to(int selection);
|
||||
void redo_to(int selection);
|
||||
bool undo_redo_string_getter(const bool is_undo, int idx, const char** out_text);
|
||||
void undo_redo_topmost_string_getter(const bool is_undo, std::string& out_text);
|
||||
int update_print_required_data(Slic3r::DynamicPrintConfig config, Slic3r::Model model, Slic3r::PlateDataPtrs plate_data_list, std::string file_name, std::string file_path);
|
||||
bool search_string_getter(int idx, const char** label, const char** tooltip);
|
||||
// For the memory statistics.
|
||||
const Slic3r::UndoRedo::Stack& undo_redo_stack_main() const;
|
||||
void clear_undo_redo_stack_main();
|
||||
// Enter / leave the Gizmos specific Undo / Redo stack. To be used by the SLA support point editing gizmo.
|
||||
void enter_gizmos_stack();
|
||||
// BBS: return false if not changed
|
||||
bool leave_gizmos_stack();
|
||||
|
||||
void on_filaments_change(size_t extruders_count);
|
||||
// BBS
|
||||
void on_bed_type_change(BedType bed_type,bool is_gcode_file = false);
|
||||
bool update_filament_colors_in_full_config();
|
||||
void config_change_notification(const DynamicPrintConfig &config, const std::string& key);
|
||||
void on_config_change(const DynamicPrintConfig &config);
|
||||
void force_filament_colors_update();
|
||||
void force_print_bed_update();
|
||||
// On activating the parent window.
|
||||
void on_activate();
|
||||
std::vector<std::string> get_extruder_colors_from_plater_config(const GCodeProcessorResult* const result = nullptr) const;
|
||||
std::vector<std::string> get_colors_for_color_print(const GCodeProcessorResult* const result = nullptr) const;
|
||||
|
||||
void update_menus();
|
||||
// BBS
|
||||
//void show_action_buttons(const bool is_ready_to_slice) const;
|
||||
|
||||
wxString get_project_filename(const wxString& extension = wxEmptyString) const;
|
||||
wxString get_export_gcode_filename(const wxString& extension = wxEmptyString, bool only_filename = false, bool export_all = false) const;
|
||||
void set_project_filename(const wxString& filename);
|
||||
void update_print_error_info(int code, std::string msg, std::string extra);
|
||||
|
||||
bool is_export_gcode_scheduled() const;
|
||||
|
||||
const Selection& get_selection() const;
|
||||
int get_selected_object_idx();
|
||||
bool is_single_full_object_selection() const;
|
||||
GLCanvas3D* canvas3D();
|
||||
const GLCanvas3D * canvas3D() const;
|
||||
GLCanvas3D* get_current_canvas3D(bool exclude_preview = false);
|
||||
GLCanvas3D* get_view3D_canvas3D();
|
||||
GLCanvas3D* get_preview_canvas3D();
|
||||
GLCanvas3D* get_assmeble_canvas3D();
|
||||
wxWindow* get_select_machine_dialog();
|
||||
|
||||
void arrange();
|
||||
void orient();
|
||||
void find_new_position(const ModelInstancePtrs &instances);
|
||||
//BBS: add job state related functions
|
||||
void set_prepare_state(int state);
|
||||
int get_prepare_state();
|
||||
//BBS: add print job releated functions
|
||||
void get_print_job_data(PrintPrepareData* data);
|
||||
int get_send_calibration_finished_event();
|
||||
int get_print_finished_event();
|
||||
int get_send_finished_event();
|
||||
int get_publish_finished_event();
|
||||
|
||||
void set_current_canvas_as_dirty();
|
||||
void unbind_canvas_event_handlers();
|
||||
void reset_canvas_volumes();
|
||||
|
||||
PrinterTechnology printer_technology() const;
|
||||
const DynamicPrintConfig * config() const;
|
||||
bool set_printer_technology(PrinterTechnology printer_technology);
|
||||
|
||||
//BBS
|
||||
void cut_selection_to_clipboard();
|
||||
|
||||
void copy_selection_to_clipboard();
|
||||
void paste_from_clipboard();
|
||||
//BBS: add clone logic
|
||||
void clone_selection();
|
||||
void center_selection();
|
||||
void search(bool plater_is_active, Preset::Type type, wxWindow *tag, TextInput *etag, wxWindow *stag);
|
||||
void mirror(Axis axis);
|
||||
void split_object();
|
||||
void split_volume();
|
||||
void optimize_rotation();
|
||||
// find all empty cells on the plate and won't overlap with exclusion areas
|
||||
static std::vector<Vec2f> get_empty_cells(const Vec2f step);
|
||||
|
||||
//BBS:
|
||||
void fill_color(int extruder_id);
|
||||
|
||||
//BBS:
|
||||
void edit_text();
|
||||
bool can_edit_text() const;
|
||||
|
||||
bool can_delete() const;
|
||||
bool can_delete_all() const;
|
||||
bool can_add_model() const;
|
||||
bool can_add_plate() const;
|
||||
bool can_delete_plate() const;
|
||||
bool can_increase_instances() const;
|
||||
bool can_decrease_instances() const;
|
||||
bool can_set_instance_to_object() const;
|
||||
bool can_fix_through_netfabb() const;
|
||||
bool can_simplify() const;
|
||||
bool can_split_to_objects() const;
|
||||
bool can_split_to_volumes() const;
|
||||
bool can_arrange() const;
|
||||
//BBS
|
||||
bool can_cut_to_clipboard() const;
|
||||
bool can_layers_editing() const;
|
||||
bool can_paste_from_clipboard() const;
|
||||
bool can_copy_to_clipboard() const;
|
||||
bool can_undo() const;
|
||||
bool can_redo() const;
|
||||
bool can_reload_from_disk() const;
|
||||
bool can_replace_with_stl() const;
|
||||
bool can_mirror() const;
|
||||
bool can_split(bool to_objects) const;
|
||||
#if ENABLE_ENHANCED_PRINT_VOLUME_FIT
|
||||
bool can_scale_to_print_volume() const;
|
||||
#endif // ENABLE_ENHANCED_PRINT_VOLUME_FIT
|
||||
|
||||
//BBS:
|
||||
bool can_fillcolor() const;
|
||||
bool has_assmeble_view() const;
|
||||
|
||||
void msw_rescale();
|
||||
void sys_color_changed();
|
||||
|
||||
// BBS
|
||||
#if 0
|
||||
bool init_view_toolbar();
|
||||
void enable_view_toolbar(bool enable);
|
||||
#endif
|
||||
|
||||
bool init_collapse_toolbar();
|
||||
void enable_collapse_toolbar(bool enable);
|
||||
|
||||
const Camera& get_camera() const;
|
||||
Camera& get_camera();
|
||||
|
||||
//BBS: partplate list related functions
|
||||
PartPlateList& get_partplate_list();
|
||||
void validate_current_plate(bool& model_fits, bool& validate_error);
|
||||
//BBS: select the plate by index
|
||||
int select_plate(int plate_index, bool need_slice = false);
|
||||
//BBS: update progress result
|
||||
void apply_background_progress();
|
||||
//BBS: select the plate by hover_id
|
||||
int select_plate_by_hover_id(int hover_id, bool right_click = false, bool isModidyPlateName = false);
|
||||
//BBS: delete the plate, index= -1 means the current plate
|
||||
int delete_plate(int plate_index = -1);
|
||||
//BBS: select the sliced plate by index
|
||||
int select_sliced_plate(int plate_index);
|
||||
//BBS: set bed positions
|
||||
void set_bed_position(Vec2d& pos);
|
||||
//BBS: is the background process slicing currently
|
||||
bool is_background_process_slicing() const;
|
||||
//BBS: update slicing context
|
||||
void update_slicing_context_to_current_partplate();
|
||||
//BBS: show object info
|
||||
void show_object_info();
|
||||
//BBS
|
||||
bool show_publish_dialog(bool show = true);
|
||||
//BBS: post process string object exception strings by warning types
|
||||
void post_process_string_object_exception(StringObjectException &err);
|
||||
|
||||
#if ENABLE_ENVIRONMENT_MAP
|
||||
void init_environment_texture();
|
||||
unsigned int get_environment_texture_id() const;
|
||||
#endif // ENABLE_ENVIRONMENT_MAP
|
||||
|
||||
const BuildVolume& build_volume() const;
|
||||
|
||||
// BBS
|
||||
//const GLToolbar& get_view_toolbar() const;
|
||||
//GLToolbar& get_view_toolbar();
|
||||
|
||||
const GLToolbar& get_collapse_toolbar() const;
|
||||
GLToolbar& get_collapse_toolbar();
|
||||
|
||||
void update_preview_bottom_toolbar();
|
||||
void update_preview_moves_slider();
|
||||
void enable_preview_moves_slider(bool enable);
|
||||
|
||||
#if 0
|
||||
void update_partplate();
|
||||
#endif
|
||||
|
||||
void reset_gcode_toolpaths();
|
||||
void reset_last_loaded_gcode() { m_last_loaded_gcode = ""; }
|
||||
|
||||
const Mouse3DController& get_mouse3d_controller() const;
|
||||
Mouse3DController& get_mouse3d_controller();
|
||||
|
||||
//BBS: add bed exclude area
|
||||
void set_bed_shape() const;
|
||||
void set_bed_shape(const Pointfs& shape, const Pointfs& exclude_area, const double printable_height, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom = false) const;
|
||||
|
||||
const NotificationManager* get_notification_manager() const;
|
||||
NotificationManager* get_notification_manager();
|
||||
DailyTipsWindow* get_dailytips() const;
|
||||
//BBS: show message in status bar
|
||||
void show_status_message(std::string s);
|
||||
|
||||
void init_notification_manager();
|
||||
|
||||
void bring_instance_forward();
|
||||
|
||||
bool need_update() const;
|
||||
void set_need_update(bool need_update);
|
||||
|
||||
// ROII wrapper for suppressing the Undo / Redo snapshot to be taken.
|
||||
class SuppressSnapshots
|
||||
{
|
||||
public:
|
||||
SuppressSnapshots(Plater *plater) : m_plater(plater)
|
||||
{
|
||||
m_plater->suppress_snapshots();
|
||||
}
|
||||
~SuppressSnapshots()
|
||||
{
|
||||
m_plater->allow_snapshots();
|
||||
}
|
||||
private:
|
||||
Plater *m_plater;
|
||||
};
|
||||
|
||||
// RAII wrapper for taking an Undo / Redo snapshot while disabling the snapshot taking by the methods called from inside this snapshot.
|
||||
class TakeSnapshot
|
||||
{
|
||||
public:
|
||||
TakeSnapshot(Plater *plater, const std::string &snapshot_name) : m_plater(plater)
|
||||
{
|
||||
m_plater->take_snapshot(snapshot_name);
|
||||
m_plater->suppress_snapshots();
|
||||
}
|
||||
/*TakeSnapshot(Plater *plater, const wxString &snapshot_name) : m_plater(plater)
|
||||
{
|
||||
m_plater->take_snapshot(snapshot_name);
|
||||
m_plater->suppress_snapshots();
|
||||
}*/
|
||||
TakeSnapshot(Plater* plater, const std::string& snapshot_name, UndoRedo::SnapshotType snapshot_type) : m_plater(plater)
|
||||
{
|
||||
m_plater->take_snapshot(snapshot_name, snapshot_type);
|
||||
m_plater->suppress_snapshots();
|
||||
}
|
||||
/*TakeSnapshot(Plater *plater, const wxString &snapshot_name, UndoRedo::SnapshotType snapshot_type) : m_plater(plater)
|
||||
{
|
||||
m_plater->take_snapshot(snapshot_name, snapshot_type);
|
||||
m_plater->suppress_snapshots();
|
||||
}*/
|
||||
|
||||
~TakeSnapshot()
|
||||
{
|
||||
m_plater->allow_snapshots();
|
||||
}
|
||||
private:
|
||||
Plater *m_plater;
|
||||
};
|
||||
|
||||
// BBS: limit to single snapshot taking by the methods called from inside
|
||||
// this snapshot.
|
||||
class SingleSnapshot
|
||||
{
|
||||
public:
|
||||
SingleSnapshot(Plater *plater) : m_plater(plater)
|
||||
{
|
||||
m_plater->single_snapshots_enter(this);
|
||||
}
|
||||
|
||||
~SingleSnapshot() { m_plater->single_snapshots_leave(this); }
|
||||
|
||||
bool check(bool modify)
|
||||
{
|
||||
if (token && (this->modify || !modify)) return false;
|
||||
token = true;
|
||||
this->modify = modify;
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Plater *m_plater;
|
||||
bool token = false;
|
||||
bool modify = false;
|
||||
};
|
||||
|
||||
bool inside_snapshot_capture();
|
||||
|
||||
void toggle_render_statistic_dialog();
|
||||
bool is_render_statistic_dialog_visible() const;
|
||||
|
||||
void toggle_show_wireframe();
|
||||
bool is_show_wireframe() const;
|
||||
void enable_wireframe(bool status);
|
||||
bool is_wireframe_enabled() const;
|
||||
|
||||
// Wrapper around wxWindow::PopupMenu to suppress error messages popping out while tracking the popup menu.
|
||||
bool PopupMenu(wxMenu *menu, const wxPoint& pos = wxDefaultPosition);
|
||||
bool PopupMenu(wxMenu *menu, int x, int y) { return this->PopupMenu(menu, wxPoint(x, y)); }
|
||||
|
||||
//BBS: add popup logic for table object
|
||||
bool PopupObjectTable(int object_id, int volume_id, const wxPoint& position);
|
||||
//BBS: popup selection at default position
|
||||
bool PopupObjectTableBySelection();
|
||||
|
||||
// get same Plater/ObjectList menus
|
||||
wxMenu* plate_menu();
|
||||
wxMenu* object_menu();
|
||||
wxMenu* part_menu();
|
||||
wxMenu* sla_object_menu();
|
||||
wxMenu* default_menu();
|
||||
wxMenu* instance_menu();
|
||||
wxMenu* layer_menu();
|
||||
wxMenu* multi_selection_menu();
|
||||
wxMenu* assemble_multi_selection_menu();
|
||||
int GetPlateIndexByRightMenuInLeftUI();
|
||||
void SetPlateIndexByRightMenuInLeftUI(int);
|
||||
static bool has_illegal_filename_characters(const wxString& name);
|
||||
static bool has_illegal_filename_characters(const std::string& name);
|
||||
static void show_illegal_characters_warning(wxWindow* parent);
|
||||
|
||||
std::string get_preview_only_filename() { return m_preview_only_filename; };
|
||||
|
||||
bool last_arrange_job_is_finished()
|
||||
{
|
||||
bool prevRunning = false;
|
||||
return m_arrange_running.compare_exchange_strong(prevRunning, true);
|
||||
};
|
||||
std::atomic<bool> m_arrange_running{false};
|
||||
|
||||
private:
|
||||
struct priv;
|
||||
std::unique_ptr<priv> p;
|
||||
|
||||
// Set true during PopupMenu() tracking to suppress immediate error message boxes.
|
||||
// The error messages are collected to m_tracking_popup_menu_error_message instead and these error messages
|
||||
// are shown after the pop-up dialog closes.
|
||||
bool m_tracking_popup_menu = false;
|
||||
wxString m_tracking_popup_menu_error_message;
|
||||
|
||||
wxString m_last_loaded_gcode;
|
||||
//BBS: add only gcode mode
|
||||
bool m_only_gcode { false };
|
||||
bool m_exported_file { false };
|
||||
bool skip_thumbnail_invalid { false };
|
||||
bool m_loading_project {false };
|
||||
std::string m_preview_only_filename;
|
||||
int m_valid_plates_count { 0 };
|
||||
|
||||
void suppress_snapshots();
|
||||
void allow_snapshots();
|
||||
// BBS: single snapshot
|
||||
void single_snapshots_enter(SingleSnapshot *single);
|
||||
void single_snapshots_leave(SingleSnapshot *single);
|
||||
// BBS: add project slice related functions
|
||||
int start_next_slice();
|
||||
|
||||
void _calib_pa_pattern(const Calib_Params ¶ms);
|
||||
void _calib_pa_tower(const Calib_Params ¶ms);
|
||||
void _calib_pa_select_added_objects();
|
||||
|
||||
friend class SuppressBackgroundProcessingUpdate;
|
||||
};
|
||||
|
||||
class SuppressBackgroundProcessingUpdate
|
||||
{
|
||||
public:
|
||||
SuppressBackgroundProcessingUpdate();
|
||||
~SuppressBackgroundProcessingUpdate();
|
||||
private:
|
||||
bool m_was_scheduled;
|
||||
};
|
||||
|
||||
std::vector<int> get_min_flush_volumes(const DynamicPrintConfig& full_config);
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
#endif
|
|
@ -830,6 +830,7 @@ bool PlaterPresetComboBox::switch_to_tab()
|
|||
return false;
|
||||
}
|
||||
}
|
||||
//wxGetApp().get_tab(Preset::TYPE_CONFIG)->get_combo_box()->Update();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -969,6 +970,7 @@ void PlaterPresetComboBox::update()
|
|||
bool wide_icons = selected_preset && !selected_preset->is_compatible;
|
||||
|
||||
std::map<wxString, wxBitmap*> nonsys_presets;
|
||||
std::map<wxString, wxBitmap*> temp_presets;
|
||||
//BBS: add project embedded presets logic
|
||||
std::map<wxString, wxBitmap*> project_embedded_presets;
|
||||
std::map<wxString, wxBitmap *> system_presets;
|
||||
|
@ -1056,29 +1058,69 @@ void PlaterPresetComboBox::update()
|
|||
add_ams_filaments(into_u8(selected_user_preset.empty() ? selected_system_preset : selected_user_preset), true);
|
||||
|
||||
//BBS: add project embedded preset logic
|
||||
if (!project_embedded_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("Project-inside presets")), wxNullBitmap));
|
||||
for (std::map<wxString, wxBitmap*>::iterator it = project_embedded_presets.begin(); it != project_embedded_presets.end(); ++it) {
|
||||
SetItemTooltip(Append(it->first, *it->second), preset_descriptions[it->first]);
|
||||
validate_selection(it->first == selected_user_preset);
|
||||
if (m_type == Preset::TYPE_CONFIG) {
|
||||
wxString lian_xu = _L("Lian xu");
|
||||
bool m_fold = false;
|
||||
//m_preset_bundle->filament_presets
|
||||
for (auto& f : m_preset_bundle->filament_presets) {
|
||||
wxString abc = wxString::FromUTF8(f);
|
||||
if (m_fold = abc.Contains(lian_xu)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_fold){
|
||||
/* for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
||||
wxString key = it->first;
|
||||
temp_presets.insert
|
||||
}*/
|
||||
temp_presets.clear();
|
||||
for (const auto& pair : nonsys_presets) {
|
||||
if (m_fold) {
|
||||
wxString key = pair.first;
|
||||
if (key.Contains(lian_xu)) {
|
||||
temp_presets.emplace(pair);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (std::map<wxString, wxBitmap*>::iterator it = temp_presets.begin(); it != temp_presets.end(); ++it) {
|
||||
SetItemTooltip(Append(it->first, *it->second), preset_descriptions[it->first]);
|
||||
validate_selection(it->first == selected_user_preset);
|
||||
}
|
||||
//m_collection->cbegin
|
||||
}
|
||||
else {
|
||||
for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
||||
SetItemTooltip(Append(it->first, *it->second), preset_descriptions[it->first]);
|
||||
validate_selection(it->first == selected_user_preset);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!nonsys_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("User presets")), wxNullBitmap));
|
||||
for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
||||
SetItemTooltip(Append(it->first, *it->second), preset_descriptions[it->first]);
|
||||
validate_selection(it->first == selected_user_preset);
|
||||
else {
|
||||
if (!project_embedded_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("Project-inside presets")), wxNullBitmap));
|
||||
for (std::map<wxString, wxBitmap*>::iterator it = project_embedded_presets.begin(); it != project_embedded_presets.end(); ++it) {
|
||||
SetItemTooltip(Append(it->first, *it->second), preset_descriptions[it->first]);
|
||||
validate_selection(it->first == selected_user_preset);
|
||||
}
|
||||
}
|
||||
}
|
||||
//BBS: move system to the end
|
||||
if (!system_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("System presets")), wxNullBitmap));
|
||||
for (std::map<wxString, wxBitmap*>::iterator it = system_presets.begin(); it != system_presets.end(); ++it) {
|
||||
SetItemTooltip(Append(it->first, *it->second), preset_descriptions[it->first]);
|
||||
validate_selection(it->first == selected_system_preset);
|
||||
if (!nonsys_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("User presets")), wxNullBitmap));
|
||||
for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
||||
SetItemTooltip(Append(it->first, *it->second), preset_descriptions[it->first]);
|
||||
validate_selection(it->first == selected_user_preset);
|
||||
}
|
||||
}
|
||||
//BBS: move system to the end
|
||||
if (!system_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("System presets")), wxNullBitmap));
|
||||
for (std::map<wxString, wxBitmap*>::iterator it = system_presets.begin(); it != system_presets.end(); ++it) {
|
||||
SetItemTooltip(Append(it->first, *it->second), preset_descriptions[it->first]);
|
||||
validate_selection(it->first == selected_system_preset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1114,8 +1156,8 @@ void PlaterPresetComboBox::update()
|
|||
set_label_marker(Append(separator(L("Add/Remove filaments")), *bmp), LABEL_ITEM_WIZARD_FILAMENTS);
|
||||
else if (m_type == Preset::TYPE_SLA_MATERIAL)
|
||||
set_label_marker(Append(separator(L("Add/Remove materials")), *bmp), LABEL_ITEM_WIZARD_MATERIALS);
|
||||
else if (m_type == Preset::TYPE_CONFIG)
|
||||
set_label_marker(Append(separator(L("Add/Remove filaments")), *bmp), LABEL_ITEM_WIZARD_FILAMENTS);
|
||||
else if (m_type == Preset::TYPE_CONFIG) {}
|
||||
//set_label_marker(Append(separator(L("Add/Remove configs")), *bmp), LABEL_ITEM_WIZARD_CONFIGS);
|
||||
else {
|
||||
set_label_marker(Append(separator(L("Select/Remove printers(system presets)")), *bmp), LABEL_ITEM_WIZARD_PRINTERS);
|
||||
set_label_marker(Append(separator(L("Create printer")), *bmp), LABEL_ITEM_WIZARD_ADD_PRINTERS);
|
||||
|
@ -1183,6 +1225,7 @@ void TabPresetComboBox::OnSelect(wxCommandEvent &evt)
|
|||
case LABEL_ITEM_WIZARD_PRINTERS: sp = ConfigWizard::SP_PRINTERS; break;
|
||||
case LABEL_ITEM_WIZARD_FILAMENTS: sp = ConfigWizard::SP_FILAMENTS; break;
|
||||
case LABEL_ITEM_WIZARD_MATERIALS: sp = ConfigWizard::SP_MATERIALS; break;
|
||||
case LABEL_ITEM_WIZARD_CONFIGS: sp = ConfigWizard::SP_CONFIGS; break;
|
||||
default: break;
|
||||
}
|
||||
if (sp != ConfigWizard::SP_WELCOME) {
|
||||
|
@ -1224,6 +1267,7 @@ void TabPresetComboBox::update()
|
|||
const std::deque<Preset>& presets = m_collection->get_presets();
|
||||
|
||||
std::map<wxString, std::pair<wxBitmap*, bool>> nonsys_presets;
|
||||
std::map<wxString, std::pair<wxBitmap*, bool>> temp_presets;
|
||||
//BBS: add project embedded presets logic
|
||||
std::map<wxString, std::pair<wxBitmap*, bool>> project_embedded_presets;
|
||||
//BBS: move system to the end
|
||||
|
@ -1292,41 +1336,88 @@ void TabPresetComboBox::update()
|
|||
add_ams_filaments(into_u8(selected));
|
||||
|
||||
//BBS: add project embedded preset logic
|
||||
if (!project_embedded_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("Project-inside presets")), wxNullBitmap));
|
||||
for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = project_embedded_presets.begin(); it != project_embedded_presets.end(); ++it) {
|
||||
int item_id = Append(it->first, *it->second.first);
|
||||
SetItemTooltip(item_id, preset_descriptions[it->first]);
|
||||
bool is_enabled = it->second.second;
|
||||
if (!is_enabled)
|
||||
set_label_marker(item_id, LABEL_ITEM_DISABLED);
|
||||
validate_selection(it->first == selected);
|
||||
if (m_type == Preset::TYPE_CONFIG) {
|
||||
wxString lian_xu = _L("Lian xu");
|
||||
bool m_fold = false;
|
||||
//m_preset_bundle->filament_presets
|
||||
for (auto& f : m_preset_bundle->filament_presets) {
|
||||
wxString abc = wxString::FromUTF8(f);
|
||||
if (m_fold = abc.Contains(lian_xu)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_fold) {
|
||||
/* for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
||||
wxString key = it->first;
|
||||
temp_presets.insert
|
||||
}*/
|
||||
temp_presets.clear();
|
||||
for (const auto& pair : nonsys_presets) {
|
||||
if (m_fold) {
|
||||
wxString key = pair.first;
|
||||
if (key.Contains(lian_xu)) {
|
||||
temp_presets.emplace(pair);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = temp_presets.begin(); it != temp_presets.end(); ++it) {
|
||||
int item_id = Append(it->first, *it->second.first);
|
||||
SetItemTooltip(item_id, preset_descriptions[it->first]);
|
||||
bool is_enabled = it->second.second;
|
||||
if (!is_enabled)
|
||||
set_label_marker(item_id, LABEL_ITEM_DISABLED);
|
||||
validate_selection(it->first == selected);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
||||
int item_id = Append(it->first, *it->second.first);
|
||||
SetItemTooltip(item_id, preset_descriptions[it->first]);
|
||||
bool is_enabled = it->second.second;
|
||||
if (!is_enabled)
|
||||
set_label_marker(item_id, LABEL_ITEM_DISABLED);
|
||||
validate_selection(it->first == selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!nonsys_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("User presets")), wxNullBitmap));
|
||||
for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
||||
int item_id = Append(it->first, *it->second.first);
|
||||
SetItemTooltip(item_id, preset_descriptions[it->first]);
|
||||
bool is_enabled = it->second.second;
|
||||
if (!is_enabled)
|
||||
set_label_marker(item_id, LABEL_ITEM_DISABLED);
|
||||
validate_selection(it->first == selected);
|
||||
else {
|
||||
if (!project_embedded_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("Project-inside presets")), wxNullBitmap));
|
||||
for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = project_embedded_presets.begin(); it != project_embedded_presets.end(); ++it) {
|
||||
int item_id = Append(it->first, *it->second.first);
|
||||
SetItemTooltip(item_id, preset_descriptions[it->first]);
|
||||
bool is_enabled = it->second.second;
|
||||
if (!is_enabled)
|
||||
set_label_marker(item_id, LABEL_ITEM_DISABLED);
|
||||
validate_selection(it->first == selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
//BBS: move system to the end
|
||||
if (!system_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("System presets")), wxNullBitmap));
|
||||
for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = system_presets.begin(); it != system_presets.end(); ++it) {
|
||||
int item_id = Append(it->first, *it->second.first);
|
||||
SetItemTooltip(item_id, preset_descriptions[it->first]);
|
||||
bool is_enabled = it->second.second;
|
||||
if (!is_enabled)
|
||||
set_label_marker(item_id, LABEL_ITEM_DISABLED);
|
||||
validate_selection(it->first == selected);
|
||||
if (!nonsys_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("User presets")), wxNullBitmap));
|
||||
for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
||||
int item_id = Append(it->first, *it->second.first);
|
||||
SetItemTooltip(item_id, preset_descriptions[it->first]);
|
||||
bool is_enabled = it->second.second;
|
||||
if (!is_enabled)
|
||||
set_label_marker(item_id, LABEL_ITEM_DISABLED);
|
||||
validate_selection(it->first == selected);
|
||||
}
|
||||
}
|
||||
//BBS: move system to the end
|
||||
if (!system_presets.empty())
|
||||
{
|
||||
set_label_marker(Append(separator(L("System presets")), wxNullBitmap));
|
||||
for (std::map<wxString, std::pair<wxBitmap*, bool>>::iterator it = system_presets.begin(); it != system_presets.end(); ++it) {
|
||||
int item_id = Append(it->first, *it->second.first);
|
||||
SetItemTooltip(item_id, preset_descriptions[it->first]);
|
||||
bool is_enabled = it->second.second;
|
||||
if (!is_enabled)
|
||||
set_label_marker(item_id, LABEL_ITEM_DISABLED);
|
||||
validate_selection(it->first == selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,257 @@
|
|||
#ifndef slic3r_PresetComboBoxes_hpp_
|
||||
#define slic3r_PresetComboBoxes_hpp_
|
||||
|
||||
//#include <wx/bmpcbox.h>
|
||||
#include <wx/colourdata.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/clrpicker.h>
|
||||
|
||||
#include "libslic3r/Preset.hpp"
|
||||
#include "wxExtensions.hpp"
|
||||
#include "BitmapComboBox.hpp"
|
||||
#include "Widgets/ComboBox.hpp"
|
||||
#include "GUI_Utils.hpp"
|
||||
|
||||
class wxString;
|
||||
class wxTextCtrl;
|
||||
class wxStaticText;
|
||||
class ScalableButton;
|
||||
class wxBoxSizer;
|
||||
class wxComboBox;
|
||||
class wxStaticBitmap;
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class BitmapCache;
|
||||
|
||||
// ---------------------------------
|
||||
// *** PresetComboBox ***
|
||||
// ---------------------------------
|
||||
|
||||
// BitmapComboBox used to presets list on Sidebar and Tabs
|
||||
class PresetComboBox : public ::ComboBox // BBS
|
||||
{
|
||||
bool m_show_all { false };
|
||||
public:
|
||||
PresetComboBox(wxWindow* parent, Preset::Type preset_type, const wxSize& size = wxDefaultSize, PresetBundle* preset_bundle = nullptr);
|
||||
~PresetComboBox();
|
||||
|
||||
enum LabelItemType {
|
||||
LABEL_ITEM_PHYSICAL_PRINTER = 0xffffff01,
|
||||
LABEL_ITEM_DISABLED,
|
||||
LABEL_ITEM_MARKER,
|
||||
LABEL_ITEM_PHYSICAL_PRINTERS,
|
||||
LABEL_ITEM_WIZARD_PRINTERS,
|
||||
LABEL_ITEM_WIZARD_FILAMENTS,
|
||||
LABEL_ITEM_WIZARD_MATERIALS,
|
||||
LABEL_ITEM_WIZARD_ADD_PRINTERS,
|
||||
LABEL_ITEM_WIZARD_CONFIGS,
|
||||
|
||||
LABEL_ITEM_MAX,
|
||||
};
|
||||
|
||||
void set_label_marker(int item, LabelItemType label_item_type = LABEL_ITEM_MARKER);
|
||||
bool set_printer_technology(PrinterTechnology pt);
|
||||
|
||||
void set_selection_changed_function(std::function<void(int)> sel_changed) { on_selection_changed = sel_changed; }
|
||||
|
||||
bool is_selected_physical_printer();
|
||||
|
||||
// Return true, if physical printer was selected
|
||||
// and next internal selection was accomplished
|
||||
bool selection_is_changed_according_to_physical_printers();
|
||||
|
||||
void update(std::string select_preset);
|
||||
// select preset which is selected in PreseBundle
|
||||
void update_from_bundle();
|
||||
|
||||
// BBS: ams
|
||||
void add_ams_filaments(std::string selected, bool alias_name = false);
|
||||
int selected_ams_filament() const;
|
||||
|
||||
void set_filament_idx(const int extr_idx) { m_filament_idx = extr_idx; }
|
||||
int get_filament_idx() const { return m_filament_idx; }
|
||||
|
||||
// BBS
|
||||
wxString get_tooltip(const Preset& preset);
|
||||
|
||||
static wxColor different_color(wxColor const & color);
|
||||
|
||||
virtual wxString get_preset_name(const Preset& preset);
|
||||
Preset::Type get_type() { return m_type; }
|
||||
void show_all(bool show_all);
|
||||
virtual void update();
|
||||
virtual void msw_rescale();
|
||||
virtual void sys_color_changed();
|
||||
virtual void OnSelect(wxCommandEvent& evt);
|
||||
|
||||
protected:
|
||||
typedef std::size_t Marker;
|
||||
std::function<void(int)> on_selection_changed { nullptr };
|
||||
|
||||
Preset::Type m_type;
|
||||
std::string m_main_bitmap_name;
|
||||
|
||||
PresetBundle* m_preset_bundle {nullptr};
|
||||
PresetCollection* m_collection {nullptr};
|
||||
|
||||
// Caching bitmaps for the all bitmaps, used in preset comboboxes
|
||||
static BitmapCache& bitmap_cache();
|
||||
|
||||
// Indicator, that the preset is compatible with the selected printer.
|
||||
ScalableBitmap m_bitmapCompatible;
|
||||
// Indicator, that the preset is NOT compatible with the selected printer.
|
||||
ScalableBitmap m_bitmapIncompatible;
|
||||
|
||||
int m_last_selected;
|
||||
int m_em_unit;
|
||||
bool m_suppress_change { true };
|
||||
|
||||
// BBS: ams
|
||||
int m_filament_idx = -1;
|
||||
int m_first_ams_filament = 0;
|
||||
int m_last_ams_filament = 0;
|
||||
|
||||
// parameters for an icon's drawing
|
||||
int icon_height;
|
||||
int norm_icon_width;
|
||||
int thin_icon_width;
|
||||
int wide_icon_width;
|
||||
int space_icon_width;
|
||||
int thin_space_icon_width;
|
||||
int wide_space_icon_width;
|
||||
|
||||
PrinterTechnology printer_technology {ptAny};
|
||||
|
||||
void invalidate_selection();
|
||||
void validate_selection(bool predicate = false);
|
||||
void update_selection();
|
||||
|
||||
// BBS: ams
|
||||
int update_ams_color();
|
||||
|
||||
#ifdef __linux__
|
||||
static const char* separator_head() { return "------- "; }
|
||||
static const char* separator_tail() { return " -------"; }
|
||||
#else // __linux__
|
||||
static const char* separator_head() { return "------ "; }
|
||||
static const char* separator_tail() { return " ------"; }
|
||||
#endif // __linux__
|
||||
static wxString separator(const std::string& label);
|
||||
|
||||
wxBitmap* get_bmp( std::string bitmap_key, bool wide_icons, const std::string& main_icon_name,
|
||||
bool is_compatible = true, bool is_system = false, bool is_single_bar = false,
|
||||
const std::string& filament_rgb = "", const std::string& extruder_rgb = "", const std::string& material_rgb = "");
|
||||
|
||||
wxBitmap* get_bmp( std::string bitmap_key, const std::string& main_icon_name, const std::string& next_icon_name,
|
||||
bool is_enabled = true, bool is_compatible = true, bool is_system = false);
|
||||
|
||||
wxBitmap *get_bmp(Preset const &preset);
|
||||
|
||||
private:
|
||||
void fill_width_height();
|
||||
};
|
||||
|
||||
|
||||
// ---------------------------------
|
||||
// *** PlaterPresetComboBox ***
|
||||
// ---------------------------------
|
||||
|
||||
class PlaterPresetComboBox : public PresetComboBox
|
||||
{
|
||||
public:
|
||||
PlaterPresetComboBox(wxWindow *parent, Preset::Type preset_type);
|
||||
~PlaterPresetComboBox();
|
||||
|
||||
ScalableButton* edit_btn { nullptr };
|
||||
|
||||
// BBS
|
||||
wxButton* clr_picker { nullptr };
|
||||
wxColourData m_clrData;
|
||||
|
||||
wxColor get_color() { return m_color; }
|
||||
|
||||
bool switch_to_tab();
|
||||
void change_extruder_color();
|
||||
void show_add_menu();
|
||||
void show_edit_menu();
|
||||
|
||||
wxString get_preset_name(const Preset& preset) override;
|
||||
void update() override;
|
||||
void msw_rescale() override;
|
||||
void OnSelect(wxCommandEvent& evt) override;
|
||||
|
||||
private:
|
||||
// BBS
|
||||
wxColor m_color;
|
||||
};
|
||||
|
||||
|
||||
// ---------------------------------
|
||||
// *** TabPresetComboBox ***
|
||||
// ---------------------------------
|
||||
|
||||
class TabPresetComboBox : public PresetComboBox
|
||||
{
|
||||
bool show_incompatible {false};
|
||||
bool m_enable_all {false};
|
||||
|
||||
public:
|
||||
TabPresetComboBox(wxWindow *parent, Preset::Type preset_type);
|
||||
~TabPresetComboBox() {}
|
||||
void set_show_incompatible_presets(bool show_incompatible_presets) {
|
||||
show_incompatible = show_incompatible_presets;
|
||||
}
|
||||
|
||||
wxString get_preset_name(const Preset& preset) override;
|
||||
void update() override;
|
||||
void update_dirty();
|
||||
void msw_rescale() override;
|
||||
void OnSelect(wxCommandEvent& evt) override;
|
||||
|
||||
void set_enable_all(bool enable=true) { m_enable_all = enable; }
|
||||
|
||||
PresetCollection* presets() const { return m_collection; }
|
||||
Preset::Type type() const { return m_type; }
|
||||
};
|
||||
|
||||
// ---------------------------------
|
||||
// *** CalibrateFilamentComboBox ***
|
||||
// ---------------------------------
|
||||
|
||||
class CalibrateFilamentComboBox : public PlaterPresetComboBox
|
||||
{
|
||||
public:
|
||||
CalibrateFilamentComboBox(wxWindow *parent);
|
||||
~CalibrateFilamentComboBox();
|
||||
|
||||
void load_tray(DynamicPrintConfig & config);
|
||||
|
||||
void update() override;
|
||||
void msw_rescale() override;
|
||||
void OnSelect(wxCommandEvent &evt) override;
|
||||
const Preset* get_selected_preset() { return m_selected_preset; }
|
||||
std::string get_tray_name() { return m_tray_name; }
|
||||
std::string get_tag_uid() { return m_tag_uid; }
|
||||
bool is_tray_exist() { return m_filament_exist; }
|
||||
bool is_compatible_with_printer() { return m_is_compatible; }
|
||||
|
||||
private:
|
||||
std::string m_tray_name;
|
||||
std::string m_filament_id;
|
||||
std::string m_tag_uid;
|
||||
std::string m_filament_type;
|
||||
std::string m_filament_color;
|
||||
bool m_filament_exist{false};
|
||||
bool m_is_compatible{true};
|
||||
const Preset* m_selected_preset = nullptr;
|
||||
std::map<wxString, std::pair<std::string, wxBitmap*>> m_nonsys_presets;
|
||||
std::map<wxString, std::pair<std::string, wxBitmap*>> m_system_presets;
|
||||
};
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
#endif
|
|
@ -2999,72 +2999,72 @@ void TabFilament::build()
|
|||
load_initial_data();
|
||||
|
||||
auto page = add_options_page(L("Filament"), "spool");
|
||||
//BBS
|
||||
auto optgroup = page->new_optgroup(L("Basic information"), L"param_information");
|
||||
// Set size as all another fields for a better alignment
|
||||
Option option = optgroup->get_option("filament_type");
|
||||
option.opt.width = Field::def_width();
|
||||
optgroup->append_single_option_line(option);
|
||||
optgroup->append_single_option_line("filament_vendor");
|
||||
optgroup->append_single_option_line("filament_soluble");
|
||||
// BBS
|
||||
optgroup->append_single_option_line("filament_is_support");
|
||||
//optgroup->append_single_option_line("filament_colour");
|
||||
optgroup->append_single_option_line("required_nozzle_HRC");
|
||||
optgroup->append_single_option_line("default_filament_colour");
|
||||
optgroup->append_single_option_line("filament_diameter");
|
||||
optgroup->append_single_option_line("filament_flow_ratio");
|
||||
optgroup->append_single_option_line("enable_pressure_advance");
|
||||
optgroup->append_single_option_line("pressure_advance");
|
||||
optgroup->append_single_option_line("filament_density");
|
||||
optgroup->append_single_option_line("filament_cost");
|
||||
//BBS
|
||||
optgroup->append_single_option_line("temperature_vitrification");
|
||||
Line line = { L("Recommended nozzle temperature"), L("Recommended nozzle temperature range of this filament. 0 means no set") };
|
||||
line.append_option(optgroup->get_option("nozzle_temperature_range_low"));
|
||||
line.append_option(optgroup->get_option("nozzle_temperature_range_high"));
|
||||
optgroup->append_line(line);
|
||||
//BBS
|
||||
auto optgroup = page->new_optgroup(L("Basic information"), L"param_information");
|
||||
// Set size as all another fields for a better alignment
|
||||
Option option = optgroup->get_option("filament_type");
|
||||
option.opt.width = Field::def_width();
|
||||
optgroup->append_single_option_line(option);
|
||||
optgroup->append_single_option_line("filament_vendor");
|
||||
optgroup->append_single_option_line("filament_soluble");
|
||||
// BBS
|
||||
optgroup->append_single_option_line("filament_is_support");
|
||||
//optgroup->append_single_option_line("filament_colour");
|
||||
optgroup->append_single_option_line("required_nozzle_HRC");
|
||||
optgroup->append_single_option_line("default_filament_colour");
|
||||
optgroup->append_single_option_line("filament_diameter");
|
||||
optgroup->append_single_option_line("filament_flow_ratio");
|
||||
optgroup->append_single_option_line("enable_pressure_advance");
|
||||
optgroup->append_single_option_line("pressure_advance");
|
||||
optgroup->append_single_option_line("filament_density");
|
||||
optgroup->append_single_option_line("filament_cost");
|
||||
//BBS
|
||||
optgroup->append_single_option_line("temperature_vitrification");
|
||||
Line line = { L("Recommended nozzle temperature"), L("Recommended nozzle temperature range of this filament. 0 means no set") };
|
||||
line.append_option(optgroup->get_option("nozzle_temperature_range_low"));
|
||||
line.append_option(optgroup->get_option("nozzle_temperature_range_high"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
optgroup->m_on_change = [this, optgroup](t_config_option_key opt_key, boost::any value) {
|
||||
DynamicPrintConfig &filament_config = wxGetApp().preset_bundle->filaments.get_edited_preset().config;
|
||||
optgroup->m_on_change = [this, optgroup](t_config_option_key opt_key, boost::any value) {
|
||||
DynamicPrintConfig& filament_config = wxGetApp().preset_bundle->filaments.get_edited_preset().config;
|
||||
|
||||
update_dirty();
|
||||
if (!m_postpone_update_ui && (opt_key == "nozzle_temperature_range_low" || opt_key == "nozzle_temperature_range_high")) {
|
||||
m_config_manipulation.check_nozzle_recommended_temperature_range(&filament_config);
|
||||
}
|
||||
on_value_change(opt_key, value);
|
||||
update_dirty();
|
||||
if (!m_postpone_update_ui && (opt_key == "nozzle_temperature_range_low" || opt_key == "nozzle_temperature_range_high")) {
|
||||
m_config_manipulation.check_nozzle_recommended_temperature_range(&filament_config);
|
||||
}
|
||||
on_value_change(opt_key, value);
|
||||
};
|
||||
|
||||
|
||||
optgroup = page->new_optgroup(L("Print temperature"), L"param_temperature");
|
||||
optgroup->append_single_option_line("chamber_temperatures","chamber-temperature");
|
||||
optgroup = page->new_optgroup(L("Print temperature"), L"param_temperature");
|
||||
optgroup->append_single_option_line("chamber_temperatures", "chamber-temperature");
|
||||
|
||||
line = { L("Nozzle"), L("Nozzle temperature when printing") };
|
||||
line.append_option(optgroup->get_option("nozzle_temperature_initial_layer"));
|
||||
line.append_option(optgroup->get_option("nozzle_temperature"));
|
||||
optgroup->append_line(line);
|
||||
line = { L("Nozzle"), L("Nozzle temperature when printing") };
|
||||
line.append_option(optgroup->get_option("nozzle_temperature_initial_layer"));
|
||||
line.append_option(optgroup->get_option("nozzle_temperature"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
line = { L("Cool Plate / PLA Plate"), L("Bed temperature when cool plate is installed. Value 0 means the filament does not support to print on the Cool Plate") };
|
||||
line.append_option(optgroup->get_option("cool_plate_temp_initial_layer"));
|
||||
line.append_option(optgroup->get_option("cool_plate_temp"));
|
||||
optgroup->append_line(line);
|
||||
line = { L("Cool Plate / PLA Plate"), L("Bed temperature when cool plate is installed. Value 0 means the filament does not support to print on the Cool Plate") };
|
||||
line.append_option(optgroup->get_option("cool_plate_temp_initial_layer"));
|
||||
line.append_option(optgroup->get_option("cool_plate_temp"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
line = { L("Engineering Plate"), L("Bed temperature when engineering plate is installed. Value 0 means the filament does not support to print on the Engineering Plate") };
|
||||
line.append_option(optgroup->get_option("eng_plate_temp_initial_layer"));
|
||||
line.append_option(optgroup->get_option("eng_plate_temp"));
|
||||
optgroup->append_line(line);
|
||||
line = { L("Engineering Plate"), L("Bed temperature when engineering plate is installed. Value 0 means the filament does not support to print on the Engineering Plate") };
|
||||
line.append_option(optgroup->get_option("eng_plate_temp_initial_layer"));
|
||||
line.append_option(optgroup->get_option("eng_plate_temp"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
line = {L("Smooth PEI Plate / High Temp Plate"), L("Bed temperature when Smooth PEI Plate/High temperature plate is installed. Value 0 means the filament does not support to print on the Smooth PEI Plate/High Temp Plate") };
|
||||
line.append_option(optgroup->get_option("hot_plate_temp_initial_layer"));
|
||||
line.append_option(optgroup->get_option("hot_plate_temp"));
|
||||
optgroup->append_line(line);
|
||||
line = { L("Smooth PEI Plate / High Temp Plate"), L("Bed temperature when Smooth PEI Plate/High temperature plate is installed. Value 0 means the filament does not support to print on the Smooth PEI Plate/High Temp Plate") };
|
||||
line.append_option(optgroup->get_option("hot_plate_temp_initial_layer"));
|
||||
line.append_option(optgroup->get_option("hot_plate_temp"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
line = {L("Textured PEI Plate"), L("Bed temperature when Textured PEI Plate is installed. Value 0 means the filament does not support to print on the Textured PEI Plate")};
|
||||
line.append_option(optgroup->get_option("textured_plate_temp_initial_layer"));
|
||||
line.append_option(optgroup->get_option("textured_plate_temp"));
|
||||
optgroup->append_line(line);
|
||||
line = { L("Textured PEI Plate"), L("Bed temperature when Textured PEI Plate is installed. Value 0 means the filament does not support to print on the Textured PEI Plate") };
|
||||
line.append_option(optgroup->get_option("textured_plate_temp_initial_layer"));
|
||||
line.append_option(optgroup->get_option("textured_plate_temp"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
optgroup->m_on_change = [this, optgroup](t_config_option_key opt_key, boost::any value)
|
||||
optgroup->m_on_change = [this, optgroup](t_config_option_key opt_key, boost::any value)
|
||||
{
|
||||
DynamicPrintConfig& filament_config = wxGetApp().preset_bundle->filaments.get_edited_preset().config;
|
||||
|
||||
|
@ -3094,104 +3094,104 @@ void TabFilament::build()
|
|||
on_value_change(opt_key, value);
|
||||
};
|
||||
|
||||
//BBS
|
||||
optgroup = page->new_optgroup(L("Volumetric speed limitation"), L"param_volumetric_speed");
|
||||
optgroup->append_single_option_line("filament_max_volumetric_speed");
|
||||
//BBS
|
||||
optgroup = page->new_optgroup(L("Volumetric speed limitation"), L"param_volumetric_speed");
|
||||
optgroup->append_single_option_line("filament_max_volumetric_speed");
|
||||
|
||||
//line = { "", "" };
|
||||
//line.full_width = 1;
|
||||
//line.widget = [this](wxWindow* parent) {
|
||||
// return description_line_widget(parent, &m_volumetric_speed_description_line);
|
||||
//};
|
||||
//optgroup->append_line(line);
|
||||
//line = { "", "" };
|
||||
//line.full_width = 1;
|
||||
//line.widget = [this](wxWindow* parent) {
|
||||
// return description_line_widget(parent, &m_volumetric_speed_description_line);
|
||||
//};
|
||||
//optgroup->append_line(line);
|
||||
|
||||
page = add_options_page(L("Cooling"), "empty");
|
||||
|
||||
//line = { "", "" };
|
||||
//line.full_width = 1;
|
||||
//line.widget = [this](wxWindow* parent) {
|
||||
// return description_line_widget(parent, &m_cooling_description_line);
|
||||
//};
|
||||
//optgroup->append_line(line);
|
||||
optgroup = page->new_optgroup(L("Cooling for specific layer"), L"param_cooling");
|
||||
//line = { "", "" };
|
||||
//line.full_width = 1;
|
||||
//line.widget = [this](wxWindow* parent) {
|
||||
// return description_line_widget(parent, &m_cooling_description_line);
|
||||
//};
|
||||
//optgroup->append_line(line);
|
||||
optgroup = page->new_optgroup(L("Cooling for specific layer"), L"param_cooling");
|
||||
optgroup->append_single_option_line("close_fan_the_first_x_layers", "auto-cooling");
|
||||
//optgroup->append_single_option_line("full_fan_speed_layer");
|
||||
//optgroup->append_single_option_line("full_fan_speed_layer");
|
||||
|
||||
optgroup = page->new_optgroup(L("Part cooling fan"), L"param_cooling_fan");
|
||||
line = { L("Min fan speed threshold"), L("Part cooling fan speed will start to run at min speed when the estimated layer time is no longer than the layer time in setting. When layer time is shorter than threshold, fan speed is interpolated between the minimum and maximum fan speed according to layer printing time") };
|
||||
line.label_path = "auto-cooling";
|
||||
line.append_option(optgroup->get_option("fan_min_speed"));
|
||||
line.append_option(optgroup->get_option("fan_cooling_layer_time"));
|
||||
optgroup->append_line(line);
|
||||
line = { L("Max fan speed threshold"), L("Part cooling fan speed will be max when the estimated layer time is shorter than the setting value") };
|
||||
line.label_path = "auto-cooling";
|
||||
line.append_option(optgroup->get_option("fan_max_speed"));
|
||||
line.append_option(optgroup->get_option("slow_down_layer_time"));
|
||||
optgroup->append_line(line);
|
||||
optgroup->append_single_option_line("reduce_fan_stop_start_freq", "auto-cooling");
|
||||
optgroup->append_single_option_line("slow_down_for_layer_cooling", "auto-cooling");
|
||||
optgroup->append_single_option_line("slow_down_min_speed","auto-cooling");
|
||||
optgroup = page->new_optgroup(L("Part cooling fan"), L"param_cooling_fan");
|
||||
line = { L("Min fan speed threshold"), L("Part cooling fan speed will start to run at min speed when the estimated layer time is no longer than the layer time in setting. When layer time is shorter than threshold, fan speed is interpolated between the minimum and maximum fan speed according to layer printing time") };
|
||||
line.label_path = "auto-cooling";
|
||||
line.append_option(optgroup->get_option("fan_min_speed"));
|
||||
line.append_option(optgroup->get_option("fan_cooling_layer_time"));
|
||||
optgroup->append_line(line);
|
||||
line = { L("Max fan speed threshold"), L("Part cooling fan speed will be max when the estimated layer time is shorter than the setting value") };
|
||||
line.label_path = "auto-cooling";
|
||||
line.append_option(optgroup->get_option("fan_max_speed"));
|
||||
line.append_option(optgroup->get_option("slow_down_layer_time"));
|
||||
optgroup->append_line(line);
|
||||
optgroup->append_single_option_line("reduce_fan_stop_start_freq", "auto-cooling");
|
||||
optgroup->append_single_option_line("slow_down_for_layer_cooling", "auto-cooling");
|
||||
optgroup->append_single_option_line("slow_down_min_speed", "auto-cooling");
|
||||
|
||||
optgroup->append_single_option_line("enable_overhang_bridge_fan", "auto-cooling");
|
||||
optgroup->append_single_option_line("overhang_fan_threshold", "auto-cooling");
|
||||
optgroup->append_single_option_line("overhang_fan_speed", "auto-cooling");
|
||||
optgroup->append_single_option_line("enable_overhang_bridge_fan", "auto-cooling");
|
||||
optgroup->append_single_option_line("overhang_fan_threshold", "auto-cooling");
|
||||
optgroup->append_single_option_line("overhang_fan_speed", "auto-cooling");
|
||||
|
||||
optgroup = page->new_optgroup(L("Auxiliary part cooling fan"), L"param_cooling_fan");
|
||||
optgroup->append_single_option_line("additional_cooling_fan_speed");
|
||||
optgroup = page->new_optgroup(L("Auxiliary part cooling fan"), L"param_cooling_fan");
|
||||
optgroup->append_single_option_line("additional_cooling_fan_speed");
|
||||
|
||||
optgroup = page->new_optgroup(L("Exhaust fan"),L"param_cooling_fan");
|
||||
optgroup = page->new_optgroup(L("Exhaust fan"), L"param_cooling_fan");
|
||||
|
||||
optgroup->append_single_option_line("activate_air_filtration");
|
||||
optgroup->append_single_option_line("activate_air_filtration");
|
||||
|
||||
line = {L("During print"), ""};
|
||||
line.append_option(optgroup->get_option("during_print_exhaust_fan_speed"));
|
||||
optgroup->append_line(line);
|
||||
line = { L("During print"), "" };
|
||||
line.append_option(optgroup->get_option("during_print_exhaust_fan_speed"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
|
||||
line = {L("Complete print"), ""};
|
||||
line.append_option(optgroup->get_option("complete_print_exhaust_fan_speed"));
|
||||
optgroup->append_line(line);
|
||||
//BBS
|
||||
// add_filament_overrides_page();
|
||||
line = { L("Complete print"), "" };
|
||||
line.append_option(optgroup->get_option("complete_print_exhaust_fan_speed"));
|
||||
optgroup->append_line(line);
|
||||
//BBS
|
||||
add_filament_overrides_page();
|
||||
#if 0
|
||||
//page = add_options_page(L("Advanced"), "advanced");
|
||||
// optgroup = page->new_optgroup(L("Wipe tower parameters"));
|
||||
// optgroup->append_single_option_line("filament_minimal_purge_on_wipe_tower");
|
||||
#endif
|
||||
|
||||
const int gcode_field_height = 15; // 150
|
||||
const int notes_field_height = 25; // 250
|
||||
const int gcode_field_height = 15; // 150
|
||||
const int notes_field_height = 25; // 250
|
||||
|
||||
page = add_options_page(L("Advanced"), "advanced");
|
||||
optgroup = page->new_optgroup(L("Filament start G-code"), L"param_gcode", 0);
|
||||
optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) {
|
||||
validate_custom_gcode_cb(this, optgroup, opt_key, value);
|
||||
optgroup = page->new_optgroup(L("Filament start G-code"), L"param_gcode", 0);
|
||||
optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) {
|
||||
validate_custom_gcode_cb(this, optgroup, opt_key, value);
|
||||
};
|
||||
option = optgroup->get_option("filament_start_gcode");
|
||||
option.opt.full_width = true;
|
||||
option.opt.is_code = true;
|
||||
option.opt.height = gcode_field_height;// 150;
|
||||
optgroup->append_single_option_line(option);
|
||||
option = optgroup->get_option("filament_start_gcode");
|
||||
option.opt.full_width = true;
|
||||
option.opt.is_code = true;
|
||||
option.opt.height = gcode_field_height;// 150;
|
||||
optgroup->append_single_option_line(option);
|
||||
|
||||
optgroup = page->new_optgroup(L("Filament end G-code"), L"param_gcode", 0);
|
||||
optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) {
|
||||
validate_custom_gcode_cb(this, optgroup, opt_key, value);
|
||||
optgroup = page->new_optgroup(L("Filament end G-code"), L"param_gcode", 0);
|
||||
optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) {
|
||||
validate_custom_gcode_cb(this, optgroup, opt_key, value);
|
||||
};
|
||||
option = optgroup->get_option("filament_end_gcode");
|
||||
option.opt.full_width = true;
|
||||
option.opt.is_code = true;
|
||||
option.opt.height = gcode_field_height;// 150;
|
||||
optgroup->append_single_option_line(option);
|
||||
option = optgroup->get_option("filament_end_gcode");
|
||||
option.opt.full_width = true;
|
||||
option.opt.is_code = true;
|
||||
option.opt.height = gcode_field_height;// 150;
|
||||
optgroup->append_single_option_line(option);
|
||||
|
||||
page = add_options_page(L("Notes"), "note");
|
||||
optgroup = page->new_optgroup(L("Notes"),"note");
|
||||
optgroup->label_width = 0;
|
||||
option = optgroup->get_option("filament_notes");
|
||||
option.opt.full_width = true;
|
||||
option.opt.height = notes_field_height;
|
||||
optgroup->append_single_option_line(option);
|
||||
optgroup = page->new_optgroup(L("Notes"), "note");
|
||||
optgroup->label_width = 0;
|
||||
option = optgroup->get_option("filament_notes");
|
||||
option.opt.full_width = true;
|
||||
option.opt.height = notes_field_height;
|
||||
optgroup->append_single_option_line(option);
|
||||
|
||||
//BBS
|
||||
//BBS
|
||||
#if 0
|
||||
//page = add_options_page(L("Dependencies"), "advanced");
|
||||
// optgroup = page->new_optgroup(L("Profile dependencies"));
|
||||
|
@ -4401,19 +4401,19 @@ void TabConfig::reload_config()
|
|||
//this->compatible_widget_reload(m_compatible_prints);
|
||||
Tab::reload_config();
|
||||
}
|
||||
void TabConfig::update_description_lines()
|
||||
{
|
||||
Tab::update_description_lines();
|
||||
|
||||
if (!m_active_page)
|
||||
return;
|
||||
|
||||
//if (m_active_page->title() == "Cooling" && m_cooling_description_line)
|
||||
// m_cooling_description_line->SetText(from_u8(PresetHints::cooling_description(m_presets->get_edited_preset())));
|
||||
//BBS
|
||||
//if (m_active_page->title() == "Filament" && m_volumetric_speed_description_line)
|
||||
// this->update_volumetric_flow_preset_hints();
|
||||
}
|
||||
//void TabConfig::update_description_lines()
|
||||
//{
|
||||
// Tab::update_description_lines();
|
||||
//
|
||||
// if (!m_active_page)
|
||||
// return;
|
||||
//
|
||||
// //if (m_active_page->title() == "Cooling" && m_cooling_description_line)
|
||||
// // m_cooling_description_line->SetText(from_u8(PresetHints::cooling_description(m_presets->get_edited_preset())));
|
||||
// //BBS
|
||||
// //if (m_active_page->title() == "Filament" && m_volumetric_speed_description_line)
|
||||
// // this->update_volumetric_flow_preset_hints();
|
||||
//}
|
||||
void TabConfig::toggle_options() {
|
||||
if (!m_active_page)
|
||||
return;
|
||||
|
@ -4422,49 +4422,211 @@ void TabConfig::toggle_options() {
|
|||
if (m_preset_bundle) {
|
||||
is_BBL_printer = m_preset_bundle->configs.get_edited_preset().is_bbl_vendor_preset(m_preset_bundle);
|
||||
}
|
||||
|
||||
/* const Preset& preset = m_preset_bundle->configs.get_edited_preset();
|
||||
bool is_BBL = preset.is_system;*/
|
||||
//if (m_active_page->title() == "Quality") {
|
||||
//toggle_line("printable_area", !is_configed_by_BBL);//all printer can entry and view data
|
||||
//toggle_option("single_extruder_multi_material", have_multiple_extruders);
|
||||
//BBS: gcode_flavore of BBL printer can't be edited and changed
|
||||
//toggle_option("gcode_flavor", !is_BBL_printer);
|
||||
//toggle_option("thumbnail_size", !is_BBL_printer);
|
||||
//toggle_option("printer_structure", !is_BBL_printer);
|
||||
//toggle_option("use_relative_e_distances", !is_BBL_printer);
|
||||
//toggle_option("support_chamber_temp_control", !is_BBL_printer);
|
||||
//toggle_option("use_firmware_retraction", !is_BBL_printer);
|
||||
//toggle_option("support_air_filtration", is_BBL_printer);
|
||||
//auto flavor = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
|
||||
//bool is_marlin_flavor = flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware;
|
||||
//// Disable silent mode for non-marlin firmwares.
|
||||
//toggle_option("silent_mode", is_marlin_flavor);
|
||||
////BBS: extruder clearance of BBL printer can't be edited.
|
||||
//for (auto el : { "extruder_clearance_max_radius", "extruder_clearance_height_to_rod", "extruder_clearance_height_to_lid" })
|
||||
// toggle_option(el, !is_BBL_printer);
|
||||
//}
|
||||
|
||||
/* if (m_active_page->title() == "Strength") {
|
||||
toggle_line("time_lapse_gcode", m_preset_bundle->configs.get_edited_preset().config.opt_enum<PrinterStructure>("printer_structure") == PrinterStructure::psI3);
|
||||
toggle_option("thumbnail_size", !is_BBL_printer);
|
||||
//std::string cde = "1";
|
||||
//m_preset_bundle->filament_presets
|
||||
/* for (auto& f : m_preset_bundle->filament_presets) {
|
||||
cde = f;
|
||||
}*/
|
||||
|
||||
//p->combos_filament
|
||||
//m_preset_bundle->configs.update_dirty();
|
||||
//wxString abc = wxString::FromUTF8( m_preset_bundle->configs.get_selected_preset().name);
|
||||
wxString abc = wxGetApp().get_tab(Preset::TYPE_CONFIG)->get_combo_box()->GetTextLabel();
|
||||
//wxString abc = wxString::FromUTF8( m_preset_bundle->configs.get_edited_preset().name);
|
||||
//InfillPattern bcd = m_preset_bundle->configs.get_edited_preset().config.opt_enum<InfillPattern>("top_surface_pattern");
|
||||
wxString lian_xu = _L("Lian xu");
|
||||
if (abc.Contains(lian_xu)) {
|
||||
BitmapCache concentric_cache;
|
||||
wxBitmap concentric_bmp = *concentric_cache.load_svg("param_concentric", FromDIP(23), FromDIP(23));
|
||||
BitmapCache zig_cache;
|
||||
wxBitmap zig_bmp = *zig_cache.load_svg("param_zig-zag", FromDIP(23), FromDIP(23));
|
||||
BitmapCache monotonic_cache;
|
||||
wxBitmap monotonic_bmp = *monotonic_cache.load_svg("param_monotonic", FromDIP(23), FromDIP(23));
|
||||
BitmapCache monotonicline_cache;
|
||||
wxBitmap monotonicline_bmp = *monotonicline_cache.load_svg("param_monotonicline", FromDIP(23), FromDIP(23));
|
||||
BitmapCache alignedrectilinear_cache;
|
||||
wxBitmap alignedrectilinear_bmp = *alignedrectilinear_cache.load_svg("param_alignedrectilinear", FromDIP(23), FromDIP(23));
|
||||
BitmapCache fiberspiral_cache;
|
||||
wxBitmap fiberspiral_bmp = *fiberspiral_cache.load_svg("param_fiberspiral", FromDIP(23), FromDIP(23));
|
||||
|
||||
BitmapCache grid_cache;
|
||||
wxBitmap grid_bmp = *grid_cache.load_svg("param_grid", FromDIP(23), FromDIP(23));
|
||||
BitmapCache line_cache;
|
||||
wxBitmap line_bmp = *line_cache.load_svg("param_line", FromDIP(23), FromDIP(23));
|
||||
//BitmapCache cubic_cache;
|
||||
//wxBitmap cubic_bmp = *cubic_cache.load_svg("param_cubic", FromDIP(23), FromDIP(23));
|
||||
//BitmapCache triangles_cache;
|
||||
//wxBitmap triangles_bmp = *triangles_cache.load_svg("param_triangles", FromDIP(23), FromDIP(23));
|
||||
//BitmapCache tri_cache;
|
||||
//wxBitmap tri_bmp = *tri_cache.load_svg("param_tri-hexagon", FromDIP(23), FromDIP(23));
|
||||
//BitmapCache gyroid_cache;
|
||||
//wxBitmap gyroid_bmp = *gyroid_cache.load_svg("param_gyroid", FromDIP(23), FromDIP(23));
|
||||
BitmapCache honeycomb_cache;
|
||||
wxBitmap honeycomb_bmp = *honeycomb_cache.load_svg("param_honeycomb", FromDIP(23), FromDIP(23));
|
||||
BitmapCache adaptivecubic_cache;
|
||||
wxBitmap adaptivecubic_bmp = *adaptivecubic_cache.load_svg("param_adaptivecubic", FromDIP(23), FromDIP(23));
|
||||
BitmapCache dhoneycomb_cache;
|
||||
wxBitmap dhoneycomb_bmp = *dhoneycomb_cache.load_svg("param_3dhoneycomb", FromDIP(23), FromDIP(23));
|
||||
|
||||
|
||||
{
|
||||
Field* field = m_active_page->get_field("top_surface_pattern");
|
||||
if (auto choice = dynamic_cast<Choice*>(field)) {
|
||||
auto& opt = const_cast<ConfigOptionDef&>(field->m_opt);
|
||||
auto cb = dynamic_cast<ComboBox*>(choice->window);
|
||||
auto n = cb->GetValue();
|
||||
opt.enum_values.clear();
|
||||
opt.enum_labels.clear();
|
||||
cb->Clear();
|
||||
|
||||
opt.enum_values.push_back("concentric");
|
||||
opt.enum_values.push_back("zig-zag");
|
||||
opt.enum_values.push_back("monotonic");
|
||||
opt.enum_values.push_back("monotonicline");
|
||||
opt.enum_values.push_back("alignedrectilinear");
|
||||
opt.enum_values.push_back("fiberspiral");
|
||||
|
||||
opt.enum_labels.push_back(L("Concentric"));
|
||||
cb->Append(_L("Concentric"), concentric_bmp);
|
||||
opt.enum_labels.push_back(L("Rectilinear"));
|
||||
cb->Append(_L("Rectilinear"), zig_bmp);
|
||||
opt.enum_labels.push_back(L("Monotonic"));
|
||||
cb->Append(_L("Monotonic"), monotonic_bmp);
|
||||
opt.enum_labels.push_back(L("Monotonic line"));
|
||||
cb->Append(_L("Monotonic line"), monotonicline_bmp);
|
||||
opt.enum_labels.push_back(L("Aligned Rectilinear"));
|
||||
cb->Append(_L("Aligned Rectilinear"), alignedrectilinear_bmp);
|
||||
opt.enum_labels.push_back(L("Fiber Spiral"));
|
||||
cb->Append(_L("Fiber Spiral"), fiberspiral_bmp);
|
||||
|
||||
cb->SetValue(n);
|
||||
}
|
||||
}
|
||||
{
|
||||
Field* field = m_active_page->get_field("bottom_surface_pattern");
|
||||
if (auto choice = dynamic_cast<Choice*>(field)) {
|
||||
auto& opt = const_cast<ConfigOptionDef&>(field->m_opt);
|
||||
auto cb = dynamic_cast<ComboBox*>(choice->window);
|
||||
auto n = cb->GetValue();
|
||||
opt.enum_values.clear();
|
||||
opt.enum_labels.clear();
|
||||
cb->Clear();
|
||||
|
||||
opt.enum_values.push_back("concentric");
|
||||
opt.enum_values.push_back("zig-zag");
|
||||
opt.enum_values.push_back("monotonic");
|
||||
opt.enum_values.push_back("monotonicline");
|
||||
opt.enum_values.push_back("alignedrectilinear");
|
||||
opt.enum_values.push_back("fiberspiral");
|
||||
|
||||
opt.enum_labels.push_back(L("Concentric"));
|
||||
cb->Append(_L("Concentric"), concentric_bmp);
|
||||
opt.enum_labels.push_back(L("Rectilinear"));
|
||||
cb->Append(_L("Rectilinear"), zig_bmp);
|
||||
opt.enum_labels.push_back(L("Monotonic"));
|
||||
cb->Append(_L("Monotonic"), monotonic_bmp);
|
||||
opt.enum_labels.push_back(L("Monotonic line"));
|
||||
cb->Append(_L("Monotonic line"), monotonicline_bmp);
|
||||
opt.enum_labels.push_back(L("Aligned Rectilinear"));
|
||||
cb->Append(_L("Aligned Rectilinear"), alignedrectilinear_bmp);
|
||||
opt.enum_labels.push_back(L("Fiber Spiral"));
|
||||
cb->Append(_L("Fiber Spiral"), fiberspiral_bmp);
|
||||
|
||||
cb->SetValue(n);
|
||||
}
|
||||
}
|
||||
{
|
||||
Field * field = m_active_page->get_field("internal_solid_infill_pattern");
|
||||
if (auto choice = dynamic_cast<Choice*>(field)) {
|
||||
auto& opt = const_cast<ConfigOptionDef&>(field->m_opt);
|
||||
auto cb = dynamic_cast<ComboBox*>(choice->window);
|
||||
auto n = cb->GetValue();
|
||||
opt.enum_values.clear();
|
||||
opt.enum_labels.clear();
|
||||
cb->Clear();
|
||||
|
||||
opt.enum_values.push_back("concentric");
|
||||
opt.enum_values.push_back("zig-zag");
|
||||
opt.enum_values.push_back("monotonic");
|
||||
opt.enum_values.push_back("monotonicline");
|
||||
opt.enum_values.push_back("alignedrectilinear");
|
||||
opt.enum_values.push_back("fiberspiral");
|
||||
|
||||
opt.enum_labels.push_back(L("Concentric"));
|
||||
cb->Append(_L("Concentric"), concentric_bmp);
|
||||
opt.enum_labels.push_back(L("Rectilinear"));
|
||||
cb->Append(_L("Rectilinear"), zig_bmp);
|
||||
opt.enum_labels.push_back(L("Monotonic"));
|
||||
cb->Append(_L("Monotonic"), monotonic_bmp);
|
||||
opt.enum_labels.push_back(L("Monotonic line"));
|
||||
cb->Append(_L("Monotonic line"), monotonicline_bmp);
|
||||
opt.enum_labels.push_back(L("Aligned Rectilinear"));
|
||||
cb->Append(_L("Aligned Rectilinear"), alignedrectilinear_bmp);
|
||||
opt.enum_labels.push_back(L("Fiber Spiral"));
|
||||
cb->Append(_L("Fiber Spiral"), fiberspiral_bmp);
|
||||
|
||||
cb->SetValue(n);
|
||||
}
|
||||
}
|
||||
{
|
||||
Field* field = m_active_page->get_field("sparse_infill_pattern");
|
||||
if (auto choice = dynamic_cast<Choice*>(field)) {
|
||||
auto& opt = const_cast<ConfigOptionDef&>(field->m_opt);
|
||||
auto cb = dynamic_cast<ComboBox*>(choice->window);
|
||||
auto n = cb->GetValue();
|
||||
opt.enum_values.clear();
|
||||
opt.enum_labels.clear();
|
||||
cb->Clear();
|
||||
|
||||
opt.enum_values.push_back("concentric");
|
||||
opt.enum_values.push_back("zig-zag");
|
||||
opt.enum_values.push_back("grid");
|
||||
opt.enum_values.push_back("line");
|
||||
//opt.enum_values.push_back("cubic");
|
||||
//opt.enum_values.push_back("triangles");
|
||||
//opt.enum_values.push_back("tri-hexagon");
|
||||
//opt.enum_values.push_back("gyroid");
|
||||
opt.enum_values.push_back("honeycomb");
|
||||
opt.enum_values.push_back("adaptivecubic");
|
||||
opt.enum_values.push_back("alignedrectilinear");
|
||||
opt.enum_values.push_back("3dhoneycomb");
|
||||
opt.enum_values.push_back("fiberspiral");
|
||||
|
||||
opt.enum_labels.push_back(L("Concentric"));
|
||||
cb->Append(_L("Concentric"), concentric_bmp);
|
||||
opt.enum_labels.push_back(L("Rectilinear"));
|
||||
cb->Append(_L("Rectilinear"), zig_bmp);
|
||||
opt.enum_labels.push_back(L("Grid"));
|
||||
cb->Append(_L("Grid"), grid_bmp);
|
||||
opt.enum_labels.push_back(L("Line"));
|
||||
cb->Append(_L("Line"), line_bmp);
|
||||
//opt.enum_labels.push_back(L("Cubic"));
|
||||
//cb->Append(_L("Cubic"), cubic_bmp);
|
||||
//opt.enum_labels.push_back(L("Triangles"));
|
||||
//cb->Append(_L("Triangles"), triangles_bmp);
|
||||
//opt.enum_labels.push_back(L("Tri-hexagon"));
|
||||
//cb->Append(_L("Tri-hexagon"), tri_bmp);
|
||||
//opt.enum_labels.push_back(L("Gyroid"));
|
||||
//cb->Append(_L("Gyroid"), gyroid_bmp);
|
||||
opt.enum_labels.push_back(L("Honeycomb"));
|
||||
cb->Append(_L("Honeycomb"), honeycomb_bmp);
|
||||
opt.enum_labels.push_back(L("Adaptive Cubic"));
|
||||
cb->Append(_L("Adaptive Cubic"), adaptivecubic_bmp);
|
||||
opt.enum_labels.push_back(L("Aligned Rectilinear"));
|
||||
cb->Append(_L("Aligned Rectilinear"), alignedrectilinear_bmp);
|
||||
opt.enum_labels.push_back(L("3D Honeycomb"));
|
||||
cb->Append(_L("3D Honeycomb"), dhoneycomb_bmp);
|
||||
opt.enum_labels.push_back(L("Fiber Spiral"));
|
||||
cb->Append(_L("Fiber Spiral"), fiberspiral_bmp);
|
||||
|
||||
cb->SetValue(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void TabConfig::update() {
|
||||
|
||||
//m_update_cnt++;
|
||||
//update_description_lines();
|
||||
////BBS: GUI refactor
|
||||
////Layout();
|
||||
//m_parent->Layout();
|
||||
|
||||
m_update_cnt++;
|
||||
|
||||
update_description_lines();
|
||||
//BBS: GUI refactor
|
||||
//Layout();
|
||||
m_parent->Layout();
|
||||
|
||||
toggle_options();
|
||||
|
||||
m_update_cnt--;
|
||||
|
|
|
@ -585,7 +585,7 @@ public:
|
|||
|
||||
void build() override;
|
||||
void reload_config() override;
|
||||
void update_description_lines() override;
|
||||
//void update_description_lines() override;
|
||||
void toggle_options() override;
|
||||
void update() override;
|
||||
void clear_pages() override;
|
||||
|
|
Loading…
Reference in New Issue