Browse Source

try fix macos random bug & even more logs

remi durand 3 years ago
parent
commit
57103bf3a6

+ 34 - 0
src/libslic3r/Config.cpp

@@ -431,6 +431,17 @@ void ConfigBase::apply_only(const ConfigBase &other, const t_config_option_keys
         // If the key is not in the parameter definition, or this ConfigBase is a static type and it does not support the parameter,
         // an exception is thrown if not ignore_nonexistent.
         ConfigOption *my_opt = this->option(opt_key, true);
+        if (opt_key == "printer_technology") {
+            std::cout << "Config:"<< (uint64_t)(this)<<"::apply_only printer_technology";
+            if (my_opt == nullptr)
+                std::cout << " for the first time ";
+            else
+                std::cout << " from @"<< (uint64_t)(this->option<ConfigOptionEnum<PrinterTechnology>>("printer_technology")) <<" value " << (int)(this->option<ConfigOptionEnum<PrinterTechnology>>("printer_technology")->value);
+            const ConfigOption* other_opt = other.option(opt_key);
+            if (other_opt == nullptr)
+                std::cout << " to nothing because it doesn't exist\n";
+            else std::cout << " to @"<< (uint64_t)(other.option<ConfigOptionEnum<PrinterTechnology>>(opt_key))<<" value:" << (int)other.option<ConfigOptionEnum<PrinterTechnology>>(opt_key)->value << "\n";
+        }
         // If we didn't find an option, look for any other option having this as an alias.
         if (my_opt == nullptr) {
             const ConfigDef       *def = this->def();
@@ -504,6 +515,11 @@ std::string ConfigBase::opt_serialize(const t_config_option_key &opt_key) const
 
 void ConfigBase::set(const std::string &opt_key, int value, bool create)
 {
+    if (opt_key == "printer_technology") {
+        std::cout << "Config::set printer_technology";
+            std::cout << " from value " << (int)(this->option<ConfigOptionEnum<PrinterTechnology>>("printer_technology")->value);
+        std::cout << " to "<< value <<"\n";
+    }
     ConfigOption *opt = this->option_throw(opt_key, create);
     switch (opt->type()) {
     	case coInt:    static_cast<ConfigOptionInt*>(opt)->value = value; break;
@@ -516,6 +532,11 @@ void ConfigBase::set(const std::string &opt_key, int value, bool create)
 
 void ConfigBase::set(const std::string &opt_key, double value, bool create)
 {
+    if (opt_key == "printer_technology") {
+        std::cout << "Config::set printer_technology";
+        std::cout << " from value " << (int)(this->option<ConfigOptionEnum<PrinterTechnology>>("printer_technology")->value);
+        std::cout << " to " << value << "\n";
+    }
     ConfigOption *opt = this->option_throw(opt_key, create);
     switch (opt->type()) {
     	case coFloat:  			static_cast<ConfigOptionFloat*>(opt)->value = value; break;
@@ -532,6 +553,11 @@ bool ConfigBase::set_deserialize_nothrow(const t_config_option_key &opt_key_src,
     // Both opt_key and value may be modified by _handle_legacy().
     // If the opt_key is no more valid in this version of Slic3r, opt_key is cleared by _handle_legacy().
     this->handle_legacy(opt_key, value);
+    if (opt_key_src == "printer_technology") {
+        std::cout << "Config::set_deserialize_nothrow printer_technology";
+        std::cout << " from value " << (int)(this->option<ConfigOptionEnum<PrinterTechnology>>("printer_technology")->value);
+        std::cout << " to " << value_src << " == " << value <<"\n";
+    }
     if (opt_key.empty())
         // Ignore the option.
         return true;
@@ -586,6 +612,14 @@ bool ConfigBase::set_deserialize_raw(const t_config_option_key &opt_key_src, con
     }
     
     ConfigOption *opt = this->option(opt_key, true);
+    if (opt_key_src == "printer_technology") {
+        std::cout << "Config::set_deserialize printer_technology";
+        if (opt == nullptr)
+            std::cout << " for the first time ";
+        else
+            std::cout << " from value " << (int)(this->option<ConfigOptionEnum<PrinterTechnology>>("printer_technology")->value);
+        std::cout << " to " << value << "\n";
+    }
     if (opt == nullptr)
         throw new UnknownOptionException(opt_key);
 

+ 1 - 1
src/libslic3r/Config.hpp

@@ -1435,7 +1435,7 @@ public:
     }
 
     void set(const ConfigOption *rhs) override {
-        std::cout << "set enum to " << rhs->serialize() << ": "<< (int)this->value << "=>";
+        std::cout << "set enum "<< (uint64_t)rhs <<" to " << rhs->serialize() << ": "<< (int)this->value << "=>";
         if (rhs->type() != this->type())
             throw Slic3r::RuntimeError("ConfigOptionEnum<T>: Assigning an incompatible type");
         // rhs could be of the following type: ConfigOptionEnumGeneric or ConfigOptionEnum<T>

+ 13 - 0
src/libslic3r/PresetBundle.cpp

@@ -46,7 +46,12 @@ PresetBundle::PresetBundle() :
     physical_printers(PhysicalPrinter::printer_options())
 {
 
+    std::cout << "create PresetBundle, does it has the printer tech? "<< (this->printers.preset(0).config.has("printer_technology") ? "yes" : "no");
+    if(this->printers.preset(0).config.has("printer_technology"))
+        std::cout << ", value: " << (int)(this->printers.preset(0).config.option<ConfigOptionEnum<PrinterTechnology>>("printer_technology")->value) 
+        << " @"<< (uint64_t)this->printers.preset(0).config.option<ConfigOptionEnum<PrinterTechnology>>("printer_technology") << "\n";
     std::cout << "create PresetBundle with default printer as " << (int)this->printers.preset(0).printer_technology() << "\n";
+    
     // The following keys are handled by the UI, they do not have a counterpart in any StaticPrintConfig derived classes,
     // therefore they need to be handled differently. As they have no counterpart in StaticPrintConfig, they are not being
     // initialized based on PrintConfigDef(), but to empty values (zeros, empty vectors, empty strings).
@@ -170,8 +175,10 @@ void PresetBundle::setup_directories()
 
 void PresetBundle::load_presets(AppConfig &config, const std::string &preferred_model_id)
 {
+    std::cout << "PresetBundle::load_presets test point 1 : (" << this->printers.get_edited_preset().name << ") = " << (int)this->printers.get_edited_preset().printer_technology() << "\n";
     // First load the vendor specific system presets.
     std::string errors_cummulative = this->load_system_presets();
+    std::cout << "PresetBundle::load_presets test point 2 : (" << this->printers.get_edited_preset().name << ") = " << (int)this->printers.get_edited_preset().printer_technology() << "\n";
 
     const std::string dir_user_presets = data_dir()
 #ifdef SLIC3R_PROFILE_USE_PRESETS_SUBDIR
@@ -202,21 +209,27 @@ void PresetBundle::load_presets(AppConfig &config, const std::string &preferred_
         errors_cummulative += err.what();
     }
     try {
+        std::cout << "PresetBundle::load_presets test point 5 : (" << this->printers.get_edited_preset().name << ") = " << (int)this->printers.get_edited_preset().printer_technology() << "\n";
         this->printers.load_presets(dir_user_presets, "printer");
     } catch (const std::runtime_error &err) {
         errors_cummulative += err.what();
     }
     try {
+        std::cout << "PresetBundle::load_presets test point 6 : (" << this->printers.get_edited_preset().name << ") = " << (int)this->printers.get_edited_preset().printer_technology() << "\n";
         this->physical_printers.load_printers(dir_user_presets, "physical_printer");
     } catch (const std::runtime_error &err) {
         errors_cummulative += err.what();
     }
+    std::cout << "PresetBundle::load_presets test point 7 : (" << this->printers.get_edited_preset().name << ") = " << (int)this->printers.get_edited_preset().printer_technology() << "\n";
     this->update_multi_material_filament_presets();
+    std::cout << "PresetBundle::load_presets test point 8 : (" << this->printers.get_edited_preset().name << ") = " << (int)this->printers.get_edited_preset().printer_technology() << "\n";
     this->update_compatible(PresetSelectCompatibleType::Never);
     if (! errors_cummulative.empty())
         throw Slic3r::RuntimeError(errors_cummulative);
+    std::cout << "PresetBundle::load_presets test point 9 : (" << this->printers.get_edited_preset().name << ") = " << (int)this->printers.get_edited_preset().printer_technology() << "\n";
 
     this->load_selections(config, preferred_model_id);
+    std::cout << "PresetBundle::load_presets test point 10 : (" << this->printers.get_edited_preset().name << ") = " << (int)this->printers.get_edited_preset().printer_technology() << "\n";
 }
 
 // Load system presets into this PresetBundle.

+ 0 - 14
src/libslic3r/PrintConfig.cpp

@@ -6199,20 +6199,6 @@ std::string FullPrintConfig::validate()
     return "";
 }
 
-// Declare the static caches for each StaticPrintConfig derived class.
-StaticPrintConfig::StaticCache<class Slic3r::PrintObjectConfig> PrintObjectConfig::s_cache_PrintObjectConfig;
-StaticPrintConfig::StaticCache<class Slic3r::PrintRegionConfig> PrintRegionConfig::s_cache_PrintRegionConfig;
-StaticPrintConfig::StaticCache<class Slic3r::MachineEnvelopeConfig> MachineEnvelopeConfig::s_cache_MachineEnvelopeConfig;
-StaticPrintConfig::StaticCache<class Slic3r::GCodeConfig>       GCodeConfig::s_cache_GCodeConfig;
-StaticPrintConfig::StaticCache<class Slic3r::PrintConfig>       PrintConfig::s_cache_PrintConfig;
-StaticPrintConfig::StaticCache<class Slic3r::FullPrintConfig>   FullPrintConfig::s_cache_FullPrintConfig;
-
-StaticPrintConfig::StaticCache<class Slic3r::SLAMaterialConfig>     SLAMaterialConfig::s_cache_SLAMaterialConfig;
-StaticPrintConfig::StaticCache<class Slic3r::SLAPrintConfig>        SLAPrintConfig::s_cache_SLAPrintConfig;
-StaticPrintConfig::StaticCache<class Slic3r::SLAPrintObjectConfig>  SLAPrintObjectConfig::s_cache_SLAPrintObjectConfig;
-StaticPrintConfig::StaticCache<class Slic3r::SLAPrinterConfig>      SLAPrinterConfig::s_cache_SLAPrinterConfig;
-StaticPrintConfig::StaticCache<class Slic3r::SLAFullPrintConfig>    SLAFullPrintConfig::s_cache_SLAFullPrintConfig;
-
 CLIActionsConfigDef::CLIActionsConfigDef()
 {
     ConfigOptionDef* def;

+ 33 - 24
src/libslic3r/PrintConfig.hpp

@@ -458,6 +458,8 @@ public:
 
 class StaticPrintConfig : public StaticConfig
 {
+    template<typename T>
+    friend class StaticCache;
 public:
     StaticPrintConfig() {}
 
@@ -496,8 +498,15 @@ protected:
     class StaticCache : public StaticCacheBase
     {
     public:
-        // Calling the constructor of m_defaults with 0 forces m_defaults to not run the initialization.
-        StaticCache() : m_defaults(nullptr) {}
+        // To be called during the StaticCache setup.
+        StaticCache(T* _defaults) : m_defaults(_defaults) {
+            _defaults->initialize(*this, (const char*)_defaults);
+            ConfigOption* optptr = this->optptr("printer_technology", m_defaults);
+            if (optptr) {
+                ConfigOptionEnum<PrinterTechnology>* opt = static_cast<ConfigOptionEnum<PrinterTechnology>*>(optptr);
+                std::cout << "create default config @" << (uint64_t)_defaults << " with option printer_technology @" << (uint64_t)(opt) << " value " << (int)(opt->value) << "\n";
+            }
+        }
         ~StaticCache() { delete m_defaults; m_defaults = nullptr; }
 
         bool                initialized() const { return ! m_keys.empty(); }
@@ -517,40 +526,45 @@ protected:
         const std::vector<std::string>& keys()      const { return m_keys; }
         const T&                        defaults()  const { return *m_defaults; }
 
+
+    private:
+
         // To be called during the StaticCache setup.
         // Collect option keys from m_map_name_to_offset,
         // assign default values to m_defaults.
-        void                finalize(T *defaults, const ConfigDef *defs)
+        void                finalize(T* defaults)
         {
+            assert(defaults != nullptr);
+            const ConfigDef* defs = m_defaults->def();
             assert(defs != nullptr);
             m_defaults = defaults;
             m_keys.clear();
             m_keys.reserve(m_map_name_to_offset.size());
-            for (const auto &kvp : defs->options) {
+            for (const auto& kvp : defs->options) {
                 // Find the option given the option name kvp.first by an offset from (char*)m_defaults.
-                ConfigOption *opt = this->optptr(kvp.first, m_defaults);
+                ConfigOption* opt = this->optptr(kvp.first, m_defaults);
                 if (opt == nullptr)
                     // This option is not defined by the ConfigBase of type T.
                     continue;
                 m_keys.emplace_back(kvp.first);
-                const ConfigOptionDef *def = defs->get(kvp.first);
+                const ConfigOptionDef* def = defs->get(kvp.first);
                 assert(def != nullptr);
                 if (def->default_value)
                     opt->set(def->default_value.get());
             }
         }
 
-    private:
         T                                  *m_defaults;
         std::vector<std::string>            m_keys;
     };
 };
 
 #define STATIC_PRINT_CONFIG_CACHE_BASE(CLASS_NAME) \
+    friend StaticCache<CLASS_NAME>; \
 public: \
     /* Overrides ConfigBase::optptr(). Find ando/or create a ConfigOption instance for a given name. */ \
     const ConfigOption*      optptr(const t_config_option_key &opt_key) const override \
-        {   const ConfigOption* opt = s_cache_##CLASS_NAME.optptr(opt_key, this); \
+        {   const ConfigOption* opt = config_cache().optptr(opt_key, this); \
             if (opt == nullptr && parent != nullptr) \
                 /*if not find, try with the parent config.*/ \
                 opt = parent->option(opt_key); \
@@ -558,28 +572,23 @@ public: \
         } \
     /* Overrides ConfigBase::optptr(). Find ando/or create a ConfigOption instance for a given name. */ \
     ConfigOption*            optptr(const t_config_option_key &opt_key, bool create = false) override \
-        { return s_cache_##CLASS_NAME.optptr(opt_key, this); } \
+        { return config_cache().optptr(opt_key, this); } \
     /* Overrides ConfigBase::keys(). Collect names of all configuration values maintained by this configuration store. */ \
-    t_config_option_keys     keys() const override { return s_cache_##CLASS_NAME.keys(); } \
-    const t_config_option_keys& keys_ref() const override { return s_cache_##CLASS_NAME.keys(); } \
-    static const CLASS_NAME& defaults() { initialize_cache(); return s_cache_##CLASS_NAME.defaults(); } \
+    t_config_option_keys     keys() const override { return config_cache().keys(); } \
+    const t_config_option_keys& keys_ref() const override { return config_cache().keys(); } \
+    static const CLASS_NAME& defaults() { return config_cache().defaults(); } \
 private: \
-    static void initialize_cache() \
+	static const StaticPrintConfig::StaticCache<CLASS_NAME>& config_cache() \
     { \
-        if (! s_cache_##CLASS_NAME.initialized()) { \
-            CLASS_NAME *inst = new CLASS_NAME(1); \
-            inst->initialize(s_cache_##CLASS_NAME, (const char*)inst); \
-            s_cache_##CLASS_NAME.finalize(inst, inst->def()); \
-        } \
+        static StaticPrintConfig::StaticCache<CLASS_NAME> threadsafe_cache_##CLASS_NAME(new CLASS_NAME(1)); \
+        return threadsafe_cache_##CLASS_NAME; \
     } \
-    /* Cache object holding a key/option map, a list of option keys and a copy of this static config initialized with the defaults. */ \
-    static StaticPrintConfig::StaticCache<CLASS_NAME> s_cache_##CLASS_NAME;
 
 #define STATIC_PRINT_CONFIG_CACHE(CLASS_NAME) \
     STATIC_PRINT_CONFIG_CACHE_BASE(CLASS_NAME) \
 public: \
     /* Public default constructor will initialize the key/option cache and the default object copy if needed. */ \
-    CLASS_NAME() { initialize_cache(); *this = s_cache_##CLASS_NAME.defaults(); } \
+    CLASS_NAME() { *this = config_cache().defaults(); } \
 protected: \
     /* Protected constructor to be called when compounded. */ \
     CLASS_NAME(int) {}
@@ -1232,7 +1241,7 @@ protected:
 class PrintConfig : public MachineEnvelopeConfig, public GCodeConfig
 {
     STATIC_PRINT_CONFIG_CACHE_DERIVED(PrintConfig)
-    PrintConfig() : MachineEnvelopeConfig(0), GCodeConfig(0) { initialize_cache(); *this = s_cache_PrintConfig.defaults(); }
+    PrintConfig() : MachineEnvelopeConfig(0), GCodeConfig(0) { *this = config_cache().defaults(); }
 public:
     double                          min_object_distance() const;
     static double                   min_object_distance(const ConfigBase *config, double height = 0);
@@ -1431,7 +1440,7 @@ class FullPrintConfig :
     public PrintConfig
 {
     STATIC_PRINT_CONFIG_CACHE_DERIVED(FullPrintConfig)
-    FullPrintConfig() : PrintObjectConfig(0), PrintRegionConfig(0), PrintConfig(0) { initialize_cache(); *this = s_cache_FullPrintConfig.defaults(); }
+    FullPrintConfig() : PrintObjectConfig(0), PrintRegionConfig(0), PrintConfig(0) { *this = config_cache().defaults(); }
 
 public:
     // Validate the FullPrintConfig. Returns an empty string on success, otherwise an error message is returned.
@@ -1744,7 +1753,7 @@ protected:
 class SLAFullPrintConfig : public SLAPrinterConfig, public SLAPrintConfig, public SLAPrintObjectConfig, public SLAMaterialConfig
 {
     STATIC_PRINT_CONFIG_CACHE_DERIVED(SLAFullPrintConfig)
-    SLAFullPrintConfig() : SLAPrinterConfig(0), SLAPrintConfig(0), SLAPrintObjectConfig(0), SLAMaterialConfig(0) { initialize_cache(); *this = s_cache_SLAFullPrintConfig.defaults(); }
+    SLAFullPrintConfig() : SLAPrinterConfig(0), SLAPrintConfig(0), SLAPrintObjectConfig(0), SLAMaterialConfig(0) {  *this = config_cache().defaults(); }
 
 public:
     // Validate the SLAFullPrintConfig. Returns an empty string on success, otherwise an error message is returned.

+ 4 - 36
src/slic3r/GUI/GUI_App.cpp

@@ -866,20 +866,14 @@ bool GUI_App::on_init_inner()
         scrn->SetText(_L("Loading configuration")+ dots);
     }
 
-#ifdef __APPLE__
     std::cout << "GUI_App Bundle::new" << "\n";
-#endif
     preset_bundle = new PresetBundle();
-#ifdef __APPLE__
     std::cout << "GUI_App:on_init_inner test point 1 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 
     // just checking for existence of Slic3r::data_dir is not enough : it may be an empty directory
     // supplied as argument to --datadir; in that case we should still run the wizard
     preset_bundle->setup_directories();
-#ifdef __APPLE__
     std::cout << "GUI_App:on_init_inner test point 2 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 
     if (is_editor()) {
 #ifdef __WXMSW__ 
@@ -887,25 +881,19 @@ bool GUI_App::on_init_inner()
         if (app_config->get("associate_3mf") == "1")
 #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
             associate_3mf_files();
-#ifdef __APPLE__
         std::cout << "GUI_App:on_init_inner test point 3 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 #if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
         if (app_config->get("associate_stl") == "1")
             associate_stl_files();
 #endif // ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
 #endif // __WXMSW__
-#ifdef __APPLE__
         std::cout << "GUI_App:on_init_inner test point 4 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 
         preset_updater = new PresetUpdater();
         Bind(EVT_SLIC3R_VERSION_ONLINE, [this](const wxCommandEvent& evt) {
         app_config->set("version_online", into_u8(evt.GetString()));
         app_config->save();
-#ifdef __APPLE__
         std::cout << "GUI_App:on_init_inner test point 5 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
             if (this->plater_ != nullptr) {
                 //if (*Semver::parse(SLIC3R_VERSION_FULL) < *Semver::parse(into_u8(evt.GetString()))) {
                     this->plater_->get_notification_manager()->push_notification(NotificationType::NewAppAvailable);
@@ -921,36 +909,29 @@ bool GUI_App::on_init_inner()
             associate_gcode_files();
 #endif // __WXMSW__
     }
-#ifdef __APPLE__
     std::cout << "GUI_App:on_init_inner test point 6 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 
     // initialize label colors and fonts
     init_label_colours();
     init_fonts();
     wxImage::AddHandler(new wxJPEGHandler());
-#ifdef __APPLE__
     std::cout << "GUI_App:on_init_inner test point 7 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 
     // If load_language() fails, the application closes.
     load_language(wxString(), true);
 
-#ifdef __APPLE__
     std::cout << "GUI_App:on_init_inner test point 8 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 
     // Suppress the '- default -' presets.
     preset_bundle->set_default_suppressed(app_config->get("no_defaults") == "1");
+    std::cout << "GUI_App:on_init_inner test point 8.1 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
     try {
         preset_bundle->load_presets(*app_config);
     } catch (const std::exception &ex) {
         show_error(nullptr, ex.what());
     }
 
-#ifdef __APPLE__
     std::cout << "GUI_App:on_init_inner test point 9 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 #ifdef WIN32
 #if !wxVERSION_EQUAL_OR_GREATER_THAN(3,1,3)
     register_win32_dpi_event();
@@ -960,36 +941,26 @@ bool GUI_App::on_init_inner()
 
     // Let the libslic3r know the callback, which will translate messages on demand.
     Slic3r::I18N::set_translate_callback(libslic3r_translate_callback);
-#ifdef __APPLE__
     std::cout << "GUI_App:on_init_inner test point 10 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 
     // application frame
     if (scrn && is_editor())
         scrn->SetText(_L("Preparing settings tabs") + dots);
 
     mainframe = new MainFrame();
-#ifdef __APPLE__
     std::cout << "GUI_App:on_init_inner test point 11 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
     // hide settings tabs after first Layout
     if (is_editor())
         mainframe->select_tab(MainFrame::ETabType::LastPlater);
-#ifdef __APPLE__
     std::cout << "GUI_App:on_init_inner test point 12 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 
     sidebar().obj_list()->init_objects(); // propagate model objects to object list
 //     update_mode(); // !!! do that later
     SetTopWindow(mainframe);
-#ifdef __APPLE__
     std::cout << "GUI_App:on_init_inner test point 13 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 
     m_printhost_job_queue.reset(new PrintHostJobQueue(mainframe->printhost_queue_dlg()));
-#ifdef __APPLE__
     std::cout << "GUI_App:on_init_inner test point 14 : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
 
     if (is_gcode_viewer()) {
         mainframe->update_layout();
@@ -2035,22 +2006,19 @@ bool GUI_App::checked_tab(Tab* tab)
 // Update UI / Tabs to reflect changes in the currently loaded presets
 void GUI_App::load_current_presets(bool check_printer_presets_ /*= true*/)
 {
-#ifdef __APPLE__
     std::cout << "GUI_App:load_current_presets start : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
+
     // check printer_presets for the containing information about "Print Host upload"
     // and create physical printer from it, if any exists
     if (check_printer_presets_)
         check_printer_presets();
-#ifdef __APPLE__
     std::cout << "GUI_App:load_current_presets check_printer_presets : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)preset_bundle->printers.get_edited_preset().printer_technology() << "\n";
-#endif
+
 
     PrinterTechnology printer_technology = preset_bundle->printers.get_edited_preset().printer_technology();
 
-#ifdef __APPLE__
     std::cout << "GUI_App:load_current_presets check_printer_presets : (" << preset_bundle->printers.get_edited_preset().name << ") = " << (int)printer_technology << "\n";
-#endif
+
 	this->plater()->set_printer_technology(printer_technology);
     for (Tab *tab : tabs_list)
 		if (tab->supports_printer_technology(printer_technology)) {