OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::GuideFrame Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/WebGuideDialog.hpp>

Inheritance diagram for Slic3r::GUI::GuideFrame:
Collaboration diagram for Slic3r::GUI::GuideFrame:

Classes

struct  CachedFilamentInfo

Public Types

enum  GuidePage {
  BBL_WELCOME , BBL_REGION , BBL_MODELS , BBL_FILAMENTS ,
  BBL_FILAMENT_ONLY , BBL_MODELS_ONLY
}
using json = nlohmann::json

Public Member Functions

 GuideFrame (GUI_App *pGUI, long style=wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU)
virtual ~GuideFrame ()
void load_url (wxString &url)
wxString SetStartPage (GuidePage startpage=BBL_WELCOME, bool load=true)
void UpdateState ()
void OnIdle (wxIdleEvent &evt)
void OnNavigationRequest (wxWebViewEvent &evt)
void OnNavigationComplete (wxWebViewEvent &evt)
void OnDocumentLoaded (wxWebViewEvent &evt)
void OnNewWindow (wxWebViewEvent &evt)
void OnError (wxWebViewEvent &evt)
void OnTitleChanged (wxWebViewEvent &evt)
void OnFullScreenChanged (wxWebViewEvent &evt)
void OnScriptMessage (wxWebViewEvent &evt)
void OnScriptResponseMessage (wxCommandEvent &evt)
void RunScript (const wxString &javascript)
bool IsFirstUse ()
int LoadProfileData ()
int SaveProfileData ()
int LoadProfileFamily (std::string strVendor, std::string strFilePath)
void init_guide_paths ()
void on_profile_loaded ()
void notify_profile_loaded ()
bool BuildProfileJson (const PresetBundle &bundle, bool require_all_resource_vendors)
bool BuildProfileDataFromPresetBundle ()
bool BuildProfileDataFromVendors ()
void reset_profile_json ()
int SaveProfile ()
int GetFilamentInfo (std::string VendorDirectory, json &pFilaList, std::string filepath, std::string &sVendor, std::string &sType)
bool apply_config (AppConfig *app_config, PresetBundle *preset_bundle, const PresetUpdater *updater, bool &apply_keeped_changes)
bool run ()
void StrReplace (std::string &strBase, std::string strSrc, std::string strDes)
std::string w2s (wxString sSrc)
void GetStardardFilePath (std::string &FilePath)
bool LoadFile (std::string jPath, std::string &sContent)
int DownloadPlugin ()
int InstallPlugin ()
int ShowPluginStatus (int status, int percent, bool &cancel)
void on_dpi_changed (const wxRect &suggested_rect)
void EndModal (int retCode) override
float scale_factor () const
float prev_scale_factor () const
void set_scale_factor (float v)
void set_prev_scale_factor (float v)
void set_em_unit (int v)
bool force_rescale () const
int em_unit () const
const wxFont & normal_font () const
void enable_force_rescale ()
int ShowModal ()

Public Attributes

enum Slic3r::GUI::GuideFrame::GuidePage m_page

Protected Member Functions

virtual void on_sys_color_changed ()

Private Member Functions

int GetFilamentInfo (const std::string &VendorDirectory, json &pFilaList, const std::string &filepath, std::string &sVendor, std::string &sType, std::unordered_set< std::string > &visiting)
void update_em_unit ()
bool is_new_scale_factor () const
void rescale (const wxRect &suggested_rect)

Private Attributes

GUI_App * m_MainPtr
AppConfig m_appconfig_new
wxWebView * m_browser
wxString m_SectionName
bool orca_bundle_rsrc
boost::filesystem::path vendor_dir
boost::filesystem::path rsrc_vendor_dir
bool bFirstComplete {false}
bool m_profile_ready {false}
bool m_page_ready {false}
std::shared_ptr< std::atomic< bool > > m_cancel_token {std::make_shared<std::atomic<bool>>(false)}
std::unique_ptr< boost::thread > m_load_task
bool PrivacyUse
bool StealthMode
std::string m_Region
bool InstallNetplugin
bool network_plugin_ready {false}
json m_ProfileJson
json m_OrcaFilaList
std::string m_OrcaFilaLibPath
wxString m_javascript
wxString m_response_js
wxString m_bbl_user_agent
std::string m_editing_filament_id
std::unordered_map< std::string, CachedFilamentInfo > filament_info_cache
float m_scale_factor
int m_em_unit
wxFont m_normal_font
float m_prev_scale_factor
bool m_can_rescale
bool m_force_rescale
int m_new_font_point_size

Detailed Description


Class Documentation

◆ Slic3r::GUI::GuideFrame::CachedFilamentInfo

struct Slic3r::GUI::GuideFrame::CachedFilamentInfo
Collaboration diagram for Slic3r::GUI::GuideFrame::CachedFilamentInfo:
Class Members
int status {-1}
string type
string vendor

Member Typedef Documentation

◆ json

using Slic3r::GUI::GuideFrame::json = nlohmann::json

Member Enumeration Documentation

◆ GuidePage

Enumerator
BBL_WELCOME 
BBL_REGION 
BBL_MODELS 
BBL_FILAMENTS 
BBL_FILAMENT_ONLY 
BBL_MODELS_ONLY 
67 {
74 }m_page;
@ BBL_REGION
Definition WebGuideDialog.hpp:69
@ BBL_FILAMENT_ONLY
Definition WebGuideDialog.hpp:72
@ BBL_WELCOME
Definition WebGuideDialog.hpp:68
@ BBL_MODELS_ONLY
Definition WebGuideDialog.hpp:73
@ BBL_FILAMENTS
Definition WebGuideDialog.hpp:71
@ BBL_MODELS
Definition WebGuideDialog.hpp:70
enum Slic3r::GUI::GuideFrame::GuidePage m_page

Constructor & Destructor Documentation

◆ GuideFrame()

Slic3r::GUI::GuideFrame::GuideFrame ( GUI_App * pGUI,
long style = wxCAPTION | wxCLOSE_BOX | wxSYSTEM_MENU )
223 : DPIDialog((wxWindow *) (pGUI->mainframe), wxID_ANY, "OrcaSlicer", wxDefaultPosition, wxDefaultSize, style),
225{
226 SetBackgroundColour(*wxWHITE);
227 // INI
228 m_SectionName = "firstguide";
230 PrivacyUse = false;
231 StealthMode = false;
232 InstallNetplugin = false;
233
234 m_MainPtr = pGUI;
235
236 // set the frame icon
237 wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
238
239 // Created empty and loaded by SetStartPage(BBL_REGION) below, after the strings are added, so the
240 // first load already has them.
241 m_browser = WebView::CreateWebView(this, wxEmptyString);
242 if (m_browser == nullptr) {
243 wxLogError("Could not init m_browser");
244 return;
245 }
246 m_browser->AddUserScript(wxString::FromUTF8(WebViewHostDialog::localized_strings_script(guide_strings())));
247 m_browser->Hide();
248 m_browser->SetSize(0, 0);
249
250 SetSizer(topsizer);
251
252 topsizer->Add(m_browser, wxSizerFlags().Expand().Proportion(1));
253
254 // Log backend information
255 // wxLogMessage(wxWebView::GetBackendVersionInfo().ToString());
256 // wxLogMessage("Backend: %s Version: %s",
257 // m_browser->GetClassInfo()->GetClassName(),wxWebView::GetBackendVersionInfo().ToString());
258 // wxLogMessage("User Agent: %s", m_browser->GetUserAgent());
259
260 // Set a more sensible size for web browsing
261 wxSize pSize = FromDIP(wxSize(820, 660));
262 SetSize(pSize);
263
264 int screenheight = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, NULL);
265 int screenwidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X, NULL);
266 int MaxY = (screenheight - pSize.y) > 0 ? (screenheight - pSize.y) / 2 : 0;
267 wxPoint tmpPT((screenwidth - pSize.x) / 2, MaxY);
268 Move(tmpPT);
269#ifdef __WXMSW__
270 this->Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& e) {
271 if ((m_page == BBL_FILAMENT_ONLY || m_page == BBL_MODELS_ONLY) && e.GetKeyCode() == WXK_ESCAPE) {
272 if (this->IsModal())
273 this->EndModal(wxID_CANCEL);
274 else
275 this->Close();
276 }
277 else
278 e.Skip();
279 });
280#endif
281 // Connect the webview events
282 Bind(wxEVT_WEBVIEW_NAVIGATING, &GuideFrame::OnNavigationRequest, this, m_browser->GetId());
283 Bind(wxEVT_WEBVIEW_NAVIGATED, &GuideFrame::OnNavigationComplete, this, m_browser->GetId());
284 Bind(wxEVT_WEBVIEW_LOADED, &GuideFrame::OnDocumentLoaded, this, m_browser->GetId());
285 Bind(wxEVT_WEBVIEW_ERROR, &GuideFrame::OnError, this, m_browser->GetId());
286 Bind(wxEVT_WEBVIEW_NEWWINDOW, &GuideFrame::OnNewWindow, this, m_browser->GetId());
287 Bind(wxEVT_WEBVIEW_TITLE_CHANGED, &GuideFrame::OnTitleChanged, this, m_browser->GetId());
288 Bind(wxEVT_WEBVIEW_FULLSCREEN_CHANGED, &GuideFrame::OnFullScreenChanged, this, m_browser->GetId());
289 Bind(wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED, &GuideFrame::OnScriptMessage, this, m_browser->GetId());
290
291 // Connect the idle events
292 // Bind(wxEVT_IDLE, &GuideFrame::OnIdle, this);
293 // Bind(wxEVT_CLOSE_WINDOW, &GuideFrame::OnClose, this);
294
295 // UI
297
298 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", finished");
299 wxGetApp().UpdateDlgDarkUI(this);
300}
#define style
Definition WipeTowerDialog.cpp:101
void EndModal(int retCode) override
Definition GUI_Utils.hpp:305
wxWebView * m_browser
Definition WebGuideDialog.hpp:136
AppConfig m_appconfig_new
Definition WebGuideDialog.hpp:134
wxString m_SectionName
Definition WebGuideDialog.hpp:138
void OnNavigationComplete(wxWebViewEvent &evt)
Definition WebGuideDialog.cpp:470
void OnDocumentLoaded(wxWebViewEvent &evt)
Definition WebGuideDialog.cpp:501
void OnNavigationRequest(wxWebViewEvent &evt)
Definition WebGuideDialog.cpp:402
void OnFullScreenChanged(wxWebViewEvent &evt)
Definition WebGuideDialog.cpp:543
bool StealthMode
Definition WebGuideDialog.hpp:158
GUI_App * m_MainPtr
Definition WebGuideDialog.hpp:133
void OnScriptMessage(wxWebViewEvent &evt)
Definition WebGuideDialog.cpp:549
void OnNewWindow(wxWebViewEvent &evt)
Definition WebGuideDialog.cpp:520
void OnError(wxWebViewEvent &evt)
Definition WebGuideDialog.cpp:865
wxString SetStartPage(GuidePage startpage=BBL_WELCOME, bool load=true)
Definition WebGuideDialog.cpp:324
bool PrivacyUse
Definition WebGuideDialog.hpp:157
void OnTitleChanged(wxWebViewEvent &evt)
Definition WebGuideDialog.cpp:537
bool InstallNetplugin
Definition WebGuideDialog.hpp:161
static std::string localized_strings_script(const nlohmann::json &strings)
Definition WebViewHostDialog.cpp:156
static wxWebView * CreateWebView(wxWindow *parent, wxString const &url)
Definition WebView.cpp:313
static json guide_strings()
Definition WebGuideDialog.cpp:92

References BBL_FILAMENT_ONLY, BBL_MODELS_ONLY, BBL_REGION, BBL_WELCOME, WebView::CreateWebView(), Slic3r::GUI::DPIDialog::EndModal(), Slic3r::GUI::guide_strings(), InstallNetplugin, Slic3r::GUI::WebViewHostDialog::localized_strings_script(), m_appconfig_new, m_browser, m_MainPtr, m_page, m_SectionName, OnDocumentLoaded(), OnError(), OnFullScreenChanged(), OnNavigationComplete(), OnNavigationRequest(), OnNewWindow(), OnScriptMessage(), OnTitleChanged(), PrivacyUse, SetStartPage(), StealthMode, and style.

Here is the call graph for this function:

◆ ~GuideFrame()

Slic3r::GUI::GuideFrame::~GuideFrame ( )
virtual
303{
304 *m_cancel_token = true; // stop the loading thread and any queued CallAfter lambdas before join
305 if (m_load_task && m_load_task->joinable())
306 m_load_task->join();
307 m_load_task.reset();
308 if (m_browser) {
309 delete m_browser;
310 m_browser = nullptr;
311 }
312}
std::shared_ptr< std::atomic< bool > > m_cancel_token
Definition WebGuideDialog.hpp:153
std::unique_ptr< boost::thread > m_load_task
Definition WebGuideDialog.hpp:154

References m_browser, m_cancel_token, and m_load_task.

Member Function Documentation

◆ apply_config()

