ExpTime incorporated. Some refactor as welll.

This commit is contained in:
tamasmeszaros 2018-06-28 13:21:24 +02:00
parent 8497289650
commit 18bfe4f2dc
7 changed files with 269 additions and 144 deletions

View file

@ -1253,7 +1253,8 @@ void Print::set_status(int percent, const std::string &message)
}
void Print::print_to_png(std::string dirpath) {
print_to<FilePrinterFormat::PNG>(*this, dirpath, 68.0, 120.0, 1440, 2560);
print_to<FilePrinterFormat::PNG>(*this, dirpath, 68.0, 120.0, 1440, 2560,
8.0, 35.0);
}
}

View file

@ -75,7 +75,7 @@ public:
// Implementation for PNG raster output
// Be aware that if a large number of layers are allocated, it can very well
// exhaust the available memory.especially on 32 bit platform.
// exhaust the available memory especially on 32 bit platform.
template<> class FilePrinter<FilePrinterFormat::PNG> {
struct Layer {
@ -97,35 +97,46 @@ template<> class FilePrinter<FilePrinterFormat::PNG> {
Raster::Resolution res_;
Raster::PixelDim pxdim_;
const Print *print_ = nullptr;
double exp_time_s_ = .0, exp_time_first_s_ = .0;
std::string createIniContent(const std::string& projectname) {
double layer_height = print_?
print_->default_object_config.layer_height.getFloat() :
0.05;
return std::string(
using std::string;
using std::to_string;
auto expt_str = to_string(exp_time_s_);
auto expt_first_str = to_string(exp_time_first_s_);
auto stepnum_str = to_string(static_cast<unsigned>(800*layer_height));
auto layerh_str = to_string(layer_height);
return string(
"action = print\n"
"jobDir = ") + projectname + "\n" +
"expTime = 8.0\n"
"expTimeFirst = 35\n"
"stepNum = 40\n"
"expTime = " + expt_str + "\n"
"expTimeFirst = " + expt_first_str + "\n"
"stepNum = " + stepnum_str + "\n"
"wifiOn = 1\n"
"tiltSlow = 60\n"
"tiltFast = 15\n"
"numFade = 10\n"
"startdelay = 0\n"
"layerHeight = " + std::to_string(layer_height) + "\n"
"layerHeight = " + layerh_str + "\n"
"noteInfo = "
"expTime=8.0+resinType=FTD-IB-Black+layerHeight=0.05+printer=DWARF3\n";
"expTime="+expt_str+"+resinType=FTD-IB-Black+layerHeight="
+layerh_str+"+printer=DWARF3\n";
}
public:
inline FilePrinter(double width_mm, double height_mm,
unsigned width_px, unsigned height_px,
unsigned layer_cnt = 0):
res_(width_px, height_px),
pxdim_(width_mm/width_px, height_mm/height_px) {
layers(layer_cnt);
double exp_time, double exp_time_first):
res_(width_px, height_px), exp_time_s_(exp_time),
exp_time_first_s_(exp_time_first),
pxdim_(width_mm/width_px, height_mm/height_px)
{
}
FilePrinter(const FilePrinter& ) = delete;

View file

@ -289,8 +289,8 @@ void PrintController::slice_to_png()
return;
}
// TODO
/*bool correction = false;
// TODO: copy the model and work with the copy only
bool correction = false;
if(exd.corr_x != 1.0 || exd.corr_y != 1.0 || exd.corr_z != 1.0) {
correction = true;
print_->invalidate_all_steps();
@ -301,8 +301,9 @@ void PrintController::slice_to_png()
);
po->model_object()->invalidate_bounding_box();
po->reload_model_instances();
po->invalidate_all_steps();
}
}*/
}
auto print_bb = print_->bounding_box();
@ -319,7 +320,7 @@ void PrintController::slice_to_png()
}
std::async(supports_asynch()? std::launch::async : std::launch::deferred,
[this, exd]()
[this, exd, correction]()
{
progress_indicator(100, "Slicing to zipped png files...");
progress_indicator()->procedure_count(3);
@ -338,14 +339,15 @@ void PrintController::slice_to_png()
try {
print_to<FilePrinterFormat::PNG>( *print_, exd.zippath,
exd.width_mm, exd.height_mm,
exd.width_px, exd.height_px );
exd.width_px, exd.height_px,
exd.exp_time_s, exd.exp_time_first_s);
} catch (std::exception& e) {
report_issue(IssueType::ERR, e.what(), "Exception");
progress_indicator()->cancel();
}
/*if(correction) { // scale the model back
if(correction) { // scale the model back
print_->invalidate_all_steps();
for(auto po : print_->objects) {
po->model_object()->scale(
@ -353,8 +355,9 @@ void PrintController::slice_to_png()
);
po->model_object()->invalidate_bounding_box();
po->reload_model_instances();
po->invalidate_all_steps();
}
}*/
}
print_->progressindicator = pbak;
});

