feature to set feedrate

This commit is contained in:
2019-07-30 21:56:09 +03:00
parent f1c26251f6
commit de36bbbd4b
5 changed files with 29 additions and 15 deletions

View File

@@ -4,7 +4,10 @@
#include "ConfigManager.h"
const std::unordered_map<std::string, std::string> defaults{
{{"wifiMode", "ap"}, {"wifiSSID", defSSID}, {"wifiPass", defPass}}};
{{"wifiMode", "ap"},
{"wifiSSID", defSSID},
{"wifiPass", defPass},
{"defRpm", "2"}}};
/*
Max string length is 25

View File

@@ -1,6 +1,7 @@
#include <Arduino.h>
#include <unordered_map>
#include "ConfigManager.h"
#include "GCodeParser.h"
Command bufcmd;
@@ -56,9 +57,10 @@ Command parseGCode(std::string gcode) {
auto xIter = argsMap.find('X');
auto yIter = argsMap.find('Y');
auto zIter = argsMap.find('Z');
auto fIter = argsMap.find('F');
auto endIter = argsMap.end();
if(xIter != endIter) {
if (xIter != endIter) {
bufcmd.arg1 = xIter->second;
}
if (yIter != endIter) {
@@ -67,6 +69,11 @@ Command parseGCode(std::string gcode) {
if (zIter != endIter) {
bufcmd.arg3 = zIter->second;
}
if (fIter != endIter) {
bufcmd.arg4 = fIter->second;
} else {
bufcmd.arg4 = atof(configManager.get("defRpm").c_str());
}
if (strcmp(command, "G00") == 0) {
bufcmd.type = CommandType::G00;