OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
CreatePresetsDialog.cpp File Reference
#include "CreatePresetsDialog.hpp"
#include <algorithm>
#include <any>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/log/trivial.hpp>
#include <string>
#include <cctype>
#include "libslic3r/LocalesUtils.hpp"
#include <cstddef>
#include "libslic3r/Preset.hpp"
#include <deque>
#include <exception>
#include <chrono>
#include <ctime>
#include <sstream>
#include <iomanip>
#include "libslic3r/Config.hpp"
#include <utility>
#include "slic3r/GUI/Widgets/CheckBox.hpp"
#include "slic3r/GUI/GUI.hpp"
#include <memory>
#include "slic3r/GUI/Widgets/ComboBox.hpp"
#include "slic3r/GUI/Widgets/RadioBox.hpp"
#include <cstdio>
#include <map>
#include <nlohmann/json.hpp>
#include <cstdlib>
#include "slic3r/GUI/GUI_Utils.hpp"
#include "slic3r/GUI/Widgets/Label.hpp"
#include "slic3r/GUI/Widgets/TextInput.hpp"
#include "slic3r/GUI/Widgets/DialogButtons.hpp"
#include "libslic3r/libslic3r.h"
#include <cassert>
#include "slic3r/GUI/wxExtensions.hpp"
#include "slic3r/GUI/Widgets/Button.hpp"
#include "libslic3r/Utils.hpp"
#include <cmath>
#include "libslic3r/Point.hpp"
#include <miniz.h>
#include "slic3r/GUI/ParamsDialog.hpp"
#include <vector>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <openssl/md5.h>
#include <openssl/evp.h>
#include <wx/anybutton.h>
#include <wx/colour.h>
#include <wx/dcgraph.h>
#include <wx/string.h>
#include <wx/gdicmn.h>
#include <wx/event.h>
#include <wx/panel.h>
#include <wx/scrolwin.h>
#include <wx/sizer.h>
#include <wx/tglbtn.h>
#include <wx/filedlg.h>
#include <wx/dirdlg.h>
#include <wx/tooltip.h>
#include <wx/treebase.h>
#include <wx/toplevel.h>
#include <wx/utils.h>
#include <boost/nowide/cstdio.hpp>
#include <wx/valtext.h>
#include "libslic3r/PresetBundle.hpp"
#include "libslic3r/PrinterBedAssets.hpp"
#include "I18N.hpp"
#include "GUI_App.hpp"
#include "MsgDialog.hpp"
#include "FileHelp.hpp"
#include "Tab.hpp"
#include "MainFrame.hpp"
#include "libslic3r_version.h"
#include "Widgets/HyperLink.hpp"

Go to the source code of this file.

Namespaces

namespace  Slic3r
 |/ Copyright (c) Prusa Research 2020 - 2023 Enrico Turri @enricoturri1966 |/ |/ PrusaSlicer is released under the terms of the AGPLv3 or higher |/
namespace  Slic3r::GUI

Macros

#define NAME_OPTION_COMBOBOX_SIZE   wxSize(FromDIP(200), FromDIP(24))
#define FILAMENT_PRESET_COMBOBOX_SIZE   wxSize(FromDIP(300), FromDIP(24))
#define OPTION_SIZE   wxSize(FromDIP(100), FromDIP(24))
#define PRINTER_LIST_SIZE   wxSize(-1, FromDIP(100))
#define FILAMENT_LIST_SIZE   wxSize(FromDIP(560), FromDIP(100))
#define FILAMENT_OPTION_SIZE   wxSize(FromDIP(-1), FromDIP(30))
#define PRESET_TEMPLATE_SIZE   wxSize(FromDIP(-1), FromDIP(100))
#define PRINTER_SPACE_SIZE   wxSize(FromDIP(100), FromDIP(24))
#define ORIGIN_TEXT_SIZE   wxSize(FromDIP(10), FromDIP(24))
#define PRINTER_PRESET_VENDOR_SIZE   wxSize(FromDIP(150), FromDIP(24))
#define PRINTER_PRESET_MODEL_SIZE   wxSize(FromDIP(280), FromDIP(24))
#define STATIC_TEXT_COLOUR   wxColour("#363636")
#define PRINTER_LIST_COLOUR   wxColour("#EEEEEE")
#define FILAMENT_OPTION_COLOUR   wxColour("#D9D9D9")
#define SELECT_ALL_OPTION_COLOUR   wxColour("#009688")
#define DEFAULT_PROMPT_TEXT_COLOUR   wxColour("#ACACAC")

Functions

