mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 01:25:56 +08:00
Calibration: now doesn't change the "last directory used" anymore
This commit is contained in:
parent
c07354ac81
commit
2b04548ecb
@ -36,7 +36,7 @@ void CalibrationBedDialog::create_geometry(wxCommandEvent& event_args) {
|
||||
Slic3r::resources_dir()+"/calibration/bed_leveling/patch.amf",
|
||||
Slic3r::resources_dir()+"/calibration/bed_leveling/patch.amf",
|
||||
Slic3r::resources_dir()+"/calibration/bed_leveling/patch.amf",
|
||||
Slic3r::resources_dir()+"/calibration/bed_leveling/patch.amf"}, true, false);
|
||||
Slic3r::resources_dir()+"/calibration/bed_leveling/patch.amf"}, true, false, false);
|
||||
|
||||
assert(objs_idx.size() == 5);
|
||||
const DynamicPrintConfig* printConfig = this->gui_app->get_tab(Preset::TYPE_PRINT)->get_config();
|
||||
|
@ -59,7 +59,7 @@ void CalibrationBridgeDialog::create_geometry(std::string setting_to_test, bool
|
||||
std::vector<std::string> items;
|
||||
for (size_t i = 0; i < nb_items; i++)
|
||||
items.emplace_back(Slic3r::resources_dir()+"/calibration/bridge_flow/bridge_test.amf");
|
||||
std::vector<size_t> objs_idx = plat->load_files(items, true, false);
|
||||
std::vector<size_t> objs_idx = plat->load_files(items, true, false, false);
|
||||
|
||||
assert(objs_idx.size() == nb_items);
|
||||
const DynamicPrintConfig* print_config = this->gui_app->get_tab(Preset::TYPE_PRINT)->get_config();
|
||||
|
@ -54,7 +54,7 @@ void CalibrationCubeDialog::create_geometry(std::string calibration_path) {
|
||||
Model& model = plat->model();
|
||||
plat->reset();
|
||||
std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{
|
||||
Slic3r::resources_dir()+"/calibration/cube/"+ calibration_path}, true, false);
|
||||
Slic3r::resources_dir()+"/calibration/cube/"+ calibration_path}, true, false, false);
|
||||
|
||||
assert(objs_idx.size() == 1);
|
||||
const DynamicPrintConfig* printConfig = this->gui_app->get_tab(Preset::TYPE_PRINT)->get_config();
|
||||
|
@ -40,7 +40,7 @@ void CalibrationFlowDialog::create_geometry(float start, float delta) {
|
||||
Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow_test_cube.amf",
|
||||
Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow_test_cube.amf",
|
||||
Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow_test_cube.amf",
|
||||
Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow_test_cube.amf"}, true, false);
|
||||
Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow_test_cube.amf"}, true, false, false);
|
||||
|
||||
|
||||
assert(objs_idx.size() == 5);
|
||||
|
@ -37,7 +37,7 @@ void CalibrationOverBridgeDialog::create_geometry(wxCommandEvent& event_args) {
|
||||
Slic3r::resources_dir()+"/calibration/over-bridge_tuning/over-bridge_flow_ratio_test.amf",
|
||||
Slic3r::resources_dir()+"/calibration/over-bridge_tuning/over-bridge_flow_ratio_test.amf",
|
||||
Slic3r::resources_dir()+"/calibration/over-bridge_tuning/over-bridge_flow_ratio_test.amf",
|
||||
Slic3r::resources_dir()+"/calibration/over-bridge_tuning/over-bridge_flow_ratio_test.amf"}, true, false);
|
||||
Slic3r::resources_dir()+"/calibration/over-bridge_tuning/over-bridge_flow_ratio_test.amf"}, true, false, false);
|
||||
|
||||
assert(objs_idx.size() == 6);
|
||||
const DynamicPrintConfig* print_config = this->gui_app->get_tab(Preset::TYPE_PRINT)->get_config();
|
||||
|
@ -54,7 +54,7 @@ void CalibrationTempDialog::create_geometry(wxCommandEvent& event_args) {
|
||||
Model& model = plat->model();
|
||||
plat->reset();
|
||||
std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{
|
||||
Slic3r::resources_dir()+"/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, false);
|
||||
|
||||
assert(objs_idx.size() == 1);
|
||||
const DynamicPrintConfig* printConfig = this->gui_app->get_tab(Preset::TYPE_PRINT)->get_config();
|
||||
|
@ -1883,7 +1883,7 @@ struct Plater::priv
|
||||
arrangement::BedShapeHint get_bed_shape_hint() const;
|
||||
|
||||
void find_new_position(const ModelInstancePtrs &instances, coord_t min_d);
|
||||
std::vector<size_t> load_files(const std::vector<fs::path>& input_files, bool load_model, bool load_config);
|
||||
std::vector<size_t> load_files(const std::vector<fs::path>& input_files, bool load_model, bool load_config, bool update_dirs = true);
|
||||
std::vector<size_t> load_model_objects(const ModelObjectPtrs &model_objects);
|
||||
wxString get_export_file(GUI::FileType file_type);
|
||||
|
||||
@ -2349,7 +2349,7 @@ BoundingBox Plater::priv::scaled_bed_shape_bb() const
|
||||
return bed_shape.bounding_box();
|
||||
}
|
||||
|
||||
std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_files, bool load_model, bool load_config)
|
||||
std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_files, bool load_model, bool load_config, bool update_dirs)
|
||||
{
|
||||
if (input_files.empty()) { return std::vector<size_t>(); }
|
||||
|
||||
@ -2428,6 +2428,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||
wxGetApp().load_current_presets();
|
||||
is_project_file = true;
|
||||
}
|
||||
if(update_dirs)
|
||||
wxGetApp().app_config->update_config_dir(path.parent_path().string());
|
||||
}
|
||||
}
|
||||
@ -2516,6 +2517,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||
|
||||
if (load_model)
|
||||
{
|
||||
if(update_dirs)
|
||||
wxGetApp().app_config->update_skein_dir(input_files[input_files.size() - 1].parent_path().string());
|
||||
// XXX: Plater.pm had @loaded_files, but didn't seem to fill them with the filenames...
|
||||
statusbar()->set_status_text(_(L("Loaded")));
|
||||
@ -4737,16 +4739,18 @@ void Plater::extract_config_from_project()
|
||||
load_files(input_paths, false, true);
|
||||
}
|
||||
|
||||
std::vector<size_t> Plater::load_files(const std::vector<fs::path>& input_files, bool load_model, bool load_config) { return p->load_files(input_files, load_model, load_config); }
|
||||
std::vector<size_t> Plater::load_files(const std::vector<fs::path>& input_files, bool load_model, bool load_config, bool update_dirs) {
|
||||
return p->load_files(input_files, load_model, load_config, update_dirs);
|
||||
}
|
||||
|
||||
// To be called when providing a list of files to the GUI slic3r on command line.
|
||||
std::vector<size_t> Plater::load_files(const std::vector<std::string>& input_files, bool load_model, bool load_config)
|
||||
std::vector<size_t> Plater::load_files(const std::vector<std::string>& input_files, bool load_model, bool load_config, bool update_dirs)
|
||||
{
|
||||
std::vector<fs::path> paths;
|
||||
paths.reserve(input_files.size());
|
||||
for (const std::string& path : input_files)
|
||||
paths.emplace_back(path);
|
||||
return p->load_files(paths, load_model, load_config);
|
||||
return p->load_files(paths, load_model, load_config, update_dirs);
|
||||
}
|
||||
|
||||
void Plater::update() { p->update(); }
|
||||
|
@ -157,9 +157,9 @@ public:
|
||||
void add_model();
|
||||
void extract_config_from_project();
|
||||
|
||||
std::vector<size_t> load_files(const std::vector<boost::filesystem::path>& input_files, bool load_model = true, bool load_config = true);
|
||||
std::vector<size_t> load_files(const std::vector<boost::filesystem::path>& input_files, bool load_model = true, bool load_config = true, bool update_dirs = true);
|
||||
// To be called when providing a list of files to the GUI slic3r on command line.
|
||||
std::vector<size_t> load_files(const std::vector<std::string>& input_files, bool load_model = true, bool load_config = true);
|
||||
std::vector<size_t> load_files(const std::vector<std::string>& input_files, bool load_model = true, bool load_config = true, bool update_dirs = true);
|
||||
|
||||
void update();
|
||||
void stop_jobs();
|
||||
|
Loading…
x
Reference in New Issue
Block a user