From dc266a1c92a2376887635a2a7ecb4ee7c54737bb Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Tue, 2 Oct 2007 12:41:34 +1000 Subject: [PATCH] convert 'send' arguments to upper case and substitute '%' and '`' with axis_label r2169 | dcl | 2007-10-02 12:41:34 +1000 (Tue, 02 Oct 2007) | 2 lines --- site_ansto/motor_dmc2280.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/site_ansto/motor_dmc2280.c b/site_ansto/motor_dmc2280.c index 4685cb26..5c15d392 100644 --- a/site_ansto/motor_dmc2280.c +++ b/site_ansto/motor_dmc2280.c @@ -1,4 +1,3 @@ -#define POSIT_SHIM /** \file motor_dmc2280.c * \brief Driver for Galil DMC2280 motor controller. * @@ -3224,14 +3223,21 @@ int DMC2280Action(SConnection *pCon, SicsInterp *pSics, void *pData, char cmd[CMDLEN]; char rsp[CMDLEN]; int idx = 0; - int i, j; + int i; cmd[0] = '\0'; for (i = 2; i < argc; ++i) { + int j, k; j = snprintf(&cmd[idx], CMDLEN - idx, "%s%s", (i > 2) ? " " : "", argv[i]); if (j < 0) break; + for ( k = 0; k < j && cmd[idx + k]; ++k) { + if (cmd[idx + k] == '%' || cmd[idx + k] == '`') + cmd[idx + k] = self->axisLabel; + if (islower(cmd[idx + k])) + cmd[idx + k] = toupper(cmd[idx + k]); + } idx += j; } DMC2280SendReceive(self, cmd, rsp);