From fc12b6b1c18756d50fd1f2c42e168874f734e951 Mon Sep 17 00:00:00 2001 From: zolliker Date: Thu, 3 Mar 2005 14:14:05 +0000 Subject: [PATCH] small updates --- tecs/didi | 3 ++- tecs/inp/lsc.codes | 6 ++++-- tecs/instr_hosts.c | 16 ++++++++-------- tecs/make_gen | 4 ++-- tecs/make_list.tcsh | 2 +- tecs/six.c | 8 +++++++- tecs/term.c | 24 ++++++++++++++---------- 7 files changed, 38 insertions(+), 25 deletions(-) diff --git a/tecs/didi b/tecs/didi index fa212fc..6507b4d 100755 --- a/tecs/didi +++ b/tecs/didi @@ -7,8 +7,9 @@ set destlist=( type@osf1 \ AMOR@amor:tecs/ FOCUS@focus:tecs/ TRICS@trics:tecs/ \ alpha=/afs/psi.ch/project/sinq/tru64/stow/tecs/bin/ \ type@linux \ +slinux=/afs/psi.ch/project/sinq/sl-linux/stow/tecs/bin/ \ linux=/afs/psi.ch/project/sinq/linux/stow/tecs/bin/ \ -TASP@tasp:tecs/ DMC@dmc:tecs/ HRPT@hrpt:tecs/ \ +TASP@tasp:tecs/ dmc@dmc:tecs/ HRPT@hrpt:tecs/ \ MORPHEUS@morpheus:tecs/ SANS@sans:tecs/ SANS2@sans2:tecs/ \ type@darwin \ macosx=/afs/psi.ch/project/sinq/mac_os/stow/tecs/bin/ \ diff --git a/tecs/inp/lsc.codes b/tecs/inp/lsc.codes index fb40d20..e665dd3 100644 --- a/tecs/inp/lsc.codes +++ b/tecs/inp/lsc.codes @@ -15,6 +15,7 @@ cti6 11 apd 12 apdl -9 ccr4k 13 +dil -18 ccr2 28 -28 hef4c 14 -11 sup4t 15 60 @@ -23,6 +24,7 @@ dise 26 -26 ori1 29 -29 ori2 25 -25 ori3 22 -22 -ma11 27 +ma11_test -27 ma02 23 -23 -ma15 24 +ma15 24 +disc 30 diff --git a/tecs/instr_hosts.c b/tecs/instr_hosts.c index 3e4e231..81bc539 100644 --- a/tecs/instr_hosts.c +++ b/tecs/instr_hosts.c @@ -8,15 +8,15 @@ typedef struct { char *instr; char *host; int port; char *user; int cod; } Instrument; static Instrument list[]={ - { "DMC", "pc4629.psi.ch", 9753, "DMC" , 1}, - { "MORPHEUS", "pc4120.psi.ch", 9753, "MORPHEUS" , 1}, - { "SANS", "pc3965.psi.ch", 9753, "SANS" , 1}, + { "DMC", "pc4629.psi.ch", 9753, "dmc" , 1}, + { "MORPHEUS", "pc4120.psi.ch", 9753, "morpheus" , 1}, + { "SANS", "pc4122.psi.ch", 9753, "sans" , 1}, { "SANS2", "sans2.psi.ch", 9753, "SANS2" , 1}, - { "HRPT", "pc4630.psi.ch", 9753, "HRPT" , 1}, - { "TRICS", "lnsa18.psi.ch", 9753, "TRICS" , 1}, - { "AMOR", "lnsa14.psi.ch", 9753, "AMOR" , 1}, - { "FOCUS", "lnsa16.psi.ch", 9753, "FOCUS" , 1}, - { "TASP", "pc4478.psi.ch", 9753, "TASP", 1}, + { "HRPT", "pc4630.psi.ch", 9753, "hrpt" , 1}, + { "TRICS", "trics.psi.ch", 9753, "trics" , 1}, + { "AMOR", "amor.psi.ch", 9753, "amor" , 1}, + { "FOCUS", "focus.psi.ch", 9753, "focus" , 1}, + { "TASP", "pc4478.psi.ch", 9753, "tasp", 1}, { "RITA", "pc4345.psi.ch", 9753, NULL , 0}, { "PREP", "lns1se.psi.ch", 9753, "admin" , 0}, { "AREA", "lns1se.psi.ch", 9751, "admin" , 0}, diff --git a/tecs/make_gen b/tecs/make_gen index b172806..963dbdb 100644 --- a/tecs/make_gen +++ b/tecs/make_gen @@ -33,8 +33,8 @@ all: libtecsl.a TecsServer TecsClient keep_running six CFGDIR=/afs/psi.ch/project/sinq/common/lib/tecs/cfg/ -#-include make_crv -#-include src/make_crv +-include make_crv +-include src/make_crv $(SRC)make_crv: make_crv.tcsh inp/lsc.codes $(ALLINP) $(SRC)make_crv.tcsh $(SRC)inp/lsc.codes diff --git a/tecs/make_list.tcsh b/tecs/make_list.tcsh index c1b23e7..afd984d 100755 --- a/tecs/make_list.tcsh +++ b/tecs/make_list.tcsh @@ -3,7 +3,7 @@ printf "\n\n" foreach file ($*) set nam=${file:t:s/.cfg//} set def="`grep "dev=" $file`" - alias def "set$def" + alias def "set $def" if ("$def" != "") then def printf "%-10s %s\n" $nam "$dev" diff --git a/tecs/six.c b/tecs/six.c index 8a63682..9059388 100644 --- a/tecs/six.c +++ b/tecs/six.c @@ -169,7 +169,13 @@ char* readWrite(int fd, int tmo, int skip, char *find) { n+=strlen(msg); } else { term_clear(); - fputs(msg, stdout); + if (strncmp(msg, "ERROR:", 6)==0) { + fputs("\033[1;31m", stdout); + fputs(msg, stdout); + fputs("\033[0m", stdout); + } else { + fputs(msg, stdout); + } if (chr=='\n') fputs("\n", stdout); } if (go) break; diff --git a/tecs/term.c b/tecs/term.c index 854c40f..c976a1e 100644 --- a/tecs/term.c +++ b/tecs/term.c @@ -252,7 +252,7 @@ static int dirty=0; /* line is to be cleared through a call of term_clear */ void term_clear(void) { if (dirty) { - fputs("\r\033[K", stdout); + fputs("\r\033[K\033[0m", stdout); dirty=0; } } @@ -267,8 +267,11 @@ int term_get_line(char *buf, int size, int *pos, char *prompt, fd_set *mask) { char key, *lin; int i,j,l,iret,buflen; char tmp[512]; - static int init=1; + static char back[128]=""; + if (back[0] == '\0') { + memset(back, '\b', sizeof back); + } buf[size-1]='\0'; /* make sure buf is null terminated */ l=strlen(buf); if (*pos>l) { @@ -279,17 +282,20 @@ int term_get_line(char *buf, int size, int *pos, char *prompt, fd_set *mask) { iret=term_get_key(&key, 0); while (1) { if (iret==-1 || key == RET_CHAR || key==EVT_CHAR) { /* refresh after a short timeout */ + snprintf(tmp, sizeof tmp, "%s%s%s%s%s%.*s", + "\r\033[1m", prompt, "\033[34m", buf, "\033[K\033[0m", l - *pos, back); +/* assert(l*2+20+strlen(prompt)*pos; i--) { tmp[j]='\b'; j++; } tmp[j]='\0'; +*/ fputs(tmp, stdout); if (iret==-1) { iret=term_get_key(&key, -1); /* no timeout */ @@ -318,11 +324,9 @@ int term_get_line(char *buf, int size, int *pos, char *prompt, fd_set *mask) { } hist_pos=hist_end; term_save_hist(0); - printf("\r\033[K\n"); - for (i = strlen(prompt) - 1; i > 0; i--) { - printf("-"); - } - printf(" %s", buf); + printf("\r\033[K\n\033[1;34m"); + printf("%s", buf); + printf("\033[0m"); return(STDIN_FILENO); /* normal EXIT */