bool Slic3r::GUI::GuideFrame::apply_config ( AppConfig * app_config,
PresetBundle * preset_bundle,
const PresetUpdater * updater,
bool & apply_keeped_changes )
1006{
1007 const auto enabled_vendors = m_appconfig_new.vendors();
1008 const auto old_enabled_vendors = app_config->vendors();
1009
1010 const auto enabled_filaments = m_appconfig_new.has_section(AppConfig::SECTION_FILAMENTS) ? m_appconfig_new.get_section(AppConfig::SECTION_FILAMENTS) : std::map<std::string, std::string>();
1011 const auto old_enabled_filaments = app_config->has_section(AppConfig::SECTION_FILAMENTS) ? app_config->get_section(AppConfig::SECTION_FILAMENTS) : std::map<std::string, std::string>();
1012
1013 bool check_unsaved_preset_changes = false;
1014 std::vector<std::string> install_bundles;
1015 std::vector<std::string> remove_bundles;
1016 for (const auto &it : enabled_vendors) {
1017 if (it.second.size() > 0) {
1018 if (!is_vendor_installed(it.first)) {
1019 install_bundles.emplace_back(it.first);
1020 }
1021 }
1022 }
1023
1024 //add the removed vendor bundles
1025 for (const auto &it : old_enabled_vendors) {
1026 if (it.second.size() > 0) {
1027 if (enabled_vendors.find(it.first) != enabled_vendors.end())
1028 continue;
1029 if (is_vendor_installed(it.first)) {
1030 remove_bundles.emplace_back(it.first);
1031 }
1032 }
1033 }
1034
1035 check_unsaved_preset_changes = (enabled_vendors != old_enabled_vendors) || (enabled_filaments != old_enabled_filaments);
1036 wxString header = _L("The configuration package is changed in previous Config Guide");
1037 wxString caption = _L("Configuration package changed");
1039
1040 if (check_unsaved_preset_changes &&
1041 !wxGetApp().check_and_keep_current_preset_changes(caption, header, act_btns, &apply_keeped_changes))
1042 return false;
1043
1044 // If there are bundles to install, they will be installed by apply_vendor_config
1045 if (!install_bundles.empty()) {
1046 BOOST_LOG_TRIVIAL(info) << "Will install " << install_bundles.size() << " vendor bundles from resources";
1047 } else {
1048 BOOST_LOG_TRIVIAL(info) << "No bundles need to be installed from resource directory";
1049 }
1050
1051 // Not remove, because these bundles may be updated
1052 //if (remove_bundles.size() > 0) {
1053 // //remove unused bundles
1054 // for (const auto &it : remove_bundles) {
1055 // auto vendor_file = vendor_dir/(it + ".json");
1056 // auto sub_dir = vendor_dir/(it);
1057 // if (fs::exists(vendor_file))
1058 // fs::remove(vendor_file);
1059 // if (fs::exists(sub_dir))
1060 // fs::remove_all(sub_dir);
1061 // }
1062 //} else {
1063 // BOOST_LOG_TRIVIAL(info) << "No bundles need to be removed";
1064 //}
1065
1066 std::string preferred_model;
1067 std::string preferred_variant;
1068 PrinterTechnology preferred_pt = ptFFF;
1069 auto get_preferred_printer_model = [preset_bundle, enabled_vendors, old_enabled_vendors](const std::string& bundle_name, std::string& variant) {
1070 const auto config = enabled_vendors.find(bundle_name);
1071 if (config == enabled_vendors.end())
1072 return std::string();
1073
1074 const VendorProfile & printer_profile = preset_bundle->vendors[bundle_name];
1075 const std::map<std::string, std::set<std::string>>& model_maps = config->second;
1076 //for (const auto& vendor_profile : preset_bundle->vendors) {
1077 for (const auto& model_it: model_maps) {
1078 if (model_it.second.size() > 0) {
1079 variant = *model_it.second.begin();
1080 if (model_it.second.size() > 1) {
1081 if (printer_profile.models.size() > 0) {
1082 const VendorProfile::PrinterModel& printer_model = *std::find_if(printer_profile.models.begin(), printer_profile.models.end(),
1083 [id = model_it.first](auto& m) { return m.id == id; });
1084 for (auto& vt : printer_model.variants) {
1085 if (std::find(model_it.second.begin(), model_it.second.end(), vt.name) != model_it.second.end()) { variant = vt.name; break; }
1086 }
1087 }
1088 else if (variant != PresetBundle::ORCA_DEFAULT_PRINTER_VARIANT){
1089 if (std::find(model_it.second.begin(), model_it.second.end(), PresetBundle::ORCA_DEFAULT_PRINTER_VARIANT) != model_it.second.end())
1091 }
1092 }
1093
1094 const auto config_old = old_enabled_vendors.find(bundle_name);
1095 if (config_old == old_enabled_vendors.end())
1096 return model_it.first;
1097 const auto model_it_old = config_old->second.find(model_it.first);
1098 if (model_it_old == config_old->second.end())
1099 return model_it.first;
1100 else if (model_it_old->second != model_it.second) {
1101 for (const auto& var : model_it.second)
1102 if (model_it_old->second.find(var) == model_it_old->second.end()) {
1103 variant = var;
1104 return model_it.first;
1105 }
1106 }
1107 }
1108 }
1109 //}
1110 if (!variant.empty())
1111 variant.clear();
1112 return std::string();
1113 };
1114 // Orca "custom" printers are considered first, then 3rd party.
1115 if (preferred_model = get_preferred_printer_model(PresetBundle::ORCA_DEFAULT_BUNDLE, preferred_variant);
1116 preferred_model.empty()) {
1117 for (const auto& bundle : enabled_vendors) {
1118 if (bundle.first == PresetBundle::ORCA_DEFAULT_BUNDLE) { continue; }
1119 if (preferred_model = get_preferred_printer_model(bundle.first, preferred_variant);
1120 !preferred_model.empty())
1121 break;
1122 }
1123 }
1124
1125 std::string first_added_filament;
1126 auto get_first_added_material_preset = [this, app_config](const std::string& section_name, std::string& first_added_preset) {
1127 if (m_appconfig_new.has_section(section_name)) {
1128 // get first of new added preset names
1129 const std::map<std::string, std::string>& old_presets = app_config->has_section(section_name) ? app_config->get_section(section_name) : std::map<std::string, std::string>();
1130 first_added_preset = get_first_added_preset(old_presets, m_appconfig_new.get_section(section_name));
1131 }
1132 };
1133 // Not switch filament
1134 //get_first_added_material_preset(AppConfig::SECTION_FILAMENTS, first_added_filament);
1135
1136 // ORCA: functionality moved to PresetBundle::apply_vendor_config; keeping for future reference
1137 // // For each @System filament, check if a vendor-specific override exists
1138 // // in the loaded profiles. If so, replace the @System variant with the
1139 // // override (e.g. replace "Generic ABS @System" with BBL "Generic ABS").
1140 // // When printers from the default bundle are also selected, keep @System
1141 // // too since those printers need it.
1142 // static const std::string system_suffix = " @System";
1143 // auto it_default = enabled_vendors.find(PresetBundle::ORCA_DEFAULT_BUNDLE);
1144 // bool has_default_bundle_printer = it_default != enabled_vendors.end() && !it_default->second.empty();
1145 // bool has_filament_profiles = m_ProfileJson.contains("filament");
1146
1147 // // Check if any non-default vendor has selected printers
1148 // bool has_vendor_printer = false;
1149 // for (const auto& [vendor, models] : enabled_vendors) {
1150 // if (vendor != PresetBundle::ORCA_DEFAULT_BUNDLE && !models.empty()) {
1151 // has_vendor_printer = true;
1152 // break;
1153 // }
1154 // }
1155
1156 // std::map<std::string, std::string> supplemented_filaments;
1157 // for (const auto& [name, value] : enabled_filaments) {
1158 // if (name.size() > system_suffix.size() &&
1159 // name.compare(name.size() - system_suffix.size(), system_suffix.size(), system_suffix) == 0) {
1160 // std::string short_name = name.substr(0, name.size() - system_suffix.size());
1161 // if (has_vendor_printer && has_filament_profiles && m_ProfileJson["filament"].contains(short_name)) {
1162 // supplemented_filaments[short_name] = value;
1163 // BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " Replacing @System filament: '" << name << "' -> '" << short_name << "'";
1164 // if (has_default_bundle_printer) {
1165 // supplemented_filaments[name] = value;
1166 // BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " Also keeping '" << name << "' for default bundle printers";
1167 // }
1168 // continue;
1169 // }
1170 // }
1171 // supplemented_filaments[name] = value;
1172 // }
1173
1174 // //update the app_config
1175 // app_config->set_section(AppConfig::SECTION_FILAMENTS, supplemented_filaments);
1176 // app_config->set_vendors(m_appconfig_new);
1177
1178 // if (check_unsaved_preset_changes)
1179 // preset_bundle->load_presets(*app_config, ForwardCompatibilitySubstitutionRule::Enable,
1180 // {preferred_model, preferred_variant, first_added_filament, std::string()});
1181
1182 // // If the active filament is not in the wizard-selected filaments, switch to the first
1183 // // compatible wizard-selected filament. This handles the first-run case where load_presets
1184 // // falls back to "Generic PLA" even though the user selected a different filament.
1185 // bool active_filament_selected = supplemented_filaments.empty()
1186 // || supplemented_filaments.count(preset_bundle->filament_presets.front()) > 0;
1187 // if (!active_filament_selected) {
1188 // for (const auto& [filament_name, _] : supplemented_filaments) {
1189 // const Preset* preset = preset_bundle->filaments.find_preset(filament_name);
1190 // if (preset && preset->is_visible && preset->is_compatible) {
1191 // preset_bundle->filaments.select_preset_by_name(filament_name, true);
1192 // preset_bundle->filament_presets.front() = preset_bundle->filaments.get_selected_preset_name();
1193 // break;
1194 // }
1195 // }
1196 // }
1197
1198 // // Update the selections from the compatibilty.
1199 // preset_bundle->export_selections(*app_config);
1200
1201 BOOST_LOG_TRIVIAL(info) << "calling apply_vendor_config from WebGuideDialog";
1202 // Call the Core library function to apply vendor configuration
1203 // This handles bundle installation, filament @System substitution, AppConfig updates, and preset loading
1204 if (!preset_bundle->apply_vendor_config(
1205 enabled_vendors,
1206 enabled_filaments,
1207 app_config,
1208 true,
1209 preferred_model,
1210 preferred_variant))
1211 return false;
1212
1213 return true;
1214}
#define _L(s)
Definition OBJ.cpp:34
static const std::string SECTION_FILAMENTS
Definition AppConfig.hpp:408
static const char * ORCA_DEFAULT_BUNDLE
Definition PresetBundle.hpp:686
static const char * ORCA_DEFAULT_PRINTER_VARIANT
Definition PresetBundle.hpp:688
const char * section_name(ShortcutSection section)
Definition Shortcuts.cpp:248
static std::string get_first_added_preset(const std::map< std::string, std::string > &old_data, const std::map< std::string, std::string > &new_data)
Definition ConfigWizard.cpp:2367
@ KEEP
Definition UnsavedChangesDialog.hpp:252
@ SAVE
Definition UnsavedChangesDialog.hpp:253
std::string var(const std::string &file_name)
Definition utils.cpp:278
PrinterTechnology
Definition Config.hpp:229
@ ptFFF
Definition Config.hpp:231
bool is_vendor_installed(const std::string &vendor)
Definition utils.cpp:1973

References _L, Slic3r::PresetBundle::apply_vendor_config(), Slic3r::GUI::get_first_added_preset(), Slic3r::AppConfig::get_section(), Slic3r::AppConfig::has_section(), Slic3r::is_vendor_installed(), Slic3r::GUI::KEEP, m_appconfig_new, Slic3r::VendorProfile::models, Slic3r::PresetBundle::ORCA_DEFAULT_BUNDLE, Slic3r::PresetBundle::ORCA_DEFAULT_PRINTER_VARIANT, Slic3r::ptFFF, Slic3r::GUI::SAVE, Slic3r::AppConfig::SECTION_FILAMENTS, Slic3r::GUI::section_name(), Slic3r::var(), Slic3r::VendorProfile::PrinterModel::variants, Slic3r::AppConfig::vendors(), and Slic3r::PresetBundle::vendors.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildProfileDataFromPresetBundle()

bool Slic3r::GUI::GuideFrame::BuildProfileDataFromPresetBundle ( )
1504{
1505 PresetBundle* pb = wxGetApp().preset_bundle;
1506 if (!pb || pb->vendors.empty())
1507 return false;
1508 return BuildProfileJson(*pb, /*require_all_resource_vendors=*/true);
1509}
bool BuildProfileJson(const PresetBundle &bundle, bool require_all_resource_vendors)
Definition WebGuideDialog.cpp:1385

References BuildProfileJson(), and Slic3r::PresetBundle::vendors.

Referenced by OnNavigationComplete().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildProfileDataFromVendors()

bool Slic3r::GUI::GuideFrame::BuildProfileDataFromVendors ( )
1512{
1513 try {
1514 // Same vendor set and precedence as the JSON scan in LoadProfileData: a
1515 // vendor in the user's system dir shadows the bundled one of that name.
1516 // vendor_names_in names a vendor by its profile or, where a build ships
1517 // preset caches instead, by its cache alone.
1518 std::map<std::string, boost::filesystem::path> vendor_sources;
1519 for (const boost::filesystem::path& dir : { vendor_dir, rsrc_vendor_dir }) {
1520 boost::system::error_code ec;
1521 if (boost::filesystem::exists(dir, ec))
1522 for (const std::string& name : vendor_names_in(dir))
1523 vendor_sources.emplace(name, dir); // first dir wins
1524 }
1525
1526 // The load order: the filament library first, because the others'
1527 // filaments inherit from it, then every versioned vendor — each loaded
1528 // from the directory it was found in, so a vendor that is not installed
1529 // is served from the shipped profiles. Each is stamped by name and
1530 // version alone: a profile change requires a version bump, so those two
1531 // determine content wherever the vendor's copy sits.
1532 std::vector<PresetBundle::VendorSource> ordered;
1533 json stamps = json::array();
1534 auto add_vendor = [&ordered, &stamps](const std::string& name, const boost::filesystem::path& dir) {
1535 // The version a load from `dir` would serve: the profile's where one
1536 // exists (a cache is only served while it covers the profile beside
1537 // it), the cache's own stamp where the cache is the whole vendor.
1538 // A profile without a version (blacklist.json) carries no presets
1539 // and is passed over.
1540 const boost::filesystem::path profile = dir / (name + ".json");
1541 std::string version;
1542 if (boost::filesystem::exists(profile)) {
1543 const Semver v = get_version_from_json(profile.string());
1544 if (! v.valid())
1545 return;
1546 version = v.to_string();
1547 } else {
1548 version = VendorCacheFile::peek_version((dir / (name + ".opc")).string(), name);
1549 }
1550 ordered.push_back({name, dir});
1551 stamps.push_back({name, version});
1552 };
1553 const std::string filament_library(PresetBundle::ORCA_FILAMENT_LIBRARY);
1554 if (auto it = vendor_sources.find(filament_library); it != vendor_sources.end())
1555 add_vendor(filament_library, it->second);
1556 for (const auto& [name, dir] : vendor_sources)
1557 if (name != filament_library)
1558 add_vendor(name, dir);
1559 if (ordered.empty())
1560 return false;
1561
1562 // What this function derives is a pure function of that stamped set, so
1563 // the derived JSON is cached whole: a fresh cache makes an open one
1564 // file read, with no bundle built and no preset installed. Stale or
1565 // absent, the bundle is rebuilt below and the result written back.
1566 const boost::filesystem::path cache_file =
1567 boost::filesystem::path(Slic3r::data_dir()) / "cache" / "wizard_profile_data.json";
1568 try {
1569 // Slurped whole and parsed from the buffer — nlohmann's fastest
1570 // input path; a stream adapter costs real time on a multi-MB file.
1571 boost::nowide::ifstream ifs(cache_file.string(), std::ios::binary);
1572 if (ifs.is_open()) {
1573 const std::string text{std::istreambuf_iterator<char>(ifs), std::istreambuf_iterator<char>()};
1574 json cached = json::parse(text);
1575 if (cached.value("format", 0) == 1 && cached["vendors"] == stamps &&
1576 ! cached["profile"]["machine"].empty()) {
1577 for (const char* key : { "model", "machine", "filament", "process" })
1578 m_ProfileJson[key] = std::move(cached["profile"][key]);
1579 BOOST_LOG_TRIVIAL(info) << "GuideFrame: profile data served from " << cache_file;
1580 return true;
1581 }
1582 }
1583 } catch (const std::exception& e) {
1584 BOOST_LOG_TRIVIAL(info) << "GuideFrame: rejecting cached profile data: " << e.what();
1585 }
1586
1587 // Each vendor comes from its preset cache where one covers it, which is
1588 // what makes this worth doing instead of the scan below.
1589 PresetBundle bundle;
1590 std::vector<std::string> failed;
1591 const std::string errors = bundle.load_vendors(ordered, ForwardCompatibilitySubstitutionRule::EnableSilent,
1592 /*allow_cache=*/true, m_cancel_token.get(), &failed).second;
1593 if (*m_cancel_token || bundle.vendors.empty())
1594 return false;
1595 if (! errors.empty())
1596 BOOST_LOG_TRIVIAL(warning) << "GuideFrame: loading the vendors reported: " << errors;
1597 // A vendor that failed to load sends this open to the scan below, which lists
1598 // what it can read of every vendor.
1599 if (! failed.empty())
1600 return false;
1601 if (! BuildProfileJson(bundle, /*require_all_resource_vendors=*/false))
1602 return false;
1603
1604 // Written through a temp file and moved into place, as the preset caches
1605 // are: half a cache must never be readable.
1606 try {
1607 json out;
1608 out["format"] = 1;
1609 out["vendors"] = std::move(stamps);
1610 json& profile = out["profile"];
1611 for (const char* key : { "model", "machine", "filament", "process" })
1612 profile[key] = m_ProfileJson[key];
1613 boost::filesystem::create_directories(cache_file.parent_path());
1614 if (const std::error_code ec = write_file_atomically(cache_file.string(), out.dump(-1, ' ', false, json::error_handler_t::ignore), /*binary=*/true))
1615 throw std::runtime_error(ec.message());
1616 } catch (const std::exception& e) {
1617 BOOST_LOG_TRIVIAL(warning) << "GuideFrame: could not write the profile data cache: " << e.what();
1618 }
1619 return true;
1620 } catch (const std::exception& e) {
1621 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << " failed: " << e.what();
1623 return false;
1624 }
1625}
nlohmann::json json
Definition WebGuideDialog.hpp:62
boost::filesystem::path vendor_dir
Definition WebGuideDialog.hpp:141
void reset_profile_json()
Definition WebGuideDialog.cpp:414
boost::filesystem::path rsrc_vendor_dir
Definition WebGuideDialog.hpp:142
json m_ProfileJson
Definition WebGuideDialog.hpp:164
static const char * ORCA_FILAMENT_LIBRARY
Definition PresetBundle.hpp:690
static std::string peek_version(const std::string &path, const std::string &expected_vendor_name)
Definition PresetCacheFormat.cpp:530
@ EnableSilent
Definition Config.hpp:247
Semver get_version_from_json(std::string file_path)
Definition Preset.cpp:197
std::error_code write_file_atomically(const std::string &path, std::initializer_list< std::string_view > chunks, bool binary)
Definition utils.cpp:796
const std::string & data_dir()
Definition utils.cpp:365
std::set< std::string > vendor_names_in(const boost::filesystem::path &dir)
Definition utils.cpp:2005

References BuildProfileJson(), Slic3r::data_dir(), Slic3r::EnableSilent, Slic3r::get_version_from_json(), Slic3r::PresetBundle::load_vendors(), m_cancel_token, m_ProfileJson, Slic3r::PresetBundle::ORCA_FILAMENT_LIBRARY, Slic3r::VendorCacheFile::peek_version(), reset_profile_json(), rsrc_vendor_dir, Slic3r::Semver::to_string(), Slic3r::Semver::valid(), vendor_dir, Slic3r::vendor_names_in(), Slic3r::PresetBundle::vendors, and Slic3r::write_file_atomically().

Referenced by LoadProfileData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildProfileJson()

bool Slic3r::GUI::GuideFrame::BuildProfileJson ( const PresetBundle & bundle,
bool require_all_resource_vendors )
1386{
1387 try {
1388 // Models from vendor profiles
1389 for (const auto& [vendor_id, vp] : bundle.vendors) {
1390 for (const auto& model : vp.models) {
1391 std::string nozzle_str;
1392 for (const auto& v : model.variants) {
1393 if (!nozzle_str.empty()) nozzle_str += ";";
1394 nozzle_str += v.name;
1395 }
1396 const std::string materials_str = boost::algorithm::join(model.default_materials, ";");
1397 boost::filesystem::path cover_path =
1398 (boost::filesystem::path(resources_dir()) / "profiles" / vp.id / (model.id + "_cover.png"))
1399 .make_preferred();
1400 if (!boost::filesystem::exists(cover_path))
1401 cover_path =
1402 (boost::filesystem::path(resources_dir()) / "web/image/printer" / (model.id + "_cover.png"))
1403 .make_preferred();
1404
1405 json entry;
1406 entry["model"] = model.id;
1407 entry["name"] = model.name;
1408 entry["vendor"] = vp.id;
1409 entry["nozzle_diameter"] = nozzle_str;
1410 entry["materials"] = materials_str;
1411 entry["cover"] = into_u8(file_url_from_path(cover_path));
1412 entry["nozzle_selected"] = "";
1413 entry["sub_path"] = "";
1414 m_ProfileJson["model"].push_back(entry);
1415 }
1416 }
1417
1418 // Machine map: preset name -> {model, nozzle variant}
1419 for (const Preset& p : bundle.printers()) {
1420 if (!p.is_system || !p.vendor) continue;
1421 const auto* printer_model = p.config.option<ConfigOptionString>("printer_model");
1422 const auto* printer_variant = p.config.option<ConfigOptionString>("printer_variant");
1423 if (!printer_model || printer_model->value.empty() || !printer_variant) continue;
1424
1425 json mach;
1426 mach["model"] = printer_model->value;
1427 mach["nozzle"] = printer_variant->value;
1428 m_ProfileJson["machine"][p.name] = mach;
1429 }
1430
1431 // Filament map from system filament presets (vendor/type already resolved in config)
1432 const json& machines = m_ProfileJson["machine"];
1433 for (const Preset& p : bundle.filaments()) {
1434 if (!p.is_system || !p.vendor) continue;
1435 const auto* fila_vendor = p.config.option<ConfigOptionStrings>("filament_vendor");
1436 const auto* fila_type = p.config.option<ConfigOptionStrings>("filament_type");
1437 const auto* compat_printers = p.config.option<ConfigOptionStrings>("compatible_printers");
1438
1439 std::string vendor = (fila_vendor && !fila_vendor->values.empty()) ? fila_vendor->values[0] : "";
1440 std::string type = (fila_type && !fila_type->values.empty()) ? fila_type->values[0] : "";
1441
1442 std::string model_list;
1443 if (compat_printers) {
1444 for (const std::string& pname : compat_printers->values) {
1445 auto it = machines.find(pname);
1446 if (it != machines.end()) {
1447 const std::string m = (*it)["model"];
1448 const std::string n = (*it)["nozzle"];
1449 model_list += "[" + m + "++" + n + "]";
1450 }
1451 }
1452 }
1453
1454 json ff;
1455 ff["name"] = p.name;
1456 ff["sub_path"] = p.file;
1457 ff["vendor"] = vendor;
1458 ff["type"] = type;
1459 ff["models"] = model_list;
1460 ff["selected"] = 0;
1461 m_ProfileJson["filament"][p.name] = ff;
1462 }
1463
1464 // Process list from visible system print presets
1465 for (const Preset& p : bundle.prints()) {
1466 if (!p.is_system || !p.vendor || !p.is_visible) continue;
1467 json entry;
1468 entry["name"] = p.name;
1469 entry["sub_path"] = p.file;
1470 m_ProfileJson["process"].push_back(entry);
1471 }
1472
1473 if (require_all_resource_vendors) {
1474 // If rsrc_vendor_dir has vendors (profile JSONs, or the preset caches a
1475 // packaged build ships instead) not covered by the current bundle, the
1476 // bundle is incomplete (e.g. dev env where data_dir/system only has
1477 // OrcaFilamentLibrary+Custom). Fall back so the slow path reads both dirs.
1478 try {
1479 for (const std::string& name : vendor_names_in(rsrc_vendor_dir)) {
1480 if (bundle.vendors.find(name) == bundle.vendors.end()) {
1481 BOOST_LOG_TRIVIAL(info) << "GuideFrame: vendor '" << name
1482 << "' in resources but not in preset_bundle — falling back to JSON loading";
1484 return false;
1485 }
1486 }
1487 } catch (const std::exception&) {}
1488 }
1489
1490 BOOST_LOG_TRIVIAL(info) << "GuideFrame: built profile data ("
1491 << m_ProfileJson["model"].size() << " models, "
1492 << m_ProfileJson["machine"].size() << " machines, "
1493 << m_ProfileJson["filament"].size() << " filaments)";
1494 return !m_ProfileJson["machine"].empty();
1495 } catch (const std::exception& e) {
1496 BOOST_LOG_TRIVIAL(warning) << "GuideFrame::BuildProfileJson failed: " << e.what()
1497 << " — falling back to JSON loading";
1499 return false;
1500 }
1501}
wxString file_url_from_path(const boost::filesystem::path &path)
Definition GUI.cpp:569
std::string into_u8(const wxString &str)
Definition GUI.cpp:549
@ Preset
Definition calib.hpp:39
const std::string & resources_dir()
Definition utils.cpp:296
zaa_minimize_perimeter_height ConfigOptionString
Definition PrintConfig.hpp:1702

References Slic3r::PresetBundle::filaments, Slic3r::GUI::file_url_from_path(), Slic3r::GUI::into_u8(), m_ProfileJson, Slic3r::PresetBundle::printers, Slic3r::PresetBundle::prints, reset_profile_json(), Slic3r::resources_dir(), rsrc_vendor_dir, Slic3r::ConfigOptionSingle< T >::value, Slic3r::ConfigOptionVector< T >::values, Slic3r::vendor_names_in(), and Slic3r::PresetBundle::vendors.

Referenced by BuildProfileDataFromPresetBundle(), and BuildProfileDataFromVendors().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DownloadPlugin()

int Slic3r::GUI::GuideFrame::DownloadPlugin ( )
2030{
2031 return wxGetApp().download_plugin(
2032 "plugins", "network_plugin.zip",
2033 [this](int status, int percent, bool& cancel) {
2034 return ShowPluginStatus(status, percent, cancel);
2035 }
2036 , nullptr);
2037}
int ShowPluginStatus(int status, int percent, bool &cancel)
Definition WebGuideDialog.cpp:2048

References ShowPluginStatus().

Here is the call graph for this function:

◆ em_unit()

int Slic3r::GUI::DPIAware< wxDialog >::em_unit ( ) const
inlineinherited
203{ return m_em_unit; }
Definition GUI_Utils.hpp:107

Referenced by Slic3r::GUI::AuxiliaryDialog::AuxiliaryDialog(), Slic3r::GUI::CopyrightsDialog::CopyrightsDialog(), Slic3r::GUI::DesignTextDialog::DesignTextDialog(), Slic3r::GUI::EditGCodeDialog::EditGCodeDialog(), Slic3r::GUI::FileArchiveDialog::FileArchiveDialog(), Slic3r::GUI::MsgNoUpdates::MsgNoUpdates(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::OAuthDialog::OAuthDialog(), Slic3r::GUI::ParamsDialog::ParamsDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::SettingsDialog::SettingsDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), anonymous_namespace{3DPrinterOS.cpp}::UploadOptionsDialog::UploadOptionsDialog(), Slic3r::GUI::PublishSettingsDialog::add_row_ui(), Slic3r::GUI::DiffPresetDialog::complete_dialog_creation(), Slic3r::GUI::DiffPresetDialog::create_edit_sizer(), Slic3r::GUI::DiffPresetDialog::create_presets_sizer(), Slic3r::GUI::DiffPresetDialog::create_tree(), Slic3r::GUI::ElegooPrintHostSendDialog::init(), Slic3r::GUI::FlashforgePrintHostSendDialog::init(), Slic3r::GUI::PrintHostSendDialog::init(), Slic3r::GUI::AboutDialog::on_dpi_changed(), Slic3r::GUI::AuxiliaryDialog::on_dpi_changed(), Slic3r::GUI::BedShapeDialog::on_dpi_changed(), Slic3r::GUI::ConfigWizard::on_dpi_changed(), Slic3r::GUI::CopyrightsDialog::on_dpi_changed(), Slic3r::GUI::DiffPresetDialog::on_dpi_changed(), Slic3r::GUI::EditGCodeDialog::on_dpi_changed(), Slic3r::GUI::FileArchiveDialog::on_dpi_changed(), Slic3r::GUI::OAuthDialog::on_dpi_changed(), Slic3r::GUI::ObjectTableDialog::on_dpi_changed(), Slic3r::GUI::ParamsDialog::on_dpi_changed(), Slic3r::GUI::PhysicalPrinterDialog::on_dpi_changed(), Slic3r::GUI::PrintHostQueueDialog::on_dpi_changed(), Slic3r::GUI::PurgeModeDialog::on_dpi_changed(), Slic3r::GUI::SavePresetDialog::on_dpi_changed(), Slic3r::GUI::SendSystemInfoDialog::on_dpi_changed(), Slic3r::GUI::SettingsDialog::on_dpi_changed(), and Slic3r::GUI::UnsavedChangesDialog::on_dpi_changed().

Here is the caller graph for this function:

◆ enable_force_rescale()

void Slic3r::GUI::DPIAware< wxDialog >::enable_force_rescale ( )
inlineinherited
206{ m_force_rescale = true; }

◆ EndModal()

void Slic3r::GUI::DPIDialog::EndModal ( int retCode)
inlineoverrideinherited
306 {
307 if (!dialogStack.empty() && dialogStack.front() != this) {
308 // This is a bug in wxWidgets
309 // when the dialog is not top modal dialog, EndModal() just hide dialog without quit
310 // the modal event loop. And the modal event loop blocks us from bottom widgets.
311 // Solution: let user click it manually or close outside. FIXME
312 BOOST_LOG_TRIVIAL(warning) << "DPIAware::EndModal Error: dialogStack is not empty, but top dialog is not this one. retCode=" << retCode;
313 return;
314 }
315
316 return wxDialog::EndModal(retCode);
317 }
std::deque< wxDialog * > dialogStack
Definition GUI_Utils.cpp:549

References Slic3r::GUI::dialogStack.