View file

@ -187,6 +187,8 @@ protected:
unsigned long width_px = 1440; // resolution - rows
unsigned long height_px = 2560; // resolution columns
double width_mm = 68.0, height_mm = 120.0; // dimensions in mm
double exp_time_first_s = 35.0; // first exposure time
double exp_time_s = 8.0; // global exposure time
double corr_x = 1.0; // offsetting in x
double corr_y = 1.0; // offsetting in y
double corr_z = 1.0; // offsetting in y

View file

@ -319,6 +319,8 @@ PrintController::PngExportData PrintController::query_png_export_data()
ret.height_px = spin_reso_height_->GetValue();
ret.width_mm = bed_width_spin_->GetValue();
ret.height_mm = bed_height_spin_->GetValue();
ret.exp_time_s = exptime_spin_->GetValue();
ret.exp_time_first_s = exptime_first_spin_->GetValue();
ret.corr_x = corr_spin_x_->GetValue();
ret.corr_y = corr_spin_y_->GetValue();
ret.corr_z = corr_spin_z_->GetValue();
@ -331,6 +333,8 @@ PrintController::PngExportData PrintController::query_png_export_data()
spin_reso_height_->SetValue(data.height_px);
bed_width_spin_->SetValue(data.width_mm);
bed_height_spin_->SetValue(data.height_mm);
exptime_spin_->SetValue(data.exp_time_s);
exptime_first_spin_->SetValue(data.exp_time_first_s);
corr_spin_x_->SetValue(data.corr_x);
corr_spin_y_->SetValue(data.corr_y);
corr_spin_z_->SetValue(data.corr_z);

View file

