FIX: fix build error

jira: none
Change-Id: I97df69b728fc3871b7c33e1fd3ba068e741d51c7
(cherry picked from commit 326d7d28b47017bdbd98873a6437ef84116291ba)
This commit is contained in:
zhimin.zeng
2024-07-09 15:41:39 +08:00
committed by Noisyfox
parent 48f1d74127
commit 2ff3b46a7e
13 changed files with 22 additions and 21 deletions

View File

@@ -30,7 +30,6 @@ namespace Slic3r {
{
double value;
bool percent;
private:
friend class cereal::access;
template<class Archive> void serialize(Archive& ar) { ar(this->value); ar(this->percent); }

View File

@@ -216,6 +216,7 @@ ToolOrdering::ToolOrdering(const PrintObject &object, unsigned int first_extrude
m_is_BBL_printer = object.print()->is_BBL_printer();
m_print_full_config = &object.print()->full_print_config();
m_print_object_ptr = &object;
m_print = const_cast<Print*>(object.print());
if (object.layers().empty())
return;
@@ -260,6 +261,7 @@ ToolOrdering::ToolOrdering(const Print &print, unsigned int first_extruder, bool
{
m_is_BBL_printer = print.is_BBL_printer();
m_print_full_config = &print.full_print_config();
m_print = const_cast<Print *>(&print); // for update the context of print
m_print_config_ptr = &print.config();
// Initialize the print layers for all objects and all layers.

View File

@@ -217,6 +217,7 @@ private:
const DynamicPrintConfig* m_print_full_config = nullptr;
const PrintConfig* m_print_config_ptr = nullptr;
const PrintObject* m_print_object_ptr = nullptr;
Print* m_print;
bool m_is_BBL_printer = false;
};

View File

@@ -1570,13 +1570,12 @@ namespace client
expr::random(param1, param2, ctx->context_data->rng);
}
static void filament_change(const MyContext* ctx, expr<Iterator>& param)
static void filament_change(const MyContext* ctx, expr& param)
{
MyContext *context = const_cast<MyContext *>(ctx);
context->current_extruder_id = param.as_i();
}
template <typename Iterator>
static void throw_exception(const std::string &msg, const IteratorRange &it_range)
{
// An asterix is added to the start of the string to differentiate the boost::spirit::info::tag content
@@ -2170,7 +2169,7 @@ namespace client
[ px::bind(&expr::max, _val, _2) ]
| (kw["random"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > ')')
[ px::bind(&MyContext::random, _r1, _val, _2) ]
| (kw["filament_change"] > '(' > conditional_expression(_r1) > ')') [ px::bind(&MyContext::filament_change<Iterator>, _r1, _1) ]
| (kw["filament_change"] > '(' > conditional_expression(_r1) > ')') [ px::bind(&MyContext::filament_change, _r1, _1) ]
| (kw["digits"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > optional_parameter(_r1))
[ px::bind(&expr::digits<false>, _val, _2, _3) ]
| (kw["zdigits"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > optional_parameter(_r1))

View File

@@ -2738,7 +2738,7 @@ inline t_config_option_keys deep_diff(const ConfigBase &config_this, const Confi
case coFloats: add_correct_opts_to_diff<ConfigOptionFloats >(opt_key, diff, config_other, config_this, strict); break;
case coStrings: add_correct_opts_to_diff<ConfigOptionStrings >(opt_key, diff, config_other, config_this, strict); break;
case coPercents:add_correct_opts_to_diff<ConfigOptionPercents >(opt_key, diff, config_other, config_this, strict); break;
case coFloatsOrPercents: add_correct_opts_to_diff<ConfigOptionFloatsOrPercents>(opt_key, diff, config_other, config_this); break;
case coFloatsOrPercents: add_correct_opts_to_diff<ConfigOptionFloatsOrPercents>(opt_key, diff, config_other, config_this, strict); break;
case coPoints: add_correct_opts_to_diff<ConfigOptionPoints >(opt_key, diff, config_other, config_this, strict); break;
// BBS
case coEnums: add_correct_opts_to_diff<ConfigOptionInts>(opt_key, diff, config_other, config_this, strict); break;

View File

@@ -2796,7 +2796,7 @@ void Print::_make_wipe_tower()
unsigned int pre_filament_id = nozzle_cur_filament_ids[nozzle_id];
float volume_to_purge = 0;
if (pre_filament_id != unsigned int(-1) && pre_filament_id != filament_id) {
if (pre_filament_id != (unsigned int)(-1) && pre_filament_id != filament_id) {
volume_to_purge = multi_extruder_flush[nozzle_id][pre_filament_id][filament_id];
volume_to_purge *= m_config.flush_multiplier.get_at(nozzle_id);
volume_to_purge = pre_filament_id == -1 ? 0 :

View File

@@ -228,9 +228,10 @@ void BackgroundSlicingProcess::process_fff()
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" %1%: gcode_result reseted, will start print::process")%__LINE__;
m_print->process();
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" %1%: after print::process, send slicing complete event to gui...")%__LINE__;
if (m_current_plate->get_filament_map_mode() == FilamentMapMode::fmmAuto)
m_current_plate->set_filament_maps(m_fff_print->get_filament_maps());
if (m_current_plate->get_filament_map_mode() == FilamentMapMode::fmmAuto) {
std::vector<int> f_maps = m_fff_print->get_filament_maps();
m_current_plate->set_filament_maps(f_maps);
}
wxCommandEvent evt(m_event_slicing_completed_id);
// Post the Slicing Finished message for the G-code viewer to update.
// Passing the timestamp

View File

@@ -887,7 +887,7 @@ int MachineObject::ams_filament_mapping(std::vector<FilamentInfo> filaments, std
// tray_index : tray_color
std::map<int, FilamentInfo> tray_filaments;
for (auto ams = amsList.begin(); ams != amsList.end(); ams++) {
std::string ams_id = ams->second->id;
@@ -949,7 +949,7 @@ int MachineObject::ams_filament_mapping(std::vector<FilamentInfo> filaments, std
info.slot_id = std::to_string(0);
tray_filaments.emplace(std::make_pair(info.tray_id, info));
}
}
if (ext_second)
{

View File

@@ -959,7 +959,7 @@ void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& pr
m_last_result_id = gcode_result.id;
m_gcode_result = &gcode_result;
m_only_gcode_in_preview = only_gcode;
m_sequential_view.gcode_window.load_gcode(gcode_result.filename, gcode_result.lines_ends);
//BBS: add only gcode mode
@@ -4377,7 +4377,7 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding)
{
ImGuiWrapper &imgui = *wxGetApp().imgui();
auto link_text = [&](std::string &label) {
auto link_text = [&](const std::string &label) {
ImVec2 wiki_part_size = ImGui::CalcTextSize(label.c_str());
ImColor HyperColor = ImColor(48, 221, 114, 255).Value;
@@ -5269,7 +5269,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
columns_offsets.push_back({ buf, color_print_offsets[_u8L("Tower")] });
}
if ((displayed_columns & ~ColumnData::Model) > 0) {
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", total_model_used_filament_m + total_support_used_filament_m + total_flushed_filament_m + total_wipe_tower_used_filament_m,
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", total_model_used_filament_m + total_support_used_filament_m + total_flushed_filament_m + total_wipe_tower_used_filament_m,
(total_model_used_filament_g + total_support_used_filament_g + total_flushed_filament_g + total_wipe_tower_used_filament_g) / unit_conver);
columns_offsets.push_back({ buf, color_print_offsets[_u8L("Total")] });
}

View File

@@ -3191,7 +3191,7 @@ std::vector<int> PartPlate::get_filament_maps()
return filament_maps;
}
void PartPlate::set_filament_maps(std::vector<int>& f_maps)
void PartPlate::set_filament_maps(const std::vector<int>& f_maps)
{
std::vector<int>& filament_maps = m_config.option<ConfigOptionInts>("filament_map", true)->values;

View File

@@ -485,7 +485,7 @@ public:
void set_filament_map_mode(FilamentMapMode& mode);
std::vector<int> get_filament_maps();
void set_filament_maps(std::vector<int>& f_maps);
void set_filament_maps(const std::vector<int>& f_maps);
void set_filament_count(int filament_count);
void on_filament_added();

View File

@@ -1620,8 +1620,6 @@ void Sidebar::msw_rescale()
//BBS
p->m_bed_type_list->Rescale();
p->m_bed_type_list->SetMinSize({-1, 3 * wxGetApp().em_unit()});
p->m_left_extruder_list->Rescale();
p->m_right_extruder_list->Rescale();
#if 0
if (p->mode_sizer)
p->mode_sizer->msw_rescale();
@@ -13367,7 +13365,7 @@ void Plater::on_filaments_delete(size_t num_filaments, size_t filament_id)
sidebar().obj_list()->update_objects_list_filament_column_when_delete_filament(filament_id, num_filaments);
// update customize gcode
for (auto& item = p->model.plates_custom_gcodes.begin(); item != p->model.plates_custom_gcodes.end(); ++item) {
for (auto item = p->model.plates_custom_gcodes.begin(); item != p->model.plates_custom_gcodes.end(); ++item) {
auto iter = std::remove_if(item->second.gcodes.begin(), item->second.gcodes.end(), [filament_id](const Item& gcode_item) {
return (gcode_item.type == CustomGCode::Type::ToolChange && gcode_item.extruder == filament_id + 1);
});

View File

@@ -611,6 +611,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
sizer_print_failed_info->Add(0, 0, 0, wxTOP, FromDIP(3));
sizer_print_failed_info->Add(sizer_extra_info, 0, wxLEFT, 5);
m_sizer_main->Add(m_line_top, 0, wxEXPAND, 0);
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(12));
@@ -1208,7 +1209,7 @@ bool SelectMachineDialog::get_ams_mapping_result(std::string &mapping_array_str,
mapping_item["filamentId"] = "";
mapping_item["filamentType"] = "";
for (int k = 0; k < m_ams_mapping_result.size(); k++) {
if (m_ams_mapping_result[k].id == i) {
@@ -3406,7 +3407,7 @@ void SelectMachineDialog::reset_and_sync_ams_list()
MaterialItem* item = nullptr;
if (use_double_extruder)
{
if (m_filaments_map[extruder] == 1)
{
item = new MaterialItem(m_filament_left_panel, colour_rgb, _L(display_materials[extruder]));