mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	
							parent
							
								
									ca138794d9
								
							
						
					
					
						commit
						7a7187f9ed
					
				
					 5 changed files with 18 additions and 6 deletions
				
			
		|  | @ -1286,10 +1286,11 @@ namespace DoExport { | |||
| //            get_time_dhms(result.print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Stealth)].time) : "N/A";
 | ||||
| //    }
 | ||||
| 
 | ||||
|     static void update_print_estimated_stats(const GCodeProcessor& processor, const std::vector<Extruder>& extruders, PrintStatistics& print_statistics) | ||||
|     static void update_print_estimated_stats(const GCodeProcessor& processor, const std::vector<Extruder>& extruders, PrintStatistics& print_statistics, const PrintConfig& config) | ||||
|     { | ||||
|         const GCodeProcessorResult& result = processor.get_result(); | ||||
|         print_statistics.estimated_normal_print_time = get_time_dhms(result.print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Normal)].time); | ||||
|         double normal_print_time = result.print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Normal)].time; | ||||
|         print_statistics.estimated_normal_print_time = get_time_dhms(normal_print_time); | ||||
|         print_statistics.estimated_silent_print_time = processor.is_stealth_time_estimator_enabled() ? | ||||
|             get_time_dhms(result.print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Stealth)].time) : "N/A"; | ||||
| 
 | ||||
|  | @ -1327,7 +1328,9 @@ namespace DoExport { | |||
|             total_weight        += weight; | ||||
|             total_cost          += weight * extruder->filament_cost() * 0.001; | ||||
|         } | ||||
| 
 | ||||
|         | ||||
|         total_cost += config.time_cost.getFloat() * (normal_print_time/3600.0); | ||||
|          | ||||
|         print_statistics.total_extruded_volume = total_extruded_volume; | ||||
|         print_statistics.total_used_filament   = total_used_filament; | ||||
|         print_statistics.total_weight          = total_weight; | ||||
|  | @ -1488,7 +1491,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu | |||
|     // Post-process the G-code to update time stamps.
 | ||||
|     m_processor.finalize(true); | ||||
| //    DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics);
 | ||||
|     DoExport::update_print_estimated_stats(m_processor, m_writer.extruders(), print->m_print_statistics); | ||||
|     DoExport::update_print_estimated_stats(m_processor, m_writer.extruders(), print->m_print_statistics, print->config()); | ||||
|     if (result != nullptr) { | ||||
|         *result = std::move(m_processor.extract_result()); | ||||
|         // set the filename to the correct value
 | ||||
|  |  | |||
|  | @ -814,7 +814,7 @@ static std::vector<std::string> s_Preset_printer_options { | |||
|     "default_print_profile", "inherits", | ||||
|     "silent_mode", | ||||
|     // BBS
 | ||||
|     "scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "machine_pause_gcode", "template_custom_gcode", | ||||
|     "scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time","time_cost", "machine_pause_gcode", "template_custom_gcode", | ||||
|     "nozzle_type", "nozzle_hrc","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types", "retract_lift_enforce", | ||||
|     //SoftFever
 | ||||
|     "host_type", "print_host", "printhost_apikey", | ||||
|  |  | |||
|  | @ -2090,6 +2090,14 @@ def = this->add("filament_loading_speed", coFloats); | |||
|     def->mode = comAdvanced; | ||||
|     def->set_default_value(new ConfigOptionFloat(0)); | ||||
| 
 | ||||
|     def = this->add("time_cost", coFloat); | ||||
|     def->label = L("Time cost"); | ||||
|     def->tooltip = L("The printer cost per hour"); | ||||
|     def->sidetext = L("money/h"); | ||||
|     def->min     = 0; | ||||
|     def->mode    = comAdvanced; | ||||
|     def->set_default_value(new ConfigOptionFloat(0)); | ||||
| 
 | ||||
|     def = this->add("gcode_flavor", coEnum); | ||||
|     def->label = L("G-code flavor"); | ||||
|     def->tooltip = L("What kind of gcode the printer is compatible with"); | ||||
|  |  | |||
|  | @ -878,7 +878,7 @@ PRINT_CONFIG_CLASS_DEFINE( | |||
|     ((ConfigOptionBool,                gcode_add_line_number)) | ||||
|     ((ConfigOptionBool,                bbl_bed_temperature_gcode)) | ||||
|     ((ConfigOptionEnum<GCodeFlavor>,   gcode_flavor)) | ||||
| 
 | ||||
|     ((ConfigOptionFloat,               time_cost))  | ||||
|     ((ConfigOptionString,              layer_change_gcode)) | ||||
| 
 | ||||
|     ((ConfigOptionFloat,               max_volumetric_extrusion_rate_slope)) | ||||
|  |  | |||
|  | @ -3126,6 +3126,7 @@ void TabPrinter::build_fff() | |||
|         // optgroup->append_single_option_line("spaghetti_detector");
 | ||||
|         optgroup->append_single_option_line("machine_load_filament_time"); | ||||
|         optgroup->append_single_option_line("machine_unload_filament_time"); | ||||
|         optgroup->append_single_option_line("time_cost"); | ||||
|          | ||||
|         optgroup = page->new_optgroup(L("Cooling Fan")); | ||||
|         Line line = Line{ L("Fan speed-up time"), optgroup->get_option("fan_speedup_time").opt.tooltip }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 niklasb
						niklasb