aboutsummaryrefslogtreecommitdiff
path: root/src/survive_default_devices.c
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2018-03-14 23:54:14 -0400
committercnlohr <lohr85@gmail.com>2018-03-14 23:54:14 -0400
commit61a01d0ddfd8e99c97e3d235d4f0782fbf0ed032 (patch)
treed5e4efd164d0001bb2545a2ff829c2ab201c0296 /src/survive_default_devices.c
parent3681b5df3cf518b0ded815d93cb45b176aea7440 (diff)
downloadlibsurvive-61a01d0ddfd8e99c97e3d235d4f0782fbf0ed032.tar.gz
libsurvive-61a01d0ddfd8e99c97e3d235d4f0782fbf0ed032.tar.bz2
rename nr_locations to sensor_ct
Also, make it easier to see edges in calibrate.
Diffstat (limited to 'src/survive_default_devices.c')
-rw-r--r--src/survive_default_devices.c10
1 files changed, 5 insertions, 5 deletions
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]);
}