|
|
@ -70,7 +70,7 @@ const parseMessage = (message) => {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
switch (message.toLowerCase()) {
|
|
|
|
switch (message.toLowerCase()) {
|
|
|
|
case 'init':
|
|
|
|
case 'init':
|
|
|
|
toPlotter(translate());
|
|
|
|
toPlotter(init());
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'pu':
|
|
|
|
case 'pu':
|
|
|
|
toPlotter(`PU;`);
|
|
|
|
toPlotter(`PU;`);
|
|
|
@ -79,7 +79,7 @@ const parseMessage = (message) => {
|
|
|
|
toPlotter(`PD;`);
|
|
|
|
toPlotter(`PD;`);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'up':
|
|
|
|
case 'up':
|
|
|
|
toPlotter(translate(distance * -1, 0));
|
|
|
|
toPlotter(translate(0, distance * -1));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'down':
|
|
|
|
case 'down':
|
|
|
|
toPlotter(translate(0, distance));
|
|
|
|
toPlotter(translate(0, distance));
|
|
|
@ -88,10 +88,7 @@ const parseMessage = (message) => {
|
|
|
|
toPlotter(translate(distance * -1, 0));
|
|
|
|
toPlotter(translate(distance * -1, 0));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'right':
|
|
|
|
case 'right':
|
|
|
|
toPlotter(translate(0, distance));
|
|
|
|
toPlotter(translate(distance, 0));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'right':
|
|
|
|
|
|
|
|
toPlotter(translate(0, distance));
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'rectangle':
|
|
|
|
case 'rectangle':
|
|
|
|
toPlotter(rectangle(distance));
|
|
|
|
toPlotter(rectangle(distance));
|
|
|
|