#include <SetArcVector.h>
#include <Axis.h>
#include <TorchHeightControl.h>
#include <Machine.h>
const char SetArcVector::myName[] =
"SetArcVector";
const char*
SetArcVector::name() {
return
myName; };
SetArcVector::SetArcVector( char* data ) {
axisNameC = ' ';
xyArcLength = 0.0;
headRotationAngleRad = 0.0;
zArcOffset = 0.0;
sscanf( data+3,
"%c %f %f %f %f %f",
&axisNameC,
&xyArcLength,
&headRotationAngleRad,
&zArcOffset );
headRotationAngleRad *= M_PI / 180.0; };
bool
SetArcVector::execute( Machine* machine ) {
TorchHeightControl* axis =
(TorchHeightControl*)machine->findAxis(
axisNameC,
NULL );
if ( axis )
axis->setArcVector(
xyArcLength,
headRotationAngleRad,
zArcOffset );
return
true; };
void
SetArcVector::report( String* msgPtr ) {
char data[40] = "";
if ( axis )
snprintf( data, 40,
" Plasma %c arc vector set\n",
axisNameC );
else
snprintf( data, 40,
"E Plasma axis %c invalid\n",
axisNameC );
*msgPtr += String( data ); };