From 17c7a98858f2ad566f46294c926bf3c56eeb4eab Mon Sep 17 00:00:00 2001 From: picca Date: Fri, 23 Jan 2015 10:06:30 +0100 Subject: [PATCH] [hkl] factorize the psi_parameters for the psi engine. during thie refactoring I renamed the parameters so they match the psi_constant_xxx mode of the hkl engine. It will be easier to understand the these parameters are equivalent. --- hkl/hkl-engine-e4c.c | 8 ++------ hkl/hkl-engine-e6c.c | 8 ++------ hkl/hkl-engine-k4c.c | 8 ++------ hkl/hkl-engine-k6c.c | 16 ++++------------ hkl/hkl-engine-template.c | 8 ++------ hkl/hkl-pseudoaxis-common-psi-private.h | 18 ++++++++++++++++++ 6 files changed, 30 insertions(+), 36 deletions(-) diff --git a/hkl/hkl-engine-e4c.c b/hkl/hkl-engine-e4c.c index 7a03d330..8541c569 100644 --- a/hkl/hkl-engine-e4c.c +++ b/hkl/hkl-engine-e4c.c @@ -156,13 +156,9 @@ static HklMode *psi(void) { static const char *axes[] = {"omega", "chi", "phi", "tth"}; static const HklFunction *functions[] = {&psi_func}; - static const HklParameter parameters[] = { - {HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,}, - }; static const HklModeAutoInfo info = { - HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes, functions, parameters), + HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes, + functions, psi_parameters), }; return hkl_mode_psi_new(&info); diff --git a/hkl/hkl-engine-e6c.c b/hkl/hkl-engine-e6c.c index c4a65ae4..529ed471 100644 --- a/hkl/hkl-engine-e6c.c +++ b/hkl/hkl-engine-e6c.c @@ -302,13 +302,9 @@ static HklMode* psi_vertical() static const char *axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"}; static const char *axes_w[] = {"omega", "chi", "phi", "delta"}; static const HklFunction *functions[] = {&psi_func}; - static const HklParameter parameters[] = { - {HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,}, - }; static const HklModeAutoInfo info = { - HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w, functions, parameters), + HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w, + functions, psi_parameters), }; return hkl_mode_psi_new(&info); diff --git a/hkl/hkl-engine-k4c.c b/hkl/hkl-engine-k4c.c index d0419df8..cb19e35c 100644 --- a/hkl/hkl-engine-k4c.c +++ b/hkl/hkl-engine-k4c.c @@ -363,13 +363,9 @@ static HklMode *psi() { static const char *axes[] = {"komega", "kappa", "kphi", "tth"}; static const HklFunction *functions[] = {&psi_func}; - static const HklParameter parameters[] = { - {HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,}, - }; static const HklModeAutoInfo info = { - HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes, functions, parameters), + HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes, + functions, psi_parameters), }; return hkl_mode_psi_new(&info); diff --git a/hkl/hkl-engine-k6c.c b/hkl/hkl-engine-k6c.c index c266581e..bcda99fb 100644 --- a/hkl/hkl-engine-k6c.c +++ b/hkl/hkl-engine-k6c.c @@ -878,13 +878,9 @@ static HklMode *psi_vertical() static const char *axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"}; static const char *axes_w[] = {"komega", "kappa", "kphi", "delta"}; static const HklFunction *functions[] = {&psi_func}; - static const HklParameter parameters[] = { - {HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,}, - }; static const HklModeAutoInfo info = { - HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w, functions, parameters), + HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w, + functions, psi_parameters), }; return hkl_mode_psi_new(&info); @@ -913,13 +909,9 @@ static HklMode *psi_vertical_soleil_sirius_kappa() static const char *axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"}; static const char *axes_w[] = {"komega", "kappa", "kphi", "gamma"}; static const HklFunction *functions[] = {&psi_func}; - static const HklParameter parameters[] = { - {HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,}, - }; static const HklModeAutoInfo info = { - HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w, functions, parameters), + HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w, + functions, psi_parameters), }; return hkl_mode_psi_new(&info); diff --git a/hkl/hkl-engine-template.c b/hkl/hkl-engine-template.c index eeeb979a..06d44d4f 100644 --- a/hkl/hkl-engine-template.c +++ b/hkl/hkl-engine-template.c @@ -161,13 +161,9 @@ static HklMode* psi_vertical() static const char *axes_r[] = {MU, OMEGA, CHI, PHI, GAMMA, DELTA}; static const char *axes_w[] = {OMEGA, CHI, PHI, DELTA}; static const HklFunction *functions[] = {&psi_func}; - static const HklParameter parameters[] = { - {HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,}, - {HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,}, - }; static const HklModeAutoInfo info = { - HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w, functions, parameters), + HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w, + functions, psi_parameters), }; return hkl_mode_psi_new(&info); diff --git a/hkl/hkl-pseudoaxis-common-psi-private.h b/hkl/hkl-pseudoaxis-common-psi-private.h index f23f5173..48c9712a 100644 --- a/hkl/hkl-pseudoaxis-common-psi-private.h +++ b/hkl/hkl-pseudoaxis-common-psi-private.h @@ -58,6 +58,24 @@ static const HklFunction psi_func = { .size = 4, }; +static const HklParameter psi_parameters[] = { + { + HKL_PARAMETER_DEFAULTS, .name = "h2", ._value = 1, + .description = "h coordinate of the reference plan", + .range = { .min=-1, .max=1 }, + }, + { + HKL_PARAMETER_DEFAULTS, .name = "k2", ._value = 1, + .description = "k coordinate of the reference plan", + .range = { .min=-1, .max=1 }, + }, + { + HKL_PARAMETER_DEFAULTS, .name = "l2", ._value = 1, + .description = "l coordinate of the reference plan", + .range = { .min=-1, .max=1 }, + }, +}; + G_END_DECLS #endif /* __HKL_PSEUDOAXIS_COMMON_PSI_PRIVATE_H__ */ -- 2.11.4.GIT