mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-30 01:54:40 +08:00
Merge remote-tracking branch 'aegean-odyssey/ao_profile_resources_patch' into master
This commit is contained in:
commit
5f97b2512b
@ -1840,8 +1840,11 @@ namespace PresetUtils {
|
|||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
const VendorProfile::PrinterModel* pm = PresetUtils::system_printer_model(preset);
|
const VendorProfile::PrinterModel* pm = PresetUtils::system_printer_model(preset);
|
||||||
if (pm != nullptr && !pm->bed_model.empty())
|
if (pm != nullptr && !pm->bed_model.empty()) {
|
||||||
out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->bed_model;
|
out = Slic3r::data_dir() + "/vendor/" + preset.vendor->id + "/" + pm->bed_model;
|
||||||
|
if (!boost::filesystem::exists(boost::filesystem::path(out)))
|
||||||
|
out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->bed_model;
|
||||||
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1849,8 +1852,11 @@ namespace PresetUtils {
|
|||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
const VendorProfile::PrinterModel* pm = PresetUtils::system_printer_model(preset);
|
const VendorProfile::PrinterModel* pm = PresetUtils::system_printer_model(preset);
|
||||||
if (pm != nullptr && !pm->bed_texture.empty())
|
if (pm != nullptr && !pm->bed_texture.empty()) {
|
||||||
out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->bed_texture;
|
out = Slic3r::data_dir() + "/vendor/" + preset.vendor->id + "/" + pm->bed_texture;
|
||||||
|
if (!boost::filesystem::exists(boost::filesystem::path(out)))
|
||||||
|
out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->bed_texture;
|
||||||
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
} // namespace PresetUtils
|
} // namespace PresetUtils
|
||||||
|
@ -324,6 +324,7 @@ void Bed3D::calc_gridlines(const ExPolygon& poly, const BoundingBox& bed_bbox)
|
|||||||
printf("Unable to create bed grid lines\n");
|
printf("Unable to create bed grid lines\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::tuple<Bed3D::EType, std::string, std::string> Bed3D::detect_type(const Pointfs& shape) const
|
std::tuple<Bed3D::EType, std::string, std::string> Bed3D::detect_type(const Pointfs& shape) const
|
||||||
{
|
{
|
||||||
auto bundle = wxGetApp().preset_bundle;
|
auto bundle = wxGetApp().preset_bundle;
|
||||||
|
@ -192,26 +192,23 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxSt
|
|||||||
|
|
||||||
wxBitmap bitmap;
|
wxBitmap bitmap;
|
||||||
int bitmap_width = 0;
|
int bitmap_width = 0;
|
||||||
int bitmap_height = 0;
|
auto load_bitmap = [](const wxString& bitmap_file, wxBitmap& bitmap, int& bitmap_width)->bool {
|
||||||
const wxString bitmap_file = GUI::from_u8(Slic3r::resources_dir() + "/profiles/" + vendor.id + "/" + model.id + "_thumbnail.png");
|
if (wxFileExists(bitmap_file)) {
|
||||||
if (wxFileExists(bitmap_file)) {
|
bitmap.LoadFile(bitmap_file, wxBITMAP_TYPE_PNG);
|
||||||
bitmap.LoadFile(bitmap_file, wxBITMAP_TYPE_PNG);
|
|
||||||
bitmap_width = bitmap.GetWidth();
|
|
||||||
bitmap_height = bitmap.GetHeight();
|
|
||||||
} else {
|
|
||||||
BOOST_LOG_TRIVIAL(warning) << boost::format("Can't find bitmap file `%1%` for vendor `%2%`, printer `%3%`, using placeholder icon instead")
|
|
||||||
% bitmap_file
|
|
||||||
% vendor.id
|
|
||||||
% model.id;
|
|
||||||
|
|
||||||
const wxString placeholder_file = GUI::from_u8(Slic3r::var(PRINTER_PLACEHOLDER));
|
|
||||||
if (wxFileExists(placeholder_file)) {
|
|
||||||
bitmap.LoadFile(placeholder_file, wxBITMAP_TYPE_PNG);
|
|
||||||
bitmap_width = bitmap.GetWidth();
|
bitmap_width = bitmap.GetWidth();
|
||||||
bitmap_height = bitmap.GetHeight();
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
if (!load_bitmap(GUI::from_u8(Slic3r::data_dir() + "/vendor/" + vendor.id + "/" + model.id + "_thumbnail.png"), bitmap, bitmap_width)) {
|
||||||
|
if (!load_bitmap(GUI::from_u8(Slic3r::resources_dir() + "/profiles/" + vendor.id + "/" + model.id + "_thumbnail.png"), 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")
|
||||||
|
% vendor.id
|
||||||
|
% model.id;
|
||||||
|
load_bitmap(Slic3r::var(PRINTER_PLACEHOLDER), bitmap, bitmap_width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto *title = new wxStaticText(this, wxID_ANY, model.name, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
|
auto *title = new wxStaticText(this, wxID_ANY, model.name, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
|
||||||
title->SetFont(font_name);
|
title->SetFont(font_name);
|
||||||
const int wrap_width = std::max((int)MODEL_MIN_WRAP, bitmap_width);
|
const int wrap_width = std::max((int)MODEL_MIN_WRAP, bitmap_width);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user