mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
FIX:Fix the crash that occurred when importing G-code file
Jira:STUDIO-13408 (cherry picked from commit 3810f4edfe086b9500860e59baf35e5568b56977)
This commit is contained in:
@@ -2316,6 +2316,16 @@ static inline const char* remove_eols(const char *begin, const char *end) {
|
||||
return end;
|
||||
}
|
||||
|
||||
DynamicConfig GCodeProcessor::export_config_for_render() const
|
||||
{
|
||||
DynamicConfig config;
|
||||
config.set_key_value("filament_colour", new ConfigOptionStrings(m_parser.get_config().filament_colour.values));
|
||||
config.set_key_value("filament_is_support", new ConfigOptionBools(m_parser.get_config().filament_is_support.values));
|
||||
config.set_key_value("filament_type", new ConfigOptionStrings(m_parser.get_config().filament_type.values));
|
||||
config.set_key_value("filament_map", new ConfigOptionInts(m_parser.get_config().filament_map.values));
|
||||
return config;
|
||||
}
|
||||
|
||||
// Load a G-code into a stand-alone G-code viewer.
|
||||
// throws CanceledException through print->throw_if_canceled() (sent by the caller as callback).
|
||||
void GCodeProcessor::process_file(const std::string& filename, std::function<void()> cancel_callback)
|
||||
|
||||
@@ -847,6 +847,9 @@ class Print;
|
||||
const std::vector<std::set<int>>& unprintable_filament_types );
|
||||
void apply_config(const PrintConfig& config);
|
||||
void set_print(Print* print) { m_print = print; }
|
||||
|
||||
DynamicConfig export_config_for_render() const;
|
||||
|
||||
void enable_stealth_time_estimator(bool enabled);
|
||||
bool is_stealth_time_estimator_enabled() const {
|
||||
return m_time_processor.machines[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Stealth)].enabled;
|
||||
|
||||
Reference in New Issue
Block a user