2022-07-15 15:37:19 +00:00
# ifndef slic3r_DeviceManager_hpp_
# define slic3r_DeviceManager_hpp_
# include <map>
2023-12-21 09:10:46 +00:00
# include <mutex>
2022-07-15 15:37:19 +00:00
# include <vector>
# include <string>
# include <memory>
# include <chrono>
# include <boost/thread.hpp>
2023-10-09 08:57:50 +00:00
# include <boost/nowide/fstream.hpp>
2022-09-02 05:12:50 +00:00
# include "nlohmann/json.hpp"
2022-07-15 15:37:19 +00:00
# include "libslic3r/ProjectTask.hpp"
# include "slic3r/Utils/json_diff.hpp"
# include "slic3r/Utils/NetworkAgent.hpp"
2024-11-05 12:35:31 +00:00
# include "boost/bimap/bimap.hpp"
2022-11-18 03:16:24 +00:00
# include "CameraPopup.hpp"
2023-07-06 07:27:05 +00:00
# include "libslic3r/Calib.hpp"
2023-10-09 08:57:50 +00:00
# include "libslic3r/Utils.hpp"
2022-07-15 15:37:19 +00:00
# define USE_LOCAL_SOCKET_BIND 0
2022-07-22 09:46:10 +00:00
# define DISCONNECT_TIMEOUT 30000.f // milliseconds
2022-07-15 15:37:19 +00:00
# define PUSHINFO_TIMEOUT 15000.f // milliseconds
2022-12-07 10:20:50 +00:00
# define TIMEOUT_FOR_STRAT 20000.f // milliseconds
2023-07-07 03:52:31 +00:00
# define TIMEOUT_FOR_KEEPALIVE 5* 60 * 1000.f // milliseconds
2023-07-07 07:52:33 +00:00
# define REQUEST_PUSH_MIN_TIME 3000.f // milliseconds
2022-12-07 10:20:50 +00:00
# define REQUEST_START_MIN_TIME 15000.f // milliseconds
2023-01-15 09:04:51 +00:00
# define EXTRUSION_OMIT_TIME 20000.f // milliseconds
2023-01-16 09:34:33 +00:00
# define HOLD_TIMEOUT 10000.f // milliseconds
2022-07-15 15:37:19 +00:00
# define FILAMENT_MAX_TEMP 300
# define FILAMENT_DEF_TEMP 220
# define FILAMENT_MIN_TEMP 120
2022-12-01 09:35:54 +00:00
# define BED_TEMP_LIMIT 120
2022-07-15 15:37:19 +00:00
2022-07-27 10:13:40 +00:00
# define HOLD_COUNT_MAX 3
2022-12-06 09:01:32 +00:00
# define HOLD_COUNT_CAMERA 6
2022-12-02 01:16:00 +00:00
# define GET_VERSION_RETRYS 10
# define RETRY_INTERNAL 2000
2024-12-19 07:58:55 +00:00
2024-12-04 01:38:34 +00:00
# define MAIN_NOZZLE_ID 0
# define DEPUTY_NOZZLE_ID 1
2024-12-19 07:58:55 +00:00
# define UNIQUE_NOZZLE_ID MAIN_NOZZLE_ID
2024-06-24 09:35:38 +00:00
# define VIRTUAL_TRAY_MAIN_ID 255
# define VIRTUAL_TRAY_DEPUTY_ID 254
2023-03-22 01:08:30 +00:00
# define START_SEQ_ID 20000
# define END_SEQ_ID 30000
2025-01-07 03:58:18 +00:00
# define SUBSCRIBE_RETRY_COUNT 5
2022-07-27 10:13:40 +00:00
2022-07-15 15:37:19 +00:00
inline int correct_filament_temperature ( int filament_temp )
{
int temp = std : : min ( filament_temp , FILAMENT_MAX_TEMP ) ;
temp = std : : max ( temp , FILAMENT_MIN_TEMP ) ;
return temp ;
}
wxString get_stage_string ( int stage ) ;
2022-09-02 05:12:50 +00:00
using namespace nlohmann ;
2022-07-15 15:37:19 +00:00
namespace Slic3r {
2023-11-22 10:30:14 +00:00
class SecondaryCheckDialog ;
2023-08-25 04:25:22 +00:00
enum PrinterArch {
ARCH_CORE_XY ,
ARCH_I3 ,
} ;
2023-07-07 02:11:18 +00:00
enum PrinterSeries {
SERIES_X1 = 0 ,
SERIES_P1P ,
SERIES_UNKNOWN ,
} ;
2022-09-02 05:12:50 +00:00
enum PrinterFunction {
FUNC_MAX
} ;
2022-07-15 15:37:19 +00:00
enum PrintingSpeedLevel {
SPEED_LEVEL_INVALID = 0 ,
SPEED_LEVEL_SILENCE = 1 ,
SPEED_LEVEL_NORMAL = 2 ,
SPEED_LEVEL_RAPID = 3 ,
SPEED_LEVEL_RAMPAGE = 4 ,
SPEED_LEVEL_COUNT
} ;
class NetworkAgent ;
enum AmsRfidState {
AMS_RFID_INIT ,
AMS_RFID_LOADING ,
AMS_REID_DONE ,
} ;
enum AmsStep {
AMS_STEP_INIT ,
AMS_STEP_HEAT_EXTRUDER ,
AMS_STEP_LOADING ,
AMS_STEP_COMPLETED ,
} ;
enum AmsRoadPosition {
AMS_ROAD_POSITION_TRAY , // filament at tray
AMS_ROAD_POSITION_TUBE , // filament at tube
AMS_ROAD_POSITION_HOTEND , // filament at hotend
} ;
enum AmsStatusMain {
AMS_STATUS_MAIN_IDLE = 0x00 ,
AMS_STATUS_MAIN_FILAMENT_CHANGE = 0x01 ,
AMS_STATUS_MAIN_RFID_IDENTIFYING = 0x02 ,
AMS_STATUS_MAIN_ASSIST = 0x03 ,
AMS_STATUS_MAIN_CALIBRATION = 0x04 ,
AMS_STATUS_MAIN_SELF_CHECK = 0x10 ,
AMS_STATUS_MAIN_DEBUG = 0x20 ,
AMS_STATUS_MAIN_UNKNOWN = 0xFF ,
} ;
2022-08-31 12:02:57 +00:00
enum AmsRfidStatus {
AMS_RFID_IDLE = 0 ,
AMS_RFID_READING = 1 ,
AMS_RFID_GCODE_TRANS = 2 ,
AMS_RFID_GCODE_RUNNING = 3 ,
AMS_RFID_ASSITANT = 4 ,
AMS_RFID_SWITCH_FILAMENT = 5 ,
AMS_RFID_HAS_FILAMENT = 6
} ;
2022-11-10 11:32:25 +00:00
enum AmsOptionType {
AMS_OP_STARTUP_READ ,
AMS_OP_TRAY_READ ,
AMS_OP_CALIBRATE_REMAIN
} ;
2023-08-23 02:25:51 +00:00
enum ManualPaCaliMethod {
PA_LINE = 0 ,
PA_PATTERN ,
} ;
2024-12-03 13:49:35 +00:00
enum ExtruderSwitchState {
ES_IDLE = 0 ,
ES_BUSY ,
ES_SWITCHING ,
ES_SWITCHING_FAILED
} ;
2024-09-10 02:11:10 +00:00
enum AirDuctType {
AIR_FAN_TYPE ,
AIR_DOOR_TYPE
} ;
2024-10-26 06:30:18 +00:00
enum NozzleFlowType {
NONE_FLOWTYPE ,
S_FLOW ,
H_FLOW
} ;
enum NozzleToolType {
NONE_TOOLTYPE ,
H_TOOL ,
C_TOOL
} ;
2024-07-15 13:54:21 +00:00
struct AmsSlot
{
std : : string ams_id ;
std : : string slot_id ;
} ;
2024-10-26 06:30:18 +00:00
struct Nozzle
2024-06-18 12:09:11 +00:00
{
2024-10-26 06:30:18 +00:00
int id ;
NozzleToolType tool_type ; // H nozzle or Cut
NozzleFlowType nozzle_flow ; // 0-common 1-high flow
NozzleType nozzle_type ; // 0-stainless_steel 1-hardened_steel
2024-07-15 13:54:21 +00:00
float diameter = { 0.4f } ; // 0-0.2mm 1-0.4mm 2-0.6 mm3-0.8mm
2024-10-26 06:30:18 +00:00
int max_temp = 0 ;
int wear = 0 ;
} ;
struct NozzleData
{
int extder_exist ; //0- none exist 1-exist
int cut_exist ;
int state ; //0-idle 1-checking
std : : vector < Nozzle > nozzles ;
} ;
struct Extder
{
int id ; // 0-right 1-left
int enable_change_nozzle { 0 } ;
2024-07-15 13:54:21 +00:00
int ext_has_filament { 0 } ;
int buffer_has_filament { 0 } ;
2024-10-26 06:30:18 +00:00
int nozzle_exist { 0 } ;
2024-07-15 13:54:21 +00:00
2024-12-25 11:18:53 +00:00
std : : vector < int > filam_bak ; // the refill filam
2024-10-26 06:30:18 +00:00
int temp { 0 } ;
2024-07-15 13:54:21 +00:00
int target_temp { 0 } ;
2024-10-26 06:30:18 +00:00
AmsSlot spre ; // tray_pre
AmsSlot snow ; // tray_now
AmsSlot star ; // tray_tar
int ams_stat { 0 } ;
int rfid_stat { 0 } ;
int nozzle_id ; // nozzle id now
int target_nozzle_id ; // target nozzle id
//current nozzle
NozzleType current_nozzle_type { NozzleType : : ntUndefine } ; // 0-hardened_steel 1-stainless_steel
float current_nozzle_diameter = { 0.4f } ; // 0-0.2mm 1-0.4mm 2-0.6 mm3-0.8mm
NozzleFlowType current_nozzle_flow_type { NozzleFlowType : : NONE_FLOWTYPE } ; //0-common 1-high flow
2024-06-18 12:09:11 +00:00
} ;
2024-09-10 02:11:10 +00:00
struct ExtderData
{
int current_extder_id { 0 } ;
int target_extder_id { 0 } ;
int total_extder_count { 0 } ;
2024-12-04 01:38:34 +00:00
int current_loading_extder_id { - 1 } ;
2024-12-10 09:29:43 +00:00
bool current_busy_for_loading { false } ;
2024-12-04 01:38:34 +00:00
ExtruderSwitchState switch_extder_state ;
2024-09-10 02:11:10 +00:00
std : : vector < Extder > extders ;
} ;
2024-12-06 07:23:28 +00:00
struct AirMode
2024-06-18 12:09:11 +00:00
{
2024-12-06 07:23:28 +00:00
int id { - 1 } ;
std : : vector < int > ctrl ;
// If the fan is off, it cannot be controlled and is displayed as off
std : : vector < int > off ;
// If the fan is not off or ctrl, it will be displayed as auto
2024-09-10 02:11:10 +00:00
} ;
2024-12-06 07:23:28 +00:00
struct AirParts
2024-09-10 02:11:10 +00:00
{
2024-12-06 07:23:28 +00:00
int type { 0 } ;
int id { 0 } ;
int func { 0 } ;
int state { 0 } ; // 100%
int range_start { 0 } ; // 100%
int range_end { 0 } ; // 100%
2024-09-10 02:11:10 +00:00
} ;
struct AirDuctData
{
2024-12-06 07:23:28 +00:00
int curren_mode { 0 } ;
std : : vector < AirMode > modes ;
std : : vector < AirParts > parts ;
2024-06-18 12:09:11 +00:00
} ;
2023-12-07 03:14:07 +00:00
2023-09-27 03:54:29 +00:00
struct RatingInfo {
bool request_successful ;
2023-10-08 02:23:34 +00:00
int http_code ;
2023-09-27 03:54:29 +00:00
int rating_id ;
int start_count ;
bool success_printed ;
std : : string content ;
std : : vector < std : : string > image_url_paths ;
} ;
2022-07-15 15:37:19 +00:00
class AmsTray {
public :
AmsTray ( std : : string tray_id ) {
is_bbl = false ;
id = tray_id ;
road_position = AMS_ROAD_POSITION_TRAY ;
step_state = AMS_STEP_INIT ;
rfid_state = AMS_RFID_INIT ;
}
static int hex_digit_to_int ( const char c )
{
return ( c > = ' 0 ' & & c < = ' 9 ' ) ? int ( c - ' 0 ' ) : ( c > = ' A ' & & c < = ' F ' ) ? int ( c - ' A ' ) + 10 : ( c > = ' a ' & & c < = ' f ' ) ? int ( c - ' a ' ) + 10 : - 1 ;
}
static wxColour decode_color ( const std : : string & color )
{
2023-05-16 12:53:08 +00:00
std : : array < int , 4 > ret = { 0 , 0 , 0 , 0 } ;
2022-07-15 15:37:19 +00:00
const char * c = color . data ( ) ;
if ( color . size ( ) = = 8 ) {
2023-05-16 12:53:08 +00:00
for ( size_t j = 0 ; j < 4 ; + + j ) {
2022-07-15 15:37:19 +00:00
int digit1 = hex_digit_to_int ( * c + + ) ;
int digit2 = hex_digit_to_int ( * c + + ) ;
if ( digit1 = = - 1 | | digit2 = = - 1 ) break ;
ret [ j ] = float ( digit1 * 16 + digit2 ) ;
}
2023-02-10 04:18:16 +00:00
} else {
2023-05-16 12:53:08 +00:00
return wxColour ( 255 , 255 , 255 , 255 ) ;
2022-07-15 15:37:19 +00:00
}
2023-05-16 12:53:08 +00:00
return wxColour ( ret [ 0 ] , ret [ 1 ] , ret [ 2 ] , ret [ 3 ] ) ;
2022-07-15 15:37:19 +00:00
}
2024-08-08 04:11:02 +00:00
bool operator = = ( AmsTray const & o ) const
{
return id = = o . id & & type = = o . type & & filament_setting_id = = o . filament_setting_id & & color = = o . color ;
}
bool operator ! = ( AmsTray const & o ) const { return ! operator = = ( o ) ; }
2024-07-08 09:32:49 +00:00
std : : string id ;
2022-11-22 09:54:39 +00:00
std : : string tag_uid ; // tag_uid
std : : string setting_id ; // tray_info_idx
std : : string filament_setting_id ; // setting_id
2022-07-15 15:37:19 +00:00
std : : string type ;
std : : string sub_brands ;
std : : string color ;
2023-03-20 08:21:30 +00:00
std : : vector < std : : string > cols ;
2022-07-15 15:37:19 +00:00
std : : string weight ;
std : : string diameter ;
std : : string temp ;
std : : string time ;
std : : string bed_temp_type ;
std : : string bed_temp ;
std : : string nozzle_temp_max ;
std : : string nozzle_temp_min ;
std : : string xcam_info ;
std : : string uuid ;
2023-12-26 07:57:45 +00:00
int ctype = 0 ;
2022-11-22 09:54:39 +00:00
float k = 0.0f ; // k range: 0 ~ 0.5
float n = 0.0f ; // k range: 0.6 ~ 2.0
2023-06-20 12:28:38 +00:00
int cali_idx = 0 ;
2022-07-15 15:37:19 +00:00
wxColour wx_color ;
bool is_bbl ;
bool is_exists = false ;
2022-07-22 09:46:10 +00:00
int hold_count = 0 ;
2022-11-24 07:28:01 +00:00
int remain = 0 ; // filament remain: 0 ~ 100
2022-07-15 15:37:19 +00:00
AmsRoadPosition road_position ;
AmsStep step_state ;
AmsRfidState rfid_state ;
2022-07-27 10:13:40 +00:00
void set_hold_count ( ) { hold_count = HOLD_COUNT_MAX ; }
2022-07-15 15:37:19 +00:00
void update_color_from_str ( std : : string color ) ;
wxColour get_color ( ) ;
2023-02-10 04:18:16 +00:00
void reset ( ) ;
2022-07-15 15:37:19 +00:00
bool is_tray_info_ready ( ) ;
2022-08-03 02:00:18 +00:00
bool is_unset_third_filament ( ) ;
2022-08-04 09:56:40 +00:00
std : : string get_display_filament_type ( ) ;
std : : string get_filament_type ( ) ;
2022-07-15 15:37:19 +00:00
} ;
class Ams {
public :
2024-06-18 12:09:11 +00:00
Ams ( std : : string ams_id , int nozzle_id , int type_id ) {
2022-07-15 15:37:19 +00:00
id = ams_id ;
2024-06-18 12:09:11 +00:00
nozzle = nozzle_id ;
type = type_id ;
2022-07-15 15:37:19 +00:00
}
std : : string id ;
2022-11-17 13:23:52 +00:00
int humidity = 5 ;
2022-07-15 15:37:19 +00:00
bool startup_read_opt { true } ;
bool tray_read_opt { false } ;
bool is_exists { false } ;
std : : map < std : : string , AmsTray * > trayList ;
2024-06-18 12:09:11 +00:00
int nozzle ;
int type { 1 } ; //0:dummy 1:ams 2:ams-lite 3:n3f 4:n3s
2022-07-15 15:37:19 +00:00
} ;
enum PrinterFirmwareType {
FIRMWARE_TYPE_ENGINEER = 0 ,
FIRMWARE_TYPE_PRODUCTION ,
FIRMEARE_TYPE_UKNOWN ,
} ;
class FirmwareInfo
{
public :
std : : string module_type ; // ota or ams
std : : string version ;
std : : string url ;
std : : string name ;
std : : string description ;
} ;
enum ModuleID {
MODULE_UKNOWN = 0x00 ,
MODULE_01 = 0x01 ,
MODULE_02 = 0x02 ,
MODULE_MC = 0x03 ,
MODULE_04 = 0x04 ,
MODULE_MAINBOARD = 0x05 ,
MODULE_06 = 0x06 ,
MODULE_AMS = 0x07 ,
MODULE_TH = 0x08 ,
MODULE_09 = 0x09 ,
MODULE_10 = 0x0A ,
MODULE_11 = 0x0B ,
MODULE_XCAM = 0x0C ,
MODULE_13 = 0x0D ,
MODULE_14 = 0x0E ,
MODULE_15 = 0x0F ,
MODULE_MAX = 0x10
} ;
enum HMSMessageLevel {
HMS_UNKNOWN = 0 ,
HMS_FATAL = 1 ,
HMS_SERIOUS = 2 ,
HMS_COMMON = 3 ,
HMS_INFO = 4 ,
HMS_MSG_LEVEL_MAX ,
} ;
2024-09-10 02:11:10 +00:00
2024-12-06 07:23:28 +00:00
enum AIR_FUN {
FAN_HEAT_BREAK_0_IDX = 0 ,
FAN_COOLING_0_AIRDOOR = 1 ,
FAN_REMOTE_COOLING_0_IDX = 2 ,
FAN_CHAMBER_0_IDX = 3 ,
FAN_HEAT_BREAK_1_IDX = 4 ,
FAN_MC_BOARD_0_IDX = 5 ,
FAN_INNNER_LOOP_FAN_0_IDX = 6 ,
FAN_TOTAL_COUNT = 7
2024-09-10 02:11:10 +00:00
} ;
2024-12-06 07:23:28 +00:00
enum AIR_DOOR {
2024-09-10 02:11:10 +00:00
AIR_DOOR_FUNC_CHAMBER = 0 ,
AIR_DOOR_FUNC_INNERLOOP ,
AIR_DOOR_FUNC_TOP
} ;
2024-12-06 07:23:28 +00:00
enum AIR_DUCT {
2024-09-10 02:11:10 +00:00
AIR_DUCT_NONE = - 1 ,
AIR_DUCT_COOLING_FILT = 0 ,
AIR_DUCT_HEATING_INTERNAL_FILT ,
AIR_DUCT_EXHAUST ,
AIR_DUCT_FULL_COOLING ,
AIR_DUCT_NUM ,
AIR_DUCT_INIT = 0xFF //Initial mode, only used within mc
} ;
2022-07-15 15:37:19 +00:00
class HMSItem
{
public :
ModuleID module_id ;
unsigned module_num ;
unsigned part_id ;
unsigned reserved ;
HMSMessageLevel msg_level = HMS_UNKNOWN ;
int msg_code = 0 ;
2024-02-01 09:06:49 +00:00
bool already_read = false ;
2022-07-15 15:37:19 +00:00
bool parse_hms_info ( unsigned attr , unsigned code ) ;
2022-08-05 09:57:07 +00:00
std : : string get_long_error_code ( ) ;
2022-07-15 15:37:19 +00:00
static wxString get_module_name ( ModuleID module_id ) ;
static wxString get_hms_msg_level_str ( HMSMessageLevel level ) ;
} ;
# define UpgradeNoError 0
# define UpgradeDownloadFailed -1
# define UpgradeVerfifyFailed -2
# define UpgradeFlashFailed -3
# define UpgradePrinting -4
2022-07-22 09:46:10 +00:00
// calc distance map
struct DisValue {
int tray_id ;
float distance ;
bool is_same_color = true ;
bool is_type_match = true ;
} ;
2022-07-15 15:37:19 +00:00
2024-08-13 12:13:49 +00:00
class Preset ;
2022-07-15 15:37:19 +00:00
class MachineObject
{
private :
2023-11-01 06:41:41 +00:00
NetworkAgent * m_agent { nullptr } ;
2023-11-02 02:35:35 +00:00
std : : shared_ptr < int > m_token = std : : make_shared < int > ( 1 ) ;
2022-07-15 15:37:19 +00:00
bool check_valid_ip ( ) ;
2022-11-14 03:03:29 +00:00
void _parse_print_option_ack ( int option ) ;
2023-01-16 10:53:35 +00:00
std : : string access_code ;
std : : string user_access_code ;
2024-02-27 03:54:25 +00:00
// type, time stamp, delay
std : : vector < std : : tuple < std : : string , uint64_t , uint64_t > > message_delay ;
2024-12-30 03:54:27 +00:00
2022-07-15 15:37:19 +00:00
public :
2024-12-06 07:23:28 +00:00
typedef std : : function < void ( const json & ) > CommandCallBack ;
2022-07-15 15:37:19 +00:00
enum LIGHT_EFFECT {
LIGHT_EFFECT_ON ,
LIGHT_EFFECT_OFF ,
LIGHT_EFFECT_FLASHING ,
LIGHT_EFFECT_UNKOWN ,
} ;
enum FanType {
COOLING_FAN = 1 ,
BIG_COOLING_FAN = 2 ,
CHAMBER_FAN = 3 ,
2024-09-10 02:11:10 +00:00
EXHAUST_FAN ,
FILTER_FAN ,
2022-07-15 15:37:19 +00:00
} ;
enum UpgradingDisplayState {
UpgradingUnavaliable = 0 ,
UpgradingAvaliable = 1 ,
UpgradingInProgress = 2 ,
UpgradingFinished = 3
} ;
2022-10-27 05:11:52 +00:00
enum ExtruderAxisStatus {
LOAD = 0 ,
UNLOAD = 1 ,
STATUS_NUMS = 2
} ;
enum ExtruderAxisStatus extruder_axis_status = LOAD ;
2022-11-14 03:03:29 +00:00
enum PrintOption {
PRINT_OP_AUTO_RECOVERY = 0 ,
PRINT_OP_MAX ,
} ;
2022-07-15 15:37:19 +00:00
class ModuleVersionInfo
{
public :
std : : string name ;
2025-01-02 08:01:54 +00:00
wxString product_name ;
2022-07-15 15:37:19 +00:00
std : : string sn ;
std : : string hw_ver ;
std : : string sw_ver ;
2022-08-01 07:59:15 +00:00
std : : string sw_new_ver ;
2023-12-12 07:57:37 +00:00
int firmware_status ;
ModuleVersionInfo ( ) : firmware_status ( 0 ) {
} ;
2025-01-02 08:01:54 +00:00
public :
bool isValid ( ) const { return ! sn . empty ( ) ; }
bool isAirPump ( ) const { return product_name . Contains ( " Air Pump " ) ; }
bool isLaszer ( ) const { return product_name . Contains ( " Laser " ) ; }
bool isCuttingModule ( ) const { return product_name . Contains ( " Cutting Module " ) ; }
2022-07-15 15:37:19 +00:00
} ;
2022-11-18 03:16:24 +00:00
enum SdcardState {
NO_SDCARD = 0 ,
HAS_SDCARD_NORMAL = 1 ,
HAS_SDCARD_ABNORMAL = 2 ,
2024-11-29 11:31:06 +00:00
HAS_SDCARD_READONLY = 3 ,
SDCARD_STATE_NUM = 4
2022-11-18 03:16:24 +00:00
} ;
2023-05-26 11:37:18 +00:00
enum ActiveState {
2024-07-08 09:32:49 +00:00
NotActive ,
Active ,
2023-05-26 11:37:18 +00:00
UpdateToDate
} ;
2024-09-04 04:03:28 +00:00
enum MappingOption {
USE_LEFT_AMS = 0 ,
USE_RIGHT_AMS ,
USE_LEFT_EXT ,
USE_RIGHT_EXT
} ;
2022-11-22 09:54:39 +00:00
class ExtrusionRatioInfo
{
public :
std : : string name ;
std : : string setting_id ;
float k = 0.0 ;
float n = 0.0 ;
} ;
2022-07-15 15:37:19 +00:00
/* static members and functions */
2023-03-22 01:08:30 +00:00
static inline int m_sequence_id = START_SEQ_ID ;
2022-09-02 05:12:50 +00:00
static std : : string parse_printer_type ( std : : string type_str ) ;
static std : : string get_preset_printer_model_name ( std : : string printer_type ) ;
2022-12-09 10:34:28 +00:00
static std : : string get_preset_printer_thumbnail_img ( std : : string printer_type ) ;
2022-07-15 15:37:19 +00:00
static bool is_bbl_filament ( std : : string tag_uid ) ;
typedef std : : function < void ( ) > UploadedFn ;
typedef std : : function < void ( int progress ) > UploadProgressFn ;
typedef std : : function < void ( std : : string error ) > ErrorFn ;
typedef std : : function < void ( int result , std : : string info ) > ResultFn ;
/* properties */
std : : string dev_name ;
std : : string dev_ip ;
std : : string dev_id ;
2023-05-25 08:51:01 +00:00
bool local_use_ssl_for_mqtt { true } ;
bool local_use_ssl_for_ftp { true } ;
2024-12-03 13:49:35 +00:00
bool m_busy_for_select_extruder { false } ;
2023-11-01 04:33:16 +00:00
int subscribe_counter { 3 } ;
2022-07-15 15:37:19 +00:00
std : : string dev_connection_type ; /* lan | cloud */
std : : string connection_type ( ) { return dev_connection_type ; }
2023-08-25 01:10:14 +00:00
std : : string dev_connection_name ; /* lan | eth */
2023-08-17 04:47:46 +00:00
void set_dev_ip ( std : : string ip ) { dev_ip = ip ; }
2023-02-02 06:21:51 +00:00
std : : string get_ftp_folder ( ) ;
2023-08-17 04:47:46 +00:00
bool has_access_right ( ) { return ! get_access_code ( ) . empty ( ) ; }
2023-01-16 10:53:35 +00:00
std : : string get_access_code ( ) ;
2023-02-08 07:26:39 +00:00
2023-05-18 07:24:30 +00:00
void set_access_code ( std : : string code , bool only_refresh = true ) ;
void set_user_access_code ( std : : string code , bool only_refresh = true ) ;
void erase_user_access_code ( ) ;
2023-01-16 10:53:35 +00:00
std : : string get_user_access_code ( ) ;
2022-07-15 15:37:19 +00:00
bool is_lan_mode_printer ( ) ;
2023-02-08 07:26:39 +00:00
2022-09-02 05:12:50 +00:00
//PRINTER_TYPE printer_type = PRINTER_3DPrinter_UKNOWN;
std : : string printer_type ; /* model_id */
2023-07-07 02:11:18 +00:00
PrinterSeries get_printer_series ( ) const ;
2023-08-25 04:25:22 +00:00
PrinterArch get_printer_arch ( ) const ;
2023-09-07 08:25:03 +00:00
std : : string get_printer_ams_type ( ) const ;
2023-10-09 08:57:50 +00:00
bool get_printer_is_enclosed ( ) const ;
2023-09-07 08:25:03 +00:00
2023-08-16 07:38:16 +00:00
void reload_printer_settings ( ) ;
2022-12-09 10:34:28 +00:00
std : : string printer_thumbnail_img ;
std : : string monitor_upgrade_printer_img ;
2022-07-15 15:37:19 +00:00
wxString get_printer_type_display_str ( ) ;
2022-12-09 10:34:28 +00:00
std : : string get_printer_thumbnail_img_str ( ) ;
2023-08-17 04:47:46 +00:00
2022-07-15 15:37:19 +00:00
std : : string product_name ; // set by iot service, get /user/print
std : : string bind_user_name ;
std : : string bind_user_id ;
std : : string bind_state ; /* free | occupied */
2023-03-16 02:26:32 +00:00
std : : string bind_sec_link ;
2023-12-28 10:04:18 +00:00
std : : string bind_ssdp_version ;
2022-07-15 15:37:19 +00:00
bool is_avaliable ( ) { return bind_state = = " free " ; }
time_t last_alive ;
bool m_is_online ;
2022-11-29 08:20:15 +00:00
bool m_lan_mode_connection_state { false } ;
2023-11-22 10:30:14 +00:00
bool m_set_ctt_dlg { false } ;
2022-11-29 08:20:15 +00:00
void set_lan_mode_connection_state ( bool state ) { m_lan_mode_connection_state = state ; } ;
bool get_lan_mode_connection_state ( ) { return m_lan_mode_connection_state ; } ;
2023-11-22 10:30:14 +00:00
void set_ctt_dlg ( wxString text ) ;
2022-07-15 15:37:19 +00:00
int parse_msg_count = 0 ;
2023-07-07 03:52:31 +00:00
int keep_alive_count = 0 ;
2022-07-15 15:37:19 +00:00
std : : chrono : : system_clock : : time_point last_update_time ; /* last received print data from machine */
2023-12-18 07:39:17 +00:00
std : : chrono : : system_clock : : time_point last_utc_time ; /* last received print data from machine */
2023-07-07 03:52:31 +00:00
std : : chrono : : system_clock : : time_point last_keep_alive ; /* last received print data from machine */
2022-07-15 15:37:19 +00:00
std : : chrono : : system_clock : : time_point last_push_time ; /* last received print push from machine */
std : : chrono : : system_clock : : time_point last_request_push ; /* last received print push from machine */
2022-12-07 10:20:50 +00:00
std : : chrono : : system_clock : : time_point last_request_start ; /* last received print push from machine */
2022-07-15 15:37:19 +00:00
2023-06-07 11:17:15 +00:00
int m_active_state = 0 ; // 0 - not active, 1 - active, 2 - update-to-date
2023-05-31 11:50:49 +00:00
bool is_tunnel_mqtt = false ;
2023-05-26 11:37:18 +00:00
2022-07-15 15:37:19 +00:00
/* ams properties */
std : : map < std : : string , Ams * > amsList ; // key: ams[id], start with 0
2024-06-24 09:35:38 +00:00
//AmsTray vt_tray; // virtual tray
2022-07-15 15:37:19 +00:00
long ams_exist_bits = 0 ;
long tray_exist_bits = 0 ;
long tray_is_bbl_bits = 0 ;
long tray_read_done_bits = 0 ;
2022-08-31 12:02:57 +00:00
long tray_reading_bits = 0 ;
int ams_rfid_status = 0 ;
bool ams_insert_flag { false } ;
bool ams_power_on_flag { false } ;
2022-11-10 11:32:25 +00:00
bool ams_calibrate_remain_flag { false } ;
2022-11-24 07:28:01 +00:00
bool ams_auto_switch_filament_flag { false } ;
2024-04-01 02:30:27 +00:00
bool ams_air_print_status { false } ;
2022-11-22 09:54:39 +00:00
bool ams_support_virtual_tray { true } ;
2022-11-10 11:32:25 +00:00
int ams_humidity ;
2022-09-06 11:58:01 +00:00
int ams_user_setting_hold_count = 0 ;
2022-07-15 15:37:19 +00:00
AmsStatusMain ams_status_main ;
int ams_status_sub ;
int ams_version = 0 ;
std : : string m_ams_id ; // local ams : "0" ~ "3"
std : : string m_tray_id ; // local tray id : "0" ~ "3"
2023-02-10 04:18:16 +00:00
std : : string m_tray_now ; // tray_now : "0" ~ "15" or "254", "255"
2022-07-15 15:37:19 +00:00
std : : string m_tray_tar ; // tray_tar : "0" ~ "15" or "255"
2022-11-22 09:54:39 +00:00
2023-01-12 03:39:16 +00:00
int extrusion_cali_hold_count = 0 ;
2023-01-12 09:27:39 +00:00
std : : chrono : : system_clock : : time_point last_extrusion_cali_start_time ;
2023-01-16 09:34:33 +00:00
int extrusion_cali_set_tray_id = - 1 ;
std : : chrono : : system_clock : : time_point extrusion_cali_set_hold_start ;
2023-05-23 01:06:11 +00:00
std : : string extrusion_cali_filament_name ;
2023-01-12 03:39:16 +00:00
2022-11-22 09:54:39 +00:00
bool is_in_extrusion_cali ( ) ;
bool is_extrusion_cali_finished ( ) ;
2022-07-15 15:37:19 +00:00
void _parse_tray_now ( std : : string tray_now ) ;
bool is_filament_move ( ) { return atoi ( m_tray_now . c_str ( ) ) = = 255 ? false : true ; } ;
bool is_ams_need_update ;
inline bool is_ams_unload ( ) { return m_tray_tar . compare ( " 255 " ) = = 0 ; }
Ams * get_curr_Ams ( ) ;
AmsTray * get_curr_tray ( ) ;
AmsTray * get_ams_tray ( std : : string ams_id , std : : string tray_id ) ;
// parse amsStatusMain and ams_status_sub
void _parse_ams_status ( int ams_status ) ;
bool has_ams ( ) { return ams_exist_bits ! = 0 ; }
2022-12-09 07:38:54 +00:00
bool can_unload_filament ( ) ;
2022-07-15 15:33:39 +00:00
bool is_support_ams_mapping ( ) ;
2024-07-05 06:38:36 +00:00
bool is_support_amx_ext_mix_mapping ( ) ;
2022-07-15 15:37:19 +00:00
2024-04-11 11:57:11 +00:00
void get_ams_colors ( std : : vector < wxColour > & ams_colors ) ;
2024-09-04 04:03:28 +00:00
void parse_tray_info ( int ams_id , int sot_id , AmsTray tray , FilamentInfo & result ) ;
int ams_filament_mapping ( std : : vector < FilamentInfo > filaments , std : : vector < FilamentInfo > & result , std : : vector < bool > map_opt , std : : vector < int > exclude_id = std : : vector < int > ( ) ) ;
2022-11-17 06:46:44 +00:00
bool is_valid_mapping_result ( std : : vector < FilamentInfo > & result , bool check_empty_slot = false ) ;
2022-08-03 02:00:18 +00:00
// exceed index start with 0
bool is_mapping_exceed_filament ( std : : vector < FilamentInfo > & result , int & exceed_index ) ;
2022-07-15 15:37:19 +00:00
void reset_mapping_result ( std : : vector < FilamentInfo > & result ) ;
2024-09-04 07:20:35 +00:00
bool is_main_extruder_on_left ( ) const ;
2024-08-05 09:34:45 +00:00
bool is_multi_extruders ( ) const ;
2024-09-04 07:20:35 +00:00
bool need_SD_card ( ) const ;
2024-09-30 03:41:30 +00:00
int get_extruder_id_by_ams_id ( const std : : string & ams_id ) ;
2022-07-15 15:37:19 +00:00
2022-08-19 06:19:13 +00:00
/*online*/
bool online_rfid ;
bool online_ahb ;
2022-12-09 13:03:00 +00:00
int online_version = - 1 ;
int last_online_version = - 1 ;
2022-07-15 15:37:19 +00:00
/* temperature */
2024-07-15 13:54:21 +00:00
//float nozzle_temp;
//float nozzle_temp_target;
2022-07-15 15:37:19 +00:00
float bed_temp ;
float bed_temp_target ;
float chamber_temp ;
2023-09-15 07:13:14 +00:00
float chamber_temp_target ;
2024-12-30 03:54:27 +00:00
float chamber_temp_edit_min = 0 ;
float chamber_temp_edit_max = 60 ;
2022-07-15 15:37:19 +00:00
float frame_temp ;
/* cooling */
int heatbreak_fan_speed = 0 ;
int cooling_fan_speed = 0 ;
int big_fan1_speed = 0 ;
int big_fan2_speed = 0 ;
2022-12-07 02:46:15 +00:00
uint32_t fan_gear = 0 ;
2022-07-15 15:37:19 +00:00
2024-12-20 03:53:13 +00:00
/*extruder*/
[[nodiscard]] bool is_nozzle_flow_type_supported ( ) const { return is_enable_np ; } ;
[[nodiscard]] NozzleFlowType get_nozzle_flow_type ( int extruder_id ) const ;
2024-09-10 02:11:10 +00:00
//new fan data
AirDuctData m_air_duct_data ;
2024-12-06 07:23:28 +00:00
void converse_to_duct ( bool is_suppt_part_fun , bool is_suppt_aux_fun , bool is_suppt_cham_fun ) ; // Convert the data to duct type to make the newand old protocols consistent
2024-09-10 02:11:10 +00:00
2022-07-15 15:37:19 +00:00
/* signals */
std : : string wifi_signal ;
std : : string link_th ;
std : : string link_ams ;
2023-09-11 02:15:41 +00:00
bool network_wired { false } ;
2022-07-15 15:37:19 +00:00
/* lights */
LIGHT_EFFECT chamber_light ;
LIGHT_EFFECT work_light ;
std : : string light_effect_str ( LIGHT_EFFECT effect ) ;
LIGHT_EFFECT light_effect_parse ( std : : string effect_str ) ;
/* upgrade */
bool upgrade_force_upgrade { false } ;
bool upgrade_new_version { false } ;
2022-11-10 03:22:21 +00:00
bool upgrade_consistency_request { false } ;
2022-07-15 15:37:19 +00:00
int upgrade_display_state = 0 ; // 0 : upgrade unavailable, 1: upgrade idle, 2: upgrading, 3: upgrade_finished
2023-01-11 01:26:01 +00:00
int upgrade_display_hold_count = 0 ;
2022-07-15 15:37:19 +00:00
PrinterFirmwareType firmware_type ; // engineer|production
2023-12-25 08:34:38 +00:00
PrinterFirmwareType lifecycle { PrinterFirmwareType : : FIRMWARE_TYPE_PRODUCTION } ;
2022-07-15 15:37:19 +00:00
std : : string upgrade_progress ;
std : : string upgrade_message ;
std : : string upgrade_status ;
std : : string upgrade_module ;
std : : string ams_new_version_number ;
std : : string ota_new_version_number ;
std : : string ahb_new_version_number ;
2022-12-02 01:16:00 +00:00
int get_version_retry = 0 ;
2025-01-02 08:01:54 +00:00
ModuleVersionInfo air_pump_version_info ;
ModuleVersionInfo laser_version_info ;
ModuleVersionInfo cutting_module_version_info ;
2022-07-15 15:37:19 +00:00
std : : map < std : : string , ModuleVersionInfo > module_vers ;
2022-08-01 07:59:15 +00:00
std : : map < std : : string , ModuleVersionInfo > new_ver_list ;
2022-11-22 09:54:39 +00:00
std : : map < std : : string , ExtrusionRatioInfo > extrusion_ratio_map ;
2022-08-01 07:59:15 +00:00
bool m_new_ver_list_exist = false ;
2022-07-15 15:37:19 +00:00
int upgrade_err_code = 0 ;
std : : vector < FirmwareInfo > firmware_list ;
std : : string get_firmware_type_str ( ) ;
2023-05-25 08:51:01 +00:00
std : : string get_lifecycle_type_str ( ) ;
2022-07-15 15:37:19 +00:00
bool is_in_upgrading ( ) ;
bool is_upgrading_avalable ( ) ;
int get_upgrade_percent ( ) ;
std : : string get_ota_version ( ) ;
2022-12-02 01:16:00 +00:00
bool check_version_valid ( ) ;
2022-07-15 15:37:19 +00:00
wxString get_upgrade_result_str ( int upgrade_err_code ) ;
// key: ams_id start as 0,1,2,3
std : : map < int , ModuleVersionInfo > get_ams_version ( ) ;
2025-01-02 08:01:54 +00:00
void store_version_info ( const ModuleVersionInfo & info ) ;
2022-07-15 15:37:19 +00:00
/* printing */
std : : string print_type ;
2022-11-22 09:54:39 +00:00
float nozzle { 0.0f } ; // default is 0.0f as initial value
2022-12-01 09:35:54 +00:00
bool is_220V_voltage { false } ;
2022-07-15 15:37:19 +00:00
int mc_print_stage ;
int mc_print_sub_stage ;
int mc_print_error_code ;
int mc_print_line_number ;
int mc_print_percent ; /* left print progess in percent */
int mc_left_time ; /* left time in seconds */
2022-07-22 09:46:10 +00:00
int last_mc_print_stage ;
2022-08-31 08:32:56 +00:00
int home_flag ;
2022-09-29 02:29:51 +00:00
int hw_switch_state ;
2022-07-15 15:37:19 +00:00
bool is_system_printing ( ) ;
2022-07-22 08:43:08 +00:00
int print_error ;
2023-01-10 02:49:57 +00:00
int curr_layer = 0 ;
int total_layers = 0 ;
bool is_support_layer_num { false } ;
2024-04-01 02:30:27 +00:00
bool nozzle_blob_detection_enabled { false } ;
2022-07-15 15:37:19 +00:00
2024-12-27 12:27:45 +00:00
int last_cali_version = - 1 ;
2023-06-20 12:28:38 +00:00
int cali_version = - 1 ;
2023-07-03 13:48:19 +00:00
float cali_selected_nozzle_dia { 0.0 } ;
// 1: record when start calibration in preset page
// 2: reset when start calibration in start page
// 3: save tray_id, filament_id, setting_id, and name, nozzle_dia
std : : vector < CaliPresetInfo > selected_cali_preset ;
2023-07-04 02:50:02 +00:00
float cache_flow_ratio { 0.0 } ;
2023-07-20 09:04:12 +00:00
bool cali_finished = true ;
2023-12-07 03:14:07 +00:00
FlowRatioCalibrationType flow_ratio_calibration_type = FlowRatioCalibrationType : : COMPLETE_CALIBRATION ;
2023-07-03 13:48:19 +00:00
2023-08-23 02:25:51 +00:00
ManualPaCaliMethod manual_pa_cali_method = ManualPaCaliMethod : : PA_LINE ;
2023-07-03 13:48:19 +00:00
bool has_get_pa_calib_tab { false } ;
2023-05-18 01:41:50 +00:00
std : : vector < PACalibResult > pa_calib_tab ;
2023-07-03 13:48:19 +00:00
bool get_pa_calib_result { false } ;
2023-05-18 01:41:50 +00:00
std : : vector < PACalibResult > pa_calib_results ;
2023-07-03 13:48:19 +00:00
bool get_flow_calib_result { false } ;
2023-05-18 01:41:50 +00:00
std : : vector < FlowRatioCalibResult > flow_ratio_results ;
2023-07-03 13:48:19 +00:00
void reset_pa_cali_history_result ( )
{
has_get_pa_calib_tab = false ;
pa_calib_tab . clear ( ) ;
}
void reset_pa_cali_result ( ) {
get_pa_calib_result = false ;
pa_calib_results . clear ( ) ;
}
void reset_flow_rate_cali_result ( ) {
get_flow_calib_result = false ;
flow_ratio_results . clear ( ) ;
}
bool check_pa_result_validation ( PACalibResult & result ) ;
2023-05-18 01:41:50 +00:00
2022-07-15 15:37:19 +00:00
std : : vector < int > stage_list_info ;
int stage_curr = 0 ;
int m_push_count = 0 ;
2022-07-22 09:46:10 +00:00
bool calibration_done { false } ;
2022-07-15 15:37:19 +00:00
2022-08-31 08:32:56 +00:00
bool is_axis_at_home ( std : : string axis ) ;
2022-09-29 02:29:51 +00:00
bool is_filament_at_extruder ( ) ;
2022-07-15 15:37:19 +00:00
wxString get_curr_stage ( ) ;
// return curr stage index of stage list
int get_curr_stage_idx ( ) ;
bool is_in_calibration ( ) ;
2022-07-22 09:46:10 +00:00
bool is_calibration_running ( ) ;
bool is_calibration_done ( ) ;
void parse_state_changed_event ( ) ;
2022-11-10 11:32:25 +00:00
void parse_status ( int flag ) ;
2022-07-15 15:37:19 +00:00
/* printing status */
2023-03-16 04:19:49 +00:00
std : : string print_status ; /* enum string: FINISH, SLICING, RUNNING, PAUSE, INIT, FAILED */
int queue_number = 0 ;
2022-07-15 15:37:19 +00:00
std : : string iot_print_status ; /* iot */
PrintingSpeedLevel printing_speed_lvl ;
int printing_speed_mag = 100 ;
PrintingSpeedLevel _parse_printing_speed_lvl ( int lvl ) ;
2022-12-01 09:35:54 +00:00
int get_bed_temperature_limit ( ) ;
2022-07-15 15:37:19 +00:00
/* camera */
2022-10-08 07:55:47 +00:00
bool has_ipcam { false } ;
2022-07-15 15:37:19 +00:00
bool camera_recording { false } ;
2022-11-01 08:36:37 +00:00
bool camera_recording_when_printing { false } ;
2022-07-15 15:37:19 +00:00
bool camera_timelapse { false } ;
2022-11-30 06:56:21 +00:00
int camera_recording_hold_count = 0 ;
int camera_timelapse_hold_count = 0 ;
int camera_resolution_hold_count = 0 ;
2023-08-14 06:44:17 +00:00
std : : string camera_resolution = " " ;
std : : vector < std : : string > camera_resolution_supported ;
2022-07-27 10:13:40 +00:00
bool xcam_first_layer_inspector { false } ;
int xcam_first_layer_hold_count = 0 ;
2023-05-17 06:05:23 +00:00
std : : string local_rtsp_url ;
std : : string tutk_state ;
2023-08-14 06:44:17 +00:00
enum LiveviewLocal {
LVL_None ,
2024-02-18 06:59:59 +00:00
LVL_Disable ,
2024-07-08 09:32:49 +00:00
LVL_Local ,
2023-08-14 06:44:17 +00:00
LVL_Rtsps ,
LVL_Rtsp
} liveview_local { LVL_None } ;
2024-04-08 01:48:36 +00:00
enum LiveviewRemote {
LVR_None ,
2024-08-05 09:34:45 +00:00
LVR_Tutk ,
2024-04-08 01:48:36 +00:00
LVR_Agora ,
LVR_TutkAgora
} liveview_remote { LVR_None } ;
enum FileLocal {
2024-08-05 09:34:45 +00:00
FL_None ,
2024-04-08 01:48:36 +00:00
FL_Local
} file_local { FL_None } ;
enum FileRemote {
2024-08-05 09:34:45 +00:00
FR_None ,
FR_Tutk ,
2024-04-08 01:48:36 +00:00
FR_Agora ,
FR_TutkAgora
} file_remote { FR_None } ;
2023-10-25 02:24:30 +00:00
bool file_model_download { false } ;
2023-08-14 06:44:17 +00:00
bool virtual_camera { false } ;
2022-11-14 03:03:29 +00:00
2024-03-02 06:54:41 +00:00
int nozzle_setting_hold_count = 0 ;
2022-11-14 03:03:29 +00:00
bool xcam_ai_monitoring { false } ;
int xcam_ai_monitoring_hold_count = 0 ;
std : : string xcam_ai_monitoring_sensitivity ;
bool xcam_buildplate_marker_detector { false } ;
int xcam_buildplate_marker_hold_count = 0 ;
bool xcam_auto_recovery_step_loss { false } ;
2023-08-15 08:05:13 +00:00
bool xcam_allow_prompt_sound { false } ;
2023-09-25 07:40:24 +00:00
bool xcam_filament_tangle_detect { false } ;
2022-11-14 03:03:29 +00:00
int xcam_auto_recovery_hold_count = 0 ;
2023-08-15 08:05:13 +00:00
int xcam_prompt_sound_hold_count = 0 ;
2023-09-25 07:40:24 +00:00
int xcam_filament_tangle_detect_count = 0 ;
2022-11-24 07:28:01 +00:00
int ams_print_option_count = 0 ;
2024-12-03 13:49:35 +00:00
int nozzle_selected_count = 0 ;
2024-12-10 09:29:43 +00:00
bool flag_update_nozzle = { true } ;
2022-07-15 15:37:19 +00:00
2023-08-17 04:47:46 +00:00
//supported features
bool is_support_chamber_edit { false } ;
bool is_support_extrusion_cali { false } ;
bool is_support_first_layer_inspect { false } ;
2022-12-20 05:11:23 +00:00
bool is_support_ai_monitoring { false } ;
2023-08-17 04:47:46 +00:00
bool is_support_lidar_calibration { false } ;
bool is_support_build_plate_marker_detect { false } ;
2024-07-15 13:54:21 +00:00
bool is_support_pa_calibration { false } ;
2023-08-17 04:47:46 +00:00
bool is_support_flow_calibration { false } ;
2024-07-15 13:54:21 +00:00
bool is_support_auto_flow_calibration { false } ;
2023-08-17 04:47:46 +00:00
bool is_support_print_without_sd { false } ;
bool is_support_print_all { false } ;
bool is_support_send_to_sdcard { false } ;
bool is_support_aux_fan { false } ;
bool is_support_chamber_fan { false } ;
bool is_support_filament_backup { false } ;
2023-08-29 12:55:13 +00:00
bool is_support_show_filament_backup { false } ;
2023-08-17 04:47:46 +00:00
bool is_support_timelapse { false } ;
bool is_support_update_remain { false } ;
bool is_support_auto_leveling { false } ;
bool is_support_auto_recovery_step_loss { false } ;
bool is_support_ams_humidity { false } ;
bool is_support_prompt_sound { false } ;
2023-09-25 07:40:24 +00:00
bool is_support_filament_tangle_detect { false } ;
2023-08-17 04:47:46 +00:00
bool is_support_1080dpi { false } ;
bool is_support_cloud_print_only { false } ;
bool is_support_command_ams_switch { false } ;
2023-06-09 02:50:00 +00:00
bool is_support_mqtt_alive { false } ;
2023-08-17 04:47:46 +00:00
bool is_support_tunnel_mqtt { false } ;
2023-08-15 11:24:37 +00:00
bool is_support_motor_noise_cali { false } ;
2023-10-08 09:11:41 +00:00
bool is_support_wait_sending_finish { false } ;
2023-11-08 07:04:46 +00:00
bool is_support_user_preset { false } ;
2024-07-15 13:54:21 +00:00
//bool is_support_p1s_plus{false};
2024-04-01 02:30:27 +00:00
bool is_support_nozzle_blob_detection { false } ;
bool is_support_air_print_detection { false } ;
2024-04-08 01:48:36 +00:00
bool is_support_agora { false } ;
2024-07-15 13:54:21 +00:00
bool is_support_upgrade_kit { false } ;
2024-12-12 10:10:42 +00:00
bool is_support_filament_setting_inprinting { false } ;
2024-12-27 06:51:40 +00:00
bool is_support_internal_timelapse { false } ; // fun[28], support timelapse without SD card
2023-08-17 04:47:46 +00:00
2024-07-15 13:54:21 +00:00
bool installed_upgrade_kit { false } ;
2023-08-17 04:47:46 +00:00
int bed_temperature_limit = - 1 ;
2024-12-24 09:56:22 +00:00
/*nozzle temp range*/
std : : vector < int > nozzle_temp_range ;
2022-11-18 03:16:24 +00:00
/* sdcard */
MachineObject : : SdcardState sdcard_state { NO_SDCARD } ;
MachineObject : : SdcardState get_sdcard_state ( ) ;
2022-07-15 15:37:19 +00:00
/* HMS */
std : : vector < HMSItem > hms_list ;
/* machine mqtt apis */
2023-05-13 09:31:35 +00:00
int connect ( bool is_anonymous = false , bool use_openssl = true ) ;
2022-07-15 15:37:19 +00:00
int disconnect ( ) ;
json_diff print_json ;
/* Project Task and Sub Task */
std : : string project_id_ ;
std : : string profile_id_ ;
std : : string task_id_ ;
std : : string subtask_id_ ;
2023-09-11 07:55:00 +00:00
std : : string job_id_ ;
2023-09-27 03:54:29 +00:00
std : : string last_subtask_id_ ;
2022-07-15 15:37:19 +00:00
BBLSliceInfo * slice_info { nullptr } ;
2022-08-04 06:05:26 +00:00
boost : : thread * get_slice_info_thread { nullptr } ;
2023-09-27 03:54:29 +00:00
boost : : thread * get_model_task_thread { nullptr } ;
2024-12-06 07:23:28 +00:00
/* key: sequence id, value: callback */
std : : map < std : : string , CommandCallBack > m_callback_list ;
2023-09-27 03:54:29 +00:00
bool is_makeworld_subtask ( ) ;
2022-08-04 06:05:26 +00:00
2022-12-07 10:20:50 +00:00
2023-11-09 03:26:49 +00:00
int m_plate_index { - 1 } ;
2022-07-15 15:37:19 +00:00
std : : string m_gcode_file ;
2022-07-22 09:46:10 +00:00
int gcode_file_prepare_percent = 0 ;
2022-07-15 15:37:19 +00:00
BBLSubTask * subtask_ ;
2023-09-27 03:54:29 +00:00
BBLModelTask * model_task { nullptr } ;
RatingInfo * rating_info { nullptr } ;
int request_model_result = 0 ;
bool get_model_mall_result_need_retry = false ;
2024-07-08 09:32:49 +00:00
2022-07-15 15:37:19 +00:00
std : : string obj_subtask_id ; // subtask_id == 0 for sdcard
std : : string subtask_name ;
bool is_sdcard_printing ( ) ;
2022-12-09 08:46:51 +00:00
bool is_timelapse ( ) ;
2022-11-01 08:36:37 +00:00
bool is_recording_enable ( ) ;
bool is_recording ( ) ;
2022-07-15 15:37:19 +00:00
MachineObject ( NetworkAgent * agent , std : : string name , std : : string id , std : : string ip ) ;
~ MachineObject ( ) ;
2022-12-16 07:55:10 +00:00
2023-08-09 11:21:38 +00:00
std : : string parse_version ( ) ;
2022-12-16 07:55:10 +00:00
void parse_version_func ( ) ;
2023-03-22 01:08:30 +00:00
bool is_studio_cmd ( int seq ) ;
2024-12-03 13:49:35 +00:00
2024-12-27 06:51:40 +00:00
/* quick check*/
bool canEnableTimelapse ( ) const ;
2022-07-15 15:37:19 +00:00
/* command commands */
2022-12-02 01:16:00 +00:00
int command_get_version ( bool with_retry = true ) ;
2023-06-30 04:06:47 +00:00
int command_request_push_all ( bool request_now = false ) ;
2022-12-07 10:20:50 +00:00
int command_pushing ( std : : string cmd ) ;
2023-04-06 00:21:59 +00:00
int command_clean_print_error ( std : : string task_id , int print_error ) ;
2023-07-19 08:47:25 +00:00
int command_set_printer_nozzle ( std : : string nozzle_type , float diameter ) ;
2024-12-09 12:12:24 +00:00
int command_set_printer_nozzle2 ( int id , std : : string nozzle_type , float diameter ) ;
2023-10-16 07:45:23 +00:00
int command_get_access_code ( ) ;
2024-12-03 13:49:35 +00:00
int command_select_extruder ( int id ) ;
2022-07-15 15:37:19 +00:00
/* command upgrade */
int command_upgrade_confirm ( ) ;
2022-09-16 02:26:20 +00:00
int command_consistency_upgrade_confirm ( ) ;
2022-07-15 15:37:19 +00:00
int command_upgrade_firmware ( FirmwareInfo info ) ;
2022-12-08 07:12:52 +00:00
int command_upgrade_module ( std : : string url , std : : string module_type , std : : string version ) ;
2022-07-15 15:37:19 +00:00
/* control apis */
int command_xyz_abs ( ) ;
int command_auto_leveling ( ) ;
int command_go_home ( ) ;
2024-12-06 07:23:28 +00:00
int command_control_fan ( int fan_type , int val ) ; // Old protocol
int command_control_fan_new ( int fan_id , int val , const CommandCallBack & cb ) ; // New protocol
int command_control_air_duct ( int mode_id , const CommandCallBack & cb ) ;
2022-07-15 15:37:19 +00:00
int command_task_abort ( ) ;
2023-09-11 07:55:00 +00:00
/* cancelled the job_id */
int command_task_cancel ( std : : string job_id ) ;
2022-07-15 15:37:19 +00:00
int command_task_pause ( ) ;
int command_task_resume ( ) ;
int command_set_bed ( int temp ) ;
int command_set_nozzle ( int temp ) ;
2024-12-03 13:49:35 +00:00
int command_set_nozzle_new ( int nozzle_id , int temp ) ;
2023-07-06 02:53:28 +00:00
int command_set_chamber ( int temp ) ;
2022-07-15 15:37:19 +00:00
// ams controls
int command_ams_switch ( int tray_index , int old_temp = 210 , int new_temp = 210 ) ;
int command_ams_change_filament ( int tray_id , int old_temp = 210 , int new_temp = 210 ) ;
2024-12-04 01:38:34 +00:00
int command_ams_change_filament2 ( int ams_id , int slot_id , int old_temp = 210 , int new_temp = 210 ) ;
2022-11-10 11:32:25 +00:00
int command_ams_user_settings ( int ams_id , bool start_read_opt , bool tray_read_opt , bool remain_flag = false ) ;
2022-11-24 07:28:01 +00:00
int command_ams_switch_filament ( bool switch_filament ) ;
2024-04-01 02:30:27 +00:00
int command_ams_air_print_detect ( bool air_print_detect ) ;
2022-07-15 15:37:19 +00:00
int command_ams_calibrate ( int ams_id ) ;
2022-11-22 09:54:39 +00:00
int command_ams_filament_settings ( int ams_id , int tray_id , std : : string filament_id , std : : string setting_id , std : : string tray_color , std : : string tray_type , int nozzle_temp_min , int nozzle_temp_max ) ;
2022-07-15 15:37:19 +00:00
int command_ams_select_tray ( std : : string tray_id ) ;
int command_ams_refresh_rfid ( std : : string tray_id ) ;
2025-01-01 08:30:38 +00:00
int command_ams_refresh_rfid2 ( int ams_id , int slot_id ) ;
2022-10-17 06:12:56 +00:00
int command_ams_control ( std : : string action ) ;
2022-07-15 15:37:19 +00:00
int command_set_chamber_light ( LIGHT_EFFECT effect , int on_time = 500 , int off_time = 500 , int loops = 1 , int interval = 1000 ) ;
2024-12-03 14:13:11 +00:00
int command_set_chamber_light2 ( LIGHT_EFFECT effect , int on_time = 500 , int off_time = 500 , int loops = 1 , int interval = 1000 ) ;
2022-07-15 15:37:19 +00:00
int command_set_work_light ( LIGHT_EFFECT effect , int on_time = 500 , int off_time = 500 , int loops = 1 , int interval = 1000 ) ;
2022-11-22 09:54:39 +00:00
int command_start_extrusion_cali ( int tray_index , int nozzle_temp , int bed_temp , float max_volumetric_speed , std : : string setting_id = " " ) ;
int command_stop_extrusion_cali ( ) ;
int command_extrusion_cali_set ( int tray_index , std : : string setting_id , std : : string name , float k , float n , int bed_temp = - 1 , int nozzle_temp = - 1 , float max_volumetric_speed = - 1 ) ;
2022-07-15 15:37:19 +00:00
// set printing speed
int command_set_printing_speed ( PrintingSpeedLevel lvl ) ;
2023-09-25 07:40:24 +00:00
//set prompt sound
2023-08-15 08:05:13 +00:00
int command_set_prompt_sound ( bool prompt_sound ) ;
2023-09-25 07:40:24 +00:00
//set fliament tangle detect
int command_set_filament_tangle_detect ( bool fliament_tangle_detect ) ;
2022-11-14 03:03:29 +00:00
// set print option
int command_set_printing_option ( bool auto_recovery ) ;
2024-04-01 02:30:27 +00:00
int command_nozzle_blob_detect ( bool nozzle_blob_detect ) ;
2022-07-15 15:37:19 +00:00
// axis string is X, Y, Z, E
2023-07-05 12:07:08 +00:00
int command_axis_control ( std : : string axis , double unit = 1.0f , double input_val = 1.0f , int speed = 3000 ) ;
2022-07-15 15:37:19 +00:00
2024-12-13 02:04:28 +00:00
int command_extruder_control ( int nozzle_id , double val ) ;
2022-07-15 15:37:19 +00:00
// calibration printer
2022-11-17 03:38:46 +00:00
bool is_support_command_calibration ( ) ;
2023-08-15 11:24:37 +00:00
int command_start_calibration ( bool vibration , bool bed_leveling , bool xcam_cali , bool motor_noise ) ;
2022-07-15 15:37:19 +00:00
2023-05-18 01:41:50 +00:00
// PA calibration
2023-06-30 02:32:01 +00:00
int command_start_pa_calibration ( const X1CCalibInfos & pa_data , int mode = 0 ) ; // 0: automatic mode; 1: manual mode. default: automatic mode
2023-08-04 06:28:31 +00:00
int command_set_pa_calibration ( const std : : vector < PACalibResult > & pa_calib_values , bool is_auto_cali ) ;
2023-06-05 01:25:43 +00:00
int command_delete_pa_calibration ( const PACalibIndexInfo & pa_calib ) ;
2024-07-08 09:32:49 +00:00
int command_get_pa_calibration_tab ( const PACalibExtruderInfo & calib_info ) ;
2023-06-20 12:28:38 +00:00
int command_get_pa_calibration_result ( float nozzle_diameter ) ;
2023-06-05 01:25:43 +00:00
int commnad_select_pa_calibration ( const PACalibIndexInfo & pa_calib_info ) ;
2023-05-18 01:41:50 +00:00
// flow ratio calibration
2023-06-05 01:25:43 +00:00
int command_start_flow_ratio_calibration ( const X1CCalibInfos & calib_data ) ;
2023-06-20 12:28:38 +00:00
int command_get_flow_ratio_calibration_result ( float nozzle_diameter ) ;
2023-05-18 01:41:50 +00:00
2022-07-15 15:37:19 +00:00
// camera control
int command_ipcam_record ( bool on_off ) ;
int command_ipcam_timelapse ( bool on_off ) ;
2022-11-18 03:16:24 +00:00
int command_ipcam_resolution_set ( std : : string resolution ) ;
2022-11-14 03:03:29 +00:00
int command_xcam_control ( std : : string module_name , bool on_off , std : : string lvl = " " ) ;
int command_xcam_control_ai_monitoring ( bool on_off , std : : string lvl ) ;
2022-07-27 10:13:40 +00:00
int command_xcam_control_first_layer_inspector ( bool on_off , bool print_halt ) ;
2022-11-14 03:03:29 +00:00
int command_xcam_control_buildplate_marker_detector ( bool on_off ) ;
int command_xcam_control_auto_recovery_step_loss ( bool on_off ) ;
2023-08-15 08:05:13 +00:00
int command_xcam_control_allow_prompt_sound ( bool on_off ) ;
2023-09-25 07:40:24 +00:00
int command_xcam_control_filament_tangle_detect ( bool on_off ) ;
2022-07-15 15:37:19 +00:00
/* common apis */
inline bool is_local ( ) { return ! dev_ip . empty ( ) ; }
void set_bind_status ( std : : string status ) ;
std : : string get_bind_str ( ) ;
bool can_print ( ) ;
bool can_resume ( ) ;
bool can_pause ( ) ;
bool can_abort ( ) ;
bool is_in_printing ( ) ;
2022-07-22 09:46:10 +00:00
bool is_in_prepare ( ) ;
2022-07-15 15:37:19 +00:00
bool is_printing_finished ( ) ;
2023-08-25 04:25:22 +00:00
bool is_core_xy ( ) ;
2022-07-15 15:37:19 +00:00
void reset_update_time ( ) ;
void reset ( ) ;
static bool is_in_printing_status ( std : : string status ) ;
void set_print_state ( std : : string status ) ;
bool is_connected ( ) ;
2022-07-22 09:46:10 +00:00
bool is_connecting ( ) ;
2022-07-15 15:37:19 +00:00
void set_online_state ( bool on_off ) ;
bool is_online ( ) { return m_is_online ; }
2024-12-20 13:27:38 +00:00
bool is_info_ready ( ) const ;
2023-05-06 05:54:14 +00:00
bool is_camera_busy_off ( ) ;
2022-07-15 15:37:19 +00:00
2023-08-17 04:47:46 +00:00
std : : vector < std : : string > get_resolution_supported ( ) ;
std : : vector < std : : string > get_compatible_machine ( ) ;
2022-07-15 15:37:19 +00:00
/* Msg for display MsgFn */
typedef std : : function < void ( std : : string topic , std : : string payload ) > MsgFn ;
2024-12-02 10:21:57 +00:00
int publish_json ( std : : string json_str , int qos = 0 , int flag = 0 ) ;
int cloud_publish_json ( std : : string json_str , int qos = 0 , int flag = 0 ) ;
int local_publish_json ( std : : string json_str , int qos = 0 , int flag = 0 ) ;
2024-04-17 20:38:58 +00:00
int parse_json ( std : : string payload , bool key_filed_only = false ) ;
2022-07-15 15:37:19 +00:00
int publish_gcode ( std : : string gcode_str ) ;
2023-08-02 10:09:36 +00:00
std : : string setting_id_to_type ( std : : string setting_id , std : : string tray_type ) ;
2022-07-15 15:37:19 +00:00
BBLSubTask * get_subtask ( ) ;
2023-04-24 08:59:45 +00:00
BBLModelTask * get_modeltask ( ) ;
void set_modeltask ( BBLModelTask * task ) ;
2023-09-27 03:54:29 +00:00
void update_model_task ( ) ;
2022-07-15 15:37:19 +00:00
void update_slice_info ( std : : string project_id , std : : string profile_id , std : : string subtask_id , int plate_idx ) ;
bool m_firmware_valid { false } ;
2022-10-08 02:38:34 +00:00
bool m_firmware_thread_started { false } ;
2022-07-15 15:37:19 +00:00
void get_firmware_info ( ) ;
bool is_firmware_info_valid ( ) ;
2024-12-06 07:23:28 +00:00
std : : string get_string_from_fantype ( int type ) ;
2024-08-13 12:13:49 +00:00
2024-06-18 12:09:11 +00:00
/*for more extruder*/
2024-07-15 13:54:21 +00:00
bool is_enable_np { false } ;
2024-10-26 06:30:18 +00:00
2024-09-10 02:11:10 +00:00
ExtderData m_extder_data ;
2024-10-26 06:30:18 +00:00
NozzleData m_nozzle_data ;
2024-06-18 12:09:11 +00:00
2024-06-24 09:35:38 +00:00
/*vi slot data*/
std : : vector < AmsTray > vt_slot ;
AmsTray parse_vt_tray ( json vtray ) ;
2024-07-15 13:54:21 +00:00
/*for parse new info*/
void parse_new_info ( json print ) ;
2024-10-26 06:30:18 +00:00
bool is_nozzle_data_invalid ( ) ;
int get_flag_bits ( std : : string str , int start , int count = 1 ) ;
2024-09-10 02:11:10 +00:00
int get_flag_bits ( int num , int start , int count = 1 , int base = 10 ) ;
2024-12-12 10:22:45 +00:00
/* Device Filament Check */
struct FilamentData
{
std : : set < std : : string > checked_filament ;
std : : string printer_preset_name ;
std : : map < std : : string , std : : pair < int , int > > filament_list ; // filament_id, pair<min temp, max temp>
} ;
std : : map < std : : string , FilamentData > m_nozzle_filament_data ;
void update_filament_list ( ) ;
void update_printer_preset_name ( ) ;
void check_ams_filament_valid ( ) ;
2024-12-06 07:23:28 +00:00
int command_handle_response ( const json & response ) ;
2022-07-15 15:37:19 +00:00
} ;
class DeviceManager
{
private :
NetworkAgent * m_agent { nullptr } ;
public :
2024-04-17 20:38:58 +00:00
static bool EnableMultiMachine ;
2022-07-15 15:37:19 +00:00
DeviceManager ( NetworkAgent * agent = nullptr ) ;
~ DeviceManager ( ) ;
2022-07-22 09:46:10 +00:00
void set_agent ( NetworkAgent * agent ) ;
2022-07-15 15:37:19 +00:00
std : : mutex listMutex ;
std : : string selected_machine ; /* dev_id */
std : : string local_selected_machine ; /* dev_id */
std : : map < std : : string , MachineObject * > localMachineList ; /* dev_id -> MachineObject*, localMachine SSDP */
std : : map < std : : string , MachineObject * > userMachineList ; /* dev_id -> MachineObject* cloudMachine of User */
2023-07-07 03:52:31 +00:00
void keep_alive ( ) ;
2022-12-07 10:20:50 +00:00
void check_pushing ( ) ;
2024-07-15 13:54:21 +00:00
static float nozzle_diameter_conver ( int diame ) ;
static int nozzle_diameter_conver ( float diame ) ;
static std : : string nozzle_type_conver ( int type ) ;
static int nozzle_type_conver ( std : : string & type ) ;
2022-07-15 15:37:19 +00:00
MachineObject * get_default_machine ( ) ;
MachineObject * get_local_selected_machine ( ) ;
MachineObject * get_local_machine ( std : : string dev_id ) ;
MachineObject * get_user_machine ( std : : string dev_id ) ;
MachineObject * get_my_machine ( std : : string dev_id ) ;
2022-07-22 09:46:10 +00:00
void erase_user_machine ( std : : string dev_id ) ;
2022-07-15 15:37:19 +00:00
void clean_user_info ( ) ;
2023-08-16 07:38:16 +00:00
void reload_printer_settings ( ) ;
2022-07-15 15:37:19 +00:00
2023-03-02 04:17:09 +00:00
bool set_selected_machine ( std : : string dev_id , bool need_disconnect = false ) ;
2022-07-15 15:37:19 +00:00
MachineObject * get_selected_machine ( ) ;
2024-04-17 20:38:58 +00:00
void add_user_subscribe ( ) ;
void del_user_subscribe ( ) ;
void subscribe_device_list ( std : : vector < std : : string > dev_list ) ;
2022-07-15 15:37:19 +00:00
/* return machine has access code and user machine if login*/
std : : map < std : : string , MachineObject * > get_my_machine_list ( ) ;
2024-04-17 20:38:58 +00:00
std : : map < std : : string , MachineObject * > get_my_cloud_machine_list ( ) ;
2022-07-15 15:37:19 +00:00
std : : string get_first_online_user_machine ( ) ;
void modify_device_name ( std : : string dev_id , std : : string dev_name ) ;
void update_user_machine_list_info ( ) ;
void parse_user_print_info ( std : : string body ) ;
/* create machine or update machine properties */
void on_machine_alive ( std : : string json_str ) ;
2024-08-14 03:52:12 +00:00
MachineObject * insert_local_device ( std : : string dev_name , std : : string dev_id , std : : string dev_ip , std : : string connection_type , std : : string bind_state , std : : string version , std : : string access_code ) ;
2022-07-15 15:37:19 +00:00
/* disconnect all machine connections */
void disconnect_all ( ) ;
int query_bind_status ( std : : string & msg ) ;
// get alive machine
std : : map < std : : string , MachineObject * > get_local_machine_list ( ) ;
void load_last_machine ( ) ;
2022-09-02 05:12:50 +00:00
2024-04-17 20:38:58 +00:00
std : : vector < std : : string > subscribe_list_cache ;
static void set_key_field_parsing ( bool enable ) { DeviceManager : : key_field_only = enable ; }
static bool key_field_only ;
2022-09-02 05:12:50 +00:00
static json function_table ;
2023-02-08 02:21:44 +00:00
static json filaments_blacklist ;
2023-10-09 08:57:50 +00:00
template < typename T >
static T get_value_from_config ( std : : string type_str , std : : string item ) {
std : : string config_file = Slic3r : : resources_dir ( ) + " /printers/ " + type_str + " .json " ;
boost : : nowide : : ifstream json_file ( config_file . c_str ( ) ) ;
try {
json jj ;
if ( json_file . is_open ( ) ) {
json_file > > jj ;
if ( jj . contains ( " 00.00.00.00 " ) ) {
json const & printer = jj [ " 00.00.00.00 " ] ;
if ( printer . contains ( item ) ) {
return printer [ item ] . get < T > ( ) ;
}
}
}
}
catch ( . . . ) { }
return " " ;
}
2022-09-02 05:12:50 +00:00
static std : : string parse_printer_type ( std : : string type_str ) ;
static std : : string get_printer_display_name ( std : : string type_str ) ;
2022-12-09 10:34:28 +00:00
static std : : string get_printer_thumbnail_img ( std : : string type_str ) ;
2023-09-07 08:25:03 +00:00
static std : : string get_printer_ams_type ( std : : string type_str ) ;
static std : : string get_printer_series ( std : : string type_str ) ;
2023-08-25 06:39:46 +00:00
static std : : string get_printer_diagram_img ( std : : string type_str ) ;
static std : : string get_printer_ams_img ( std : : string type_str ) ;
2023-08-25 04:25:22 +00:00
static PrinterArch get_printer_arch ( std : : string type_str ) ;
2023-02-02 06:21:51 +00:00
static std : : string get_ftp_folder ( std : : string type_str ) ;
2024-11-05 12:35:31 +00:00
static bool get_printer_is_enclosed ( std : : string type_str ) ;
static bool load_filaments_blacklist_config ( ) ;
2022-11-18 03:16:24 +00:00
static std : : vector < std : : string > get_resolution_supported ( std : : string type_str ) ;
2023-08-17 04:47:46 +00:00
static std : : vector < std : : string > get_compatible_machine ( std : : string type_str ) ;
2024-09-25 03:58:12 +00:00
static void check_filaments_in_blacklist ( std : : string tag_vendor , std : : string tag_type , int ams_id , bool & in_blacklist , std : : string & ac , std : : string & info ) ;
2024-11-05 12:35:31 +00:00
static boost : : bimaps : : bimap < std : : string , std : : string > get_all_model_id_with_name ( ) ;
2023-02-02 09:30:35 +00:00
static std : : string load_gcode ( std : : string type_str , std : : string gcode_file ) ;
2024-09-25 03:58:12 +00:00
static bool is_virtual_slot ( int ams_id ) ;
2022-07-15 15:37:19 +00:00
} ;
2024-01-19 07:46:14 +00:00
// change the opacity
void change_the_opacity ( wxColour & colour ) ;
2024-09-29 12:38:00 +00:00
wxString generate_nozzle_id ( NozzleVolumeType nozzle_type ) ;
2022-07-15 15:37:19 +00:00
} // namespace Slic3r
# endif // slic3r_DeviceManager_hpp_