@ -1,147 +1,211 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "PngExportDialog.hpp"
///////////////////////////////////////////////////////////////////////////
namespace Slic3r {
PngExportDialog::PngExportDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
PngExportDialog::PngExportDialog( wxWindow* parent, wxWindowID id,
const wxString& title, const wxPoint& pos,
const wxSize& size, long style ) :
wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* top_layout_;
top_layout_ = new wxBoxSizer( wxVERTICAL );
auto top_layout = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* bSizer15;
bSizer15 = new wxBoxSizer( wxHORIZONTAL );
// /////////////////////////////////////////////////////////////////////////
// Labels
// /////////////////////////////////////////////////////////////////////////
wxBoxSizer* bSizer16;
bSizer16 = new wxBoxSizer( wxVERTICAL );
auto labels_layout = new wxGridSizer(6, 1, 0, 0);
wxGridSizer* gSizer2;
gSizer2 = new wxGridSizer( 5, 1, 0, 0 );
// Input File picker label
auto filepick_text = new wxStaticText( this, wxID_ANY,
_("Target zip file"),
wxDefaultPosition,
wxDefaultSize, 0 );
filepick_text->Wrap( -1 );
labels_layout->Add( filepick_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
filepick_text_ = new wxStaticText( this, wxID_ANY, _("Target zip file"), wxDefaultPosition, wxDefaultSize, 0 );
filepick_text_->Wrap( -1 );
gSizer2->Add( filepick_text_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
auto confpick_text = new wxStaticText( this, wxID_ANY, _("Config file (optional)"), wxDefaultPosition, wxDefaultSize, 0 );
// Config file label
auto confpick_text = new wxStaticText( this, wxID_ANY,
_("Config file (optional)"),
wxDefaultPosition,
wxDefaultSize, 0 );
confpick_text->Wrap( -1 );
gSizer2->Add( confpick_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
labels_layout->Add( confpick_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
confpick_text->Disable();
resotext_ = new wxStaticText( this, wxID_ANY, _("Resolution (w, h) [px]"), wxDefaultPosition, wxDefaultSize, 0 );
resotext_->Wrap( -1 );
gSizer2->Add( resotext_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
// Resolution layout
auto resotext = new wxStaticText( this, wxID_ANY,
_("Resolution (w, h) [px]"),
wxDefaultPosition, wxDefaultSize, 0 );
resotext->Wrap( -1 );
labels_layout->Add( resotext, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
bed_size_text_ = new wxStaticText( this, wxID_ANY, _("Bed size (w, h) [mm]"), wxDefaultPosition, wxDefaultSize, 0 );
bed_size_text_->Wrap( -1 );
gSizer2->Add( bed_size_text_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
// Bed size label
auto bed_size_text = new wxStaticText( this, wxID_ANY,
_("Bed size (w, h) [mm]"),
wxDefaultPosition,
wxDefaultSize, 0 );
bed_size_text->Wrap( -1 );
labels_layout->Add( bed_size_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
corr_text_ = new wxStaticText( this, wxID_ANY, _("Scale (x, y, z)"), wxDefaultPosition, wxDefaultSize, 0 );
corr_text_->Wrap( -1 );
gSizer2->Add( corr_text_, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
// Correction label
auto corr_text = new wxStaticText( this, wxID_ANY, _("Scale (x, y, z)"),
wxDefaultPosition, wxDefaultSize, 0 );
corr_text->Wrap( -1 );
labels_layout->Add( corr_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
// Exp time label
auto exp_text = new wxStaticText( this, wxID_ANY,
_("Exposure time [s]"),
wxDefaultPosition, wxDefaultSize, 0 );
exp_text->Wrap( -1 );
labels_layout->Add( exp_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
top_layout->Add( labels_layout, 0, wxEXPAND, 5 );
// /////////////////////////////////////////////////////////////////////////
bSizer16->Add( gSizer2, 1, wxEXPAND, 5 );
// /////////////////////////////////////////////////////////////////////////
// Body
// /////////////////////////////////////////////////////////////////////////
auto body_layout = new wxBoxSizer( wxVERTICAL );
// Input file picker
auto fpicklayout = new wxBoxSizer(wxHORIZONTAL);
filepick_ctl_ = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString,
_("Select a file"), wxT("*.zip"),
wxDefaultPosition, wxDefaultSize,
wxFLP_USE_TEXTCTRL | wxFLP_SAVE,
wxDefaultValidator,
wxT("filepick_ctl") );
fpicklayout->Add( filepick_ctl_, 1, wxALL | wxALIGN_CENTER, 5);
body_layout->Add( fpicklayout, 1, wxEXPAND, 5 );
auto ctlpicklayout = new wxBoxSizer(wxHORIZONTAL);
confpick_ctl_ = new wxFilePickerCtrl(
this, wxID_ANY, wxEmptyString, _("Select a file"),
wxT("*.json"), wxDefaultPosition, wxDefaultSize,
wxFLP_USE_TEXTCTRL | wxFLP_DEFAULT_STYLE, wxDefaultValidator,
wxT("filepick_ctl") );
confpick_ctl_->Disable();
ctlpicklayout->Add( confpick_ctl_, 1, wxALL | wxALIGN_CENTER, 5);
body_layout->Add( ctlpicklayout, 1, wxEXPAND, 5 );
bSizer15->Add( bSizer16, 0, wxEXPAND, 5 );
// Resolution controls /////////////////////////////////////////////////////
wxBoxSizer* bSizer18;
bSizer18 = new wxBoxSizer( wxVERTICAL );
auto res_spins_layout = new wxBoxSizer( wxHORIZONTAL );
spin_reso_width_ = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS, 0, 10000, 1440 );
res_spins_layout->Add( spin_reso_width_, 1, wxALIGN_CENTER|wxALL, 5 );
spin_reso_height_ = new wxSpinCtrl( this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS, 0, 10000, 2560 );
res_spins_layout->Add( spin_reso_height_, 1, wxALIGN_CENTER|wxALL, 5 );
wxBoxSizer* filepick_layout_;
filepick_layout_ = new wxBoxSizer( wxHORIZONTAL );
filepick_ctl_ = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*.zip"), wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL | wxFLP_SAVE, wxDefaultValidator, wxT("filepick_ctl") );
filepick_layout_->Add( filepick_ctl_, 2, wxALIGN_CENTER|wxALL, 5 );
bSizer18->Add( filepick_layout_, 1, wxEXPAND, 5 );
wxBoxSizer* confpick_layout_;
confpick_layout_ = new wxBoxSizer( wxHORIZONTAL );
confpick_ctl_ = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*.json"), wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL | wxFLP_DEFAULT_STYLE, wxDefaultValidator, wxT("filepick_ctl") );
confpick_layout_ ->Add( confpick_ctl_, 2, wxALIGN_CENTER|wxALL, 5 );
bSizer18->Add( confpick_layout_ , 1, wxEXPAND, 5 );
wxBoxSizer* resolution_layout_;
resolution_layout_ = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* resolution_spins_layout_;
resolution_spins_layout_ = new wxBoxSizer( wxHORIZONTAL );
spin_reso_width_ = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10000, 1440 );
resolution_spins_layout_->Add( spin_reso_width_, 1, wxALIGN_CENTER|wxALL, 5 );
spin_reso_height_ = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10000, 2560 );
resolution_spins_layout_->Add( spin_reso_height_, 1, wxALIGN_CENTER|wxALL, 5 );
reso_lock_btn_ = new wxToggleButton( this, wxID_ANY, _("Lock"), wxDefaultPosition, wxDefaultSize, 0 );
reso_lock_btn_ = new wxToggleButton( this, wxID_ANY, _("Lock"),
wxDefaultPosition, wxDefaultSize, 0 );
reso_lock_btn_->SetValue(true);
resolution_spins_layout_->Add( reso_lock_btn_, 0, wxALIGN_CENTER|wxALL, 5 );
res_spins_layout->Add( reso_lock_btn_, 0, wxALIGN_CENTER|wxALL, 5 );
body_layout->Add( res_spins_layout, 1, wxEXPAND, 5 );
resolution_layout_->Add( resolution_spins_layout_, 1, wxEXPAND, 5 );
// Bed size controls ///////////////////////////////////////////////////////
auto bed_spins_layout = new wxBoxSizer( wxHORIZONTAL );
bed_width_spin_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS, 0, 1e6, 68.0 );
bSizer18->Add( resolution_layout_, 1, wxEXPAND, 5 );
bed_spins_layout->Add( bed_width_spin_, 1, wxALIGN_CENTER|wxALL, 5 );
wxBoxSizer* bedsize_layout_;
bedsize_layout_ = new wxBoxSizer( wxHORIZONTAL );
bed_height_spin_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS, 0, 1e6, 120.0 );
bed_spins_layout->Add( bed_height_spin_, 1, wxALIGN_CENTER|wxALL, 5 );
wxBoxSizer* bedsize_spins_layout_;
bedsize_spins_layout_ = new wxBoxSizer( wxHORIZONTAL );
bed_width_spin_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 1e6, 68.0 );
bedsize_spins_layout_->Add( bed_width_spin_, 1, wxALIGN_CENTER|wxALL, 5 );
bed_height_spin_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 1e6, 120.0 );
bedsize_spins_layout_->Add( bed_height_spin_, 1, wxALIGN_CENTER|wxALL, 5 );
bedsize_lock_btn_ = new wxToggleButton( this, wxID_ANY, _("Lock"), wxDefaultPosition, wxDefaultSize, 0 );
bedsize_lock_btn_ = new wxToggleButton( this, wxID_ANY, _("Lock"),
wxDefaultPosition,
wxDefaultSize, 0 );
bedsize_lock_btn_->SetValue(true);
bedsize_spins_layout_->Add( bedsize_lock_btn_, 0, wxALIGN_CENTER|wxALL, 5 );
bed_spins_layout->Add( bedsize_lock_btn_, 0, wxALIGN_CENTER|wxALL, 5 );
bedsize_layout_->Add( bedsize_spins_layout_, 1, wxEXPAND, 5 );
body_layout->Add( bed_spins_layout, 1, wxEXPAND, 5 );
bSizer18->Add( bedsize_layout_, 1, wxEXPAND, 5 );
wxBoxSizer* corr_layout_;
corr_layout_ = new wxBoxSizer( wxHORIZONTAL );
// Scale correction controls ///////////////////////////////////////////////
corr_spin_x_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 1, 0.01 );
auto corr_layout = new wxBoxSizer( wxHORIZONTAL );
corr_spin_x_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS, 0, 100, 1, 0.01 );
corr_spin_x_->SetDigits(3);
corr_spin_x_->SetMaxSize(wxSize(100, -1));
corr_layout_->Add( corr_spin_x_, 0, wxALIGN_CENTER|wxALL, 5 );
corr_layout->Add( corr_spin_x_, 0, wxALIGN_CENTER|wxALL, 5 );
corr_spin_y_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 1, 0.01 );
corr_spin_y_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS, 0, 100, 1, 0.01 );
corr_spin_y_->SetDigits(3);
corr_spin_y_->SetMaxSize(wxSize(100, -1));
corr_layout_->Add( corr_spin_y_, 0, wxALIGN_CENTER|wxALL, 5 );
corr_layout->Add( corr_spin_y_, 0, wxALIGN_CENTER|wxALL, 5 );
corr_spin_z_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 1, 0.01 );
corr_spin_z_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS, 0, 100, 1, 0.01 );
corr_spin_z_->SetDigits(3);
corr_spin_z_->SetMaxSize(wxSize(100, -1));
corr_layout_->Add( corr_spin_z_, 0, wxALIGN_CENTER|wxALL, 5 );
corr_layout->Add( corr_spin_z_, 0, wxALIGN_CENTER|wxALL, 5 );
corr_layout_->Add( 0, 0, 1, wxEXPAND, 5 );
corr_layout->Add( bedsize_lock_btn_->GetSize().GetWidth(), 0, 1, wxEXPAND, 5 );
export_btn_ = new wxButton( this, wxID_ANY, _("Export"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxT("export_btn") );
corr_layout_->Add( export_btn_, 0, wxALIGN_CENTER|wxALL, 5 );
body_layout->Add( corr_layout, 1, wxEXPAND, 5 );
// Exposure time controls /////////////////////////////////////////////////
bSizer18->Add( corr_layout_, 1, wxEXPAND, 5 );
auto exp_layout = new wxBoxSizer( wxHORIZONTAL );
exptime_spin_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS, 0, 100, 1, 0.01 );
exptime_spin_->SetDigits(3);
exptime_spin_->SetMaxSize(wxSize(100, -1));
auto first_txt = new wxStaticText( this, wxID_ANY,
_("First exp. time"),
wxDefaultPosition,
wxDefaultSize, wxALIGN_RIGHT );
bSizer15->Add( bSizer18, 1, wxEXPAND, 5 );
exptime_first_spin_ = new wxSpinCtrlDouble( this, wxID_ANY, wxEmptyString,
wxDefaultPosition,
wxDefaultSize, wxSP_ARROW_KEYS,
0, 100, 1, 0.01 );
exptime_first_spin_->SetDigits(3);
exptime_first_spin_->SetMaxSize(wxSize(100, -1));
exp_layout->Add( exptime_spin_, 1, wxALIGN_CENTER|wxALL, 5 );
exp_layout->Add( first_txt, 1, wxALIGN_CENTER|wxALL, 5);
exp_layout->Add( exptime_first_spin_, 1, wxALIGN_CENTER|wxALL, 5 );
top_layout_->Add( bSizer15, 1, wxEXPAND, 5 );
export_btn_ = new wxButton( this, wxID_ANY, _("Export"), wxDefaultPosition,
wxDefaultSize, 0, wxDefaultValidator,
wxT("export_btn") );
exp_layout->Add( export_btn_, 0, wxALIGN_CENTER|wxALL, 5 );
this->SetSizer( top_layout_ );
body_layout->Add( exp_layout, 1, wxEXPAND, 5 );
top_layout->Add( body_layout, 0, wxEXPAND, 5 );
// /////////////////////////////////////////////////////////////////////////
// Finalize
// /////////////////////////////////////////////////////////////////////////
this->SetSizer(top_layout);
this->Layout();
this->Fit();
@ -149,26 +213,74 @@ PngExportDialog::PngExportDialog( wxWindow* parent, wxWindowID id, const wxStrin
this->Centre( wxBOTH );
// Connect Events
filepick_ctl_->Connect( wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEventHandler( PngExportDialog::onFileChanged ), NULL, this );
spin_reso_width_->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PngExportDialog::EvalResoSpin ), NULL, this );
spin_reso_height_->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PngExportDialog::EvalResoSpin ), NULL, this );
reso_lock_btn_->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( PngExportDialog::ResoLock ), NULL, this );
bed_width_spin_->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PngExportDialog::EvalBedSpin ), NULL, this );
bed_height_spin_->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PngExportDialog::EvalBedSpin ), NULL, this );
bedsize_lock_btn_->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( PngExportDialog::BedsizeLock ), NULL, this );
export_btn_->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PngExportDialog::Close ), NULL, this );
filepick_ctl_->Connect(
wxEVT_COMMAND_FILEPICKER_CHANGED,
wxFileDirPickerEventHandler( PngExportDialog::onFileChanged ),
NULL, this );
spin_reso_width_->Connect(
wxEVT_COMMAND_TEXT_UPDATED,
wxCommandEventHandler( PngExportDialog::EvalResoSpin ),
NULL, this );
spin_reso_height_->Connect(
wxEVT_COMMAND_TEXT_UPDATED,
wxCommandEventHandler( PngExportDialog::EvalResoSpin ),
NULL, this );
reso_lock_btn_->Connect(
wxEVT_COMMAND_TOGGLEBUTTON_CLICKED,
wxCommandEventHandler( PngExportDialog::ResoLock ),
NULL, this );
bed_width_spin_->Connect(
wxEVT_COMMAND_TEXT_UPDATED,
wxCommandEventHandler( PngExportDialog::EvalBedSpin ),
NULL, this );
bed_height_spin_->Connect(
wxEVT_COMMAND_TEXT_UPDATED,
wxCommandEventHandler( PngExportDialog::EvalBedSpin ),
NULL, this );
bedsize_lock_btn_->Connect(
wxEVT_COMMAND_TOGGLEBUTTON_CLICKED,
wxCommandEventHandler( PngExportDialog::BedsizeLock ),
NULL, this );
export_btn_->Connect(
wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler( PngExportDialog::Close ), NULL, this );
}
PngExportDialog::~PngExportDialog()
{
// Disconnect Events
filepick_ctl_->Disconnect( wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEventHandler( PngExportDialog::onFileChanged ), NULL, this );
spin_reso_width_->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PngExportDialog::EvalResoSpin ), NULL, this );
spin_reso_height_->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PngExportDialog::EvalResoSpin ), NULL, this );
reso_lock_btn_->Disconnect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( PngExportDialog::ResoLock ), NULL, this );
bed_width_spin_->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PngExportDialog::EvalBedSpin ), NULL, this );
bed_height_spin_->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PngExportDialog::EvalBedSpin ), NULL, this );
bedsize_lock_btn_->Disconnect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( PngExportDialog::BedsizeLock ), NULL, this );
export_btn_->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PngExportDialog::Close ), NULL, this );
filepick_ctl_->Disconnect(
wxEVT_COMMAND_FILEPICKER_CHANGED,
wxFileDirPickerEventHandler( PngExportDialog::onFileChanged ),
NULL, this );
spin_reso_width_->Disconnect(
wxEVT_COMMAND_TEXT_UPDATED,
wxCommandEventHandler( PngExportDialog::EvalResoSpin ),
NULL, this );
spin_reso_height_->Disconnect(
wxEVT_COMMAND_TEXT_UPDATED,
wxCommandEventHandler( PngExportDialog::EvalResoSpin ),
NULL, this );
reso_lock_btn_->Disconnect(
wxEVT_COMMAND_TOGGLEBUTTON_CLICKED,
wxCommandEventHandler( PngExportDialog::ResoLock ),
NULL, this );
bed_width_spin_->Disconnect(
wxEVT_COMMAND_TEXT_UPDATED,
wxCommandEventHandler( PngExportDialog::EvalBedSpin ),
NULL, this );
bed_height_spin_->Disconnect(
wxEVT_COMMAND_TEXT_UPDATED,
wxCommandEventHandler( PngExportDialog::EvalBedSpin ),
NULL, this );
bedsize_lock_btn_->Disconnect(
wxEVT_COMMAND_TOGGLEBUTTON_CLICKED,
wxCommandEventHandler( PngExportDialog::BedsizeLock ),
NULL, this );
export_btn_->Disconnect(
wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler( PngExportDialog::Close ), NULL, this );
}
}