Referenced by Slic3r::GUI::CloneDialog::CloneDialog(), Slic3r::GUI::ConfigWizard::ConfigWizard(), Slic3r::GUI::CreatePresetSuccessfulDialog::CreatePresetSuccessfulDialog(), Slic3r::GUI::DeleteConfirmDialog::DeleteConfirmDialog(), Slic3r::GUI::DesignVariableDialog::DesignVariableDialog(), Slic3r::GUI::anonymous_namespace{PrintHostDialogs.cpp}::FlashforgeSlotDialog::FlashforgeSlotDialog(), Slic3r::GUI::GuideFrame::GuideFrame(), Slic3r::GUI::InputIpAddressDialog::InputIpAddressDialog(), Slic3r::GUI::ManualNozzleCountDialog::ManualNozzleCountDialog(), Slic3r::GUI::MsgUpdateConfig::MsgUpdateConfig(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::MultiChoiceDialog::MultiChoiceDialog(), Slic3r::GUI::NetworkErrorDialog::NetworkErrorDialog(), Slic3r::GUI::NetworkPluginRestartDialog::NetworkPluginRestartDialog(), Slic3r::GUI::PartSkipConfirmDialog::PartSkipConfirmDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::PlateNameEditDialog::PlateNameEditDialog(), Slic3r::GUI::PlateSettingsDialog::PlateSettingsDialog(), Slic3r::GUI::PublishSettingsDialog::PublishSettingsDialog(), Slic3r::GUI::SelectMachineDialog::SelectMachineDialog(), Slic3r::GUI::SendFailedConfirm::SendFailedConfirm(), Slic3r::GUI::SendSystemInfoDialog::SendSystemInfoDialog(), Slic3r::GUI::ShortcutCaptureDialog::ShortcutCaptureDialog(), Slic3r::GUI::SingleChoiceDialog::SingleChoiceDialog(), StepMeshDialog::StepMeshDialog(), Slic3r::GUI::SyncAmsInfoDialog::SyncAmsInfoDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), Slic3r::GUI::UpdatePluginDialog::UpdatePluginDialog(), Slic3r::GUI::UpdateVersionDialog::UpdateVersionDialog(), Slic3r::GUI::wgtDeviceNozzleRackUpgradeDlg::wgtDeviceNozzleRackUpgradeDlg(), Slic3r::GUI::SavePresetDialog::accept(), Slic3r::GUI::MsgDialog::add_button(), Slic3r::GUI::TipsDialog::add_button(), Slic3r::GUI::FilamentPickerDialog::BindEvents(), Slic3r::GUI::PluginPickerDialog::build_capability_ui(), Slic3r::GUI::BedShapeDialog::build_dialog(), Slic3r::GUI::PluginPickerDialog::build_ui(), Slic3r::GUI::UnsavedChangesDialog::close(), Slic3r::GUI::FileArchiveDialog::create_btn_sizer(), Slic3r::GUI::ColorDecomposeDialog::create_button_panel(), Slic3r::GUI::MixedFilamentDialog::create_button_panel(), Slic3r::GUI::CreateFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::CreatePresetForPrinterDialog::create_dialog_buttons(), Slic3r::GUI::EditFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::create_dialog_buttons(), Slic3r::GUI::PreferencesDialog::create_item_language_combobox(), Slic3r::GUI::PreferencesDialog::create_item_region_combobox(), Slic3r::GUI::PreferencesDialog::create_items(), Slic3r::GUI::CreatePrinterPresetDialog::create_page1_dialog_buttons(), Slic3r::GUI::CreatePrinterPresetDialog::create_page2_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::data_init(), Slic3r::GUI::WebDialog::destroy_silently(), Slic3r::GUI::EditFilamentPresetDialog::edit_preset(), Slic3r::GUI::ConnectPrinterDialog::end_modal(), Slic3r::GUI::PrintHostSendDialog::EndModal(), Slic3r::GUI::ColorPickerDialog::finish(), Slic3r::GUI::WebDialog::finish(), Slic3r::GUI::Newer3mfVersionDialog::get_btn_sizer(), Slic3r::GUI::ScoreDialog::get_button_sizer(), Slic3r::GUI::WebViewHostDialog::handle_common_script_command(), Slic3r::GUI::ExportPresetBundleDialog::InitExportData(), Slic3r::GUI::SelectMachineDialog::navigate_to_timelapse_page(), Slic3r::GUI::BindMachineDialog::on_bind_success(), Slic3r::GUI::ConnectPrinterDialog::on_button_confirm(), Slic3r::GUI::RecenterDialog::on_button_confirm(), Slic3r::GUI::BindMachineDialog::on_cancel(), Slic3r::GUI::EditCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::InputIpAddressDialog::on_cancel(), Slic3r::GUI::NewCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::OAuthDialog::on_cancel(), Slic3r::GUI::PingCodeBindDialog::on_cancel(), Slic3r::GUI::SelectMachineDialog::on_cancel(), Slic3r::GUI::SendToPrinterDialog::on_cancel(), Slic3r::GUI::SyncAmsInfoDialog::on_cancel(), Slic3r::GUI::UnBindMachineDialog::on_cancel(), Slic3r::GUI::WebDialog::on_close_window(), Slic3r::GUI::NetworkPluginDownloadDialog::on_dont_ask(), Slic3r::GUI::NetworkPluginDownloadDialog::on_download(), Slic3r::GUI::EditDevNameDialog::on_edit_name(), Slic3r::GUI::ConfirmBeforeSendDialog::on_hide(), Slic3r::GUI::PrivacyUpdateDialog::on_hide(), Slic3r::GUI::ShortcutCaptureDialog::on_key(), Slic3r::GUI::TextureImportDialog::on_ok_clicked(), Slic3r::GUI::FileArchiveDialog::on_open_button(), Slic3r::GUI::NetworkPluginDownloadDialog::on_remind_later(), Slic3r::GUI::ProjectDropDialog::on_select_cancel(), Slic3r::GUI::SavePresetDialog::on_select_cancel(), Slic3r::GUI::ProjectDropDialog::on_select_ok(), Slic3r::GUI::SendMultiMachinePage::on_send(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip(), Slic3r::GUI::TextureImportDialog::on_skip_clicked(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip_version(), Slic3r::GUI::Cornering_Test_Dlg::on_start(), Slic3r::GUI::FlowRateCalibrationDialog::on_start(), Slic3r::GUI::Input_Shaping_Damp_Test_Dlg::on_start(), Slic3r::GUI::Input_Shaping_Freq_Test_Dlg::on_start(), Slic3r::GUI::MaxVolumetricSpeed_Test_Dlg::on_start(), Slic3r::GUI::PA_Calibration_Dlg::on_start(), Slic3r::GUI::Retraction_Test_Dlg::on_start(), Slic3r::GUI::Temp_Calibration_Dlg::on_start(), Slic3r::GUI::VFA_Test_Dlg::on_start(), Slic3r::GUI::CalibrationDialog::on_start_calibration(), Slic3r::GUI::UnBindMachineDialog::on_unbind_printer(), Slic3r::GUI::PartSkipDialog::OnApplyDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::OnCancel(), Slic3r::GUI::AboutDialog::onCloseDialog(), Slic3r::GUI::CopyrightsDialog::onCloseDialog(), Slic3r::GUI::MultiNozzleSyncDialog::OnRackStatusReadingFinished(), Slic3r::GUI::GuideFrame::OnScriptMessage(), Slic3r::GUI::InputIpAddressDialog::OnTimer(), Slic3r::GUI::KBShortcutsDialog::open_mouse_preferences(), Slic3r::GUI::TroubleshootDialog::PackAll(), Slic3r::GUI::TroubleshootDialog::RebuildSystemProfiles(), Slic3r::GUI::SpeedDialWebDialog::run_action(), Slic3r::GUI::OAuthDialog::Show(), Slic3r::GUI::MultiNozzleSyncDialog::UpdateButton(), and Slic3r::GUI::CreatePrinterPresetDialog::validate_input_valid().

◆ force_rescale()

bool Slic3r::GUI::DPIAware< wxDialog >::force_rescale ( ) const
inlineinherited
201{ return m_force_rescale; }

◆ GetFilamentInfo() [1/2]

int Slic3r::GUI::GuideFrame::GetFilamentInfo ( const std::string & VendorDirectory,
json & pFilaList,
const std::string & filepath,
std::string & sVendor,
std::string & sType,
std::unordered_set< std::string > & visiting )
private
1294{
1295 //GetStardardFilePath(filepath);
1296 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " GetFilamentInfo:VendorDirectory - " << VendorDirectory << ", Filepath - "<<filepath;
1297
1298 // Path-scoped guard: without it an `inherits` cycle would recurse forever.
1299 // The repeated file was not inserted, so the cycle hit has nothing to erase.
1300 if (!visiting.insert(filepath).second) {
1301 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " inherits cycle at " << filepath;
1302 return -1;
1303 }
1304
1305 // Resolve this file's own vendor/type into LOCAL variables, independent of
1306 // whatever the caller already accumulated. The cache entry for `filepath`
1307 // must reflect only this file's own inherits chain — passing the caller's
1308 // in/out sVendor/sType down would poison a shared base file's cache with the
1309 // type of whichever descendant happened to traverse it first (e.g. an ABS
1310 // preset reaching fdm_filament_common before a PLA one, making every PLA that
1311 // later reuses the cached base resolve to "ABS"). Merge into the caller's
1312 // out-params only at the end, filling empties.
1313 std::string vendor;
1314 std::string type;
1315 int status = 0;
1316
1317 const auto cache_it = filament_info_cache.find(filepath);
1318 if (cache_it != filament_info_cache.end()) {
1319 vendor = cache_it->second.vendor;
1320 type = cache_it->second.type;
1321 status = cache_it->second.status;
1322 } else {
1323 try {
1324 std::string contents;
1325 LoadFile(filepath, contents);
1326 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": Json Contents: " << contents;
1327 json jLocal = json::parse(contents);
1328
1329 if (jLocal.contains("filament_vendor"))
1330 vendor = jLocal["filament_vendor"][0];
1331 else
1332 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << filepath << " - Not Contains filament_vendor";
1333
1334 if (jLocal.contains("filament_type"))
1335 type = jLocal["filament_type"][0];
1336 else
1337 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << filepath << " - Not Contains filament_type";
1338
1339 if (jLocal.contains("inherits")) {
1340 std::string FName = jLocal["inherits"];
1341
1342 if (!pFilaList.contains(FName)) {
1343 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "pFilaList - Not Contains inherits filaments: " << FName;
1344 status = -1;
1345 } else {
1346 std::string FPath = pFilaList[FName]["sub_path"];
1347 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " Before Format Inherits Path: VendorDirectory - " << VendorDirectory << ", sub_path - " << FPath;
1348 wxString strNewFile = wxString::Format("%s%c%s", wxString(VendorDirectory.c_str(), wxConvUTF8), boost::filesystem::path::preferred_separator, FPath);
1349 boost::filesystem::path inherits_path(w2s(strNewFile));
1350 if (!boost::filesystem::exists(inherits_path))
1351 inherits_path = (boost::filesystem::path(m_OrcaFilaLibPath) / boost::filesystem::path(FPath)).make_preferred();
1352
1353 if (boost::filesystem::exists(inherits_path)) {
1354 // Traverse the full chain for errors; inherited values only fill local gaps.
1355 status = GetFilamentInfo(VendorDirectory, pFilaList, inherits_path.string(), vendor, type, visiting);
1356 } else {
1357 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " inherits File Not Exist: " << inherits_path;
1358 status = -1;
1359 }
1360 }
1361 } else {
1362 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << filepath << " - Not Contains inherits";
1363 status = 0;
1364 }
1365 }
1366 catch (nlohmann::detail::parse_error &err) {
1367 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": parse " << filepath << " got a nlohmann::detail::parse_error, reason = " << err.what();
1368 status = -1;
1369 }
1370 catch (std::exception &e) {
1371 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": parse " << filepath << " got exception: " << e.what();
1372 status = -1;
1373 }
1374
1375 filament_info_cache[filepath] = CachedFilamentInfo{status, vendor, type};
1376 }
1377
1378 // Merge this file's resolved values into the caller's out-params (fill empties only).
1379 if (sVendor.empty()) sVendor = vendor;
1380 if (sType.empty()) sType = type;
1381 visiting.erase(filepath);
1382 return status;
1383}
std::string m_OrcaFilaLibPath
Definition WebGuideDialog.hpp:166
int GetFilamentInfo(std::string VendorDirectory, json &pFilaList, std::string filepath, std::string &sVendor, std::string &sType)
Definition WebGuideDialog.cpp:1285
bool LoadFile(std::string jPath, std::string &sContent)
Definition WebGuideDialog.cpp:2011
std::string w2s(wxString sSrc)
Definition WebGuideDialog.cpp:2001
std::unordered_map< std::string, CachedFilamentInfo > filament_info_cache
Definition WebGuideDialog.hpp:186
Definition WebGuideDialog.hpp:181

References filament_info_cache, GetFilamentInfo(), LoadFile(), m_OrcaFilaLibPath, and w2s().

Here is the call graph for this function:

◆ GetFilamentInfo() [2/2]

int Slic3r::GUI::GuideFrame::GetFilamentInfo ( std::string VendorDirectory,
json & pFilaList,
std::string filepath,
std::string & sVendor,
std::string & sType )
1286{
1287 std::unordered_set<std::string> visiting;
1288 return GetFilamentInfo(VendorDirectory, pFilaList, filepath, sVendor, sType, visiting);
1289}

References GetFilamentInfo().

Referenced by GetFilamentInfo(), GetFilamentInfo(), and LoadProfileFamily().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetStardardFilePath()

void Slic3r::GUI::GuideFrame::GetStardardFilePath ( std::string & FilePath)
2006 {
2007 StrReplace(FilePath, "\\", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
2008 StrReplace(FilePath, "/" , w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
2009}
void StrReplace(std::string &strBase, std::string strSrc, std::string strDes)
Definition WebGuideDialog.cpp:1989

References StrReplace(), and w2s().

Here is the call graph for this function:

◆ init_guide_paths()

void Slic3r::GUI::GuideFrame::init_guide_paths ( )
423{
424 m_ProfileJson = json::parse("{}");
426
427 vendor_dir = (boost::filesystem::path(Slic3r::data_dir()) / PRESET_SYSTEM_DIR).make_preferred();
428 rsrc_vendor_dir = (boost::filesystem::path(resources_dir()) / "profiles").make_preferred();
429 orca_bundle_rsrc = true;
430
431 if (boost::filesystem::exists(vendor_dir)) {
432 for (const auto& entry : boost::filesystem::directory_iterator(vendor_dir)) {
433 if (!boost::filesystem::is_directory(entry) &&
434 boost::iequals(entry.path().extension().string(), ".json") &&
435 !boost::iequals(entry.path().stem().string(), PresetBundle::ORCA_FILAMENT_LIBRARY)) {
436 orca_bundle_rsrc = false;
437 break;
438 }
439 }
440 }
441
442 auto lib_json = boost::filesystem::path(PresetBundle::ORCA_FILAMENT_LIBRARY).replace_extension(".json");
443 m_OrcaFilaLibPath = boost::filesystem::exists(vendor_dir / lib_json)
446}
#define PRESET_SYSTEM_DIR
Definition Preset.hpp:31
bool orca_bundle_rsrc
Definition WebGuideDialog.hpp:140

References Slic3r::data_dir(), m_OrcaFilaLibPath, m_ProfileJson, orca_bundle_rsrc, Slic3r::PresetBundle::ORCA_FILAMENT_LIBRARY, PRESET_SYSTEM_DIR, reset_profile_json(), Slic3r::resources_dir(), rsrc_vendor_dir, and vendor_dir.

Referenced by OnNavigationComplete().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InstallPlugin()

int Slic3r::GUI::GuideFrame::InstallPlugin ( )
2040{
2041 return wxGetApp().install_plugin("plugins", "network_plugin.zip",
2042 [this](int status, int percent, bool &cancel) {
2043 return ShowPluginStatus(status, percent, cancel);
2044 }
2045 );
2046}

References ShowPluginStatus().

Here is the call graph for this function:

◆ is_new_scale_factor()

bool Slic3r::GUI::DPIAware< wxDialog >::is_new_scale_factor ( ) const
inlineprivateinherited
262{ return fabs(m_scale_factor - m_prev_scale_factor) > 0.001; }

◆ IsFirstUse()

bool Slic3r::GUI::GuideFrame::IsFirstUse ( )
898{
899 wxString strUse;
900 std::string strVal = wxGetApp().app_config->get(std::string(m_SectionName.mb_str()), "finish");
901 if (strVal == "1")
902 return false;
903
904 if (orca_bundle_rsrc == true)
905 return true;
906
907 return true;
908}

References m_SectionName, and orca_bundle_rsrc.

◆ load_url()

void Slic3r::GUI::GuideFrame::load_url ( wxString & url)
315{
316 BOOST_LOG_TRIVIAL(trace) << __FUNCTION__<< " enter, url=" << url.ToStdString();
318 m_browser->SetFocus();
319 UpdateState();
320
321 BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< " exit";
322}
void UpdateState()
Definition WebGuideDialog.cpp:379
static void LoadUrl(wxWebView *webView, wxString const &url)
Definition WebView.cpp:480
void trace(unsigned int level, const char *message)
Definition utils.cpp:247

References WebView::LoadUrl(), m_browser, Slic3r::trace(), and UpdateState().

Referenced by SetStartPage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadFile()

bool Slic3r::GUI::GuideFrame::LoadFile ( std::string jPath,
std::string & sContent )
2012{
2013 try {
2014 boost::nowide::ifstream t(jPath);
2015 std::stringstream buffer;
2016 buffer << t.rdbuf();
2017 sContent=buffer.str();
2018 BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << boost::format(", load %1% into buffer")% jPath;
2019 }
2020 catch (std::exception &e)
2021 {
2022 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ", got exception: "<<e.what();
2023 return false;
2024 }
2025
2026 return true;
2027}

References Slic3r::trace().

Referenced by GetFilamentInfo(), and LoadProfileFamily().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadProfileData()

int Slic3r::GUI::GuideFrame::LoadProfileData ( )
1628{
1629 // Background thread: the fast path in OnNavigationComplete failed (presets not yet loaded).
1630 // Loading order (fastest to slowest):
1631 // 1. Load every vendor, from its preset cache wherever one covers it
1632 // 2. Read all vendor JSONs by hand
1633 try {
1635 // Last resort — read all vendor JSONs
1636 std::set<std::string> loaded_vendors;
1637 auto filament_library_name = boost::filesystem::path(PresetBundle::ORCA_FILAMENT_LIBRARY).replace_extension(".json");
1638 if (boost::filesystem::exists(vendor_dir / filament_library_name))
1639 LoadProfileFamily(PresetBundle::ORCA_FILAMENT_LIBRARY, (vendor_dir / filament_library_name).string());
1640 else
1641 LoadProfileFamily(PresetBundle::ORCA_FILAMENT_LIBRARY, (rsrc_vendor_dir / filament_library_name).string());
1642 loaded_vendors.insert(PresetBundle::ORCA_FILAMENT_LIBRARY);
1643
1644 boost::filesystem::directory_iterator endIter;
1645 for (boost::filesystem::directory_iterator iter(vendor_dir); iter != endIter; iter++) {
1646 if (!boost::filesystem::is_directory(*iter)) {
1647 wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
1648 strVendor = strVendor.AfterLast('\\');
1649 strVendor = strVendor.AfterLast('/');
1650 wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
1651 if (strExtension.CmpNoCase("json") != 0 || loaded_vendors.find(w2s(strVendor)) != loaded_vendors.end())
1652 continue;
1653 LoadProfileFamily(w2s(strVendor), iter->path().string());
1654 loaded_vendors.insert(w2s(strVendor));
1655 }
1656 if (*m_cancel_token) return 0;
1657 }
1658
1659 boost::filesystem::directory_iterator others_endIter;
1660 for (boost::filesystem::directory_iterator iter(rsrc_vendor_dir); iter != others_endIter; iter++) {
1661 if (!boost::filesystem::is_directory(*iter)) {
1662 wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
1663 strVendor = strVendor.AfterLast('\\');
1664 strVendor = strVendor.AfterLast('/');
1665 wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
1666 if (strExtension.CmpNoCase("json") != 0 || loaded_vendors.find(w2s(strVendor)) != loaded_vendors.end())
1667 continue;
1668 LoadProfileFamily(w2s(strVendor), iter->path().string());
1669 loaded_vendors.insert(w2s(strVendor));
1670 }
1671 if (*m_cancel_token) return 0;
1672 }
1673 }
1674
1675 // Capture the cancel token by value (shared_ptr) so the lambda doesn't
1676 // touch `this` if GuideFrame is destroyed before the event fires.
1677 auto tok = m_cancel_token;
1678 wxGetApp().CallAfter([this, tok] {
1679 if (!*tok)
1681 });
1682 } catch (const std::exception& e) {
1683 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ", error: " << e.what();
1684 }
1685
1686 filament_info_cache.clear();
1687 return 0;
1688}
bool BuildProfileDataFromVendors()
Definition WebGuideDialog.cpp:1511
void on_profile_loaded()
Definition WebGuideDialog.cpp:448
int LoadProfileFamily(std::string strVendor, std::string strFilePath)
Definition WebGuideDialog.cpp:1781
wxString from_u8(const std::string &str)
Definition GUI.cpp:544

References BuildProfileDataFromVendors(), filament_info_cache, Slic3r::GUI::from_u8(), LoadProfileFamily(), m_cancel_token, on_profile_loaded(), Slic3r::PresetBundle::ORCA_FILAMENT_LIBRARY, rsrc_vendor_dir, vendor_dir, and w2s().

Referenced by OnNavigationComplete().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadProfileFamily()

int Slic3r::GUI::GuideFrame::LoadProfileFamily ( std::string strVendor,
std::string strFilePath )
1782{
1783 // wxString strFolder = strFilePath.BeforeLast(boost::filesystem::path::preferred_separator);
1784 boost::filesystem::path file_path(strFilePath);
1785 boost::filesystem::path vendor_dir = boost::filesystem::absolute(file_path.parent_path() / strVendor).make_preferred();
1786 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", vendor path %1%.") % vendor_dir.string();
1787 try {
1788 // wxLogMessage("GUIDE: json_path1 %s", w2s(strFilePath));
1789
1790 std::string contents;
1791 LoadFile(strFilePath, contents);
1792 // wxLogMessage("GUIDE: json_path1 content: %s", contents);
1793 json jLocal = json::parse(contents);
1794 // wxLogMessage("GUIDE: json_path1 Loaded");
1795
1796 // BBS:models
1797 json pmodels = jLocal["machine_model_list"];
1798 int nsize = pmodels.size();
1799
1800 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", got %1% machine models") % nsize;
1801
1802 for (int n = 0; n < nsize; n++) {
1803 json OneModel = pmodels.at(n);
1804
1805 OneModel["model"] = OneModel["name"];
1806 OneModel.erase("name");
1807
1808 std::string s1 = OneModel["model"];
1809 std::string s2 = OneModel["sub_path"];
1810
1811 boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred();
1812 if (!boost::filesystem::exists(sub_path)) continue;
1813
1814 std::string sub_file = sub_path.string();
1815
1816 // wxLogMessage("GUIDE: json_path2 %s", w2s(ModelFilePath));
1817 LoadFile(sub_file, contents);
1818 // wxLogMessage("GUIDE: json_path2 content: %s", contents);
1819 json pm = json::parse(contents);
1820 // wxLogMessage("GUIDE: json_path2 loaded");
1821
1822 OneModel["name"] = pm["name"];
1823 OneModel["vendor"] = strVendor;
1824 std::string NozzleOpt = pm["nozzle_diameter"];
1825 StringReplace(NozzleOpt, " ", "");
1826 OneModel["nozzle_diameter"] = NozzleOpt;
1827 OneModel["materials"] = pm["default_materials"];
1828
1829 // wxString strCoverPath = wxString::Format("%s\\%s\\%s_cover.png", strFolder, strVendor, std::string(s1.mb_str()));
1830 std::string cover_file = s1 + "_cover.png";
1831 boost::filesystem::path cover_path = boost::filesystem::absolute(vendor_dir / cover_file).make_preferred();
1832 BOOST_LOG_TRIVIAL(info) << "[WebGuideDialog] " << cover_path;
1833 if (!boost::filesystem::exists(cover_path)) {
1834 cover_path = boost::filesystem::absolute(boost::filesystem::path(resources_dir()) / "/profiles/" / strVendor / cover_file)
1835 .make_preferred();
1836 if (!boost::filesystem::exists(cover_path))
1837 cover_path = (boost::filesystem::absolute(boost::filesystem::path(resources_dir()) / "/web/image/printer/") / cover_file)
1838 .make_preferred();
1839 }
1840 OneModel["cover"] = into_u8(file_url_from_path(cover_path));
1841
1842 OneModel["nozzle_selected"] = "";
1843
1844 m_ProfileJson["model"].push_back(OneModel);
1845 }
1846
1847 // BBS:Machine
1848 json pmachine = jLocal["machine_list"];
1849 nsize = pmachine.size();
1850 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", got %1% machines") % nsize;
1851 for (int n = 0; n < nsize; n++) {
1852 json OneMachine = pmachine.at(n);
1853
1854 std::string s1 = OneMachine["name"];
1855 std::string s2 = OneMachine["sub_path"];
1856
1857 // wxString ModelFilePath = wxString::Format("%s\\%s\\%s", strFolder, strVendor, s2);
1858 boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred();
1859 if (!boost::filesystem::exists(sub_path)) continue;
1860
1861 std::string sub_file = sub_path.string();
1862 LoadFile(sub_file, contents);
1863 json pm = json::parse(contents);
1864
1865 std::string strInstant = pm["instantiation"];
1866 if (strInstant.compare("true") == 0) {
1867 OneMachine["model"] = pm["printer_model"];
1868 OneMachine["nozzle"] = pm["nozzle_diameter"][0];
1869
1870 m_ProfileJson["machine"][s1]=OneMachine;
1871 }
1872 }
1873
1874 // BBS:Filament
1875 json pFilament = jLocal["filament_list"];
1876 json tFilaList = m_OrcaFilaList;
1877 nsize = pFilament.size();
1878
1879 for (int n = 0; n < nsize; n++) {
1880 json OneFF = pFilament.at(n);
1881
1882 std::string s1 = OneFF["name"];
1883 std::string s2 = OneFF["sub_path"];
1884
1885 tFilaList[s1] = OneFF;
1886 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "Vendor: " << strVendor <<", tFilaList Add: " << s1;
1887 }
1888
1889 int nFalse = 0;
1890 int nModel = 0;
1891 int nFinish = 0;
1892 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", got %1% filaments") % nsize;
1893 for (int n = 0; n < nsize; n++) {
1894 json OneFF = pFilament.at(n);
1895
1896 std::string s1 = OneFF["name"];
1897 std::string s2 = OneFF["sub_path"];
1898
1899 if (!m_ProfileJson["filament"].contains(s1)) {
1900 // wxString ModelFilePath = wxString::Format("%s\\%s\\%s", strFolder, strVendor, s2);
1901 boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred();
1902 if (!boost::filesystem::exists(sub_path)) continue;
1903
1904 std::string sub_file = sub_path.string();
1905 LoadFile(sub_file, contents);
1906 json pm = json::parse(contents);
1907
1908 std::string strInstant = pm["instantiation"];
1909 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "Load Filament:" << s1 << ",Path:" << sub_file << ",instantiation?" << strInstant;
1910
1911 if (strInstant == "true") {
1912 std::string sV;
1913 std::string sT;
1914
1915 int nRet = GetFilamentInfo(vendor_dir.string(),tFilaList, sub_file, sV, sT);
1916 if (nRet != 0 || sV.empty() || sT.empty()) {
1917 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "Load Filament:" << s1 << ",unresolved vendor/type, Vendor:" << sV << ",Type:"<< sT;
1918 continue;
1919 }
1920
1921 OneFF["vendor"] = sV;
1922 OneFF["type"] = sT;
1923
1924 OneFF["models"] = "";
1925
1926 json pPrinters = pm["compatible_printers"];
1927 int nPrinter = pPrinters.size();
1928 std::string ModelList = "";
1929 for (int i = 0; i < nPrinter; i++)
1930 {
1931 std::string sP = pPrinters.at(i);
1932 if (m_ProfileJson["machine"].contains(sP))
1933 {
1934 std::string mModel = m_ProfileJson["machine"][sP]["model"];
1935 std::string mNozzle = m_ProfileJson["machine"][sP]["nozzle"];
1936 std::string NewModel = mModel + "++" + mNozzle;
1937
1938 ModelList = (boost::format("%1%[%2%]") % ModelList % NewModel).str();
1939 }
1940 }
1941
1942 OneFF["models"] = ModelList;
1943 OneFF["selected"] = 0;
1944
1945 m_ProfileJson["filament"][s1] = OneFF;
1946 } else
1947 continue;
1948
1949 }
1950 }
1952 m_OrcaFilaList = tFilaList;
1953
1954 // process
1955 json pProcess = jLocal["process_list"];
1956 nsize = pProcess.size();
1957 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", got %1% processes") % nsize;
1958 for (int n = 0; n < nsize; n++) {
1959 json OneProcess = pProcess.at(n);
1960
1961 std::string s2 = OneProcess["sub_path"];
1962 // wxString ModelFilePath = wxString::Format("%s\\%s\\%s", strFolder, strVendor, s2);
1963 boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred();
1964 if (!boost::filesystem::exists(sub_path)) continue;
1965
1966 std::string sub_file = sub_path.string();
1967 LoadFile(sub_file, contents);
1968 json pm = json::parse(contents);
1969
1970 std::string bInstall = pm["instantiation"];
1971 if (bInstall == "true") { m_ProfileJson["process"].push_back(OneProcess); }
1972 }
1973
1974 } catch (nlohmann::detail::parse_error &err) {
1975 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": parse " << strFilePath << " got a nlohmann::detail::parse_error, reason = " << err.what();
1976 return -1;
1977 } catch (std::exception &e) {
1978 // wxMessageBox(e.what(), "", MB_OK);
1979 // wxLogMessage("GUIDE: LoadFamily Error: %s", e.what());
1980 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": parse " << strFilePath << " got exception: " << e.what();
1981 return -1;
1982 }
1983
1984 return 0;
1985}
json m_OrcaFilaList
Definition WebGuideDialog.hpp:165
void StringReplace(std::string &strBase, std::string strSrc, std::string strDes)
Definition WebGuideDialog.cpp:1768
bool contains(const std::vector< T > &vector, const Point &point)
Definition Geometry.cpp:55

