@@ -18,7 +18,7 @@ servo_period_ns = float(Popen(
1818 "-sec" ,
1919 "EMCMOT" ,
2020 "-ini" ,
21- "%s/tests/ motion/g0/motion -test.ini" % os .getenv ("EMC2_HOME " )
21+ "%s/motion-test.ini" % os .getenv ("TEST_DIR " )
2222 ],
2323 stdout = PIPE
2424).communicate ()[0 ])
@@ -32,9 +32,9 @@ max_acceleration_ips2 = float(Popen(
3232 "-var" ,
3333 "MAX_ACCELERATION" ,
3434 "-sec" ,
35- "AXIS_0 " ,
35+ "AXIS_X " ,
3636 "-ini" ,
37- "%s/tests/ motion/g0/motion -test.ini" % os .getenv ("EMC2_HOME " )
37+ "%s/motion-test.ini" % os .getenv ("TEST_DIR " )
3838 ],
3939 stdout = PIPE
4040).communicate ()[0 ])
@@ -50,9 +50,9 @@ max_velocity_ips = float(Popen(
5050 "-var" ,
5151 "MAX_VELOCITY" ,
5252 "-sec" ,
53- "AXIS_0 " ,
53+ "AXIS_X " ,
5454 "-ini" ,
55- "%s/tests/ motion/g0/motion -test.ini" % os .getenv ("EMC2_HOME " )
55+ "%s/motion-test.ini" % os .getenv ("TEST_DIR " )
5656 ],
5757 stdout = PIPE
5858).communicate ()[0 ])
@@ -63,7 +63,9 @@ max_velocity_ipc = max_velocity_ips / cycles_per_second
6363# read the samples file and turn it into an array, where index i is an
6464# array of the floats found on line i of the samples file
6565samples_filename = sys .argv [1 ] + ".halsamples"
66- lines = file (samples_filename ).readlines ()
66+ with open (samples_filename ) as f :
67+ lines = f .readlines ()
68+
6769samples = []
6870for line in lines :
6971 s = [ float (x ) for x in line .split () ]
@@ -105,7 +107,7 @@ for i in range(i, len(samples)):
105107
106108 highest_seen_accel_ipc2 = max (accel_ipc2 , highest_seen_accel_ipc2 )
107109
108- #print "line %d: X=%.6f, v=%.6f i/c (%.6f i/s), a=%.6f i/c^2 (%.6f i/s^2)" % (i, samples[i][1], new_v_ipc, (new_v_ipc * cycles_per_second), accel_ipc2, (accel_ipc2 * cycles_per_second * cycles_per_second))
110+ #print( "line %d: X=%.6f, v=%.6f i/c (%.6f i/s), a=%.6f i/c^2 (%.6f i/s^2)" % (i, samples[i][1], new_v_ipc, (new_v_ipc * cycles_per_second), accel_ipc2, (accel_ipc2 * cycles_per_second * cycles_per_second) ))
109111
110112 # i hate floating point
111113 if ((accel_ipc2 * cycles_per_second ) - max_acceleration_ipspc ) > 0.0000001 :
@@ -163,7 +165,7 @@ for i in range(i, len(samples)):
163165
164166 highest_seen_accel_ipc2 = min (accel_ipc2 , highest_seen_accel_ipc2 )
165167
166- #print "line %d: X=%.6f, v=%.6f i/c (%.6f i/s), a=%.6f i/c^2 (%.6f i/s^2)" % (i, samples[i][1], new_v_ipc, (new_v_ipc * cycles_per_second), accel_ipc2, (accel_ipc2 * cycles_per_second * cycles_per_second))
168+ #print( "line %d: X=%.6f, v=%.6f i/c (%.6f i/s), a=%.6f i/c^2 (%.6f i/s^2)" % (i, samples[i][1], new_v_ipc, (new_v_ipc * cycles_per_second), accel_ipc2, (accel_ipc2 * cycles_per_second * cycles_per_second) ))
167169
168170 # i hate floating point
169171 if ((accel_ipc2 * cycles_per_second ) - max_acceleration_ipspc ) > 0.0000001 :
0 commit comments