2023-04-23 01:04:55 +00:00
|
|
|
#pragma once
|
|
|
|
#include "libslic3r/Calib.hpp"
|
2023-05-18 01:41:50 +00:00
|
|
|
#include "../GUI/DeviceManager.hpp"
|
2023-06-06 08:47:14 +00:00
|
|
|
#include "../GUI/Jobs/PrintJob.hpp"
|
2023-04-23 01:04:55 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
class ProgressIndicator;
|
2023-05-18 01:41:50 +00:00
|
|
|
class Preset;
|
2023-04-23 01:04:55 +00:00
|
|
|
|
|
|
|
namespace GUI {
|
2023-05-18 01:41:50 +00:00
|
|
|
class CalibInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Calib_Params params;
|
|
|
|
Preset* printer_prest;
|
|
|
|
Preset* filament_prest;
|
|
|
|
Preset* print_prest;
|
|
|
|
BedType bed_type;
|
|
|
|
std::string dev_id;
|
|
|
|
std::string select_ams;
|
|
|
|
std::shared_ptr<ProgressIndicator> process_bar;
|
|
|
|
};
|
|
|
|
|
2023-04-23 01:04:55 +00:00
|
|
|
class CalibUtils
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CalibUtils(){};
|
2023-06-06 08:47:14 +00:00
|
|
|
static std::shared_ptr<PrintJob> print_job;
|
2023-06-16 02:04:51 +00:00
|
|
|
|
2023-07-03 13:48:19 +00:00
|
|
|
static CalibMode get_calib_mode_by_name(const std::string name, int &cali_stage);
|
2023-06-16 02:04:51 +00:00
|
|
|
|
2023-07-03 13:48:19 +00:00
|
|
|
static void calib_PA(const X1CCalibInfos& calib_infos, int mode, std::string& error_message);
|
2023-06-20 12:28:38 +00:00
|
|
|
|
|
|
|
static void emit_get_PA_calib_results(float nozzle_diameter);
|
2023-05-18 01:41:50 +00:00
|
|
|
static bool get_PA_calib_results(std::vector<PACalibResult> &pa_calib_results);
|
2023-06-20 12:28:38 +00:00
|
|
|
|
|
|
|
static void emit_get_PA_calib_infos(float nozzle_diameter);
|
2023-05-18 01:41:50 +00:00
|
|
|
static bool get_PA_calib_tab(std::vector<PACalibResult> &pa_calib_infos);
|
2023-06-20 12:28:38 +00:00
|
|
|
|
|
|
|
static void emit_get_PA_calib_info(float nozzle_diameter, const std::string &filament_id);
|
|
|
|
static bool get_PA_calib_info(PACalibResult &pa_calib_info);
|
|
|
|
|
2023-05-18 01:41:50 +00:00
|
|
|
static void set_PA_calib_result(const std::vector<PACalibResult>& pa_calib_values);
|
2023-06-05 01:25:43 +00:00
|
|
|
static void select_PA_calib_result(const PACalibIndexInfo &pa_calib_info);
|
|
|
|
static void delete_PA_calib_result(const PACalibIndexInfo &pa_calib_info);
|
2023-05-18 01:41:50 +00:00
|
|
|
|
|
|
|
static void calib_flowrate_X1C(const X1CCalibInfos& calib_infos, std::string& error_message);
|
2023-06-20 12:28:38 +00:00
|
|
|
static void emit_get_flow_ratio_calib_results(float nozzle_diameter);
|
2023-05-18 01:41:50 +00:00
|
|
|
static bool get_flow_ratio_calib_results(std::vector<FlowRatioCalibResult> &flow_ratio_calib_results);
|
|
|
|
static void calib_flowrate(int pass, const CalibInfo& calib_info, std::string& error_message);
|
|
|
|
|
2023-06-13 10:34:00 +00:00
|
|
|
static void calib_generic_PA(const CalibInfo& calib_info, std::string &error_message);
|
2023-05-18 01:41:50 +00:00
|
|
|
static void calib_temptue(const CalibInfo& calib_info, std::string& error_message);
|
|
|
|
static void calib_max_vol_speed(const CalibInfo& calib_info, std::string& error_message);
|
|
|
|
static void calib_VFA(const CalibInfo& calib_info, std::string& error_message);
|
2023-06-13 10:34:00 +00:00
|
|
|
static void calib_retraction(const CalibInfo &calib_info, std::string &error_message);
|
2023-04-23 01:04:55 +00:00
|
|
|
|
2023-06-21 12:20:00 +00:00
|
|
|
//help function
|
|
|
|
static int get_selected_calib_idx(const std::vector<PACalibResult> &pa_calib_values, int cali_idx);
|
|
|
|
|
2023-07-03 13:48:19 +00:00
|
|
|
static bool validate_input_k_value(wxString k_text, float* output_value);
|
|
|
|
static bool validate_input_flow_ratio(wxString flow_ratio, float* output_value);
|
|
|
|
|
2023-04-23 01:04:55 +00:00
|
|
|
private:
|
2023-05-18 01:41:50 +00:00
|
|
|
static void process_and_store_3mf(Model* model, const DynamicPrintConfig& full_config, const Calib_Params& params, std::string& error_message);
|
2023-07-03 13:48:19 +00:00
|
|
|
static void send_to_print(const CalibInfo &calib_info, std::string& error_message, int flow_ratio_mode = 0); // 0: none 1: coarse 2: fine
|
2023-04-23 01:04:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|