Update the codes to 01.01.00.10 for the formal release

1. first formal version of macos
2. add the bambu networking plugin install logic
3. auto compute the wipe volume when filament change
4. add the logic of wiping into support
5. refine the GUI layout and icons, improve the gui apperance in lots of
   small places
6. serveral improve to support
7. support AMS auto-mapping
8. disable lots of unstable features: such as params table, media file download, HMS
9. fix serveral kinds of bugs
10. update the document of building
11. ...
This commit is contained in:
lane.wei 2022-07-22 17:46:10 +08:00 committed by Lane.Wei
parent e1528e4299
commit e9e4d75877
267 changed files with 10326 additions and 32228 deletions

View file

@ -1017,6 +1017,15 @@ void PartPlate::release_opengl_resource()
std::vector<int> PartPlate::get_extruders() const
{
std::vector<int> plate_extruders;
// if gcode.3mf file
if (m_model->objects.empty()) {
for (int i = 0; i < slice_filaments_info.size(); i++) {
plate_extruders.push_back(slice_filaments_info[i].id + 1);
}
return plate_extruders;
}
// if 3mf file
const DynamicPrintConfig& glb_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
int glb_support_intf_extr = glb_config.opt_int("support_interface_filament");
int glb_support_extr = glb_config.opt_int("support_filament");
@ -1626,6 +1635,33 @@ void PartPlate::move_instances_to(PartPlate& left_plate, PartPlate& right_plate,
return;
}
//can add timelapse object
bool PartPlate::can_add_timelapse_object()
{
bool result = true;
if (obj_to_instance_set.size() == 0)
return false;
for (std::set<std::pair<int, int>>::iterator it = obj_to_instance_set.begin(); it != obj_to_instance_set.end(); ++it)
{
int obj_id = it->first;
if (obj_id >= m_model->objects.size())
continue;
ModelObject* object = m_model->objects[obj_id];
if (object->is_timelapse_wipe_tower)
{
result = false;
break;
}
}
return result;
}
void PartPlate::generate_logo_polygon(ExPolygon &logo_polygon)
{
if (m_shape.size() == 4)
@ -2109,9 +2145,9 @@ int PartPlate::load_pattern_thumbnail_data(std::string filename)
if (result) {
cali_thumbnail_data.set(img.GetWidth(), img.GetHeight());
for (int i = 0; i < img.GetWidth() * img.GetHeight(); i++) {
memcpy(&thumbnail_data.pixels[4 * i], (unsigned char*)(img.GetData() + 3 * i), 3);
memcpy(&cali_thumbnail_data.pixels[4 * i], (unsigned char*)(img.GetData() + 3 * i), 3);
if (img.HasAlpha()) {
thumbnail_data.pixels[4 * i + 3] = *(unsigned char*)(img.GetAlpha() + i);
cali_thumbnail_data.pixels[4 * i + 3] = *(unsigned char*)(img.GetAlpha() + i);
}
}
}
@ -2121,6 +2157,24 @@ int PartPlate::load_pattern_thumbnail_data(std::string filename)
return 0;
}
//load pattern box data from file
int PartPlate::load_pattern_box_data(std::string filename)
{
try {
nlohmann::json j;
boost::nowide::ifstream ifs(filename);
ifs >> j;
PlateBBoxData bbox_data;
bbox_data.from_json(j);
cali_bboxes_data = bbox_data;
return 0;
}
catch(std::exception &ex) {
BOOST_LOG_TRIVIAL(trace) << boost::format("catch an exception %1%")%ex.what();
return -1;
}
}
void PartPlate::print() const
{
@ -4009,6 +4063,11 @@ int PartPlateList::store_to_3mf_structure(PlateDataPtrs& plate_data_list, bool w
if (m_plate_list[i]->get_slice_result() && m_plate_list[i]->is_slice_result_valid()) {
// BBS only include current palte_idx
if (plate_idx == i || plate_idx == -1) {
//load calibration thumbnail
if (m_plate_list[i]->cali_thumbnail_data.is_valid())
plate_data_item->pattern_file = "valid_pattern";
if (m_plate_list[i]->cali_bboxes_data.is_valid())
plate_data_item->pattern_bbox_file = "valid_pattern_bbox";
plate_data_item->gcode_file = m_plate_list[i]->m_gcode_result->filename;
plate_data_item->is_sliced_valid = true;
plate_data_item->gcode_prediction = std::to_string(
@ -4018,7 +4077,10 @@ int PartPlateList::store_to_3mf_structure(PlateDataPtrs& plate_data_list, bool w
m_plate_list[i]->get_print((PrintBase **) &print, nullptr, nullptr);
if (print) {
const PrintStatistics &ps = print->print_statistics();
if (ps.total_weight != 0.0) { plate_data_item->gcode_weight = wxString::Format("%.2f", ps.total_weight).ToStdString(); }
if (ps.total_weight != 0.0) {
CNumericLocalesSetter locales_setter;
plate_data_item->gcode_weight =wxString::Format("%.2f", ps.total_weight).ToStdString();
}
} else {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format("print is null!");
}
@ -4072,21 +4134,29 @@ int PartPlateList::load_from_3mf_structure(PlateDataPtrs& plate_data_list)
gcode_result->print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Normal)].time = atoi(plate_data_list[i]->gcode_prediction.c_str());
ps.total_weight = atof(plate_data_list[i]->gcode_weight.c_str());
ps.total_used_filament = 0.f;
for (auto filament_item: plate_data_list[i]->slice_flaments_info)
for (auto filament_item: plate_data_list[i]->slice_filaments_info)
{
ps.total_used_filament += filament_item.used_m;
}
ps.total_used_filament *= 1000; //koef
gcode_result->toolpath_outside = plate_data_list[i]->toolpath_outside;
m_plate_list[index]->slice_filaments_info = plate_data_list[i]->slice_filaments_info;
if (!plate_data_list[i]->thumbnail_file.empty()) {
if (boost::filesystem::exists(plate_data_list[i]->thumbnail_file)) {
m_plate_list[index]->load_thumbnail_data(plate_data_list[i]->thumbnail_file);
}
}
if (!plate_data_list[i]->pattern_file.empty()) {
if (boost::filesystem::exists(plate_data_list[i]->pattern_file)) {
m_plate_list[index]->load_pattern_thumbnail_data(plate_data_list[i]->pattern_file);
//no need to load pattern data currently
//m_plate_list[index]->load_pattern_thumbnail_data(plate_data_list[i]->pattern_file);
}
}
if (!plate_data_list[i]->pattern_bbox_file.empty()) {
if (boost::filesystem::exists(plate_data_list[i]->pattern_bbox_file)) {
m_plate_list[index]->load_pattern_box_data(plate_data_list[i]->pattern_bbox_file);
}
}