mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 07:03:59 -06:00
Merge remote-tracking branch 'origin/ys_sla_time_estimation'
This commit is contained in:
commit
37ab271803
10 changed files with 467 additions and 18 deletions
|
@ -98,6 +98,11 @@ public:
|
|||
wxStaticText *info_facets;
|
||||
wxStaticText *info_materials;
|
||||
wxStaticText *info_manifold;
|
||||
|
||||
wxStaticText *label_volume;
|
||||
wxStaticText *label_materials;
|
||||
std::vector<wxStaticText *> sla_hided_items;
|
||||
|
||||
bool showing_manifold_warning_icon;
|
||||
void show_sizer(bool show);
|
||||
};
|
||||
|
@ -119,15 +124,16 @@ ObjectInfo::ObjectInfo(wxWindow *parent) :
|
|||
(*info_label)->SetFont(wxGetApp().small_font());
|
||||
grid_sizer->Add(text, 0);
|
||||
grid_sizer->Add(*info_label, 0);
|
||||
return text;
|
||||
};
|
||||
|
||||
init_info_label(&info_size, _(L("Size")));
|
||||
init_info_label(&info_volume, _(L("Volume")));
|
||||
label_volume = init_info_label(&info_volume, _(L("Volume")));
|
||||
init_info_label(&info_facets, _(L("Facets")));
|
||||
init_info_label(&info_materials, _(L("Materials")));
|
||||
label_materials = init_info_label(&info_materials, _(L("Materials")));
|
||||
Add(grid_sizer, 0, wxEXPAND);
|
||||
|
||||
auto *info_manifold_text = new wxStaticText(parent, wxID_ANY, _(L("Manifold")));
|
||||
auto *info_manifold_text = new wxStaticText(parent, wxID_ANY, _(L("Manifold")) + ":");
|
||||
info_manifold_text->SetFont(wxGetApp().small_font());
|
||||
info_manifold = new wxStaticText(parent, wxID_ANY, "");
|
||||
info_manifold->SetFont(wxGetApp().small_font());
|
||||
|
@ -138,6 +144,8 @@ ObjectInfo::ObjectInfo(wxWindow *parent) :
|
|||
sizer_manifold->Add(manifold_warning_icon, 0, wxLEFT, 2);
|
||||
sizer_manifold->Add(info_manifold, 0, wxLEFT, 2);
|
||||
Add(sizer_manifold, 0, wxEXPAND | wxTOP, 4);
|
||||
|
||||
sla_hided_items = { label_volume, info_volume, label_materials, info_materials };
|
||||
}
|
||||
|
||||
void ObjectInfo::show_sizer(bool show)
|
||||
|
@ -152,6 +160,7 @@ enum SlisedInfoIdx
|
|||
siFilament_m,
|
||||
siFilament_mm3,
|
||||
siFilament_g,
|
||||
siMateril_unit,
|
||||
siCost,
|
||||
siEstimatedTime,
|
||||
siWTNumbetOfToolchanges,
|
||||
|
@ -192,6 +201,7 @@ SlicedInfo::SlicedInfo(wxWindow *parent) :
|
|||
init_info_label(_(L("Used Filament (m)")));
|
||||
init_info_label(_(L("Used Filament (mm³)")));
|
||||
init_info_label(_(L("Used Filament (g)")));
|
||||
init_info_label(_(L("Used Material (unit)")));
|
||||
init_info_label(_(L("Cost")));
|
||||
init_info_label(_(L("Estimated printing time")));
|
||||
init_info_label(_(L("Number of tool changes")));
|
||||
|
@ -827,6 +837,11 @@ void Sidebar::show_info_sizer()
|
|||
}
|
||||
|
||||
p->object_info->show_sizer(true);
|
||||
|
||||
if (p->plater->printer_technology() == ptSLA) {
|
||||
for (auto item: p->object_info->sla_hided_items)
|
||||
item->Show(false);
|
||||
}
|
||||
}
|
||||
|
||||
void Sidebar::show_sliced_info_sizer(const bool show)
|
||||
|
@ -835,6 +850,32 @@ void Sidebar::show_sliced_info_sizer(const bool show)
|
|||
|
||||
p->sliced_info->Show(show);
|
||||
if (show) {
|
||||
if (p->plater->printer_technology() == ptSLA)
|
||||
{
|
||||
const SLAPrintStatistics& ps = p->plater->sla_print().print_statistics();
|
||||
wxString new_label = _(L("Used Material (ml)")) + " :";
|
||||
const bool is_supports = ps.support_used_material > 0.0;
|
||||
if (is_supports)
|
||||
new_label += wxString::Format("\n - %s\n - %s", _(L("object(s)")), _(L("supports and pad")));
|
||||
|
||||
wxString info_text = is_supports ?
|
||||
wxString::Format("%.2f \n%.2f \n%.2f", (ps.objects_used_material + ps.support_used_material) / 1000,
|
||||
ps.objects_used_material / 1000,
|
||||
ps.support_used_material / 1000) :
|
||||
wxString::Format("%.2f", (ps.objects_used_material + ps.support_used_material) / 1000);
|
||||
p->sliced_info->SetTextAndShow(siMateril_unit, info_text, new_label);
|
||||
|
||||
p->sliced_info->SetTextAndShow(siCost, "N/A"/*wxString::Format("%.2f", ps.total_cost)*/);
|
||||
p->sliced_info->SetTextAndShow(siEstimatedTime, ps.estimated_print_time, _(L("Estimated printing time")) + " :");
|
||||
|
||||
// Hide non-SLA sliced info parameters
|
||||
p->sliced_info->SetTextAndShow(siFilament_m, "N/A");
|
||||
p->sliced_info->SetTextAndShow(siFilament_mm3, "N/A");
|
||||
p->sliced_info->SetTextAndShow(siFilament_g, "N/A");
|
||||
p->sliced_info->SetTextAndShow(siWTNumbetOfToolchanges, "N/A");
|
||||
}
|
||||
else
|
||||
{
|
||||
const PrintStatistics& ps = p->plater->fff_print().print_statistics();
|
||||
const bool is_wipe_tower = ps.total_wipe_tower_filament > 0;
|
||||
|
||||
|
@ -882,6 +923,10 @@ void Sidebar::show_sliced_info_sizer(const bool show)
|
|||
|
||||
// if there is a wipe tower, insert number of toolchanges info into the array:
|
||||
p->sliced_info->SetTextAndShow(siWTNumbetOfToolchanges, is_wipe_tower ? wxString::Format("%.d", p->plater->fff_print().wipe_tower_data().number_of_toolchanges) : "N/A");
|
||||
|
||||
// Hide non-FFF sliced info parameters
|
||||
p->sliced_info->SetTextAndShow(siMateril_unit, "N/A");
|
||||
}
|
||||
}
|
||||
|
||||
Layout();
|
||||
|
|
|
@ -444,6 +444,7 @@ const std::vector<std::string>& Preset::sla_print_options()
|
|||
if (s_opts.empty()) {
|
||||
s_opts = {
|
||||
"layer_height",
|
||||
"faded_layers",
|
||||
"supports_enable",
|
||||
"support_head_front_diameter",
|
||||
"support_head_penetration",
|
||||
|
@ -500,6 +501,7 @@ const std::vector<std::string>& Preset::sla_printer_options()
|
|||
"bed_shape", "max_print_height",
|
||||
"display_width", "display_height", "display_pixels_x", "display_pixels_y",
|
||||
"display_orientation",
|
||||
"fast_tilt_time", "slow_tilt_time", "area_fill",
|
||||
"printer_correction",
|
||||
"print_host", "printhost_apikey", "printhost_cafile",
|
||||
"printer_notes",
|
||||
|
|
|
@ -1977,6 +1977,13 @@ void TabPrinter::build_sla()
|
|||
optgroup->append_line(line);
|
||||
optgroup->append_single_option_line("display_orientation");
|
||||
|
||||
optgroup = page->new_optgroup(_(L("Tilt")));
|
||||
line = { _(L("Tilt time")), "" };
|
||||
line.append_option(optgroup->get_option("fast_tilt_time"));
|
||||
line.append_option(optgroup->get_option("slow_tilt_time"));
|
||||
optgroup->append_line(line);
|
||||
optgroup->append_single_option_line("area_fill");
|
||||
|
||||
optgroup = page->new_optgroup(_(L("Corrections")));
|
||||
line = Line{ m_config->def()->get("printer_correction")->full_label, "" };
|
||||
std::vector<std::string> axes{ "X", "Y", "Z" };
|
||||
|
@ -3210,6 +3217,7 @@ void TabSLAPrint::build()
|
|||
|
||||
auto optgroup = page->new_optgroup(_(L("Layers")));
|
||||
optgroup->append_single_option_line("layer_height");
|
||||
optgroup->append_single_option_line("faded_layers");
|
||||
|
||||
page = add_options_page(_(L("Supports")), "building.png");
|
||||
optgroup = page->new_optgroup(_(L("Supports")));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue