Calibrations now should get the good settings directory, even on mac,

temp calibrations now began by to hot test and the calibration is configurable.
This commit is contained in:
supermerill 2020-05-21 00:16:30 +02:00
parent 9821da6609
commit da5e38f6f6
7 changed files with 108 additions and 75 deletions

View File

@ -11,17 +11,18 @@
<h2>How it works</h2> <h2>How it works</h2>
<p>First, select your printer and your default print profile, with the filament profile for a filament you have. Note that this works with your first extruder if you have multiple ones.</p> <p>First, select your printer and your default print profile, with the filament profile for a filament you have. Note that this works with your first extruder if you have multiple ones.</p>
<p>When clicking on the Generate button, the program will create and slice the test print. You have to send it to your printer and print it. After the print end, check the result of each corners and the middle one against the photo below. You will have to tune your printer/firmware to correct the height if needed.</p> <p>When clicking on the Generate button, the program will create and slice the test print. You have to send it to your printer and print it. After the print end, check the result of each corners and the middle one against the photo below. You will have to tune your printer/firmware to correct the height if needed.</p>
<p>Read the notes and advices below for more informations.</p>
<h2>Results</h2> <h2>Results</h2>
<table> <table>
<tbody> <tbody>
<tr> <tr>
<td><img src="./low_ll.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./low_ll.jpg" width="100" height="200" /></td>
<td><img src="./low_l.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./low_l.jpg" width="100" height="200" /></td>
<td><img src="./low.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./low.jpg" width="100" height="200" /></td>
<td><img src="./good.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./good.jpg" width="100" height="200" /></td>
<td><img src="./high.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./high.jpg" width="100" height="200" /></td>
<td><img src="./high_h.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./high_h.jpg" width="100" height="200" /></td>
<td><img src="./high_hh.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./high_hh.jpg" width="100" height="200" /></td>
</tr> </tr>
<tr> <tr>
<td style="text-align: center;">Too far away</td> <td style="text-align: center;">Too far away</td>
@ -44,6 +45,7 @@
<li>You can disable/enable z-hop for the first layer by increasing "only lift z"-&gt; above Z" to a higher value than your first layer height. Enbaling it may pull the filament from the bed and diabling may let the nozzle strke &amp; push the deposited filament, so you have to test and keep the best. (Advanced setting, printer -> extruder)</li> <li>You can disable/enable z-hop for the first layer by increasing "only lift z"-&gt; above Z" to a higher value than your first layer height. Enbaling it may pull the filament from the bed and diabling may let the nozzle strke &amp; push the deposited filament, so you have to test and keep the best. (Advanced setting, printer -> extruder)</li>
</ul> </ul>
<h2>Notes</h2> <h2>Notes</h2>
<p>This test use your current first layer height, but you may want to increase it up to 80% of your nozzle height (before using 'generate') if it's the first time you level your bed, to reduce the risk of a nozzle crash.</p>
<p>After the filament flow calibration, if it appears that the flow was very wrong, you may want to redo this calibration just after.</p> <p>After the filament flow calibration, if it appears that the flow was very wrong, you may want to redo this calibration just after.</p>
<p>Most of the calibrations need to done is the right order. This one is the first to do. But ou have to have a "good enough" extruder calibration: when you ask for 100mm of filament, that's ~ what the extruder has to scroll into the nozzle.</p> <p>Most of the calibrations need to done is the right order. This one is the first to do. But ou have to have a "good enough" extruder calibration: when you ask for 100mm of filament, that's ~ what the extruder has to scroll into the nozzle.</p>
<p>This test set the setting "complete individual objects" to true, so you may want to reset your print settigns afterwards</p> <p>This test set the setting "complete individual objects" to true, so you may want to reset your print settigns afterwards</p>

View File

@ -13,11 +13,11 @@
<tbody> <tbody>
<h4>Exemple:</h4> <h4>Exemple:</h4>
<tr> <tr>
<td><img src="./m20.jpg" alt="too low, by far" width="150" height="150" /></td> <td><img src="./m20.jpg" width="150" height="150" /></td>
<td><img src="./m10.jpg" alt="too low, by far" width="150" height="150" /></td> <td><img src="./m10.jpg" width="150" height="150" /></td>
<td><img src="./0_v1.jpg" alt="too low, by far" width="150" height="150" /></td> <td><img src="./0_v1.jpg" width="150" height="150" /></td>
<td><img src="./p10.jpg" alt="too low, by far" width="150" height="150" /></td> <td><img src="./p10.jpg" width="150" height="150" /></td>
<td><img src="./p20.jpg" alt="too low, by far" width="150" height="150" /></td> <td><img src="./p20.jpg" width="150" height="150" /></td>
</tr> </tr>
<tr> <tr>
<td style="text-align: center;">not flat</td> <td style="text-align: center;">not flat</td>
@ -33,11 +33,11 @@
<tbody> <tbody>
<h4>Second step, starting from +20%:</h4> <h4>Second step, starting from +20%:</h4>
<tr> <tr>
<td><img src="./m8.jpg" alt="too low, by far" width="150" height="150" /></td> <td><img src="./m8.jpg" width="150" height="150" /></td>
<td><img src="./m6.jpg" alt="too low, by far" width="150" height="150" /></td> <td><img src="./m6.jpg" width="150" height="150" /></td>
<td><img src="./m4.jpg" alt="too low, by far" width="150" height="150" /></td> <td><img src="./m4.jpg" width="150" height="150" /></td>
<td><img src="./m2.jpg" alt="too low, by far" width="150" height="150" /></td> <td><img src="./m2.jpg" width="150" height="150" /></td>
<td><img src="./0_v2.jpg" alt="too low, by far" width="150" height="150" /></td> <td><img src="./0_v2.jpg" width="150" height="150" /></td>
</tr> </tr>
<tr> <tr>
<td style="text-align: center;">Not good</td> <td style="text-align: center;">Not good</td>

View File

@ -7,22 +7,22 @@
<body> <body>
<h1>Filament temperature calibration</h1> <h1>Filament temperature calibration</h1>
<p>You need to do the bed level calibration before this one, and it's preferable to have also done the flow calibration. This calibration will help you to choose the right temperature with respect of bonding, overhangs and ooze. Note that this test is dependant of the cooling you selected. You can print this multiple times with more or less cooling to find your perfect spot.</p> <p>You need to do the bed level calibration before this one, and it's preferable to have also done the flow calibration. This calibration will help you to choose the right temperature with respect of bonding, overhangs and ooze. Note that this test is dependant of the cooling you selected. You can print this multiple times with more or less cooling to find your perfect spot.</p>
<p>This test will print a tower of prints printed with a different temperature for each floor. The middle one will be printed with the current temperature selected in your filament configuration. Each other floor will differ by 5°c. You can choose to generate 5 or 9 floors.</p> <p>This test will print a tower of prints printed with a different temperature for each floor. The "middle" one will be printed with the current temperature selected in your filament configuration. The first item, on the build plate will be the hottest and the higher will be the coolest. You can choose the delta of temperature between each test and the number of tests (how many tests below the current temperature, and how many tests hotter than the current) but you can let them as-is to begun.</p>
<h2>Results : observation</h2> <h2>Results : observation</h2>
<p>The goal is to choose the highest temperature that doesn't produce artifacts.</p> <p>The goal is to choose the highest temperature that doesn't produce artifacts.</p>
<p>First, you have to analyse the tower. Each floor has the temperature written on it.</p> <p>First, you have to analyse the tower. Each floor has the temperature written on it.</p>
<table> <table>
<tbody> <tbody>
<tr> <tr>
<td><img src="./low_ll.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./low_ll.jpg" width="100" height="200" /></td>
<td><img src="./low_l.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./low_l.jpg" width="100" height="200" /></td>
<td><img src="./low.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./low.jpg" width="100" height="200" /></td>
<td><img src="./good.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./good.jpg" width="100" height="200" /></td>
<td><img src="./high.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./high.jpg" width="100" height="200" /></td>
<td><img src="./high_h.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./high_h.jpg" width="100" height="200" /></td>
<td><img src="./high_hh.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./high_hh.jpg" width="100" height="200" /></td>
<td><img src="./high_h.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./high_h.jpg" width="100" height="200" /></td>
<td><img src="./high_hh.jpg" alt="too low, by far" width="100" height="200" /></td> <td><img src="./high_hh.jpg" width="100" height="200" /></td>
</tr> </tr>
<tr> <tr>
<td style="text-align: center;">TODO</td> <td style="text-align: center;">TODO</td>
@ -44,6 +44,7 @@
</ul> </ul>
<h2>Notes</h2> <h2>Notes</h2>
<p>Most of the calibrations need to done is the right order. This one should be the third.</p> <p>Most of the calibrations need to done is the right order. This one should be the third.</p>
<p>The temperature numbers will only be shown between 180 and 285. Higher or lower values won't be displayed but the test will be conducted successfully, you just have to remember them.</p>
<p>This tower is made with the 3D model created by gaaZolee and available here https://www.thingiverse.com/thing:2729076 with the CC BY-SA 3.0 licence.<p> <p>This tower is made with the 3D model created by gaaZolee and available here https://www.thingiverse.com/thing:2729076 with the CC BY-SA 3.0 licence.<p>
<p>Licence for models used for this calibration test: CC BY-SA 3.0</p> <p>Licence for models used for this calibration test: CC BY-SA 3.0</p>
</body> </body>

View File

@ -43,7 +43,7 @@ namespace GUI {
//html //html
html_viewer = new wxHtmlWindow(this, wxID_ANY, html_viewer = new wxHtmlWindow(this, wxID_ANY,
wxDefaultPosition, wxSize(800, 500), wxHW_SCROLLBAR_AUTO); wxDefaultPosition, wxSize(800, 500), wxHW_SCROLLBAR_AUTO);
html_viewer->LoadPage("./resources/calibration/bed_leveling/bed_leveling.html"); html_viewer->LoadPage(Slic3r::resources_dir()+"/calibration/bed_leveling/bed_leveling.html");
main_sizer->Add(html_viewer, 1, wxEXPAND | wxALL, 5); main_sizer->Add(html_viewer, 1, wxEXPAND | wxALL, 5);
wxStdDialogButtonSizer* buttons = new wxStdDialogButtonSizer(); wxStdDialogButtonSizer* buttons = new wxStdDialogButtonSizer();
@ -72,11 +72,11 @@ void CalibrationBedDialog::create_geometry(wxCommandEvent& event_args) {
Model& model = plat->model(); Model& model = plat->model();
plat->reset(); plat->reset();
std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{ std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{
"./resources/calibration/bed_leveling/patch.amf", Slic3r::resources_dir()+"/calibration/bed_leveling/patch.amf",
"./resources/calibration/bed_leveling/patch.amf", Slic3r::resources_dir()+"/calibration/bed_leveling/patch.amf",
"./resources/calibration/bed_leveling/patch.amf", Slic3r::resources_dir()+"/calibration/bed_leveling/patch.amf",
"./resources/calibration/bed_leveling/patch.amf", Slic3r::resources_dir()+"/calibration/bed_leveling/patch.amf",
"./resources/calibration/bed_leveling/patch.amf"}, true, false); Slic3r::resources_dir()+"/calibration/bed_leveling/patch.amf"}, true, false);
assert(objs_idx.size() == 5); assert(objs_idx.size() == 5);
const DynamicPrintConfig* printConfig = this->gui_app->get_tab(Preset::TYPE_PRINT)->get_config(); const DynamicPrintConfig* printConfig = this->gui_app->get_tab(Preset::TYPE_PRINT)->get_config();

View File

