| 225 | |
| 226 | |
| 227 | PointSegment *GcodeParser::processCommand(const QStringList &args) |
| 228 | { |
| 229 | QList<float> gCodes; |
| 230 | PointSegment *ps = NULL; |
| 231 | |
| 232 | // Handle F code |
| 233 | double speed = GcodePreprocessorUtils::parseCoord(args, 'F'); |
| 234 | if (!qIsNaN(speed)) this->m_lastSpeed = this->m_isMetric ? speed : speed * 25.4; |
| 235 | |
| 236 | // Handle S code |
| 237 | double spindleSpeed = GcodePreprocessorUtils::parseCoord(args, 'S'); |
| 238 | if (!qIsNaN(spindleSpeed)) this->m_lastSpindleSpeed = spindleSpeed; |
| 239 | |
| 240 | // Handle P code |
| 241 | double dwell = GcodePreprocessorUtils::parseCoord(args, 'P'); |
| 242 | if (!qIsNaN(dwell)) this->m_points.last()->setDwell(dwell); |
| 243 | |
| 244 | // handle G codes. |
| 245 | gCodes = GcodePreprocessorUtils::parseCodes(args, 'G'); |
| 246 | |
| 247 | // If there was no command, add the implicit one to the party. |
| 248 | if (gCodes.isEmpty() && m_lastGcodeCommand != -1) { |
| 249 | gCodes.append(m_lastGcodeCommand); |
| 250 | } |
| 251 | |
| 252 | foreach (float code, gCodes) { |
| 253 | ps = handleGCode(code, args); |
| 254 | } |
| 255 | |
| 256 | return ps; |
| 257 | } |
| 258 | |
| 259 | PointSegment *GcodeParser::addLinearPointSegment(const QVector3D &nextPoint, bool fastTraverse) |
| 260 | { |