debugging parameter management
parent
501a08a78a
commit
ee465d0244
|
@ -100,25 +100,30 @@ void Command::getParameter(char* charPointer) {
|
|||
axisSpeedValue[2] = atof(charPointer + 1);
|
||||
|
||||
} else if (charPointer[0] == speedCode) {
|
||||
speedValue = atof(charPointer + 1);
|
||||
speedValue = atof(charPointer + 1);
|
||||
} else if (charPointer[0] == parameterIdCode) {
|
||||
speedValue = atof(charPointer + 1);
|
||||
parameterId = atof(charPointer + 1);
|
||||
} else if (charPointer[0] == parameterValueCode) {
|
||||
speedValue = atof(charPointer + 1);
|
||||
parameterValue = atof(charPointer + 1);
|
||||
}
|
||||
}
|
||||
|
||||
void Command::print() {
|
||||
Serial.print("R99 Command with code:G");
|
||||
Serial.print("R99 Command with code: ");
|
||||
Serial.print(commandCodeEnum);
|
||||
Serial.print(", X:");
|
||||
Serial.print(", X: ");
|
||||
Serial.print(axisValue[0]);
|
||||
Serial.print(", Y:");
|
||||
Serial.print(", Y: ");
|
||||
Serial.print(axisValue[1]);
|
||||
Serial.print(", Z:");
|
||||
Serial.println(axisValue[2]);
|
||||
Serial.print(", S:");
|
||||
Serial.println(speedValue);
|
||||
Serial.print(", Z: ");
|
||||
Serial.print(axisValue[2]);
|
||||
Serial.print(", S: ");
|
||||
Serial.print(speedValue);
|
||||
Serial.print(", P: ");
|
||||
Serial.print(parameterId);
|
||||
Serial.print(", V: ");
|
||||
Serial.print(parameterValue);
|
||||
Serial.print("\n");
|
||||
}
|
||||
|
||||
CommandCodeEnum Command::getCodeEnum() {
|
||||
|
@ -149,11 +154,11 @@ long Command::getC() {
|
|||
return axisValue[2];
|
||||
}
|
||||
|
||||
double Command::getP() {
|
||||
long Command::getP() {
|
||||
return parameterId;
|
||||
}
|
||||
|
||||
double Command::getV() {
|
||||
long Command::getV() {
|
||||
return parameterValue;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ public:
|
|||
double getY();
|
||||
double getZ();
|
||||
double getS();
|
||||
double getP();
|
||||
double getV();
|
||||
long getP();
|
||||
long getV();
|
||||
long getA();
|
||||
long getB();
|
||||
long getC();
|
||||
|
|
|
@ -23,7 +23,26 @@ F22Handler::F22Handler() {
|
|||
|
||||
int F22Handler::execute(Command* command) {
|
||||
|
||||
ParameterList::getInstance()->readValue(command->getP());
|
||||
/*
|
||||
Serial.print("R99");
|
||||
Serial.print(" ");
|
||||
Serial.print("write value");
|
||||
Serial.print(" ");
|
||||
Serial.print("P");
|
||||
|
||||
Serial.print(" ");
|
||||
Serial.print(command->getP());
|
||||
Serial.print(" ");
|
||||
|
||||
Serial.print("V");
|
||||
Serial.print(" ");
|
||||
Serial.print(command->getV());
|
||||
Serial.print(" ");
|
||||
|
||||
Serial.print("\n");
|
||||
*/
|
||||
|
||||
ParameterList::getInstance()->writeValue(command->getP(), command->getV());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -51,6 +51,21 @@ int ParameterList::writeValue(int id, long value) {
|
|||
|
||||
paramValues[id] = value;
|
||||
|
||||
/*
|
||||
Serial.print("R99");
|
||||
Serial.print(" ");
|
||||
Serial.print("writeValue");
|
||||
Serial.print(" ");
|
||||
Serial.print("P");
|
||||
Serial.print(" ");
|
||||
Serial.print(id);
|
||||
Serial.print(" ");
|
||||
Serial.print("V");
|
||||
Serial.print(" ");
|
||||
Serial.print(value);
|
||||
Serial.print("\n");
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -58,8 +73,8 @@ int ParameterList::readValue(int id) {
|
|||
|
||||
long value = paramValues[id];
|
||||
|
||||
/*
|
||||
Serial.print("R22");
|
||||
|
||||
Serial.print("R21");
|
||||
Serial.print(" ");
|
||||
Serial.print("P");
|
||||
Serial.print(id);
|
||||
|
@ -67,7 +82,7 @@ int ParameterList::readValue(int id) {
|
|||
Serial.print("V");
|
||||
Serial.print(value);
|
||||
Serial.print("\n");
|
||||
*/
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue