diff options
Diffstat (limited to 'src/ufo-roof-config.c')
-rw-r--r-- | src/ufo-roof-config.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ufo-roof-config.c b/src/ufo-roof-config.c index 4788a2a..17f4b30 100644 --- a/src/ufo-roof-config.c +++ b/src/ufo-roof-config.c @@ -43,9 +43,6 @@ void ufo_roof_config_free(UfoRoofConfig *cfg) { if (cfg) { UfoRoofConfigPrivate *priv = (UfoRoofConfigPrivate*)cfg; - if (cfg->path) - g_free(cfg->path); - if (priv->parser) g_object_unref (priv->parser); @@ -53,7 +50,7 @@ void ufo_roof_config_free(UfoRoofConfig *cfg) { } } -UfoRoofConfig *ufo_roof_config_new(const char *config, GError **error) { +UfoRoofConfig *ufo_roof_config_new(const char *config, UfoRoofConfigFlags flags, GError **error) { UfoRoofConfigPrivate *priv; UfoRoofConfig *cfg; @@ -66,6 +63,7 @@ UfoRoofConfig *ufo_roof_config_new(const char *config, GError **error) { JsonObject *performance = NULL; JsonObject *simulation = NULL; JsonObject *reconstruction = NULL; + JsonObject *data = NULL; GError *gerr = NULL; @@ -97,7 +95,6 @@ UfoRoofConfig *ufo_roof_config_new(const char *config, GError **error) { cfg->dataset_size = 0; cfg->buffer_size = 2; cfg->drop_buffers = 0; - cfg->path = NULL; // Read configuration @@ -118,8 +115,11 @@ UfoRoofConfig *ufo_roof_config_new(const char *config, GError **error) { roof_config_node_get(optics, root, object, "optics"); roof_config_node_get(network, root, object, "network"); roof_config_node_get(reconstruction, root, object, "reconstruction"); - roof_config_node_get(simulation, root, object, "simulation"); roof_config_node_get(performance, root, object, "performance"); + roof_config_node_get(data, root, object, "data"); + + if (flags&UFO_ROOF_CONFIG_SIMULATION) + roof_config_node_get(simulation, root, object, "simulation"); } if (hardware) { @@ -183,8 +183,6 @@ UfoRoofConfig *ufo_roof_config_new(const char *config, GError **error) { } if (simulation) { - roof_config_node_get_string(cfg->path, simulation, "path"); - roof_config_node_get(cfg->first_file_number, simulation, int, "first_file_number"); roof_config_node_get(cfg->header_size, simulation, int, "header_size"); if (!cfg->payload_size) |