mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 15:13:58 -06:00
Merged with dev
This commit is contained in:
parent
d934b63424
commit
fe3b92870f
90 changed files with 3310 additions and 1748 deletions
|
@ -104,10 +104,11 @@ sub new {
|
|||
# callback to enable/disable action buttons
|
||||
my $enable_action_buttons = sub {
|
||||
my ($enable) = @_;
|
||||
$self->{btn_export_gcode}->Enable($enable);
|
||||
$self->{btn_reslice}->Enable($enable);
|
||||
$self->{btn_print}->Enable($enable);
|
||||
$self->{btn_send_gcode}->Enable($enable);
|
||||
Slic3r::GUI::enable_action_buttons($enable);
|
||||
# $self->{btn_export_gcode}->Enable($enable);
|
||||
# $self->{btn_reslice}->Enable($enable);
|
||||
# $self->{btn_print}->Enable($enable);
|
||||
# $self->{btn_send_gcode}->Enable($enable);
|
||||
};
|
||||
|
||||
# callback to react to gizmo scale
|
||||
|
@ -230,7 +231,14 @@ sub new {
|
|||
my ($obj_idx, $object) = $self->selected_object;
|
||||
if (defined $obj_idx) {
|
||||
my $vol_idx = Slic3r::GUI::_3DScene::get_first_volume_id($self->{canvas3D}, $obj_idx);
|
||||
Slic3r::GUI::_3DScene::select_volume($self->{canvas3D}, $vol_idx) if ($vol_idx != -1);
|
||||
#Slic3r::GUI::_3DScene::select_volume($self->{canvas3D}, $vol_idx) if ($vol_idx != -1);
|
||||
my $inst_cnt = $self->{model}->objects->[$obj_idx]->instances_count;
|
||||
for (0..$inst_cnt-1){
|
||||
Slic3r::GUI::_3DScene::select_volume($self->{canvas3D}, $_ + $vol_idx) if ($vol_idx != -1);
|
||||
}
|
||||
|
||||
my $volume_idx = Slic3r::GUI::_3DScene::get_in_object_volume_id($self->{canvas3D}, $vol_idx);
|
||||
Slic3r::GUI::select_current_volume($obj_idx, $volume_idx) if ($volume_idx != -1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -368,26 +376,35 @@ sub new {
|
|||
# }
|
||||
|
||||
### Panel for right column
|
||||
# $self->{right_panel} = Wx::Panel->new($self, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
|
||||
$self->{right_panel} = Wx::ScrolledWindow->new($self, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
|
||||
$self->{right_panel}->SetScrollbars(0, 1, 1, 1);
|
||||
$self->{right_panel} = Wx::Panel->new($self, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
|
||||
# $self->{right_panel} = Wx::ScrolledWindow->new($self, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
|
||||
# $self->{right_panel}->SetScrollbars(0, 1, 1, 1);
|
||||
|
||||
### Scrolled Window for panel without "Export G-code" and "Slice now" buttons
|
||||
my $scrolled_window_sizer = $self->{scrolled_window_sizer} = Wx::BoxSizer->new(wxVERTICAL);
|
||||
$scrolled_window_sizer->SetMinSize([320, -1]);
|
||||
my $scrolled_window_panel = $self->{scrolled_window_panel} = Wx::ScrolledWindow->new($self->{right_panel}, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
|
||||
$scrolled_window_panel->SetSizer($scrolled_window_sizer);
|
||||
$scrolled_window_panel->SetScrollbars(0, 1, 1, 1);
|
||||
|
||||
# right pane buttons
|
||||
$self->{btn_export_gcode} = Wx::Button->new($self->{right_panel}, -1, L("Export G-code…"), wxDefaultPosition, [-1, 30], wxNO_BORDER);#, wxBU_LEFT);
|
||||
$self->{btn_reslice} = Wx::Button->new($self->{right_panel}, -1, L("Slice now"), wxDefaultPosition, [-1, 30], wxBU_LEFT);
|
||||
$self->{btn_print} = Wx::Button->new($self->{right_panel}, -1, L("Print…"), wxDefaultPosition, [-1, 30], wxBU_LEFT);
|
||||
$self->{btn_send_gcode} = Wx::Button->new($self->{right_panel}, -1, L("Send to printer"), wxDefaultPosition, [-1, 30], wxBU_LEFT);
|
||||
$self->{btn_export_stl} = Wx::Button->new($self->{right_panel}, -1, L("Export STL…"), wxDefaultPosition, [-1, 30], wxBU_LEFT);
|
||||
$self->{btn_export_gcode} = Wx::Button->new($self->{right_panel}, -1, L("Export G-code…"), wxDefaultPosition, [-1, 30],);# wxNO_BORDER);#, wxBU_LEFT);
|
||||
$self->{btn_reslice} = Wx::Button->new($self->{right_panel}, -1, L("Slice now"), wxDefaultPosition, [-1, 30]);#, wxNO_BORDER);#, wxBU_LEFT);
|
||||
# $self->{btn_print} = Wx::Button->new($self->{right_panel}, -1, L("Print…"), wxDefaultPosition, [-1, 30], wxBU_LEFT);
|
||||
# $self->{btn_send_gcode} = Wx::Button->new($self->{right_panel}, -1, L("Send to printer"), wxDefaultPosition, [-1, 30], wxBU_LEFT);
|
||||
$self->{btn_print} = Wx::Button->new($scrolled_window_panel, -1, L("Print…"), wxDefaultPosition, [-1, 30], wxBU_LEFT);
|
||||
$self->{btn_send_gcode} = Wx::Button->new($scrolled_window_panel, -1, L("Send to printer"), wxDefaultPosition, [-1, 30], wxBU_LEFT);
|
||||
#$self->{btn_export_stl} = Wx::Button->new($self->{right_panel}, -1, L("Export STL…"), wxDefaultPosition, [-1, 30], wxBU_LEFT);
|
||||
#$self->{btn_export_gcode}->SetFont($Slic3r::GUI::small_font);
|
||||
#$self->{btn_export_stl}->SetFont($Slic3r::GUI::small_font);
|
||||
$self->{btn_print}->Hide;
|
||||
$self->{btn_send_gcode}->Hide;
|
||||
|
||||
# export_gcode cog_go.png
|
||||
#! reslice reslice.png
|
||||
my %icons = qw(
|
||||
print arrow_up.png
|
||||
send_gcode arrow_up.png
|
||||
reslice reslice.png
|
||||
export_stl brick_go.png
|
||||
);
|
||||
for (grep $self->{"btn_$_"}, keys %icons) {
|
||||
|
@ -494,9 +511,11 @@ sub new {
|
|||
# $self->{preset_choosers}{$group}[$idx]
|
||||
$self->{preset_choosers} = {};
|
||||
for my $group (qw(print filament sla_material printer)) {
|
||||
my $text = Wx::StaticText->new($self->{right_panel}, -1, "$group_labels{$group}:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
|
||||
# my $text = Wx::StaticText->new($self->{right_panel}, -1, "$group_labels{$group}:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
|
||||
my $text = Wx::StaticText->new($scrolled_window_panel, -1, "$group_labels{$group}:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
|
||||
$text->SetFont($Slic3r::GUI::small_font);
|
||||
my $choice = Wx::BitmapComboBox->new($self->{right_panel}, -1, "", wxDefaultPosition, wxDefaultSize, [], wxCB_READONLY);
|
||||
# my $choice = Wx::BitmapComboBox->new($self->{right_panel}, -1, "", wxDefaultPosition, wxDefaultSize, [], wxCB_READONLY);
|
||||
my $choice = Wx::BitmapComboBox->new($scrolled_window_panel, -1, "", wxDefaultPosition, wxDefaultSize, [], wxCB_READONLY);
|
||||
if ($group eq 'filament') {
|
||||
EVT_LEFT_DOWN($choice, sub { $self->filament_color_box_lmouse_down(0, @_); } );
|
||||
}
|
||||
|
@ -515,26 +534,13 @@ sub new {
|
|||
}
|
||||
|
||||
my $frequently_changed_parameters_sizer = $self->{frequently_changed_parameters_sizer} = Wx::BoxSizer->new(wxVERTICAL);
|
||||
Slic3r::GUI::add_frequently_changed_parameters($self->{right_panel}, $frequently_changed_parameters_sizer, $presets);
|
||||
|
||||
my $expert_mode_part_sizer = Wx::BoxSizer->new(wxVERTICAL);
|
||||
Slic3r::GUI::add_expert_mode_part( $self->{right_panel}, $expert_mode_part_sizer,
|
||||
$self->{model},
|
||||
$self->{event_object_selection_changed},
|
||||
$self->{event_object_settings_changed},
|
||||
$self->{event_remove_object},
|
||||
$self->{event_update_scene});
|
||||
# if ($expert_mode_part_sizer->IsShown(2)==1)
|
||||
# {
|
||||
# $expert_mode_part_sizer->Layout;
|
||||
# $expert_mode_part_sizer->Show(2, 0); # ? Why doesn't work
|
||||
# $self->{right_panel}->Layout;
|
||||
# }
|
||||
#! Slic3r::GUI::add_frequently_changed_parameters($self->{right_panel}, $frequently_changed_parameters_sizer, $presets);
|
||||
Slic3r::GUI::add_frequently_changed_parameters($self->{scrolled_window_panel}, $frequently_changed_parameters_sizer, $presets);
|
||||
|
||||
my $object_info_sizer;
|
||||
{
|
||||
# my $box = Wx::StaticBox->new($scrolled_window_panel, -1, L("Info"));
|
||||
my $box = Wx::StaticBox->new($self->{right_panel}, -1, L("Info"));
|
||||
my $box = Wx::StaticBox->new($scrolled_window_panel, -1, L("Info"));
|
||||
# my $box = Wx::StaticBox->new($self->{right_panel}, -1, L("Info"));
|
||||
$box->SetFont($Slic3r::GUI::small_bold_font);
|
||||
$object_info_sizer = Wx::StaticBoxSizer->new($box, wxVERTICAL);
|
||||
$object_info_sizer->SetMinSize([300,-1]);
|
||||
|
@ -554,25 +560,26 @@ sub new {
|
|||
);
|
||||
while (my $field = shift @info) {
|
||||
my $label = shift @info;
|
||||
# my $text = Wx::StaticText->new($scrolled_window_panel, -1, "$label:", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
|
||||
my $text = Wx::StaticText->new($self->{right_panel}, -1, "$label:", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
|
||||
my $text = Wx::StaticText->new($scrolled_window_panel, -1, "$label:", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
|
||||
# my $text = Wx::StaticText->new($self->{right_panel}, -1, "$label:", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
|
||||
$text->SetFont($Slic3r::GUI::small_font);
|
||||
#!$grid_sizer->Add($text, 0);
|
||||
|
||||
# $self->{"object_info_$field"} = Wx::StaticText->new($scrolled_window_panel, -1, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
|
||||
$self->{"object_info_$field"} = Wx::StaticText->new($self->{right_panel}, -1, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
|
||||
$self->{"object_info_$field"} = Wx::StaticText->new($scrolled_window_panel, -1, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
|
||||
# $self->{"object_info_$field"} = Wx::StaticText->new($self->{right_panel}, -1, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
|
||||
$self->{"object_info_$field"}->SetFont($Slic3r::GUI::small_font);
|
||||
if ($field eq 'manifold') {
|
||||
# $self->{object_info_manifold_warning_icon} = Wx::StaticBitmap->new($scrolled_window_panel, -1, Wx::Bitmap->new(Slic3r::var("error.png"), wxBITMAP_TYPE_PNG));
|
||||
$self->{object_info_manifold_warning_icon} = Wx::StaticBitmap->new($self->{right_panel}, -1, Wx::Bitmap->new(Slic3r::var("error.png"), wxBITMAP_TYPE_PNG));
|
||||
$self->{object_info_manifold_warning_icon} = Wx::StaticBitmap->new($scrolled_window_panel, -1, Wx::Bitmap->new(Slic3r::var("error.png"), wxBITMAP_TYPE_PNG));
|
||||
# $self->{object_info_manifold_warning_icon} = Wx::StaticBitmap->new($self->{right_panel}, -1, Wx::Bitmap->new(Slic3r::var("error.png"), wxBITMAP_TYPE_PNG));
|
||||
#$self->{object_info_manifold_warning_icon}->Hide;
|
||||
$self->{"object_info_manifold_warning_icon_show"} = sub {
|
||||
if ($self->{object_info_manifold_warning_icon}->IsShown() != $_[0]) {
|
||||
# this fuction show/hide info_manifold_warning_icon on the c++ side now
|
||||
Slic3r::GUI::set_show_manifold_warning_icon($_[0]);
|
||||
my $mode = wxTheApp->{app_config}->get("view_mode");
|
||||
return if ($mode eq "" || $mode eq "simple");
|
||||
$self->{object_info_manifold_warning_icon}->Show($_[0]);
|
||||
$self->Layout
|
||||
#my $mode = wxTheApp->{app_config}->get("view_mode");
|
||||
#return if ($mode eq "" || $mode eq "simple");
|
||||
#$self->{object_info_manifold_warning_icon}->Show($_[0]);
|
||||
#$self->Layout
|
||||
}
|
||||
};
|
||||
$self->{"object_info_manifold_warning_icon_show"}->(0);
|
||||
|
@ -590,18 +597,19 @@ sub new {
|
|||
}
|
||||
}
|
||||
|
||||
my $print_info_sizer = $self->{print_info_sizer} = Wx::StaticBoxSizer->new(
|
||||
# Wx::StaticBox->new($scrolled_window_panel, -1, L("Sliced Info")), wxVERTICAL);
|
||||
Wx::StaticBox->new($self->{right_panel}, -1, L("Sliced Info")), wxVERTICAL);
|
||||
my $print_info_box = Wx::StaticBox->new($scrolled_window_panel, -1, L("Sliced Info"));
|
||||
$print_info_box->SetFont($Slic3r::GUI::small_bold_font);
|
||||
my $print_info_sizer = $self->{print_info_sizer} = Wx::StaticBoxSizer->new($print_info_box, wxVERTICAL);
|
||||
# Wx::StaticBox->new($self->{right_panel}, -1, L("Sliced Info")), wxVERTICAL);
|
||||
$print_info_sizer->SetMinSize([300,-1]);
|
||||
|
||||
my $buttons_sizer = Wx::BoxSizer->new(wxHORIZONTAL);
|
||||
$self->{buttons_sizer} = $buttons_sizer;
|
||||
$buttons_sizer->AddStretchSpacer(1);
|
||||
$buttons_sizer->Add($self->{btn_export_stl}, 0, wxALIGN_RIGHT, 0);
|
||||
$buttons_sizer->Add($self->{btn_reslice}, 0, wxALIGN_RIGHT, 0);
|
||||
$buttons_sizer->Add($self->{btn_print}, 0, wxALIGN_RIGHT, 0);
|
||||
$buttons_sizer->Add($self->{btn_send_gcode}, 0, wxALIGN_RIGHT, 0);
|
||||
# $buttons_sizer->Add($self->{btn_export_stl}, 0, wxALIGN_RIGHT, 0);
|
||||
#! $buttons_sizer->Add($self->{btn_reslice}, 0, wxALIGN_RIGHT, 0);
|
||||
$buttons_sizer->Add($self->{btn_print}, 0, wxALIGN_RIGHT | wxBOTTOM | wxTOP, 5);
|
||||
$buttons_sizer->Add($self->{btn_send_gcode}, 0, wxALIGN_RIGHT | wxBOTTOM | wxTOP, 5);
|
||||
|
||||
# $scrolled_window_sizer->Add($self->{list}, 1, wxEXPAND, 5);
|
||||
# $scrolled_window_sizer->Add($object_info_sizer, 0, wxEXPAND, 0);
|
||||
|
@ -611,24 +619,39 @@ sub new {
|
|||
### Sizer for info boxes
|
||||
my $info_sizer = $self->{info_sizer} = Wx::BoxSizer->new(wxVERTICAL);
|
||||
$info_sizer->SetMinSize([318, -1]);
|
||||
$info_sizer->Add($object_info_sizer, 0, wxEXPAND | wxBOTTOM, 5);
|
||||
$info_sizer->Add($print_info_sizer, 0, wxEXPAND | wxBOTTOM, 5);
|
||||
$info_sizer->Add($object_info_sizer, 0, wxEXPAND | wxTOP, 20);
|
||||
$info_sizer->Add($print_info_sizer, 0, wxEXPAND | wxTOP, 20);
|
||||
|
||||
$scrolled_window_sizer->Add($presets, 0, wxEXPAND | wxLEFT, 2) if defined $presets;
|
||||
$scrolled_window_sizer->Add($frequently_changed_parameters_sizer, 1, wxEXPAND | wxLEFT, 0) if defined $frequently_changed_parameters_sizer;
|
||||
$scrolled_window_sizer->Add($buttons_sizer, 0, wxEXPAND, 0);
|
||||
$scrolled_window_sizer->Add($info_sizer, 0, wxEXPAND | wxLEFT, 20);
|
||||
# Show the box initially, let it be shown after the slicing is finished.
|
||||
$self->print_info_box_show(0);
|
||||
|
||||
### Sizer for "Export G-code" & "Slice now" buttons
|
||||
my $btns_sizer = Wx::BoxSizer->new(wxVERTICAL);
|
||||
$btns_sizer->SetMinSize([318, -1]);
|
||||
$btns_sizer->Add($self->{btn_reslice}, 0, wxEXPAND, 0);
|
||||
$btns_sizer->Add($self->{btn_export_gcode}, 0, wxEXPAND | wxTOP, 5);
|
||||
|
||||
my $right_sizer = Wx::BoxSizer->new(wxVERTICAL);
|
||||
$self->{right_panel}->SetSizer($right_sizer);
|
||||
$right_sizer->SetMinSize([320, -1]);
|
||||
$right_sizer->Add($presets, 0, wxEXPAND | wxTOP, 10) if defined $presets;
|
||||
$right_sizer->Add($frequently_changed_parameters_sizer, 1, wxEXPAND | wxTOP, 0) if defined $frequently_changed_parameters_sizer;
|
||||
$right_sizer->Add($expert_mode_part_sizer, 0, wxEXPAND | wxTOP, 10) if defined $expert_mode_part_sizer;
|
||||
$right_sizer->Add($buttons_sizer, 0, wxEXPAND | wxBOTTOM | wxTOP, 10);
|
||||
$right_sizer->Add($info_sizer, 0, wxEXPAND | wxLEFT, 20);
|
||||
#! $right_sizer->Add($presets, 0, wxEXPAND | wxTOP, 10) if defined $presets;
|
||||
#! $right_sizer->Add($frequently_changed_parameters_sizer, 1, wxEXPAND | wxTOP, 0) if defined $frequently_changed_parameters_sizer;
|
||||
#! $right_sizer->Add($buttons_sizer, 0, wxEXPAND | wxBOTTOM | wxTOP, 10);
|
||||
#! $right_sizer->Add($info_sizer, 0, wxEXPAND | wxLEFT, 20);
|
||||
# Show the box initially, let it be shown after the slicing is finished.
|
||||
$self->print_info_box_show(0);
|
||||
$right_sizer->Add($self->{btn_export_gcode}, 0, wxEXPAND | wxLEFT | wxTOP | wxBOTTOM, 20);
|
||||
#! $self->print_info_box_show(0);
|
||||
$right_sizer->Add($scrolled_window_panel, 1, wxEXPAND | wxTOP, 5);
|
||||
# $right_sizer->Add($self->{btn_reslice}, 0, wxEXPAND | wxLEFT | wxTOP, 20);
|
||||
# $right_sizer->Add($self->{btn_export_gcode}, 0, wxEXPAND | wxLEFT | wxTOP, 20);
|
||||
$right_sizer->Add($btns_sizer, 0, wxEXPAND | wxLEFT | wxTOP, 20);
|
||||
|
||||
my $hsizer = Wx::BoxSizer->new(wxHORIZONTAL);
|
||||
$hsizer->Add($self->{preview_notebook}, 1, wxEXPAND | wxTOP, 1);
|
||||
$hsizer->Add($self->{right_panel}, 0, wxEXPAND | wxLEFT | wxRIGHT, 3);
|
||||
$hsizer->Add($self->{right_panel}, 0, wxEXPAND | wxLEFT | wxRIGHT, 0);#3);
|
||||
|
||||
my $sizer = Wx::BoxSizer->new(wxVERTICAL);
|
||||
# $sizer->Add($self->{htoolbar}, 0, wxEXPAND, 0) if $self->{htoolbar};
|
||||
|
@ -639,16 +662,21 @@ sub new {
|
|||
$self->SetSizer($sizer);
|
||||
|
||||
# Send sizers/buttons to C++
|
||||
Slic3r::GUI::set_objects_from_perl( $self->{right_panel},
|
||||
$frequently_changed_parameters_sizer,
|
||||
$expert_mode_part_sizer,
|
||||
$info_sizer,
|
||||
$self->{btn_export_gcode},
|
||||
$self->{btn_export_stl},
|
||||
$self->{btn_reslice},
|
||||
$self->{btn_print},
|
||||
$self->{btn_send_gcode},
|
||||
$self->{object_info_manifold_warning_icon} );
|
||||
Slic3r::GUI::set_objects_from_perl( $self->{scrolled_window_panel},
|
||||
$frequently_changed_parameters_sizer,
|
||||
$info_sizer,
|
||||
$self->{btn_export_gcode},
|
||||
# $self->{btn_export_stl},
|
||||
$self->{btn_reslice},
|
||||
$self->{btn_print},
|
||||
$self->{btn_send_gcode},
|
||||
$self->{object_info_manifold_warning_icon} );
|
||||
|
||||
Slic3r::GUI::set_model_events_from_perl( $self->{model},
|
||||
$self->{event_object_selection_changed},
|
||||
$self->{event_object_settings_changed},
|
||||
$self->{event_remove_object},
|
||||
$self->{event_update_scene});
|
||||
}
|
||||
|
||||
# Last correct selected item for each preset
|
||||
|
@ -1594,14 +1622,16 @@ sub print_info_box_show {
|
|||
# my $scrolled_window_panel = $self->{scrolled_window_panel};
|
||||
# my $scrolled_window_sizer = $self->{scrolled_window_sizer};
|
||||
# return if (!$show && ($scrolled_window_sizer->IsShown(2) == $show));
|
||||
my $panel = $self->{right_panel};
|
||||
my $panel = $self->{scrolled_window_panel};#$self->{right_panel};
|
||||
my $sizer = $self->{info_sizer};
|
||||
return if (!$sizer || !$show && ($sizer->IsShown(1) == $show));
|
||||
# return if (!$sizer || !$show && ($sizer->IsShown(1) == $show));
|
||||
return if (!$sizer);
|
||||
|
||||
Slic3r::GUI::set_show_print_info($show);
|
||||
return if (wxTheApp->{app_config}->get("view_mode") eq "simple");
|
||||
# return if (wxTheApp->{app_config}->get("view_mode") eq "simple");
|
||||
|
||||
if ($show) {
|
||||
# if ($show)
|
||||
{
|
||||
my $print_info_sizer = $self->{print_info_sizer};
|
||||
$print_info_sizer->Clear(1);
|
||||
my $grid_sizer = Wx::FlexGridSizer->new(2, 2, 5, 5);
|
||||
|
@ -1609,20 +1639,37 @@ sub print_info_box_show {
|
|||
$grid_sizer->AddGrowableCol(1, 1);
|
||||
$grid_sizer->AddGrowableCol(3, 1);
|
||||
$print_info_sizer->Add($grid_sizer, 0, wxEXPAND);
|
||||
my $is_wipe_tower = $self->{print}->total_wipe_tower_filament > 0;
|
||||
my @info = (
|
||||
L("Used Filament (m)")
|
||||
=> sprintf("%.2f" , $self->{print}->total_used_filament / 1000),
|
||||
=> $is_wipe_tower ?
|
||||
sprintf("%.2f (%.2f %s + %.2f %s)" , $self->{print}->total_used_filament / 1000,
|
||||
($self->{print}->total_used_filament - $self->{print}->total_wipe_tower_filament) / 1000,
|
||||
L("objects"),
|
||||
$self->{print}->total_wipe_tower_filament / 1000,
|
||||
L("wipe tower")) :
|
||||
sprintf("%.2f" , $self->{print}->total_used_filament / 1000),
|
||||
|
||||
L("Used Filament (mm³)")
|
||||
=> sprintf("%.2f" , $self->{print}->total_extruded_volume),
|
||||
L("Used Filament (g)"),
|
||||
=> sprintf("%.2f" , $self->{print}->total_weight),
|
||||
L("Cost"),
|
||||
=> sprintf("%.2f" , $self->{print}->total_cost),
|
||||
=> $is_wipe_tower ?
|
||||
sprintf("%.2f (%.2f %s + %.2f %s)" , $self->{print}->total_cost,
|
||||
($self->{print}->total_cost - $self->{print}->total_wipe_tower_cost),
|
||||
L("objects"),
|
||||
$self->{print}->total_wipe_tower_cost,
|
||||
L("wipe tower")) :
|
||||
sprintf("%.2f" , $self->{print}->total_cost),
|
||||
L("Estimated printing time (normal mode)")
|
||||
=> $self->{print}->estimated_normal_print_time,
|
||||
L("Estimated printing time (silent mode)")
|
||||
=> $self->{print}->estimated_silent_print_time
|
||||
);
|
||||
# if there is a wipe tower, insert number of toolchanges info into the array:
|
||||
splice (@info, 8, 0, L("Number of tool changes") => sprintf("%.d", $self->{print}->wipe_tower_number_of_toolchanges)) if ($is_wipe_tower);
|
||||
|
||||
while ( my $label = shift @info) {
|
||||
my $value = shift @info;
|
||||
next if $value eq "N/A";
|
||||
|
@ -1639,7 +1686,7 @@ sub print_info_box_show {
|
|||
|
||||
# $scrolled_window_sizer->Show(2, $show);
|
||||
# $scrolled_window_panel->Layout;
|
||||
$sizer->Show(1, $show);
|
||||
$sizer->Show(1, $show && wxTheApp->{app_config}->get("view_mode") ne "simple");
|
||||
|
||||
$self->Layout;
|
||||
$panel->Refresh;
|
||||
|
@ -1823,6 +1870,7 @@ sub _get_export_file {
|
|||
# (i.e. when an object is added/removed/moved/rotated/scaled)
|
||||
sub update {
|
||||
my ($self, $force_autocenter) = @_;
|
||||
$self->Freeze;
|
||||
if (wxTheApp->{app_config}->get("autocenter") || $force_autocenter) {
|
||||
$self->{model}->center_instances_around_point($self->bed_centerf);
|
||||
}
|
||||
|
@ -1836,6 +1884,7 @@ sub update {
|
|||
$self->{preview3D}->reset_gcode_preview_data if $self->{preview3D};
|
||||
$self->{preview3D}->reload_print if $self->{preview3D};
|
||||
$self->schedule_background_process;
|
||||
$self->Thaw;
|
||||
}
|
||||
|
||||
# When a printer technology is changed, the UI needs to be updated to show/hide needed preset combo boxes.
|
||||
|
@ -1868,7 +1917,8 @@ sub on_extruders_change {
|
|||
my @presets = $choices->[0]->GetStrings;
|
||||
|
||||
# initialize new choice
|
||||
my $choice = Wx::BitmapComboBox->new($self->{right_panel}, -1, "", wxDefaultPosition, wxDefaultSize, [@presets], wxCB_READONLY);
|
||||
# my $choice = Wx::BitmapComboBox->new($self->{right_panel}, -1, "", wxDefaultPosition, wxDefaultSize, [@presets], wxCB_READONLY);
|
||||
my $choice = Wx::BitmapComboBox->new($self->{scrolled_window_panel}, -1, "", wxDefaultPosition, wxDefaultSize, [@presets], wxCB_READONLY);
|
||||
my $extruder_idx = scalar @$choices;
|
||||
EVT_LEFT_DOWN($choice, sub { $self->filament_color_box_lmouse_down($extruder_idx, @_); } );
|
||||
push @$choices, $choice;
|
||||
|
@ -1895,6 +1945,7 @@ sub on_extruders_change {
|
|||
$choices->[-1]->Destroy;
|
||||
pop @$choices;
|
||||
}
|
||||
$self->{right_panel}->Layout;
|
||||
$self->Layout;
|
||||
}
|
||||
|
||||
|
@ -2221,15 +2272,59 @@ sub select_object {
|
|||
if (defined $obj_idx) {
|
||||
$self->{objects}->[$obj_idx]->selected(1);
|
||||
# Select current object in the list on c++ side, if item isn't child
|
||||
if (!defined $child){
|
||||
Slic3r::GUI::select_current_object($obj_idx);}
|
||||
# if (!defined $child){
|
||||
# Slic3r::GUI::select_current_object($obj_idx);} # all selections in the object list is on c++ side
|
||||
} else {
|
||||
# Unselect all objects in the list on c++ side
|
||||
Slic3r::GUI::unselect_objects();
|
||||
# Slic3r::GUI::unselect_objects(); # all selections in the object list is on c++ side
|
||||
}
|
||||
$self->selection_changed(1);
|
||||
}
|
||||
|
||||
sub select_object_from_cpp {
|
||||
my ($self, $obj_idx, $vol_idx) = @_;
|
||||
|
||||
# remove current selection
|
||||
foreach my $o (0..$#{$self->{objects}}) {
|
||||
$self->{objects}->[$o]->selected(0);
|
||||
}
|
||||
|
||||
my $curr = Slic3r::GUI::_3DScene::get_select_by($self->{canvas3D});
|
||||
|
||||
if (defined $obj_idx) {
|
||||
if ($vol_idx == -1){
|
||||
if ($curr eq 'object') {
|
||||
$self->{objects}->[$obj_idx]->selected(1);
|
||||
}
|
||||
elsif ($curr eq 'volume') {
|
||||
Slic3r::GUI::_3DScene::set_select_by($self->{canvas3D}, 'object');
|
||||
}
|
||||
|
||||
my $selections = $self->collect_selections;
|
||||
Slic3r::GUI::_3DScene::set_objects_selections($self->{canvas3D}, \@$selections);
|
||||
Slic3r::GUI::_3DScene::reload_scene($self->{canvas3D}, 1);
|
||||
}
|
||||
else {
|
||||
if ($curr eq 'object') {
|
||||
Slic3r::GUI::_3DScene::set_select_by($self->{canvas3D}, 'volume');
|
||||
}
|
||||
|
||||
my $selections = [];
|
||||
Slic3r::GUI::_3DScene::set_objects_selections($self->{canvas3D}, \@$selections);
|
||||
Slic3r::GUI::_3DScene::deselect_volumes($self->{canvas3D});
|
||||
Slic3r::GUI::_3DScene::reload_scene($self->{canvas3D}, 1);
|
||||
my $volume_idx = Slic3r::GUI::_3DScene::get_first_volume_id($self->{canvas3D}, $obj_idx);
|
||||
|
||||
my $inst_cnt = $self->{model}->objects->[$obj_idx]->instances_count;
|
||||
for (0..$inst_cnt-1){
|
||||
Slic3r::GUI::_3DScene::select_volume($self->{canvas3D}, $vol_idx*$inst_cnt + $_ + $volume_idx) if ($volume_idx != -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$self->selection_changed(1);
|
||||
}
|
||||
|
||||
sub selected_object {
|
||||
my ($self) = @_;
|
||||
my $obj_idx = first { $self->{objects}[$_]->selected } 0..$#{ $self->{objects} };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue