mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Add manual control to DLP projector too
This commit is contained in:
parent
128b2623cc
commit
2efc759a74
3 changed files with 31 additions and 5 deletions
|
@ -267,6 +267,30 @@ sub new {
|
|||
my $buttons = Wx::BoxSizer->new(wxHORIZONTAL);
|
||||
$sizer->Add($buttons, 0, wxEXPAND | wxBOTTOM | wxLEFT | wxRIGHT, 10);
|
||||
|
||||
{
|
||||
my $btn = $self->{btn_manual_control} = Wx::Button->new($self, -1, 'Manual Control', wxDefaultPosition, wxDefaultSize);
|
||||
if ($Slic3r::GUI::have_button_icons) {
|
||||
$btn->SetBitmap(Wx::Bitmap->new("$Slic3r::var/cog.png", wxBITMAP_TYPE_PNG));
|
||||
}
|
||||
$buttons->Add($btn, 0);
|
||||
EVT_BUTTON($self, $btn, sub {
|
||||
my $sender = Slic3r::GCode::Sender->new;
|
||||
my $res = $sender->connect(
|
||||
$self->config->serial_port,
|
||||
$self->config->serial_speed,
|
||||
);
|
||||
if (!$res || !$sender->wait_connected) {
|
||||
Slic3r::GUI::show_error(undef, "Connection failed. Check serial port and speed.");
|
||||
return;
|
||||
}
|
||||
my $dlg = Slic3r::GUI::Controller::ManualControlDialog->new
|
||||
($self, $self->config, $sender);
|
||||
$dlg->ShowModal;
|
||||
$sender->disconnect;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
{
|
||||
my $btn = $self->{btn_print} = Wx::Button->new($self, -1, 'Print', wxDefaultPosition, wxDefaultSize);
|
||||
if ($Slic3r::GUI::have_button_icons) {
|
||||
|
@ -346,6 +370,7 @@ sub _update_buttons {
|
|||
my ($self) = @_;
|
||||
|
||||
my $is_printing = $self->controller->is_printing;
|
||||
$self->{btn_manual_control}->Show(!$is_printing);
|
||||
$self->{btn_print}->Show(!$is_printing);
|
||||
$self->{btn_stop}->Show($is_printing);
|
||||
$self->Layout;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue