- various enhancements in tecs and six
This commit is contained in:
@ -384,7 +384,7 @@ int CocPushThisHandler(CocVar *var, CocClient *cl, void *base, int mode) {
|
|||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (mode==COC_DWR) {
|
if (mode==COC_DWR) {
|
||||||
if (var->pending) return(0);
|
if (var->pending && cl->npend != 0) return(0);
|
||||||
var->pending=1;
|
var->pending=1;
|
||||||
}
|
}
|
||||||
n=cl->npend;
|
n=cl->npend;
|
||||||
|
@ -56,6 +56,9 @@ $(CFGDIR)ccs130.crv: ccrv inp/ccs130.inp
|
|||||||
$(CFGDIR)c_ill.crv: ccrv inp/c_ill.inp
|
$(CFGDIR)c_ill.crv: ccrv inp/c_ill.inp
|
||||||
$Q -p$(CFGDIR)
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
|
$(CFGDIR)cma02.crv: ccrv inp/cma02.inp
|
||||||
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
$(CFGDIR)cma11.crv: ccrv inp/cma11.inp
|
$(CFGDIR)cma11.crv: ccrv inp/cma11.inp
|
||||||
$Q -p$(CFGDIR)
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
@ -71,6 +74,9 @@ $(CFGDIR)cma11r3lc.crv: ccrv inp/cma11r3lc.inp
|
|||||||
$(CFGDIR)cma11r4rc.crv: ccrv inp/cma11r4rc.inp
|
$(CFGDIR)cma11r4rc.crv: ccrv inp/cma11r4rc.inp
|
||||||
$Q -p$(CFGDIR)
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
|
$(CFGDIR)cma6.crv: ccrv inp/cma6.inp
|
||||||
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
$(CFGDIR)cplus45.crv: ccrv inp/cplus45.inp
|
$(CFGDIR)cplus45.crv: ccrv inp/cplus45.inp
|
||||||
$Q -p$(CFGDIR)
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
@ -110,6 +116,15 @@ $(CFGDIR)g26552.crv: ccrv inp/g26552.inp
|
|||||||
$(CFGDIR)gemark.crv: ccrv inp/gemark.inp
|
$(CFGDIR)gemark.crv: ccrv inp/gemark.inp
|
||||||
$Q -p$(CFGDIR)
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
|
$(CFGDIR)ln2a.crv: ccrv inp/ln2a.inp
|
||||||
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
|
$(CFGDIR)ln2b.crv: ccrv inp/ln2b.inp
|
||||||
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
|
$(CFGDIR)ln2.crv: ccrv inp/ln2.inp
|
||||||
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
$(CFGDIR)mz020124.crv: ccrv inp/mz020124.inp
|
$(CFGDIR)mz020124.crv: ccrv inp/mz020124.inp
|
||||||
$Q -p$(CFGDIR)
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
@ -329,6 +344,9 @@ $(CFGDIR)x38622.crv: ccrv inp/x38622.inp
|
|||||||
$(CFGDIR)x40188.crv: ccrv inp/x40188.inp
|
$(CFGDIR)x40188.crv: ccrv inp/x40188.inp
|
||||||
$Q -p$(CFGDIR)
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
|
$(CFGDIR)x48581.crv: ccrv inp/x48581.inp
|
||||||
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
$(CFGDIR)x50830.crv: ccrv inp/x50830.inp
|
$(CFGDIR)x50830.crv: ccrv inp/x50830.inp
|
||||||
$Q -p$(CFGDIR)
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
@ -341,6 +359,9 @@ $(CFGDIR)x50921.crv: ccrv inp/x50921.inp
|
|||||||
$(CFGDIR)x50923.crv: ccrv inp/x50923.inp
|
$(CFGDIR)x50923.crv: ccrv inp/x50923.inp
|
||||||
$Q -p$(CFGDIR)
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
|
$(CFGDIR)x50991.crv: ccrv inp/x50991.inp
|
||||||
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
$(CFGDIR)x51079.crv: ccrv inp/x51079.inp
|
$(CFGDIR)x51079.crv: ccrv inp/x51079.inp
|
||||||
$Q -p$(CFGDIR)
|
$Q -p$(CFGDIR)
|
||||||
|
|
||||||
@ -367,11 +388,13 @@ all_crv: dev.list \
|
|||||||
$(CFGDIR)c_ab.crv \
|
$(CFGDIR)c_ab.crv \
|
||||||
$(CFGDIR)ccs130.crv \
|
$(CFGDIR)ccs130.crv \
|
||||||
$(CFGDIR)c_ill.crv \
|
$(CFGDIR)c_ill.crv \
|
||||||
|
$(CFGDIR)cma02.crv \
|
||||||
$(CFGDIR)cma11.crv \
|
$(CFGDIR)cma11.crv \
|
||||||
$(CFGDIR)cma11r1al.crv \
|
$(CFGDIR)cma11r1al.crv \
|
||||||
$(CFGDIR)cma11r2ol.crv \
|
$(CFGDIR)cma11r2ol.crv \
|
||||||
$(CFGDIR)cma11r3lc.crv \
|
$(CFGDIR)cma11r3lc.crv \
|
||||||
$(CFGDIR)cma11r4rc.crv \
|
$(CFGDIR)cma11r4rc.crv \
|
||||||
|
$(CFGDIR)cma6.crv \
|
||||||
$(CFGDIR)cplus45.crv \
|
$(CFGDIR)cplus45.crv \
|
||||||
$(CFGDIR)cplus70.crv \
|
$(CFGDIR)cplus70.crv \
|
||||||
$(CFGDIR)cs405.crv \
|
$(CFGDIR)cs405.crv \
|
||||||
@ -385,6 +408,9 @@ all_crv: dev.list \
|
|||||||
$(CFGDIR)g26550.crv \
|
$(CFGDIR)g26550.crv \
|
||||||
$(CFGDIR)g26552.crv \
|
$(CFGDIR)g26552.crv \
|
||||||
$(CFGDIR)gemark.crv \
|
$(CFGDIR)gemark.crv \
|
||||||
|
$(CFGDIR)ln2a.crv \
|
||||||
|
$(CFGDIR)ln2b.crv \
|
||||||
|
$(CFGDIR)ln2.crv \
|
||||||
$(CFGDIR)mz020124.crv \
|
$(CFGDIR)mz020124.crv \
|
||||||
$(CFGDIR)mz030500.crv \
|
$(CFGDIR)mz030500.crv \
|
||||||
$(CFGDIR)pcry.crv \
|
$(CFGDIR)pcry.crv \
|
||||||
@ -458,10 +484,12 @@ all_crv: dev.list \
|
|||||||
$(CFGDIR)x38604.crv \
|
$(CFGDIR)x38604.crv \
|
||||||
$(CFGDIR)x38622.crv \
|
$(CFGDIR)x38622.crv \
|
||||||
$(CFGDIR)x40188.crv \
|
$(CFGDIR)x40188.crv \
|
||||||
|
$(CFGDIR)x48581.crv \
|
||||||
$(CFGDIR)x50830.crv \
|
$(CFGDIR)x50830.crv \
|
||||||
$(CFGDIR)x50903.crv \
|
$(CFGDIR)x50903.crv \
|
||||||
$(CFGDIR)x50921.crv \
|
$(CFGDIR)x50921.crv \
|
||||||
$(CFGDIR)x50923.crv \
|
$(CFGDIR)x50923.crv \
|
||||||
|
$(CFGDIR)x50991.crv \
|
||||||
$(CFGDIR)x51079.crv \
|
$(CFGDIR)x51079.crv \
|
||||||
$(CFGDIR)z030114.crv \
|
$(CFGDIR)z030114.crv \
|
||||||
|
|
||||||
@ -485,11 +513,13 @@ inp/cab505.inp \
|
|||||||
inp/c_ab.inp \
|
inp/c_ab.inp \
|
||||||
inp/ccs130.inp \
|
inp/ccs130.inp \
|
||||||
inp/c_ill.inp \
|
inp/c_ill.inp \
|
||||||
|
inp/cma02.inp \
|
||||||
inp/cma11.inp \
|
inp/cma11.inp \
|
||||||
inp/cma11r1al.inp \
|
inp/cma11r1al.inp \
|
||||||
inp/cma11r2ol.inp \
|
inp/cma11r2ol.inp \
|
||||||
inp/cma11r3lc.inp \
|
inp/cma11r3lc.inp \
|
||||||
inp/cma11r4rc.inp \
|
inp/cma11r4rc.inp \
|
||||||
|
inp/cma6.inp \
|
||||||
inp/cplus45.inp \
|
inp/cplus45.inp \
|
||||||
inp/cplus70.inp \
|
inp/cplus70.inp \
|
||||||
inp/cs405.inp \
|
inp/cs405.inp \
|
||||||
@ -503,6 +533,9 @@ inp/g25550.inp \
|
|||||||
inp/g26550.inp \
|
inp/g26550.inp \
|
||||||
inp/g26552.inp \
|
inp/g26552.inp \
|
||||||
inp/gemark.inp \
|
inp/gemark.inp \
|
||||||
|
inp/ln2a.inp \
|
||||||
|
inp/ln2b.inp \
|
||||||
|
inp/ln2.inp \
|
||||||
inp/mz020124.inp \
|
inp/mz020124.inp \
|
||||||
inp/mz030500.inp \
|
inp/mz030500.inp \
|
||||||
inp/pcry.inp \
|
inp/pcry.inp \
|
||||||
@ -576,10 +609,12 @@ inp/x37346.inp \
|
|||||||
inp/x38604.inp \
|
inp/x38604.inp \
|
||||||
inp/x38622.inp \
|
inp/x38622.inp \
|
||||||
inp/x40188.inp \
|
inp/x40188.inp \
|
||||||
|
inp/x48581.inp \
|
||||||
inp/x50830.inp \
|
inp/x50830.inp \
|
||||||
inp/x50903.inp \
|
inp/x50903.inp \
|
||||||
inp/x50921.inp \
|
inp/x50921.inp \
|
||||||
inp/x50923.inp \
|
inp/x50923.inp \
|
||||||
|
inp/x50991.inp \
|
||||||
inp/x51079.inp \
|
inp/x51079.inp \
|
||||||
inp/z030114.inp \
|
inp/z030114.inp \
|
||||||
|
|
||||||
|
14
tecs/six.c
14
tecs/six.c
@ -605,6 +605,10 @@ int main (int argc, char *argv[]) {
|
|||||||
clcname="seacmd";
|
clcname="seacmd";
|
||||||
servername="sea";
|
servername="sea";
|
||||||
clclen=strlen(clcname);
|
clclen=strlen(clcname);
|
||||||
|
} else if (0==strcmp(argv[i], "-graph") || 0==strcmp(argv[i], "graph")) {
|
||||||
|
clcname="graphcmd";
|
||||||
|
servername="graph";
|
||||||
|
clclen=strlen(clcname);
|
||||||
} else if (0==strcmp(argv[i], "-a") || 0==strcmp(argv[i], "a")) {
|
} else if (0==strcmp(argv[i], "-a") || 0==strcmp(argv[i], "a")) {
|
||||||
remember=0;
|
remember=0;
|
||||||
} else if (0==strcmp(argv[i], "-c") || 0==strcmp(argv[i], "c")) {
|
} else if (0==strcmp(argv[i], "-c") || 0==strcmp(argv[i], "c")) {
|
||||||
@ -705,7 +709,7 @@ int main (int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
home = 1;
|
home = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (strcmp(clcname, "seacmd") == 0) {
|
||||||
PutC("seacmd, a sea commandline client (doc: seacmd help)\n");
|
PutC("seacmd, a sea commandline client (doc: seacmd help)\n");
|
||||||
if (port == -1) {
|
if (port == -1) {
|
||||||
port = 8641;
|
port = 8641;
|
||||||
@ -713,6 +717,14 @@ int main (int argc, char *argv[]) {
|
|||||||
port += 8640;
|
port += 8640;
|
||||||
}
|
}
|
||||||
home = 1;
|
home = 1;
|
||||||
|
} else {
|
||||||
|
PutC("graphcmd, a graph commandline client (doc: graphcmd help)\n");
|
||||||
|
if (port == -1) {
|
||||||
|
port = 8741;
|
||||||
|
} else if (port > 0 && port < 9) {
|
||||||
|
port += 8740;
|
||||||
|
}
|
||||||
|
home = 1;
|
||||||
}
|
}
|
||||||
PutC( "---------------------------------------------------\n");
|
PutC( "---------------------------------------------------\n");
|
||||||
PutC(".");
|
PutC(".");
|
||||||
|
24
tecs/tecs.c
24
tecs/tecs.c
@ -1217,17 +1217,23 @@ int ReadTemp(void) {
|
|||||||
float Percent2Power(float percent) {
|
float Percent2Power(float percent) {
|
||||||
float curr;
|
float curr;
|
||||||
|
|
||||||
if (linearPower != 0) {
|
if (linearPower > 0) {
|
||||||
return percent/100*linearPower;
|
return percent/100*linearPower;
|
||||||
}
|
}
|
||||||
curr=maxCurrent*percent/100;
|
curr=maxCurrent*percent/100;
|
||||||
|
if (linearPower < 0) {
|
||||||
|
return curr*sqrt(resist)*powFact;
|
||||||
|
}
|
||||||
return curr*curr*resist*powFact;
|
return curr*curr*resist*powFact;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Power2Percent(float power) {
|
float Power2Percent(float power) {
|
||||||
if (linearPower != 0) {
|
if (linearPower > 0) {
|
||||||
return power/linearPower*100;
|
return power/linearPower*100;
|
||||||
}
|
}
|
||||||
|
if (linearPower < 0) {
|
||||||
|
return power/powFact/sqrt(resist)/maxCurrent*100;
|
||||||
|
}
|
||||||
return sqrt(power/powFact/resist)/maxCurrent*100;
|
return sqrt(power/powFact/resist)/maxCurrent*100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1382,18 +1388,19 @@ int SetTemp(int switchOn) {
|
|||||||
if (ramp < 0) ramp=-ramp;
|
if (ramp < 0) ramp=-ramp;
|
||||||
if (ramp < 0.1) ramp=0.1;
|
if (ramp < 0.1) ramp=0.1;
|
||||||
if (showSet) {
|
if (showSet) {
|
||||||
ERR_P(LscCmd(ser, "RAMP [loop]:1,[ramp];SETP [loop],[setH];SETP?[loop]>fbuf"));
|
fbuf = ramp;
|
||||||
} else {
|
} else {
|
||||||
ERR_P(LscCmd(ser, "SETP?[loop]>fbuf"));
|
ERR_P(LscCmd(ser, "SETP?[loop]>fbuf"));
|
||||||
if (fabs(fbuf-setH) >= ramp*smooth) {
|
if (fabs(fbuf-setH) >= ramp*smooth) {
|
||||||
fbuf=ramp;
|
fbuf=ramp;
|
||||||
} else {
|
} else {
|
||||||
fbuf=sqrt(fabs(fbuf-setH)*ramp/smooth);
|
fbuf=sqrt(fabs(fbuf-setH)*ramp/smooth);
|
||||||
if (fbuf<0.1) fbuf=0.1;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
fbuf = fbuf / ctlSens->scale;
|
||||||
|
if (fbuf<0.1) fbuf=0.1;
|
||||||
ERR_P(LscCmd(ser, "RAMP [loop]:1,[fbuf];SETP [loop],[setH]"));
|
ERR_P(LscCmd(ser, "RAMP [loop]:1,[fbuf];SETP [loop],[setH]"));
|
||||||
ERR_P(LscCmd(ser, "SETP?[loop]>fbuf"));
|
ERR_P(LscCmd(ser, "SETP?[loop]>fbuf"));
|
||||||
}
|
|
||||||
tr=TrueScale(ctlSens, fbuf);
|
tr=TrueScale(ctlSens, fbuf);
|
||||||
if (showSet) {
|
if (showSet) {
|
||||||
logfileOut(LOG_MAIN, "set %g (on %s) %g K/min, starting from %g\n", set, ctlSens->ch, ramp, tr);
|
logfileOut(LOG_MAIN, "set %g (on %s) %g K/min, starting from %g\n", set, ctlSens->ch, ramp, tr);
|
||||||
@ -1663,8 +1670,11 @@ int ConfigAlarms(float genLimit) {
|
|||||||
int LoadFromLsc(void) {
|
int LoadFromLsc(void) {
|
||||||
ERR_P(LscCmd(ser, "PID?[loop]>prop,integ,deriv"));
|
ERR_P(LscCmd(ser, "PID?[loop]>prop,integ,deriv"));
|
||||||
ERR_P(LscCmd(ser, "RAMP?[loop]>,ramp"));
|
ERR_P(LscCmd(ser, "RAMP?[loop]>,ramp"));
|
||||||
|
if (ctlSens != NULL) {
|
||||||
|
ramp *= ctlSens->scale;
|
||||||
|
}
|
||||||
ERR_P(LscCmd(ser, "ANALOG?1>,,,,,,fbuf"));
|
ERR_P(LscCmd(ser, "ANALOG?1>,,,,,,fbuf"));
|
||||||
still=fbuf*fbuf/70;
|
still=fbuf;
|
||||||
return 0;
|
return 0;
|
||||||
OnError: return -1;
|
OnError: return -1;
|
||||||
}
|
}
|
||||||
@ -2920,7 +2930,7 @@ int StillHdl(int mode, void *base, int fd) {
|
|||||||
if (mode==COC_WR) {
|
if (mode==COC_WR) {
|
||||||
return COC_DWR;
|
return COC_DWR;
|
||||||
} else if (mode==COC_DWR) {
|
} else if (mode==COC_DWR) {
|
||||||
fbuf=sqrt(still*70);
|
fbuf=still;
|
||||||
ERR_P(LscCmd(ser,"ANALOG 1:0,2,,,,,[fbuf]"));
|
ERR_P(LscCmd(ser,"ANALOG 1:0,2,,,,,[fbuf]"));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user