From 0ebe84be5824202aecfd87ac58005afa76b36be9 Mon Sep 17 00:00:00 2001 From: Joshua Allen Date: Mon, 6 Mar 2017 22:05:02 -0500 Subject: Load strings from config files. I need to finish the loading of numeric values and arrays. --- calibrate_client.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'calibrate_client.c') diff --git a/calibrate_client.c b/calibrate_client.c index 08f0715..927f40f 100644 --- a/calibrate_client.c +++ b/calibrate_client.c @@ -142,6 +142,17 @@ void * GuiThread( void * v ) int main() { + + config_init(); + config_read("config.json"); + config_set_str(&global_config_values, "Hello","World!"); + const char *s = config_read_str(&global_config_values, "test123","default"); + printf("%s\n", s); + + +// config_save("config.json"); + + ctx = survive_init( 1 ); survive_install_light_fn( ctx, my_light_process ); @@ -159,13 +170,6 @@ int main() CNFGSetup( "Survive GUI Debug", 640, 480 ); OGCreateThread( GuiThread, 0 ); - config_init(); - config_set_str(&global_config_values, "Hello","World!"); - const char *s = config_read_str(&global_config_values, "TestStr","This is a test."); - printf("%s\n", s); - config_save("config.json"); - - if( !ctx ) { fprintf( stderr, "Fatal. Could not start\n" ); -- cgit v1.2.3 From 90ed96e7b59e60a39f1e1f33223c6ffb0ee833f7 Mon Sep 17 00:00:00 2001 From: Joshua Allen Date: Tue, 7 Mar 2017 20:33:19 -0500 Subject: parse out integers and floats --- calibrate_client.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'calibrate_client.c') diff --git a/calibrate_client.c b/calibrate_client.c index 927f40f..9867d67 100644 --- a/calibrate_client.c +++ b/calibrate_client.c @@ -149,6 +149,12 @@ int main() const char *s = config_read_str(&global_config_values, "test123","default"); printf("%s\n", s); + FLT *f; + + uint16_t fs = config_read_float_array(lh_config+1, "fcalgibpha", &f, NULL, 0); + printf("%d\n", fs); + printf("===> %f %f\n", f[0], f[1]); + // config_save("config.json"); -- cgit v1.2.3 From c65498054c77192b2a12fdb5ef44439a14110292 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Wed, 8 Mar 2017 01:43:56 -0500 Subject: Architect the way the posers receive data. --- calibrate_client.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'calibrate_client.c') diff --git a/calibrate_client.c b/calibrate_client.c index 9867d67..b15b9db 100644 --- a/calibrate_client.c +++ b/calibrate_client.c @@ -75,15 +75,14 @@ void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int } } -void my_imu_process( struct SurviveObject * so, int16_t * accelgyro, uint32_t timecode, int id ) +void my_imu_process( struct SurviveObject * so, int mask, FLT * accelgyro, uint32_t timecode, int id ) { - survive_default_imu_process( so, accelgyro, timecode, id ); + survive_default_imu_process( so, mask, accelgyro, timecode, id ); -return; //if( so->codename[0] == 'H' ) - if( 1 ) + if( 0 ) { - printf( "I %s %d %d %d %d %d %d %d %d\n", so->codename, timecode, accelgyro[0], accelgyro[1], accelgyro[2], accelgyro[3], accelgyro[4], accelgyro[5], id ); + printf( "I %s %d %f %f %f %f %f %f %d\n", so->codename, timecode, accelgyro[0], accelgyro[1], accelgyro[2], accelgyro[3], accelgyro[4], accelgyro[5], id ); } } -- cgit v1.2.3 From d69cf82a079f93ae1109f70fd011a0efa75b44b5 Mon Sep 17 00:00:00 2001 From: Joshua Allen Date: Wed, 8 Mar 2017 21:17:50 -0500 Subject: shoehorn configuration into SurviveContext --- calibrate_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'calibrate_client.c') diff --git a/calibrate_client.c b/calibrate_client.c index b15b9db..f28520b 100644 --- a/calibrate_client.c +++ b/calibrate_client.c @@ -141,7 +141,7 @@ void * GuiThread( void * v ) int main() { - +/* config_init(); config_read("config.json"); config_set_str(&global_config_values, "Hello","World!"); @@ -156,7 +156,7 @@ int main() // config_save("config.json"); - +*/ ctx = survive_init( 1 ); -- cgit v1.2.3