@ -44,7 +44,7 @@ namespace GUI {
html_viewer = new wxHtmlWindow(this, wxID_ANY, html_viewer = new wxHtmlWindow(this, wxID_ANY,
wxDefaultPosition, wxSize(500, 500), wxHW_SCROLLBAR_AUTO); wxDefaultPosition, wxSize(500, 500), wxHW_SCROLLBAR_AUTO);
html_viewer->SetMinSize(wxSize(900, 500)); html_viewer->SetMinSize(wxSize(900, 500));
html_viewer->LoadPage("./resources/calibration/filament_flow/filament_flow.html"); html_viewer->LoadPage(Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow.html");
main_sizer->Add(html_viewer, 1, wxEXPAND | wxALL, 5); main_sizer->Add(html_viewer, 1, wxEXPAND | wxALL, 5);
wxStdDialogButtonSizer* buttons = new wxStdDialogButtonSizer(); wxStdDialogButtonSizer* buttons = new wxStdDialogButtonSizer();
@ -130,11 +130,11 @@ void CalibrationFlowDialog::create_geometry(float start, float delta) {
Model& model = plat->model(); Model& model = plat->model();
plat->reset(); plat->reset();
std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{ std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{
"./resources/calibration/filament_flow/filament_flow_test_cube.amf", Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow_test_cube.amf",
"./resources/calibration/filament_flow/filament_flow_test_cube.amf", Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow_test_cube.amf",
"./resources/calibration/filament_flow/filament_flow_test_cube.amf", Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow_test_cube.amf",
"./resources/calibration/filament_flow/filament_flow_test_cube.amf", Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow_test_cube.amf",
"./resources/calibration/filament_flow/filament_flow_test_cube.amf"}, true, false); Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow_test_cube.amf"}, true, false);
assert(objs_idx.size() == 5); assert(objs_idx.size() == 5);
@ -163,20 +163,20 @@ void CalibrationFlowDialog::create_geometry(float start, float delta) {
//add sub-part after scale //add sub-part after scale
float zshift = (1 - zscale) / 2; float zshift = (1 - zscale) / 2;
if (delta == 10.f && start == 80.f) { if (delta == 10.f && start == 80.f) {
add_part(model.objects[objs_idx[0]], "./resources/calibration/filament_flow/m20.amf", Vec3d{ 9,0,zshift }); add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_flow/m20.amf", Vec3d{ 9,0,zshift });
add_part(model.objects[objs_idx[1]], "./resources/calibration/filament_flow/m10.amf", Vec3d{ 9,0,zshift }); add_part(model.objects[objs_idx[1]], Slic3r::resources_dir()+"/calibration/filament_flow/m10.amf", Vec3d{ 9,0,zshift });
add_part(model.objects[objs_idx[2]], "./resources/calibration/filament_flow/_0.amf", Vec3d{ 9,0,zshift }); add_part(model.objects[objs_idx[2]], Slic3r::resources_dir()+"/calibration/filament_flow/_0.amf", Vec3d{ 9,0,zshift });
add_part(model.objects[objs_idx[3]], "./resources/calibration/filament_flow/p10.amf", Vec3d{ 9,0,zshift }); add_part(model.objects[objs_idx[3]], Slic3r::resources_dir()+"/calibration/filament_flow/p10.amf", Vec3d{ 9,0,zshift });
add_part(model.objects[objs_idx[4]], "./resources/calibration/filament_flow/p20.amf", Vec3d{ 9,0,zshift }); add_part(model.objects[objs_idx[4]], Slic3r::resources_dir()+"/calibration/filament_flow/p20.amf", Vec3d{ 9,0,zshift });
} else if (delta == 2.f && start == 92.f) { } else if (delta == 2.f && start == 92.f) {
add_part(model.objects[objs_idx[0]], "./resources/calibration/filament_flow/m8.amf", Vec3d{ 9,0,zshift }); add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_flow/m8.amf", Vec3d{ 9,0,zshift });
add_part(model.objects[objs_idx[1]], "./resources/calibration/filament_flow/m6.amf", Vec3d{ 9,0,zshift }); add_part(model.objects[objs_idx[1]], Slic3r::resources_dir()+"/calibration/filament_flow/m6.amf", Vec3d{ 9,0,zshift });
add_part(model.objects[objs_idx[2]], "./resources/calibration/filament_flow/m4.amf", Vec3d{ 9,0,zshift }); add_part(model.objects[objs_idx[2]], Slic3r::resources_dir()+"/calibration/filament_flow/m4.amf", Vec3d{ 9,0,zshift });
add_part(model.objects[objs_idx[3]], "./resources/calibration/filament_flow/m2.amf", Vec3d{ 9,0,zshift }); add_part(model.objects[objs_idx[3]], Slic3r::resources_dir()+"/calibration/filament_flow/m2.amf", Vec3d{ 9,0,zshift });
add_part(model.objects[objs_idx[4]], "./resources/calibration/filament_flow/_0.amf", Vec3d{ 9,0,zshift }); add_part(model.objects[objs_idx[4]], Slic3r::resources_dir()+"/calibration/filament_flow/_0.amf", Vec3d{ 9,0,zshift });
} }
for (size_t i = 0; i < 5; i++) { for (size_t i = 0; i < 5; i++) {
add_part(model.objects[objs_idx[i]], "./resources/calibration/filament_flow/O.amf", Vec3d{ 0,0,zscale/2.f + 0.5 }, Vec3d{1,1,xyScale }); add_part(model.objects[objs_idx[i]], Slic3r::resources_dir()+"/calibration/filament_flow/O.amf", Vec3d{ 0,0,zscale/2.f + 0.5 }, Vec3d{1,1,xyScale });
} }
/// --- translate ---; /// --- translate ---;

View File

@ -43,15 +43,33 @@ namespace GUI {
//html //html
html_viewer = new wxHtmlWindow(this, wxID_ANY, html_viewer = new wxHtmlWindow(this, wxID_ANY,
wxDefaultPosition, wxSize(800, 500), wxHW_SCROLLBAR_AUTO); wxDefaultPosition, wxSize(800, 500), wxHW_SCROLLBAR_AUTO);
html_viewer->LoadPage("./resources/calibration/filament_temp/filament_temp.html"); html_viewer->LoadPage(Slic3r::resources_dir()+"/calibration/filament_temp/filament_temp.html");
main_sizer->Add(html_viewer, 1, wxEXPAND | wxALL, 5); main_sizer->Add(html_viewer, 1, wxEXPAND | wxALL, 5);
wxString choices_steps[] = { "5","10","15","20" };
steps = new wxComboBox(this, wxID_ANY, wxString{ "10" }, wxDefaultPosition, wxDefaultSize, 4, choices_steps);
steps->SetToolTip(_(L("Select the step in celcius between two tests.")));
steps->SetSelection(1);
wxString choices_nb[] = { "0","1","2","3","4","5","6","7" };
nb_down = new wxComboBox(this, wxID_ANY, wxString{ "2" }, wxDefaultPosition, wxDefaultSize, 4, choices_nb);
nb_down->SetToolTip(_(L("Select the number of tests with lower temperature than the current one.")));
nb_down->SetSelection(2);
nb_up = new wxComboBox(this, wxID_ANY, wxString{ "2" }, wxDefaultPosition, wxDefaultSize, 4, choices_nb);
nb_up->SetToolTip(_(L("Select the number of tests with higher temperature than the current one.")));
nb_up->SetSelection(2);
wxStdDialogButtonSizer* buttons = new wxStdDialogButtonSizer(); wxStdDialogButtonSizer* buttons = new wxStdDialogButtonSizer();
wxButton* bt = new wxButton(this, wxID_FILE1, _(L("Generate +- 10"))); buttons->Add(new wxStaticText(this, wxID_ANY, wxString{ "nb down:" }));
bt->Bind(wxEVT_BUTTON, &CalibrationTempDialog::create_geometry_2, this); buttons->Add(nb_down);
buttons->Add(bt); buttons->AddSpacer(15);
bt = new wxButton(this, wxID_FILE1, _(L("Generate +- 20"))); buttons->Add(new wxStaticText(this, wxID_ANY, wxString{ "nb up:" }));
bt->Bind(wxEVT_BUTTON, &CalibrationTempDialog::create_geometry_4, this); buttons->Add(nb_up);
buttons->AddSpacer(40);
buttons->Add(new wxStaticText(this, wxID_ANY, wxString{ "steps:" }));
buttons->Add(steps);
buttons->AddSpacer(40);
wxButton* bt = new wxButton(this, wxID_FILE1, _(L("Generate")));
bt->Bind(wxEVT_BUTTON, &CalibrationTempDialog::create_geometry, this);
buttons->Add(bt); buttons->Add(bt);
wxButton* close = new wxButton(this, wxID_CLOSE, _(L("Close"))); wxButton* close = new wxButton(this, wxID_CLOSE, _(L("Close")));
close->Bind(wxEVT_BUTTON, &CalibrationTempDialog::closeMe, this); close->Bind(wxEVT_BUTTON, &CalibrationTempDialog::closeMe, this);
@ -116,12 +134,12 @@ ModelObject* CalibrationTempDialog::add_part(ModelObject* model_object, std::str
return model.objects.empty()?nullptr: model.objects[0]; return model.objects.empty()?nullptr: model.objects[0];
} }
void CalibrationTempDialog::create_geometry(uint8_t nb_delta) { void CalibrationTempDialog::create_geometry(wxCommandEvent& event_args) {
Plater* plat = this->main_frame->plater(); Plater* plat = this->main_frame->plater();
Model& model = plat->model(); Model& model = plat->model();
plat->reset(); plat->reset();
std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{ std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{
"./resources/calibration/filament_temp/Smart_compact_temperature_calibration_item.amf"}, true, false); Slic3r::resources_dir()+"/calibration/filament_temp/Smart_compact_temperature_calibration_item.amf"}, true, false);
assert(objs_idx.size() == 1); assert(objs_idx.size() == 1);
const DynamicPrintConfig* printConfig = this->gui_app->get_tab(Preset::TYPE_PRINT)->get_config(); const DynamicPrintConfig* printConfig = this->gui_app->get_tab(Preset::TYPE_PRINT)->get_config();
@ -131,8 +149,15 @@ void CalibrationTempDialog::create_geometry(uint8_t nb_delta) {
// -- get temps // -- get temps
const ConfigOptionInts* temperature_config = filamentConfig->option<ConfigOptionInts>("temperature"); const ConfigOptionInts* temperature_config = filamentConfig->option<ConfigOptionInts>("temperature");
assert(temperature_config->values.size() >= 1); assert(temperature_config->values.size() >= 1);
int16_t temperature = 5* (temperature_config->values[0]/5); int idx_steps = steps->GetSelection();
size_t nb_items = 1 + 2 * nb_delta; int idx_up = nb_up->GetSelection();
int idx_down = nb_down->GetSelection();
int16_t temperature = 5 * (temperature_config->values[0] / 5);
size_t step_temp = 5 + (idx_steps == wxNOT_FOUND ? 0 : (idx_steps * 5));
size_t nb_items = 1 + (idx_down == wxNOT_FOUND ? 0 : idx_down)
+ (idx_up == wxNOT_FOUND ? 0 : idx_up);
//start at the highest temp
temperature = temperature + step_temp * (idx_up == wxNOT_FOUND ? 0 : idx_up);
/// --- scale --- /// --- scale ---
//model is created for a 0.4 nozzle, scale xy with nozzle size. //model is created for a 0.4 nozzle, scale xy with nozzle size.
@ -153,15 +178,15 @@ void CalibrationTempDialog::create_geometry(uint8_t nb_delta) {
std::vector<ModelObject*>tower; std::vector<ModelObject*>tower;
tower.push_back(model.objects[objs_idx[0]]); tower.push_back(model.objects[objs_idx[0]]);
float zshift = (1 - xyzScale) / 2; float zshift = (1 - xyzScale) / 2;
if (temperature - (int8_t)nb_delta * 5 > 175 && temperature - (int8_t)nb_delta * 5 < 290) { if (temperature > 175 && temperature < 290) {
tower.push_back(add_part(model.objects[objs_idx[0]], "./resources/calibration/filament_temp/t"+std::to_string(temperature - (int8_t)nb_delta * 5 )+".amf", tower.push_back(add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_temp/t"+std::to_string(temperature)+".amf",
Vec3d{ xyzScale * 5, - xyzScale * 2.5, zshift - xyzScale * 2.5}, Vec3d{ xyzScale, xyzScale, xyzScale * 0.43 })); Vec3d{ xyzScale * 5, - xyzScale * 2.5, zshift - xyzScale * 2.5}, Vec3d{ xyzScale, xyzScale, xyzScale * 0.43 }));
} }
for (int16_t i = 1; i < nb_items; i++) { for (int16_t i = 1; i < nb_items; i++) {
tower.push_back(add_part(model.objects[objs_idx[0]], "./resources/calibration/filament_temp/Smart_compact_temperature_calibration_item.amf", tower.push_back(add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_temp/Smart_compact_temperature_calibration_item.amf",
Vec3d{ 0,0, zshift + i * 10 }, Vec3d{ xyzScale, xyzScale * 0.5, xyzScale })); Vec3d{ 0,0, zshift + i * 10 }, Vec3d{ xyzScale, xyzScale * 0.5, xyzScale }));
if (temperature - (int8_t)nb_delta * 5 + i * 5 > 175 && temperature - (int8_t)nb_delta * 5 + i * 5 < 290) { if (temperature - i * step_temp > 175 && temperature - i * step_temp < 290) {
tower.push_back(add_part(model.objects[objs_idx[0]], "./resources/calibration/filament_temp/t" + std::to_string(temperature - (int8_t)nb_delta * 5 + i * 5) + ".amf", tower.push_back(add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_temp/t" + std::to_string(temperature - i * step_temp) + ".amf",
Vec3d{ xyzScale * 5, -xyzScale * 2.5, zshift + xyzScale * (i * 10 - 2.5) }, Vec3d{ xyzScale, xyzScale, xyzScale * 0.43 })); Vec3d{ xyzScale * 5, -xyzScale * 2.5, zshift + xyzScale * (i * 10 - 2.5) }, Vec3d{ xyzScale, xyzScale, xyzScale * 0.43 }));
} }
} }
@ -178,13 +203,16 @@ void CalibrationTempDialog::create_geometry(uint8_t nb_delta) {
new_print_config.set_key_value("complete_objects", new ConfigOptionBool(false)); new_print_config.set_key_value("complete_objects", new ConfigOptionBool(false));
/// -- generate the heat change gcode /// -- generate the heat change gcode
std::string str_layer_gcode = "{if layer_num > 0 and layer_z <= " + std::to_string(2 * xyzScale) + "}\nM104 S" + std::to_string(temperature - (int8_t)nb_delta * 5); //std::string str_layer_gcode = "{if layer_num > 0 and layer_z <= " + std::to_string(2 * xyzScale) + "}\nM104 S" + std::to_string(temperature - (int8_t)nb_delta * 5);
// double print_z, std::string gcode,int extruder, std::string color
model.custom_gcode_per_print_z.gcodes.emplace_back(CustomGCode::Item{ nozzle_diameter, "M104 S" + std::to_string(temperature) + " ; ground floor temp tower set", -1, "" });
for (int16_t i = 1; i < nb_items; i++) { for (int16_t i = 1; i < nb_items; i++) {
str_layer_gcode += "\n{ elsif layer_z >= " + std::to_string(i * 10 * xyzScale) + " and layer_z <= " + std::to_string((1 + i * 10) * xyzScale) + " }\nM104 S" + std::to_string(temperature - (int8_t)nb_delta * 5 + i * 5); model.custom_gcode_per_print_z.gcodes.emplace_back(CustomGCode::Item{ (i * 10 * xyzScale) , "M104 S" + std::to_string(temperature - i * step_temp) + " ; floor "+std::to_string(i)+" of the temp tower set", -1, "" });
//str_layer_gcode += "\n{ elsif layer_z >= " + std::to_string(i * 10 * xyzScale) + " and layer_z <= " + std::to_string((1 + i * 10) * xyzScale) + " }\nM104 S" + std::to_string(temperature - (int8_t)nb_delta * 5 + i * 5);
} }
str_layer_gcode += "\n{endif}\n"; //str_layer_gcode += "\n{endif}\n";
DynamicPrintConfig new_printer_config = *printerConfig; //make a copy //DynamicPrintConfig new_printer_config = *printerConfig; //make a copy
new_printer_config.set_key_value("layer_gcode", new ConfigOptionString(str_layer_gcode)); //new_printer_config.set_key_value("layer_gcode", new ConfigOptionString(str_layer_gcode));
/// --- custom config --- /// --- custom config ---
float brim_width = printConfig->option<ConfigOptionFloat>("brim_width")->value; float brim_width = printConfig->option<ConfigOptionFloat>("brim_width")->value;
@ -207,11 +235,12 @@ void CalibrationTempDialog::create_geometry(uint8_t nb_delta) {
//update plater //update plater
this->gui_app->get_tab(Preset::TYPE_PRINT)->load_config(new_print_config); this->gui_app->get_tab(Preset::TYPE_PRINT)->load_config(new_print_config);
plat->on_config_change(new_print_config); plat->on_config_change(new_print_config);
this->gui_app->get_tab(Preset::TYPE_PRINTER)->load_config(new_printer_config); //this->gui_app->get_tab(Preset::TYPE_PRINTER)->load_config(new_printer_config);
plat->on_config_change(new_printer_config); //plat->on_config_change(new_printer_config);
plat->changed_objects(objs_idx); plat->changed_objects(objs_idx);
this->gui_app->get_tab(Preset::TYPE_PRINT)->update_dirty(); this->gui_app->get_tab(Preset::TYPE_PRINT)->update_dirty();
this->gui_app->get_tab(Preset::TYPE_PRINTER)->update_dirty(); this->gui_app->get_tab(Preset::TYPE_PRINTER)->update_dirty();
plat->is_preview_shown();
//update everything, easier to code. //update everything, easier to code.
ObjectList* obj = this->gui_app->obj_list(); ObjectList* obj = this->gui_app->obj_list();
obj->update_after_undo_redo(); obj->update_after_undo_redo();

View File

@ -27,14 +27,15 @@ protected:
private: private:
void closeMe(wxCommandEvent& event_args); void closeMe(wxCommandEvent& event_args);
ModelObject* add_part(ModelObject* model_object, std::string input_file, Vec3d move, Vec3d scale = Vec3d{ 1,1,1 }); ModelObject* add_part(ModelObject* model_object, std::string input_file, Vec3d move, Vec3d scale = Vec3d{ 1,1,1 });
void create_geometry_2(wxCommandEvent& event_args) { create_geometry(2); } void create_geometry(wxCommandEvent& event_args);
void create_geometry_4(wxCommandEvent& event_args) { create_geometry(4); }
void create_geometry(uint8_t nb_delta);
wxPanel* create_header(wxWindow* parent, const wxFont& bold_font); wxPanel* create_header(wxWindow* parent, const wxFont& bold_font);
wxHtmlWindow* html_viewer; wxHtmlWindow* html_viewer;
MainFrame* main_frame; MainFrame* main_frame;
GUI_App* gui_app; GUI_App* gui_app;
wxComboBox* steps;
wxComboBox* nb_down;
wxComboBox* nb_up;
}; };