FIX:View gcode file without displaying unnecessary logos

jira: none
Change-Id: Icb0b1d2dbdc86e95ea21a44e9d878fff3039867a
This commit is contained in:
zhou.xu 2024-12-10 12:26:20 +08:00 committed by lane.wei
parent 8bf65c0963
commit a8d25d48f7
1 changed files with 18 additions and 16 deletions

View File

@ -506,6 +506,7 @@ void PartPlate::render_logo_texture(GLTexture &logo_texture, GLModel &logo_buffe
void PartPlate::render_logo(bool bottom, bool render_cali) void PartPlate::render_logo(bool bottom, bool render_cali)
{ {
// render printer custom texture logo // render printer custom texture logo
auto real_gcode = wxGetApp().plater()->only_gcode_mode();
if (m_partplate_list->m_logo_texture_filename.empty()) { if (m_partplate_list->m_logo_texture_filename.empty()) {
m_partplate_list->m_logo_texture.reset(); m_partplate_list->m_logo_texture.reset();
} else { } else {
@ -556,7 +557,7 @@ void PartPlate::render_logo(bool bottom, bool render_cali)
set_logo_box_by_bed(box_in_plate_origin); set_logo_box_by_bed(box_in_plate_origin);
} }
} }
if (m_logo_triangles.is_initialized()) { if (m_logo_triangles.is_initialized() && !real_gcode) {
render_logo_texture(m_partplate_list->m_logo_texture, m_logo_triangles, bottom); render_logo_texture(m_partplate_list->m_logo_texture, m_logo_triangles, bottom);
} }
if (!m_partplate_list->render_bedtype_logo) { if (!m_partplate_list->render_bedtype_logo) {
@ -580,6 +581,7 @@ void PartPlate::render_logo(bool bottom, bool render_cali)
bed_type_idx = 0; bed_type_idx = 0;
} }
// render bed textures // render bed textures
if (!real_gcode) {
for (auto &part : m_partplate_list->bed_texture_info[bed_type_idx].parts) { for (auto &part : m_partplate_list->bed_texture_info[bed_type_idx].parts) {
if (part.texture) { if (part.texture) {
if (part.buffer && part.buffer->is_initialized() if (part.buffer && part.buffer->is_initialized()
@ -587,14 +589,14 @@ void PartPlate::render_logo(bool bottom, bool render_cali)
) { ) {
if (part.offset.x() != m_origin.x() || part.offset.y() != m_origin.y()) { if (part.offset.x() != m_origin.x() || part.offset.y() != m_origin.y()) {
part.offset = Vec2d(m_origin.x(), m_origin.y()); part.offset = Vec2d(m_origin.x(), m_origin.y());
//part.update_buffer(); // part.update_buffer();
} }
render_logo_texture(*(part.texture), render_logo_texture(*(part.texture), *(part.buffer), bottom);
*(part.buffer),
bottom);
} }
} }
} }
}
// render cali texture // render cali texture
if (render_cali) { if (render_cali) {
@ -616,7 +618,7 @@ void PartPlate::render_logo(bool bottom, bool render_cali)
//render extruder_only_area_info //render extruder_only_area_info
bool is_zh = wxGetApp().app_config->get("language") == "zh_CN"; bool is_zh = wxGetApp().app_config->get("language") == "zh_CN";
int language_idx = (int) (is_zh ? ExtruderOnlyAreaType::Chinese:ExtruderOnlyAreaType::Engilish); int language_idx = (int) (is_zh ? ExtruderOnlyAreaType::Chinese:ExtruderOnlyAreaType::Engilish);
if (!is_single_extruder) { if (!is_single_extruder && !real_gcode) {
for (auto &part : m_partplate_list->extruder_only_area_info[language_idx].parts) { for (auto &part : m_partplate_list->extruder_only_area_info[language_idx].parts) {
if (part.texture) { if (part.texture) {
if (part.buffer && part.buffer->is_initialized()) { if (part.buffer && part.buffer->is_initialized()) {