servlog.c

Fix month in logfile name and put date in all log file names.
sct_protek_common.tcl
Catch non-numeric readings from main multimeter display
Added support for a callbank function which is called after reportVal

sct_julabo_lh45.tcl
Clear the geterror property when getting a new reading.
Don't set the overtemp and subtemp warning limits because this can cause the julabo to alarm.
Do nothing if the setpoint hasn't been updated.
Set default settletime to 60s and the default error handler to "lazy".
Added start_temperature and end_temperature which are updated by callbacks on the histogram memory control.

sct_lakeshore_340.tcl
Set the type for the setpoint nodes to drivable
r3032 | ffr | 2010-12-02 14:03:44 +1100 (Thu, 02 Dec 2010) | 15 lines
This commit is contained in:
Ferdi Franceschini
2010-12-02 14:03:44 +11:00
committed by Douglas Clowes
parent 7bf2d4d9f0
commit 202bb2869a
4 changed files with 91 additions and 55 deletions

View File

@@ -248,10 +248,9 @@ static const char* timestamp(struct timeval *tp) {
#define MAXFILES 100
static FILE *fLogFile = NULL;
static int iFile = 0;
static int iFile = -1;
static int iLineCount = 0;
static int iLogUsable = 1;
char * fPath = "./../log/";
/*---------------------------------------------------------------------------*/
int OpenVerifyLogFile()
@@ -259,6 +258,10 @@ static const char* timestamp(struct timeval *tp) {
char pFile[256];
char filnam[512];
char *pChar = NULL;
char fPath[1024];
/* snprintf(fPath, 1023, "%s/", getenv("SICS_INIT_LOGPATH")); */
snprintf(fPath, 1023, "%s/", "../log");
pChar = IFindOption(pSICSOptions,"LogFileBaseName");
if(!pChar)
@@ -271,7 +274,6 @@ static const char* timestamp(struct timeval *tp) {
}
// Jing added here to add timestamp info for the server00.log file name as server00_hh:mm:sec-daymonyear.log
if(iFile==0){
int hh, mm, ss, day, mon, year;
struct timeval tv;
struct tm *time;
@@ -282,12 +284,14 @@ static const char* timestamp(struct timeval *tp) {
mm = time->tm_min;
ss = time->tm_sec;
day = time->tm_mday;
mon = time->tm_mon;
mon = time->tm_mon+1;
year = time->tm_year + 1900;
snprintf(filnam,511,"%s%s%2.2d_%02d:%02d:%02d-%02d%02d%04d.log", fPath, pFile, iFile, hh, mm, ss, day, mon, year);
if(iFile==-1){
snprintf(filnam,511,"%s%s_%04d-%02d-%02dT%02d:%02d:%02d.000.log", fPath, pFile, year, mon, day, hh, mm, ss);
iFile = 0;
}else
snprintf(filnam,511,"%s%s%2.2d.log", fPath, pFile, iFile);
snprintf(filnam,511,"%s%s_%04d-%02d-%02dT%02d:%02d:%02d.%2.2d.log", fPath, pFile, year, mon, day, hh, mm, ss, iFile);
fLogFile = fopen(filnam,"w");
if(!fLogFile)