Merge remote-tracking branch 'remote/master' into feature/merge_upstream

# Conflicts:
#	bbl/i18n/OrcaSlicer.pot
#	bbl/i18n/de/OrcaSlicer_de.po
#	bbl/i18n/en/OrcaSlicer_en.po
#	bbl/i18n/es/OrcaSlicer_es.po
#	bbl/i18n/fr/OrcaSlicer_fr.po
#	bbl/i18n/hu/OrcaSlicer_hu.po
#	bbl/i18n/it/OrcaSlicer_it.po
#	bbl/i18n/ja/OrcaSlicer_ja.po
#	bbl/i18n/nl/OrcaSlicer_nl.po
#	bbl/i18n/sv/OrcaSlicer_sv.po
#	bbl/i18n/zh_cn/OrcaSlicer_zh_CN.po
#	resources/config.json
#	resources/i18n/de/BambuStudio.mo
#	resources/i18n/en/BambuStudio.mo
#	resources/i18n/es/BambuStudio.mo
#	resources/i18n/fr/BambuStudio.mo
#	resources/i18n/hu/BambuStudio.mo
#	resources/i18n/it/BambuStudio.mo
#	resources/i18n/ja/OrcaSlicer.mo
#	resources/i18n/nl/BambuStudio.mo
#	resources/i18n/sv/BambuStudio.mo
#	resources/i18n/zh_cn/BambuStudio.mo
#	resources/images/ams_humidity_2.svg
#	resources/images/ams_humidity_3.svg
#	resources/images/ams_humidity_4.svg
#	resources/images/ams_humidity_tips.svg
#	resources/images/monitor_state_on.svg
#	resources/images/sdcard_state_normal.svg
#	resources/profiles/BBL.json
#	resources/profiles/BBL/filament/Bambu PETG-CF @base.json
#	resources/profiles/BBL/filament/Generic PETG-CF @base.json
#	resources/profiles/BBL/machine/Bambu Lab P1P 0.4 nozzle.json
#	resources/web/data/text.js
#	resources/web/guide/3/index.html
#	resources/web/guide/31/index.html
#	src/BambuStudio.cpp
#	src/libslic3r/AABBTreeLines.hpp
#	src/libslic3r/Brim.cpp
#	src/libslic3r/CMakeLists.txt
#	src/libslic3r/ExPolygon.hpp
#	src/libslic3r/Fill/FillBase.hpp
#	src/libslic3r/Format/bbs_3mf.cpp
#	src/libslic3r/GCodeWriter.cpp
#	src/libslic3r/Line.hpp
#	src/libslic3r/PerimeterGenerator.cpp
#	src/libslic3r/Preset.cpp
#	src/libslic3r/Print.cpp
#	src/libslic3r/Print.hpp
#	src/libslic3r/PrintConfig.cpp
#	src/libslic3r/PrintConfig.hpp
#	src/libslic3r/TreeSupport.cpp
#	src/slic3r/GUI/AmsMappingPopup.cpp
#	src/slic3r/GUI/BackgroundSlicingProcess.cpp
#	src/slic3r/GUI/ConfigManipulation.cpp
#	src/slic3r/GUI/GCodeViewer.cpp
#	src/slic3r/GUI/GCodeViewer.hpp
#	src/slic3r/GUI/GLCanvas3D.cpp
#	src/slic3r/GUI/GUI_App.cpp
#	src/slic3r/GUI/MainFrame.cpp
#	src/slic3r/GUI/PartPlate.cpp
#	src/slic3r/GUI/Plater.cpp
#	src/slic3r/GUI/Preferences.cpp
#	src/slic3r/GUI/SelectMachine.cpp
#	src/slic3r/GUI/Widgets/AMSControl.cpp
#	src/slic3r/GUI/wxMediaCtrl2.cpp
#	src/slic3r/Utils/Process.cpp
#	version.inc
This commit is contained in:
SoftFever 2023-04-19 08:48:07 +08:00
commit 9f598046d1
658 changed files with 70312 additions and 4877 deletions

View file

