Change Application name to OrcaSlicer

This commit is contained in:
SoftFever 2023-03-12 10:02:38 +08:00
parent 81ca7720e9
commit 5b0ba1207e
93 changed files with 5629 additions and 10221 deletions

View file

@ -1184,7 +1184,7 @@ ConfigSubstitutions ConfigBase::load_from_gcode_file(const std::string &file, Fo
// Read a 64k block from the end of the G-code.
boost::nowide::ifstream ifs(file);
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": before parse_file %1%") % file.c_str();
// Look for Slic3r or BambuStudio header.
// Look for Slic3r or OrcaSlicer header.
// Look for the header across the whole file as the G-code may have been extended at the start by a post-processing script or the user.
//BBS
bool has_delimiters = true;

View file

@ -231,8 +231,8 @@ class ConfigOptionDef;
struct ConfigOptionDeleter { void operator()(ConfigOption* p); };
using ConfigOptionUniquePtr = std::unique_ptr<ConfigOption, ConfigOptionDeleter>;
// When parsing a configuration value, if the old_value is not understood by this BambuStudio version,
// it is being substituted with some default value that this BambuStudio could work with.
// When parsing a configuration value, if the old_value is not understood by this OrcaSlicer version,
// it is being substituted with some default value that this OrcaSlicer could work with.
// This structure serves to inform the user about the substitutions having been done during file import.
struct ConfigSubstitution {
const ConfigOptionDef *opt_def { nullptr };

View file

@ -835,7 +835,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
bool m_load_restore;
std::string m_backup_path;
std::string m_origin_file;
// Semantic version of Bambu Studio, that generated this 3MF.
// Semantic version of Orca Slicer, that generated this 3MF.
boost::optional<Semver> m_bambuslicer_generator_version;
unsigned int m_fdm_supports_painting_version = 0;
unsigned int m_seam_painting_version = 0;
@ -1501,7 +1501,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
lock.close();
if (!m_is_bbl_3mf) {
// if the 3mf was not produced by BambuStudio and there is more than one instance,
// if the 3mf was not produced by OrcaSlicer and there is more than one instance,
// split the object in as many objects as instances
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ":" << __LINE__ << boost::format(", found 3mf from other vendor, split as instance");
for (const IdToModelObjectMap::value_type& object : m_objects) {
@ -2776,7 +2776,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
}
if (!m_is_bbl_3mf) {
// if the 3mf was not produced by BambuStudio and there is only one object,
// if the 3mf was not produced by OrcaSlicer and there is only one object,
// set the object name to match the filename
if (m_model->objects.size() == 1)
m_model->objects.front()->name = m_name;
@ -3175,15 +3175,15 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
/*} else if (m_curr_metadata_name == BBS_FDM_SUPPORTS_PAINTING_VERSION) {
m_fdm_supports_painting_version = (unsigned int) atoi(m_curr_characters.c_str());
check_painting_version(m_fdm_supports_painting_version, FDM_SUPPORTS_PAINTING_VERSION,
_(L("The selected 3MF contains FDM supports painted object using a newer version of BambuStudio and is not compatible.")));
_(L("The selected 3MF contains FDM supports painted object using a newer version of OrcaSlicer and is not compatible.")));
} else if (m_curr_metadata_name == BBS_SEAM_PAINTING_VERSION) {
m_seam_painting_version = (unsigned int) atoi(m_curr_characters.c_str());
check_painting_version(m_seam_painting_version, SEAM_PAINTING_VERSION,
_(L("The selected 3MF contains seam painted object using a newer version of BambuStudio and is not compatible.")));
_(L("The selected 3MF contains seam painted object using a newer version of OrcaSlicer and is not compatible.")));
} else if (m_curr_metadata_name == BBS_MM_PAINTING_VERSION) {
m_mm_painting_version = (unsigned int) atoi(m_curr_characters.c_str());
check_painting_version(m_mm_painting_version, MM_PAINTING_VERSION,
_(L("The selected 3MF contains multi-material painted object using a newer version of BambuStudio and is not compatible.")));*/
_(L("The selected 3MF contains multi-material painted object using a newer version of OrcaSlicer and is not compatible.")));*/
} else if (m_curr_metadata_name == BBL_MODEL_ID_TAG) {
m_model_id = xml_unescape(m_curr_characters);
} else if (m_curr_metadata_name == BBL_MODEL_NAME_TAG) {
@ -3897,7 +3897,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
TriangleMesh triangle_mesh(std::move(its), volume_data->mesh_stats);
if (!m_is_bbl_3mf) {
// if the 3mf was not produced by BambuStudio and there is only one instance,
// if the 3mf was not produced by OrcaSlicer and there is only one instance,
// bake the transformation into the geometry to allow the reload from disk command
// to work properly
if (object.instances.size() == 1) {
@ -4072,7 +4072,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
TriangleMesh triangle_mesh(std::move(its), volume_data.mesh_stats);
if (!m_is_bbl_3mf) {
// if the 3mf was not produced by BambuStudio and there is only one instance,
// if the 3mf was not produced by OrcaSlicer and there is only one instance,
// bake the transformation into the geometry to allow the reload from disk command
// to work properly
if (object.instances.size() == 1) {
@ -4911,7 +4911,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
}
// Adds content types file ("[Content_Types].xml";).
// The content of this file is the same for each BambuStudio 3mf.
// The content of this file is the same for each OrcaSlicer 3mf.
if (!_add_content_types_file_to_archive(archive)) {
return false;
}
@ -5187,7 +5187,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
}
// Adds relationships file ("_rels/.rels").
// The content of this file is the same for each BambuStudio 3mf.
// The content of this file is the same for each OrcaSlicer 3mf.
// The relationshis file contains a reference to the geometry file "3D/3dmodel.model", the name was chosen to be compatible with CURA.
if (!_add_relationships_file_to_archive(archive, {}, {}, {}, temp_data, export_plate_idx)) {
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ":" <<__LINE__ << boost::format(", _add_relationships_file_to_archive failed\n");

View file

@ -1542,7 +1542,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
file.write_format(
"; %s\n\n",
std::string(
std::string("generated by SuperSlicer " SLIC3R_VERSION " on ") +
std::string("generated by SuperSlicer " SoftFever_VERSION " on ") +
Slic3r::Utils::utc_timestamp())
.c_str());

View file

@ -833,10 +833,11 @@ void GCodeProcessorResult::reset() {
#endif // ENABLE_GCODE_VIEWER_STATISTICS
const std::vector<std::pair<GCodeProcessor::EProducer, std::string>> GCodeProcessor::Producers = {
//BBS: BambuStudio is also "bambu". Otherwise the time estimation didn't work.
//BBS: OrcaSlicer is also "bambu". Otherwise the time estimation didn't work.
//FIXME: Workaround and should be handled when do removing-bambu
{ EProducer::BambuStudio, SLIC3R_APP_NAME },
{ EProducer::BambuStudio, "generated by BambuStudio" }
{ EProducer::BambuStudio, "generated by BambuStudio" },
{ EProducer::BambuStudio, "BambuStudio" }
//{ EProducer::Slic3rPE, "generated by Slic3r Bambu Edition" },
//{ EProducer::Slic3r, "generated by Slic3r" },
//{ EProducer::SuperSlicer, "generated by SuperSlicer" },

View file

@ -72,7 +72,7 @@ namespace Slic3r {
PlaceholderParser::PlaceholderParser(const DynamicConfig *external_config) : m_external_config(external_config)
{
this->set("version", std::string(SLIC3R_VERSION));
this->set("version", std::string(SoftFever_VERSION));
this->apply_env_variables();
this->update_timestamp();
}

View file

@ -66,7 +66,7 @@ std::string PrintBase::output_filename(const std::string &format, const std::str
DynamicConfig cfg;
if (config_override != nullptr)
cfg = *config_override;
cfg.set_key_value("version", new ConfigOptionString(std::string(SLIC3R_VERSION)));
cfg.set_key_value("version", new ConfigOptionString(std::string(SoftFever_VERSION)));
PlaceholderParser::update_timestamp(cfg);
this->update_object_placeholders(cfg, default_ext);
if (! filename_base.empty()) {

View file

@ -5094,8 +5094,8 @@ CLIMiscConfigDef::CLIMiscConfigDef()
def = this->add("config_compatibility", coEnum);
def->label = L("Forward-compatibility rule when loading configurations from config files and project files (3MF, AMF).");
def->tooltip = L("This version of BambuStudio may not understand configurations produced by the newest BambuStudio versions. "
"For example, newer BambuStudio may extend the list of supported firmware flavors. One may decide to "
def->tooltip = L("This version of OrcaSlicer may not understand configurations produced by the newest OrcaSlicer versions. "
"For example, newer OrcaSlicer may extend the list of supported firmware flavors. One may decide to "
"bail out or to substitute an unknown value with a default silently or verbosely.");
def->enum_keys_map = &ConfigOptionEnum<ForwardCompatibilitySubstitutionRule>::get_enum_values();
def->enum_values.push_back("disable");
@ -5130,7 +5130,7 @@ CLIMiscConfigDef::CLIMiscConfigDef()
def = this->add("single_instance", coBool);
def->label = L("Single instance mode");
def->tooltip = L("If enabled, the command line arguments are sent to an existing instance of GUI BambuStudio, "
"or an existing BambuStudio window is activated. "
"or an existing OrcaSlicer window is activated. "
"Overrides the \"single_instance\" configuration value from application preferences.");*/
/*

View file

@ -9,6 +9,7 @@
#include <boost/system/error_code.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem/path.hpp>
#include <openssl/md5.h>
#include "libslic3r.h"
@ -567,6 +568,9 @@ inline std::string get_bbl_remain_time_dhms(float time_in_secs)
bool bbl_calc_md5(std::string &filename, std::string &md5_out);
void copy_directory_recursively(const boost::filesystem::path &source, const boost::filesystem::path &target);
} // namespace Slic3r
#if WIN32

View file

@ -2,7 +2,7 @@
#define _libslic3r_h_
#include "libslic3r_version.h"
#define SLIC3R_APP_FULL_NAME "Bambu Studio"
#define SLIC3R_APP_FULL_NAME "Orca Slicer"
#define GCODEVIEWER_APP_NAME "BambuStudio G-code Viewer"
#define GCODEVIEWER_APP_KEY "BambuStudioGcodeViewer"
#define GCODEVIEWER_BUILD_ID std::string("BambuStudio G-code Viewer-") + std::string(SLIC3R_VERSION) + std::string("-RC")

View file

@ -54,7 +54,6 @@
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/nowide/fstream.hpp>
#include <boost/nowide/convert.hpp>
#include <boost/nowide/cstdio.hpp>
@ -1106,12 +1105,12 @@ std::string string_printf(const char *format, ...)
std::string header_slic3r_generated()
{
return std::string(SLIC3R_APP_NAME "-SoftFever" " " SLIC3R_VERSION);
return std::string(SLIC3R_APP_NAME " " SoftFever_VERSION);
}
std::string header_gcodeviewer_generated()
{
return std::string(GCODEVIEWER_APP_NAME " " SLIC3R_VERSION);
return std::string(GCODEVIEWER_APP_NAME " " SoftFever_VERSION);
}
unsigned get_current_pid()
@ -1421,5 +1420,36 @@ bool bbl_calc_md5(std::string &filename, std::string &md5_out)
return true;
}
// SoftFever: copy directory recursively
void copy_directory_recursively(const boost::filesystem::path &source, const boost::filesystem::path &target)
{
BOOST_LOG_TRIVIAL(info) << format("copy_directory_recursively %1% -> %2%", source, target);
std::string error_message;
if (boost::filesystem::exists(target))
boost::filesystem::remove_all(target);
boost::filesystem::create_directories(target);
for (auto &dir_entry : boost::filesystem::directory_iterator(source))
{
std::string source_file = dir_entry.path().string();
std::string name = dir_entry.path().filename().string();
std::string target_file = target.string() + "/" + name;
if (boost::filesystem::is_directory(dir_entry)) {
const auto target_path = target / name;
copy_directory_recursively(dir_entry, target_path);
}
else {
CopyFileResult cfr = copy_file(source_file, target_file, error_message, false);
if (cfr != CopyFileResult::SUCCESS) {
BOOST_LOG_TRIVIAL(error) << "Copying failed(" << cfr << "): " << error_message;
throw Slic3r::CriticalException(format(
("Copying directory %1% to %2% failed: %3%"),
source, target, error_message));
}
}
}
return;
}
}; // namespace Slic3r