View file

@ -1,12 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __NONAME_H__
#define __NONAME_H__
#ifndef PNG_EXPORT_DIALOG_HPP
#define PNG_EXPORT_DIALOG_HPP
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
@ -26,7 +19,7 @@
#include "GUI.hpp"
///////////////////////////////////////////////////////////////////////////
namespace Slic3r {
///////////////////////////////////////////////////////////////////////////////
/// Class PngExportDialog
@ -36,10 +29,6 @@ class PngExportDialog : public wxDialog
private:
protected:
wxStaticText* filepick_text_;
wxStaticText* resotext_;
wxStaticText* bed_size_text_;
wxStaticText* corr_text_;
wxFilePickerCtrl* filepick_ctl_;
wxFilePickerCtrl* confpick_ctl_;
wxSpinCtrl* spin_reso_width_;
@ -48,6 +37,8 @@ class PngExportDialog : public wxDialog
wxSpinCtrlDouble* bed_width_spin_;
wxSpinCtrlDouble* bed_height_spin_;
wxToggleButton* bedsize_lock_btn_;
wxSpinCtrlDouble* exptime_spin_;
wxSpinCtrlDouble* exptime_first_spin_;
wxSpinCtrlDouble* corr_spin_x_;
wxSpinCtrlDouble* corr_spin_y_;
wxSpinCtrlDouble* corr_spin_z_;
@ -68,4 +59,5 @@ class PngExportDialog : public wxDialog
};
#endif //__NONAME_H__
}
#endif //PNG_EXPORT_DIALOG_HPP