MCPcopy Create free account
hub / github.com/Schildkroet/Candle2 / updateCenterWithCommand

Method updateCenterWithCommand

src/parser/gcodepreprocessorutils.cpp:204–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204QVector3D GcodePreprocessorUtils::updateCenterWithCommand(QStringList commandArgs, QVector3D initial, QVector3D nextPoint, bool absoluteIJKMode, bool clockwise)
205{
206 double i = qQNaN();
207 double j = qQNaN();
208 double k = qQNaN();
209 double r = qQNaN();
210 char c;
211
212 foreach (QString t, commandArgs)
213 {
214 if (t.length() > 0) {
215 c = t[0].toUpper().toLatin1();
216 switch (c) {
217 case 'I':
218 i = t.mid(1).toDouble();
219 break;
220 case 'J':
221 j = t.mid(1).toDouble();
222 break;
223 case 'K':
224 k = t.mid(1).toDouble();
225 break;
226 case 'R':
227 r = t.mid(1).toDouble();
228 break;
229 }
230 }
231 }
232
233 if (qIsNaN(i) && qIsNaN(j) && qIsNaN(k)) {
234 return convertRToCenter(initial, nextPoint, r, absoluteIJKMode, clockwise);
235 }
236
237 return updatePointWithCommand(initial, i, j, k, absoluteIJKMode);
238}
239
240QString GcodePreprocessorUtils::generateG1FromPoints(QVector3D start, QVector3D end, bool absoluteMode, int precision)
241{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected