配置功能再优化,但未能解决下拉列表数据回显。新增更多参数功能。软件启动页弹窗再优化

This commit is contained in:
cjw 2025-02-14 16:27:40 +08:00
parent 2faf0e1c86
commit ff1370ae7c
13 changed files with 1446 additions and 1165 deletions

View File

@ -805,13 +805,13 @@ static std::vector<std::string> s_Preset_print_options {
"minimum_sparse_infill_area", "reduce_infill_retraction", "ironing_pattern", "ironing_type",
"ironing_flow", "ironing_speed", "ironing_spacing","ironing_direction",
"max_travel_detour_distance",
"fuzzy_skin", "fuzzy_skin_thickness", "fuzzy_skin_point_distance",
"fuzzy_skin", "fuzzy_skin_thickness", "fuzzy_skin_point_distance","fibre_feed_rate",
#ifdef HAS_PRESSURE_EQUALIZER
"max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative",
#endif /* HAS_PRESSURE_EQUALIZER */
"inner_wall_speed", "outer_wall_speed", "sparse_infill_speed", "internal_solid_infill_speed",
"top_surface_speed", "support_speed", "support_object_xy_distance", "support_object_first_layer_gap","support_interface_speed",
"bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed", "outer_wall_acceleration",
"bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed", "outer_wall_acceleration","default_print_speed",
"initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "inner_wall_acceleration", "sparse_infill_acceleration",
"accel_to_decel_enable", "accel_to_decel_factor", "skirt_loops", "skirt_distance",
"skirt_height", "draft_shield",
@ -997,8 +997,14 @@ static std::vector<std::string> s_Preset_sla_printer_options {
"inherits"
};
static std::vector<std::string> s_Preset_config_options{
"initial_layer_print_height","initial_layer_line_width","outer_wall_line_width","inner_wall_line_width","top_surface_line_width","sparse_infill_line_width","support_line_width","resolution","enable_arc_fitting","wall_generator","wall_sequence",
"detect_thin_wall"
"initial_layer_print_height","initial_layer_line_width","outer_wall_line_width","inner_wall_line_width","top_surface_line_width","sparse_infill_line_width","support_line_width","seam_gap","seam_slope_conditional","scarf_angle_threshold","seam_slope_start_height",
"seam_slope_entire_loop","seam_slope_min_length","seam_slope_steps","seam_slope_inner_walls","wipe_speed","resolution","enable_arc_fitting","ironing_pattern","ironing_speed","ironing_flow","ironing_spacing","ironing_direction","wall_generator","wall_transition_angle",
"wall_transition_filter_deviation","wall_transition_length","wall_distribution_count","min_bead_width","min_feature_size","wall_sequence","top_one_wall_type","top_area_threshold","only_one_wall_first_layer","detect_overhang_wall","max_travel_detour_distance","support_base_pattern_spacing",
"support_interface_top_layers","support_interface_bottom_layers","support_bottom_interface_spacing","top_surface_pattern","bottom_surface_pattern","internal_solid_infill_pattern","sparse_infill_pattern","filter_out_gap_fill","bridge_angle","minimum_sparse_infill_area","infill_combination",
"default_print_speed","initial_layer_speed","initial_layer_infill_speed","outer_wall_speed","inner_wall_speed","sparse_infill_speed","internal_solid_infill_speed","top_surface_speed","bridge_speed","gap_infill_speed","support_speed","support_interface_speed","travel_speed",
"default_acceleration","accel_to_decel_enable","accel_to_decel_factor","support_type","support_style","support_threshold_angle","support_on_build_plate_only","support_critical_regions_only","support_remove_small_overhang","raft_layers","raft_contact_distance","raft_first_layer_density",
"support_filament","support_interface_filament","support_interface_not_for_body","raft_first_layer_expansion","tree_support_wall_count","support_base_pattern","support_interface_pattern","support_object_xy_distance","bridge_no_support","max_bridge_length","independent_support_layer_height",
"tree_support_branch_distance","tree_support_branch_diameter","tree_support_branch_angle","slicing_mode","fibre_feed_rate","print_sequence","spiral_mode","spiral_mode_smooth","spiral_mode_max_xy_smoothing","timelapse_type","fuzzy_skin","fuzzy_skin_point_distance","fuzzy_skin_thickness"
};
const std::vector<std::string>& Preset::print_options() { return s_Preset_print_options; }

View File

@ -577,8 +577,7 @@ PresetsConfigSubstitutions PresetBundle::load_user_presets(std::string user, For
std::string config_selected_preset_name = configs.get_selected_preset().name;
this->configs.load_presets(dir_user_presets, PRESET_CONFIG_NAME, substitutions, substitution_rule);
configs.select_preset_by_name(config_selected_preset_name, false);
}
catch (const std::runtime_error& err) {
}catch (const std::runtime_error& err) {
errors_cummulative += err.what();
}
if (!errors_cummulative.empty()) throw Slic3r::RuntimeError(errors_cummulative);
@ -1396,15 +1395,18 @@ std::vector<std::string> PresetBundle::merge_presets(PresetBundle &&other)
std::vector<std::string> duplicate_filaments = this->filaments .merge_presets(std::move(other.filaments), this->vendors);
std::vector<std::string> duplicate_sla_materials = this->sla_materials.merge_presets(std::move(other.sla_materials), this->vendors);
std::vector<std::string> duplicate_printers = this->printers .merge_presets(std::move(other.printers), this->vendors);
std::vector<std::string> duplicate_configs = this->configs .merge_presets(std::move(other.configs), this->vendors);
append(this->obsolete_presets.prints, std::move(other.obsolete_presets.prints));
append(this->obsolete_presets.sla_prints, std::move(other.obsolete_presets.sla_prints));
append(this->obsolete_presets.filaments, std::move(other.obsolete_presets.filaments));
append(this->obsolete_presets.sla_materials, std::move(other.obsolete_presets.sla_materials));
append(this->obsolete_presets.printers, std::move(other.obsolete_presets.printers));
append(this->obsolete_presets.configs, std::move(other.obsolete_presets.configs));
append(duplicate_prints, std::move(duplicate_sla_prints));
append(duplicate_prints, std::move(duplicate_filaments));
append(duplicate_prints, std::move(duplicate_sla_materials));
append(duplicate_prints, std::move(duplicate_printers));
append(duplicate_configs, std::move(duplicate_configs));
return duplicate_prints;
}
@ -1415,6 +1417,8 @@ void PresetBundle::update_system_maps()
this->filaments .update_map_system_profile_renamed();
this->sla_materials.update_map_system_profile_renamed();
this->printers .update_map_system_profile_renamed();
//xiamian+
//this->configs .update_map_system_profile_renamed();
this->prints .update_map_alias_to_profile_name();
this->sla_prints .update_map_alias_to_profile_name();
@ -1483,7 +1487,9 @@ void PresetBundle::save_changes_for_preset(const std::string& new_name, Preset::
PresetCollection& presets = type == Preset::TYPE_PRINT ? prints :
type == Preset::TYPE_SLA_PRINT ? sla_prints :
type == Preset::TYPE_FILAMENT ? filaments :
type == Preset::TYPE_SLA_MATERIAL ? sla_materials : printers;
type == Preset::TYPE_SLA_MATERIAL ? sla_materials :
type == Preset::TYPE_PRINTER ?printers :
configs;
// if we want to save just some from selected options
if (!unselected_options.empty()) {

View File

@ -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");
@ -1788,7 +1788,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 +1857,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 +3017,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");

View File

@ -33,6 +33,7 @@ public:
SP_FILAMENTS,
SP_MATERIALS,
SP_CUSTOM,
SP_CONFIGS,
};
ConfigWizard(wxWindow *parent);

View File

@ -4556,11 +4556,16 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
return;
const Size cnv_size = wxGetApp().plater()->get_current_canvas3D()->get_canvas_size();
//Plater s_panel = wxGetApp().plater();
//GLCanvas3D* s_panel = wxGetApp().plater()->get_current_canvas3D();
//wxPanel* s_panel = p->status_panel;
ImGuiWrapper& imgui = *wxGetApp().imgui();
//ImGuiWrapper& imgui2 = *wxGetApp().imgui();
//wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
//BBS: GUI refactor: move to the right
imgui.set_next_window_pos(float(canvas_width - right_margin * m_scale), 0.0f, ImGuiCond_Always, 1.0f, 0.0f);
//imgui2.set_next_window_pos(float(canvas_width - right_margin * m_scale), 1.0f, ImGuiCond_Always, 2.0f, 1.0f);
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0,0.0));
ImGui::PushStyleColor(ImGuiCol_Separator, ImVec4(1.0f,1.0f,1.0f,0.6f));
@ -4678,11 +4683,11 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
float dummy_size = type == EItemType::None ? window_padding * 3 : ImGui::GetStyle().ItemSpacing.x + icon_size;
ImGui::SameLine(dummy_size);
imgui.text(columns_offsets[0].first);
for (auto i = 1; i < columns_offsets.size(); i++) {
ImGui::SameLine(columns_offsets[i].second);
imgui.text(columns_offsets[i].first);
}
if (callback && !checkbox && !visible)
ImGui::PopStyleColor(1);
}
@ -4863,46 +4868,84 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
ImGui::PopStyleColor(3);
ImGui::PopStyleVar(1);
ImGui::SameLine();
imgui.bold_text(_u8L("Color Scheme"));
push_combo_style();
//xiamian+
//wxBoxSizer* moreOptionsSizer = new wxBoxSizer(wxVERTICAL);
imgui.bold_text(_u8L("More parameters"));
//push_combo_style();
ImGui::SameLine();
const char* view_type_value = view_type_items_str[m_view_type_sel].c_str();
ImGuiComboFlags flags = 0;
if (ImGui::BBLBeginCombo("", view_type_value, flags)) {
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0.0f);
for (int i = 0; i < view_type_items_str.size(); i++) {
const bool is_selected = (m_view_type_sel == i);
if (ImGui::BBLSelectable(view_type_items_str[i].c_str(), is_selected)) {
m_fold = false;
m_view_type_sel = i;
set_view_type(view_type_items[m_view_type_sel]);
reset_visible(view_type_items[m_view_type_sel]);
// update buffers' render paths
refresh_render_paths(false, false);
update_moves_slider();
wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
}
if (is_selected) {
ImGui::SetItemDefaultFocus();
}
}
ImGui::PopStyleVar(1);
ImGui::EndCombo();
}
pop_combo_style();
ImGui::SameLine();
ImGui::Dummy({ window_padding, window_padding });
////xiamian+
////wxBoxSizer* moreOptionsSizer = new wxBoxSizer(wxVERTICAL);
if (m_fold) {
//ImGui::SameLine();
//const char* view_type_value = view_type_items_str[m_view_type_sel].c_str();
//ImGuiComboFlags flags = 0;
//if (ImGui::BBLBeginCombo("", view_type_value, flags)) {
// ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0.0f);
// //select controller
// for (int i = 0; i < view_type_items_str.size(); i++) {
// const bool is_selected = (m_view_type_sel == i);
// if (ImGui::BBLSelectable(view_type_items_str[i].c_str(), is_selected)) {
// m_fold = false;
// m_view_type_sel = i;
// set_view_type(view_type_items[m_view_type_sel]);
// reset_visible(view_type_items[m_view_type_sel]);
// // update buffers' render paths
// refresh_render_paths(false, false);
// update_moves_slider();
// wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
// }
// if (is_selected) {
// ImGui::SetItemDefaultFocus();
// }
// }
// ImGui::PopStyleVar(1);
// ImGui::EndCombo();
//}
//pop_combo_style();
//ImGui::Dummy({ window_padding, window_padding });
/* if (m_fold) {
legend_height = ImGui::GetStyle().WindowPadding.y + ImGui::GetFrameHeight() + window_padding * 2.5;
imgui.end();
ImGui::PopStyleColor(6);
ImGui::PopStyleVar(2);
return;
}
}*/
//ImGui::Dummy({ window_padding, window_padding });
//imgui.bold_text(_u8L("Color Scheme"));
//push_combo_style();
//ImGui::SameLine();
//const char* view_type_value = view_type_items_str[m_view_type_sel].c_str();
//ImGuiComboFlags flags = 0;
//if (ImGui::BBLBeginCombo("", view_type_value, flags)) {
// ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0.0f);
// //select controller
// for (int i = 0; i < view_type_items_str.size(); i++) {
// const bool is_selected = (m_view_type_sel == i);
// if (ImGui::BBLSelectable(view_type_items_str[i].c_str(), is_selected)) {
// m_fold = false;
// m_view_type_sel = i;
// set_view_type(view_type_items[m_view_type_sel]);
// reset_visible(view_type_items[m_view_type_sel]);
// // update buffers' render paths
// refresh_render_paths(false, false);
// update_moves_slider();
// wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
// }
// if (is_selected) {
// ImGui::SetItemDefaultFocus();
// }
// }
// ImGui::PopStyleVar(1);
// ImGui::EndCombo();
//}
//pop_combo_style();
//ImGui::SameLine();
//ImGui::Dummy({ window_padding, window_padding });
// data used to properly align items in columns when showing time
std::vector<float> offsets;
@ -4939,7 +4982,75 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
double koef = imperial_units ? GizmoObjectManipulation::in_to_mm : 1000.0;
double unit_conver = imperial_units ? GizmoObjectManipulation::oz_to_g : 1;
auto append_option_item = [this, append_item](EMoveType type, std::vector<float> offsets) {
auto append_option_item_with_type = [this, offsets, append_item](EMoveType type, const Color& color, const std::string& label, bool visible) {
append_item(EItemType::Rect, color, { { label , offsets[0] } }, true, visible, [this, type, visible]() {
m_buffers[buffer_id(type)].visible = !m_buffers[buffer_id(type)].visible;
// update buffers' render paths
refresh_render_paths(false, false);
update_moves_slider();
wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
});
};
const bool visible = m_buffers[buffer_id(type)].visible;
if (type == EMoveType::Travel) {
//BBS: only display travel time in FeatureType view
append_option_item_with_type(type, Travel_Colors[0], _u8L("Travel"), visible);
}
else if (type == EMoveType::Seam)
append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::Seams], _u8L("Seams"), visible);
else if (type == EMoveType::Retract)
append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::Retractions], _u8L("Retract"), visible);
else if (type == EMoveType::Unretract)
append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::Unretractions], _u8L("Unretract"), visible);
else if (type == EMoveType::Tool_change)
append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::ToolChanges], _u8L("Filament Changes"), visible);
else if (type == EMoveType::Wipe)
append_option_item_with_type(type, Wipe_Color, _u8L("Wipe"), visible);
};
if (!m_fold) {
//ImGui::Dummy(ImVec2(0.0f, ImGui::GetFontSize() * 0.1));
ImGui::Dummy({ window_padding, window_padding });
ImGui::Spacing();
ImGui::Dummy({ window_padding, window_padding });
//ImGui::Spacing();
//ImGui::Dummy({ window_padding, window_padding });
//imgui.bold_text(_u8L("Color Scheme"));
ImGui::SameLine();
imgui.text(_u8L("Color Scheme"));
push_combo_style();
ImGui::SameLine();
const char* view_type_value = view_type_items_str[m_view_type_sel].c_str();
ImGuiComboFlags flags = 0;
if (ImGui::BBLBeginCombo("", view_type_value, flags)) {
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0.0f);
//select controller
for (int i = 0; i < view_type_items_str.size(); i++) {
const bool is_selected = (m_view_type_sel == i);
if (ImGui::BBLSelectable(view_type_items_str[i].c_str(), is_selected)) {
m_fold = false;
m_view_type_sel = i;
set_view_type(view_type_items[m_view_type_sel]);
reset_visible(view_type_items[m_view_type_sel]);
// update buffers' render paths
refresh_render_paths(false, false);
update_moves_slider();
wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
}
if (is_selected) {
ImGui::SetItemDefaultFocus();
}
}
ImGui::PopStyleVar(1);
ImGui::EndCombo();
}
pop_combo_style();
//ImGui::Dummy({ window_padding, window_padding });
ImGui::SameLine();
ImGui::Dummy({ window_padding, window_padding });
ImGui::Dummy({ window_padding, window_padding });
// used filament statistics
for (size_t extruder_id : m_extruder_ids) {
if (m_print_statistics.model_volumes_per_extruder.find(extruder_id) == m_print_statistics.model_volumes_per_extruder.end()) {
@ -5122,32 +5233,32 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
default: { break; }
}
auto append_option_item = [this, append_item](EMoveType type, std::vector<float> offsets) {
auto append_option_item_with_type = [this, offsets, append_item](EMoveType type, const Color& color, const std::string& label, bool visible) {
append_item(EItemType::Rect, color, {{ label , offsets[0] }}, true, visible, [this, type, visible]() {
m_buffers[buffer_id(type)].visible = !m_buffers[buffer_id(type)].visible;
// update buffers' render paths
refresh_render_paths(false, false);
update_moves_slider();
wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
});
};
const bool visible = m_buffers[buffer_id(type)].visible;
if (type == EMoveType::Travel) {
//BBS: only display travel time in FeatureType view
append_option_item_with_type(type, Travel_Colors[0], _u8L("Travel"), visible);
}
else if (type == EMoveType::Seam)
append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::Seams], _u8L("Seams"), visible);
else if (type == EMoveType::Retract)
append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::Retractions], _u8L("Retract"), visible);
else if (type == EMoveType::Unretract)
append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::Unretractions], _u8L("Unretract"), visible);
else if (type == EMoveType::Tool_change)
append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::ToolChanges], _u8L("Filament Changes"), visible);
else if (type == EMoveType::Wipe)
append_option_item_with_type(type, Wipe_Color, _u8L("Wipe"), visible);
};
//auto append_option_item = [this, append_item](EMoveType type, std::vector<float> offsets) {
// auto append_option_item_with_type = [this, offsets, append_item](EMoveType type, const Color& color, const std::string& label, bool visible) {
// append_item(EItemType::Rect, color, { { label , offsets[0] } }, true, visible, [this, type, visible]() {
// m_buffers[buffer_id(type)].visible = !m_buffers[buffer_id(type)].visible;
// // update buffers' render paths
// refresh_render_paths(false, false);
// update_moves_slider();
// wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
// });
// };
// const bool visible = m_buffers[buffer_id(type)].visible;
// if (type == EMoveType::Travel) {
// //BBS: only display travel time in FeatureType view
// append_option_item_with_type(type, Travel_Colors[0], _u8L("Travel"), visible);
// }
// else if (type == EMoveType::Seam)
// append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::Seams], _u8L("Seams"), visible);
// else if (type == EMoveType::Retract)
// append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::Retractions], _u8L("Retract"), visible);
// else if (type == EMoveType::Unretract)
// append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::Unretractions], _u8L("Unretract"), visible);
// else if (type == EMoveType::Tool_change)
// append_option_item_with_type(type, Options_Colors[(int)EOptionsColors::ToolChanges], _u8L("Filament Changes"), visible);
// else if (type == EMoveType::Wipe)
// append_option_item_with_type(type, Wipe_Color, _u8L("Wipe"), visible);
// };
// extrusion paths section -> items
switch (m_view_type)
@ -5178,7 +5289,8 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
for (auto item : options_items) {
if (item != EMoveType::Travel) {
append_option_item(item, offsets);
} else {
}
else {
//BBS: show travel time in FeatureType view
const bool visible = m_buffers[buffer_id(item)].visible;
std::vector<std::pair<std::string, float>> columns_offsets;
@ -5682,9 +5794,10 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
}
}
}
}
// total estimated printing time section
if (show_estimated) {
ImGui::Dummy({ window_padding, window_padding });
ImGui::Spacing();
std::string time_title = m_view_type == EViewType::FeatureType ? _u8L("Total Estimation") : _u8L("Time Estimation");
auto can_show_mode_button = [this](PrintEstimatedStatistics::ETimeMode mode) {
@ -5713,6 +5826,8 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
ImGui::Dummy({ window_padding, window_padding });
ImGui::SameLine();
imgui.title(time_title);
//auto timecText = new wxStaticText(s_panel, wxID_ANY, wxString::FromUTF8(time_title), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
//auto timecText = new wxStaticText(s_panel, wxID_ANY, time_title, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
std::string total_filament_str = _u8L("Total Filament");
std::string model_filament_str = _u8L("Model Filament");
std::string cost_str = _u8L("Cost");
@ -5844,6 +5959,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
}
default : { assert(false); break; }
}
ImGui::Dummy({ window_padding, window_padding });
}
if (m_view_type == EViewType::ColorPrint) {

View File

@ -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,88 +431,89 @@ 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);
wxBitmap new_bmp("E:\\Code\\Projects\\BambuStudio\\resources\\images\\back123.png", wxBITMAP_TYPE_PNG);
new_bmp.SetHeight(height);
new_bmp.SetWidth(width);
return new_bmp;
@ -2783,8 +2796,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...";

