small updates

This commit is contained in:
zolliker
2005-03-03 14:14:05 +00:00
parent 0677ecfbe7
commit fc12b6b1c1
7 changed files with 38 additions and 25 deletions

View File

@ -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/ \

View File

@ -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

View File

@ -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},

View File

@ -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

View File

@ -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"

View File

@ -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;

View File

@ -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)<sizeof(tmp));
tmp[0]='\r';
tmp[1]='\0';
strcpy(tmp,"\r\033[1;34m");
strcat(tmp, prompt);
strcat(tmp, buf);
strcat(tmp,"\033[K");
strcat(tmp,"\033[K\033[0m");
j=strlen(tmp);
for (i=l; i>*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 */