run-in-simulator.sh: use stdin/stdout for the data file, too.
This commit is contained in:
parent
005a935adc
commit
e559b59b54
|
|
@ -25,6 +25,7 @@ for GCODE_FILE in "triangle.gcode" "straight-speeds.gcode"; do
|
||||||
|
|
||||||
FILE="${GCODE_FILE%.gcode}"
|
FILE="${GCODE_FILE%.gcode}"
|
||||||
VCD_FILE="${FILE}.vcd"
|
VCD_FILE="${FILE}.vcd"
|
||||||
|
DATA_FILE="${FILE}.data"
|
||||||
VEL_FILE="${FILE}.processed.vcd"
|
VEL_FILE="${FILE}.processed.vcd"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -41,8 +42,7 @@ for GCODE_FILE in "triangle.gcode" "straight-speeds.gcode"; do
|
||||||
# is assumed to match the order in tracein.txt and starting at "0".
|
# is assumed to match the order in tracein.txt and starting at "0".
|
||||||
awk '
|
awk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
dataFile = "'"${FILE}"'.data";
|
print "0 0 0 0 0";
|
||||||
print "0 0 0 0 0" > dataFile;
|
|
||||||
xDir = yDir = 0;
|
xDir = yDir = 0;
|
||||||
xPos = yPos = 0;
|
xPos = yPos = 0;
|
||||||
xVel = yVel = 0;
|
xVel = yVel = 0;
|
||||||
|
|
@ -69,7 +69,7 @@ for GCODE_FILE in "triangle.gcode" "straight-speeds.gcode"; do
|
||||||
if (bit == 1) {
|
if (bit == 1) {
|
||||||
xPos += xDir;
|
xPos += xDir;
|
||||||
xVel = 1000000000 / (time - lastxTime);
|
xVel = 1000000000 / (time - lastxTime);
|
||||||
print time " " xPos " " yPos " " xVel " " yVel >> dataFile;
|
print time " " xPos " " yPos " " xVel " " yVel;
|
||||||
lastxTime = time;
|
lastxTime = time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -77,12 +77,12 @@ for GCODE_FILE in "triangle.gcode" "straight-speeds.gcode"; do
|
||||||
if (bit == 1) {
|
if (bit == 1) {
|
||||||
yPos += yDir;
|
yPos += yDir;
|
||||||
yVel = 1000000000 / (time - lastyTime);
|
yVel = 1000000000 / (time - lastyTime);
|
||||||
print time " " xPos " " yPos " " xVel " " yVel >> dataFile;
|
print time " " xPos " " yPos " " xVel " " yVel;
|
||||||
lastyTime = time;
|
lastyTime = time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
' < "${VCD_FILE}"
|
' < "${VCD_FILE}" > "${DATA_FILE}"
|
||||||
|
|
||||||
|
|
||||||
# Create a plot.
|
# Create a plot.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue