diff --git a/tecs/tecs.c b/tecs/tecs.c index 71ed28c1..94756901 100644 --- a/tecs/tecs.c +++ b/tecs/tecs.c @@ -586,13 +586,15 @@ int PeriodicTask(void) { str_copy(cryo.device, buf1+1); cryo.manual=1; } else { - str_copy(cryo.device, buf1); + if (cryo.code!=0) str_copy(cryo.device, buf1); + cryo.manual=0; } if (buf2[0]=='*') { str_copy(samp.device, buf2+1); samp.manual=1; } else { - str_copy(samp.device, buf2); + if (samp.code!=0) str_copy(samp.device, buf2); + samp.manual=0; } concatDevice(); if (cryo.manual || cryo.code!=0) { cryo.dirty=1; } @@ -860,8 +862,8 @@ int ExecuteRequest(void) { t=strchr(device, '/'); if (t==NULL) { if (0==strcmp(device, "0") || 0==strcasecmp(device, "auto")) { - cryo.manual=0; cryo.dirty=1; - samp.manual=0; samp.dirty=1; + cryo.manual=0; cryo.dirty=1; cryo.device[0]='\0'; + samp.manual=0; samp.dirty=1; samp.device[0]='\0'; } else { str_copy(cryo.device, device); str_copy(samp.device, device);