Commit 4f35db9c authored by Ole Streicher's avatar Ole Streicher

Merge branch 'upstream' into debian

parents 1e1125b9 e6ab0c9c
2.6.8 14/09/2015 Addressed DFS-11239
2.6.7 10/09/2015
"changed status of parameter SetProductExplorerMode to Triggered" sinfo.xml.in
2.6.6 24/08/2015 release added param to allow change of offset convention in sinfo_utl_cube_combine
2.6.5 04/08/2015 release 2.6.5
2.6.5b2 02/08/2015 Candidate release 2.6.5b2
Fixed PIPE-6103
......
......@@ -41,7 +41,7 @@ PRINTER_NAME=lp
PRINT_FONT=Monospaced:16
PRINT_ORIENTATION=P
RADEC_CONVERSION=true
RECIPE_SET=sinfo_rec_detlin=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_rec_detlin.so;sinfo_rec_distortion=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_rec_distortion.so;sinfo_rec_jitter=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_rec_jitter.so;sinfo_rec_mdark=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_rec_mdark.so;sinfo_rec_mflat=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_rec_mflat.so;sinfo_rec_pupil=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_rec_pupil.so;sinfo_rec_wavecal=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_rec_wavecal.so;sinfo_utl_bp_mask_add=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_utl_bp_mask_add.so;sinfo_utl_cube2ima=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_utl_cube2ima.so;sinfo_utl_cube_combine=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_utl_cube_combine.so;sinfo_utl_cube2spectrum=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_utl_cube2spectrum.so;sinfo_utl_cube_arith=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_utl_cube_arith.so;sinfo_utl_ima_arith=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_utl_ima_arith.so;sinfo_utl_skycor=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_utl_skycor.so;sinfo_utl_skymap=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_utl_skymap.so;sinfo_utl_spectrum_divide_by_blackbody=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_utl_spectrum_divide_by_blackbody.so;sinfo_utl_spectrum_wavelength_shift=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.5/sinfo_utl_spectrum_wavelength_shift.so
RECIPE_SET=sinfo_rec_detlin=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_rec_detlin.so;sinfo_rec_distortion=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_rec_distortion.so;sinfo_rec_jitter=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_rec_jitter.so;sinfo_rec_mdark=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_rec_mdark.so;sinfo_rec_mflat=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_rec_mflat.so;sinfo_rec_pupil=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_rec_pupil.so;sinfo_rec_wavecal=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_rec_wavecal.so;sinfo_utl_bp_mask_add=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_utl_bp_mask_add.so;sinfo_utl_cube2ima=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_utl_cube2ima.so;sinfo_utl_cube_combine=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_utl_cube_combine.so;sinfo_utl_cube2spectrum=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_utl_cube2spectrum.so;sinfo_utl_cube_arith=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_utl_cube_arith.so;sinfo_utl_ima_arith=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_utl_ima_arith.so;sinfo_utl_skycor=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_utl_skycor.so;sinfo_utl_skymap=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_utl_skymap.so;sinfo_utl_spectrum_divide_by_blackbody=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_utl_spectrum_divide_by_blackbody.so;sinfo_utl_spectrum_wavelength_shift=/home/quality/pipelines/sinfo/lib/esopipes-plugins/sinfo-2.6.8/sinfo_utl_spectrum_wavelength_shift.so
SCRIPTS_DIR=/home/astro4/gasgano/scripts/gas-scripts
SHORTEN_FILES_PATH=false
SHORT_FILENAME=true
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for SINFONI Instrument Pipeline 2.6.5.
# Generated by GNU Autoconf 2.69 for SINFONI Instrument Pipeline 2.6.8.
#
# Report bugs to <usd-help@eso.org>.
#
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='SINFONI Instrument Pipeline'
PACKAGE_TARNAME='sinfo'
PACKAGE_VERSION='2.6.5'
PACKAGE_STRING='SINFONI Instrument Pipeline 2.6.5'
PACKAGE_VERSION='2.6.8'
PACKAGE_STRING='SINFONI Instrument Pipeline 2.6.8'
PACKAGE_BUGREPORT='usd-help@eso.org'
PACKAGE_URL=''
......@@ -1376,7 +1376,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures SINFONI Instrument Pipeline 2.6.5 to adapt to many kinds of systems.
\`configure' configures SINFONI Instrument Pipeline 2.6.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1447,7 +1447,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of SINFONI Instrument Pipeline 2.6.5:";;
short | recursive ) echo "Configuration of SINFONI Instrument Pipeline 2.6.8:";;
esac
cat <<\_ACEOF
......@@ -1575,7 +1575,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
SINFONI Instrument Pipeline configure 2.6.5
SINFONI Instrument Pipeline configure 2.6.8
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1990,7 +1990,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by SINFONI Instrument Pipeline $as_me 2.6.5, which was
It was created by SINFONI Instrument Pipeline $as_me 2.6.8, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2969,7 +2969,7 @@ fi
# Define the identity of the package.
PACKAGE='sinfo'
VERSION='2.6.5'
VERSION='2.6.8'
cat >>confdefs.h <<_ACEOF
......@@ -14932,7 +14932,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by SINFONI Instrument Pipeline $as_me 2.6.5, which was
This file was extended by SINFONI Instrument Pipeline $as_me 2.6.8, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -14998,7 +14998,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
SINFONI Instrument Pipeline config.status 2.6.5
SINFONI Instrument Pipeline config.status 2.6.8
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
# Process this file with autoconf to produce a configure script.
AC_INIT([SINFONI Instrument Pipeline], [2.6.5], [usd-help@eso.org], [sinfo])
AC_INIT([SINFONI Instrument Pipeline], [2.6.8], [usd-help@eso.org], [sinfo])
AC_PREREQ([2.59])
......
/*
* This file is part of the irplib package
* Copyright (C) 2002,2003,2014 European Southern Observatory
* 2004 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -189,6 +189,18 @@ static int sinfo_utl_cube_combine_create(cpl_plugin * plugin)
cpl_parameterlist_append(recipe->parameters, p) ;
p = cpl_parameter_new_value("sinfoni.sinfo_utl_cube_combine.offset_mode",
CPL_TYPE_BOOL, "Offset conventions. If TRUE applies "
"reference offset correction. If FALSE: "
"take user offsets. The reference offset "
"is computed as (min_off+max_off)/2",
"sinfoni.sinfo_utl_cube_combine", CPL_TRUE) ;
cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "offset_mode") ;
cpl_parameterlist_append(recipe->parameters, p) ;
/* Return */
return 0;
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -174,6 +174,8 @@ sinfo_new_fit_slits2( cpl_image * lineImage,
constant intensity value for xdat values greater than pos2
(see illustration above)
return 0 in case of invalid input.
@memo This function calculates the value of a slope function with parameters
parlist at the position xdat
*/
......@@ -184,6 +186,9 @@ sinfo_new_edge ( float * xdat, float * parlist/*, int * npar, int * ndat*/ )
float return_value ;
float slope1 ;
cpl_ensure(xdat , CPL_ERROR_NULL_INPUT, 0.);
cpl_ensure(parlist , CPL_ERROR_NULL_INPUT, 0.);
/* compute the slopes */
slope1 = ( parlist[3] - parlist[2] ) / ( parlist[1] - parlist[0] ) ;
......@@ -246,6 +251,8 @@ sinfo_new_edge ( float * xdat, float * parlist/*, int * npar, int * ndat*/ )
linear between pos2 and pos3, linear decreasing between pos3 and pos4,
and constant background value for xdat values greater than pos4.
(see figure above)
TODO: NOT USED
*/
......@@ -331,6 +338,7 @@ sinfo_new_hat2 ( float * xdat, float * parlist/*, int * npar, int * ndat*/ )
pos2-slope_width, linear decreasing between pos2-slope_width and pos2,
and constant background value for xdat values greater than pos2.
(see figure above)
TODO: NOT USED
*/
float
sinfo_new_hat1 ( float * xdat, float * parlist/*, int * npar, int * ndat*/ )
......@@ -411,12 +419,16 @@ sinfo_new_hat1 ( float * xdat, float * parlist/*, int * npar, int * ndat*/ )
*/
void
cpl_error_code
sinfo_new_edge_deriv( float * xdat, float * parlist,
float * dervs/*, int * npar*/ )
{
float deriv1_slope1 ;
cpl_ensure_code(xdat , CPL_ERROR_NULL_INPUT);
cpl_ensure_code(parlist , CPL_ERROR_NULL_INPUT);
cpl_ensure_code(dervs , CPL_ERROR_NULL_INPUT);
/* compute the slopes */
deriv1_slope1 =( parlist[3] - parlist[2] ) / SQR(parlist[1] - parlist[0]) ;
......@@ -442,6 +454,7 @@ sinfo_new_edge_deriv( float * xdat, float * parlist,
dervs[2] = 0. ;
dervs[3] = 1. ;
}
return cpl_error_get_code();
}
/**
@name sinfo_new_hat_deriv2
......@@ -487,6 +500,7 @@ sinfo_new_edge_deriv( float * xdat, float * parlist,
|----------|----|------|---|------> X axis
pos1 pos2 pos3 pos4
TODO: NOT USED
*/
void
......@@ -597,6 +611,7 @@ sinfo_new_hat_deriv2(float * xdat, float * parlist,
|----------|----|---------------> X axis
parlist(0)=pos1 pos2=parlist(1)
TODO: NOT USED
*/
void
......@@ -1233,6 +1248,7 @@ sinfo_new_lsqfit_edge ( float * xdat,
first image columns
# -7 if not all slitlets could be found
# -8 if the least squares fit failed
TODO: NOT USED
*/
......@@ -1672,6 +1688,8 @@ sinfo_new_fit_slits1( cpl_image * lineImage,
first image columns
# -8 if not all slitlets could be found
# -9 if the least squares fit failed
TODO: NOT USED
*/
......@@ -2093,6 +2111,7 @@ sinfo_new_fit_slits( cpl_image * lineImage,
using a box bigger than the size of one slitlet and
divides the box into two parts
for both edges within the fit function is shifted.
TODO: NOT USED
*/
int
......
......@@ -59,11 +59,11 @@ sinfo_new_edge(float * xdat, float * parlist/*, int * npar, int * ndat */) ;
float
sinfo_new_boltz ( float * xdat, float * parlist ) ;
void
cpl_error_code
sinfo_new_edge_deriv(float * xdat,
float * parlist, float * dervs/*, int * npar */) ;
void
cpl_error_code
sinfo_new_boltz_deriv( float * xdat, float * parlist, float * dervs ) ;
int sinfo_new_lsqfit ( float * xdat,
......
......@@ -63,9 +63,6 @@
#include <math.h>
#define H_GEOLAT "ESO TEL GEOLAT"
#define H_GEOLON "ESO TEL GEOLON"
#define H_UTC "UTC"
/*-----------------------------------------------------------------------------
Local functions
......
......@@ -22,27 +22,6 @@
* $Date: 2009-04-28 11:42:18 $
* $Revision: 1.2 $
* $Name: not supported by cvs2svn $
* $Log: not supported by cvs2svn $
* Revision 1.1 2009/01/02 08:38:07 amodigli
* added to CVS
*
* Revision 1.3 2007/06/06 08:17:33 amodigli
* replace tab with 4 spaces
*
* Revision 1.2 2007/04/24 12:50:29 jmlarsen
* Replaced cpl_propertylist -> uves_propertylist which is much faster
*
* Revision 1.1 2006/10/04 11:03:08 jmlarsen
* Implemented QC.VRAD parameters
*
* Revision 1.4 2006/08/17 13:56:52 jmlarsen
* Reduced max line length
*
* Revision 1.3 2006/02/28 09:15:22 jmlarsen
* Minor update
*
* Revision 1.2 2005/12/19 16:17:56 jmlarsen
* Replaced bool -> int
*
*/
#ifndef SINFO_BARYVEL_H
......@@ -50,6 +29,9 @@
#include <cpl.h>
#define H_GEOLAT "ESO TEL GEOLAT"
#define H_GEOLON "ESO TEL GEOLON"
#define H_UTC "UTC"
cpl_error_code
sinfo_baryvel(const cpl_propertylist *raw_header,
double *barycor,
......
......@@ -119,12 +119,14 @@ static int sinfo_new_get_vec ( float * xdat,
that is
y = (parlist(0) - parlist(1)) /
(1+exp((x-parlist(2))/parlist(3))) + parlist(1)
or 0 is the input are invalid
*/
float sinfo_new_boltz ( float * xdat, float * parlist )
{
float return_value ;
cpl_ensure(xdat , CPL_ERROR_NULL_INPUT, 0.);
cpl_ensure(parlist , CPL_ERROR_NULL_INPUT, 0.);
/* now build the boltzman function out of the parameters */
return_value =
......@@ -156,9 +158,13 @@ float sinfo_new_boltz ( float * xdat, float * parlist )
@returns nothing, void
*/
void sinfo_new_boltz_deriv( float * xdat, float * parlist, float * dervs )
cpl_error_code sinfo_new_boltz_deriv( float * xdat, float * parlist, float * dervs )
{
float subst ;
cpl_ensure_code(xdat , CPL_ERROR_NULL_INPUT);
cpl_ensure_code(parlist , CPL_ERROR_NULL_INPUT);
cpl_ensure_code(dervs , CPL_ERROR_NULL_INPUT);
subst = (xdat[0] - parlist[2]) / parlist[3] ;
......@@ -172,6 +178,8 @@ void sinfo_new_boltz_deriv( float * xdat, float * parlist, float * dervs )
dervs[3] = ( (parlist[0] - parlist[1]) * (xdat[0] - parlist[2]) /
(parlist[3]*parlist[3]) * exp(subst) ) /
( (1. + exp(subst)) * (1. + exp(subst)) ) ;
return cpl_error_get_code();
}
/**
......@@ -1508,7 +1516,7 @@ int sinfo_new_fit_slits_boltz ( cpl_image * lineImage,
user given positions.
The least squares fit is done by using a box smaller than
the size of two slitlets
TODO: NOT USED
*/
int
......
......@@ -82,6 +82,7 @@
fitted through the fitted positions. The slope of this linear fit
is returned.
TODO: not used
*/
float
......@@ -407,6 +408,7 @@ sinfo_new_slope_of_spectrum( cpl_image * ns_image,
@doc shifts the rows of a raw image by using the output of
sinfo_slopeOfSpectrum and applying polynomial interpolation
TODO: not used
*/
......@@ -642,7 +644,7 @@ sinfo_new_shift_rows( cpl_image * image,
@param filename filename of ASCII file
@return void
TODO: NOT USED
*/
void
......@@ -697,6 +699,7 @@ sinfo_new_parameter_to_ascii ( float * parameter,
each row. Afterwards, a polynomial is fitted through the
found positions. The polynomial coefficients are returned.
TODO: NOT USED
*
*/
......
......@@ -692,6 +692,7 @@ sinfo_north_south_test( cpl_image * ns_image,
Can do the same with the bad pixel map image to generate a
bad pixel mask cube.
TODO: NOT USED
*/
cpl_imagelist *
......@@ -1421,6 +1422,8 @@ sinfo_new_make_cube_dist ( cpl_image * calibImage,
Can do the same with the bad pixel map image to generate a
bad pixel mask cube.
TODO: not used
*/
......@@ -1567,6 +1570,7 @@ sinfo_new_make_3D_cube_dist ( cpl_image * calibImage,
Can do the same with the bad pixel map image to generate a
bad pixel mask cube.
TODO: not used
*/
......@@ -1661,6 +1665,7 @@ sinfo_new_make_3D_cube ( cpl_image * calibImage,
@return resulting bad pixel data cube (bad pixels: 0, good pixels: 1).
TODO: not used
*/
......@@ -1772,6 +1777,7 @@ sinfo_new_determine_mask_cube ( cpl_imagelist * sourceMaskCube,
(there must be at least 18) and take the sinfo_median of the valid
pixels with which the bad pixel is replaced.
TODO: NOT USED
*/
......@@ -2696,6 +2702,8 @@ cpl_imagelist * sinfo_new_fine_tune_cube_by_spline ( cpl_imagelist * cube,
@doc determines the distances of the spectra from the center
of the slitlets to be able to find the correct angle of
the north-south entrance slit.
TODO: not used
*/
float *
......@@ -3236,6 +3244,8 @@ sinfo_new_calibrate_ns_test( cpl_image * ns_image,
according to the distances array gained from the north-south test
routine. Can do the same with the bad pixel map image to generate a
bad pixel mask cube.
TODO: NOT USED
*/
cpl_image *
......
This diff is collapsed.
......@@ -184,6 +184,7 @@ sinfo_distortion_smooth(cpl_image* inp,const int r,const int d)
@param ks_method method used in kappa-sigma clip: 0 (average) 1 (median)
@param n number iterations kappa-sigma clip
@return smoothed image if succes, NULL else
TODO: not used
*/
cpl_image *
......@@ -688,6 +689,7 @@ static cpl_apertures * sinfo_distortion_detect_arcs_new(
This polynomial can be used as it is by the CPL warping function to correct
the image.
TODO: not used
*/
/*---------------------------------------------------------------------------*/
cpl_polynomial * sinfo_distortion_estimate(
......
......@@ -45,45 +45,7 @@
#include <sinfo_msg.h>
#include <cpl.h>
/*----------------------------------------------------------------*/
/**
* @brief Print a property list.
* @param pl The property list to print.
* @param low Index of first property to print.
* @param high Index of first property not to print.
* @return CPL_ERROR_NONE iff OK.
*
* This function prints all properties in the property list @em pl
* in the range from @em low (included) to @em high (not included)
* counting from zero.
*/
/*----------------------------------------------------------------*/
cpl_error_code
sinfo_print_cpl_propertylist(const cpl_propertylist *pl, long low, long high)
{
cpl_property *prop;
long i = 0;
assure(0 <= low && high <= cpl_propertylist_get_size(pl) && low <= high,
CPL_ERROR_ILLEGAL_INPUT, "Illegal range");
/* Printing an empty range is allowed but only when low == high */
if (pl == NULL ) {
sinfo_msg("NULL");
}
else if (cpl_propertylist_is_empty(pl)) {
sinfo_msg("[Empty property list]");
}
else
for (i = low; i < high; i++) {
/* bug workaround: remove const cast when declaration
of cpl_propertylist_get() is changed */
prop = cpl_propertylist_get((cpl_propertylist *) pl, i);
check(sinfo_print_cpl_property(prop), "Error printing property");
}
cleanup: return cpl_error_get_code();
}
/*----------------------------------------------------------------*/
/**
* @brief Print a property.
......@@ -94,7 +56,7 @@ sinfo_print_cpl_propertylist(const cpl_propertylist *pl, long low, long high)
*/
/*----------------------------------------------------------------*/
cpl_error_code
static cpl_error_code
sinfo_print_cpl_property(const cpl_property *prop)
{
cpl_type t;
......@@ -184,77 +146,6 @@ sinfo_print_cpl_property(const cpl_property *prop)
cleanup: return cpl_error_get_code();
}
/*----------------------------------------------------------------*/
/**
* @brief Print a frame set
* @param frames Frame set to print
* @return CPL_ERROR_NONE iff OK.
*
* This function prints all frames in a CPL frame set.
*/
/*----------------------------------------------------------------*/
cpl_error_code
sinfo_print_cpl_frameset(const cpl_frameset *frames)
{
/* Two special cases: a NULL frame set and an empty frame set */
if (frames == NULL ) {
sinfo_msg("NULL");
}
else {
cpl_frameset_iterator* it = cpl_frameset_iterator_new(frames);
const cpl_frame *f = cpl_frameset_iterator_get_const(it);
if (f == NULL ) {
sinfo_msg("[Empty frame set]");
}
else {
while (f != NULL ) {
check(sinfo_print_cpl_frame(f), "Could not print frame");
cpl_frameset_iterator_advance(it, 1);
f = cpl_frameset_iterator_get_const(it);
}
}
cpl_frameset_iterator_delete(it);
}
cleanup: return cpl_error_get_code();
}
/*----------------------------------------------------------------*/
/**
* @brief Print a frame
* @param f Frame to print
* @return CPL_ERROR_NONE iff OK.
*
* This function prints a CPL frame.
*/
/*----------------------------------------------------------------*/
cpl_error_code
sinfo_print_cpl_frame(const cpl_frame *f)
{
if (f == NULL ) {
sinfo_msg("NULL");
}
else {
sinfo_msg("%-7s %-20s '%s'",
sinfo_tostring_cpl_frame_group(cpl_frame_get_group(f)),
cpl_frame_get_tag(f) != NULL ? cpl_frame_get_tag(f) : "Null",
cpl_frame_get_filename(f));
sinfo_msg_debug("type \t= %s",
sinfo_tostring_cpl_frame_type(cpl_frame_get_type(f)));
sinfo_msg_debug("group \t= %s",
sinfo_tostring_cpl_frame_group(cpl_frame_get_group(f)));
sinfo_msg_debug("level \t= %s",
sinfo_tostring_cpl_frame_level(cpl_frame_get_level(f)));
}
return cpl_error_get_code();
}
/*----------------------------------------------------------------*/
/**
......@@ -263,7 +154,7 @@ sinfo_print_cpl_frame(const cpl_frame *f)
* @return A textual representation of @em ft.
*/
/*----------------------------------------------------------------*/
const char *
static const char *
sinfo_tostring_cpl_frame_type(cpl_frame_type ft)
{
switch (ft)
......@@ -288,7 +179,7 @@ sinfo_tostring_cpl_frame_type(cpl_frame_type ft)
* @return A textual representation of @em fg.
*/
/*----------------------------------------------------------------*/
const char *
static const char *
sinfo_tostring_cpl_frame_group(cpl_frame_group fg)
{
switch (fg)
......@@ -306,14 +197,15 @@ sinfo_tostring_cpl_frame_group(cpl_frame_group fg)
}
}
/*----------------------------------------------------------------*/
/**
/**
* @brief Convert a frame level to a string
* @param fl Frame level to convert
* @return A textual representation of @em fl.
*/
/*----------------------------------------------------------------*/
const char *
static const char *
sinfo_tostring_cpl_frame_level(cpl_frame_level fl)
{
......@@ -332,6 +224,39 @@ sinfo_tostring_cpl_frame_level(cpl_frame_level fl)
}
}
/*----------------------------------------------------------------*/
/**
* @brief Print a frame
* @param f Frame to print
* @return CPL_ERROR_NONE iff OK.
*
* This function prints a CPL frame.
*/
/*----------------------------------------------------------------*/
static cpl_error_code
sinfo_print_cpl_frame(const cpl_frame *f)
{
if (f == NULL ) {
sinfo_msg("NULL");
}
else {
sinfo_msg("%-7s %-20s '%s'",
sinfo_tostring_cpl_frame_group(cpl_frame_get_group(f)),
cpl_frame_get_tag(f) != NULL ? cpl_frame_get_tag(f) : "Null",
cpl_frame_get_filename(f));
sinfo_msg_debug("type \t= %s",
sinfo_tostring_cpl_frame_type(cpl_frame_get_type(f)));
sinfo_msg_debug("group \t= %s",
sinfo_tostring_cpl_frame_group(cpl_frame_get_group(f)));
sinfo_msg_debug("level \t= %s",
sinfo_tostring_cpl_frame_level(cpl_frame_get_level(f)));
}
return cpl_error_get_code();
}
/*----------------------------------------------------------------*/
/**
* @brief Convert a CPL type to a string
......@@ -405,4 +330,93 @@ sinfo_tostring_cpl_type(cpl_type t)
return "unrecognized type";
}
}
/*----------------------------------------------------------------*/
/**
* @brief Print a property list.
* @param pl The property list to print.
* @param low Index of first property to print.
* @param high Index of first property not to print.
* @return CPL_ERROR_NONE iff OK.
*
* This function prints all properties in the property list @em pl
* in the range from @em low (included) to @em high (not included)
* counting from zero.
* TODO: not used
*/
/*----------------------------------------------------------------*/
cpl_error_code
sinfo_print_cpl_propertylist(const cpl_propertylist *pl, long low, long high)
{
cpl_property *prop;
long i = 0;
assure(0 <= low && high <= cpl_propertylist_get_size(pl) && low <= high,
CPL_ERROR_ILLEGAL_INPUT, "Illegal range");
/* Printing an empty range is allowed but only when low == high */
if (pl == NULL ) {
sinfo_msg("NULL");
}
else if (cpl_propertylist_is_empty(pl)) {
sinfo_msg("[Empty property list]");
}
else
for (i = low; i < high; i++) {
/* bug workaround: remove const cast when declaration
of cpl_propertylist_get() is changed */
prop = cpl_propertylist_get((cpl_propertylist *) pl, i);
check(sinfo_print_cpl_property(prop), "Error printing property");
}
cleanup: return cpl_error_get_code();
}
/*----------------------------------------------------------------*/
/**
* @brief Print a frame set
* @param frames Frame set to print
* @return CPL_ERROR_NONE iff OK.
*
* This function prints all frames in a CPL frame set.
* TODO: not used
*/
/*----------------------------------------------------------------*/
cpl_error_code
sinfo_print_cpl_frameset(const cpl_frameset *frames)
{
/* Two special cases: a NULL frame set and an empty frame set */
if (frames == NULL ) {
sinfo_msg("NULL");
}
else {
cpl_frameset_iterator* it = cpl_frameset_iterator_new(frames);
const cpl_frame *f = cpl_frameset_iterator_get_const(it);
if (f == NULL ) {
sinfo_msg("[Empty frame set]");
}
else {
while (f != NULL ) {
check(sinfo_print_cpl_frame(f), "Could not print frame");
cpl_frameset_iterator_advance(it, 1);
f = cpl_frameset_iterator_get_const(it);
}
}
cpl_frameset_iterator_delete(it);
}
cleanup: return cpl_error_get_code();
}
/**@}*/
......@@ -22,24 +22,7 @@
* $Date: 2011-11-23 17:29:09 $
* $Revision: 1.6 $
* $Name: not supported by cvs2svn $
* $Log: not supported by cvs2svn $
* Revision 1.5 2006/10/25 06:46:09 amodigli
* fixed warnings from static checks
*