mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-18 04:08:02 -06:00
Initial implementation of a wipe tower preview UI.
This commit is contained in:
parent
7b6c9b3b3c
commit
cb0a66b743
7 changed files with 102 additions and 36 deletions
|
@ -53,6 +53,8 @@ sub new {
|
|||
$self->{config} = Slic3r::Config->new_from_defaults(qw(
|
||||
bed_shape complete_objects extruder_clearance_radius skirts skirt_distance brim_width variable_layer_height
|
||||
serial_port serial_speed octoprint_host octoprint_apikey
|
||||
nozzle_diameter single_extruder_multi_material
|
||||
wipe_tower wipe_tower_x wipe_tower_y wipe_tower_width wipe_tower_per_color_wipe
|
||||
));
|
||||
# C++ Slic3r::Model with Perl extensions in Slic3r/Model.pm
|
||||
$self->{model} = Slic3r::Model->new;
|
||||
|
@ -77,7 +79,8 @@ sub new {
|
|||
# Initialize handlers for canvases
|
||||
my $on_select_object = sub {
|
||||
my ($obj_idx) = @_;
|
||||
$self->select_object($obj_idx);
|
||||
# Ignore the special objects (the wipe tower proxy and such).
|
||||
$self->select_object((defined($obj_idx) && $obj_idx < 1000) ? $obj_idx : undef);
|
||||
};
|
||||
my $on_double_click = sub {
|
||||
$self->object_settings_dialog if $self->selected_object;
|
||||
|
@ -538,7 +541,8 @@ sub on_layer_editing_toggled {
|
|||
$self->{"btn_layer_editing"}->SetValue(0);
|
||||
}
|
||||
}
|
||||
$self->{canvas3D}->update;
|
||||
$self->{canvas3D}->Refresh;
|
||||
$self->{canvas3D}->Update;
|
||||
}
|
||||
|
||||
sub GetFrame {
|
||||
|
@ -1700,6 +1704,7 @@ sub on_config_change {
|
|||
my $self = shift;
|
||||
my ($config) = @_;
|
||||
|
||||
my $update_scheduled;
|
||||
foreach my $opt_key (@{$self->{config}->diff($config)}) {
|
||||
$self->{config}->set($opt_key, $config->get($opt_key));
|
||||
if ($opt_key eq 'bed_shape') {
|
||||
|
@ -1707,7 +1712,10 @@ sub on_config_change {
|
|||
$self->{canvas3D}->update_bed_size if $self->{canvas3D};
|
||||
$self->{preview3D}->set_bed_shape($self->{config}->bed_shape)
|
||||
if $self->{preview3D};
|
||||
$self->update;
|
||||
$update_scheduled = 1;
|
||||
} elsif ($opt_key =~ '^wipe_tower' || $opt_key == 'single_extruder_multi_material') {
|
||||
#$self->{canvas3D}->reload_scene if $self->{canvas3D};
|
||||
$update_scheduled = 1;
|
||||
} elsif ($opt_key eq 'serial_port') {
|
||||
if ($config->get('serial_port')) {
|
||||
$self->{btn_print}->Show;
|
||||
|
@ -1732,7 +1740,8 @@ sub on_config_change {
|
|||
$self->{"btn_layer_editing"}->SetValue(0);
|
||||
}
|
||||
$self->{canvas3D}->layer_editing_enabled(0);
|
||||
$self->{canvas3D}->update;
|
||||
$self->{canvas3D}->Refresh;
|
||||
$self->{canvas3D}->Update;
|
||||
} elsif ($self->{canvas3D}->layer_editing_allowed) {
|
||||
# Want to allow the layer editing, but do it only if the OpenGL supports it.
|
||||
if ($self->{htoolbar}) {
|
||||
|
@ -1743,6 +1752,8 @@ sub on_config_change {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$self->update if $update_scheduled;
|
||||
|
||||
return if !$self->GetFrame->is_loaded;
|
||||
|
||||
|
@ -1955,7 +1966,7 @@ sub refresh_canvases {
|
|||
my ($self) = @_;
|
||||
|
||||
$self->{canvas}->Refresh;
|
||||
$self->{canvas3D}->update if $self->{canvas3D};
|
||||
$self->{canvas3D}->reload_scene if $self->{canvas3D};
|
||||
$self->{preview3D}->reload_print if $self->{preview3D};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue