diff --git a/tecs/make_gen b/tecs/make_gen index f4297b2..b06a83a 100644 --- a/tecs/make_gen +++ b/tecs/make_gen @@ -10,7 +10,7 @@ LIBR_OBJ =coc_util.o myc_err.o myc_str.o myc_buf.o myc_time.o SERV_OBJ =tecs.o coc_server.o tecs_lsc.o tecs_serial.o coc_logfile.o \ - tecs_data.o logger_tecs.o $(LIBR_OBJ) + tecs_data.o $(LIBR_OBJ) CLI_OBJ =tecs_cli.o coc_client.o $(LIBR_OBJ) TCLI_OBJ =sys_getenv.o sys_env.o myc_tmp.o sys_cmdpar.o \ sys_date.o sys_wait.o sys_lun.o sys_rdline.o \ @@ -71,9 +71,6 @@ keep_running: keep_running.c six: six.c term.o sys_select.o libtecsl.a $(CC) $(CFLAGS) -o $@ $Q $(FORTIFYOBJ) -tt: tt.c term.o sys_select.o libtecsl.a - $(CC) $(CFLAGS) -o $@ $Q $(FORTIFYOBJ) - rexstart: rstart.c myc_str.o myc_err.o instr_hosts.o $(CC) $(CFLAGS) -o $@ $Q $(FORTIFYOBJ) @ echo "$(PWD)/rstart" diff --git a/tecs/six.c b/tecs/six.c index 0f7da60..ba76145 100644 --- a/tecs/six.c +++ b/tecs/six.c @@ -749,9 +749,6 @@ int main (int argc, char *argv[]) { PrintCmd(buf, CLIENT); ERR_SI(send(sock[0], "INT1712 3\n", 10, 0)); buf[0]='\0'; - if (level != 1 && !busy[0]) { - PutC("nothing to stop\n"); - } } else if (0==strcmp(buf, "-") || 0==strcmp(buf, "--") || 0==strcmp(buf, "+") || diff --git a/tecs/tecs.c b/tecs/tecs.c index aff78a3..db1d259 100644 --- a/tecs/tecs.c +++ b/tecs/tecs.c @@ -5,9 +5,6 @@ #include #include #include -#include -#include -#include #include "myc_mem.h" #include "myc_err.h" #include "coc_util.h" @@ -17,7 +14,6 @@ #include "myc_time.h" #include "tecs_lsc.h" #include "tecs_data.h" -#include "logger.h" /* --- non ANSI signal --- */ #ifndef SIGPIPE @@ -174,7 +170,7 @@ static int lockAlarm, cntError; -static int tim, rdTim; /* actual time, read Time */ +int tim, rdTim; /* actual time, read Time */ static int decod[8]={21,20,17,16,5,4,1,0}; /* for code conversion */ @@ -682,6 +678,8 @@ again: } else if (tLimit>tMaxLimit) { tLimit=tMaxLimit; } + maxPowerFlt=25; + sscanf(maxPower, "%f", &maxPowerFlt); for (i=j; itype[0]; @@ -1410,6 +1408,8 @@ void CalcMaxPower(void) { str_append(maxPower, ")"); } maxCurrent=sqrt(best->p/resist); + iRange = best->iRange; + iAmp = best->iAmp; assert(maxCurrent>0); } } @@ -1509,7 +1509,7 @@ int SetMaxPower(void) { fbuf=FakeScale(ctlSens, tLimit); if (loop==1) { PidSumHdl(COC_RD, NULL, 0); - if (!initMaxPower && lastCurrent != maxCurrent) { + if (!initMaxPower && lastCurrent != maxCurrent && lastCurrent != 0) { logfileOut(LOG_MAIN, "pid: %s\nlast %f max %f\n", pid, lastCurrent, maxCurrent); prop=prop*lastCurrent/maxCurrent; } @@ -2844,7 +2844,6 @@ int main(int argc, char *argv[]) { int i, iret; char *inistr; char buf[256], opt; - char loggerDir[256]; signal(SIGPIPE, ignore_forever); @@ -3065,18 +3064,8 @@ int main(int argc, char *argv[]) { str_copy(statusBuf, "starting up"); logfileStatusBuf(statusBuf); - if (logDir[0] == '/') { - str_copy(buf, logDir); - } else { - getcwd(buf, sizeof buf); - str_append(buf, "/"); - ERR_I(str_append(buf, logDir)); - } - ERR_I(str_append(buf, serverId)); - ERR_I(str_copy(loggerDir, buf)); - mkdir(loggerDir, S_IRWXU+S_IRGRP+S_IXGRP+S_IROTH+S_IXOTH); - /* do not check return value */ - LoggerSetDir(loggerDir); + str_copy(buf, logDir); + str_append(buf, serverId); logfile=logfileInit(buf, logIt, use_stdout, logIt && use_stdout); CocDefStr(logfile, RD); logfileOut(LOG_MAIN ,"\n"); diff --git a/tecs/tecs_data.c b/tecs/tecs_data.c index 192c016..13f2e89 100644 --- a/tecs/tecs_data.c +++ b/tecs/tecs_data.c @@ -8,7 +8,6 @@ #include "myc_time.h" #include "coc_logfile.h" #include "tecs_data.h" -#include "logger.h" #define RUN_SIZE 1024 #define SET_LEN 1024 @@ -35,7 +34,6 @@ typedef struct _Set { float *var; Run *runs; Summary sum; - Logger *log; } Set; typedef struct { @@ -127,7 +125,6 @@ Set *CreateSet(Base *base, char *name, float *var, int step, int lifetime, int s s->start = start; s->step = step; s->var = var; - s->log = LoggerMake(name, step); ResetSum(&s->sum); return s; OnError: @@ -270,8 +267,7 @@ int DataPut(DataSet *set, int time, float value) { int DataPutAll(DataBase *base, int time) { Set *s; - char value[32]; - + if (base == NULL) { s=database.head; } else { @@ -280,10 +276,6 @@ int DataPutAll(DataBase *base, int time) { while (s!=NULL) { if (s->var!=NULL) { ERR_I(Put(s, time, *s->var)); - if (s->log != NULL) { - snprintf(value, sizeof value, "%f", *s->var); - LoggerWrite(s->log, mycUnixTime(time), s->step, value); - } } s=s->next; }