Commit ed7b46cb authored by claes's avatar claes

Supervision of emon timestamp in plcthreads

parent c3263c6c
......@@ -60,7 +60,8 @@ pwrs_Node_Exec (
time_Adiff( &diff, &current_time, &np->ProcTimeStamp[i]);
if ( time_DToFloat( 0, &diff) > timeout[i]) {
np->ProcStatus[i] = PWR__PTIMEOUT;
if ( errh_Severity( np->ProcStatus[i]) < errh_Severity(PWR__PTIMEOUT))
np->ProcStatus[i] = PWR__PTIMEOUT;
}
else if ( np->ProcStatus[i] == PWR__PTIMEOUT) {
np->ProcStatus[i] = (i < errh_cAnix_SrvSize) ? PWR__SRUN : PWR__ARUN;
......@@ -85,6 +86,45 @@ pwrs_Node_Exec (
/* Supervise emon server process */
void
pwrs_Node_SupEmon (
)
{
int i = errh_eAnix_emon - 1;
pwr_tTime current_time;
pwr_tDeltaTime diff;
static float timeout = 3;
if ( !np) {
pwr_tOid oid;
pwr_tStatus sts;
sts = gdh_GetNodeObject( 0, &oid);
if ( ODD(sts))
gdh_ObjidToPointer( oid, (void **) &np);
if ( EVEN(sts)) return;
}
if ( !np)
return;
if ( np->ProcStatus[i] != 0 && np->ProcStatus[i] != PWR__PTIMEOUT) {
clock_gettime( CLOCK_REALTIME, &current_time);
time_Adiff( &diff, &current_time, &np->ProcTimeStamp[i]);
if ( time_DToFloat( 0, &diff) > timeout) {
if ( errh_Severity( np->ProcStatus[i]) < errh_Severity(PWR__PTIMEOUT)) {
np->ProcStatus[i] = PWR__PTIMEOUT;
np->SystemStatus = PWR__PTIMEOUT;
}
}
}
}
......
......@@ -14,4 +14,7 @@ void
pwrs_Node_Exec (
);
void
pwrs_Node_SupEmon (
);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment