solstice

Compute collected power and efficiencies of a solar plant
git clone git://git.meso-star.com/solstice.git
Log | Files | Refs | README | LICENSE

commit a38815e484760bbc223d7ab6d120ad632a97bd2f
parent e14b05b4a5847bfadb33467b98928befa537f7aa
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri,  6 Jan 2017 16:28:31 +0100

Update how multiple images are outputted

An image is no more preceded by an header. The sun direction is now
written after the image data.

Diffstat:
Msrc/solstice.c | 5++++-
Msrc/solstice_args.c | 12++++--------
2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/solstice.c b/src/solstice.c @@ -375,9 +375,12 @@ solstice_run(struct solstice* solstice) res = solstice_update_entities(solstice, sun_dir); if(res != RES_OK) goto error; - fprintf(solstice->output, "# Sun direction: %g %g %g\n", SPLIT3(sun_dir)); + res = solstice_draw(solstice); if(res != RES_OK) goto error; + + fprintf(solstice->output, + "# Sun direction: %g %g %g\n", SPLIT3(sun_dir)); } } diff --git a/src/solstice_args.c b/src/solstice_args.c @@ -119,8 +119,8 @@ parse_sun_dir_list(const char* str, struct solstice_args* args) goto error; } - spherical.azimuth = tmp[0]; - spherical.elevation = tmp[1]; + spherical.azimuth = MDEG2RAD(tmp[0]); + spherical.elevation = MDEG2RAD(tmp[1]); sa_push(args->sun_dirs, spherical); tk = strtok_r(NULL, ":", &ctx); @@ -244,12 +244,8 @@ parse_rendering_options(const char* str, struct solstice_args* args) (void)str, (void)args; /* Setup default values of the rendering parameters */ - d3(args->camera.pos, 0, 0, 0); - d3(args->camera.tgt, 0, 0, -1); - d3(args->camera.up, 0, 1, 0); - args->camera.fov_x = MDEG2RAD(70); - args->img.width = 800; - args->img.height = 600; + args->camera = SOLSTICE_ARGS_DEFAULT.camera; + args->img = SOLSTICE_ARGS_DEFAULT.img; if(!str) goto exit;