static std::string Slic3r::GUI::remove_special_key (const std::string &str)
static bool Slic3r::GUI::str_is_all_digit (const std::string &str)
static bool Slic3r::GUI::caseInsensitiveCompare (const std::string &a, const std::string &b)
static float Slic3r::GUI::my_stof (std::string str)
static bool Slic3r::GUI::delete_filament_preset_by_name (std::string delete_preset_name, std::string &selected_preset_name)
static std::string Slic3r::GUI::get_curr_time (const char *format="%Y_%m_%d_%H_%M_%S")
static std::string Slic3r::GUI::get_curr_timestmp ()
static void Slic3r::GUI::get_filament_compatible_printer (Preset *preset, std::vector< std::string > &printers)
static wxBoxSizer * Slic3r::GUI::create_checkbox (wxWindow *parent, Preset *preset, wxString &preset_name, std::vector< std::pair<::CheckBox *, Preset * > > &preset_checkbox)
static wxBoxSizer * Slic3r::GUI::create_checkbox (wxWindow *parent, std::string &compatible_printer, Preset *preset, std::unordered_map<::CheckBox *, std::pair< std::string, Preset * > > &ptinter_compatible_filament_preset)
static wxBoxSizer * Slic3r::GUI::create_checkbox (wxWindow *parent, wxString &preset_name, std::vector< std::pair<::CheckBox *, std::string > > &preset_checkbox)
static wxArrayString Slic3r::GUI::get_exist_vendor_choices (VendorMap &vendors)
static std::string Slic3r::GUI::get_machine_name (const std::string &preset_name)
static std::string Slic3r::GUI::get_filament_name (std::string &preset_name)
static wxBoxSizer * Slic3r::GUI::create_preset_tree (wxWindow *parent, std::pair< std::string, std::vector< std::shared_ptr< Preset > > > printer_and_preset)
static std::string Slic3r::GUI::get_vendor_name (std::string &preset_name)
static wxBoxSizer * Slic3r::GUI::create_select_filament_preset_checkbox (wxWindow *parent, std::string &compatible_printer, std::vector< Preset * > presets, std::unordered_map<::CheckBox *, std::pair< std::string, Preset * > > &machine_filament_preset)
static wxString Slic3r::GUI::get_curr_radio_type (std::vector< std::pair< RadioBox *, wxString > > &radio_btns)
static std::string Slic3r::GUI::calculate_md5 (const std::string &input)
static void Slic3r::GUI::load_filament_id_sources (PresetBundle &temp_preset_bundle)
static std::string Slic3r::GUI::get_filament_id (std::string vendor_typr_serial, const PresetBundle &temp_preset_bundle)
static json Slic3r::GUI::get_config_json (const Preset *preset)
static char * Slic3r::GUI::read_json_file (const std::string &preset_path)
static std::string Slic3r::GUI::get_printer_nozzle_diameter (std::string printer_name)
static void Slic3r::GUI::adjust_dialog_in_screen (DPIDialog *dialog)

Variables

static const std::vector< std::string > Slic3r::GUI::filament_vendors
static const std::vector< std::string > Slic3r::GUI::filament_types
static const std::vector< std::string > Slic3r::GUI::printer_vendors
static const std::unordered_map< std::string, std::vector< std::string > > Slic3r::GUI::printer_model_map
static std::vector< std::string > Slic3r::GUI::nozzle_diameter_vec = {"0.4", "0.15", "0.2", "0.25", "0.3", "0.35", "0.5", "0.6", "0.75", "0.8", "1.0", "1.2", "1.75"}
static std::unordered_map< std::string, float > Slic3r::GUI::nozzle_diameter_map
static std::set< int > Slic3r::GUI::cannot_input_key = {9, 10, 13, 33, 35, 36, 37, 38, 40, 41, 42, 44, 46, 47, 59, 60, 62, 63, 64, 92, 94, 95, 124, 126}
static std::set< char > Slic3r::GUI::special_key = {'\n', '\t', '\r', '\v', '@', ';'}
static std::string Slic3r::GUI::last_directory = ""

Macro Definition Documentation

◆ DEFAULT_PROMPT_TEXT_COLOUR

◆ FILAMENT_LIST_SIZE

#define FILAMENT_LIST_SIZE   wxSize(FromDIP(560), FromDIP(100))

◆ FILAMENT_OPTION_COLOUR

#define FILAMENT_OPTION_COLOUR   wxColour("#D9D9D9")

◆ FILAMENT_OPTION_SIZE

#define FILAMENT_OPTION_SIZE   wxSize(FromDIP(-1), FromDIP(30))

◆ FILAMENT_PRESET_COMBOBOX_SIZE

#define FILAMENT_PRESET_COMBOBOX_SIZE   wxSize(FromDIP(300), FromDIP(24))

◆ NAME_OPTION_COMBOBOX_SIZE

◆ OPTION_SIZE

◆ ORIGIN_TEXT_SIZE

#define ORIGIN_TEXT_SIZE   wxSize(FromDIP(10), FromDIP(24))

◆ PRESET_TEMPLATE_SIZE

#define PRESET_TEMPLATE_SIZE   wxSize(FromDIP(-1), FromDIP(100))

◆ PRINTER_LIST_COLOUR

◆ PRINTER_LIST_SIZE

#define PRINTER_LIST_SIZE   wxSize(-1, FromDIP(100))

◆ PRINTER_PRESET_MODEL_SIZE

◆ PRINTER_PRESET_VENDOR_SIZE

#define PRINTER_PRESET_VENDOR_SIZE   wxSize(FromDIP(150), FromDIP(24))

◆ PRINTER_SPACE_SIZE

◆ SELECT_ALL_OPTION_COLOUR

#define SELECT_ALL_OPTION_COLOUR   wxColour("#009688")

◆ STATIC_TEXT_COLOUR

#define STATIC_TEXT_COLOUR   wxColour("#363636")