@ -208,7 +208,7 @@ void openFolderForFile(wxString const & file)
@end
/* edit column for wxTableView */
/* edit column for wxCocoaOutlineView */
#include <wx/dataview.h>
#include <wx/osx/cocoa/dataview.h>
@ -216,8 +216,20 @@ void openFolderForFile(wxString const & file)
@implementation wxCocoaOutlineView (Edit)
bool addObserver = false;
- (BOOL)outlineView: (NSOutlineView*) view shouldEditTableColumn:(nullable NSTableColumn *)tableColumn item:(nonnull id)item
{
NSClipView * clipView = [[self enclosingScrollView] contentView];
if (!addObserver) {
addObserver = true;
clipView.postsBoundsChangedNotifications = YES;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(synchronizedViewContentBoundsDidChange:)
name:NSViewBoundsDidChangeNotification
object:clipView];
}
wxDataViewColumn* const col((wxDataViewColumn *)[tableColumn getColumnPointer]);
wxDataViewItem item2([static_cast<wxPointerObject *>(item) pointer]);
@ -227,9 +239,18 @@ void openFolderForFile(wxString const & file)
dvc->GetEventHandler()->ProcessEvent( event );
if( !event.IsAllowed() )
return NO;
return YES;
}
- (void)synchronizedViewContentBoundsDidChange:(NSNotification *)notification
{
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
wxDataViewCustomRenderer * r = dvc->GetCustomRendererPtr();
if (r)
r->FinishEditing();
}
@end
/* Font for wxTextCtrl */

View file

