From 61a01d0ddfd8e99c97e3d235d4f0782fbf0ed032 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Wed, 14 Mar 2018 23:54:14 -0400 Subject: rename nr_locations to sensor_ct Also, make it easier to see edges in calibrate. --- src/survive_default_devices.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/survive_default_devices.c') diff --git a/src/survive_default_devices.c b/src/survive_default_devices.c index 0229c63..b52a2f7 100644 --- a/src/survive_default_devices.c +++ b/src/survive_default_devices.c @@ -65,7 +65,7 @@ static int ParsePoints(SurviveContext *ctx, SurviveObject *so, char *ct0conf, int pts = t[i + 1].size; jsmntok_t *tk; - so->nr_locations = 0; + so->sensor_ct = 0; *floats_out = malloc(sizeof(**floats_out) * 32 * 3); for (k = 0; k < pts; k++) { @@ -86,10 +86,10 @@ static int ParsePoints(SurviveContext *ctx, SurviveObject *so, char *ct0conf, memcpy(ctt, ct0conf + tk->start, elemlen); ctt[elemlen] = 0; FLT f = atof(ctt); - int id = so->nr_locations * 3 + m; + int id = so->sensor_ct * 3 + m; (*floats_out)[id] = f; } - so->nr_locations++; + so->sensor_ct++; } return 0; } @@ -181,7 +181,7 @@ int survive_load_htc_config_format(char *ct0conf, int len, SurviveObject *so) { FILE *f = fopen(fname, "w"); int j; if(f) { - for (j = 0; j < so->nr_locations; j++) { + for (j = 0; j < so->sensor_ct; j++) { fprintf(f, "%f %f %f\n", so->sensor_locations[j * 3 + 0], so->sensor_locations[j * 3 + 1], so->sensor_locations[j * 3 + 2]); @@ -192,7 +192,7 @@ int survive_load_htc_config_format(char *ct0conf, int len, SurviveObject *so) { if(f) { sprintf(fname, "calinfo/%s_normals.csv", so->codename); f = fopen(fname, "w"); - for (j = 0; j < so->nr_locations; j++) { + for (j = 0; j < so->sensor_ct; j++) { fprintf(f, "%f %f %f\n", so->sensor_normals[j * 3 + 0], so->sensor_normals[j * 3 + 1], so->sensor_normals[j * 3 + 2]); } -- cgit v1.2.3