mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	ENH: add traditional timelapse without wipe tower
Change-Id: I77792fb1a7af2ee95242c6f2501371dc0745287f (cherry picked from commit f6d434cc8b6c8d11d16bbabf9600c2f2b63868db)
This commit is contained in:
		
							parent
							
								
									4987f19147
								
							
						
					
					
						commit
						05625a5e43
					
				
					 10 changed files with 90 additions and 24 deletions
				
			
		|  | @ -1932,8 +1932,8 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re | |||
|         auto co = dynamic_cast<const ConfigOptionEnum<PrintSequence>*>(m_config->option<ConfigOptionEnum<PrintSequence>>("print_sequence")); | ||||
| 
 | ||||
|         const DynamicPrintConfig &dconfig           = wxGetApp().preset_bundle->prints.get_edited_preset().config; | ||||
|         const ConfigOption *      option            = dconfig.option("timelapse_no_toolhead"); | ||||
|         bool                      timelapse_enabled = option ? option->getBool() : false; | ||||
|         auto timelapse_type = dconfig.option<ConfigOptionEnum<TimelapseType>>("timelapse_type"); | ||||
|         bool timelapse_enabled = timelapse_type ? (timelapse_type->value == TimelapseType::tlSmooth) : false; | ||||
| 
 | ||||
|         if (timelapse_enabled || (filaments_count > 1 && wt && co != nullptr && co->value != PrintSequence::ByObject)) { | ||||
|             for (int plate_id = 0; plate_id < n_plates; plate_id++) { | ||||
|  |  | |||
|  | @ -1104,8 +1104,8 @@ Vec3d PartPlate::estimate_wipe_tower_size(const double w, const double wipe_volu | |||
| 	wipe_tower_size(2) = max_height; | ||||
| 
 | ||||
| 	const DynamicPrintConfig &dconfig = wxGetApp().preset_bundle->prints.get_edited_preset().config; | ||||
|     const ConfigOption* option = dconfig.option("timelapse_no_toolhead"); | ||||
|     bool timelapse_enabled = option ? option->getBool() : false; | ||||
|     auto timelapse_type    = dconfig.option<ConfigOptionEnum<TimelapseType>>("timelapse_type"); | ||||
|     bool timelapse_enabled = timelapse_type ? (timelapse_type->value == TimelapseType::tlSmooth) : false; | ||||
| 
 | ||||
| 	double depth = wipe_volume * (plate_extruders.size() - 1) / (layer_height * w); | ||||
|     if (timelapse_enabled || depth > EPSILON) { | ||||
|  |  | |||
|  | @ -1375,13 +1375,14 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) | |||
|         update_wiping_button_visibility(); | ||||
| 
 | ||||
|     if (opt_key == "enable_prime_tower") { | ||||
|         bool timelapse_enabled = m_config->option<ConfigOptionBool>("timelapse_no_toolhead")->value; | ||||
|         auto timelapse_type = m_config->option<ConfigOptionEnum<TimelapseType>>("timelapse_type"); | ||||
|         bool timelapse_enabled = timelapse_type->value == TimelapseType::tlSmooth; | ||||
|         if (!boost::any_cast<bool>(value) && timelapse_enabled) { | ||||
|             MessageDialog dlg(wxGetApp().plater(), _L("Prime tower is required by timeplase. Are you sure you want to disable both of them?"), | ||||
|                               _L("Warning"), wxICON_WARNING | wxYES | wxNO); | ||||
|             if (dlg.ShowModal() == wxID_YES) { | ||||
|                 DynamicPrintConfig new_conf = *m_config; | ||||
|                 new_conf.set_key_value("timelapse_no_toolhead", new ConfigOptionBool(false)); | ||||
|                 new_conf.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(TimelapseType::tlClose)); | ||||
|                 m_config_manipulation.apply(m_config, &new_conf); | ||||
|                 wxGetApp().plater()->update(); | ||||
|             } | ||||
|  | @ -1395,9 +1396,9 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) | |||
|     } | ||||
| 
 | ||||
|     // reload scene to update timelapse wipe tower
 | ||||
|     if (opt_key == "timelapse_no_toolhead") { | ||||
|     if (opt_key == "timelapse_type") { | ||||
|         bool wipe_tower_enabled = m_config->option<ConfigOptionBool>("enable_prime_tower")->value; | ||||
|         if (!wipe_tower_enabled && boost::any_cast<bool>(value)) { | ||||
|         if (!wipe_tower_enabled && boost::any_cast<int>(value) == int(TimelapseType::tlSmooth)) { | ||||
|             MessageDialog dlg(wxGetApp().plater(), _L("Prime tower is required by timelapse. Do you want to enable both of them?"), | ||||
|                               _L("Warning"), wxICON_WARNING | wxYES | wxNO); | ||||
|             if (dlg.ShowModal() == wxID_YES) { | ||||
|  | @ -1408,7 +1409,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) | |||
|             } | ||||
|             else { | ||||
|                 DynamicPrintConfig new_conf = *m_config; | ||||
|                 new_conf.set_key_value("timelapse_no_toolhead", new ConfigOptionBool(false)); | ||||
|                 new_conf.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(TimelapseType::tlClose)); | ||||
|                 m_config_manipulation.apply(m_config, &new_conf); | ||||
|             } | ||||
|         } else { | ||||
|  | @ -1910,7 +1911,7 @@ void TabPrint::build() | |||
|         optgroup = page->new_optgroup(L("Special mode")); | ||||
|         optgroup->append_single_option_line("print_sequence"); | ||||
|         optgroup->append_single_option_line("spiral_mode", "spiral-vase"); | ||||
|         optgroup->append_single_option_line("timelapse_no_toolhead", "Timelapse"); | ||||
|         optgroup->append_single_option_line("timelapse_type", "None"); | ||||
|         //BBS: todo remove clearance to machine
 | ||||
| #if 0 | ||||
|         //line = { L("Extruder radius"), "" };
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 zhimin.zeng
						zhimin.zeng