References Slic3r::Geometry::contains(), Slic3r::GUI::file_url_from_path(), GetFilamentInfo(), Slic3r::GUI::into_u8(), LoadFile(), m_OrcaFilaList, m_ProfileJson, Slic3r::PresetBundle::ORCA_FILAMENT_LIBRARY, Slic3r::resources_dir(), Slic3r::GUI::StringReplace(), and vendor_dir.

Referenced by LoadProfileData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normal_font()

◆ notify_profile_loaded()

void Slic3r::GUI::GuideFrame::notify_profile_loaded ( )
461{
463 return;
464 json res;
465 res["command"] = "userguide_profile_load_finish";
466 res["sequence_id"] = "10001";
467 RunScript(wxString::Format("HandleStudio(%s)", res.dump(-1, ' ', true)));
468}
void RunScript(const wxString &javascript)
Definition WebGuideDialog.cpp:823
bool m_page_ready
Definition WebGuideDialog.hpp:149
bool m_profile_ready
Definition WebGuideDialog.hpp:148

References m_page_ready, m_profile_ready, and RunScript().

Referenced by on_profile_loaded(), and OnScriptMessage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_dpi_changed()

void Slic3r::GUI::GuideFrame::on_dpi_changed ( const wxRect & suggested_rect)
inlinevirtual

