mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 20:03:47 +00:00
FIX: the dirty data of filament backup
jira: [STUDIO-8518] Change-Id: I67f9d906177269b42d32047b31a0b36cfaf7ecf1 (cherry picked from commit 4de2ef356558540b5565d906cc4684e8ebbe4f1f)
This commit is contained in:
@@ -1569,9 +1569,8 @@ void MachineObject::parse_status(int flag)
|
|||||||
|
|
||||||
sdcard_state = MachineObject::SdcardState(get_flag_bits(flag, 8, 2));
|
sdcard_state = MachineObject::SdcardState(get_flag_bits(flag, 8, 2));
|
||||||
|
|
||||||
if (ams_print_option_count > 0)
|
if (time(nullptr) - ams_switch_filament_start > HOLD_TIME_MAX)
|
||||||
ams_print_option_count--;
|
{
|
||||||
else {
|
|
||||||
ams_auto_switch_filament_flag = ((flag >> 10) & 0x1) != 0;
|
ams_auto_switch_filament_flag = ((flag >> 10) & 0x1) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2380,7 +2379,7 @@ int MachineObject::command_ams_switch_filament(bool switch_filament)
|
|||||||
|
|
||||||
ams_auto_switch_filament_flag = switch_filament;
|
ams_auto_switch_filament_flag = switch_filament;
|
||||||
BOOST_LOG_TRIVIAL(trace) << "command_ams_filament_settings:" << switch_filament;
|
BOOST_LOG_TRIVIAL(trace) << "command_ams_filament_settings:" << switch_filament;
|
||||||
ams_print_option_count = HOLD_COUNT_MAX;
|
ams_switch_filament_start = time(nullptr);
|
||||||
|
|
||||||
return this->publish_json(j.dump());
|
return this->publish_json(j.dump());
|
||||||
}
|
}
|
||||||
@@ -5861,7 +5860,6 @@ void MachineObject::parse_new_info(json print)
|
|||||||
if (xcam_first_layer_hold_count > 0) xcam_first_layer_hold_count--;
|
if (xcam_first_layer_hold_count > 0) xcam_first_layer_hold_count--;
|
||||||
if (xcam_ai_monitoring_hold_count > 0) xcam_ai_monitoring_hold_count--;
|
if (xcam_ai_monitoring_hold_count > 0) xcam_ai_monitoring_hold_count--;
|
||||||
if (xcam_auto_recovery_hold_count > 0) xcam_auto_recovery_hold_count--;
|
if (xcam_auto_recovery_hold_count > 0) xcam_auto_recovery_hold_count--;
|
||||||
if (ams_print_option_count > 0) ams_print_option_count--;
|
|
||||||
if (xcam_prompt_sound_hold_count > 0) xcam_prompt_sound_hold_count--;
|
if (xcam_prompt_sound_hold_count > 0) xcam_prompt_sound_hold_count--;
|
||||||
if (xcam_filament_tangle_detect_count > 0)xcam_filament_tangle_detect_count--;
|
if (xcam_filament_tangle_detect_count > 0)xcam_filament_tangle_detect_count--;
|
||||||
if (nozzle_setting_hold_count > 0)nozzle_setting_hold_count--;
|
if (nozzle_setting_hold_count > 0)nozzle_setting_hold_count--;
|
||||||
@@ -5933,7 +5931,11 @@ void MachineObject::parse_new_info(json print)
|
|||||||
ams_calibrate_remain_flag = get_flag_bits(cfg, 17);
|
ams_calibrate_remain_flag = get_flag_bits(cfg, 17);
|
||||||
}
|
}
|
||||||
|
|
||||||
ams_auto_switch_filament_flag = get_flag_bits(cfg, 18);
|
if (time(nullptr) - ams_switch_filament_start > HOLD_TIME_MAX)
|
||||||
|
{
|
||||||
|
ams_auto_switch_filament_flag = get_flag_bits(cfg, 18);
|
||||||
|
}
|
||||||
|
|
||||||
xcam_allow_prompt_sound = get_flag_bits(cfg, 22);
|
xcam_allow_prompt_sound = get_flag_bits(cfg, 22);
|
||||||
xcam_filament_tangle_detect = get_flag_bits(cfg, 23);
|
xcam_filament_tangle_detect = get_flag_bits(cfg, 23);
|
||||||
nozzle_blob_detection_enabled = get_flag_bits(cfg, 24);
|
nozzle_blob_detection_enabled = get_flag_bits(cfg, 24);
|
||||||
|
|||||||
@@ -687,6 +687,7 @@ public:
|
|||||||
bool ams_air_print_status { false };
|
bool ams_air_print_status { false };
|
||||||
bool ams_support_virtual_tray { true };
|
bool ams_support_virtual_tray { true };
|
||||||
time_t ams_user_setting_start = 0;
|
time_t ams_user_setting_start = 0;
|
||||||
|
time_t ams_switch_filament_start = 0;
|
||||||
AmsStatusMain ams_status_main;
|
AmsStatusMain ams_status_main;
|
||||||
int ams_status_sub;
|
int ams_status_sub;
|
||||||
int ams_version = 0;
|
int ams_version = 0;
|
||||||
@@ -958,7 +959,6 @@ public:
|
|||||||
int xcam_auto_recovery_hold_count = 0;
|
int xcam_auto_recovery_hold_count = 0;
|
||||||
int xcam_prompt_sound_hold_count = 0;
|
int xcam_prompt_sound_hold_count = 0;
|
||||||
int xcam_filament_tangle_detect_count = 0;
|
int xcam_filament_tangle_detect_count = 0;
|
||||||
int ams_print_option_count = 0;
|
|
||||||
int nozzle_selected_count = 0;
|
int nozzle_selected_count = 0;
|
||||||
bool flag_update_nozzle = {true};
|
bool flag_update_nozzle = {true};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user