mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-03 01:18:44 +03:00
Delete BugWizard
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#ifndef EXECUTIONSEQ_HPP
|
#ifndef EXECUTIONSEQ_HPP
|
||||||
#define EXECUTIONSEQ_HPP
|
#define EXECUTIONSEQ_HPP
|
||||||
|
|
||||||
#ifdef PRUSASLICER_USE_EXECUTION_STD // Conflicts with our version of TBB
|
#ifdef QIDISLICER_USE_EXECUTION_STD // Conflicts with our version of TBB
|
||||||
#include <execution>
|
#include <execution>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ static constexpr ExecutionSeq ex_seq = {};
|
|||||||
template<class EP> struct IsSequentialEP_ { static constexpr bool value = false; };
|
template<class EP> struct IsSequentialEP_ { static constexpr bool value = false; };
|
||||||
|
|
||||||
template<> struct IsSequentialEP_<ExecutionSeq>: public std::true_type {};
|
template<> struct IsSequentialEP_<ExecutionSeq>: public std::true_type {};
|
||||||
#ifdef PRUSASLICER_USE_EXECUTION_STD
|
#ifdef QIDISLICER_USE_EXECUTION_STD
|
||||||
template<> struct IsExecutionPolicy_<std::execution::sequenced_policy>: public std::true_type {};
|
template<> struct IsExecutionPolicy_<std::execution::sequenced_policy>: public std::true_type {};
|
||||||
template<> struct IsSequentialEP_<std::execution::sequenced_policy>: public std::true_type {};
|
template<> struct IsSequentialEP_<std::execution::sequenced_policy>: public std::true_type {};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ static std::vector<std::string> s_project_options {
|
|||||||
"wiping_volumes_matrix"
|
"wiping_volumes_matrix"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *PresetBundle::PRUSA_BUNDLE = "QIDITechnology";
|
const char *PresetBundle::QIDI_BUNDLE = "QIDITechnology";
|
||||||
|
|
||||||
PresetBundle::PresetBundle() :
|
PresetBundle::PresetBundle() :
|
||||||
prints(Preset::TYPE_PRINT, Preset::print_options(), static_cast<const PrintRegionConfig&>(FullPrintConfig::defaults())),
|
prints(Preset::TYPE_PRINT, Preset::print_options(), static_cast<const PrintRegionConfig&>(FullPrintConfig::defaults())),
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public:
|
|||||||
bool transfer_and_save(Preset::Type type, const std::string& preset_from_name, const std::string& preset_to_name,
|
bool transfer_and_save(Preset::Type type, const std::string& preset_from_name, const std::string& preset_to_name,
|
||||||
const std::string& new_name, const std::vector<std::string>& options);
|
const std::string& new_name, const std::vector<std::string>& options);
|
||||||
|
|
||||||
static const char *PRUSA_BUNDLE;
|
static const char *QIDI_BUNDLE;
|
||||||
|
|
||||||
static std::array<Preset::Type, 3> types_list(PrinterTechnology pt) {
|
static std::array<Preset::Type, 3> types_list(PrinterTechnology pt) {
|
||||||
if (pt == ptFFF)
|
if (pt == ptFFF)
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
// paper: https://people.eecs.berkeley.edu/~jrs/meshpapers/GarlandHeckbert2.pdf
|
// paper: https://people.eecs.berkeley.edu/~jrs/meshpapers/GarlandHeckbert2.pdf
|
||||||
// sum up: https://users.csc.calpoly.edu/~zwood/teaching/csc570/final06/jseeba/
|
// sum up: https://users.csc.calpoly.edu/~zwood/teaching/csc570/final06/jseeba/
|
||||||
// inspiration: https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification
|
// inspiration: https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification
|
||||||
#ifndef PRUSASLICER_QUADRIC_EDGE_COLLAPSE_HPP
|
#ifndef QIDISLICER_QUADRIC_EDGE_COLLAPSE_HPP
|
||||||
#define PRUSASLICER_QUADRIC_EDGE_COLLAPSE_HPP
|
#define QIDISLICER_QUADRIC_EDGE_COLLAPSE_HPP
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -33,4 +33,4 @@ void its_quadric_edge_collapse(
|
|||||||
} // namespace Slic3r
|
} // namespace Slic3r
|
||||||
#endif // slic3r_quadric_edge_collapse_hpp_
|
#endif // slic3r_quadric_edge_collapse_hpp_
|
||||||
|
|
||||||
#endif // PRUSASLICER_QUADRIC_EDGE_COLLAPSE_HPP
|
#endif // QIDISLICER_QUADRIC_EDGE_COLLAPSE_HPP
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef libslic3r_TriangleSelector_hpp_
|
#ifndef libslic3r_TriangleSelector_hpp_
|
||||||
#define libslic3r_TriangleSelector_hpp_
|
#define libslic3r_TriangleSelector_hpp_
|
||||||
|
|
||||||
// #define PRUSASLICER_TRIANGLE_SELECTOR_DEBUG
|
// #define QIDISLICER_TRIANGLE_SELECTOR_DEBUG
|
||||||
|
|
||||||
|
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|||||||
@@ -186,9 +186,6 @@ set(SLIC3R_GUI_SOURCES
|
|||||||
GUI/ConfigWizard.cpp
|
GUI/ConfigWizard.cpp
|
||||||
GUI/ConfigWizard.hpp
|
GUI/ConfigWizard.hpp
|
||||||
GUI/ConfigWizard_private.hpp
|
GUI/ConfigWizard_private.hpp
|
||||||
GUI/BugWizard.cpp
|
|
||||||
GUI/BugWizard.hpp
|
|
||||||
GUI/BugWizard_private.hpp
|
|
||||||
GUI/MsgDialog.cpp
|
GUI/MsgDialog.cpp
|
||||||
GUI/MsgDialog.hpp
|
GUI/MsgDialog.hpp
|
||||||
GUI/UpdateDialogs.cpp
|
GUI/UpdateDialogs.cpp
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,64 +0,0 @@
|
|||||||
#ifndef slic3r_BugWizard_hpp_
|
|
||||||
#define slic3r_BugWizard_hpp_
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include <wx/dialog.h>
|
|
||||||
|
|
||||||
#include "GUI_Utils.hpp"
|
|
||||||
|
|
||||||
namespace Slic3r {
|
|
||||||
|
|
||||||
class BugPresetBundle;
|
|
||||||
class PresetUpdater;
|
|
||||||
|
|
||||||
namespace GUI {
|
|
||||||
|
|
||||||
|
|
||||||
class BugWizard: public DPIDialog
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// Why is the Wizard run
|
|
||||||
enum BugRunReason {
|
|
||||||
RR_DATA_EMPTY, // No or empty datadir
|
|
||||||
RR_DATA_LEGACY, // Pre-updating datadir
|
|
||||||
RR_DATA_INCOMPAT, // Incompatible datadir - Slic3r downgrade situation
|
|
||||||
RR_USER, // User requested the Wizard from the menus
|
|
||||||
};
|
|
||||||
|
|
||||||
// What page should wizard start on
|
|
||||||
enum BugStartPage {
|
|
||||||
SP_WELCOME,
|
|
||||||
SP_PRINTERS,
|
|
||||||
SP_FILAMENTS,
|
|
||||||
SP_MATERIALS,
|
|
||||||
};
|
|
||||||
|
|
||||||
BugWizard(wxWindow *parent);
|
|
||||||
BugWizard(BugWizard &&) = delete;
|
|
||||||
BugWizard(const BugWizard &) = delete;
|
|
||||||
BugWizard &operator=(BugWizard &&) = delete;
|
|
||||||
BugWizard &operator=(const BugWizard &) = delete;
|
|
||||||
~BugWizard();
|
|
||||||
|
|
||||||
// Run the Wizard. Return whether it was completed.
|
|
||||||
bool run(BugRunReason reason, BugStartPage start_page = SP_WELCOME);
|
|
||||||
|
|
||||||
static const wxString& name(const bool from_menu = false);
|
|
||||||
protected:
|
|
||||||
void on_dpi_changed(const wxRect &suggested_rect) override ;
|
|
||||||
void on_sys_color_changed() override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
struct priv;
|
|
||||||
std::unique_ptr<priv> p;
|
|
||||||
|
|
||||||
friend struct BugWizardPage;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,641 +0,0 @@
|
|||||||
#ifndef slic3r_BugWizard_private_hpp_
|
|
||||||
#define slic3r_BugWizard_private_hpp_
|
|
||||||
|
|
||||||
#include "BugWizard.hpp"
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <set>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <functional>
|
|
||||||
#include <boost/filesystem.hpp>
|
|
||||||
#include <boost/log/trivial.hpp>
|
|
||||||
|
|
||||||
#include <wx/panel.h>
|
|
||||||
#include <wx/button.h>
|
|
||||||
#include <wx/choice.h>
|
|
||||||
#include <wx/spinctrl.h>
|
|
||||||
#include <wx/listbox.h>
|
|
||||||
#include <wx/checklst.h>
|
|
||||||
#include <wx/radiobut.h>
|
|
||||||
#include <wx/html/htmlwin.h>
|
|
||||||
|
|
||||||
#include "libslic3r/PrintConfig.hpp"
|
|
||||||
#include "libslic3r/PresetBundle.hpp"
|
|
||||||
#include "slic3r/Utils/PresetUpdater.hpp"
|
|
||||||
#include "BedShapeDialog.hpp"
|
|
||||||
#include "GUI.hpp"
|
|
||||||
#include "SavePresetDialog.hpp"
|
|
||||||
#include "wxExtensions.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
namespace fs = boost::filesystem;
|
|
||||||
|
|
||||||
namespace Slic3r {
|
|
||||||
namespace GUI {
|
|
||||||
|
|
||||||
enum {
|
|
||||||
WRAP_WIDTH = 500,
|
|
||||||
MODEL_MIN_WRAP = 150,
|
|
||||||
|
|
||||||
DIALOG_MARGIN = 15,
|
|
||||||
INDEX_MARGIN = 40,
|
|
||||||
BTN_SPACING = 10,
|
|
||||||
INDENT_SPACING = 30,
|
|
||||||
VERTICAL_SPACING = 10,
|
|
||||||
|
|
||||||
MAX_COLS = 4,
|
|
||||||
ROW_SPACING = 75,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Configuration data structures extensions needed for the wizard
|
|
||||||
|
|
||||||
enum BugTechnology {
|
|
||||||
// Bitflag equivalent of PrinterBugTechnology
|
|
||||||
T_FFF = 0x1,
|
|
||||||
T_SLA = 0x2,
|
|
||||||
T_ANY = ~0,
|
|
||||||
};
|
|
||||||
enum BugBundleLocation{
|
|
||||||
IN_VENDOR,
|
|
||||||
IN_ARCHIVE,
|
|
||||||
IN_RESOURCES
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugBundle
|
|
||||||
{
|
|
||||||
std::unique_ptr<PresetBundle> preset_bundle;
|
|
||||||
VendorProfile* vendor_profile{ nullptr };
|
|
||||||
//bool is_in_resources{ false };
|
|
||||||
BugBundleLocation location;
|
|
||||||
bool is_qidi_bundle{ false };
|
|
||||||
|
|
||||||
BugBundle() = default;
|
|
||||||
BugBundle(BugBundle &&other);
|
|
||||||
|
|
||||||
// Returns false if not loaded. Reason for that is logged as boost::log error.
|
|
||||||
bool load(fs::path source_path, BugBundleLocation location, bool is_qidi_bundle = false);
|
|
||||||
|
|
||||||
const std::string& vendor_id() const { return vendor_profile->id; }
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugBundleMap : std::unordered_map<std::string /* = vendor ID */, BugBundle>
|
|
||||||
{
|
|
||||||
static BugBundleMap load();
|
|
||||||
|
|
||||||
BugBundle& qidi_bundle();
|
|
||||||
const BugBundle& qidi_bundle() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugMaterials
|
|
||||||
{
|
|
||||||
BugTechnology technology;
|
|
||||||
// use vector for the presets to purpose of save of presets sorting in the bundle
|
|
||||||
std::vector<const Preset*> presets;
|
|
||||||
// String is alias of material, size_t number of compatible counters
|
|
||||||
std::vector<std::pair<std::string, size_t>> compatibility_counter;
|
|
||||||
std::set<std::string> types;
|
|
||||||
std::set<const Preset*> printers;
|
|
||||||
|
|
||||||
BugMaterials(BugTechnology technology) : technology(technology) {}
|
|
||||||
|
|
||||||
void push(const Preset *preset);
|
|
||||||
void add_printer(const Preset* preset);
|
|
||||||
void clear();
|
|
||||||
bool containts(const Preset *preset) const {
|
|
||||||
//return std::find(presets.begin(), presets.end(), preset) != presets.end();
|
|
||||||
return std::find_if(presets.begin(), presets.end(),
|
|
||||||
[preset](const Preset* element) { return element == preset; }) != presets.end();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool get_omnipresent(const Preset* preset) {
|
|
||||||
return get_printer_counter(preset) == printers.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::vector<const Preset*> get_presets_by_alias(const std::string name) {
|
|
||||||
std::vector<const Preset*> ret_vec;
|
|
||||||
for (auto it = presets.begin(); it != presets.end(); ++it) {
|
|
||||||
if ((*it)->alias == name)
|
|
||||||
ret_vec.push_back((*it));
|
|
||||||
}
|
|
||||||
return ret_vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
size_t get_printer_counter(const Preset* preset) {
|
|
||||||
for (auto it : compatibility_counter) {
|
|
||||||
if (it.first == preset->alias)
|
|
||||||
return it.second;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& appconfig_section() const;
|
|
||||||
const std::string& get_type(const Preset *preset) const;
|
|
||||||
const std::string& get_vendor(const Preset *preset) const;
|
|
||||||
|
|
||||||
template<class F> void filter_presets(const Preset* printer, const std::string& type, const std::string& vendor, F cb) {
|
|
||||||
for (auto preset : presets) {
|
|
||||||
const Preset& prst = *(preset);
|
|
||||||
const Preset& prntr = *printer;
|
|
||||||
if ((printer == nullptr || is_compatible_with_printer(PresetWithVendorProfile(prst, prst.vendor), PresetWithVendorProfile(prntr, prntr.vendor))) &&
|
|
||||||
(type.empty() || get_type(preset) == type) &&
|
|
||||||
(vendor.empty() || get_vendor(preset) == vendor)) {
|
|
||||||
|
|
||||||
cb(preset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static const std::string UNKNOWN;
|
|
||||||
static const std::string& get_filament_type(const Preset *preset);
|
|
||||||
static const std::string& get_filament_vendor(const Preset *preset);
|
|
||||||
static const std::string& get_material_type(const Preset *preset);
|
|
||||||
static const std::string& get_material_vendor(const Preset *preset);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct BugPrinterPickerEvent;
|
|
||||||
|
|
||||||
// GUI elements
|
|
||||||
|
|
||||||
typedef std::function<bool(const VendorProfile::PrinterModel&)> BugModelFilter;
|
|
||||||
|
|
||||||
struct BugPrinterPicker: wxPanel
|
|
||||||
{
|
|
||||||
struct Checkbox : wxCheckBox
|
|
||||||
{
|
|
||||||
Checkbox(wxWindow *parent, const wxString &label, const std::string &model, const std::string &variant) :
|
|
||||||
wxCheckBox(parent, wxID_ANY, label),
|
|
||||||
model(model),
|
|
||||||
variant(variant)
|
|
||||||
{}
|
|
||||||
|
|
||||||
std::string model;
|
|
||||||
std::string variant;
|
|
||||||
};
|
|
||||||
|
|
||||||
const std::string vendor_id;
|
|
||||||
std::vector<Checkbox*> cboxes;
|
|
||||||
std::vector<Checkbox*> cboxes_alt;
|
|
||||||
|
|
||||||
BugPrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxString title, size_t max_cols, const AppConfig &appconfig, const BugModelFilter &filter);
|
|
||||||
BugPrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxString title, size_t max_cols, const AppConfig &appconfig);
|
|
||||||
|
|
||||||
void select_all(bool select, bool alternates = false);
|
|
||||||
void select_one(size_t i, bool select);
|
|
||||||
bool any_selected() const;
|
|
||||||
std::set<std::string> get_selected_models() const ;
|
|
||||||
|
|
||||||
int get_width() const { return width; }
|
|
||||||
const std::vector<int>& get_button_indexes() { return m_button_indexes; }
|
|
||||||
|
|
||||||
static const std::string PRINTER_PLACEHOLDER;
|
|
||||||
private:
|
|
||||||
int width;
|
|
||||||
std::vector<int> m_button_indexes;
|
|
||||||
|
|
||||||
void on_checkbox(const Checkbox *cbox, bool checked);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugWizardPage: wxPanel
|
|
||||||
{
|
|
||||||
BugWizard *parent;
|
|
||||||
const wxString shortname;
|
|
||||||
wxBoxSizer *content;
|
|
||||||
const unsigned indent;
|
|
||||||
|
|
||||||
BugWizardPage(BugWizard *parent, wxString title, wxString shortname, unsigned indent = 0);
|
|
||||||
virtual ~BugWizardPage();
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
T* append(T *thing, int proportion = 0, int flag = wxEXPAND|wxTOP|wxBOTTOM, int border = 10)
|
|
||||||
{
|
|
||||||
content->Add(thing, proportion, flag, border);
|
|
||||||
return thing;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxStaticText* append_text(wxString text);
|
|
||||||
void append_spacer(int space);
|
|
||||||
|
|
||||||
BugWizard::priv *wizard_p() const { return parent->p.get(); }
|
|
||||||
|
|
||||||
virtual void apply_custom_config(DynamicPrintConfig &config) {}
|
|
||||||
virtual void set_run_reason(BugWizard::BugRunReason run_reason) {}
|
|
||||||
virtual void on_activate() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugPageWelcome: BugWizardPage
|
|
||||||
{
|
|
||||||
wxStaticText *welcome_text;
|
|
||||||
wxCheckBox *cbox_reset;
|
|
||||||
wxCheckBox *cbox_integrate;
|
|
||||||
|
|
||||||
BugPageWelcome(BugWizard *parent);
|
|
||||||
|
|
||||||
bool reset_user_profile() const { return cbox_reset != nullptr ? cbox_reset->GetValue() : false; }
|
|
||||||
bool integrate_desktop() const { return cbox_integrate != nullptr ? cbox_integrate->GetValue() : false; }
|
|
||||||
|
|
||||||
virtual void set_run_reason(BugWizard::BugRunReason run_reason) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugPagePrinters: BugWizardPage
|
|
||||||
{
|
|
||||||
std::vector<BugPrinterPicker *> printer_pickers;
|
|
||||||
BugTechnology technology;
|
|
||||||
bool install;
|
|
||||||
|
|
||||||
BugPagePrinters(BugWizard *parent,
|
|
||||||
wxString title,
|
|
||||||
wxString shortname,
|
|
||||||
const VendorProfile &vendor,
|
|
||||||
unsigned indent, BugTechnology technology);
|
|
||||||
|
|
||||||
void select_all(bool select, bool alternates = false);
|
|
||||||
int get_width() const;
|
|
||||||
bool any_selected() const;
|
|
||||||
std::set<std::string> get_selected_models();
|
|
||||||
|
|
||||||
std::string get_vendor_id() const { return printer_pickers.empty() ? "" : printer_pickers[0]->vendor_id; }
|
|
||||||
|
|
||||||
virtual void set_run_reason(BugWizard::BugRunReason run_reason) override;
|
|
||||||
|
|
||||||
bool has_printers { false };
|
|
||||||
bool is_primary_printer_page { false };
|
|
||||||
};
|
|
||||||
|
|
||||||
// Here we extend wxListBox and wxCheckListBox
|
|
||||||
// to make the client data API much easier to use.
|
|
||||||
template<class T, class D> struct DataList : public T
|
|
||||||
{
|
|
||||||
DataList(wxWindow *parent) : T(parent, wxID_ANY) {}
|
|
||||||
DataList(wxWindow* parent, int style) : T(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, style) {}
|
|
||||||
|
|
||||||
// Note: We're _not_ using wxLB_SORT here because it doesn't do the right thing,
|
|
||||||
// eg. "ABS" is sorted before "(All)"
|
|
||||||
|
|
||||||
int append(const std::string &label, const D *data) {
|
|
||||||
void *ptr = reinterpret_cast<void*>(const_cast<D*>(data));
|
|
||||||
return this->Append(from_u8(label), ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
int append(const wxString &label, const D *data) {
|
|
||||||
void *ptr = reinterpret_cast<void*>(const_cast<D*>(data));
|
|
||||||
return this->Append(label, ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
const D& get_data(int n) {
|
|
||||||
return *reinterpret_cast<const D*>(this->GetClientData(n));
|
|
||||||
}
|
|
||||||
|
|
||||||
int find(const D &data) {
|
|
||||||
for (unsigned i = 0; i < this->GetCount(); i++) {
|
|
||||||
if (get_data(i) == data) { return i; }
|
|
||||||
}
|
|
||||||
|
|
||||||
return wxNOT_FOUND;
|
|
||||||
}
|
|
||||||
|
|
||||||
int size() { return this->GetCount(); }
|
|
||||||
|
|
||||||
void on_mouse_move(const wxPoint& position) {
|
|
||||||
int item = T::HitTest(position);
|
|
||||||
|
|
||||||
if(item == wxHitTest::wxHT_WINDOW_INSIDE)
|
|
||||||
BOOST_LOG_TRIVIAL(error) << "hit test wxHT_WINDOW_INSIDE";
|
|
||||||
else if (item == wxHitTest::wxHT_WINDOW_OUTSIDE)
|
|
||||||
BOOST_LOG_TRIVIAL(error) << "hit test wxHT_WINDOW_OUTSIDE";
|
|
||||||
else if(item == wxHitTest::wxHT_WINDOW_CORNER)
|
|
||||||
BOOST_LOG_TRIVIAL(error) << "hit test wxHT_WINDOW_CORNER";
|
|
||||||
else if (item == wxHitTest::wxHT_WINDOW_VERT_SCROLLBAR)
|
|
||||||
BOOST_LOG_TRIVIAL(error) << "hit test wxHT_WINDOW_VERT_SCROLLBAR";
|
|
||||||
else if (item == wxHitTest::wxHT_NOWHERE)
|
|
||||||
BOOST_LOG_TRIVIAL(error) << "hit test wxHT_NOWHERE";
|
|
||||||
else if (item == wxHitTest::wxHT_MAX)
|
|
||||||
BOOST_LOG_TRIVIAL(error) << "hit test wxHT_MAX";
|
|
||||||
else
|
|
||||||
BOOST_LOG_TRIVIAL(error) << "hit test: " << item;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef DataList<wxListBox, std::string> BugStringList;
|
|
||||||
typedef DataList<wxCheckListBox, std::string> BugPresetList;
|
|
||||||
|
|
||||||
struct BugProfilePrintData
|
|
||||||
{
|
|
||||||
std::reference_wrapper<const std::string> name;
|
|
||||||
bool omnipresent;
|
|
||||||
bool checked;
|
|
||||||
BugProfilePrintData(const std::string& n, bool o, bool c) : name(n), omnipresent(o), checked(c) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugPageMaterials: BugWizardPage
|
|
||||||
{
|
|
||||||
BugMaterials *materials;
|
|
||||||
BugStringList *list_printer, *list_type, *list_vendor;
|
|
||||||
BugPresetList *list_profile;
|
|
||||||
wxArrayInt sel_printers_prev;
|
|
||||||
int sel_type_prev, sel_vendor_prev;
|
|
||||||
bool presets_loaded;
|
|
||||||
|
|
||||||
wxFlexGridSizer *grid;
|
|
||||||
wxHtmlWindow* html_window;
|
|
||||||
|
|
||||||
int compatible_printers_width = { 100 };
|
|
||||||
std::string empty_printers_label;
|
|
||||||
bool first_paint = { false };
|
|
||||||
static const std::string EMPTY;
|
|
||||||
int last_hovered_item = { -1 } ;
|
|
||||||
|
|
||||||
BugPageMaterials(BugWizard *parent, BugMaterials *materials, wxString title, wxString shortname, wxString list1name);
|
|
||||||
|
|
||||||
void reload_presets();
|
|
||||||
void update_lists(int sel_type, int sel_vendor, int last_selected_printer = -1);
|
|
||||||
void on_material_highlighted(int sel_material);
|
|
||||||
void on_material_hovered(int sel_material);
|
|
||||||
void select_material(int i);
|
|
||||||
void select_all(bool select);
|
|
||||||
void clear();
|
|
||||||
void set_compatible_printers_html_window(const std::vector<std::string>& printer_names, bool all_printers = false);
|
|
||||||
void clear_compatible_printers_label();
|
|
||||||
|
|
||||||
void sort_list_data(BugStringList* list, bool add_All_item, bool material_type_ordering);
|
|
||||||
void sort_list_data(BugPresetList* list, const std::vector<BugProfilePrintData>& data);
|
|
||||||
|
|
||||||
void on_paint();
|
|
||||||
void on_mouse_move_on_profiles(wxMouseEvent& evt);
|
|
||||||
void on_mouse_enter_profiles(wxMouseEvent& evt);
|
|
||||||
void on_mouse_leave_profiles(wxMouseEvent& evt);
|
|
||||||
virtual void on_activate() override;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugPageCustom: BugWizardPage
|
|
||||||
{
|
|
||||||
BugPageCustom(BugWizard *parent);
|
|
||||||
|
|
||||||
bool custom_wanted() const { return cb_custom->GetValue(); }
|
|
||||||
std::string profile_name() const { return into_u8(tc_profile_name->GetValue()); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
static const char* default_profile_name;
|
|
||||||
|
|
||||||
wxCheckBox *cb_custom;
|
|
||||||
wxTextCtrl *tc_profile_name;
|
|
||||||
wxString profile_name_prev;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugPageUpdate: BugWizardPage
|
|
||||||
{
|
|
||||||
bool version_check;
|
|
||||||
bool preset_update;
|
|
||||||
|
|
||||||
BugPageUpdate(BugWizard *parent);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugPageReloadFromDisk : BugWizardPage
|
|
||||||
{
|
|
||||||
bool full_pathnames;
|
|
||||||
|
|
||||||
BugPageReloadFromDisk(BugWizard* parent);
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
struct BugPageFilesAssociation : BugWizardPage
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
wxCheckBox* cb_3mf{ nullptr };
|
|
||||||
wxCheckBox* cb_stl{ nullptr };
|
|
||||||
// wxCheckBox* cb_gcode;
|
|
||||||
|
|
||||||
public:
|
|
||||||
BugPageFilesAssociation(BugWizard* parent);
|
|
||||||
|
|
||||||
bool associate_3mf() const { return cb_3mf->IsChecked(); }
|
|
||||||
bool associate_stl() const { return cb_stl->IsChecked(); }
|
|
||||||
// bool associate_gcode() const { return cb_gcode->IsChecked(); }
|
|
||||||
};
|
|
||||||
#endif // _WIN32
|
|
||||||
|
|
||||||
struct BugPageMode: BugWizardPage
|
|
||||||
{
|
|
||||||
wxRadioButton *radio_simple;
|
|
||||||
wxRadioButton *radio_advanced;
|
|
||||||
wxRadioButton *radio_expert;
|
|
||||||
|
|
||||||
wxCheckBox *check_inch;
|
|
||||||
|
|
||||||
BugPageMode(BugWizard *parent);
|
|
||||||
|
|
||||||
void serialize_mode(AppConfig *app_config) const;
|
|
||||||
|
|
||||||
virtual void on_activate();
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugPageVendors: BugWizardPage
|
|
||||||
{
|
|
||||||
BugPageVendors(BugWizard *parent);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugPageFirmware: BugWizardPage
|
|
||||||
{
|
|
||||||
const ConfigOptionDef &gcode_opt;
|
|
||||||
wxChoice *gcode_picker;
|
|
||||||
|
|
||||||
BugPageFirmware(BugWizard *parent);
|
|
||||||
virtual void apply_custom_config(DynamicPrintConfig &config);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugPageBedShape: BugWizardPage
|
|
||||||
{
|
|
||||||
BedShapePanel *shape_panel;
|
|
||||||
|
|
||||||
BugPageBedShape(BugWizard *parent);
|
|
||||||
virtual void apply_custom_config(DynamicPrintConfig &config);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugPageDiameters: BugWizardPage
|
|
||||||
{
|
|
||||||
wxTextCtrl *diam_nozzle;
|
|
||||||
wxTextCtrl *diam_filam;
|
|
||||||
|
|
||||||
BugPageDiameters(BugWizard *parent);
|
|
||||||
virtual void apply_custom_config(DynamicPrintConfig &config);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct BugPageTemperatures: BugWizardPage
|
|
||||||
{
|
|
||||||
wxSpinCtrlDouble *spin_extr;
|
|
||||||
wxSpinCtrlDouble *spin_bed;
|
|
||||||
|
|
||||||
BugPageTemperatures(BugWizard *parent);
|
|
||||||
virtual void apply_custom_config(DynamicPrintConfig &config);
|
|
||||||
};
|
|
||||||
|
|
||||||
// hypothetically, each vendor can has printers both of technologies (FFF and SLA)
|
|
||||||
typedef std::map<std::string /* = vendor ID */,
|
|
||||||
std::pair<BugPagePrinters* /* = FFF page */,
|
|
||||||
BugPagePrinters* /* = SLA page */>> BugPages3rdparty;
|
|
||||||
|
|
||||||
|
|
||||||
class BugWizardIndex: public wxPanel
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BugWizardIndex(wxWindow *parent);
|
|
||||||
|
|
||||||
void add_page(BugWizardPage *page);
|
|
||||||
void add_label(wxString label, unsigned indent = 0);
|
|
||||||
|
|
||||||
size_t active_item() const { return item_active; }
|
|
||||||
BugWizardPage* active_page() const;
|
|
||||||
bool active_is_last() const { return item_active < items.size() && item_active == last_page; }
|
|
||||||
|
|
||||||
void go_prev();
|
|
||||||
void go_next();
|
|
||||||
void go_to(size_t i);
|
|
||||||
void go_to(const BugWizardPage *page);
|
|
||||||
|
|
||||||
void clear();
|
|
||||||
void msw_rescale();
|
|
||||||
|
|
||||||
int em() const { return em_w; }
|
|
||||||
|
|
||||||
static const size_t NO_ITEM = size_t(-1);
|
|
||||||
private:
|
|
||||||
struct Item
|
|
||||||
{
|
|
||||||
wxString label;
|
|
||||||
unsigned indent;
|
|
||||||
BugWizardPage *page; // nullptr page => label-only item
|
|
||||||
|
|
||||||
bool operator==(BugWizardPage *page) const { return this->page == page; }
|
|
||||||
};
|
|
||||||
|
|
||||||
int em_w;
|
|
||||||
int em_h;
|
|
||||||
ScalableBitmap bg;
|
|
||||||
ScalableBitmap bullet_black;
|
|
||||||
ScalableBitmap bullet_blue;
|
|
||||||
ScalableBitmap bullet_white;
|
|
||||||
|
|
||||||
std::vector<Item> items;
|
|
||||||
size_t item_active;
|
|
||||||
ssize_t item_hover;
|
|
||||||
size_t last_page;
|
|
||||||
|
|
||||||
int item_height() const { return std::max(bullet_black.GetHeight(), em_w) + em_w; }
|
|
||||||
//int item_height() const { return std::max(bullet_black.bmp().GetSize().GetHeight(), em_w) + em_w; }
|
|
||||||
|
|
||||||
void on_paint(wxPaintEvent &evt);
|
|
||||||
void on_mouse_move(wxMouseEvent &evt);
|
|
||||||
};
|
|
||||||
|
|
||||||
wxDEFINE_EVENT(EVT_INDEX_PAGE, wxCommandEvent);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// BugWizard private data
|
|
||||||
|
|
||||||
typedef std::map<std::string, std::set<std::string>> BugPresetAliases;
|
|
||||||
|
|
||||||
struct BugWizard::priv
|
|
||||||
{
|
|
||||||
BugWizard *q;
|
|
||||||
BugWizard::BugRunReason run_reason = RR_USER;
|
|
||||||
AppConfig appconfig_new; // Backing for vendor/model/variant and material selections in the GUI
|
|
||||||
BugBundleMap bundles; // Holds all loaded config bundles, the key is the vendor names.
|
|
||||||
// BugMaterials refers to Presets in those bundles by pointers.
|
|
||||||
// Also we update the is_visible flag in printer Presets according to the
|
|
||||||
// BugPrinterPickers state.
|
|
||||||
BugMaterials filaments; // Holds available filament presets and their types & vendors
|
|
||||||
BugMaterials sla_materials; // Ditto for SLA materials
|
|
||||||
BugPresetAliases aliases_fff; // Map of aliase to preset names
|
|
||||||
BugPresetAliases aliases_sla; // Map of aliase to preset names
|
|
||||||
std::unique_ptr<DynamicPrintConfig> custom_config; // Backing for custom printer definition
|
|
||||||
bool any_fff_selected; // Used to decide whether to display Filaments page
|
|
||||||
bool any_sla_selected; // Used to decide whether to display SLA BugMaterials page
|
|
||||||
bool custom_printer_selected { false };
|
|
||||||
// Set to true if there are none FFF printers on the main FFF page. If true, only SLA printers are shown (not even custum printers)
|
|
||||||
bool only_sla_mode { false };
|
|
||||||
|
|
||||||
wxScrolledWindow *hscroll = nullptr;
|
|
||||||
wxBoxSizer *hscroll_sizer = nullptr;
|
|
||||||
wxBoxSizer *btnsizer = nullptr;
|
|
||||||
BugWizardPage *page_current = nullptr;
|
|
||||||
BugWizardIndex *index = nullptr;
|
|
||||||
wxButton *btn_sel_all = nullptr;
|
|
||||||
wxButton *btn_prev = nullptr;
|
|
||||||
wxButton *btn_next = nullptr;
|
|
||||||
wxButton *btn_finish = nullptr;
|
|
||||||
wxButton *btn_cancel = nullptr;
|
|
||||||
wxStaticText *head_label = nullptr;
|
|
||||||
|
|
||||||
BugPageWelcome *page_welcome = nullptr;
|
|
||||||
BugPagePrinters *page_fff = nullptr;
|
|
||||||
BugPagePrinters *page_msla = nullptr;
|
|
||||||
BugPageMaterials *page_filaments = nullptr;
|
|
||||||
BugPageMaterials *page_sla_materials = nullptr;
|
|
||||||
BugPageCustom *page_custom = nullptr;
|
|
||||||
BugPageUpdate *page_update = nullptr;
|
|
||||||
BugPageReloadFromDisk *page_reload_from_disk = nullptr;
|
|
||||||
#ifdef _WIN32
|
|
||||||
BugPageFilesAssociation* page_files_association = nullptr;
|
|
||||||
#endif // _WIN32
|
|
||||||
BugPageMode *page_mode = nullptr;
|
|
||||||
BugPageVendors *page_vendors = nullptr;
|
|
||||||
BugPages3rdparty pages_3rdparty;
|
|
||||||
|
|
||||||
// Custom setup pages
|
|
||||||
BugPageFirmware *page_firmware = nullptr;
|
|
||||||
BugPageBedShape *page_bed = nullptr;
|
|
||||||
BugPageDiameters *page_diams = nullptr;
|
|
||||||
BugPageTemperatures *page_temps = nullptr;
|
|
||||||
|
|
||||||
// Pointers to all pages (regardless or whether currently part of the BugWizardIndex)
|
|
||||||
std::vector<BugWizardPage*> all_pages;
|
|
||||||
|
|
||||||
priv(BugWizard *q)
|
|
||||||
: q(q)
|
|
||||||
, appconfig_new(AppConfig::EAppMode::Editor)
|
|
||||||
, filaments(T_FFF)
|
|
||||||
, sla_materials(T_SLA)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void load_pages();
|
|
||||||
void init_dialog_size();
|
|
||||||
|
|
||||||
void load_vendors();
|
|
||||||
void add_page(BugWizardPage *page);
|
|
||||||
void enable_next(bool enable);
|
|
||||||
void set_start_page(BugWizard::BugStartPage start_page);
|
|
||||||
void create_3rdparty_pages();
|
|
||||||
void set_run_reason(BugRunReason run_reason);
|
|
||||||
void update_materials(BugTechnology technology);
|
|
||||||
|
|
||||||
void on_custom_setup(const bool custom_wanted);
|
|
||||||
void on_printer_pick(BugPagePrinters *page, const BugPrinterPickerEvent &evt);
|
|
||||||
void select_default_materials_for_printer_model(const VendorProfile::PrinterModel &printer_model, BugTechnology technology);
|
|
||||||
void select_default_materials_for_printer_models(BugTechnology technology, const std::set<const VendorProfile::PrinterModel*> &printer_models);
|
|
||||||
void on_3rdparty_install(const VendorProfile *vendor, bool install);
|
|
||||||
|
|
||||||
bool on_bnt_finish();
|
|
||||||
bool check_and_install_missing_materials(BugTechnology technology, const std::string &only_for_model_id = std::string());
|
|
||||||
bool apply_config(AppConfig *app_config, PresetBundle *preset_bundle, const PresetUpdater *updater, bool& apply_keeped_changes);
|
|
||||||
// #ys_FIXME_alise
|
|
||||||
void update_presets_in_config(const std::string& section, const std::string& alias_key, bool add);
|
|
||||||
#ifdef __linux__
|
|
||||||
void perform_desktop_integration() const;
|
|
||||||
#endif
|
|
||||||
bool check_fff_selected(); // Used to decide whether to display Filaments page
|
|
||||||
bool check_sla_selected(); // Used to decide whether to display SLA BugMaterials page
|
|
||||||
|
|
||||||
int em() const { return index->em(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -122,20 +122,20 @@ BundleMap BundleMap::load()
|
|||||||
const auto rsrc_vendor_dir = (boost::filesystem::path(resources_dir()) / "profiles").make_preferred();
|
const auto rsrc_vendor_dir = (boost::filesystem::path(resources_dir()) / "profiles").make_preferred();
|
||||||
const auto cache_dir = boost::filesystem::path(Slic3r::data_dir()) / "cache"; // for Index
|
const auto cache_dir = boost::filesystem::path(Slic3r::data_dir()) / "cache"; // for Index
|
||||||
// Load QIDI bundle from the datadir/vendor directory or from datadir/cache/vendor (archive) or from resources/profiles.
|
// Load QIDI bundle from the datadir/vendor directory or from datadir/cache/vendor (archive) or from resources/profiles.
|
||||||
auto qidi_bundle_path = (vendor_dir / PresetBundle::PRUSA_BUNDLE).replace_extension(".ini");
|
auto qidi_bundle_path = (vendor_dir / PresetBundle::QIDI_BUNDLE).replace_extension(".ini");
|
||||||
BundleLocation qidi_bundle_loc = BundleLocation::IN_VENDOR;
|
BundleLocation qidi_bundle_loc = BundleLocation::IN_VENDOR;
|
||||||
if (! boost::filesystem::exists(qidi_bundle_path)) {
|
if (! boost::filesystem::exists(qidi_bundle_path)) {
|
||||||
qidi_bundle_path = (archive_dir / PresetBundle::PRUSA_BUNDLE).replace_extension(".ini");
|
qidi_bundle_path = (archive_dir / PresetBundle::QIDI_BUNDLE).replace_extension(".ini");
|
||||||
qidi_bundle_loc = BundleLocation::IN_ARCHIVE;
|
qidi_bundle_loc = BundleLocation::IN_ARCHIVE;
|
||||||
}
|
}
|
||||||
if (!boost::filesystem::exists(qidi_bundle_path)) {
|
if (!boost::filesystem::exists(qidi_bundle_path)) {
|
||||||
qidi_bundle_path = (rsrc_vendor_dir / PresetBundle::PRUSA_BUNDLE).replace_extension(".ini");
|
qidi_bundle_path = (rsrc_vendor_dir / PresetBundle::QIDI_BUNDLE).replace_extension(".ini");
|
||||||
qidi_bundle_loc = BundleLocation::IN_RESOURCES;
|
qidi_bundle_loc = BundleLocation::IN_RESOURCES;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Bundle qidi_bundle;
|
Bundle qidi_bundle;
|
||||||
if (qidi_bundle.load(std::move(qidi_bundle_path), qidi_bundle_loc, true))
|
if (qidi_bundle.load(std::move(qidi_bundle_path), qidi_bundle_loc, true))
|
||||||
res.emplace(PresetBundle::PRUSA_BUNDLE, std::move(qidi_bundle));
|
res.emplace(PresetBundle::QIDI_BUNDLE, std::move(qidi_bundle));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the other bundles in the datadir/vendor directory
|
// Load the other bundles in the datadir/vendor directory
|
||||||
@@ -208,9 +208,9 @@ BundleMap BundleMap::load()
|
|||||||
|
|
||||||
Bundle& BundleMap::qidi_bundle()
|
Bundle& BundleMap::qidi_bundle()
|
||||||
{
|
{
|
||||||
auto it = find(PresetBundle::PRUSA_BUNDLE);
|
auto it = find(PresetBundle::QIDI_BUNDLE);
|
||||||
if (it == end()) {
|
if (it == end()) {
|
||||||
throw Slic3r::RuntimeError("ConfigWizard: Internal error in BundleMap: PRUSA_BUNDLE not loaded");
|
throw Slic3r::RuntimeError("ConfigWizard: Internal error in BundleMap: QIDI_BUNDLE not loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
return it->second;
|
return it->second;
|
||||||
@@ -679,7 +679,7 @@ void PagePrinters::set_run_reason(ConfigWizard::RunReason run_reason)
|
|||||||
if (is_primary_printer_page
|
if (is_primary_printer_page
|
||||||
&& (run_reason == ConfigWizard::RR_DATA_EMPTY || run_reason == ConfigWizard::RR_DATA_LEGACY)
|
&& (run_reason == ConfigWizard::RR_DATA_EMPTY || run_reason == ConfigWizard::RR_DATA_LEGACY)
|
||||||
&& printer_pickers.size() > 0
|
&& printer_pickers.size() > 0
|
||||||
&& printer_pickers[0]->vendor_id == PresetBundle::PRUSA_BUNDLE) {
|
&& printer_pickers[0]->vendor_id == PresetBundle::QIDI_BUNDLE) {
|
||||||
printer_pickers[0]->select_one(0, true);
|
printer_pickers[0]->select_one(0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1681,7 +1681,7 @@ PageVendors::PageVendors(ConfigWizard *parent)
|
|||||||
|
|
||||||
for (const std::pair<std::wstring, const VendorProfile*>& v : vendors) {
|
for (const std::pair<std::wstring, const VendorProfile*>& v : vendors) {
|
||||||
const VendorProfile* vendor = v.second;
|
const VendorProfile* vendor = v.second;
|
||||||
if (vendor->id == PresetBundle::PRUSA_BUNDLE) { continue; }
|
if (vendor->id == PresetBundle::QIDI_BUNDLE) { continue; }
|
||||||
if (vendor && vendor->templates_profile)
|
if (vendor && vendor->templates_profile)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -2518,7 +2518,7 @@ void ConfigWizard::priv::create_3rdparty_pages()
|
|||||||
{
|
{
|
||||||
for (const auto &pair : bundles) {
|
for (const auto &pair : bundles) {
|
||||||
const VendorProfile *vendor = pair.second.vendor_profile;
|
const VendorProfile *vendor = pair.second.vendor_profile;
|
||||||
if (vendor->id == PresetBundle::PRUSA_BUNDLE) { continue; }
|
if (vendor->id == PresetBundle::QIDI_BUNDLE) { continue; }
|
||||||
|
|
||||||
bool is_fff_technology = false;
|
bool is_fff_technology = false;
|
||||||
bool is_sla_technology = false;
|
bool is_sla_technology = false;
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ bool FirmwareDialog::priv::check_model_id()
|
|||||||
|
|
||||||
// std::string line;
|
// std::string line;
|
||||||
// error_code ec;
|
// error_code ec;
|
||||||
// serial.printer_write_line("PRUSA Rev");
|
// serial.printer_write_line("QIDI Rev");
|
||||||
// while (serial.read_line(TIMEOUT, line, ec)) {
|
// while (serial.read_line(TIMEOUT, line, ec)) {
|
||||||
// if (ec) {
|
// if (ec) {
|
||||||
// queue_error(wxString::Format(_(L("Could not connect to the printer at %s")), port->port));
|
// queue_error(wxString::Format(_(L("Could not connect to the printer at %s")), port->port));
|
||||||
|
|||||||
@@ -3096,39 +3096,6 @@ bool GUI_App::run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
//B19
|
|
||||||
bool GUI_App::run_bwizard(BugWizard::BugRunReason reason, BugWizard::BugStartPage start_page)
|
|
||||||
{
|
|
||||||
wxCHECK_MSG(mainframe != nullptr, false, "Internal error: Main frame not created / null");
|
|
||||||
|
|
||||||
if (reason == BugWizard::RR_USER) {
|
|
||||||
// Cancel sync before starting wizard to prevent two downloads at same time
|
|
||||||
preset_updater->cancel_sync();
|
|
||||||
preset_updater->update_index_db();
|
|
||||||
if (preset_updater->config_update(app_config->orig_version(), PresetUpdater::UpdateParams::FORCED_BEFORE_WIZARD) == PresetUpdater::R_ALL_CANCELED)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto wizard = new BugWizard(mainframe);
|
|
||||||
const bool res = wizard->run(reason, start_page);
|
|
||||||
|
|
||||||
// !!! Deallocate memory after close ConfigWizard.
|
|
||||||
// Note, that mainframe is a parent of ConfigWizard.
|
|
||||||
// So, wizard will be destroyed only during destroying of mainframe
|
|
||||||
// To avoid this state the wizard have to be disconnected from mainframe and Destroyed explicitly
|
|
||||||
mainframe->RemoveChild(wizard);
|
|
||||||
wizard->Destroy();
|
|
||||||
|
|
||||||
if (res) {
|
|
||||||
load_current_presets();
|
|
||||||
|
|
||||||
// #ysFIXME - delete after testing: This part of code looks redundant. All checks are inside ConfigWizard::priv::apply_config()
|
|
||||||
if (preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA)
|
|
||||||
may_switch_to_SLA_preset(_L("Configuration is editing from BugWizard"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GUI_App::show_desktop_integration_dialog()
|
void GUI_App::show_desktop_integration_dialog()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,8 +5,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "ImGuiWrapper.hpp"
|
#include "ImGuiWrapper.hpp"
|
||||||
#include "ConfigWizard.hpp"
|
#include "ConfigWizard.hpp"
|
||||||
//B19
|
|
||||||
#include "BugWizard.hpp"
|
|
||||||
#include "OpenGLManager.hpp"
|
#include "OpenGLManager.hpp"
|
||||||
#include "libslic3r/Preset.hpp"
|
#include "libslic3r/Preset.hpp"
|
||||||
|
|
||||||
@@ -357,8 +355,6 @@ public:
|
|||||||
void open_web_page_localized(const std::string &http_address);
|
void open_web_page_localized(const std::string &http_address);
|
||||||
bool may_switch_to_SLA_preset(const wxString& caption);
|
bool may_switch_to_SLA_preset(const wxString& caption);
|
||||||
bool run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage start_page = ConfigWizard::SP_WELCOME);
|
bool run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage start_page = ConfigWizard::SP_WELCOME);
|
||||||
//B19
|
|
||||||
bool run_bwizard(BugWizard::BugRunReason reason, BugWizard::BugStartPage start_page = BugWizard::SP_WELCOME);
|
|
||||||
void show_desktop_integration_dialog();
|
void show_desktop_integration_dialog();
|
||||||
void show_downloader_registration_dialog();
|
void show_downloader_registration_dialog();
|
||||||
|
|
||||||
|
|||||||
@@ -887,12 +887,12 @@ void TriangleSelectorGUI::render(ImGuiWrapper* imgui, const Transform3d& matrix)
|
|||||||
|
|
||||||
render_paint_contour(matrix);
|
render_paint_contour(matrix);
|
||||||
|
|
||||||
#ifdef PRUSASLICER_TRIANGLE_SELECTOR_DEBUG
|
#ifdef QIDISLICER_TRIANGLE_SELECTOR_DEBUG
|
||||||
if (imgui)
|
if (imgui)
|
||||||
render_debug(imgui);
|
render_debug(imgui);
|
||||||
else
|
else
|
||||||
assert(false); // If you want debug output, pass ptr to ImGuiWrapper.
|
assert(false); // If you want debug output, pass ptr to ImGuiWrapper.
|
||||||
#endif // PRUSASLICER_TRIANGLE_SELECTOR_DEBUG
|
#endif // QIDISLICER_TRIANGLE_SELECTOR_DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriangleSelectorGUI::update_render_data()
|
void TriangleSelectorGUI::update_render_data()
|
||||||
@@ -958,7 +958,7 @@ void TriangleSelectorGUI::update_render_data()
|
|||||||
update_paint_contour();
|
update_paint_contour();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PRUSASLICER_TRIANGLE_SELECTOR_DEBUG
|
#ifdef QIDISLICER_TRIANGLE_SELECTOR_DEBUG
|
||||||
void TriangleSelectorGUI::render_debug(ImGuiWrapper* imgui)
|
void TriangleSelectorGUI::render_debug(ImGuiWrapper* imgui)
|
||||||
{
|
{
|
||||||
imgui->begin(std::string("TriangleSelector dialog (DEV ONLY)"),
|
imgui->begin(std::string("TriangleSelector dialog (DEV ONLY)"),
|
||||||
@@ -1065,7 +1065,7 @@ void TriangleSelectorGUI::render_debug(ImGuiWrapper* imgui)
|
|||||||
if (curr_shader != nullptr)
|
if (curr_shader != nullptr)
|
||||||
curr_shader->start_using();
|
curr_shader->start_using();
|
||||||
}
|
}
|
||||||
#endif // PRUSASLICER_TRIANGLE_SELECTOR_DEBUG
|
#endif // QIDISLICER_TRIANGLE_SELECTOR_DEBUG
|
||||||
|
|
||||||
void TriangleSelectorGUI::update_paint_contour()
|
void TriangleSelectorGUI::update_paint_contour()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,11 +41,11 @@ public:
|
|||||||
|
|
||||||
void request_update_render_data() { m_update_render_data = true; }
|
void request_update_render_data() { m_update_render_data = true; }
|
||||||
|
|
||||||
#ifdef PRUSASLICER_TRIANGLE_SELECTOR_DEBUG
|
#ifdef QIDISLICER_TRIANGLE_SELECTOR_DEBUG
|
||||||
void render_debug(ImGuiWrapper* imgui);
|
void render_debug(ImGuiWrapper* imgui);
|
||||||
bool m_show_triangles{false};
|
bool m_show_triangles{false};
|
||||||
bool m_show_invalid{false};
|
bool m_show_invalid{false};
|
||||||
#endif // PRUSASLICER_TRIANGLE_SELECTOR_DEBUG
|
#endif // QIDISLICER_TRIANGLE_SELECTOR_DEBUG
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_update_render_data = false;
|
bool m_update_render_data = false;
|
||||||
@@ -58,9 +58,9 @@ private:
|
|||||||
GLModel m_iva_enforcers;
|
GLModel m_iva_enforcers;
|
||||||
GLModel m_iva_blockers;
|
GLModel m_iva_blockers;
|
||||||
std::array<GLModel, 3> m_iva_seed_fills;
|
std::array<GLModel, 3> m_iva_seed_fills;
|
||||||
#ifdef PRUSASLICER_TRIANGLE_SELECTOR_DEBUG
|
#ifdef QIDISLICER_TRIANGLE_SELECTOR_DEBUG
|
||||||
std::array<GLModel, 3> m_varrays;
|
std::array<GLModel, 3> m_varrays;
|
||||||
#endif // PRUSASLICER_TRIANGLE_SELECTOR_DEBUG
|
#endif // QIDISLICER_TRIANGLE_SELECTOR_DEBUG
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
GLModel m_paint_contour;
|
GLModel m_paint_contour;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef PRUSALSICER_WORKER_HPP
|
#ifndef QIDILSICER_WORKER_HPP
|
||||||
#define PRUSALSICER_WORKER_HPP
|
#define QIDILSICER_WORKER_HPP
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|||||||
@@ -770,10 +770,6 @@ void MainFrame::init_tabpanel()
|
|||||||
else
|
else
|
||||||
select_tab(size_t(0)); // select Plater
|
select_tab(size_t(0)); // select Plater
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_plater = new Plater(this, this);
|
m_plater = new Plater(this, this);
|
||||||
m_plater->Hide();
|
m_plater->Hide();
|
||||||
@@ -1160,11 +1156,7 @@ static const wxString sep_space = "\xA0";
|
|||||||
static const wxString sep = " - ";
|
static const wxString sep = " - ";
|
||||||
static const wxString sep_space = "";
|
static const wxString sep_space = "";
|
||||||
#endif
|
#endif
|
||||||
//B19
|
|
||||||
static void run_bwizard(BugWizard::BugStartPage sp)
|
|
||||||
{
|
|
||||||
wxGetApp().run_bwizard(BugWizard::RR_USER, sp);
|
|
||||||
}
|
|
||||||
static wxMenu* generate_help_menu()
|
static wxMenu* generate_help_menu()
|
||||||
{
|
{
|
||||||
wxMenu* helpMenu = new wxMenu();
|
wxMenu* helpMenu = new wxMenu();
|
||||||
@@ -1190,10 +1182,8 @@ static wxMenu* generate_help_menu()
|
|||||||
[](wxCommandEvent&) { wxGetApp().system_info(); });
|
[](wxCommandEvent&) { wxGetApp().system_info(); });
|
||||||
append_menu_item(helpMenu, wxID_ANY, _L("Show &Configuration Folder"), _L("Show user configuration folder (datadir)"),
|
append_menu_item(helpMenu, wxID_ANY, _L("Show &Configuration Folder"), _L("Show user configuration folder (datadir)"),
|
||||||
[](wxCommandEvent&) { Slic3r::GUI::desktop_open_datadir_folder(); });
|
[](wxCommandEvent&) { Slic3r::GUI::desktop_open_datadir_folder(); });
|
||||||
//B19
|
// append_menu_item(helpMenu, wxID_ANY, _L("Report an I&ssue"), wxString::Format(_L("Report an issue on %s"), SLIC3R_APP_NAME),
|
||||||
append_menu_item(helpMenu, wxID_ANY, _L("Report an I&ssue"), wxString::Format(_L("Report an issue on %s"), SLIC3R_APP_NAME),
|
// [](wxCommandEvent&) { wxGetApp().open_browser_with_warning_dialog("https://github.com/QIDITECH/QIDISlicer", nullptr, false); });
|
||||||
[](wxCommandEvent&) {
|
|
||||||
wxTheApp->CallAfter([]() { run_bwizard(BugWizard::SP_PRINTERS); });});
|
|
||||||
if (wxGetApp().is_editor())
|
if (wxGetApp().is_editor())
|
||||||
append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("&About %s"), SLIC3R_APP_NAME), _L("Show about dialog"),
|
append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("&About %s"), SLIC3R_APP_NAME), _L("Show about dialog"),
|
||||||
[](wxCommandEvent&) { Slic3r::GUI::about(); });
|
[](wxCommandEvent&) { Slic3r::GUI::about(); });
|
||||||
@@ -1728,7 +1718,7 @@ void MainFrame::quick_slice(const int qs)
|
|||||||
|
|
||||||
// select input file
|
// select input file
|
||||||
if (!(qs & qsReslice)) {
|
if (!(qs & qsReslice)) {
|
||||||
wxFileDialog dlg(this, _L("Choose a file to slice (STL/OBJ/AMF/3MF/PRUSA):"),
|
wxFileDialog dlg(this, _L("Choose a file to slice (STL/OBJ/AMF/3MF/QIDI):"),
|
||||||
wxGetApp().app_config->get_last_dir(), "",
|
wxGetApp().app_config->get_last_dir(), "",
|
||||||
file_wildcards(FT_MODEL), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
file_wildcards(FT_MODEL), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
||||||
if (dlg.ShowModal() != wxID_OK)
|
if (dlg.ShowModal() != wxID_OK)
|
||||||
|
|||||||
Reference in New Issue
Block a user