mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2024-12-22 23:43:00 +02:00
gp2rml/gp2rml.c: add spaces around operators
This commit is contained in:
parent
ea11b88bee
commit
efe5f38eb4
@ -60,7 +60,7 @@ static double z_max = -1e6; /* -1 km :) */
|
||||
static double z_scale = 1; /* < 1: compress; > 1: stretch */
|
||||
|
||||
|
||||
#define units(mm) ((int) round((mm)*40.0))
|
||||
#define units(mm) ((int) round((mm) * 40.0))
|
||||
|
||||
|
||||
#define alloc_type(t) \
|
||||
@ -146,23 +146,23 @@ static void output_paths(double z_clear, double xy_speed, double z_speed)
|
||||
printf("!PZ%d,%d;PA%d,%d;PD\n",
|
||||
units(seg->z-z_max), units(z_clear),
|
||||
units(seg->x), units(seg->y));
|
||||
d = hypot(x-seg->x, y-seg->y);
|
||||
d = hypot(x - seg->x, y - seg->y);
|
||||
s += d;
|
||||
s += z-z_max;
|
||||
t += d/V_MAX;
|
||||
t += (z-z_max)/z_speed;
|
||||
s += z - z_max;
|
||||
t += d / V_MAX;
|
||||
t += (z - z_max) / z_speed;
|
||||
x = seg->x;
|
||||
y = seg->y;
|
||||
z = seg->z;
|
||||
seg = seg->next;
|
||||
while (seg) {
|
||||
printf("!ZZ%d,%d,%d\n", units(seg->x), units(seg->y),
|
||||
units((seg->z-z_max)*z_scale));
|
||||
d = hypot(x-seg->x, y-seg->y);
|
||||
txy = d/xy_speed;
|
||||
tz = fabs(z-seg->z)/z_speed;
|
||||
units((seg->z - z_max) * z_scale));
|
||||
d = hypot(x - seg->x, y - seg->y);
|
||||
txy = d / xy_speed;
|
||||
tz = fabs(z - seg->z) / z_speed;
|
||||
t += txy > tz ? txy : tz;
|
||||
d = hypot(d, z-seg->z);
|
||||
d = hypot(d, z - seg->z);
|
||||
s += d;
|
||||
x = seg->x;
|
||||
y = seg->y;
|
||||
@ -170,16 +170,16 @@ static void output_paths(double z_clear, double xy_speed, double z_speed)
|
||||
seg = seg->next;
|
||||
}
|
||||
printf("PU\n");
|
||||
d = z_max+z_clear-z;
|
||||
d = z_max + z_clear - z;
|
||||
s += d;
|
||||
t += d/V_MAX;
|
||||
z = z_max+z_clear;
|
||||
t += d / V_MAX;
|
||||
z = z_max + z_clear;
|
||||
}
|
||||
|
||||
printf("!MC0;!ZO0;!PZ0,0;PU0,0;IN\n");
|
||||
d = -z+hypot(x, y);
|
||||
d = -z + hypot(x, y);
|
||||
s += d;
|
||||
t += d/V_MAX;
|
||||
t += d / V_MAX;
|
||||
fprintf(stderr, "Distance %.1f mm, time %.1f s\n", s, t);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user