mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 20:51:12 -06:00 
			
		
		
		
	FIX: the n value is not correct when set pa cali value
If it is manual, set it to 0, if it is automatic, use the calibrated value Change-Id: I7c8737366e0ec0c6c2c17a7ad905cfb34e236fd8 (cherry picked from commit b235b0c8b79b1baf6a393ccfea236e1e650dcb7d) (cherry picked from commit 298f7b6b9349fdf7fe7f9092e3012188d27b9bf2)
This commit is contained in:
		
							parent
							
								
									4eb1edea13
								
							
						
					
					
						commit
						cefd9876fc
					
				
					 6 changed files with 12 additions and 10 deletions
				
			
		|  | @ -295,7 +295,7 @@ void HistoryWindow::sync_history_data() { | ||||||
|                 name_value->SetLabel(from_u8(new_result.name)); |                 name_value->SetLabel(from_u8(new_result.name)); | ||||||
| 
 | 
 | ||||||
|                 new_result.tray_id = -1; |                 new_result.tray_id = -1; | ||||||
|                 CalibUtils::set_PA_calib_result({ new_result }); |                 CalibUtils::set_PA_calib_result({ new_result }, true); | ||||||
| 
 | 
 | ||||||
|                 enbale_action_buttons(false); |                 enbale_action_buttons(false); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|  | @ -593,7 +593,7 @@ void PressureAdvanceWizard::on_cali_save() | ||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 CalibUtils::set_PA_calib_result(new_pa_cali_results); |                 CalibUtils::set_PA_calib_result(new_pa_cali_results, true); | ||||||
|             } |             } | ||||||
|             else if (m_cali_method == CalibrationMethod::CALI_METHOD_MANUAL) { |             else if (m_cali_method == CalibrationMethod::CALI_METHOD_MANUAL) { | ||||||
|                 PACalibResult new_pa_cali_result; |                 PACalibResult new_pa_cali_result; | ||||||
|  | @ -601,7 +601,7 @@ void PressureAdvanceWizard::on_cali_save() | ||||||
|                 if (!save_page->get_manual_result(new_pa_cali_result)) { |                 if (!save_page->get_manual_result(new_pa_cali_result)) { | ||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
|                 CalibUtils::set_PA_calib_result({ new_pa_cali_result }); |                 CalibUtils::set_PA_calib_result({ new_pa_cali_result }, false); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             MessageDialog msg_dlg(nullptr, _L("Flow Dynamics Calibration result has been saved to the printer"), wxEmptyString, wxOK); |             MessageDialog msg_dlg(nullptr, _L("Flow Dynamics Calibration result has been saved to the printer"), wxEmptyString, wxOK); | ||||||
|  |  | ||||||
|  | @ -2036,7 +2036,7 @@ int MachineObject::command_start_pa_calibration(const X1CCalibInfos &pa_data, in | ||||||
|     return -1; |     return -1; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int MachineObject::command_set_pa_calibration(const std::vector<PACalibResult>& pa_calib_values) | int MachineObject::command_set_pa_calibration(const std::vector<PACalibResult> &pa_calib_values, bool is_auto_cali) | ||||||
| { | { | ||||||
|     CNumericLocalesSetter locales_setter; |     CNumericLocalesSetter locales_setter; | ||||||
| 
 | 
 | ||||||
|  | @ -2056,8 +2056,10 @@ int MachineObject::command_set_pa_calibration(const std::vector<PACalibResult>& | ||||||
|             j["print"]["filaments"][i]["setting_id"]  = pa_calib_values[i].setting_id; |             j["print"]["filaments"][i]["setting_id"]  = pa_calib_values[i].setting_id; | ||||||
|             j["print"]["filaments"][i]["name"]        = pa_calib_values[i].name; |             j["print"]["filaments"][i]["name"]        = pa_calib_values[i].name; | ||||||
|             j["print"]["filaments"][i]["k_value"]     = std::to_string(pa_calib_values[i].k_value); |             j["print"]["filaments"][i]["k_value"]     = std::to_string(pa_calib_values[i].k_value); | ||||||
|             // j["print"]["filaments"][i]["n_coef"]      = std::to_string(pa_calib_values[i].n_coef);
 |             if (is_auto_cali) | ||||||
|             j["print"]["filaments"][i]["n_coef"] = "0.0"; |                 j["print"]["filaments"][i]["n_coef"]  = std::to_string(pa_calib_values[i].n_coef); | ||||||
|  |             else | ||||||
|  |                 j["print"]["filaments"][i]["n_coef"]  = "0.0"; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         BOOST_LOG_TRIVIAL(trace) << "extrusion_cali_set: " << j.dump(); |         BOOST_LOG_TRIVIAL(trace) << "extrusion_cali_set: " << j.dump(); | ||||||
|  |  | ||||||
|  | @ -818,7 +818,7 @@ public: | ||||||
| 
 | 
 | ||||||
|     // PA calibration
 |     // PA calibration
 | ||||||
|     int command_start_pa_calibration(const X1CCalibInfos& pa_data, int mode = 0);  // 0: automatic mode; 1: manual mode. default: automatic mode
 |     int command_start_pa_calibration(const X1CCalibInfos& pa_data, int mode = 0);  // 0: automatic mode; 1: manual mode. default: automatic mode
 | ||||||
|     int command_set_pa_calibration(const std::vector<PACalibResult>& pa_calib_values); |     int command_set_pa_calibration(const std::vector<PACalibResult>& pa_calib_values, bool is_auto_cali); | ||||||
|     int command_delete_pa_calibration(const PACalibIndexInfo& pa_calib); |     int command_delete_pa_calibration(const PACalibIndexInfo& pa_calib); | ||||||
|     int command_get_pa_calibration_tab(float nozzle_diameter, const std::string &filament_id = ""); |     int command_get_pa_calibration_tab(float nozzle_diameter, const std::string &filament_id = ""); | ||||||
|     int command_get_pa_calibration_result(float nozzle_diameter); |     int command_get_pa_calibration_result(float nozzle_diameter); | ||||||
|  |  | ||||||
|  | @ -265,7 +265,7 @@ bool CalibUtils::get_PA_calib_info(PACalibResult & pa_calib_info) { | ||||||
|     return false; |     return false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void CalibUtils::set_PA_calib_result(const std::vector<PACalibResult>& pa_calib_values) | void CalibUtils::set_PA_calib_result(const std::vector<PACalibResult> &pa_calib_values, bool is_auto_cali) | ||||||
| { | { | ||||||
|     DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager(); |     DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager(); | ||||||
|     if (!dev) |     if (!dev) | ||||||
|  | @ -275,7 +275,7 @@ void CalibUtils::set_PA_calib_result(const std::vector<PACalibResult>& pa_calib_ | ||||||
|     if (obj_ == nullptr) |     if (obj_ == nullptr) | ||||||
|         return; |         return; | ||||||
| 
 | 
 | ||||||
|     obj_->command_set_pa_calibration(pa_calib_values); |     obj_->command_set_pa_calibration(pa_calib_values, is_auto_cali); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void CalibUtils::select_PA_calib_result(const PACalibIndexInfo& pa_calib_info) | void CalibUtils::select_PA_calib_result(const PACalibIndexInfo& pa_calib_info) | ||||||
|  |  | ||||||
|  | @ -41,7 +41,7 @@ public: | ||||||
|     static void emit_get_PA_calib_info(float nozzle_diameter, const std::string &filament_id); |     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); |     static bool get_PA_calib_info(PACalibResult &pa_calib_info); | ||||||
| 
 | 
 | ||||||
|     static void set_PA_calib_result(const std::vector<PACalibResult>& pa_calib_values); |     static void set_PA_calib_result(const std::vector<PACalibResult>& pa_calib_values, bool is_auto_cali); | ||||||
|     static void select_PA_calib_result(const PACalibIndexInfo &pa_calib_info); |     static void select_PA_calib_result(const PACalibIndexInfo &pa_calib_info); | ||||||
|     static void delete_PA_calib_result(const PACalibIndexInfo &pa_calib_info); |     static void delete_PA_calib_result(const PACalibIndexInfo &pa_calib_info); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 zhimin.zeng
						zhimin.zeng