◆ on_profile_loaded()

void Slic3r::GUI::GuideFrame::on_profile_loaded ( )
449{
450 // Must be called on the main thread.
452 const std::string strAll = m_ProfileJson.dump(-1, ' ', false, json::error_handler_t::ignore);
453 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", finished, json contents:\n" << strAll;
454 m_profile_ready = true;
456}
int SaveProfileData()
Definition WebGuideDialog.cpp:1690
void notify_profile_loaded()
Definition WebGuideDialog.cpp:460

References m_profile_ready, m_ProfileJson, notify_profile_loaded(), and SaveProfileData().

Referenced by LoadProfileData(), and OnNavigationComplete().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_sys_color_changed()

◆ OnDocumentLoaded()

void Slic3r::GUI::GuideFrame::OnDocumentLoaded ( wxWebViewEvent & evt)

Callback invoked when a page is finished loading

502{
503 // Only notify if the document is the main frame, not a subframe
504 wxString tmpUrl = evt.GetURL();
505 wxString NowUrl = m_browser->GetCurrentURL();
506
507 if (evt.GetURL() == m_browser->GetCurrentURL()) {
508 // wxLogMessage("%s", "Document loaded; url='" + evt.GetURL() + "'");
509 }
510 UpdateState();
511
512 // wxCommandEvent *event = new
513 // wxCommandEvent(EVT_WEB_RESPONSE_MESSAGE,this->GetId()); wxQueueEvent(this,
514 // event);
515}

References m_browser, and UpdateState().

Referenced by GuideFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnError()

void Slic3r::GUI::GuideFrame::OnError ( wxWebViewEvent & evt)

Callback invoked when a loading error occurs

866{
867#define WX_ERROR_CASE(type) \
868 case type: category = #type; break;
869
870 wxString category;
871 switch (evt.GetInt()) {
872 WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_CONNECTION);
873 WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_CERTIFICATE);
874 WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_AUTH);
875 WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_SECURITY);
876 WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_NOT_FOUND);
877 WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_REQUEST);
878 WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_USER_CANCELLED);
879 WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_OTHER);
880 }
881
882 // wxLogMessage("%s", "Error; url='" + evt.GetURL() + "', error='" +
883 // category + " (" + evt.GetString() + ")'");
884
885 // Show the info bar with an error
886 // m_info->ShowMessage(_L("An error occurred loading ") + evt.GetURL() +
887 // "\n" + "'" + category + "'", wxICON_ERROR);
888 BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnError: An error occurred loading " << evt.GetURL() << category;
889
890 UpdateState();
891}
#define WX_ERROR_CASE(type)

References Slic3r::trace(), UpdateState(), and WX_ERROR_CASE.

Referenced by GuideFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnFullScreenChanged()

void Slic3r::GUI::GuideFrame::OnFullScreenChanged ( wxWebViewEvent & evt)
544{
545 // wxLogMessage("Full screen changed; status = %d", evt.GetInt());
546 ShowFullScreen(evt.GetInt() != 0);
547}

Referenced by GuideFrame().

Here is the caller graph for this function:

◆ OnIdle()

void Slic3r::GUI::GuideFrame::OnIdle ( wxIdleEvent & evt)
385{
386 if (m_browser->IsBusy()) {
387 wxSetCursor(wxCURSOR_ARROWWAIT);
388 } else {
389 wxSetCursor(wxNullCursor);
390 }
391}

References m_browser.

◆ OnNavigationComplete()

void Slic3r::GUI::GuideFrame::OnNavigationComplete ( wxWebViewEvent & evt)
471{
472 //wxLogMessage("%s", "Navigation complete; url='" + evt.GetURL() + "'");
473 if (!bFirstComplete) {
474 bFirstComplete = true;
475 try {
478 if (!*m_cancel_token)
480 } else {
481 // Presets not yet in memory — delegate to background thread.
482 m_load_task = std::make_unique<boost::thread>(boost::bind(&GuideFrame::LoadProfileData, this));
483 }
484 } catch (const std::exception& e) {
485 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ", init error: " << e.what();
486 m_load_task = std::make_unique<boost::thread>(boost::bind(&GuideFrame::LoadProfileData, this));
487 }
488 }
489
490 m_browser->Show();
491 Layout();
492
493 wxString NewUrl = evt.GetURL();
494
495 UpdateState();
496}
bool BuildProfileDataFromPresetBundle()
Definition WebGuideDialog.cpp:1503
void init_guide_paths()
Definition WebGuideDialog.cpp:422
int LoadProfileData()
Definition WebGuideDialog.cpp:1627
bool bFirstComplete
Definition WebGuideDialog.hpp:145

References bFirstComplete, BuildProfileDataFromPresetBundle(), init_guide_paths(), LoadProfileData(), m_browser, m_cancel_token, m_load_task, on_profile_loaded(), and UpdateState().

Referenced by GuideFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnNavigationRequest()

void Slic3r::GUI::GuideFrame::OnNavigationRequest ( wxWebViewEvent & evt)

Callback invoked when there is a request to load a new page (for instance when the user clicks a link)

403{
404 // wxLogMessage("%s", "Navigation request to '" + evt.GetURL() + "'
405 // (target='" + evt.GetTarget() + "')");
406
407 UpdateState();
408}

References UpdateState().

Referenced by GuideFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnNewWindow()

void Slic3r::GUI::GuideFrame::OnNewWindow ( wxWebViewEvent & evt)

On new window, we veto to stop extra windows appearing

521{
522 wxString flag = " (other)";
523
524 wxString NewUrl= evt.GetURL();
525 wxLaunchDefaultBrowser(NewUrl);
526 //if (evt.GetNavigationAction() == wxWEBVIEW_NAV_ACTION_USER) { flag = " (user)"; }
527 // wxLogMessage("%s", "New window; url='" + evt.GetURL() + "'" + flag);
528
529 // If we handle new window events then just load them in this window as we
530 // are a single window browser
531 // if (m_tools_handle_new_window->IsChecked())
532 // m_browser->LoadURL(evt.GetURL());
533
534 UpdateState();
535}

References UpdateState().

Referenced by GuideFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnScriptMessage()

