FIX: false alarms due to wrong print z of gcode paths

The print z was wrong previously when there is a wipe tower, or there
is an object with floating parts.

Jira: STUDIO-2719
udesk: 2258732

Change-Id: Ifa070aeb548d692549cf88df0d405ecdf0160c80
(cherry picked from commit be3097d8044ce9e0079ebf7070b15c7aad7aff0e)
This commit is contained in:
manch1n 2023-04-18 16:54:36 +08:00 committed by Lane.Wei
parent b849a82725
commit ec7306e3cb
4 changed files with 136 additions and 92 deletions

View file

@ -490,7 +490,7 @@ class GCodeViewer
std::vector<Endpoints>& get_endpoints() { return m_endpoints; }
double get_z_at(unsigned int id) const { return (id < m_zs.size()) ? m_zs[id] : 0.0; }
Endpoints get_endpoints_at(unsigned int id) const { return (id < m_endpoints.size()) ? m_endpoints[id] : Endpoints(); }
int get_l_at(double z) const
int get_l_at(float z) const
{
auto iter = std::upper_bound(m_zs.begin(), m_zs.end(), z);
return std::distance(m_zs.begin(), iter);