- 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/ \
|
alpha=/afs/psi.ch/project/sinq/tru64/stow/tecs/bin/ \
|
||||||
type@linux \
|
type@linux \
|
||||||
slinux=/afs/psi.ch/project/sinq/sl-linux/stow/tecs/bin/ \
|
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/ \
|
amor@amor:tecs/ focus@focus:tecs/ trics@trics:tecs/ \
|
||||||
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/ \
|
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);
|
snprintf(find, sizeof find, "%s=%s", name, value);
|
||||||
found = strstr(line, find);
|
found = strstr(line, find);
|
||||||
if (found && *value != '\0' && found[strlen(find)] > ' ') {
|
if (found && *value != '\0' && found[strlen(find)] > ' ' && found[strlen(find)] != '.') {
|
||||||
/* when value is given, it must be complete */
|
/* when value is given, it must be complete, (a dot or a space terminates the value) */
|
||||||
found = NULL;
|
found = NULL;
|
||||||
}
|
}
|
||||||
if (found) {
|
if (found) {
|
||||||
@ -75,7 +75,7 @@ int InstrHost(char *service, char *input, char *instr, int instr_len,
|
|||||||
crit = "host";
|
crit = "host";
|
||||||
input = getenv("HOST");
|
input = getenv("HOST");
|
||||||
} else {
|
} else {
|
||||||
crit="instr";
|
crit = "instr";
|
||||||
}
|
}
|
||||||
finished = 0;
|
finished = 0;
|
||||||
while (NULL != fgets(line, sizeof line, fil)) {
|
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/
|
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: make_crv.tcsh inp/lsc.codes $(ALLINP)
|
||||||
make_crv.tcsh inp/lsc.codes
|
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);
|
, host, sizeof host, &port);
|
||||||
ent = gethostbyname(host);
|
ent = gethostbyname(host);
|
||||||
if (!ent) {
|
if (!ent) {
|
||||||
PutC("unknown host: ");
|
if (hostArg == NULL || hostArg[0] <= ' ') {
|
||||||
PutC(host);
|
snprintf(host, sizeof host, "%s", getenv("HOST"));
|
||||||
PutC("\n");
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
snprintf(host, sizeof host, "%s", ent->h_name);
|
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 */
|
fbuf, /* float buffer */
|
||||||
r1, r2, /* temporary values */
|
r1, r2, /* temporary values */
|
||||||
still=0,
|
still=0,
|
||||||
|
linearPower=0, /* normally 0. Maximum power when loop=2 and the power linear to the output */
|
||||||
mout,
|
mout,
|
||||||
tInt=0; /* integral time (sec.) for setpoint shift */
|
tInt=0; /* integral time (sec.) for setpoint shift */
|
||||||
|
|
||||||
@ -604,6 +605,7 @@ again:
|
|||||||
slope=0;
|
slope=0;
|
||||||
ramp=0;
|
ramp=0;
|
||||||
controlMode=0;
|
controlMode=0;
|
||||||
|
linearPower=0;
|
||||||
powFact=1;
|
powFact=1;
|
||||||
config[0]='\0';
|
config[0]='\0';
|
||||||
lscfg[0]='\0';
|
lscfg[0]='\0';
|
||||||
@ -1131,11 +1133,18 @@ int ReadTemp(void) {
|
|||||||
|
|
||||||
float Percent2Power(float percent) {
|
float Percent2Power(float percent) {
|
||||||
float curr;
|
float curr;
|
||||||
|
|
||||||
|
if (linearPower != 0) {
|
||||||
|
return percent/100*linearPower;
|
||||||
|
}
|
||||||
curr=maxCurrent*percent/100;
|
curr=maxCurrent*percent/100;
|
||||||
return curr*curr*resist*powFact;
|
return curr*curr*resist*powFact;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Power2Percent(float power) {
|
float Power2Percent(float power) {
|
||||||
|
if (linearPower != 0) {
|
||||||
|
return power/linearPower*100;
|
||||||
|
}
|
||||||
return sqrt(power/powFact/resist)/maxCurrent*100;
|
return sqrt(power/powFact/resist)/maxCurrent*100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1490,6 +1499,9 @@ int SetMaxPower(void) {
|
|||||||
pold=limCurrent*limCurrent*resist;
|
pold=limCurrent*limCurrent*resist;
|
||||||
}
|
}
|
||||||
CalcMaxPower();
|
CalcMaxPower();
|
||||||
|
} else if (linearPower != 0) {
|
||||||
|
maxCurrent = 1;
|
||||||
|
maxPowerFlt = linearPower;
|
||||||
} else {
|
} else {
|
||||||
maxCurrent=10/resist; /* 10 V max. */
|
maxCurrent=10/resist; /* 10 V max. */
|
||||||
if (maxCurrent>0.1) {
|
if (maxCurrent>0.1) {
|
||||||
@ -2925,6 +2937,7 @@ int main(int argc, char *argv[]) {
|
|||||||
CocDefFlt(r2, RD);
|
CocDefFlt(r2, RD);
|
||||||
CocDefFlt(tShift, RW);
|
CocDefFlt(tShift, RW);
|
||||||
CocDefFlt(tInt, RW);
|
CocDefFlt(tInt, RW);
|
||||||
|
CocDefFlt(linearPower, RW);
|
||||||
|
|
||||||
CocDefPtr(clData, ClientData);
|
CocDefPtr(clData, ClientData);
|
||||||
CocStrFld(ClientData, cmd, RW); CocHdl(SendHdl);
|
CocStrFld(ClientData, cmd, RW); CocHdl(SendHdl);
|
||||||
|
Reference in New Issue
Block a user