mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-31 23:42:04 +08:00
Fix for using unicode paths for loading html
supermerill/SuperSlicer#1815
This commit is contained in:
parent
d0ed35d71f
commit
226da3b862
@ -40,23 +40,23 @@ namespace GUI {
|
||||
|
||||
}
|
||||
|
||||
void CalibrationAbstractDialog::create(std::string html_path, std::string html_name, wxSize dialog_size){
|
||||
void CalibrationAbstractDialog::create(boost::filesystem::path html_path, std::string html_name, wxSize dialog_size){
|
||||
|
||||
auto main_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
//language
|
||||
wxString language = wxGetApp().current_language_code();
|
||||
std::string full_file_path = Slic3r::resources_dir() + html_path+"/"+ into_u8(language)+"_"+ html_name;
|
||||
boost::filesystem::path full_file_path = (boost::filesystem::path(Slic3r::resources_dir()) / html_path/ (into_u8(language) + "_"+ html_name));
|
||||
if (language == "en") {
|
||||
full_file_path = Slic3r::resources_dir() + html_path + "/" + html_name;
|
||||
full_file_path = (boost::filesystem::path(Slic3r::resources_dir()) / html_path / (html_name));
|
||||
}else if (!boost::filesystem::exists(full_file_path)) {
|
||||
language = wxGetApp().current_language_code_safe();
|
||||
full_file_path = Slic3r::resources_dir() + html_path + "/" + into_u8(language) + "_" + html_name;
|
||||
full_file_path = (boost::filesystem::path(Slic3r::resources_dir()) / html_path / (into_u8(language) + "_" + html_name));
|
||||
if (!boost::filesystem::exists(full_file_path)) {
|
||||
language = language.IsEmpty() ? "en" : language.BeforeFirst('_');
|
||||
full_file_path = Slic3r::resources_dir() + html_path + "/" + into_u8(language) + "_" + html_name;
|
||||
full_file_path = (boost::filesystem::path(Slic3r::resources_dir()) / html_path / (into_u8(language) + "_" + html_name));
|
||||
if (!boost::filesystem::exists(full_file_path)) {
|
||||
full_file_path = Slic3r::resources_dir() + html_path + "/" + html_name;
|
||||
full_file_path = (boost::filesystem::path(Slic3r::resources_dir()) / html_path / (html_name));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -64,7 +64,7 @@ void CalibrationAbstractDialog::create(std::string html_path, std::string html_n
|
||||
//html
|
||||
html_viewer = new wxHtmlWindow(this, wxID_ANY,
|
||||
wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO);
|
||||
html_viewer->LoadPage(full_file_path);
|
||||
html_viewer->LoadPage(GUI::from_u8(full_file_path.string()));
|
||||
main_sizer->Add(html_viewer, 1, wxEXPAND | wxALL, 5);
|
||||
|
||||
wxDisplay display(wxDisplay::GetFromWindow(main_frame));
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
private:
|
||||
wxPanel* create_header(wxWindow* parent, const wxFont& bold_font);
|
||||
protected:
|
||||
void create(std::string html_path, std::string html_name, wxSize dialogsize = wxSize(850, 550));
|
||||
void create(boost::filesystem::path html_path, std::string html_name, wxSize dialogsize = wxSize(850, 550));
|
||||
virtual void create_buttons(wxStdDialogButtonSizer*) = 0;
|
||||
void on_dpi_changed(const wxRect& suggested_rect) override;
|
||||
void close_me(wxCommandEvent& event_args);
|
||||
|
@ -44,11 +44,11 @@ void CalibrationBedDialog::create_geometry(wxCommandEvent& event_args) {
|
||||
gui_app->app_config->set("autocenter", "0");
|
||||
}
|
||||
std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{
|
||||
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",
|
||||
Slic3r::resources_dir()+"/calibration/bed_leveling/patch.amf"}, true, false, false);
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "bed_leveling" / "patch.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "bed_leveling" / "patch.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "bed_leveling" / "patch.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "bed_leveling" / "patch.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "bed_leveling" / "patch.amf").string()}, true, false, false);
|
||||
|
||||
assert(objs_idx.size() == 5);
|
||||
const DynamicPrintConfig* printConfig = this->gui_app->get_tab(Preset::TYPE_FFF_PRINT)->get_config();
|
||||
|
@ -10,7 +10,7 @@ class CalibrationBedDialog : public CalibrationAbstractDialog
|
||||
{
|
||||
|
||||
public:
|
||||
CalibrationBedDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Bed leveling calibration") { create("/calibration/bed_leveling", "bed_leveling.html"); }
|
||||
CalibrationBedDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Bed leveling calibration") { create(boost::filesystem::path("calibration") / "bed_leveling", "bed_leveling.html"); }
|
||||
virtual ~CalibrationBedDialog() {}
|
||||
protected:
|
||||
void create_buttons(wxStdDialogButtonSizer* sizer) override;
|
||||
|
@ -75,7 +75,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");
|
||||
items.emplace_back((boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "bridge_flow" / "bridge_test.amf").string());
|
||||
std::vector<size_t> objs_idx = plat->load_files(items, true, false, false);
|
||||
|
||||
assert(objs_idx.size() == nb_items);
|
||||
@ -103,7 +103,7 @@ void CalibrationBridgeDialog::create_geometry(std::string setting_to_test, bool
|
||||
for (size_t i = 0; i < nb_items; i++) {
|
||||
int step_num = (start + (add ? 1 : -1) * i * step);
|
||||
if (step_num < 180 && step_num > 20 && step_num%5 == 0) {
|
||||
add_part(model.objects[objs_idx[i]], Slic3r::resources_dir() + "/calibration/bridge_flow/f" + std::to_string(step_num) + ".amf", Vec3d{ -10,0, zshift + 4.6 * z_scale }, Vec3d{ 1,1,z_scale });
|
||||
add_part(model.objects[objs_idx[i]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "bridge_flow" / ("f" + std::to_string(step_num) + ".amf")).string(), Vec3d{ -10,0, zshift + 4.6 * z_scale }, Vec3d{ 1,1,z_scale });
|
||||
}
|
||||
}
|
||||
/// --- translate ---;
|
||||
|
@ -10,7 +10,7 @@ class CalibrationBridgeDialog : public CalibrationAbstractDialog
|
||||
{
|
||||
|
||||
public:
|
||||
CalibrationBridgeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Bridge calibration") { create("/calibration/bridge_flow", "bridge_flow.html", wxSize(850, 400)); }
|
||||
CalibrationBridgeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Bridge calibration") { create(boost::filesystem::path("calibration") / "bridge_flow", "bridge_flow.html", wxSize(850, 400)); }
|
||||
virtual ~CalibrationBridgeDialog() { }
|
||||
|
||||
protected:
|
||||
|
@ -63,7 +63,7 @@ void CalibrationCubeDialog::create_geometry(std::string calibration_path) {
|
||||
|
||||
GLCanvas3D::set_warning_freeze(true);
|
||||
std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{
|
||||
Slic3r::resources_dir()+"/calibration/cube/"+ calibration_path}, true, false, false);
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration"/"cube"/ calibration_path).string()}, true, false, false);
|
||||
|
||||
assert(objs_idx.size() == 1);
|
||||
const DynamicPrintConfig* printConfig = this->gui_app->get_tab(Preset::TYPE_FFF_PRINT)->get_config();
|
||||
|
@ -10,7 +10,7 @@ class CalibrationCubeDialog : public CalibrationAbstractDialog
|
||||
{
|
||||
|
||||
public:
|
||||
CalibrationCubeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Calibration cube") { create("/calibration/cube", "cube.html"); }
|
||||
CalibrationCubeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Calibration cube") { create(boost::filesystem::path("calibration") / "cube", "cube.html"); }
|
||||
virtual ~CalibrationCubeDialog(){ }
|
||||
|
||||
protected:
|
||||
|
@ -50,11 +50,11 @@ void CalibrationFlowDialog::create_geometry(float start, float delta) {
|
||||
}
|
||||
|
||||
std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{
|
||||
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",
|
||||
Slic3r::resources_dir()+"/calibration/filament_flow/filament_flow_test_cube.amf"}, true, false, false);
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "filament_flow_test_cube.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "filament_flow_test_cube.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "filament_flow_test_cube.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "filament_flow_test_cube.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "filament_flow_test_cube.amf").string()}, true, false, false);
|
||||
|
||||
|
||||
assert(objs_idx.size() == 5);
|
||||
@ -93,20 +93,20 @@ void CalibrationFlowDialog::create_geometry(float start, float delta) {
|
||||
*/
|
||||
float zshift = -(zscale / 2) + ((first_layer_height + layer_height) / 2) + 0.3;
|
||||
if (delta == 10.f && start == 80.f) {
|
||||
add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_flow/m20.amf", Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
add_part(model.objects[objs_idx[1]], Slic3r::resources_dir()+"/calibration/filament_flow/m10.amf", Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model.objects[objs_idx[2]], Slic3r::resources_dir()+"/calibration/filament_flow/_0.amf", Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model.objects[objs_idx[3]], Slic3r::resources_dir()+"/calibration/filament_flow/p10.amf", Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model.objects[objs_idx[4]], Slic3r::resources_dir()+"/calibration/filament_flow/p20.amf", Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model.objects[objs_idx[0]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "m20.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
add_part(model.objects[objs_idx[1]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "m10.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model.objects[objs_idx[2]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "_0.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model.objects[objs_idx[3]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "p10.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model.objects[objs_idx[4]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "p20.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
} else if (delta == 2.f && start == 92.f) {
|
||||
add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_flow/m8.amf", Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
add_part(model.objects[objs_idx[1]], Slic3r::resources_dir()+"/calibration/filament_flow/m6.amf", Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
add_part(model.objects[objs_idx[2]], Slic3r::resources_dir()+"/calibration/filament_flow/m4.amf", Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
add_part(model.objects[objs_idx[3]], Slic3r::resources_dir()+"/calibration/filament_flow/m2.amf", Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
add_part(model.objects[objs_idx[4]], Slic3r::resources_dir()+"/calibration/filament_flow/_0.amf", Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
add_part(model.objects[objs_idx[0]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "m8.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
add_part(model.objects[objs_idx[1]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "m6.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
add_part(model.objects[objs_idx[2]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "m4.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
add_part(model.objects[objs_idx[3]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "m2.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
add_part(model.objects[objs_idx[4]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "_0.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number});
|
||||
}
|
||||
for (size_t i = 0; i < 5; i++) {
|
||||
add_part(model.objects[objs_idx[i]], Slic3r::resources_dir()+"/calibration/filament_flow/O.amf", Vec3d{ 0,0,zscale/2.f + 0.5 }, Vec3d{xyScale , xyScale, layer_height / 0.2});
|
||||
add_part(model.objects[objs_idx[i]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_flow" / "O.amf").string(), Vec3d{ 0,0,zscale/2.f + 0.5 }, Vec3d{xyScale , xyScale, layer_height / 0.2});
|
||||
}
|
||||
|
||||
/// --- translate ---;
|
||||
|
@ -10,7 +10,7 @@ class CalibrationFlowDialog : public CalibrationAbstractDialog
|
||||
{
|
||||
|
||||
public:
|
||||
CalibrationFlowDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Flow calibration") { create("/calibration/filament_flow","filament_flow.html", wxSize(900, 500)); }
|
||||
CalibrationFlowDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Flow calibration") { create(boost::filesystem::path("calibration") / "filament_flow","filament_flow.html", wxSize(900, 500)); }
|
||||
virtual ~CalibrationFlowDialog() {}
|
||||
|
||||
protected:
|
||||
|
@ -55,12 +55,12 @@ void CalibrationOverBridgeDialog::create_geometry(bool over_bridge) {
|
||||
}
|
||||
|
||||
std::vector<size_t> objs_idx = plat->load_files(std::vector<std::string>{
|
||||
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",
|
||||
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, false);
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "over-bridge_tuning" / "over-bridge_flow_ratio_test.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "over-bridge_tuning" / "over-bridge_flow_ratio_test.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "over-bridge_tuning" / "over-bridge_flow_ratio_test.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "over-bridge_tuning" / "over-bridge_flow_ratio_test.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "over-bridge_tuning" / "over-bridge_flow_ratio_test.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "over-bridge_tuning" / "over-bridge_flow_ratio_test.amf").string()}, true, false, false);
|
||||
|
||||
assert(objs_idx.size() == 6);
|
||||
const DynamicPrintConfig* print_config = this->gui_app->get_tab(Preset::TYPE_FFF_PRINT)->get_config();
|
||||
@ -86,7 +86,7 @@ void CalibrationOverBridgeDialog::create_geometry(bool over_bridge) {
|
||||
float zshift = 0.8 * (1 - xyz_scale);
|
||||
for (size_t i = 0; i < 6; i++) {
|
||||
model.objects[objs_idx[i]]->rotate(PI / 2, { 0,0,1 });
|
||||
ModelObject* obj = add_part(model.objects[objs_idx[i]], Slic3r::resources_dir() + "/calibration/bridge_flow/f"+std::to_string(100 + i * 5)+".amf", Vec3d{ 0, 10 * xyz_scale ,zshift }, Vec3d{ 1, 1, patch_zscale });
|
||||
ModelObject* obj = add_part(model.objects[objs_idx[i]], (boost::filesystem::path(Slic3r::resources_dir()) /"calibration" / "bridge_flow" / ("f"+std::to_string(100 + i * 5)+".amf")).string(), Vec3d{ 0, 10 * xyz_scale ,zshift }, Vec3d{ 1, 1, patch_zscale });
|
||||
}
|
||||
|
||||
/// --- translate ---;
|
||||
|
@ -10,7 +10,7 @@ class CalibrationOverBridgeDialog : public CalibrationAbstractDialog
|
||||
{
|
||||
|
||||
public:
|
||||
CalibrationOverBridgeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Ironing pattern calibration") { create("/calibration/over-bridge_tuning", "over-bridge_tuning.html", wxSize(900, 500)); }
|
||||
CalibrationOverBridgeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Ironing pattern calibration") { create(boost::filesystem::path("calibration") / "over-bridge_tuning", "over-bridge_tuning.html", wxSize(900, 500)); }
|
||||
virtual ~CalibrationOverBridgeDialog() { }
|
||||
|
||||
protected:
|
||||
|
@ -131,7 +131,7 @@ void CalibrationRetractionDialog::create_geometry(wxCommandEvent& event_args) {
|
||||
|
||||
std::vector<std::string> items;
|
||||
for (size_t i = 0; i < nb_items; i++)
|
||||
items.emplace_back(Slic3r::resources_dir() + "/calibration/retraction/retraction_calibration.amf");
|
||||
items.emplace_back((boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "retraction" / "retraction_calibration.amf").string());
|
||||
std::vector<size_t> objs_idx = plat->load_files(items, true, false, false);
|
||||
|
||||
|
||||
@ -178,14 +178,14 @@ void CalibrationRetractionDialog::create_geometry(wxCommandEvent& event_args) {
|
||||
part_tower.emplace_back();
|
||||
int mytemp = temp - temp_decr * id_item;
|
||||
if (mytemp <= 285 && mytemp >= 180 && mytemp % 5 == 0) {
|
||||
add_part(model.objects[objs_idx[id_item]], Slic3r::resources_dir() + "/calibration/filament_temp/t" + std::to_string(mytemp) + ".amf",
|
||||
add_part(model.objects[objs_idx[id_item]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_temp" / ("t" + std::to_string(mytemp) + ".amf")).string(),
|
||||
Vec3d{ 0,0, scale * 0.2 - 4.8 }, Vec3d{ scale,scale,scale });
|
||||
model.objects[objs_idx[id_item]]->volumes[1]->rotate(PI / 2, Vec3d(0, 0, 1));
|
||||
model.objects[objs_idx[id_item]]->volumes[1]->rotate(-PI / 2, Vec3d(1, 0, 0));
|
||||
}
|
||||
for (int num_retract = 0; num_retract < nb_retract; num_retract++) {
|
||||
part_tower.back().push_back(add_part(model.objects[objs_idx[id_item]],
|
||||
Slic3r::resources_dir() + "/calibration/retraction/retraction_calibration_pillar.amf",
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "retraction" / "retraction_calibration_pillar.amf").string(),
|
||||
Vec3d{ 0,0,scale * 0.7 - 0.3 + scale * num_retract }, Vec3d{ scale,scale,scale }));
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ class CalibrationRetractionDialog : public CalibrationAbstractDialog
|
||||
{
|
||||
|
||||
public:
|
||||
CalibrationRetractionDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Flow calibration") { create("/calibration/retraction", "retraction.html", wxSize(900, 500)); }
|
||||
CalibrationRetractionDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Flow calibration") { create(boost::filesystem::path("calibration") / "retraction", "retraction.html", wxSize(900, 500)); }
|
||||
virtual ~CalibrationRetractionDialog() {}
|
||||
|
||||
protected:
|
||||
|
@ -62,7 +62,7 @@ void CalibrationTempDialog::create_geometry(wxCommandEvent& event_args) {
|
||||
|
||||
GLCanvas3D::set_warning_freeze(true);
|
||||
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, false);
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_temp" / "Smart_compact_temperature_calibration_item.amf").string()}, true, false, false);
|
||||
|
||||
assert(objs_idx.size() == 1);
|
||||
const DynamicPrintConfig* print_config = this->gui_app->get_tab(Preset::TYPE_FFF_PRINT)->get_config();
|
||||
@ -108,15 +108,15 @@ void CalibrationTempDialog::create_geometry(wxCommandEvent& event_args) {
|
||||
tower.push_back(model.objects[objs_idx[0]]);
|
||||
float zshift = (1 - xyzScale) / 2;
|
||||
if (temperature > 175 && temperature < 290 && temperature%5==0) {
|
||||
tower.push_back(add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_temp/t"+std::to_string(temperature)+".amf",
|
||||
tower.push_back(add_part(model.objects[objs_idx[0]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_temp" / ("t"+std::to_string(temperature)+".amf")).string(),
|
||||
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++) {
|
||||
tower.push_back(add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_temp/Smart_compact_temperature_calibration_item.amf",
|
||||
tower.push_back(add_part(model.objects[objs_idx[0]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_temp" / ("Smart_compact_temperature_calibration_item.amf")).string(),
|
||||
Vec3d{ 0,0, i * 10 * xyzScale }, Vec3d{ xyzScale, xyzScale * 0.5, xyzScale }));
|
||||
int sub_temp = temperature - i * step_temp;
|
||||
if (sub_temp > 175 && sub_temp < 290 && sub_temp % 5 == 0) {
|
||||
tower.push_back(add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_temp/t" + std::to_string(sub_temp) + ".amf",
|
||||
tower.push_back(add_part(model.objects[objs_idx[0]], (boost::filesystem::path(Slic3r::resources_dir()) / "calibration" / "filament_temp" / ("t" + std::to_string(sub_temp) + ".amf")).string(),
|
||||
Vec3d{ xyzScale * 5, -xyzScale * 2.5, xyzScale * (i * 10 - 2.5) }, Vec3d{ xyzScale, xyzScale, xyzScale * 0.43 }));
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ class CalibrationTempDialog : public CalibrationAbstractDialog
|
||||
{
|
||||
|
||||
public:
|
||||
CalibrationTempDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Temperature calibration") { create("/calibration/filament_temp", "filament_temp.html"); }
|
||||
CalibrationTempDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Temperature calibration") { create(boost::filesystem::path("calibration") / "filament_temp", "filament_temp.html"); }
|
||||
virtual ~CalibrationTempDialog(){ }
|
||||
|
||||
protected:
|
||||
|
@ -214,10 +214,10 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxSt
|
||||
std::string icon_path = (model.thumbnail.empty()) ?
|
||||
("/" + model.id + "_thumbnail.png") :
|
||||
("/" + model.thumbnail);
|
||||
if (!load_bitmap(GUI::from_u8(Slic3r::data_dir() + "/vendor/" + vendor.id + icon_path), bitmap, bitmap_width)) {
|
||||
if (!load_bitmap(GUI::from_u8(Slic3r::resources_dir() + "/profiles/" + vendor.id + icon_path), bitmap, bitmap_width)) {
|
||||
if (!load_bitmap(GUI::from_u8((boost::filesystem::path(Slic3r::data_dir()) / "vendor" / (vendor.id + icon_path)).string()), bitmap, bitmap_width)) {
|
||||
if (!load_bitmap(GUI::from_u8((boost::filesystem::path(Slic3r::resources_dir()) / "profiles" / ( vendor.id + icon_path)).string() ), bitmap, bitmap_width)) {
|
||||
BOOST_LOG_TRIVIAL(warning) << boost::format("Can't find bitmap file `%1%` for vendor `%2%`, printer `%3%`, using placeholder icon instead")
|
||||
% (Slic3r::resources_dir() + "/profiles/" + vendor.id + "/" + model.id + "_thumbnail.png")
|
||||
% ((boost::filesystem::path(Slic3r::resources_dir()) / "profiles" / vendor.id / (model.id + "_thumbnail.png")).string())
|
||||
% vendor.id
|
||||
% model.id;
|
||||
load_bitmap(Slic3r::var(PRINTER_PLACEHOLDER), bitmap, bitmap_width);
|
||||
|
@ -968,7 +968,7 @@ void ImGuiWrapper::init_font(bool compress)
|
||||
|
||||
//FIXME replace with io.Fonts->AddFontFromMemoryTTF(buf_decompressed_data, (int)buf_decompressed_size, m_font_size, nullptr, ranges.Data);
|
||||
//https://github.com/ocornut/imgui/issues/220
|
||||
ImFont* font = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/" + (m_font_cjk ? "NotoSansCJK-Regular.ttc" : "NotoSans-Regular.ttf")).c_str(), m_font_size, nullptr, ranges.Data);
|
||||
ImFont* font = io.Fonts->AddFontFromFileTTF((boost::filesystem::path(Slic3r::resources_dir()) / "fonts" / (m_font_cjk ? "NotoSansCJK-Regular.ttc" : "NotoSans-Regular.ttf")).string().c_str(), m_font_size, nullptr, ranges.Data);
|
||||
if (font == nullptr) {
|
||||
font = io.Fonts->AddFontDefault();
|
||||
if (font == nullptr) {
|
||||
@ -981,7 +981,7 @@ void ImGuiWrapper::init_font(bool compress)
|
||||
config.MergeMode = true;
|
||||
if (! m_font_cjk) {
|
||||
// Apple keyboard shortcuts are only contained in the CJK fonts.
|
||||
ImFont *font_cjk = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/NotoSansCJK-Regular.ttc").c_str(), m_font_size, &config, ranges_keyboard_shortcuts);
|
||||
ImFont *font_cjk = io.Fonts->AddFontFromFileTTF((boost::filesystem::path(Slic3r::resources_dir()) / "fonts" / "NotoSansCJK-Regular.ttc").string().c_str(), m_font_size, &config, ranges_keyboard_shortcuts);
|
||||
assert(font_cjk != nullptr);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user