- various bug fixes and improvements
- modified automatic instrument detection on six and tecs client
This commit is contained in:
@ -7,7 +7,6 @@ set destlist=( type@osf1 \
|
||||
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/ \
|
||||
amor@amor:tecs/ focus@focus:tecs/ trics@trics:tecs/ \
|
||||
tasp@tasp:tecs/ dmc@dmc:tecs/ hrpt@hrpt:tecs/ \
|
||||
morpheus@morpheus:tecs/ sans@sans:tecs/ sans2@sans2:tecs/ \
|
||||
|
@ -11,8 +11,8 @@ static char *getItem(char *line, char *name, char *value, int value_len) {
|
||||
|
||||
snprintf(find, sizeof find, "%s=%s", name, value);
|
||||
found = strstr(line, find);
|
||||
if (found && *value != '\0' && found[strlen(find)] > ' ') {
|
||||
/* when value is given, it must be complete */
|
||||
if (found && *value != '\0' && found[strlen(find)] > ' ' && found[strlen(find)] != '.') {
|
||||
/* when value is given, it must be complete, (a dot or a space terminates the value) */
|
||||
found = NULL;
|
||||
}
|
||||
if (found) {
|
||||
@ -75,7 +75,7 @@ int InstrHost(char *service, char *input, char *instr, int instr_len,
|
||||
crit = "host";
|
||||
input = getenv("HOST");
|
||||
} else {
|
||||
crit="instr";
|
||||
crit = "instr";
|
||||
}
|
||||
finished = 0;
|
||||
while (NULL != fgets(line, sizeof line, fil)) {
|
||||
|
@ -30,7 +30,7 @@ all: libtecsl.a TecsServer TecsClient keep_running six
|
||||
|
||||
CFGDIR=/afs/psi.ch/project/sinq/common/lib/tecs/cfg/
|
||||
|
||||
#-include make_crv
|
||||
-include make_crv
|
||||
|
||||
make_crv: make_crv.tcsh inp/lsc.codes $(ALLINP)
|
||||
make_crv.tcsh inp/lsc.codes
|
||||
|
17
tecs/six.c
17
tecs/six.c
@ -674,9 +674,20 @@ int main (int argc, char *argv[]) {
|
||||
, host, sizeof host, &port);
|
||||
ent = gethostbyname(host);
|
||||
if (!ent) {
|
||||
PutC("unknown host: ");
|
||||
PutC(host);
|
||||
PutC("\n");
|
||||
if (hostArg == NULL || hostArg[0] <= ' ') {
|
||||
snprintf(host, sizeof host, "%s", getenv("HOST"));
|
||||
hostArg = host;
|
||||
}
|
||||
PutC(service);
|
||||
PutC(" on ");
|
||||
PutC(hostArg);
|
||||
PutC(" not found in InstrumentHostList\n");
|
||||
p=getenv("InstrumentHostList");
|
||||
if (p) {
|
||||
PutC("(");
|
||||
PutC(p);
|
||||
PutC(")\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
snprintf(host, sizeof host, "%s", ent->h_name);
|
||||
|
13
tecs/tecs.c
13
tecs/tecs.c
@ -134,6 +134,7 @@ static float
|
||||
fbuf, /* float buffer */
|
||||
r1, r2, /* temporary values */
|
||||
still=0,
|
||||
linearPower=0, /* normally 0. Maximum power when loop=2 and the power linear to the output */
|
||||
mout,
|
||||
tInt=0; /* integral time (sec.) for setpoint shift */
|
||||
|
||||
@ -604,6 +605,7 @@ again:
|
||||
slope=0;
|
||||
ramp=0;
|
||||
controlMode=0;
|
||||
linearPower=0;
|
||||
powFact=1;
|
||||
config[0]='\0';
|
||||
lscfg[0]='\0';
|
||||
@ -1131,11 +1133,18 @@ int ReadTemp(void) {
|
||||
|
||||
float Percent2Power(float percent) {
|
||||
float curr;
|
||||
|
||||
if (linearPower != 0) {
|
||||
return percent/100*linearPower;
|
||||
}
|
||||
curr=maxCurrent*percent/100;
|
||||
return curr*curr*resist*powFact;
|
||||
}
|
||||
|
||||
float Power2Percent(float power) {
|
||||
if (linearPower != 0) {
|
||||
return power/linearPower*100;
|
||||
}
|
||||
return sqrt(power/powFact/resist)/maxCurrent*100;
|
||||
}
|
||||
|
||||
@ -1490,6 +1499,9 @@ int SetMaxPower(void) {
|
||||
pold=limCurrent*limCurrent*resist;
|
||||
}
|
||||
CalcMaxPower();
|
||||
} else if (linearPower != 0) {
|
||||
maxCurrent = 1;
|
||||
maxPowerFlt = linearPower;
|
||||
} else {
|
||||
maxCurrent=10/resist; /* 10 V max. */
|
||||
if (maxCurrent>0.1) {
|
||||
@ -2925,6 +2937,7 @@ int main(int argc, char *argv[]) {
|
||||
CocDefFlt(r2, RD);
|
||||
CocDefFlt(tShift, RW);
|
||||
CocDefFlt(tInt, RW);
|
||||
CocDefFlt(linearPower, RW);
|
||||
|
||||
CocDefPtr(clData, ClientData);
|
||||
CocStrFld(ClientData, cmd, RW); CocHdl(SendHdl);
|
||||
|
Reference in New Issue
Block a user