@ -87,6 +87,7 @@ func_get_user_print_info NetworkAgent::get_user_print_info_ptr = null
func_get_printer_firmware NetworkAgent::get_printer_firmware_ptr = nullptr;
func_get_task_plate_index NetworkAgent::get_task_plate_index_ptr = nullptr;
func_get_user_info NetworkAgent::get_user_info_ptr = nullptr;
func_request_bind_ticket NetworkAgent::request_bind_ticket_ptr = nullptr;
func_get_slice_info NetworkAgent::get_slice_info_ptr = nullptr;
func_query_bind_status NetworkAgent::query_bind_status_ptr = nullptr;
func_modify_printer_name NetworkAgent::modify_printer_name_ptr = nullptr;
@ -96,6 +97,10 @@ func_get_profile_3mf NetworkAgent::get_profile_3mf_ptr = nullptr;
func_get_model_publish_url NetworkAgent::get_model_publish_url_ptr = nullptr;
func_get_model_mall_home_url NetworkAgent::get_model_mall_home_url_ptr = nullptr;
func_get_my_profile NetworkAgent::get_my_profile_ptr = nullptr;
func_track_enable NetworkAgent::track_enable_ptr = nullptr;
func_track_event NetworkAgent::track_event_ptr = nullptr;
func_track_header NetworkAgent::track_header_ptr = nullptr;
func_track_update_property NetworkAgent::track_update_property_ptr = nullptr;
NetworkAgent::NetworkAgent()
@ -229,6 +234,7 @@ int NetworkAgent::initialize_network_module(bool using_backup)
get_printer_firmware_ptr = reinterpret_cast<func_get_printer_firmware>(get_network_function("bambu_network_get_printer_firmware"));
get_task_plate_index_ptr = reinterpret_cast<func_get_task_plate_index>(get_network_function("bambu_network_get_task_plate_index"));
get_user_info_ptr = reinterpret_cast<func_get_user_info>(get_network_function("bambu_network_get_user_info"));
request_bind_ticket_ptr = reinterpret_cast<func_request_bind_ticket>(get_network_function("bambu_network_request_bind_ticket"));
get_slice_info_ptr = reinterpret_cast<func_get_slice_info>(get_network_function("bambu_network_get_slice_info"));
query_bind_status_ptr = reinterpret_cast<func_query_bind_status>(get_network_function("bambu_network_query_bind_status"));
modify_printer_name_ptr = reinterpret_cast<func_modify_printer_name>(get_network_function("bambu_network_modify_printer_name"));
@ -238,6 +244,10 @@ int NetworkAgent::initialize_network_module(bool using_backup)
get_model_publish_url_ptr = reinterpret_cast<func_get_model_publish_url>(get_network_function("bambu_network_get_model_publish_url"));
get_model_mall_home_url_ptr = reinterpret_cast<func_get_model_mall_home_url>(get_network_function("bambu_network_get_model_mall_home_url"));
get_my_profile_ptr = reinterpret_cast<func_get_my_profile>(get_network_function("bambu_network_get_my_profile"));
track_enable_ptr = reinterpret_cast<func_track_enable>(get_network_function("bambu_network_track_enable"));
track_event_ptr = reinterpret_cast<func_track_event>(get_network_function("bambu_network_track_event"));
track_header_ptr = reinterpret_cast<func_track_header>(get_network_function("bambu_network_track_header"));
track_update_property_ptr = reinterpret_cast<func_track_update_property>(get_network_function("bambu_network_track_update_property"));
return 0;
}
@ -334,6 +344,10 @@ int NetworkAgent::unload_network_module()
get_model_publish_url_ptr = nullptr;
get_model_mall_home_url_ptr = nullptr;
get_my_profile_ptr = nullptr;
track_enable_ptr = nullptr;
track_event_ptr = nullptr;
track_header_ptr = nullptr;
track_update_property_ptr = nullptr;
return 0;
}
@ -785,11 +799,11 @@ std::string NetworkAgent::build_login_info()
return ret;
}
int NetworkAgent::bind(std::string dev_ip, std::string timezone, OnUpdateStatusFn update_fn)
int NetworkAgent::bind(std::string dev_ip, std::string dev_id, std::string sec_link, std::string timezone, OnUpdateStatusFn update_fn)
{
int ret = 0;
if (network_agent && bind_ptr) {
ret = bind_ptr(network_agent, dev_ip, timezone, update_fn);
ret = bind_ptr(network_agent, dev_ip, dev_id, sec_link, timezone, update_fn);
if (ret)
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%, dev_ip=%3%, timezone=%4%")
%network_agent %ret %dev_ip %timezone;
@ -1019,6 +1033,17 @@ int NetworkAgent::get_user_info(int* identifier)
return ret;
}
int NetworkAgent::request_bind_ticket(std::string* ticket)
{
int ret = 0;
if (network_agent && request_bind_ticket_ptr) {
ret = request_bind_ticket_ptr(network_agent, ticket);
if (ret)
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%") % network_agent % ret;
}
return ret;
}
int NetworkAgent::get_slice_info(std::string project_id, std::string profile_id, int plate_index, std::string* slice_json)
{
int ret;
@ -1117,4 +1142,52 @@ int NetworkAgent::get_my_profile(std::string token, unsigned int *http_code, std
return ret;
}
int NetworkAgent::track_enable(bool enable)
{
enable_track = enable;
int ret = 0;
if (network_agent && track_enable_ptr) {
ret = track_enable_ptr(network_agent, enable);
if (ret)
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format("error network_agnet=%1%, ret = %2%") % network_agent % ret;
}
return ret;
}
int NetworkAgent::track_event(std::string evt_key, std::string content)
{
if (!this->enable_track)
return 0;
int ret = 0;
if (network_agent && track_event_ptr) {
ret = track_event_ptr(network_agent, evt_key, content);
if (ret)
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format("error network_agnet=%1%, ret = %2%") % network_agent % ret;
}
return ret;
}
int NetworkAgent::track_header(std::string header)
{
int ret = 0;
if (network_agent && track_header_ptr) {
ret = track_header_ptr(network_agent, header);
if (ret)
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format("error network_agnet=%1%, ret = %2%") % network_agent % ret;
}
return ret;
}
int NetworkAgent::track_update_property(std::string name, std::string value, std::string type)
{
int ret = 0;
if (network_agent && track_update_property_ptr) {
ret = track_update_property_ptr(network_agent, name, value, type);
if (ret)
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format("error network_agnet=%1%, ret = %2%") % network_agent % ret;
}
return ret;
}
} //namespace

View file

@ -45,7 +45,7 @@ typedef std::string (*func_get_user_nickanme)(void *agent);
typedef std::string (*func_build_login_cmd)(void *agent);
typedef std::string (*func_build_logout_cmd)(void *agent);
typedef std::string (*func_build_login_info)(void *agent);
typedef int (*func_bind)(void *agent, std::string dev_ip, std::string timezone, OnUpdateStatusFn update_fn);
typedef int (*func_bind)(void *agent, std::string dev_ip, std::string dev_id, std::string sec_link, std::string timezone, OnUpdateStatusFn update_fn);
typedef int (*func_unbind)(void *agent, std::string dev_id);
typedef std::string (*func_get_bambulab_host)(void *agent);
typedef std::string (*func_get_user_selected_machine)(void *agent);
@ -67,6 +67,7 @@ typedef int (*func_get_user_print_info)(void *agent, unsigned int* http_code, st
typedef int (*func_get_printer_firmware)(void *agent, std::string dev_id, unsigned* http_code, std::string* http_body);
typedef int (*func_get_task_plate_index)(void *agent, std::string task_id, int* plate_index);
typedef int (*func_get_user_info)(void *agent, int* identifier);
typedef int (*func_request_bind_ticket)(void *agent, std::string* ticket);
typedef int (*func_get_slice_info)(void *agent, std::string project_id, std::string profile_id, int plate_index, std::string* slice_json);
typedef int (*func_query_bind_status)(void *agent, std::vector<std::string> query_list, unsigned int* http_code, std::string* http_body);
typedef int (*func_modify_printer_name)(void *agent, std::string dev_id, std::string dev_name);
@ -76,6 +77,10 @@ typedef int (*func_get_profile_3mf)(void *agent, BBLProfile* profile);
typedef int (*func_get_model_publish_url)(void *agent, std::string* url);
typedef int (*func_get_model_mall_home_url)(void *agent, std::string* url);
typedef int (*func_get_my_profile)(void *agent, std::string token, unsigned int *http_code, std::string *http_body);
typedef int (*func_track_enable)(void *agent, bool enable);
typedef int (*func_track_event)(void *agent, std::string evt_key, std::string content);
typedef int (*func_track_header)(void *agent, std::string header);
typedef int (*func_track_update_property)(void *agent, std::string name, std::string value, std::string type);
//the NetworkAgent class
@ -129,7 +134,7 @@ public:
std::string build_login_cmd();
std::string build_logout_cmd();
std::string build_login_info();
int bind(std::string dev_ip, std::string timezone, OnUpdateStatusFn update_fn);
int bind(std::string dev_ip, std::string dev_id, std::string sec_link, std::string timezone, OnUpdateStatusFn update_fn);
int unbind(std::string dev_id);
std::string get_bambulab_host();
std::string get_user_selected_machine();
@ -151,6 +156,7 @@ public:
int get_printer_firmware(std::string dev_id, unsigned* http_code, std::string* http_body);
int get_task_plate_index(std::string task_id, int* plate_index);
int get_user_info(int* identifier);
int request_bind_ticket(std::string* ticket);
int get_slice_info(std::string project_id, std::string profile_id, int plate_index, std::string* slice_json);
int query_bind_status(std::vector<std::string> query_list, unsigned int* http_code, std::string* http_body);
int modify_printer_name(std::string dev_id, std::string dev_name);
@ -160,9 +166,12 @@ public:
int get_model_publish_url(std::string* url);
int get_model_mall_home_url(std::string* url);
int get_my_profile(std::string token, unsigned int* http_code, std::string* http_body);
int track_enable(bool enable);
int track_event(std::string evt_key, std::string content);
int track_header(std::string header);
int track_update_property(std::string name, std::string value, std::string type = "string");
private:
bool enable_track = false;
void* network_agent { nullptr };
static func_check_debug_consistent check_debug_consistent_ptr;
@ -225,6 +234,7 @@ private:
static func_get_printer_firmware get_printer_firmware_ptr;
static func_get_task_plate_index get_task_plate_index_ptr;
static func_get_user_info get_user_info_ptr;
static func_request_bind_ticket request_bind_ticket_ptr;
static func_get_slice_info get_slice_info_ptr;
static func_query_bind_status query_bind_status_ptr;
static func_modify_printer_name modify_printer_name_ptr;
@ -234,6 +244,10 @@ private:
static func_get_model_publish_url get_model_publish_url_ptr;
static func_get_model_mall_home_url get_model_mall_home_url_ptr;
static func_get_my_profile get_my_profile_ptr;
static func_track_enable track_enable_ptr;
static func_track_event track_event_ptr;
static func_track_header track_header_ptr;
static func_track_update_property track_update_property_ptr;
};
}

