20061106-1 RFE critical V1 $Id: 20061213-1_improve_set_parameter.txt,v 1.1 2006/12/13 08:52:10 michel Exp $ Summary ------- Reform of lpw_set_parameter() We should had a keyword fixed= to prevent misunderstanding and remove keyword "flags". "flags" key should be handled internally by lpw_set_parameter(). functions lpw_is_pameter_fixed(), etc. should allows us to know the status of each flag. How to replicate the bug ------------------------ This is inconsistent in this API. All the flags are risen by a specific keyword (scale, vmin, vmax). The only exeption is for status fixed. But a keyword fixed exists in the modeling files. > lpw_set_parameter, world, "x2", flags=LPW_FLAGS_FIXED Actually this means that we rise LPW_FLAGS_FIXED without changing the other signals stored in key "flags". This flag does not appear in help. But: > lpw_set_parameter, world, "x2", flags=LPW_FLAGS_VMIN remove risen flag LPW_FLAGS_FIXED ! We should not make flags= available in lpw_set_parameter. A better thing to do should be: > lpw_set_parameter, world, "x2", fixed=TRUE > lpw_set_parameter, world, "x2", fixed=NONE > lpw_set_parameter, world, "x2", fixed=FALSE > lpw_set_parameter, world, "x2", fixed=1 > lpw_set_parameter, world, "x2", fixed=0 For testing flags, we have to do: > flags = lpw_get_parameter(world, "x2").flags > if (flags & LPW_FLAGS_FIXED) { ... } This should be still possible. But we could add this way: > if (lpw_is_parameter_fixed(world, "x2"))Ê{...} Discussion ---------- HISTORY ------- $Log: 20061213-1_improve_set_parameter.txt,v $ Revision 1.1 2006/12/13 08:52:10 michel - new critical RFE. Revision 1.1 2006/12/06 14:43:59 michel - Attempt to somehow track the bugs.