Skip to content

Commit

Permalink
Merge pull request #39 from jcassel/PrintHeadAbsoluteJog
Browse files Browse the repository at this point in the history
Print head absolute jog
  • Loading branch information
chunkysteveo authored Dec 29, 2022
2 parents 7336d98 + ed704fd commit 386b578
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
11 changes: 10 additions & 1 deletion OctoPrintAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,14 @@ bool OctoprintApi::octoPrintPrintHeadHome() {
return (httpStatusCode == 204);
}

bool OctoprintApi::octoPrintPrintHeadAbsoluteJog(double x, double y, double z, double f) {
return octoPrintPrintHeadJog(x,y,z,f,true);
}
bool OctoprintApi::octoPrintPrintHeadRelativeJog(double x, double y, double z, double f) {
return octoPrintPrintHeadJog(x,y,z,f,false);
}

bool OctoprintApi::octoPrintPrintHeadJog(double x, double y, double z, double f,bool absolute) {
// {
// "command": "jog",
// "x": 10,
Expand Down Expand Up @@ -449,7 +456,9 @@ bool OctoprintApi::octoPrintPrintHeadRelativeJog(double x, double y, double z, d
snprintf(tmp, 128, ", \"speed\": %f", f);
strcat(postData, tmp);
}
strcat(postData, ", \"absolute\": false");
if(absolute){strcat(postData, ", \"absolute\": true");}
else{strcat(postData, ", \"absolute\": false");}

strcat(postData, " }");
if (_debug)
Serial.println(postData);
Expand Down
2 changes: 2 additions & 0 deletions OctoPrintAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ class OctoprintApi {
bool octoPrintConnectionFakeAck();
bool octoPrintPrintHeadHome();
bool octoPrintPrintHeadRelativeJog(double x, double y, double z, double f);
bool octoPrintPrintHeadAbsoluteJog(double x, double y, double z, double f);
bool octoPrintPrintHeadJog(double x, double y, double z, double f,bool absolute);
bool octoPrintExtrude(double amount);
bool octoPrintSetBedTemperature(uint16_t t);
bool octoPrintSetTool0Temperature(uint16_t t);
Expand Down
10 changes: 10 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ octoPrintConnectionDisconnect KEYWORD2
octoPrintConnectionAutoConnect KEYWORD2
octoPrintConnectionFakeAck KEYWORD2
octoPrintPrintHeadHome KEYWORD2
octoPrintPrintHeadRelativeJog KEYWORD2
octoPrintPrintHeadAbsoluteJog KEYWORD2
octoPrintPrintHeadJog KEYWORD2
octoPrintExtrude KEYWORD2
octoPrintSetBedTemperature KEYWORD2
octoPrintSetTool0Temperature KEYWORD2
octoPrintSetTool1Temperature KEYWORD2
octoPrintGetPrinterSD KEYWORD2
octoPrintPrinterSDInit KEYWORD2
octoPrintPrinterSDRefresh KEYWORD2
Expand All @@ -35,6 +42,9 @@ octoPrintPrinterCommand KEYWORD2
octoPrintJobPause KEYWORD2
octoPrintJobResume KEYWORD2
octoPrintFileSelect KEYWORD2
octoPrintCoreShutdown KEYWORD2
octoPrintCoreReboot KEYWORD2
octoPrintCoreRestart KEYWORD2
init KEYWORD2

#######################################
Expand Down

0 comments on commit 386b578

Please sign in to comment.