void GCodePlanner::forceNewPathStart() { paths.push_back(GCodePath()); GCodePath* ret = &paths[paths.size()-1]; ret->retract = false; ret->config = &travelConfig; ret->extruder = currentExtruder; }
GCodePath* GCodePlanner::getLatestPathWithConfig(GCodePathConfig* config) { if (paths.size() > 0 && paths[paths.size()-1].config == config) return &paths[paths.size()-1]; paths.push_back(GCodePath()); GCodePath* ret = &paths[paths.size()-1]; ret->retract = false; ret->config = config; ret->extruder = currentExtruder; return ret; }
GCodePath* GCodePlanner::getLatestPathWithConfig(GCodePathConfig* config, float flow) { if (paths.size() > 0 && paths[paths.size()-1].config == config && !paths[paths.size()-1].done && paths[paths.size()-1].flow == flow) return &paths[paths.size()-1]; paths.push_back(GCodePath()); GCodePath* ret = &paths[paths.size()-1]; ret->retract = false; ret->config = config; ret->extruder = currentExtruder; ret->done = false; ret->flow = flow; if (config != &travelConfig) { last_retraction_config = config->retraction_config; } return ret; }