tecs_plot.f is now ext. f77

This commit is contained in:
cvs
2002-10-16 11:35:40 +00:00
parent f514cf51e9
commit a14b12b726
12 changed files with 860 additions and 756 deletions

View File

@@ -146,7 +146,7 @@ static int
nScan=0, /* number of scanned channels */
alarmListSize=0,
lockAlarm,
cntError,
cntError,
tableTime; /* last time when table was read */
int tim, rdTim; /* actual time, read Time */
@@ -168,6 +168,8 @@ static char
heUnits[4], /* helium level units */
alarmChannels[N_SENSORS],
alarmHistory[N_SENSORS],
dev[80],
devHelp[10000],
controlChannel[4]="A";
static char
@@ -543,7 +545,7 @@ int PrepInput(char *label) {
if (i<1) ERR_MSG("missing chans");
t+=l;
/* interprete settings until '+' appeares */
/* interprete settings until '+' appeares (after whitespace) */
ERR_P(CocReadVars(t, '+'));
if (loop!=2) loop=1;
@@ -2076,6 +2078,50 @@ EndStatus:
return -1;
}
int DevHelpHdl(int mode, void *base, int fd) {
char *t, *n, *d, *en, *ed;
char line[80], nbuf[256];
int l;
static int doit=1;
if (table!=NULL && tim>tableTime+60) { FREE(table); table=NULL; }; /* clear old table */
if (table==NULL) { /* read table */
str_copy(nbuf, binDir);
str_append(nbuf, TABLE_FILE);
ERR_P(table=str_read_file(nbuf));
tableTime=tim;
doit=1;
}
if (doit) {
doit=0;
t=table;
str_copy(devHelp,"\n");
while (t!=NULL) {
t++;
n=strchr(t, '\'');
d=strchr(t, '"');
t=strchr(t, '\n');
if (n!=NULL && d!=NULL && n < d && d < t) {
en=strchr(n+1, '\'');
ed=strchr(d+1, '"');
if (en != NULL && en<d && ed != NULL && ed<t) {
l=en-n;
if (l>12) l=12;
str_ncpy(line, n+1, l);
str_npad(line, line, 12);
l=ed-d;
if (l>77) l=77;
str_ncpy(line+12, d+1, l);
str_append(line, "\n");
str_append(devHelp, line);
}
}
}
}
return 0;
OnError: return -1;
}
int RemoteHdl(int mode, void *base, int fd) {
if (mode==COC_WR) {
return COC_DWR;
@@ -2118,18 +2164,6 @@ int TmoHdl(int mode, void *base, int fd) {
OnError: return -1;
}
int SerHdl(int mode, void *base, int fd) {
if (mode==COC_WR) {
return COC_DRD;
} else if (mode==COC_DRD) {
SerClose(ser);
noResp=1;
ERR_P(ser=SerOpen(host, msecTmo, IdleHdl));
}
return 0;
OnError: return -1;
}
int LogfileHdl(int mode, void *base, int fd) {
char buf[256];
if (mode==COC_WR) {
@@ -2237,7 +2271,7 @@ int main(int argc, char *argv[]) {
CocFltFld(SensorT, t0, RD);
CocFltFld(SensorT, t1, RD);
CocFltFld(SensorT, t2, RD);
CocFltFld(SensorT, lim, RD);
CocFltFld(SensorT, lim, RW);
CocFltFld(SensorT, scale, RD);
CocFltFld(SensorT, alarm, RW); CocHdl(AlarmHdl);
CocIntFld(SensorT, readStat, RD);
@@ -2297,6 +2331,8 @@ int main(int argc, char *argv[]) {
CocDefStr(status, RD); CocHdl(StatusHdl);
CocDefStr(pid, RD); CocHdl(PidSumHdl);
CocDefStr(config, RD);
CocDefStr(dev, RD);
CocDefStr(devHelp, RD); CocHdl(DevHelpHdl);
CocDefInt(cod1, RD);
CocDefInt(cod2, RD);
@@ -2342,7 +2378,7 @@ int main(int argc, char *argv[]) {
CocAlias(int,integ);
CocDefInt(msecTmo, RW); CocHdl(TmoHdl);
CocDefStr(host, RW); CocHdl(SerHdl);
CocDefStr(host, RW);
CocDefInt(port, RD);
CocDefInt(use_stdout, RW); CocHdl(LogfileHdl);
CocDefStr(serverId, RW); CocHdl(LogfileHdl);
@@ -2395,7 +2431,7 @@ int main(int argc, char *argv[]) {
logfileOut(LOG_MAIN ,"?");
} else {
CocReadVars(inistr, '\0');
free(inistr);
FREE(inistr);
}
}
}
@@ -2451,6 +2487,11 @@ int main(int argc, char *argv[]) {
cntError=0;
while (!quit) {
iret=MainBody();
if (ser!=NULL && 0!=strcmp(host, ser->host)) {
SerClose(ser);
ser=NULL;
noResp=1;
}
if (iret<0 || ser==NULL) {
cntError++;
ser=SerCheck(ser);