View File

@ -414,6 +414,9 @@ void ParamsPanel::create_layout()
// m_left_sizer->Add( m_filament_sizer, 1, wxEXPAND, 5 );
m_left_sizer->Add( m_tab_filament, 0, wxEXPAND );
}
if (m_tab_config) {
m_left_sizer->Add(m_tab_config, 0, wxEXPAND);
}
if (m_tab_printer) {
//m_printer_sizer = new wxBoxSizer( wxVERTICAL );
@ -481,6 +484,9 @@ void ParamsPanel::refresh_tabs()
case Preset::TYPE_PRINTER:
m_tab_printer = tab;
break;
case Preset::TYPE_CONFIG:
m_tab_config = tab;
break;
default:
break;
}
@ -509,7 +515,7 @@ void ParamsPanel::OnActivate()
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": first time opened, set current tab to print");
// BBS: open/close tab
//m_current_tab = m_tab_print;
set_active_tab(m_tab_print ? m_tab_print : m_tab_filament);
set_active_tab(m_tab_print ? m_tab_print : m_tab_filament ? m_tab_filament : m_tab_config);
}
Tab* cur_tab = dynamic_cast<Tab *> (m_current_tab);
if (cur_tab)
@ -587,7 +593,8 @@ void ParamsPanel::set_active_tab(wxPanel* tab)
{m_tab_print_layer, nullptr},
{m_tab_print_plate, nullptr},
{m_tab_filament, m_staticline_filament},
{m_tab_printer, m_staticline_printer}})) {
{m_tab_printer, m_staticline_printer},
{m_tab_config, m_staticline_config}})) {
if (!t.first) continue;
t.first->Show(tab == t.first);
if (!t.second) continue;
@ -658,7 +665,7 @@ void ParamsPanel::msw_rescale()
((SwitchButton* )m_mode_region)->Rescale();
if (m_mode_view)
((SwitchButton* )m_mode_view)->Rescale();
for (auto tab : {m_tab_print, m_tab_print_plate, m_tab_print_object, m_tab_print_part, m_tab_print_layer, m_tab_filament, m_tab_printer}) {
for (auto tab : {m_tab_print, m_tab_print_plate, m_tab_print_object, m_tab_print_part, m_tab_print_layer, m_tab_filament, m_tab_printer, m_tab_config}) {
if (tab) dynamic_cast<Tab*>(tab)->msw_rescale();
}
//((Button*)m_export_to_file)->Rescale();
@ -799,6 +806,12 @@ void ParamsPanel::delete_subwindows()
m_staticline_printer = nullptr;
}
if (m_staticline_config)
{
delete m_staticline_config;
m_staticline_config = nullptr;
}
if (m_export_to_file)
{
delete m_export_to_file;

View File

@ -104,6 +104,8 @@ class ParamsPanel : public wxPanel
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 };

View File

@ -369,7 +369,7 @@ void PhysicalPrinterDialog::update_preset_input() {
}
if (m_valid_type == Valid &&
(m_preset_name == "Default Setting" || m_preset_name == "Default Filament" || m_preset_name == "Default Printer")) {
(m_preset_name == "Default Setting" || m_preset_name == "Default Filament" || m_preset_name == "Default Printer" || m_preset_name == "Default Config")) {
info_line = _L("Name is unavailable.");
m_valid_type = NoValid;
}

View File

@ -1056,6 +1056,13 @@ 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 (m_type == Preset::TYPE_CONFIG) {
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));
@ -1081,6 +1088,7 @@ void PlaterPresetComboBox::update()
validate_selection(it->first == selected_system_preset);
}
}
}
//BBS: remove unused pysical printer logic
/*if (m_type == Preset::TYPE_PRINTER)
@ -1114,8 +1122,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 +1191,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) {
@ -1292,6 +1301,17 @@ void TabPresetComboBox::update()
add_ams_filaments(into_u8(selected));
//BBS: add project embedded preset logic
if (m_type == Preset::TYPE_CONFIG) {
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));
@ -1329,6 +1349,7 @@ void TabPresetComboBox::update()
validate_selection(it->first == selected);
}
}
}
if (m_type == Preset::TYPE_PRINTER)
{

View File

@ -47,6 +47,7 @@ public:
LABEL_ITEM_WIZARD_FILAMENTS,
LABEL_ITEM_WIZARD_MATERIALS,
LABEL_ITEM_WIZARD_ADD_PRINTERS,
LABEL_ITEM_WIZARD_CONFIGS,
LABEL_ITEM_MAX,
};

View File

@ -202,7 +202,7 @@ void SavePresetDialog::Item::update()
}
if (m_valid_type == Valid &&
(m_preset_name == "Default Setting" || m_preset_name == "Default Filament" || m_preset_name == "Default Printer")) {
(m_preset_name == "Default Setting" || m_preset_name == "Default Filament" || m_preset_name == "Default Printer" || m_preset_name == "Default Config")) {
info_line = _L("Name is unavailable.");
m_valid_type = NoValid;
}

View File

@ -966,7 +966,8 @@ void Tab::update_changed_tree_ui()
}
}
if (page->title() == "Dependencies") {
if (m_type == Slic3r::Preset::TYPE_PRINTER) {
//xiamian+
if (m_type == Slic3r::Preset::TYPE_PRINTER || m_type == Slic3r::Preset::TYPE_CONFIG) {
sys_page = m_presets->get_selected_preset_parent() != nullptr;
modified_page = false;
} else {
@ -1923,15 +1924,11 @@ void TabPrint::build()
m_presets = &m_preset_bundle->prints;
load_initial_data();
auto page = add_options_page(L("Quality"), "empty");
//xiamian-
//auto page = add_options_page(L("Quality"), "empty");
//auto optgroup = page->new_optgroup(L("Layer height"), L"param_layer_height");
auto optgroup = page->new_optgroup("", L"param_layer_height");
//optgroup->append_single_option_line("layer_height", "layer-height");
optgroup->append_single_option_line("layer_height", "layer-height");
//optgroup->append_single_option_line("initial_layer_print_height", "layer-height");
//xiamian-
//optgroup = page->new_optgroup(L("Line width"), L"param_line_width");
//optgroup->append_single_option_line("line_width", "parameter/line-width");
//optgroup->append_single_option_line("initial_layer_line_width", "parameter/line-width");
@ -1941,20 +1938,20 @@ void TabPrint::build()
//optgroup->append_single_option_line("sparse_infill_line_width", "parameter/line-width");
//optgroup->append_single_option_line("internal_solid_infill_line_width", "parameter/line-width");
//optgroup->append_single_option_line("support_line_width", "parameter/line-width");
//xiamian-
//optgroup = page->new_optgroup(L("Seam"), L"param_seam");
//optgroup->append_single_option_line("seam_position", "Seam");
optgroup->append_single_option_line("seam_gap", "Seam");
//optgroup->append_single_option_line("seam_gap", "Seam");
//optgroup->append_single_option_line("seam_slope_type");
optgroup->append_single_option_line("seam_slope_conditional");
optgroup->append_single_option_line("scarf_angle_threshold");
optgroup->append_single_option_line("seam_slope_start_height");
optgroup->append_single_option_line("seam_slope_entire_loop");
optgroup->append_single_option_line("seam_slope_min_length");
optgroup->append_single_option_line("seam_slope_steps");
optgroup->append_single_option_line("seam_slope_inner_walls");
optgroup->append_single_option_line("wipe_speed", "Seam");
//xiamian-
//optgroup->append_single_option_line("seam_slope_conditional");
//optgroup->append_single_option_line("scarf_angle_threshold");
//optgroup->append_single_option_line("seam_slope_start_height");
//optgroup->append_single_option_line("seam_slope_entire_loop");
//optgroup->append_single_option_line("seam_slope_min_length");
//optgroup->append_single_option_line("seam_slope_steps");
//optgroup->append_single_option_line("seam_slope_inner_walls");
//optgroup->append_single_option_line("wipe_speed", "Seam");
//optgroup = page->new_optgroup(L("Precision"), L"param_precision");
//optgroup->append_single_option_line("slice_closing_radius");
//optgroup->append_single_option_line("resolution", "acr-move");
@ -1963,96 +1960,85 @@ void TabPrint::build()
//optgroup->append_single_option_line("xy_contour_compensation", "xy-hole-contour-compensation");
//optgroup->append_single_option_line("elefant_foot_compensation", "parameter/elephant-foot");
//optgroup->append_single_option_line("precise_z_height");
//xiamian-
//optgroup = page->new_optgroup(L("Ironing"), L"param_ironing");
//optgroup->append_single_option_line("ironing_type", "parameter/ironing");
optgroup->append_single_option_line("ironing_pattern");
optgroup->append_single_option_line("ironing_speed");
optgroup->append_single_option_line("ironing_flow");
optgroup->append_single_option_line("ironing_spacing");
optgroup->append_single_option_line("ironing_direction");
//xiamian-
//optgroup->append_single_option_line("ironing_pattern");
//optgroup->append_single_option_line("ironing_speed");
//optgroup->append_single_option_line("ironing_flow");
//optgroup->append_single_option_line("ironing_spacing");
//optgroup->append_single_option_line("ironing_direction");
//optgroup = page->new_optgroup(L("Wall generator"), L"param_wall");
optgroup->append_single_option_line("wall_generator", "wall-generator");
//optgroup->append_single_option_line("wall_generator", "wall-generator");
optgroup->append_single_option_line("wall_transition_angle");
optgroup->append_single_option_line("wall_transition_filter_deviation");
optgroup->append_single_option_line("wall_transition_length");
optgroup->append_single_option_line("wall_distribution_count");
optgroup->append_single_option_line("min_bead_width");
optgroup->append_single_option_line("min_feature_size");
//xiamian-
//optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
optgroup->append_single_option_line("wall_sequence");
//optgroup->append_single_option_line("wall_sequence");
//optgroup->append_single_option_line("is_infill_first");
//optgroup->append_single_option_line("bridge_flow", "parameter/bridge");
//optgroup->append_single_option_line("thick_bridges", "parameter/bridge");
//optgroup->append_single_option_line("top_solid_infill_flow_ratio");
//optgroup->append_single_option_line("initial_layer_flow_ratio");
//optgroup->append_single_option_line("top_one_wall_type");
//optgroup->append_single_option_line("top_area_threshold");
//optgroup->append_single_option_line("only_one_wall_first_layer");
//optgroup->append_single_option_line("detect_overhang_wall");
optgroup->append_single_option_line("top_one_wall_type");
optgroup->append_single_option_line("top_area_threshold");
optgroup->append_single_option_line("only_one_wall_first_layer");
optgroup->append_single_option_line("detect_overhang_wall");
//optgroup->append_single_option_line("smooth_speed_discontinuity_area");
//optgroup->append_single_option_line("smooth_coefficient");
//optgroup->append_single_option_line("reduce_crossing_wall");
//optgroup->append_single_option_line("max_travel_detour_distance");
optgroup->append_single_option_line("support_base_pattern_spacing", "support#base-pattern");
optgroup->append_single_option_line("support_interface_top_layers", "support#base-pattern");
optgroup->append_single_option_line("support_interface_bottom_layers", "support#base-pattern");
optgroup->append_single_option_line("support_interface_spacing", "support#base-pattern");
optgroup->append_single_option_line("max_travel_detour_distance");
page = add_options_page(L("Strength"), "empty");
//xiamian+
optgroup = page->new_optgroup("", L"param_wall");
//xiamian-
//optgroup = page->new_optgroup(L("Walls"), L"param_wall");
//optgroup->append_single_option_line("wall_loops","wall-generator");
optgroup->append_single_option_line("detect_thin_wall","wall-generator");
optgroup->append_single_option_line("wall_loops", "wall-generator");
//optgroup->append_single_option_line("detect_thin_wall", "wall-generator");
//optgroup = page->new_optgroup(L("Top/bottom shells"), L"param_shell");
optgroup->append_single_option_line("interface_shells");
optgroup->append_single_option_line("top_surface_pattern", "fill-patterns#Infill of the top surface and bottom surface");
//optgroup->append_single_option_line("top_shell_layers");
//optgroup->append_single_option_line("top_shell_thickness");
optgroup->append_single_option_line("bottom_surface_pattern", "fill-patterns#Infill of the top surface and bottom surface");
//optgroup->append_single_option_line("bottom_shell_layers");
//optgroup->append_single_option_line("bottom_shell_thickness");
optgroup->append_single_option_line("internal_solid_infill_pattern");
//optgroup->append_single_option_line("top_surface_pattern", "fill-patterns#Infill of the top surface and bottom surface");
optgroup->append_single_option_line("top_shell_layers");
optgroup->append_single_option_line("top_shell_thickness");
//optgroup->append_single_option_line("bottom_surface_pattern", "fill-patterns#Infill of the top surface and bottom surface");
optgroup->append_single_option_line("bottom_shell_layers");
optgroup->append_single_option_line("bottom_shell_thickness");
//optgroup->append_single_option_line("internal_solid_infill_pattern");
//optgroup = page->new_optgroup(L("Sparse infill"), L"param_infill");
//optgroup->append_single_option_line("sparse_infill_density");
optgroup->append_single_option_line("sparse_infill_pattern", "fill-patterns#infill types and their properties of sparse");
optgroup->append_single_option_line("sparse_infill_density");
//optgroup->append_single_option_line("sparse_infill_pattern", "fill-patterns#infill types and their properties of sparse");
//optgroup->append_single_option_line("sparse_infill_anchor");
//optgroup->append_single_option_line("sparse_infill_anchor_max");
optgroup->append_single_option_line("filter_out_gap_fill");
//optgroup->append_single_option_line("filter_out_gap_fill");
//optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
//optgroup->append_single_option_line("infill_wall_overlap", "parameter/strength-advance-settings");
//optgroup->append_single_option_line("infill_direction", "parameter/strength-advance-settings");
optgroup->append_single_option_line("bridge_angle","parameter/strength-advance-settings");
optgroup->append_single_option_line("minimum_sparse_infill_area","parameter/strength-advance-settings");
optgroup->append_single_option_line("infill_combination","parameter/strength-advance-settings");
//optgroup->append_single_option_line("bridge_angle", "parameter/strength-advance-settings");
//optgroup->append_single_option_line("minimum_sparse_infill_area", "parameter/strength-advance-settings");
//optgroup->append_single_option_line("infill_combination", "parameter/strength-advance-settings");
//optgroup->append_single_option_line("detect_narrow_internal_solid_infill", "parameter/strength-advance-settings");
//optgroup->append_single_option_line("ensure_vertical_shell_thickness", "parameter/strength-advance-settings");
//optgroup->append_single_option_line("internal_bridge_support_thickness","parameter/strength-advance-settings");
page = add_options_page(L("Speed"), "empty");
//xiamian+
optgroup = page->new_optgroup("", L"param_speed",15);
//xiamian-
//optgroup = page->new_optgroup(L("Initial layer speed"), L"param_speed_first", 15);
optgroup->append_single_option_line("default_print_speed");
optgroup->append_single_option_line("initial_layer_speed");
optgroup->append_single_option_line("initial_layer_infill_speed");
optgroup = page->new_optgroup("", L"param_speed_first", 15);
//optgroup->append_single_option_line("initial_layer_speed");
//optgroup->append_single_option_line("initial_layer_infill_speed");
//optgroup = page->new_optgroup(L("Other layers speed"), L"param_speed", 15);
optgroup->append_single_option_line("outer_wall_speed");
optgroup->append_single_option_line("inner_wall_speed");
//optgroup->append_single_option_line("outer_wall_speed");
//optgroup->append_single_option_line("inner_wall_speed");
//optgroup->append_single_option_line("small_perimeter_speed");
//optgroup->append_single_option_line("small_perimeter_threshold");
optgroup->append_single_option_line("sparse_infill_speed");
optgroup->append_single_option_line("internal_solid_infill_speed");
optgroup->append_single_option_line("top_surface_speed");
//optgroup->append_single_option_line("sparse_infill_speed");
//optgroup->append_single_option_line("internal_solid_infill_speed");
//optgroup->append_single_option_line("top_surface_speed");
//optgroup->append_single_option_line("enable_overhang_speed", "slow-down-for-overhang");
//Line line = { L("Overhang speed"), L("This is the speed for various overhang degrees. Overhang degrees are expressed as a percentage of line width. 0 speed means no slowing down for the overhang degree range and wall speed is used") };
//line.label_path = "slow-down-for-overhang";
@ -2062,16 +2048,16 @@ void TabPrint::build()
//line.append_option(optgroup->get_option("overhang_4_4_speed"));
//optgroup->append_line(line);
//optgroup->append_single_option_line("overhang_totally_speed");
optgroup->append_single_option_line("bridge_speed");
optgroup->append_single_option_line("gap_infill_speed");
optgroup->append_single_option_line("support_speed");
optgroup->append_single_option_line("support_interface_speed");
//optgroup->append_single_option_line("bridge_speed");
//optgroup->append_single_option_line("gap_infill_speed");
//optgroup->append_single_option_line("support_speed");
//optgroup->append_single_option_line("support_interface_speed");
//optgroup = page->new_optgroup(L("Travel speed"), L"param_travel_speed", 15);
optgroup->append_single_option_line("travel_speed");
//optgroup->append_single_option_line("travel_speed");
//optgroup = page->new_optgroup(L("Acceleration"), L"param_acceleration", 15);
optgroup->append_single_option_line("default_acceleration");
//optgroup->append_single_option_line("default_acceleration");
//optgroup->append_single_option_line("initial_layer_acceleration");
//optgroup->append_single_option_line("outer_wall_acceleration");
//optgroup->append_single_option_line("inner_wall_acceleration");
@ -2089,17 +2075,14 @@ void TabPrint::build()
optgroup->append_single_option_line("initial_layer_jerk");
optgroup->append_single_option_line("travel_jerk");
#ifdef HAS_PRESSURE_EQUALIZER
optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope_positive");
optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope_negative");
#endif /* HAS_PRESSURE_EQUALIZER */
//#ifdef HAS_PRESSURE_EQUALIZER
// optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope_positive");
// optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope_negative");
//#endif /* HAS_PRESSURE_EQUALIZER */
page = add_options_page(L("Support"), "support");
//xiamian+
optgroup = page->new_optgroup("", L"param_support");
//ximian-
//optgroup = page->new_optgroup(L("Support"), L"param_support");
//optgroup->append_single_option_line("enable_support", "support");
optgroup->append_single_option_line("enable_support", "support");
optgroup->append_single_option_line("support_type", "support#support-types");
optgroup->append_single_option_line("support_style", "support#support-styles");
optgroup->append_single_option_line("support_threshold_angle", "support#threshold-angle");
@ -2109,62 +2092,47 @@ void TabPrint::build()
//optgroup->append_single_option_line("enforce_support_layers");
//optgroup = page->new_optgroup(L("Raft"), L"param_raft");
optgroup->append_single_option_line("raft_layers");
optgroup->append_single_option_line("raft_contact_distance");
optgroup->append_single_option_line("raft_first_layer_density");
//optgroup->append_single_option_line("raft_layers");
//optgroup->append_single_option_line("raft_contact_distance");
//optgroup->append_single_option_line("raft_first_layer_density");
//optgroup = page->new_optgroup(L("Support filament"), L"param_support_filament");
optgroup->append_single_option_line("support_filament", "support#support-filament");
optgroup->append_single_option_line("support_interface_filament", "support#support-filament");
optgroup->append_single_option_line("support_interface_not_for_body", "support#support-filament");
//optgroup->append_single_option_line("support_filament", "support#support-filament");
//optgroup->append_single_option_line("support_interface_filament", "support#support-filament");
//optgroup->append_single_option_line("support_interface_not_for_body", "support#support-filament");
//optgroup = page->new_optgroup(L("Options for support material and raft"));
//BBS
//optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
optgroup->append_single_option_line("raft_first_layer_expansion"); // not only for raft, but for support too
optgroup->append_single_option_line("tree_support_wall_count");
//optgroup->append_single_option_line("raft_first_layer_expansion"); // not only for raft, but for support too
//optgroup->append_single_option_line("tree_support_wall_count");
//optgroup->append_single_option_line("support_top_z_distance", "support#top-z-distance");
//optgroup->append_single_option_line("support_bottom_z_distance", "support#bottom-z-distance");
optgroup->append_single_option_line("support_base_pattern", "support#base-pattern");
//optgroup->append_single_option_line("support_base_pattern", "support#base-pattern");
//optgroup->append_single_option_line("support_base_pattern_spacing", "support#base-pattern");
//optgroup->append_single_option_line("support_angle");
//optgroup->append_single_option_line("support_interface_top_layers", "support#base-pattern");
//optgroup->append_single_option_line("support_interface_bottom_layers", "support#base-pattern");
optgroup->append_single_option_line("support_interface_pattern", "support#base-pattern");
//optgroup->append_single_option_line("support_interface_pattern", "support#base-pattern");
//optgroup->append_single_option_line("support_interface_spacing", "support#base-pattern");
optgroup->append_single_option_line("support_bottom_interface_spacing");
//optgroup->append_single_option_line("support_bottom_interface_spacing");
//optgroup->append_single_option_line("support_expansion", "support#base-pattern");
//optgroup->append_single_option_line("support_interface_loop_pattern");
optgroup->append_single_option_line("support_object_xy_distance", "support");
//optgroup->append_single_option_line("support_object_xy_distance", "support");
//optgroup->append_single_option_line("support_object_first_layer_gap", "support");
optgroup->append_single_option_line("bridge_no_support", "support#base-pattern");
optgroup->append_single_option_line("max_bridge_length", "support#base-pattern");
optgroup->append_single_option_line("independent_support_layer_height", "support");
//optgroup->append_single_option_line("bridge_no_support", "support#base-pattern");
//optgroup->append_single_option_line("max_bridge_length", "support#base-pattern");
//optgroup->append_single_option_line("independent_support_layer_height", "support");
//optgroup = page->new_optgroup(L("Tree Support"), L"param_advanced");
optgroup->append_single_option_line("tree_support_branch_distance", "support#tree-support-only-options");
optgroup->append_single_option_line("tree_support_branch_diameter", "support#tree-support-only-options");
optgroup->append_single_option_line("tree_support_branch_angle", "support#tree-support-only-options");
//xiamian+
page = add_options_page(L("Configuration"), "empty");
optgroup = page->new_optgroup("", L"param_layer_height");
optgroup->append_single_option_line("wall_loops", "wall-generator");
optgroup->append_single_option_line("layer_height", "layer-height");
optgroup->append_single_option_line("seam_position", "Seam");
optgroup->append_single_option_line("top_shell_layers");
optgroup->append_single_option_line("top_shell_thickness");
optgroup->append_single_option_line("bottom_shell_layers");
optgroup->append_single_option_line("bottom_shell_thickness");
optgroup->append_single_option_line("sparse_infill_density");
optgroup->append_single_option_line("enable_support", "support");
//optgroup->append_single_option_line("tree_support_branch_distance", "support#tree-support-only-options");
//optgroup->append_single_option_line("tree_support_branch_diameter", "support#tree-support-only-options");
//optgroup->append_single_option_line("tree_support_branch_angle", "support#tree-support-only-options");
page = add_options_page(L("Others"), "advanced");
//xiamian+
optgroup = page->new_optgroup("", L"param_adhension");
//xiamian-
//optgroup = page->new_optgroup(L("Bed adhension"), L"param_adhension");
//optgroup->append_single_option_line("skirt_loops");
//optgroup->append_single_option_line("skirt_height");
//optgroup->append_single_option_line("skirt_distance");
@ -2185,22 +2153,22 @@ void TabPrint::build()
//optgroup->append_single_option_line("flush_into_support", "reduce-wasting-during-filament-change#wipe-into-support-enabled-by-default");
//optgroup = page->new_optgroup(L("Special mode"), L"param_special");
optgroup->append_single_option_line("slicing_mode");
optgroup->append_single_option_line("print_sequence", "sequent-print");
optgroup->append_single_option_line("spiral_mode", "spiral-vase");
optgroup->append_single_option_line("spiral_mode_smooth", "spiral-vase#smooth");
optgroup->append_single_option_line("spiral_mode_max_xy_smoothing", "spiral-vase#max-xy-smoothing");
optgroup->append_single_option_line("timelapse_type", "Timelapse");
//optgroup->append_single_option_line("slicing_mode");
//optgroup->append_single_option_line("print_sequence", "sequent-print");
//optgroup->append_single_option_line("spiral_mode", "spiral-vase");
//optgroup->append_single_option_line("spiral_mode_smooth", "spiral-vase#smooth");
//optgroup->append_single_option_line("spiral_mode_max_xy_smoothing", "spiral-vase#max-xy-smoothing");
//optgroup->append_single_option_line("timelapse_type", "Timelapse");
optgroup->append_single_option_line("fuzzy_skin", "parameter/fuzzy-skin");
optgroup->append_single_option_line("fuzzy_skin_point_distance");
optgroup->append_single_option_line("fuzzy_skin_thickness");
//optgroup->append_single_option_line("fuzzy_skin", "parameter/fuzzy-skin");
//optgroup->append_single_option_line("fuzzy_skin_point_distance");
//optgroup->append_single_option_line("fuzzy_skin_thickness");
//optgroup = page->new_optgroup(L("Advanced"), L"advanced");
// optgroup->append_single_option_line("mmu_segmented_region_max_width");
optgroup->append_single_option_line("mmu_segmented_region_interlocking_depth");
//optgroup = page->new_optgroup(L("G-code output"), L"param_gcode");
optgroup = page->new_optgroup(L("G-code output"), L"param_gcode");
optgroup->append_single_option_line("reduce_infill_retraction");
optgroup->append_single_option_line("gcode_add_line_number");
optgroup->append_single_option_line("exclude_object");
@ -3184,7 +3152,7 @@ void TabFilament::build()
line.append_option(optgroup->get_option("complete_print_exhaust_fan_speed"));
optgroup->append_line(line);
//BBS
add_filament_overrides_page();
// add_filament_overrides_page();
#if 0
//page = add_options_page(L("Advanced"), "advanced");
// optgroup = page->new_optgroup(L("Wipe tower parameters"));
@ -4281,48 +4249,152 @@ void TabPrinter::update_fff()
void TabPrinter::update_sla()
{ ; }
void TabConfig::build() {
m_presets = &m_preset_bundle->configs;
load_initial_data();
//auto page = add_options_page(L("Qualityttttttt"), "empty");
//auto optgroup = page->new_optgroup("", L"param_layer_height");
//optgroup->append_single_option_line("initial_layer_print_height", "layer-height");
//optgroup->append_single_option_line("initial_layer_line_width");
//optgroup->append_single_option_line("outer_wall_line_width", "parameter/line-width");
//optgroup->append_single_option_line("inner_wall_line_width", "parameter/line-width");
//optgroup->append_single_option_line("top_surface_line_width", "parameter/line-width");
//optgroup->append_single_option_line("sparse_infill_line_width", "parameter/line-width");
//optgroup->append_single_option_line("support_line_width", "parameter/line-width");
//optgroup->append_single_option_line("resolution", "acr-move");
//optgroup->append_single_option_line("enable_arc_fitting", "acr-move");
//optgroup->append_single_option_line("wall_generator", "wall-generator");
//optgroup->append_single_option_line("wall_sequence");
auto page = add_options_page(L("Quality"), "spool");
auto optgroup = page->new_optgroup("", L"param_layer_height");
optgroup->append_single_option_line("initial_layer_print_height", "layer-height");
/*page = add_options_page(L("Strength"), "empty");
optgroup->append_single_option_line("initial_layer_line_width");
optgroup->append_single_option_line("outer_wall_line_width", "parameter/line-width");
optgroup->append_single_option_line("inner_wall_line_width", "parameter/line-width");
optgroup->append_single_option_line("top_surface_line_width", "parameter/line-width");
optgroup->append_single_option_line("sparse_infill_line_width", "parameter/line-width");
optgroup->append_single_option_line("support_line_width", "parameter/line-width");
optgroup->append_single_option_line("seam_gap", "Seam");
optgroup->append_single_option_line("seam_slope_conditional");
optgroup->append_single_option_line("scarf_angle_threshold");
optgroup->append_single_option_line("seam_slope_start_height");
optgroup->append_single_option_line("seam_slope_entire_loop");
optgroup->append_single_option_line("seam_slope_min_length");
optgroup->append_single_option_line("seam_slope_steps");
optgroup->append_single_option_line("seam_slope_inner_walls");
optgroup->append_single_option_line("wipe_speed", "Seam");
optgroup->append_single_option_line("resolution", "acr-move");
optgroup->append_single_option_line("enable_arc_fitting", "acr-move");
optgroup->append_single_option_line("ironing_pattern");
optgroup->append_single_option_line("ironing_speed");
optgroup->append_single_option_line("ironing_flow");
optgroup->append_single_option_line("ironing_spacing");
optgroup->append_single_option_line("ironing_direction");
optgroup->append_single_option_line("wall_generator", "wall-generator");
optgroup->append_single_option_line("wall_transition_angle");
optgroup->append_single_option_line("wall_transition_filter_deviation");
optgroup->append_single_option_line("wall_transition_length");
optgroup->append_single_option_line("wall_distribution_count");
optgroup->append_single_option_line("min_bead_width");
optgroup->append_single_option_line("min_feature_size");
optgroup->append_single_option_line("wall_sequence");
optgroup->append_single_option_line("top_one_wall_type");
optgroup->append_single_option_line("top_area_threshold");
optgroup->append_single_option_line("only_one_wall_first_layer");
optgroup->append_single_option_line("detect_overhang_wall");
optgroup->append_single_option_line("max_travel_detour_distance");
optgroup->append_single_option_line("support_base_pattern_spacing", "support#base-pattern");
optgroup->append_single_option_line("support_interface_top_layers", "support#base-pattern");
optgroup->append_single_option_line("support_interface_bottom_layers", "support#base-pattern");
//you cuo wu -- zan ding
//optgroup->append_single_option_line("support_interface_spacing", "support#base-pattern");
page = add_options_page(L("Strength"), "empty");
optgroup = page->new_optgroup("", L"param_wall");
optgroup->append_single_option_line("detect_thin_wall", "wall-generator");*/
optgroup->append_single_option_line("top_surface_pattern", "fill-patterns#Infill of the top surface and bottom surface");
optgroup->append_single_option_line("bottom_surface_pattern", "fill-patterns#Infill of the top surface and bottom surface");
optgroup->append_single_option_line("internal_solid_infill_pattern");
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");
optgroup->append_single_option_line("sparse_infill_pattern", "fill-patterns#infill types and their properties of sparse");
optgroup->append_single_option_line("filter_out_gap_fill");
optgroup->append_single_option_line("bridge_angle", "parameter/strength-advance-settings");
optgroup->append_single_option_line("minimum_sparse_infill_area", "parameter/strength-advance-settings");
optgroup->append_single_option_line("infill_combination", "parameter/strength-advance-settings");
page = add_options_page(L("Cooling"), "empty");
page = add_options_page(L("Speed"), "empty");
optgroup = page->new_optgroup("", L"param_speed_first", 15);
optgroup->append_single_option_line("default_print_speed");
optgroup->append_single_option_line("initial_layer_speed");
optgroup->append_single_option_line("initial_layer_infill_speed");
//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("outer_wall_speed");
optgroup->append_single_option_line("inner_wall_speed");
optgroup->append_single_option_line("sparse_infill_speed");
optgroup->append_single_option_line("internal_solid_infill_speed");
optgroup->append_single_option_line("top_surface_speed");
optgroup->append_single_option_line("bridge_speed");
optgroup->append_single_option_line("gap_infill_speed");
optgroup->append_single_option_line("support_speed");
optgroup->append_single_option_line("support_interface_speed");
page = add_options_page(L("Advanced"), "advanced");
optgroup = page->new_optgroup(L("Filament start G-code"), L"param_gcode", 0);
optgroup->append_single_option_line("travel_speed");
optgroup->append_single_option_line("default_acceleration");
optgroup->append_single_option_line("accel_to_decel_enable");
optgroup->append_single_option_line("accel_to_decel_factor");
/* optgroup->append_single_option_line("default_jerk");
optgroup->append_single_option_line("outer_wall_jerk");
optgroup->append_single_option_line("inner_wall_jerk");
optgroup->append_single_option_line("infill_jerk");
optgroup->append_single_option_line("top_surface_jerk");
optgroup->append_single_option_line("initial_layer_jerk");
optgroup->append_single_option_line("travel_jerk");*/
page = add_options_page(L("Support"), "support");
optgroup = page->new_optgroup("", L"param_support");
optgroup->append_single_option_line("support_type", "support#support-types");
optgroup->append_single_option_line("support_style", "support#support-styles");
optgroup->append_single_option_line("support_threshold_angle", "support#threshold-angle");
optgroup->append_single_option_line("support_on_build_plate_only");
optgroup->append_single_option_line("support_critical_regions_only");
optgroup->append_single_option_line("support_remove_small_overhang");
optgroup->append_single_option_line("raft_layers");
optgroup->append_single_option_line("raft_contact_distance");
optgroup->append_single_option_line("raft_first_layer_density");
optgroup->append_single_option_line("support_filament", "support#support-filament");
optgroup->append_single_option_line("support_interface_filament", "support#support-filament");
optgroup->append_single_option_line("support_interface_not_for_body", "support#support-filament");
optgroup->append_single_option_line("raft_first_layer_expansion"); // not only for raft, but for support too
optgroup->append_single_option_line("tree_support_wall_count");
optgroup->append_single_option_line("support_base_pattern", "support#base-pattern");
optgroup->append_single_option_line("support_interface_pattern", "support#base-pattern");
optgroup->append_single_option_line("support_bottom_interface_spacing");
optgroup->append_single_option_line("support_object_xy_distance", "support");
optgroup->append_single_option_line("bridge_no_support", "support#base-pattern");
optgroup->append_single_option_line("max_bridge_length", "support#base-pattern");
optgroup->append_single_option_line("independent_support_layer_height", "support");
optgroup->append_single_option_line("tree_support_branch_distance", "support#tree-support-only-options");
optgroup->append_single_option_line("tree_support_branch_diameter", "support#tree-support-only-options");
optgroup->append_single_option_line("tree_support_branch_angle", "support#tree-support-only-options");
page = add_options_page(L("Others"), "advanced");
optgroup = page->new_optgroup("", L"param_adhension");
optgroup->append_single_option_line("slicing_mode");
optgroup->append_single_option_line("fibre_feed_rate");
optgroup->append_single_option_line("print_sequence", "sequent-print");
optgroup->append_single_option_line("spiral_mode", "spiral-vase");
optgroup->append_single_option_line("spiral_mode_smooth", "spiral-vase#smooth");
optgroup->append_single_option_line("spiral_mode_max_xy_smoothing", "spiral-vase#max-xy-smoothing");
optgroup->append_single_option_line("timelapse_type", "Timelapse");
optgroup->append_single_option_line("fuzzy_skin", "parameter/fuzzy-skin");
optgroup->append_single_option_line("fuzzy_skin_point_distance");
optgroup->append_single_option_line("fuzzy_skin_thickness");
}
void TabConfig::reload_config()
{
//this->compatible_widget_reload(m_compatible_printers);
@ -4333,8 +4405,8 @@ void TabConfig::update_description_lines()
{
Tab::update_description_lines();
//if (!m_active_page)
// return;
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())));
@ -4352,11 +4424,11 @@ void TabConfig::toggle_options() {
m_preset_bundle->configs.get_edited_preset().is_bbl_vendor_preset(
m_preset_bundle);
}
if (m_active_page->title() == "Quality") {
//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("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);
@ -4370,21 +4442,37 @@ void TabConfig::toggle_options() {
////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") {
//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);
}
//toggle_option("thumbnail_size", !is_BBL_printer);
//}
}
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--;
if (m_update_cnt == 0)
wxGetApp().mainframe->on_config_changed(m_config);
}
void TabConfig::clear_pages() {
Tab::clear_pages();
}
void Tab::update_ui_items_related_on_parent_preset(const Preset* selected_preset_parent)
{