- Currently disabled attempts at logging commands

- Added a warning for excessive data rates on monitors
- Added statistics to devser and thus to scriptcontext
- Added byte concatenation to dynstring
- Added aborting for reflection generation to fourmess.c
- Added data checksum testing to hipadaba, use for update tests
- Fixed interrupt discovery in network.c, caused invalid interrupt
  codes which in turn confused sicscron which had to be fixed too.
- Renamed ubcalc into ubcalcint in order to reclaim the ubcalc for Jurg
- Added an a3offset to tasub in order to fix what I perceive an IS problem
- Added support for the newer version of the Siemens SPS, the S7
- Added a not yet fully working sinqhttpopt driver which talks to
  http HM without libghttp


SKIPPED:
	psi/delcam.c
	psi/make_gen
	psi/psi.c
	psi/sinq.c
	psi/sinq.h
	psi/sinqhttpopt.c
	psi/slsvme.c
	psi/spss7.c
This commit is contained in:
koennecke
2010-12-20 10:18:01 +00:00
parent 3e89d559ef
commit 045029dfd3
45 changed files with 732 additions and 202 deletions

View File

@@ -366,6 +366,9 @@ static char *SctActionHandler(void *actionData, char *lastReply,
if (!commError && controller->verbose && lastReply != NULL
&& *lastReply != '\0') {
SCPrintf(con, eLog, "%6.3f reply : %s\n", secondsOfMinute(), lastReply);
/**
* TODO: This is the end place of any communication for statistics measurement
*/
}
/*
@@ -413,17 +416,20 @@ static char *SctActionHandler(void *actionData, char *lastReply,
/*
* an error occurred in the script: store error message in
* a property, and write the error message the first time it
* occurs
* occurs.
*
* Replaced <> by - because it messed up XML for Gumtree
* Mark Koennecke
*/
snprintf(eprop, sizeof eprop, "error_during_%s", data->name);
emsg = GetHdbProp(node, eprop);
if (emsg == NULL || con != controller->conn) {
GetHdbPath(node, path, sizeof path);
SCPrintf(con, eError,
"ERROR: action <%s> in {%s} node %s:\nERROR: %s",
"ERROR: action - %s - in {%s} node %s:\nERROR: %s",
data->name, origScript, path, result);
}
snprintf(msg, sizeof msg, "<%s> %s", origScript, result);
snprintf(msg, sizeof msg, "- %s - %s", origScript, result);
if (strcasecmp(data->name, "read") == 0) {
SetHdbProperty(node, "geterror", result);
}
@@ -476,7 +482,7 @@ static char *SctActionHandler(void *actionData, char *lastReply,
if (emsg != NULL) {
GetHdbPath(node, path, sizeof path);
SCPrintf(con, eError,
"action <%s>: success after error message (%s)\n %s",
"action - %s -: success after error message (%s)\n %s",
data->name, path, emsg);
SetHdbProperty(node, eprop, NULL);
}
@@ -504,6 +510,9 @@ static char *SctActionHandler(void *actionData, char *lastReply,
if (controller->verbose) {
SCPrintf(con, eLog, "%6.3f send : %s", secondsOfMinute(), send);
}
/**
* TODO: this is another point where to introduce statistics, this is the start
*/
return send;
}
}
@@ -1071,6 +1080,7 @@ static int SctQueueCmd(pSICSOBJ ccmd, SConnection * con,
typedef struct SctTransact {
char *command;
char *reply;
int sent;
SConnection *con;
SctController *controller;
@@ -1085,6 +1095,9 @@ static void KillSctTransact(void *data)
if (self->command) {
free(self->command);
}
if (self->reply) {
free(self->reply);
}
if (self->con) {
SCDeleteConnection(self->con);
}
@@ -1107,7 +1120,9 @@ static char *TransactionHandler(void *actionData, char *lastReply,
if (st->controller->verbose) {
SCPrintf(st->con, eLog, "%6.3f reply : %s", secondsOfMinute(), lastReply);
}
SCWrite(st->con, lastReply, eValue);
/* printf("Transact: %s got %s\n", st->command, lastReply); */
st->reply = strdup(lastReply);
return NULL;
}
}
@@ -1141,6 +1156,11 @@ static int SctTransactCmd(pSICSOBJ ccmd, SConnection * con,
break;
}
}
if(st->reply != NULL){
SCWrite(con,st->reply,eValue);
} else {
SCWrite(con,"ERROR: no reply!",eError);
}
KillSctTransact(st);
return 1;
}
@@ -1207,6 +1227,31 @@ static int SctListActions(pSICSOBJ ccmd, SConnection * con,
return 1;
}
static int SctStatistics(pSICSOBJ ccmd, SConnection * con,
Hdb * cmdNode, Hdb * par[], int nPar)
{
SctController *c;
double avg, max;
long errCount;
int errState, maxState, maxCount;
char state[16];
c = (SctController *) ccmd->pPrivate;
DevStatistics(c->devser,&avg, &max, &errCount, &errState);
if(errState == 1){
strcpy(state,"in error");
} else {
strcpy(state,"good");
}
SCPrintf(con,eValue,"Average roundtrip time: %lf, maximum roundtrip time %lf, com error count: %ld, com state: %s",
avg, max, errCount, state);
DevAsconStatistics(c->devser,&avg, &max, &maxState, &maxCount);
SCPrintf(con,eValue,"Average time in AsconTask: %lf, maximum time spent in AsconTask %lf, state of Ascon on max %d, count > max/2 %d",
avg, max, maxState, maxCount);
return 1;
}
static hdbCallbackReturn SctDebugCallback(Hdb * node, void *userData,
hdbMessage * msg)
{
@@ -1369,6 +1414,9 @@ static int SctMakeController(SConnection * con, SicsInterp * sics,
cmd = AddSICSHdbPar(controller->node,
"actions", usUser, MakeSICSFunc(SctListActions));
cmd = AddSICSHdbPar(controller->node,
"statistics", usSpy, MakeSICSFunc(SctStatistics));
cb = MakeHipadabaCallback(SctDebugCallback, controller, NULL);
if (cb)
AppendHipadabaCallback(par, cb);