void Slic3r::GUI::GuideFrame::OnScriptMessage ( wxWebViewEvent & evt)
550{
551 try {
552 wxString strInput = evt.GetString();
553 BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnScriptMessage;OnRecv:" << strInput.c_str();
554 json j = json::parse(strInput.utf8_string());
555
556 wxString strCmd = j["command"];
557 BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnScriptMessage;Command:" << strCmd;
558
559 if (strCmd == "userguide_loading_page_ready") {
560 m_page_ready = true;
562 }
563 else if (strCmd == "close_page") {
564 this->EndModal(wxID_CANCEL);
565 }
566 if (strCmd == "user_clause") {
567 wxString strAction = j["data"]["action"];
568
569 if (strAction == "refuse") {
570 // CloseTheApp
571 this->EndModal(wxID_OK);
572
573 m_MainPtr->mainframe->Close(); // Refuse Clause, App quit immediately
574 }
575 } else if (strCmd == "user_private_choice") {
576 wxString strAction = j["data"]["action"];
577
578 if (strAction == "agree") {
579 PrivacyUse = true;
580 } else {
581 PrivacyUse = false;
582 }
583 }
584 else if (strCmd == "request_userguide_profile") {
585 json m_Res = json::object();
586 m_Res["command"] = "response_userguide_profile";
587 m_Res["sequence_id"] = "10001";
588 m_Res["response"] = m_ProfileJson;
589
590 //wxString strJS = wxString::Format("HandleStudio(%s)", m_Res.dump(-1, ' ', false, json::error_handler_t::ignore));
591 wxString strJS = wxString::Format("HandleStudio(%s)", m_Res.dump(-1, ' ', true));
592
593 BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnScriptMessage;request_userguide_profile:" << strJS.c_str();
594 wxGetApp().CallAfter([this,strJS] { RunScript(strJS); });
595 }
596 else if (strCmd == "request_custom_filaments") {
597 wxString strJS = update_custom_filaments();
598 wxGetApp().CallAfter([this, strJS] { RunScript(strJS); });
599 }
600 else if (strCmd == "create_custom_filament") {
601 this->EndModal(wxID_OK);
602 wxQueueEvent(wxGetApp().plater(), new SimpleEvent(EVT_CREATE_FILAMENT));
603 } else if (strCmd == "modify_custom_filament") {
604 m_editing_filament_id = j["id"];
605 this->EndModal(wxID_EDIT);
606 }
607 else if (strCmd == "save_userguide_models")
608 {
609 json MSelected = j["data"];
610
611 int nModel = m_ProfileJson["model"].size();
612 for (int m = 0; m < nModel; m++) {
613 json TmpModel = m_ProfileJson["model"][m];
614 m_ProfileJson["model"][m]["nozzle_selected"] = "";
615
616 for (auto it = MSelected.begin(); it != MSelected.end(); ++it) {
617 json OneSelect = it.value();
618
619 wxString s1 = TmpModel["model"];
620 wxString s2 = OneSelect["model"];
621 if (s1.compare(s2) == 0) {
622 m_ProfileJson["model"][m]["nozzle_selected"] = m_ProfileJson["model"][m]["nozzle_diameter"];
623
624 // Automatically select default materials for this printer model
625 // This mirrors the behavior of the old ConfigWizard::select_default_materials_for_printer_model()
626 if (TmpModel.contains("materials") && !TmpModel["materials"].is_null()) {
627 std::string materials_str;
628
629 // Handle both string and JSON array formats for materials
630 if (TmpModel["materials"].is_string()) {
631 materials_str = TmpModel["materials"].get<std::string>();
632 } else if (TmpModel["materials"].is_array()) {
633 // Convert JSON array to semicolon-separated string for unescape_strings_cstyle
634 for (const auto& material : TmpModel["materials"]) {
635 if (!materials_str.empty()) materials_str += ";";
636 materials_str += material.get<std::string>();
637 }
638 } else {
639 materials_str = "";
640 }
641
642 boost::trim(materials_str);
643 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " Processing default_materials for printer: " << s1.ToStdString() << " - materials: " << materials_str;
644
645 // Use the same parsing logic as ConfigWizard::select_default_materials_for_printer_model()
646 // This calls unescape_strings_cstyle() just like Preset.cpp:298 does
647 std::vector<std::string> materials;
648 if (Slic3r::unescape_strings_cstyle(materials_str, materials)) {
649 for (const std::string& material : materials) {
650 if (!material.empty()) {
651 // Mark this filament as selected if it exists in our filament list
652 // This mirrors appconfig_new.set(section, material, "true") from ConfigWizard.cpp:2150
653 if (m_ProfileJson["filament"].contains(material)) {
654 m_ProfileJson["filament"][material]["selected"] = 1;
655 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " Automatically selected default filament: " << material;
656 } else {
657 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << " Default filament '" << material << "' not found in available filaments for printer: " << s1.ToStdString();
658 }
659 }
660 }
661 } else {
662 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << " Malformed default_materials field: " << materials_str << " for printer: " << s1.ToStdString();
663 }
664 } else {
665 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " No default_materials defined for printer: " << s1.ToStdString();
666 }
667 break;
668 }
669 }
670 }
671 }
672 else if (strCmd == "save_userguide_filaments") {
673 //reset
674 for (auto it = m_ProfileJson["filament"].begin(); it != m_ProfileJson["filament"].end(); ++it)
675 {
676 m_ProfileJson["filament"][it.key()]["selected"] = 0;
677 }
678
679 json fSelected = j["data"]["filament"];
680 int nF = fSelected.size();
681 for (int m = 0; m < nF; m++)
682 {
683 std::string fName = fSelected[m];
684
685 m_ProfileJson["filament"][fName]["selected"] = 1;
686 }
687 }
688 else if (strCmd == "check_for_new_printers") {
689 json response = json::object();
690 response["command"] = "check_new_printers_result";
691 // Guide pages currently send sequence_id as a number, while older
692 // pages may send it as a string. Preserve the value without
693 // forcing either representation.
694 if (j.contains("sequence_id"))
695 response["sequence_id"] = j["sequence_id"];
696 else
697 response["sequence_id"] = "";
698
699 if (!m_MainPtr->preset_updater) {
700 response["error"] = _u8L("Printer update service is unavailable.");
701 wxString strJS = wxString::Format("HandleStudio(%s)", response.dump(-1, ' ', true));
702 wxGetApp().CallAfter([this, strJS] { RunScript(strJS); });
703 } else {
704 // Orca: enumerate vendors directly from disk rather than from m_ProfileJson["model"]
705 // — a vendor with no machine models (e.g. a filament-only bundle, or a test fixture
706 // like "test123" with an empty machine_model_list) never gets a "vendor" entry
707 // pushed into "model" by LoadProfileFamily(), so it would be invisible to the
708 // request body and get endlessly re-offered by the server. Scan both the system dir
709 // (already-installed vendors) and the bundled resources dir (shipped-but-not-yet-
710 // installed vendors), same as LoadProfileData() does when building loaded_vendors.
711 std::set<std::string> system_vendors;
712 for (const auto& dir : {vendor_dir, rsrc_vendor_dir}) {
713 if (!boost::filesystem::exists(dir))
714 continue;
715 for (const auto& entry : boost::filesystem::directory_iterator(dir)) {
716 if (!boost::filesystem::is_directory(entry) && boost::iequals(entry.path().extension().string(), ".json"))
717 system_vendors.insert(entry.path().stem().string());
718 }
719 }
720 // Orca: check_new_vendors() is async (network + confirmation dialog + download
721 // all happen off the calling thread apart from the dialog itself); guard against
722 // this dialog being closed before the callback fires.
723 wxWeakRef<GuideFrame> weak_this(this);
724 try {
725 m_MainPtr->preset_updater->check_new_vendors(
726 system_vendors, [weak_this, response](std::vector<std::string> installed_vendors, bool declined) mutable {
727 if (!weak_this)
728 return;
729
730 // Orca: append the newly installed vendor(s) into the in-memory
731 // profile data (instead of a full LoadProfileData() rescan of every
732 // vendor) and push the refreshed list to the webview, the same way
733 // request_userguide_profile does, so the printer list picks them up
734 // without needing to reopen the guide.
735 for (const auto& vendor_id : installed_vendors) {
736 weak_this->LoadProfileFamily(vendor_id, (weak_this->vendor_dir / (vendor_id + ".json")).string());
737 }
738 if (!installed_vendors.empty()) {
739 json profile_response = json::object();
740 profile_response["command"] = "response_userguide_profile";
741 profile_response["sequence_id"] = "10001";
742 profile_response["response"] = weak_this->m_ProfileJson;
743 wxString profileJS = wxString::Format("HandleStudio(%s)", profile_response.dump(-1, ' ', true));
744 weak_this->RunScript(profileJS);
745 }
746
747 response["vendors"] = installed_vendors;
748 response["declined"] = declined;
749 wxString strJS = wxString::Format("HandleStudio(%s)", response.dump(-1, ' ', true));
750 weak_this->RunScript(strJS);
751 });
752 } catch (const std::exception &e) {
753 BOOST_LOG_TRIVIAL(warning) << "Failed to check for new printers: " << e.what();
754 response["error"] = _u8L("Failed to check for new printers.");
755 wxString strJS = wxString::Format("HandleStudio(%s)", response.dump(-1, ' ', true));
756 wxGetApp().CallAfter([this, strJS] { RunScript(strJS); });
757 }
758 }
759 }
760 else if (strCmd == "user_guide_finish") {
761 SaveProfile();
762
763 std::string oldregion = m_ProfileJson["region"];
764 if (m_Region != oldregion) {
765 AppConfig* config = GUI::wxGetApp().app_config;
766 std::string country_code = config->get_country_code();
767 NetworkAgent* agent = wxGetApp().getAgent();
768 if (agent) {
769 agent->set_country_code(country_code);
770 if (wxGetApp().is_user_login()) {
771 BOOST_LOG_TRIVIAL(info) << "logout: user_logout on user_guide_finish";
772 // agent->user_logout();
773 wxGetApp().request_user_logout(ORCA_CLOUD_PROVIDER, /*user_initiated=*/true);
774 }
775 }
776 }
777
778 this->EndModal(wxID_OK);
779
781 GUI::wxGetApp().CallAfter([] { GUI::wxGetApp().ShowDownNetPluginDlg(); });
782 }
783 else if (strCmd == "user_guide_create_printer") {
784 this->EndModal(wxID_CANCEL);
785 this->Close();
786 GUI::wxGetApp().CallAfter([] {GUI::wxGetApp().sidebar().create_printer_preset();});
787 }
788 else if (strCmd == "user_guide_cancel") {
789 this->EndModal(wxID_CANCEL);
790 this->Close();
791 } else if (strCmd == "save_region") {
792 m_Region = j["region"];
793 }
794 else if (strCmd == "network_plugin_install") {
795 std::string sAction = j["data"]["action"];
796
797 if (sAction == "yes") {
799 InstallNetplugin = true;
800 else //already ready
801 InstallNetplugin = false;
802 }
803 else
804 InstallNetplugin = false;
805 }
806 else if (strCmd == "save_stealth_mode") {
807 wxString strAction = j["data"]["action"];
808
809 if (strAction == "yes") {
810 StealthMode = true;
811 } else {
812 StealthMode = false;
813 }
814 }
815 } catch (std::exception &e) {
816 // wxMessageBox(e.what(), "json Exception", MB_OK);
817 BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnScriptMessage;Error:" << e.what();
818 }
819
820 wxString strAll = m_ProfileJson.dump(-1,' ',false, json::error_handler_t::ignore);
821}
int SaveProfile()
Definition WebGuideDialog.cpp:910
std::string m_editing_filament_id
Definition WebGuideDialog.hpp:178
std::string m_Region
Definition WebGuideDialog.hpp:159
bool network_plugin_ready
Definition WebGuideDialog.hpp:162
T * begin(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:838
static Plater * plater()
Definition GUI_Factories.cpp:400
static wxString update_custom_filaments()
Definition WebGuideDialog.cpp:157
bool unescape_strings_cstyle(const std::string &str, std::vector< std::string > &out)
Definition Config.cpp:173
static const std::string ORCA_CLOUD_PROVIDER("orca")
#define _u8L(s)
Definition I18N.hpp:11

References _u8L, Slic3r::Geometry::contains(), Slic3r::GUI::DPIDialog::EndModal(), Slic3r::AppConfig::get_country_code(), InstallNetplugin, m_editing_filament_id, m_MainPtr, m_page_ready, m_ProfileJson, m_Region, network_plugin_ready, notify_profile_loaded(), Slic3r::ORCA_CLOUD_PROVIDER(), Slic3r::GUI::plater(), PrivacyUse, rsrc_vendor_dir, RunScript(), SaveProfile(), Slic3r::NetworkAgent::set_country_code(), StealthMode, Slic3r::trace(), Slic3r::unescape_strings_cstyle(), Slic3r::GUI::update_custom_filaments(), and vendor_dir.

Referenced by GuideFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnScriptResponseMessage()

void Slic3r::GUI::GuideFrame::OnScriptResponseMessage ( wxCommandEvent & evt)
894{
895}

◆ OnTitleChanged()

void Slic3r::GUI::GuideFrame::OnTitleChanged ( wxWebViewEvent & evt)
538{
539 // SetTitle(evt.GetString());
540 // wxLogMessage("%s", "Title changed; title='" + evt.GetString() + "'");
541}

Referenced by GuideFrame().

Here is the caller graph for this function:

◆ prev_scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::prev_scale_factor ( ) const
inlineinherited
196{ return m_prev_scale_factor; }

◆ rescale()

void Slic3r::GUI::DPIAware< wxDialog >::rescale ( const wxRect & suggested_rect)
inlineprivateinherited
265 {
266 this->Freeze();
267
268 m_force_rescale = false;
269
270 // set normal application font as a current window font
271 m_normal_font = this->GetFont();
272
274
275 // rescale missed controls sizes and images
277
278 this->Layout();
279 this->Thaw();
280
281 // reset previous scale factor from current scale factor value
283 }
virtual void on_dpi_changed(const wxRect &suggested_rect)=0
void update_em_unit()
Definition GUI_Utils.hpp:249

◆ reset_profile_json()

void Slic3r::GUI::GuideFrame::reset_profile_json ( )

Callback invoked when a navigation request was accepted

415{
416 m_ProfileJson["model"] = json::array();
417 m_ProfileJson["machine"] = json::object();
418 m_ProfileJson["filament"] = json::object();
419 m_ProfileJson["process"] = json::array();
420}

References m_ProfileJson.

Referenced by BuildProfileDataFromVendors(), BuildProfileJson(), and init_guide_paths().

Here is the caller graph for this function:

◆ run()

bool Slic3r::GUI::GuideFrame::run ( )
1217{
1218 //BOOST_LOG_TRIVIAL(info) << boost::format("Running ConfigWizard, reason: %1%, start_page: %2%") % reason % start_page;
1219
1220 GUI_App &app = wxGetApp();
1221
1222 //p->set_run_reason(reason);
1223 //p->set_start_page(start_page);
1224 app.preset_bundle->export_selections(*app.app_config);
1225
1226 BOOST_LOG_TRIVIAL(info) << "GuideFrame before ShowModal";
1227 // display position
1228 int main_frame_display_index = wxDisplay::GetFromWindow(wxGetApp().mainframe);
1229 int guide_display_index = wxDisplay::GetFromWindow(this);
1230 if (main_frame_display_index != guide_display_index) {
1231 wxDisplay display = wxDisplay(main_frame_display_index);
1232 wxRect screenRect = display.GetGeometry();
1233 int guide_x = screenRect.x + (screenRect.width - this->GetSize().GetWidth()) / 2;
1234 int guide_y = screenRect.y + (screenRect.height - this->GetSize().GetHeight()) / 2;
1235 this->SetPosition(wxPoint(guide_x, guide_y));
1236 }
1237
1238 int result = this->ShowModal();
1239 if (result == wxID_OK) {
1240 bool apply_keeped_changes = false;
1241 BOOST_LOG_TRIVIAL(info) << "GuideFrame returned ok";
1242 if (! this->apply_config(app.app_config, app.preset_bundle, app.preset_updater, apply_keeped_changes))
1243 return false;
1244
1245 if (apply_keeped_changes)
1246 app.apply_keeped_preset_modifications();
1247
1248 app.app_config->set_legacy_datadir(false);
1249 app.update_mode();
1250 if (Plater *plater = app.plater())
1252 // BBS
1253 //app.obj_manipul()->update_ui_from_settings();
1254 BOOST_LOG_TRIVIAL(info) << "GuideFrame applied";
1255 this->Close();
1256 return true;
1257 } else if (result == wxID_CANCEL) {
1258 BOOST_LOG_TRIVIAL(info) << "GuideFrame cancelled";
1259 if (app.preset_bundle->printers.only_default_printers()) {
1260 //we install the default here
1261 bool apply_keeped_changes = false;
1262 //clear filament section and use default materials
1263 app.app_config->set_variant(PresetBundle::ORCA_DEFAULT_BUNDLE,
1265 app.app_config->clear_section(AppConfig::SECTION_FILAMENTS);
1266 app.preset_bundle->load_selections(*app.app_config, {PresetBundle::ORCA_DEFAULT_PRINTER_MODEL, PresetBundle::ORCA_DEFAULT_PRINTER_VARIANT, PresetBundle::ORCA_DEFAULT_FILAMENT, std::string()});
1267
1268 app.app_config->set_legacy_datadir(false);
1269 app.update_mode();
1270 return true;
1271 }
1272 else
1273 return false;
1274 } else if (result == wxID_EDIT) {
1275 this->Close();
1276 Filamentinformation *filament_info = new Filamentinformation();
1277 filament_info->filament_id = m_editing_filament_id;
1278 wxQueueEvent(wxGetApp().plater(), new SimpleEvent(EVT_MODIFY_FILAMENT, filament_info));
1279 return false;
1280 }
1281 else
1282 return false;
1283}
int ShowModal()
Definition GUI_Utils.hpp:216
bool apply_config(AppConfig *app_config, PresetBundle *preset_bundle, const PresetUpdater *updater, bool &apply_keeped_changes)
Definition WebGuideDialog.cpp:1005
void normalize_bed_types(bool printer_setting_changed)
Definition Plater.cpp:15672
static const char * ORCA_DEFAULT_PRINTER_MODEL
Definition PresetBundle.hpp:687
@ Plater
Definition Shortcuts.hpp:21

References Slic3r::GUI::GUI_App::app_config, apply_config(), Slic3r::GUI::GUI_App::apply_keeped_preset_modifications(), Slic3r::AppConfig::clear_section(), Slic3r::PresetBundle::export_selections(), Slic3r::GUI::Filamentinformation::filament_id, Slic3r::PresetBundle::load_selections(), m_editing_filament_id, Slic3r::PrinterPresetCollection::only_default_printers(), Slic3r::PresetBundle::ORCA_DEFAULT_BUNDLE, Slic3r::PresetBundle::ORCA_DEFAULT_PRINTER_MODEL, Slic3r::PresetBundle::ORCA_DEFAULT_PRINTER_VARIANT, Slic3r::GUI::GUI_App::plater(), Slic3r::GUI::plater(), Slic3r::GUI::GUI_App::preset_bundle, Slic3r::GUI::GUI_App::preset_updater, Slic3r::PresetBundle::printers, Slic3r::AppConfig::SECTION_FILAMENTS, Slic3r::AppConfig::set_legacy_datadir(), Slic3r::AppConfig::set_variant(), Slic3r::GUI::DPIAware< wxDialog >::ShowModal(), and Slic3r::GUI::GUI_App::update_mode().

Referenced by Slic3r::GUI::GUI_App::run_wizard(), Slic3r::GUI::GUI_App::ShowOnlyFilament(), and Slic3r::GUI::GUI_App::ShowUserGuide().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunScript()

void Slic3r::GUI::GuideFrame::RunScript ( const wxString & javascript)
824{
825 // Remember the script we run in any case, so the next time the user opens
826 // the "Run Script" dialog box, it is shown there for convenient updating.
827 //m_javascript = javascript;
828
829 // wxLogMessage("Running JavaScript:\n%s\n", javascript);
830
831 if (!m_browser) return;
832
833 WebView::RunScript(m_browser, javascript);
834}
static bool RunScript(wxWebView *webView, wxString const &msg)
Definition WebView.cpp:491

References m_browser, and WebView::RunScript().

Referenced by notify_profile_loaded(), and OnScriptMessage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveProfile()

int Slic3r::GUI::GuideFrame::SaveProfile ( )
911{
912 // SoftFever: don't collect info
913 //privacy
914 // if (PrivacyUse == true) {
915 // m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "privacyuse", "1");
916 // } else
917 // m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "privacyuse", "0");
918
919 m_MainPtr->app_config->set("region", m_Region);
920 m_MainPtr->app_config->set_bool("stealth_mode", StealthMode);
921
922 //finish
923 m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "finish", true);
924
925 m_MainPtr->app_config->save();
926
927 std::string strAll = m_ProfileJson.dump(-1, ' ', false, json::error_handler_t::ignore);
928
929 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "before save to app_config: "<< std::endl<<strAll;
930
931 //set filaments to app_config
932 const std::string &section_name = AppConfig::SECTION_FILAMENTS;
933 std::map<std::string, std::string> section_new;
934 m_appconfig_new.clear_section(section_name);
935 for (auto it = m_ProfileJson["filament"].begin(); it != m_ProfileJson["filament"].end(); ++it) {
936 if (it.value()["selected"] == 1){
937 section_new[it.key()] = "true";
938 }
939 }
940 m_appconfig_new.set_section(section_name, section_new);
941
942 //set vendors to app_config
943 Slic3r::AppConfig::VendorMap empty_vendor_map;
944 m_appconfig_new.set_vendors(empty_vendor_map);
945 for (auto it = m_ProfileJson["model"].begin(); it != m_ProfileJson["model"].end(); ++it)
946 {
947 if (it.value().is_object()) {
948 json temp_model = it.value();
949 std::string model_name = temp_model["model"];
950 std::string vendor_name = temp_model["vendor"];
951 std::string selected = temp_model["nozzle_selected"];
952 boost::trim(selected);
953 std::string nozzle;
954 while (selected.size() > 0) {
955 auto pos = selected.find(';');
956 if (pos != std::string::npos) {
957 nozzle = selected.substr(0, pos);
958 m_appconfig_new.set_variant(vendor_name, model_name, nozzle, "true");
959 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format("vendor_name %1%, model_name %2%, nozzle %3% selected")%vendor_name %model_name %nozzle;
960 selected = selected.substr(pos + 1);
961 boost::trim(selected);
962 }
963 else {
964 m_appconfig_new.set_variant(vendor_name, model_name, selected, "true");
965 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format("vendor_name %1%, model_name %2%, nozzle %3% selected")%vendor_name %model_name %selected;
966 break;
967 }
968 }
969 }
970 }
971
972 //m_appconfig_new
973
974 return 0;
975}
std::map< std::string, std::map< std::string, std::set< std::string > > > VendorMap
Definition AppConfig.hpp:251
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16

References m_appconfig_new, m_MainPtr, m_ProfileJson, m_Region, m_SectionName, Slic3r::AppConfig::SECTION_FILAMENTS, Slic3r::GUI::section_name(), and StealthMode.

Referenced by OnScriptMessage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveProfileData()

int Slic3r::GUI::GuideFrame::SaveProfileData ( )
1691{
1692 try {
1693 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>();
1694 m_appconfig_new.set_vendors(*wxGetApp().app_config);
1695 m_appconfig_new.set_section(AppConfig::SECTION_FILAMENTS, enabled_filaments);
1696
1697 for (auto it = m_ProfileJson["model"].begin(); it != m_ProfileJson["model"].end(); ++it)
1698 {
1699 if (it.value().is_object()) {
1700 json& temp_model = it.value();
1701 std::string model_name = temp_model["model"];
1702 std::string vendor_name = temp_model["vendor"];
1703 std::string nozzle_diameter = temp_model["nozzle_diameter"];
1704 std::string selected;
1705 boost::trim(nozzle_diameter);
1706 std::string nozzle;
1707 bool enabled = false, first=true;
1708 while (nozzle_diameter.size() > 0) {
1709 auto pos = nozzle_diameter.find(';');
1710 if (pos != std::string::npos) {
1711 nozzle = nozzle_diameter.substr(0, pos);
1712 enabled = m_appconfig_new.get_variant(vendor_name, model_name, nozzle);
1713 if (enabled) {
1714 if (!first)
1715 selected += ";";
1716 selected += nozzle;
1717 first = false;
1718 }
1719 nozzle_diameter = nozzle_diameter.substr(pos + 1);
1720 boost::trim(nozzle_diameter);
1721 }
1722 else {
1723 enabled = m_appconfig_new.get_variant(vendor_name, model_name, nozzle_diameter);
1724 if (enabled) {
1725 if (!first)
1726 selected += ";";
1727 selected += nozzle_diameter;
1728 }
1729 break;
1730 }
1731 }
1732 temp_model["nozzle_selected"] = selected;
1733 //m_ProfileJson["model"][a]["nozzle_selected"]
1734 }
1735 }
1736
1737 if (m_ProfileJson["model"].size() == 1) {
1738 std::string strNozzle = m_ProfileJson["model"][0]["nozzle_diameter"];
1739 m_ProfileJson["model"][0]["nozzle_selected"]=strNozzle;
1740 }
1741
1742
1743 for (auto it = m_ProfileJson["filament"].begin(); it != m_ProfileJson["filament"].end(); ++it) {
1744 //json temp_filament = it.value();
1745 std::string filament_name = it.key();
1746 if (enabled_filaments.find(filament_name) != enabled_filaments.end())
1747 m_ProfileJson["filament"][filament_name]["selected"] = 1;
1748 }
1749
1750 //----region
1751 m_Region = wxGetApp().app_config->get("region");
1752 m_ProfileJson["region"] = m_Region;
1753
1754 m_ProfileJson["network_plugin_install"] = wxGetApp().app_config->get("app","installed_networking");
1755 m_ProfileJson["network_plugin_compability"] = wxGetApp().is_compatibility_version() ? "1" : "0";
1756 network_plugin_ready = wxGetApp().is_compatibility_version();
1757
1758 StealthMode = wxGetApp().app_config->get_bool("app","stealth_mode");
1759 m_ProfileJson["stealth_mode"] = StealthMode;
1760 }
1761 catch (std::exception &e) {
1762 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ", error: "<< e.what() <<std::endl;
1763 }
1764
1765 return 0;
1766}
zaa_minimize_perimeter_height nozzle_diameter((ConfigOptionBool, reduce_infill_retraction))((ConfigOptionBool

References m_appconfig_new, m_ProfileJson, m_Region, network_plugin_ready, Slic3r::nozzle_diameter(), Slic3r::AppConfig::SECTION_FILAMENTS, and StealthMode.

Referenced by on_profile_loaded().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::scale_factor ( ) const
inlineinherited
195{ return m_scale_factor; }

◆ set_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::set_em_unit ( int v)
inlineinherited
200{ m_em_unit = v; }

◆ set_prev_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_prev_scale_factor ( float v)
inlineinherited

◆ set_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_scale_factor ( float v)
inlineinherited
198{ m_scale_factor = v; }

◆ SetStartPage()

wxString Slic3r::GUI::GuideFrame::SetStartPage ( GuidePage startpage = BBL_WELCOME,
bool load = true )
325{
326 m_page = startpage;
327 BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(" enter, load=%1%, start_page=%2%")%load%int(startpage);
328 //wxLogMessage("GUIDE: webpage_1 %s", (boost::filesystem::path(resources_dir()) / "web\\guide\\1\\index.html").make_preferred().string().c_str() );
329 const wxString guide_url = file_url_from_path(boost::filesystem::path(resources_dir()) / "web/guide/0/index.html");
330 wxString TargetUrl = guide_url + "?target=1";
331 //wxLogMessage("GUIDE: webpage_2 %s", TargetUrl.mb_str());
332
333 if (startpage == BBL_WELCOME){
334 SetTitle(_L("Setup Wizard"));
335 TargetUrl = guide_url + "?target=1";
336 } else if (startpage == BBL_REGION) {
337 SetTitle(_L("Setup Wizard"));
338 TargetUrl = guide_url + "?target=11";
339 } else if (startpage == BBL_MODELS) {
340 SetTitle(_L("Setup Wizard"));
341 TargetUrl = guide_url + "?target=21";
342 } else if (startpage == BBL_FILAMENTS) {
343 SetTitle(_L("Setup Wizard"));
344
345 int nSize = m_ProfileJson["model"].size();
346
347 if (nSize>0)
348 TargetUrl = guide_url + "?target=22";
349 else
350 TargetUrl = guide_url + "?target=21";
351 } else if (startpage == BBL_FILAMENT_ONLY) {
352 SetTitle("");
353 TargetUrl = guide_url + "?target=23";
354 } else if (startpage == BBL_MODELS_ONLY) {
355 SetTitle("");
356 TargetUrl = guide_url + "?target=24";
357 }
358 else {
359 SetTitle(_L("Setup Wizard"));
360 TargetUrl = guide_url + "?target=21";
361 }
362
363 wxString strlang = wxGetApp().current_language_code_safe();
364 BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(", strlang=%1%") % into_u8(strlang);
365 if (strlang != "")
366 TargetUrl = wxString::Format("%s&lang=%s", w2s(TargetUrl), strlang);
367
368 if (load)
369 load_url(TargetUrl);
370
371 BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< " exit";
372 return TargetUrl;
373}
void load(Archive &archive, wxString &d)
Definition GLGizmoEmboss.cpp:3405
void load_url(wxString &url)
Definition WebGuideDialog.cpp:314

References _L, BBL_FILAMENT_ONLY, BBL_FILAMENTS, BBL_MODELS, BBL_MODELS_ONLY, BBL_REGION, BBL_WELCOME, Slic3r::GUI::file_url_from_path(), Slic3r::GUI::into_u8(), load(), load_url(), m_page, m_ProfileJson, Slic3r::resources_dir(), and w2s().

Referenced by GuideFrame(), Slic3r::GUI::GUI_App::run_wizard(), and Slic3r::GUI::GUI_App::ShowOnlyFilament().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowModal()

◆ ShowPluginStatus()

int Slic3r::GUI::GuideFrame::ShowPluginStatus ( int status,
int percent,
bool & cancel )
2049{
2050 //TODO
2051 return 0;
2052}

Referenced by DownloadPlugin(), and InstallPlugin().

Here is the caller graph for this function:

◆ StrReplace()

void Slic3r::GUI::GuideFrame::StrReplace ( std::string & strBase,
std::string strSrc,
std::string strDes )
1990{
1991 int pos = 0;
1992 int srcLen = strSrc.size();
1993 int desLen = strDes.size();
1994 pos = strBase.find(strSrc, pos);
1995 while ((pos != std::string::npos)) {
1996 strBase.replace(pos, srcLen, strDes);
1997 pos = strBase.find(strSrc, (pos + desLen));
1998 }
1999}

Referenced by GetStardardFilePath().

Here is the caller graph for this function:

◆ update_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::update_em_unit ( )
inlineprivateinherited
250 {
251 // Linux specific issue : get_dpi_for_window(this) still doesn't responce to the Display's scale in new wxWidgets(3.1.3).
252 // So, calculate the m_em_unit value from the font size, as before
253#if !defined(__WXGTK__)
255#else
256 // initialize default width_unit according to the width of the one symbol ("m") of the currently active font of this window.
257 m_em_unit = std::max<size_t>(10, this->GetTextExtent("m").x - 1);
258#endif // __WXGTK__
259 }

◆ UpdateState()

void Slic3r::GUI::GuideFrame::UpdateState ( )

Method that retrieves the current state from the web control and updates the GUI the reflect this current state.

380{
381 // SetTitle(m_browser->GetCurrentTitle());
382}

Referenced by load_url(), OnDocumentLoaded(), OnError(), OnNavigationComplete(), OnNavigationRequest(), and OnNewWindow().

Here is the caller graph for this function:

◆ w2s()

std::string Slic3r::GUI::GuideFrame::w2s ( wxString sSrc)
2002{
2003 return std::string(sSrc.mb_str());
2004}

Referenced by GetFilamentInfo(), GetStardardFilePath(), LoadProfileData(), and SetStartPage().

Here is the caller graph for this function:

Member Data Documentation

◆ bFirstComplete

bool Slic3r::GUI::GuideFrame::bFirstComplete {false}
private
145{false};

Referenced by OnNavigationComplete().

◆ filament_info_cache

std::unordered_map<std::string, CachedFilamentInfo> Slic3r::GUI::GuideFrame::filament_info_cache
private

Referenced by GetFilamentInfo(), and LoadProfileData().

◆ InstallNetplugin

bool Slic3r::GUI::GuideFrame::InstallNetplugin
private

Referenced by GuideFrame(), and OnScriptMessage().

◆ m_appconfig_new

AppConfig Slic3r::GUI::GuideFrame::m_appconfig_new
private

◆ m_bbl_user_agent

wxString Slic3r::GUI::GuideFrame::m_bbl_user_agent
private

◆ m_browser

wxWebView* Slic3r::GUI::GuideFrame::m_browser
private

◆ m_can_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_can_rescale
privateinherited
235{ true };

◆ m_cancel_token

std::shared_ptr<std::atomic<bool> > Slic3r::GUI::GuideFrame::m_cancel_token {std::make_shared<std::atomic<bool>>(false)}
private
153{std::make_shared<std::atomic<bool>>(false)};

Referenced by ~GuideFrame(), BuildProfileDataFromVendors(), LoadProfileData(), and OnNavigationComplete().

◆ m_editing_filament_id

std::string Slic3r::GUI::GuideFrame::m_editing_filament_id
private

Referenced by OnScriptMessage(), and run().

◆ m_em_unit

int Slic3r::GUI::DPIAware< wxDialog >::m_em_unit
privateinherited

◆ m_force_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_force_rescale
privateinherited
236{ false };

◆ m_javascript

wxString Slic3r::GUI::GuideFrame::m_javascript
private

◆ m_load_task

std::unique_ptr<boost::thread> Slic3r::GUI::GuideFrame::m_load_task
private

◆ m_MainPtr

GUI_App* Slic3r::GUI::GuideFrame::m_MainPtr
private

◆ m_new_font_point_size

int Slic3r::GUI::DPIAware< wxDialog >::m_new_font_point_size
privateinherited

◆ m_normal_font

wxFont Slic3r::GUI::DPIAware< wxDialog >::m_normal_font
privateinherited

◆ m_OrcaFilaLibPath

std::string Slic3r::GUI::GuideFrame::m_OrcaFilaLibPath
private

◆ m_OrcaFilaList

json Slic3r::GUI::GuideFrame::m_OrcaFilaList
private

Referenced by LoadProfileFamily().

◆ m_page

enum Slic3r::GUI::GuideFrame::GuidePage Slic3r::GUI::GuideFrame::m_page

Referenced by GuideFrame(), and SetStartPage().

◆ m_page_ready

bool Slic3r::GUI::GuideFrame::m_page_ready {false}
private
149{false};

Referenced by notify_profile_loaded(), and OnScriptMessage().

◆ m_prev_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_prev_scale_factor
privateinherited

◆ m_profile_ready

bool Slic3r::GUI::GuideFrame::m_profile_ready {false}
private
148{false};

Referenced by notify_profile_loaded(), and on_profile_loaded().

◆ m_ProfileJson

◆ m_Region

std::string Slic3r::GUI::GuideFrame::m_Region
private

◆ m_response_js

wxString Slic3r::GUI::GuideFrame::m_response_js
private

◆ m_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_scale_factor
privateinherited

◆ m_SectionName

wxString Slic3r::GUI::GuideFrame::m_SectionName
private

Referenced by GuideFrame(), IsFirstUse(), and SaveProfile().

◆ network_plugin_ready

bool Slic3r::GUI::GuideFrame::network_plugin_ready {false}
private
162{false};

Referenced by OnScriptMessage(), and SaveProfileData().

◆ orca_bundle_rsrc

bool Slic3r::GUI::GuideFrame::orca_bundle_rsrc
private

Referenced by init_guide_paths(), and IsFirstUse().

◆ PrivacyUse

bool Slic3r::GUI::GuideFrame::PrivacyUse
private

Referenced by GuideFrame(), and OnScriptMessage().

◆ rsrc_vendor_dir

boost::filesystem::path Slic3r::GUI::GuideFrame::rsrc_vendor_dir
private

◆ StealthMode

bool Slic3r::GUI::GuideFrame::StealthMode
private

◆ vendor_dir

boost::filesystem::path Slic3r::GUI::GuideFrame::vendor_dir
private

The documentation for this class was generated from the following files: