43#define MODULE_ID "XSH_PAF_SAVE"
58static void with_dots(
char *to,
const char *from,
char *filename )
62 k = sprintf( to,
"grep --quiet '" ) ;
65 if ( strncmp( from,
"ESO ", 4 ) == 0 )
68 for( ; *from !=
'\0' ; from++, to++ )
69 if ( *from ==
' ' ) *to =
'.' ;
74 strcat( to, filename ) ;
79 cpl_propertylist *qc = NULL;
80 char * filename = NULL;
90 const char *
const rrrecipe =
"xsh_mbias";
91 const char * pro_catg = NULL ;
97 pro_catg =
"MASTER_BIAS_UVB" ;
105 == CPL_ERROR_NULL_INPUT, CPL_ERROR_ILLEGAL_OUTPUT,
106 "Failed to fail on NULL input");
109 qc = cpl_propertylist_new();
117 cpl_propertylist_append_int (qc, pqc->
kw_name, 0 ) ;
119 case CPL_TYPE_DOUBLE:
120 cpl_propertylist_append_double(qc, pqc->
kw_name, 1.0 ) ;
123 cpl_propertylist_append_char(qc, pqc->
kw_name,
'x' ) ;
126 cpl_propertylist_append_float(qc, pqc->
kw_name, 0.1 ) ;
128 case CPL_TYPE_STRING:
129 cpl_propertylist_append_string(qc, pqc->
kw_name,
"ABCDEF" ) ;
132 xsh_msg(
"Other Types not handled" ) ;
142 == CPL_ERROR_NONE, cpl_error_get_code(),
143 "PAF file creation failed");
149 memset( cmd, 0, 128 ) ;
151 assure( system( cmd ) == 0, CPL_ERROR_ILLEGAL_INPUT,
152 "QC parameter '%s' NOT in PAF",
164 if (cpl_error_get_code() != CPL_ERROR_NONE) {
#define assure(CONDITION, ERROR_CODE,...)
#define xsh_error_dump(level)
#define xsh_error_reset()
void xsh_instrument_set_mode(xsh_instrument *i, XSH_MODE mode)
Set a mode on instrument structure.
void xsh_instrument_set_arm(xsh_instrument *i, XSH_ARM arm)
Set an arm on instrument structure.
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
xsh_instrument * xsh_instrument_new(void)
create new instrument structure
#define xsh_msg(...)
Print a message on info level.
cpl_error_code xsh_paf_save(const xsh_instrument *instrument, const char *recipe, const cpl_propertylist *paflist, const char *filename, const char *pro_catg)
Create a new PAF file.
qc_description * xsh_get_qc_desc_by_recipe(const char *recipe, qc_description *prev)
char * xsh_stringcat_any(const char *s,...)
Concatenate an arbitrary number of strings.
void xsh_free_propertylist(cpl_propertylist **p)
Deallocate a property list and set the pointer to NULL.
static void with_dots(char *to, const char *from, char *filename)
Unit tests of PAF saving.
#define TESTS_CLEAN_WORKSPACE(DRL_ID)
#define TESTS_INIT_WORKSPACE(DRL_ID)
#define TESTS_INIT(DRL_ID)
#define XSH_PAF_SAVE_EXTENSION