PSI UPDATE

r2720 | ffr | 2008-10-13 15:40:07 +1100 (Mon, 13 Oct 2008) | 2 lines
This commit is contained in:
Ferdi Franceschini
2008-10-13 15:40:07 +11:00
committed by Douglas Clowes
183 changed files with 20455 additions and 3661 deletions

View File

@@ -100,7 +100,7 @@
self->start = time(NULL);
self->lastt = 0;
self->iWarned = 0;
SCSave(&self->conn, pCon);
self->conn = SCSave(pCon, self->conn);
/* try at least three times to do it */
for(i = 0; i < 3; i++)
@@ -292,9 +292,9 @@
if (self->lastt > 0) { /* increase tol for hysteresis */
tol=tol*1.1001;
}
tmo = (int)(ObVal(self->pParam, SETTLE));
if(fDelta <= tol) /* inside tolerance */
{
tmo = (int)(ObVal(self->pParam, SETTLE));
if (self->lastt <= 0) /* lastt negative: -seconds already waited */
{
self->lastt += now;
@@ -319,9 +319,11 @@
else
{
if (self->lastt > 0) { /* save time already waited */
sprintf(pBueffel,"%s outside tolerance, settling time suspended",
self->pName);
SCWrite(pCon,pBueffel,eWarning);
if (tmo > 0) {
sprintf(pBueffel,"%s outside tolerance, settling time suspended",
self->pName);
SCWrite(pCon,pBueffel,eWarning);
}
self->lastt -= now;
}
notifyStatus(self, pCon, HWBusy);
@@ -382,17 +384,15 @@ static void ErrWrite(char *txt, SCStore *conn)
pExe = GetExecutor();
pCon = GetExeOwner(pExe);
if (!pCon)
if (pCon)
{
pCon = SCLoad(conn);
SCWrite(pCon,txt,eWarning);
}
if(pCon)
{
SCWrite(pCon,txt,eWarning);
}
else
{
ServerWriteGlobal(txt,eWarning);
pCon = SCStorePush(conn);
SCWrite(pCon, txt, eWarning);
SCStorePop(conn);
}
}
/*-----------------------------------------------------------------------*/
@@ -406,7 +406,7 @@ static void ErrReport(pEVControl self)
{
sprintf(pBueffel,"WARNING: %s is out of range by %g",
self->pName,fDelta);
ErrWrite(pBueffel, &self->conn);
ErrWrite(pBueffel, self->conn);
self->iWarned = 1;
}
}
@@ -479,7 +479,7 @@ static void ErrReport(pEVControl self)
snprintf(pBueffel,255,
"ERROR: %s while processing errorscript for %s",
pTcl->result,self->pName);
ErrWrite(pBueffel, &self->conn);
ErrWrite(pBueffel, self->conn);
}
/*
assume that everything is fine again after the script
@@ -493,7 +493,7 @@ static void ErrReport(pEVControl self)
snprintf(pBueffel,255,
"ERROR: script error handling requested for %s, but no script given",
self->pName);
ErrWrite(pBueffel, &self->conn);
ErrWrite(pBueffel, self->conn);
}
return 1;
@@ -523,7 +523,7 @@ static void ErrReport(pEVControl self)
ErrReport(self);
ErrWrite("Running to safe value", &self->conn);
ErrWrite("Running to safe value", self->conn);
self->pDriv->SetValue(self->pDriv, ObVal(self->pParam,SAFEVALUE));
self->eMode = EVIdle;
self->iWarned = 0;
@@ -615,7 +615,7 @@ static void ErrReport(pEVControl self)
{
sprintf(pBueffel,"Environment device %s back in tolerances again",
self->pName);
ErrWrite(pBueffel, &self->conn);
ErrWrite(pBueffel, self->conn);
self->iWarned = 0;
}
return 1;
@@ -796,6 +796,7 @@ static void ErrReport(pEVControl self)
pRes->pName = strdup(pName);
pRes->eMode = EVIdle;
pRes->iWarned = 0;
pRes->conn = NULL;
/* a terminal error gives a -1 in iRet */
if(iRet < 0)
@@ -868,6 +869,10 @@ static void ErrReport(pEVControl self)
{
free(self->runScript);
}
if (self->conn != NULL)
{
SCStoreFree(self->conn);
}
free(self);
}
/*--------------------------------------------------------------------------*/