View file

@ -881,8 +881,79 @@ void PresetUpdater::priv::sync_plugins(std::string http_url, std::string plugin_
std::string cached_version;
get_cached_plugins_version(cached_version);
if (!cached_version.empty())
plugin_version = cached_version;
if (!cached_version.empty()) {
bool need_delete_cache = false;
Semver current_semver = curr_version;
Semver cached_semver = cached_version;
int curent_patch_cc = current_semver.patch()/100;
int cached_patch_cc = cached_semver.patch()/100;
int curent_patch_dd = current_semver.patch()%100;
int cached_patch_dd = cached_semver.patch()%100;
if ((cached_semver.maj() != current_semver.maj())
|| (cached_semver.min() != current_semver.min())
|| (curent_patch_cc != cached_patch_cc))
{
need_delete_cache = true;
BOOST_LOG_TRIVIAL(info) << boost::format("cached plugins version %1% not match with current %2%")%cached_version%curr_version;
}
else if (cached_patch_dd <= curent_patch_dd) {
need_delete_cache = true;
BOOST_LOG_TRIVIAL(info) << boost::format("cached plugins version %1% not newer than current %2%")%cached_version%curr_version;
}
else {
plugin_version = cached_version;
}
if (need_delete_cache) {
std::string data_dir_str = data_dir();
boost::filesystem::path data_dir_path(data_dir_str);
auto cache_folder = data_dir_path / "ota";
#if defined(_MSC_VER) || defined(_WIN32)
auto network_library = cache_folder / "bambu_networking.dll";
auto player_library = cache_folder / "BambuSource.dll";
#elif defined(__WXMAC__)
auto network_library = cache_folder / "libbambu_networking.dylib";
auto player_library = cache_folder / "libBambuSource.dylib";
#else
auto network_library = cache_folder / "libbambu_networking.so";
auto player_library = cache_folder / "libBambuSource.so";
#endif
auto changelog_file = cache_folder / "network_plugins.json";
if (boost::filesystem::exists(network_library))
{
BOOST_LOG_TRIVIAL(info) << "[remove_old_networking_plugins] remove the file "<<network_library.string();
try {
fs::remove(network_library);
} catch (...) {
BOOST_LOG_TRIVIAL(error) << "Failed removing the plugins file " << network_library.string();
}
}
if (boost::filesystem::exists(player_library))
{
BOOST_LOG_TRIVIAL(info) << "[remove_old_networking_plugins] remove the file "<<player_library.string();
try {
fs::remove(player_library);
} catch (...) {
BOOST_LOG_TRIVIAL(error) << "Failed removing the plugins file " << player_library.string();
}
}
if (boost::filesystem::exists(changelog_file))
{
BOOST_LOG_TRIVIAL(info) << "[remove_old_networking_plugins] remove the file "<<changelog_file.string();
try {
fs::remove(changelog_file);
} catch (...) {
BOOST_LOG_TRIVIAL(error) << "Failed removing the plugins file " << changelog_file.string();
}
}
}
}
try {
std::map<std::string, Resource> resources
@ -1173,7 +1244,7 @@ void PresetUpdater::sync(std::string http_url, std::string language, std::string
// Copy the whole vendors data for use in the background thread
// Unfortunatelly as of C++11, it needs to be copied again
// into the closure (but perhaps the compiler can elide this).
VendorMap vendors = preset_bundle->vendors;
VendorMap vendors = preset_bundle ? preset_bundle->vendors : VendorMap{};
p->thread = std::thread([this, vendors, http_url, language, plugin_version]() {
this->p->prune_tmps();
@ -1182,7 +1253,8 @@ void PresetUpdater::sync(std::string http_url, std::string language, std::string
this->p->sync_version();
if (p->cancel)
return;
this->p->sync_config(http_url, std::move(vendors));
if (!vendors.empty())
this->p->sync_config(http_url, std::move(vendors));
if (p->cancel)
return;
this->p->sync_plugins(http_url, plugin_version);

View file

@ -41,7 +41,8 @@ namespace BBL {
#define BAMBU_NETWORK_LIBRARY "bambu_networking"
#define BAMBU_NETWORK_AGENT_NAME "bambu_network_agent"
#define BAMBU_NETWORK_AGENT_VERSION "01.05.00.08"
#define BAMBU_NETWORK_AGENT_VERSION "01.06.00.01"
//iot preset type strings
#define IOT_PRINTER_TYPE_STRING "printer"
@ -143,6 +144,8 @@ struct PrintParams {
bool task_layer_inspect; /* first layer inspection of task */
bool task_record_timelapse; /* record timelapse of task */
bool task_use_ams;
std::string task_bed_type;
std::string extra_options;
};
struct PublishParams {