mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 07:03:59 -06:00
Merge branch 'main' into dev/update-bbs-network
This commit is contained in:
commit
2e86306118
161 changed files with 3734 additions and 2742 deletions
|
@ -246,7 +246,7 @@ void Bed3D::Axes::render()
|
|||
|
||||
//BBS: add part plate logic
|
||||
bool Bed3D::set_shape(const Pointfs& printable_area, const double printable_height, const std::string& custom_model, bool force_as_custom,
|
||||
const Vec2d position, bool with_reset)
|
||||
const Vec2d& position, bool with_reset)
|
||||
{
|
||||
/*auto check_texture = [](const std::string& texture) {
|
||||
boost::system::error_code ec; // so the exists call does not throw (e.g. after a permission problem)
|
||||
|
@ -612,7 +612,7 @@ void Bed3D::render_system(GLCanvas3D& canvas, const Transform3d& view_matrix, co
|
|||
void Bed3D::update_model_offset()
|
||||
{
|
||||
// move the model so that its origin (0.0, 0.0, 0.0) goes into the bed shape center and a bit down to avoid z-fighting with the texture quad
|
||||
Vec3d shift = m_extended_bounding_box.center();
|
||||
Vec3d shift = m_build_volume.bounding_volume().center();
|
||||
shift(2) = -0.03;
|
||||
Vec3d* model_offset_ptr = const_cast<Vec3d*>(&m_model_offset);
|
||||
*model_offset_ptr = shift;
|
||||
|
|
|
@ -121,7 +121,7 @@ public:
|
|||
// as this class does not use it, thus there is no need to update the UI.
|
||||
// BBS
|
||||
bool set_shape(const Pointfs& printable_area, const double printable_height, const std::string& custom_model, bool force_as_custom = false,
|
||||
const Vec2d position = Vec2d::Zero(), bool with_reset = true);
|
||||
const Vec2d& position = Vec2d::Zero(), bool with_reset = true);
|
||||
|
||||
void set_position(Vec2d& position);
|
||||
void set_axes_mode(bool origin);
|
||||
|
|
|
@ -219,7 +219,7 @@ AboutDialog::AboutDialog()
|
|||
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
|
||||
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
|
||||
|
||||
wxPanel *m_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(560), FromDIP(237)), wxTAB_TRAVERSAL);
|
||||
wxPanel* m_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(560), FromDIP(125)), wxTAB_TRAVERSAL);
|
||||
|
||||
wxBoxSizer *panel_versizer = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer *vesizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
@ -232,8 +232,10 @@ AboutDialog::AboutDialog()
|
|||
main_sizer->Add(m_panel, 1, wxEXPAND | wxALL, 0);
|
||||
main_sizer->Add(ver_sizer, 0, wxEXPAND | wxALL, 0);
|
||||
|
||||
bool is_dark = wxGetApp().app_config->get("dark_color_mode") == "1";
|
||||
|
||||
// logo
|
||||
m_logo_bitmap = ScalableBitmap(this, "OrcaSlicer_about", 250);
|
||||
m_logo_bitmap = ScalableBitmap(this, is_dark ? "OrcaSlicer_about" : "OrcaSlicer_about_dark", FromDIP(125));
|
||||
m_logo = new wxStaticBitmap(this, wxID_ANY, m_logo_bitmap.bmp(), wxDefaultPosition,wxDefaultSize, 0);
|
||||
m_logo->SetSizer(vesizer);
|
||||
|
||||
|
@ -242,33 +244,31 @@ AboutDialog::AboutDialog()
|
|||
// version
|
||||
{
|
||||
|
||||
auto _build_string_font = Label::Body_10;
|
||||
auto _build_string_font = Label::Body_12;
|
||||
// _build_string_font.SetStyle(wxFONTSTYLE_ITALIC);
|
||||
|
||||
vesizer->Add(0, FromDIP(165), 1, wxEXPAND, FromDIP(5));
|
||||
auto version_string = _L("Orca Slicer") + " " + std::string(SoftFever_VERSION);
|
||||
vesizer->Add(0, 0, 1, wxEXPAND, FromDIP(5));
|
||||
auto version_string = std::string(SoftFever_VERSION); // _L("Orca Slicer ") + " " + std::string(SoftFever_VERSION);
|
||||
wxStaticText* version = new wxStaticText(this, wxID_ANY, version_string.c_str(), wxDefaultPosition, wxDefaultSize);
|
||||
wxStaticText* credits_string = new wxStaticText(this, wxID_ANY,
|
||||
wxString::Format("Build %s.\nOrcaSlicer is based on PrusaSlicer and BambuStudio",
|
||||
std::string(GIT_COMMIT_HASH)),
|
||||
wxDefaultPosition, wxDefaultSize);
|
||||
wxStaticText* credits_string = new wxStaticText(this, wxID_ANY, wxString::Format("Build %s", std::string(GIT_COMMIT_HASH)), wxDefaultPosition, wxDefaultSize);
|
||||
credits_string->SetFont(_build_string_font);
|
||||
wxFont version_font = GetFont();
|
||||
#ifdef __WXMSW__
|
||||
version_font.SetPointSize(version_font.GetPointSize()-1);
|
||||
version_font.SetPointSize(version_font.GetPointSize()-1);
|
||||
#else
|
||||
version_font.SetPointSize(11);
|
||||
#endif
|
||||
version_font.SetPointSize(FromDIP(16));
|
||||
version_font.SetPointSize(FromDIP(20));
|
||||
version->SetFont(version_font);
|
||||
version->SetForegroundColour(wxColour("#FFFFFD"));
|
||||
credits_string->SetForegroundColour(wxColour("#FFFFFD"));
|
||||
version->SetBackgroundColour(wxColour("#4d4d4d"));
|
||||
credits_string->SetBackgroundColour(wxColour("#4d4d4d"));
|
||||
version->SetForegroundColour(wxColour("#949494"));
|
||||
credits_string->SetForegroundColour(wxColour("#949494"));
|
||||
version->SetBackgroundColour(wxColour("#FFFFFF"));
|
||||
credits_string->SetBackgroundColour(wxColour("#FFFFFF"));
|
||||
|
||||
vesizer->Add(version, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, FromDIP(5));
|
||||
vesizer->Add(credits_string, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, FromDIP(5));
|
||||
// #if BBL_INTERNAL_TESTING
|
||||
vesizer->Add(version, 0, wxRIGHT | wxALIGN_RIGHT, FromDIP(20));
|
||||
vesizer->AddSpacer(FromDIP(5));
|
||||
vesizer->Add(credits_string, 0, wxRIGHT | wxALIGN_RIGHT, FromDIP(20));
|
||||
// #if BBL_INTERNAL_TESTING
|
||||
// wxString build_time = wxString::Format("Build Time: %s", std::string(SLIC3R_BUILD_TIME));
|
||||
// wxStaticText* build_time_text = new wxStaticText(this, wxID_ANY, build_time, wxDefaultPosition, wxDefaultSize);
|
||||
// build_time_text->SetForegroundColour(wxColour("#FFFFFE"));
|
||||
|
|
|
@ -708,9 +708,14 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
|||
toggle_line("support_interface_not_for_body",config->opt_int("support_interface_filament")&&!config->opt_int("support_filament"));
|
||||
|
||||
bool has_fuzzy_skin = (config->opt_enum<FuzzySkinType>("fuzzy_skin") != FuzzySkinType::None);
|
||||
for (auto el : { "fuzzy_skin_thickness", "fuzzy_skin_point_distance", "fuzzy_skin_first_layer"})
|
||||
for (auto el : { "fuzzy_skin_thickness", "fuzzy_skin_point_distance", "fuzzy_skin_first_layer", "fuzzy_skin_noise_type"})
|
||||
toggle_line(el, has_fuzzy_skin);
|
||||
|
||||
NoiseType fuzzy_skin_noise_type = config->opt_enum<NoiseType>("fuzzy_skin_noise_type");
|
||||
toggle_line("fuzzy_skin_scale", has_fuzzy_skin && fuzzy_skin_noise_type != NoiseType::Classic);
|
||||
toggle_line("fuzzy_skin_octaves", has_fuzzy_skin && fuzzy_skin_noise_type != NoiseType::Classic && fuzzy_skin_noise_type != NoiseType::Voronoi);
|
||||
toggle_line("fuzzy_skin_persistence", has_fuzzy_skin && (fuzzy_skin_noise_type == NoiseType::Perlin || fuzzy_skin_noise_type == NoiseType::Billow));
|
||||
|
||||
bool have_arachne = config->opt_enum<PerimeterGeneratorType>("wall_generator") == PerimeterGeneratorType::Arachne;
|
||||
for (auto el : { "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle",
|
||||
"min_feature_size", "min_length_factor", "min_bead_width", "wall_distribution_count", "initial_layer_min_bead_width"})
|
||||
|
|
|
@ -123,18 +123,18 @@ BundleMap BundleMap::load()
|
|||
const auto vendor_dir = (boost::filesystem::path(Slic3r::data_dir()) / PRESET_SYSTEM_DIR).make_preferred();
|
||||
const auto rsrc_vendor_dir = (boost::filesystem::path(resources_dir()) / "profiles").make_preferred();
|
||||
|
||||
//BBS: add BBL as default
|
||||
//BBS: add json logic for vendor bundle
|
||||
auto bbl_bundle_path = (vendor_dir / PresetBundle::BBL_BUNDLE).replace_extension(".json");
|
||||
auto bbl_bundle_rsrc = false;
|
||||
if (!boost::filesystem::exists(bbl_bundle_path)) {
|
||||
bbl_bundle_path = (rsrc_vendor_dir / PresetBundle::BBL_BUNDLE).replace_extension(".json");
|
||||
bbl_bundle_rsrc = true;
|
||||
//Orca: add custom as default
|
||||
//Orca: add json logic for vendor bundle
|
||||
auto orca_bundle_path = (vendor_dir / PresetBundle::ORCA_DEFAULT_BUNDLE).replace_extension(".json");
|
||||
auto orca_bundle_rsrc = false;
|
||||
if (!boost::filesystem::exists(orca_bundle_path)) {
|
||||
orca_bundle_path = (rsrc_vendor_dir / PresetBundle::ORCA_DEFAULT_BUNDLE).replace_extension(".json");
|
||||
orca_bundle_rsrc = true;
|
||||
}
|
||||
{
|
||||
Bundle bbl_bundle;
|
||||
if (bbl_bundle.load(std::move(bbl_bundle_path), bbl_bundle_rsrc, true))
|
||||
res.emplace(PresetBundle::BBL_BUNDLE, std::move(bbl_bundle));
|
||||
if (bbl_bundle.load(std::move(orca_bundle_path), orca_bundle_rsrc, true))
|
||||
res.emplace(PresetBundle::ORCA_DEFAULT_BUNDLE, std::move(bbl_bundle));
|
||||
}
|
||||
|
||||
// Load the other bundles in the datadir/vendor directory
|
||||
|
@ -163,10 +163,10 @@ BundleMap BundleMap::load()
|
|||
|
||||
Bundle& BundleMap::bbl_bundle()
|
||||
{
|
||||
//BBS: add BBL as default
|
||||
auto it = find(PresetBundle::BBL_BUNDLE);
|
||||
//Orca: add custom as default
|
||||
auto it = find(PresetBundle::ORCA_DEFAULT_BUNDLE);
|
||||
if (it == end()) {
|
||||
throw Slic3r::RuntimeError("ConfigWizard: Internal error in BundleMap: BBL_BUNDLE not loaded");
|
||||
throw Slic3r::RuntimeError("ConfigWizard: Internal error in BundleMap: ORCA_DEFAULT_BUNDLE not loaded");
|
||||
}
|
||||
|
||||
return it->second;
|
||||
|
@ -625,12 +625,11 @@ std::set<std::string> PagePrinters::get_selected_models()
|
|||
|
||||
void PagePrinters::set_run_reason(ConfigWizard::RunReason run_reason)
|
||||
{
|
||||
//BBS: add BBL as default
|
||||
//Orca: add custom as default
|
||||
if (is_primary_printer_page
|
||||
&& (run_reason == ConfigWizard::RR_DATA_EMPTY || run_reason == ConfigWizard::RR_DATA_LEGACY)
|
||||
&& printer_pickers.size() > 0
|
||||
&& printer_pickers[0]->vendor_id == PresetBundle::BBL_BUNDLE) {
|
||||
//BBS: select alll bbs machine by default
|
||||
&& printer_pickers[0]->vendor_id == PresetBundle::ORCA_DEFAULT_BUNDLE) {
|
||||
//printer_pickers[0]->select_one(0, true);
|
||||
printer_pickers[0]->select_all(true);
|
||||
}
|
||||
|
@ -1941,8 +1940,8 @@ void ConfigWizard::priv::create_3rdparty_pages()
|
|||
{
|
||||
for (const auto &pair : bundles) {
|
||||
const VendorProfile *vendor = pair.second.vendor_profile;
|
||||
//BBS: add BBL as default
|
||||
if (vendor->id == PresetBundle::BBL_BUNDLE) { continue; }
|
||||
//Orca: add custom as default
|
||||
if (vendor->id == PresetBundle::ORCA_DEFAULT_BUNDLE) { continue; }
|
||||
|
||||
bool is_fff_technology = false;
|
||||
bool is_sla_technology = false;
|
||||
|
|
|
@ -845,7 +845,7 @@ void GCodeViewer::init(ConfigOptionMode mode, PresetBundle* preset_bundle)
|
|||
}
|
||||
|
||||
if (filename.empty()) {
|
||||
filename = preset_bundle->get_hotend_model_for_printer_model(PresetBundle::BBL_DEFAULT_PRINTER_MODEL);
|
||||
filename = preset_bundle->get_hotend_model_for_printer_model(PresetBundle::ORCA_DEFAULT_PRINTER_MODEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1056,8 +1056,6 @@ void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& pr
|
|||
set_view_type(EViewType::ColorPrint);
|
||||
}
|
||||
|
||||
m_fold = false;
|
||||
|
||||
bool only_gcode_3mf = false;
|
||||
PartPlate* current_plate = wxGetApp().plater()->get_partplate_list().get_curr_plate();
|
||||
bool current_has_print_instances = current_plate->has_printable_instances();
|
||||
|
@ -4644,15 +4642,15 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
|
|||
ImGui::SameLine();
|
||||
std::wstring btn_name;
|
||||
if (m_fold)
|
||||
btn_name = ImGui::UnfoldButtonIcon + boost::nowide::widen(std::string(""));
|
||||
btn_name = ImGui::UnfoldButtonIcon;
|
||||
else
|
||||
btn_name = ImGui::FoldButtonIcon + boost::nowide::widen(std::string(""));
|
||||
btn_name = ImGui::FoldButtonIcon;
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.0f, 0.59f, 0.53f, 1.00f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.0f, 0.59f, 0.53f, 0.78f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f));
|
||||
//ImGui::PushItemWidth(
|
||||
float button_width = ImGui::CalcTextSize(into_u8(btn_name).c_str()).x;
|
||||
float button_width = 34.0f;
|
||||
if (ImGui::Button(into_u8(btn_name).c_str(), ImVec2(button_width, 0))) {
|
||||
m_fold = !m_fold;
|
||||
}
|
||||
|
|
|
@ -4782,7 +4782,7 @@ void GUI_App::start_sync_user_preset(bool with_progress_dlg)
|
|||
m_sync_update_thread = Slic3r::create_thread(
|
||||
[this, progressFn, cancelFn, finishFn, t = std::weak_ptr<int>(m_user_sync_token)] {
|
||||
// get setting list, update setting list
|
||||
std::string version = preset_bundle->get_vendor_profile_version(PresetBundle::BBL_BUNDLE).to_string();
|
||||
std::string version = preset_bundle->get_vendor_profile_version(PresetBundle::ORCA_DEFAULT_BUNDLE).to_string();
|
||||
int ret = m_agent->get_setting_list2(version, [this](auto info) {
|
||||
auto type = info[BBL_JSON_KEY_TYPE];
|
||||
auto name = info[BBL_JSON_KEY_NAME];
|
||||
|
|
|
@ -692,11 +692,6 @@ public:
|
|||
m_height_limit_mode = mode;
|
||||
}
|
||||
|
||||
// SoftFever
|
||||
const std::string& get_logo_texture_filename() const {
|
||||
return m_logo_texture_filename;
|
||||
}
|
||||
|
||||
int get_curr_plate_index() const { return m_current_plate; }
|
||||
PartPlate* get_curr_plate() { return m_plate_list[m_current_plate]; }
|
||||
const PartPlate* get_curr_plate() const { return m_plate_list[m_current_plate]; }
|
||||
|
|
|
@ -8167,13 +8167,14 @@ void Plater::priv::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_ar
|
|||
|
||||
float prev_height_lid, prev_height_rod;
|
||||
partplate_list.get_height_limits(prev_height_lid, prev_height_rod);
|
||||
auto prev_logo = partplate_list.get_logo_texture_filename();
|
||||
double height_to_lid = config->opt_float("extruder_clearance_height_to_lid");
|
||||
double height_to_rod = config->opt_float("extruder_clearance_height_to_rod");
|
||||
auto custom_bed_texture = config->opt_string("bed_custom_texture");
|
||||
|
||||
Pointfs prev_exclude_areas = partplate_list.get_exclude_area();
|
||||
new_shape |= (height_to_lid != prev_height_lid) || (height_to_rod != prev_height_rod) || (prev_exclude_areas != exclude_areas) || (prev_logo != custom_bed_texture);
|
||||
new_shape |= (height_to_lid != prev_height_lid) || (height_to_rod != prev_height_rod) || (prev_exclude_areas != exclude_areas);
|
||||
if (!new_shape && partplate_list.get_logo_texture_filename() != custom_texture) {
|
||||
partplate_list.update_logo_texture_filename(custom_texture);
|
||||
}
|
||||
if (new_shape) {
|
||||
if (view3D) view3D->bed_shape_changed();
|
||||
if (preview) preview->bed_shape_changed();
|
||||
|
|
|
@ -2352,8 +2352,12 @@ page = add_options_page(L("Others"), "custom-gcode_other"); // ORCA: icon only v
|
|||
optgroup->append_single_option_line("timelapse_type", "Timelapse");
|
||||
|
||||
optgroup->append_single_option_line("fuzzy_skin");
|
||||
optgroup->append_single_option_line("fuzzy_skin_noise_type");
|
||||
optgroup->append_single_option_line("fuzzy_skin_point_distance");
|
||||
optgroup->append_single_option_line("fuzzy_skin_thickness");
|
||||
optgroup->append_single_option_line("fuzzy_skin_scale");
|
||||
optgroup->append_single_option_line("fuzzy_skin_octaves");
|
||||
optgroup->append_single_option_line("fuzzy_skin_persistence");
|
||||
optgroup->append_single_option_line("fuzzy_skin_first_layer");
|
||||
|
||||
optgroup = page->new_optgroup(L("G-code output"), L"param_gcode");
|
||||
|
@ -2382,7 +2386,6 @@ page = add_options_page(L("Others"), "custom-gcode_other"); // ORCA: icon only v
|
|||
option.opt.height = 25;//250;
|
||||
optgroup->append_single_option_line(option);
|
||||
|
||||
#if 1
|
||||
page = add_options_page(L("Dependencies"), "custom-gcode_advanced");
|
||||
optgroup = page->new_optgroup(L("Profile dependencies"));
|
||||
|
||||
|
@ -2395,7 +2398,6 @@ page = add_options_page(L("Others"), "custom-gcode_other"); // ORCA: icon only v
|
|||
optgroup->append_single_option_line(option);
|
||||
|
||||
build_preset_description_line(optgroup.get());
|
||||
#endif
|
||||
}
|
||||
|
||||
// Reload current config (aka presets->edited_preset->config) into the UI fields.
|
||||
|
@ -3528,14 +3530,6 @@ void TabFilament::build()
|
|||
optgroup->append_single_option_line("filament_multitool_ramming_volume");
|
||||
optgroup->append_single_option_line("filament_multitool_ramming_flow");
|
||||
|
||||
page = add_options_page(L("Notes"), "custom-gcode_note"); // ORCA: icon only visible on placeholders
|
||||
optgroup = page->new_optgroup(L("Notes"),"note", 0);
|
||||
optgroup->label_width = 0;
|
||||
option = optgroup->get_option("filament_notes");
|
||||
option.opt.full_width = true;
|
||||
option.opt.height = notes_field_height;// 250;
|
||||
optgroup->append_single_option_line(option);
|
||||
#if 1
|
||||
page = add_options_page(L("Dependencies"), "advanced");
|
||||
optgroup = page->new_optgroup(L("Profile dependencies"));
|
||||
create_line_with_widget(optgroup.get(), "compatible_printers", "", [this](wxWindow* parent) {
|
||||
|
@ -3554,8 +3548,15 @@ void TabFilament::build()
|
|||
option.opt.full_width = true;
|
||||
optgroup->append_single_option_line(option);
|
||||
|
||||
page = add_options_page(L("Notes"), "custom-gcode_note"); // ORCA: icon only visible on placeholders
|
||||
optgroup = page->new_optgroup(L("Notes"),"note", 0);
|
||||
optgroup->label_width = 0;
|
||||
option = optgroup->get_option("filament_notes");
|
||||
option.opt.full_width = true;
|
||||
option.opt.height = notes_field_height;// 250;
|
||||
optgroup->append_single_option_line(option);
|
||||
|
||||
//build_preset_description_line(optgroup.get());
|
||||
#endif
|
||||
}
|
||||
|
||||
// Reload current config (aka presets->edited_preset->config) into the UI fields.
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
#include "WebGuideDialog.hpp"
|
||||
#include "ConfigWizard.hpp"
|
||||
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/iostreams/detail/select.hpp>
|
||||
#include <string.h>
|
||||
#include "I18N.hpp"
|
||||
#include "libslic3r/AppConfig.hpp"
|
||||
#include "libslic3r/PresetBundle.hpp"
|
||||
#include "slic3r/GUI/wxExtensions.hpp"
|
||||
#include "slic3r/GUI/GUI_App.hpp"
|
||||
#include "libslic3r_version.h"
|
||||
|
@ -576,13 +580,6 @@ void GuideFrame::OnError(wxWebViewEvent &evt)
|
|||
|
||||
void GuideFrame::OnScriptResponseMessage(wxCommandEvent &WXUNUSED(evt))
|
||||
{
|
||||
// if (!m_response_js.empty())
|
||||
//{
|
||||
// RunScript(m_response_js);
|
||||
//}
|
||||
|
||||
// RunScript("This is a message to Web!");
|
||||
// RunScript("postMessage(\"AABBCCDD\");");
|
||||
}
|
||||
|
||||
bool GuideFrame::IsFirstUse()
|
||||
|
@ -592,30 +589,12 @@ bool GuideFrame::IsFirstUse()
|
|||
if (strVal == "1")
|
||||
return false;
|
||||
|
||||
if (bbl_bundle_rsrc == true)
|
||||
if (orca_bundle_rsrc == true)
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*int GuideFrame::CopyDir(const boost::filesystem::path &from_dir, const boost::filesystem::path &to_dir)
|
||||
{
|
||||
if (!boost::filesystem::is_directory(from_dir)) return -1;
|
||||
// i assume to_dir.parent surely exists
|
||||
if (!boost::filesystem::is_directory(to_dir)) boost::filesystem::create_directory(to_dir);
|
||||
for (auto &dir_entry : boost::filesystem::directory_iterator(from_dir)) {
|
||||
if (!boost::filesystem::is_directory(dir_entry.path())) {
|
||||
std::string em;
|
||||
CopyFileResult cfr = copy_file(dir_entry.path().string(), (to_dir / dir_entry.path().filename()).string(), em, false);
|
||||
if (cfr != SUCCESS) { BOOST_LOG_TRIVIAL(error) << "Error when copying files from " << from_dir << " to " << to_dir << ": " << em; }
|
||||
} else {
|
||||
CopyDir(dir_entry.path(), to_dir / dir_entry.path().filename());
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}*/
|
||||
|
||||
int GuideFrame::SaveProfile()
|
||||
{
|
||||
// SoftFever: don't collect info
|
||||
|
@ -633,77 +612,6 @@ int GuideFrame::SaveProfile()
|
|||
|
||||
m_MainPtr->app_config->save();
|
||||
|
||||
//Load BBS Conf
|
||||
/*wxString strConfPath = wxGetApp().app_config->config_path();
|
||||
json jCfg;
|
||||
std::ifstream(w2s(strConfPath)) >> jCfg;
|
||||
|
||||
//model
|
||||
jCfg["models"] = json::array();
|
||||
int nM = m_ProfileJson["model"].size();
|
||||
int nModelChoose = 0;
|
||||
for (int m = 0; m < nM; m++)
|
||||
{
|
||||
json amodel = m_ProfileJson["model"][m];
|
||||
|
||||
amodel["nozzle_diameter"] = amodel["nozzle_selected"];
|
||||
amodel.erase("nozzle_selected");
|
||||
amodel.erase("preview");
|
||||
amodel.erase("sub_path");
|
||||
amodel.erase("cover");
|
||||
amodel.erase("materials");
|
||||
|
||||
std::string ss = amodel["nozzle_diameter"];
|
||||
if (ss.compare("") != 0) {
|
||||
nModelChoose++;
|
||||
jCfg["models"].push_back(amodel);
|
||||
}
|
||||
}
|
||||
if (nModelChoose == 0)
|
||||
jCfg.erase("models");
|
||||
|
||||
if (nModelChoose > 0) {
|
||||
// filament
|
||||
jCfg["filaments"] = json::array();
|
||||
for (auto it = m_ProfileJson["filament"].begin(); it != m_ProfileJson["filament"].end(); ++it) {
|
||||
if (it.value()["selected"] == 1) { jCfg["filaments"].push_back(it.key()); }
|
||||
}
|
||||
|
||||
// Preset
|
||||
jCfg["presets"]["filaments"] = json::array();
|
||||
jCfg["presets"]["filaments"].push_back(jCfg["filaments"][0]);
|
||||
|
||||
std::string PresetMachine = m_ProfileJson["machine"][0]["name"];
|
||||
jCfg["presets"]["machine"] = PresetMachine;
|
||||
|
||||
int nTotal = m_ProfileJson["process"].size();
|
||||
int nSet = nTotal / 2;
|
||||
if (nSet > 0) nSet--;
|
||||
|
||||
std::string sMode = m_ProfileJson["process"][nSet]["name"];
|
||||
jCfg["presets"]["process"] = sMode;
|
||||
|
||||
} else {
|
||||
jCfg["presets"]["filaments"] = json::array();
|
||||
jCfg["presets"]["filaments"].push_back("Default Filament");
|
||||
|
||||
jCfg["presets"]["machine"] = "Default Printer";
|
||||
|
||||
jCfg["presets"]["process"] = "Default Setting";
|
||||
}
|
||||
|
||||
std::string sOut = jCfg.dump(4, ' ', false);
|
||||
|
||||
std::ofstream output_file(w2s(strConfPath));
|
||||
output_file << sOut;
|
||||
output_file.close();
|
||||
|
||||
//Copy Profiles
|
||||
if (bbl_bundle_rsrc)
|
||||
{
|
||||
CopyDir(rsrc_vendor_dir,vendor_dir);
|
||||
}*/
|
||||
|
||||
std::string strAll = m_ProfileJson.dump(-1, ' ', false, json::error_handler_t::ignore);
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "before save to app_config: "<< std::endl<<strAll;
|
||||
|
@ -881,11 +789,11 @@ bool GuideFrame::apply_config(AppConfig *app_config, PresetBundle *preset_bundle
|
|||
variant.clear();
|
||||
return std::string();
|
||||
};
|
||||
// Prusa printers are considered first, then 3rd party.
|
||||
if (preferred_model = get_preferred_printer_model(PresetBundle::BBL_BUNDLE, preferred_variant);
|
||||
// Orca "custom" printers are considered first, then 3rd party.
|
||||
if (preferred_model = get_preferred_printer_model(PresetBundle::ORCA_DEFAULT_BUNDLE, preferred_variant);
|
||||
preferred_model.empty()) {
|
||||
for (const auto& bundle : enabled_vendors) {
|
||||
if (bundle.first == PresetBundle::BBL_BUNDLE) { continue; }
|
||||
if (bundle.first == PresetBundle::ORCA_DEFAULT_BUNDLE) { continue; }
|
||||
if (preferred_model = get_preferred_printer_model(bundle.first, preferred_variant);
|
||||
!preferred_model.empty())
|
||||
break;
|
||||
|
@ -962,10 +870,10 @@ bool GuideFrame::run()
|
|||
//we install the default here
|
||||
bool apply_keeped_changes = false;
|
||||
//clear filament section and use default materials
|
||||
app.app_config->set_variant(PresetBundle::BBL_BUNDLE,
|
||||
PresetBundle::BBL_DEFAULT_PRINTER_MODEL, PresetBundle::BBL_DEFAULT_PRINTER_VARIANT, "true");
|
||||
app.app_config->set_variant(PresetBundle::ORCA_DEFAULT_BUNDLE,
|
||||
PresetBundle::ORCA_DEFAULT_PRINTER_MODEL, PresetBundle::ORCA_DEFAULT_PRINTER_VARIANT, "true");
|
||||
app.app_config->clear_section(AppConfig::SECTION_FILAMENTS);
|
||||
app.preset_bundle->load_selections(*app.app_config, {PresetBundle::BBL_DEFAULT_PRINTER_MODEL, PresetBundle::BBL_DEFAULT_PRINTER_VARIANT, PresetBundle::BBL_DEFAULT_FILAMENT, std::string()});
|
||||
app.preset_bundle->load_selections(*app.app_config, {PresetBundle::ORCA_DEFAULT_PRINTER_MODEL, PresetBundle::ORCA_DEFAULT_PRINTER_VARIANT, PresetBundle::ORCA_DEFAULT_FILAMENT, std::string()});
|
||||
|
||||
app.app_config->set_legacy_datadir(false);
|
||||
app.update_mode();
|
||||
|
@ -1025,6 +933,8 @@ int GuideFrame::GetFilamentInfo( std::string VendorDirectory, json & pFilaList,
|
|||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " Before Format Inherits Path: VendorDirectory - " << VendorDirectory << ", sub_path - " << FPath;
|
||||
wxString strNewFile = wxString::Format("%s%c%s", wxString(VendorDirectory.c_str(), wxConvUTF8), boost::filesystem::path::preferred_separator, FPath);
|
||||
boost::filesystem::path inherits_path(w2s(strNewFile));
|
||||
if (!boost::filesystem::exists(inherits_path))
|
||||
inherits_path = (boost::filesystem::path(m_OrcaFilaLibPath) / boost::filesystem::path(FPath)).make_preferred();
|
||||
|
||||
//boost::filesystem::path nf(strNewFile.c_str());
|
||||
if (boost::filesystem::exists(inherits_path))
|
||||
|
@ -1066,31 +976,7 @@ int GuideFrame::GetFilamentInfo( std::string VendorDirectory, json & pFilaList,
|
|||
int GuideFrame::LoadProfile()
|
||||
{
|
||||
try {
|
||||
//wxString ExePath = boost::dll::program_location().parent_path().string();
|
||||
//wxString TargetFolder = ExePath + "\\resources\\profiles\\";
|
||||
//wxString TargetFolderSearch = ExePath + "\\resources\\profiles\\*.json";
|
||||
|
||||
//intptr_t handle;
|
||||
//_finddata_t findData;
|
||||
|
||||
//handle = _findfirst(TargetFolderSearch.mb_str(), &findData); // ???????????
|
||||
//if (handle == -1) { return -1; }
|
||||
|
||||
//do {
|
||||
// if (findData.attrib & _A_SUBDIR && strcmp(findData.name, ".") == 0 && strcmp(findData.name, "..") == 0) // ??????????"."?".."
|
||||
// {
|
||||
// // cout << findData.name << "\t<dir>\n";
|
||||
// } else {
|
||||
// wxString strVendor = wxString(findData.name).BeforeLast('.');
|
||||
// LoadProfileFamily(strVendor, TargetFolder + findData.name);
|
||||
// }
|
||||
|
||||
//} while (_findnext(handle, &findData) == 0); // ???????????
|
||||
|
||||
// BBS: change directories by design
|
||||
//BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", will load config from %1%.") % bbl_bundle_path;
|
||||
m_ProfileJson = json::parse("{}");
|
||||
//m_ProfileJson["configpath"] = Slic3r::data_dir();
|
||||
m_ProfileJson["model"] = json::array();
|
||||
m_ProfileJson["machine"] = json::object();
|
||||
m_ProfileJson["filament"] = json::object();
|
||||
|
@ -1099,76 +985,63 @@ int GuideFrame::LoadProfile()
|
|||
vendor_dir = (boost::filesystem::path(Slic3r::data_dir()) / PRESET_SYSTEM_DIR ).make_preferred();
|
||||
rsrc_vendor_dir = (boost::filesystem::path(resources_dir()) / "profiles").make_preferred();
|
||||
|
||||
// BBS: add BBL as default
|
||||
// BBS: add json logic for vendor bundle
|
||||
auto bbl_bundle_path = vendor_dir;
|
||||
bbl_bundle_rsrc = false;
|
||||
if (!boost::filesystem::exists((vendor_dir / PresetBundle::BBL_BUNDLE).replace_extension(".json"))) {
|
||||
bbl_bundle_path = rsrc_vendor_dir;
|
||||
bbl_bundle_rsrc = true;
|
||||
}
|
||||
// Orca: add custom as default
|
||||
// Orca: add json logic for vendor bundle
|
||||
orca_bundle_rsrc = true;
|
||||
|
||||
// intptr_t handle;
|
||||
//_finddata_t findData;
|
||||
|
||||
//handle = _findfirst((bbl_bundle_path / "*.json").make_preferred().string().c_str(), &findData); // ???????????
|
||||
// if (handle == -1) { return -1; }
|
||||
|
||||
// do {
|
||||
// if (findData.attrib & _A_SUBDIR && strcmp(findData.name, ".") == 0 && strcmp(findData.name, "..") == 0) // ??????????"."?".."
|
||||
// {
|
||||
// // cout << findData.name << "\t<dir>\n";
|
||||
// } else {
|
||||
// wxString strVendor = wxString(findData.name).BeforeLast('.');
|
||||
// LoadProfileFamily(w2s(strVendor), vendor_dir.make_preferred().string() + "\\"+ findData.name);
|
||||
// }
|
||||
|
||||
//} while (_findnext(handle, &findData) == 0); // ???????????
|
||||
|
||||
|
||||
//load BBL bundle from user data path
|
||||
string targetPath = bbl_bundle_path.make_preferred().string();
|
||||
boost::filesystem::path myPath(targetPath);
|
||||
boost::filesystem::directory_iterator endIter;
|
||||
for (boost::filesystem::directory_iterator iter(myPath); iter != endIter; iter++) {
|
||||
if (boost::filesystem::is_directory(*iter)) {
|
||||
//cout << "is dir" << endl;
|
||||
//cout << iter->path().string() << endl;
|
||||
} else {
|
||||
//cout << "is a file" << endl;
|
||||
//cout << iter->path().string() << endl;
|
||||
|
||||
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
|
||||
strVendor = strVendor.AfterLast('\\');
|
||||
strVendor = strVendor.AfterLast('/');
|
||||
wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
|
||||
|
||||
if (w2s(strVendor) == PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json") == 0)
|
||||
LoadProfileFamily(w2s(strVendor), iter->path().string());
|
||||
// search if there exists a .json file in vendor_dir folder, if exists, set orca_bundle_rsrc to false
|
||||
for (const auto& entry : boost::filesystem::directory_iterator(vendor_dir)) {
|
||||
if (!boost::filesystem::is_directory(entry) && boost::iequals(entry.path().extension().string(), ".json") && !boost::iequals(entry.path().stem().string(), PresetBundle::ORCA_FILAMENT_LIBRARY)) {
|
||||
orca_bundle_rsrc = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// load the default filament library first
|
||||
std::set<std::string> loaded_vendors;
|
||||
auto filament_library_name = boost::filesystem::path(PresetBundle::ORCA_FILAMENT_LIBRARY).replace_extension(".json");
|
||||
if (boost::filesystem::exists(vendor_dir / filament_library_name)) {
|
||||
LoadProfileFamily(PresetBundle::ORCA_FILAMENT_LIBRARY, (vendor_dir / filament_library_name).string());
|
||||
m_OrcaFilaLibPath = (vendor_dir / PresetBundle::ORCA_FILAMENT_LIBRARY).string();
|
||||
} else {
|
||||
LoadProfileFamily(PresetBundle::ORCA_FILAMENT_LIBRARY, (rsrc_vendor_dir / filament_library_name).string());
|
||||
m_OrcaFilaLibPath = (rsrc_vendor_dir / PresetBundle::ORCA_FILAMENT_LIBRARY).string();
|
||||
}
|
||||
loaded_vendors.insert(PresetBundle::ORCA_FILAMENT_LIBRARY);
|
||||
|
||||
//load custom bundle from user data path
|
||||
boost::filesystem::directory_iterator endIter;
|
||||
for (boost::filesystem::directory_iterator iter(vendor_dir); iter != endIter; iter++) {
|
||||
if (!boost::filesystem::is_directory(*iter)) {
|
||||
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
|
||||
strVendor = strVendor.AfterLast('\\');
|
||||
strVendor = strVendor.AfterLast('/');
|
||||
|
||||
wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
|
||||
if(strExtension.CmpNoCase("json") != 0 || loaded_vendors.find(w2s(strVendor)) != loaded_vendors.end())
|
||||
continue;
|
||||
|
||||
LoadProfileFamily(w2s(strVendor), iter->path().string());
|
||||
loaded_vendors.insert(w2s(strVendor));
|
||||
}
|
||||
}
|
||||
|
||||
//string others_targetPath = rsrc_vendor_dir.string();
|
||||
boost::filesystem::directory_iterator others_endIter;
|
||||
for (boost::filesystem::directory_iterator iter(rsrc_vendor_dir); iter != others_endIter; iter++) {
|
||||
if (boost::filesystem::is_directory(*iter)) {
|
||||
//cout << "is dir" << endl;
|
||||
//cout << iter->path().string() << endl;
|
||||
} else {
|
||||
//cout << "is a file" << endl;
|
||||
//cout << iter->path().string() << endl;
|
||||
if (!boost::filesystem::is_directory(*iter)) {
|
||||
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
|
||||
strVendor = strVendor.AfterLast('\\');
|
||||
strVendor = strVendor.AfterLast('/');
|
||||
wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
|
||||
if (strExtension.CmpNoCase("json") != 0 || loaded_vendors.find(w2s(strVendor)) != loaded_vendors.end())
|
||||
continue;
|
||||
|
||||
if (w2s(strVendor) != PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json")==0)
|
||||
LoadProfileFamily(w2s(strVendor), iter->path().string());
|
||||
LoadProfileFamily(w2s(strVendor), iter->path().string());
|
||||
loaded_vendors.insert(w2s(strVendor));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//LoadProfileFamily(PresetBundle::BBL_BUNDLE, bbl_bundle_path.string());
|
||||
|
||||
const auto enabled_filaments = wxGetApp().app_config->has_section(AppConfig::SECTION_FILAMENTS) ? wxGetApp().app_config->get_section(AppConfig::SECTION_FILAMENTS) : std::map<std::string, std::string>();
|
||||
m_appconfig_new.set_vendors(*wxGetApp().app_config);
|
||||
|
@ -1264,185 +1137,6 @@ void StringReplace(string &strBase, string strSrc, string strDes)
|
|||
}
|
||||
|
||||
|
||||
//int GuideFrame::LoadProfileFamily(std::string strVendor, std::string strFilePath)
|
||||
//{
|
||||
// //wxString strFolder = strFilePath.BeforeLast(boost::filesystem::path::preferred_separator);
|
||||
// boost::filesystem::path file_path(strFilePath);
|
||||
// boost::filesystem::path vendor_dir = boost::filesystem::absolute(file_path.parent_path()/ strVendor).make_preferred();
|
||||
// BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", vendor path %1%.")% vendor_dir.string();
|
||||
// try {
|
||||
//
|
||||
// //wxLogMessage("GUIDE: json_path1 %s", w2s(strFilePath));
|
||||
//
|
||||
// std::string contents;
|
||||
// LoadFile(strFilePath, contents);
|
||||
// //wxLogMessage("GUIDE: json_path1 content: %s", contents);
|
||||
// json jLocal=json::parse(contents);
|
||||
// //wxLogMessage("GUIDE: json_path1 Loaded");
|
||||
//
|
||||
// // BBS:models
|
||||
// json pmodels = jLocal["machine_model_list"];
|
||||
// int nsize = pmodels.size();
|
||||
//
|
||||
// BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", got %1% machine models")%nsize;
|
||||
//
|
||||
// for (int n = 0; n < nsize; n++) {
|
||||
// json OneModel = pmodels.at(n);
|
||||
//
|
||||
// OneModel["model"] = OneModel["name"];
|
||||
// OneModel.erase("name");
|
||||
//
|
||||
// std::string s1 = OneModel["model"];
|
||||
// std::string s2 = OneModel["sub_path"];
|
||||
//
|
||||
// boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred();
|
||||
// std::string sub_file = sub_path.string();
|
||||
//
|
||||
// //wxLogMessage("GUIDE: json_path2 %s", w2s(ModelFilePath));
|
||||
// LoadFile(sub_file, contents);
|
||||
// //wxLogMessage("GUIDE: json_path2 content: %s", contents);
|
||||
// json pm=json::parse(contents);
|
||||
// //wxLogMessage("GUIDE: json_path2 loaded");
|
||||
//
|
||||
// OneModel["vendor"] = strVendor;
|
||||
// std::string NozzleOpt = pm["nozzle_diameter"];
|
||||
// StringReplace(NozzleOpt, " ", "");
|
||||
// OneModel["nozzle_diameter"] = NozzleOpt;
|
||||
// OneModel["materials"] = pm["default_materials"];
|
||||
//
|
||||
// //wxString strCoverPath = wxString::Format("%s\\%s\\%s_cover.png", strFolder, strVendor, std::string(s1.mb_str()));
|
||||
// std::string cover_file = s1+"_cover.png";
|
||||
// boost::filesystem::path cover_path = boost::filesystem::absolute(vendor_dir / cover_file).make_preferred();
|
||||
// OneModel["cover"] = cover_path.string();
|
||||
//
|
||||
// OneModel["nozzle_selected"] = "";
|
||||
//
|
||||
// m_ProfileJson["model"].push_back(OneModel);
|
||||
// }
|
||||
//
|
||||
// // BBS:Machine
|
||||
// json pmachine = jLocal["machine_list"];
|
||||
// nsize = pmachine.size();
|
||||
// BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", got %1% machines")%nsize;
|
||||
// for (int n = 0; n < nsize; n++) {
|
||||
// json OneMachine = pmachine.at(n);
|
||||
//
|
||||
// std::string s1 = OneMachine["name"];
|
||||
// std::string s2 = OneMachine["sub_path"];
|
||||
//
|
||||
// //wxString ModelFilePath = wxString::Format("%s\\%s\\%s", strFolder, strVendor, s2);
|
||||
// boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred();
|
||||
// std::string sub_file = sub_path.string();
|
||||
// LoadFile(sub_file, contents);
|
||||
// json pm = json::parse(contents);
|
||||
//
|
||||
// std::string strInstant = pm["instantiation"];
|
||||
// if (strInstant.compare("true") == 0) {
|
||||
// OneMachine["model"] = pm["printer_model"];
|
||||
//
|
||||
// m_ProfileJson["machine"].push_back(OneMachine);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // BBS:Filament
|
||||
// json pFilament = jLocal["filament_list"];
|
||||
// nsize = pFilament.size();
|
||||
//
|
||||
// int nFalse = 0;
|
||||
// int nModel = 0;
|
||||
// int nFinish = 0;
|
||||
// BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", got %1% filaments")%nsize;
|
||||
// for (int n = 0; n < nsize; n++) {
|
||||
// json OneFF = pFilament.at(n);
|
||||
//
|
||||
// std::string s1 = OneFF["name"];
|
||||
// std::string s2 = OneFF["sub_path"];
|
||||
//
|
||||
// if (!m_ProfileJson["filament"].contains(s1))
|
||||
// {
|
||||
// //wxString ModelFilePath = wxString::Format("%s\\%s\\%s", strFolder, strVendor, s2);
|
||||
// boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred();
|
||||
// std::string sub_file = sub_path.string();
|
||||
// LoadFile(sub_file, contents);
|
||||
// json pm = json::parse(contents);
|
||||
//
|
||||
// std::string strInstant = pm["instantiation"];
|
||||
// if (strInstant == "true") {
|
||||
// std::string sV;
|
||||
// std::string sT;
|
||||
//
|
||||
// int nRet = GetFilamentInfo(sub_file, sV, sT);
|
||||
// if (nRet != 0) continue;
|
||||
//
|
||||
// OneFF["vendor"] = sV;
|
||||
// OneFF["type"] = sT;
|
||||
//
|
||||
// OneFF["models"] = "";
|
||||
// OneFF["selected"] = 0;
|
||||
// }
|
||||
// else
|
||||
// continue;
|
||||
//
|
||||
// } else {
|
||||
// OneFF = m_ProfileJson["filament"][s1];
|
||||
// }
|
||||
//
|
||||
// std::string vModel = "";
|
||||
// int nm = m_ProfileJson["model"].size();
|
||||
// int bFind = 0;
|
||||
// for (int m = 0; m < nm; m++) {
|
||||
// std::string strFF = m_ProfileJson["model"][m]["materials"];
|
||||
// strFF = (boost::format(";%1%;")%strFF).str();
|
||||
// std::string strTT = (boost::format(";%1%;")%s1).str();
|
||||
// if (strFF.find(strTT) != std::string::npos) {
|
||||
// std::string sModel = m_ProfileJson["model"][m]["model"];
|
||||
//
|
||||
// vModel = (boost::format("%1%[%2%]")%vModel %sModel).str();
|
||||
// bFind = 1;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// OneFF["models"] = vModel;
|
||||
//
|
||||
// m_ProfileJson["filament"][s1] = OneFF;
|
||||
// }
|
||||
//
|
||||
// //process
|
||||
// json pProcess = jLocal["process_list"];
|
||||
// nsize = pProcess.size();
|
||||
// BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", got %1% processes")%nsize;
|
||||
// for (int n = 0; n < nsize; n++) {
|
||||
// json OneProcess = pProcess.at(n);
|
||||
//
|
||||
// std::string s2 = OneProcess["sub_path"];
|
||||
// //wxString ModelFilePath = wxString::Format("%s\\%s\\%s", strFolder, strVendor, s2);
|
||||
// boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred();
|
||||
// std::string sub_file = sub_path.string();
|
||||
// LoadFile(sub_file, contents);
|
||||
// json pm = json::parse(contents);
|
||||
//
|
||||
// std::string bInstall = pm["instantiation"];
|
||||
// if (bInstall == "true")
|
||||
// {
|
||||
// m_ProfileJson["process"].push_back(OneProcess);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// catch(nlohmann::detail::parse_error &err) {
|
||||
// BOOST_LOG_TRIVIAL(error) << __FUNCTION__<< ": parse "<<strFilePath <<" got a nlohmann::detail::parse_error, reason = " << err.what();
|
||||
// return -1;
|
||||
// }
|
||||
// catch (std::exception &e) {
|
||||
// // wxMessageBox(e.what(), "", MB_OK);
|
||||
// //wxLogMessage("GUIDE: LoadFamily Error: %s", e.what());
|
||||
// BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": parse " << strFilePath << " got exception: " << e.what();
|
||||
// return -1;
|
||||
// }
|
||||
//
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
int GuideFrame::LoadProfileFamily(std::string strVendor, std::string strFilePath)
|
||||
{
|
||||
// wxString strFolder = strFilePath.BeforeLast(boost::filesystem::path::preferred_separator);
|
||||
|
@ -1531,7 +1225,7 @@ int GuideFrame::LoadProfileFamily(std::string strVendor, std::string strFilePath
|
|||
|
||||
// BBS:Filament
|
||||
json pFilament = jLocal["filament_list"];
|
||||
json tFilaList = json::object();
|
||||
json tFilaList = m_OrcaFilaList;
|
||||
nsize = pFilament.size();
|
||||
|
||||
for (int n = 0; n < nsize; n++) {
|
||||
|
@ -1604,6 +1298,8 @@ int GuideFrame::LoadProfileFamily(std::string strVendor, std::string strFilePath
|
|||
|
||||
}
|
||||
}
|
||||
if(strVendor == PresetBundle::ORCA_FILAMENT_LIBRARY)
|
||||
m_OrcaFilaList = tFilaList;
|
||||
|
||||
// process
|
||||
json pProcess = jLocal["process_list"];
|
||||
|
|
|
@ -103,7 +103,7 @@ private:
|
|||
|
||||
wxString m_SectionName;
|
||||
|
||||
bool bbl_bundle_rsrc;
|
||||
bool orca_bundle_rsrc;
|
||||
boost::filesystem::path vendor_dir;
|
||||
boost::filesystem::path rsrc_vendor_dir;
|
||||
|
||||
|
@ -115,6 +115,9 @@ private:
|
|||
bool InstallNetplugin;
|
||||
bool network_plugin_ready {false};
|
||||
|
||||
json m_OrcaFilaList;
|
||||
std::string m_OrcaFilaLibPath;
|
||||
|
||||
#if wxUSE_WEBVIEW_IE
|
||||
wxMenuItem *m_script_object_el;
|
||||
wxMenuItem *m_script_date_el;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue