Commit 5b512f24 authored by Claes Sjofors's avatar Claes Sjofors

Plc fo SupressSup modified

parent 38429c43
......@@ -66,6 +66,7 @@
#include "co_cdh.h"
#include "co_time.h"
#include "co_tree.h"
#include "co_timelog.h"
#include "rt_ini_event.h"
#include "rt_mh_def.h"
#include "rt_mh_net.h"
......@@ -1217,7 +1218,16 @@ aSup_exec (
if (!o->Action) {
o->Action = TRUE;
}
if (o->AlarmCheck && o->DetectOn && !o->Blocked) {
if (o->Supressed) {
if (o->ReturnCheck) {
time_GetTime( &o->ReturnTime);
o->ReturnCheck = FALSE;
o->ReturnSend = TRUE;
}
else if (o->DetectSend)
o->DetectSend = FALSE;
}
if (o->AlarmCheck && o->DetectOn && !o->Blocked && !o->Supressed) {
if (o->DetectCheck) {
o->ActualValue = In;
timerIn(sp, (sTimer *)&o->TimerFlag);
......@@ -1504,7 +1514,16 @@ dSup_exec (
if (!o->Action) {
o->Action = TRUE;
}
if (o->AlarmCheck && o->DetectOn && !o->Blocked) {
if (o->Supressed) {
if (o->ReturnCheck) {
time_GetTime( &o->ReturnTime);
o->ReturnCheck = FALSE;
o->ReturnSend = TRUE;
}
else if (o->DetectSend)
o->DetectSend = FALSE;
}
if (o->AlarmCheck && o->DetectOn && !o->Blocked && !o->Supressed) {
if (o->DetectCheck) {
o->ActualValue = In;
timerIn(sp, (sTimer *)&o->TimerFlag);
......@@ -3556,7 +3575,7 @@ outunitAck (
return;
}
printf( "** Acked %s %u\n", ap->objName, (unsigned int)ap->status.Event.Status);
timelog_ss( 4, "emon, acked", ap->objName);
switch (ap->source) {
case mh_eSource_Scanner:
......@@ -3935,6 +3954,7 @@ receive (
continue;
handleMessage( &get);
}
pwrs_Node_Exec( handlerEvent_cb);
}
else {
......@@ -5370,7 +5390,7 @@ static pwr_tStatus emon_redu_receive()
case mh_eEvent_UserAlarm4:
break;
default:
printf( "** etp type error %s %d\n", ap->objName, ap->detect_etp->event);
timelog_ss( 4, "emon etp type error", ap->objName);
activep++;
continue;
}
......
......@@ -201,39 +201,23 @@
@aref supresssup SupressSup
*/
#define SupressSup_exec(obj,sup,cid,in)\
if ( in && !obj->InOld) {\
switch ( cid) {\
case pwr_cClass_DSup:\
((pwr_sClass_DSup *)sup)->Blocked = 1;\
break;\
case pwr_cClass_DSupComp:\
((pwr_sClass_DSupComp *)sup)->Blocked = 1;\
break;\
case pwr_cClass_ASup:\
((pwr_sClass_ASup *)sup)->Blocked = 1;\
break;\
case pwr_cClass_ASupComp:\
((pwr_sClass_ASupComp *)sup)->Blocked = 1;\
break;\
default: ;\
}\
}\
else if ( !in && obj->InOld) {\
switch ( cid) {\
case pwr_cClass_DSup:\
((pwr_sClass_DSup *)sup)->Blocked = 0;\
break;\
case pwr_cClass_DSupComp:\
((pwr_sClass_DSupComp *)sup)->Blocked = 0;\
break;\
case pwr_cClass_ASup:\
((pwr_sClass_ASup *)sup)->Blocked = 0;\
break;\
case pwr_cClass_ASupComp:\
((pwr_sClass_ASupComp *)sup)->Blocked = 0;\
break;\
default: ;\
}\
}\
obj->Supressed = in;\
obj->InOld = in;
switch ( cid) { \
case pwr_cClass_DSup: \
((pwr_sClass_DSup *)sup)->Supressed = in; \
obj->Out = in || ((pwr_sClass_DSup *)sup)->Action; \
break; \
case pwr_cClass_DSupComp: \
((pwr_sClass_DSupComp *)sup)->Supressed = in; \
obj->Out = in || ((pwr_sClass_DSupComp *)sup)->Action; \
break; \
case pwr_cClass_ASup: \
((pwr_sClass_ASup *)sup)->Supressed = in; \
obj->Out = in || ((pwr_sClass_ASup *)sup)->Action; \
break; \
case pwr_cClass_ASupComp: \
((pwr_sClass_ASupComp *)sup)->Supressed = in; \
obj->Out = in || ((pwr_sClass_ASupComp *)sup)->Action; \
break; \
default: ; \
} \
obj->Supressed = in;
......@@ -104,7 +104,16 @@
((o->High && In > o->CtrlLimit) || \
(!o->High && In < o->CtrlLimit))) { \
if (!o->Action) o->Action = TRUE; \
if (o->AlarmCheck && o->DetectOn && !o->Blocked) { \
if (o->Supressed) { \
if (o->ReturnCheck) { \
time_GetTime( &o->ReturnTime); \
o->ReturnCheck = FALSE; \
o->ReturnSend = TRUE; \
} \
else if (o->DetectSend) \
o->DetectSend = FALSE; \
} \
if (o->AlarmCheck && o->DetectOn && !o->Blocked && !o->Supressed) { \
if (o->DetectCheck) { \
o->ActualValue = In; \
timer2_in(tp, o); \
......@@ -119,7 +128,7 @@
} \
} \
} \
if (o->Blocked) { \
if (o->Blocked || o->Supressed) { \
o->TimerCount = 0; \
o->DetectCheck = TRUE; \
}
......@@ -164,11 +173,20 @@
} \
} else if (con) { \
if (!o->Action) o->Action = TRUE; \
if (o->AlarmCheck && o->DetectOn && !o->Blocked) { \
if (o->Supressed) { \
if (o->ReturnCheck) { \
time_GetTime( &o->ReturnTime); \
o->ReturnCheck = FALSE; \
o->ReturnSend = TRUE; \
} \
else if (o->DetectSend) \
o->DetectSend = FALSE; \
} \
if (o->AlarmCheck && o->DetectOn && !o->Blocked && !o->Supressed) { \
if (o->DetectCheck) { \
o->ActualValue = In; \
timer2_in(tp, o); \
time_GetTime(&o->DetectTime); \
time_GetTime(&o->DetectTime); \
o->DetectCheck = FALSE; \
} \
if (!o->TimerFlag) { \
......@@ -179,7 +197,7 @@
} \
} \
} \
if (o->Blocked) { \
if (o->Blocked || o->Supressed) { \
o->TimerCount = 0; \
o->DetectCheck = TRUE; \
}
......@@ -224,7 +242,16 @@
}\
} else if (con) {\
if (!co->Action) co->Action = TRUE;\
if (co->AlarmCheck && co->DetectOn && !co->Blocked) {\
if (co->Supressed) {\
if (co->ReturnCheck) {\
time_GetTime( &co->ReturnTime);\
co->ReturnCheck = FALSE;\
co->ReturnSend = TRUE;\
}\
else if (co->DetectSend)\
co->DetectSend = FALSE;\
}\
if (co->AlarmCheck && co->DetectOn && !co->Blocked && !co->Supressed) {\
if (co->DetectCheck) {\
co->ActualValue = In;\
timer2_in(tp, co);\
......@@ -239,7 +266,7 @@
}\
}\
}\
if (co->Blocked) {\
if (co->Blocked || co->Supressed) {\
co->TimerCount = 0;\
co->DetectCheck = TRUE;\
}\
......@@ -292,7 +319,16 @@
((co->High && In > co->CtrlLimit) ||\
(!co->High && In < co->CtrlLimit))) {\
if (!co->Action) co->Action = TRUE;\
if (co->AlarmCheck && co->DetectOn && !co->Blocked) {\
if (co->Supressed) {\
if (co->ReturnCheck) {\
time_GetTime( &co->ReturnTime);\
co->ReturnCheck = FALSE;\
co->ReturnSend = TRUE;\
}\
else if (co->DetectSend)\
co->DetectSend = FALSE;\
}\
if (co->AlarmCheck && co->DetectOn && !co->Blocked && !co->Supressed) {\
if (co->DetectCheck) {\
co->ActualValue = In;\
timer2_in(tp, co);\
......@@ -307,7 +343,7 @@
}\
}\
}\
if (co->Blocked) {\
if (co->Blocked || co->Supressed) {\
co->TimerCount = 0;\
co->DetectCheck = TRUE;\
}\
......
......@@ -589,6 +589,16 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$String16"
EndBody
EndObject
!/**
! Used by the SupressSup object to supress the alarm.
!*/
Object Supressed $Attribute 42
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!
! End of ASup inf struct
! --
......
......@@ -571,6 +571,16 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$String16"
EndBody
EndObject
!/**
! Used by the SupressSup object to supress the alarm.
!*/
Object Supressed $Attribute 44
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!
! End of ASup inf struct
! --
......
......@@ -553,6 +553,16 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Used by the SupressSup object to supress the alarm.
!*/
Object Supressed $Attribute 39
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!
! End of DSup inf struct
! --
......
......@@ -536,6 +536,16 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Used by the SupressSup object to supress the alarm.
!*/
Object Supressed $Attribute 41
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!
! End of DSup inf struct
! --
......
......@@ -44,7 +44,7 @@ SObject pwrb:Class
! @image orm_supresssup_fo.gif
!
!*/
Object SupressSup $ClassDef 686
Object SupressSup $ClassDef 690
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
......@@ -69,21 +69,21 @@ SObject pwrb:Class
EndBody
EndObject
!/**
! Value of In from last scan.
! Indicating that alarm is supressed.
!*/
Object InOld $Intern 2
Object Supressed $Intern 2
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr PgmName = "Supressed"
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Output indicating that alarm is supressed.
! Output indicating that alarm is supressed or the associated
! alarm is active.
!*/
Object Supressed $Output 3
Object Out $Output 3
Body SysBody
Attr PgmName = "Supressed"
Attr PgmName = "Out"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "out"
EndBody
......@@ -141,7 +141,7 @@ SObject pwrb:Class
Attr connectmethod = 36
Attr executeordermethod = 6
Attr objname = "SupressSup"
Attr graphname = "SupSup"
Attr graphname = "SupressSup"
Attr debugpar = "Supressed"
EndBody
EndObject
......
......@@ -3177,18 +3177,44 @@ int gobj_get_object_m36( WFoe *foe, vldh_t_node node, unsigned long index)
vldh_t_plc plc;
pwr_sAttrRef attrref;
int is_attr;
unsigned long node_count;
vldh_t_node *nodelist;
vldh_t_node object;
/* Get the selected object in the navigator */
plc = (node->hn.wind)->hw.plc;
ldhses =(node->hn.wind)->hw.ldhses;
sts = gobj_get_select( foe, &attrref, &is_attr);
if ( EVEN(sts)) {
foe->message( "Select a supervision object in the navigator");
/* Get the selected object in current plc window or the navigator */
foe->gre->get_selnodes( &node_count, &nodelist);
if ( ((node_count == 1) && (*nodelist == node)) ||
( node_count == 0) ) {
/* Take the orderobject from the navigator */
sts = gobj_get_select( foe, &attrref, &is_attr);
if ( EVEN(sts)) {
foe->message( "Select a supervision object in the navigator or in the current window");
BEEP;
return sts;
}
}
else if ( (node_count == 2) &&
(( *nodelist == node) || ( *(nodelist + 1) == node))) {
if ( *nodelist == node)
object = *(nodelist + 1);
else
object = *nodelist;
attrref = cdh_ObjidToAref( object->ln.oid);
}
else if ( node_count == 1) {
object = *nodelist;
attrref = cdh_ObjidToAref( object->ln.oid);
}
else {
foe->message( "Select a supervision object in the navigator or in the current window first");
BEEP;
return sts;
return 0;
}
if ( node_count > 0) free((char *) nodelist);
sts = ldh_GetAttrRefTid( ldhses, &attrref, &cid);
if ( EVEN(sts)) return sts;
......@@ -3200,7 +3226,7 @@ int gobj_get_object_m36( WFoe *foe, vldh_t_node node, unsigned long index)
case pwr_cClass_ASupComp:
break;
default:
foe->message( "Selected object is not a di object");
foe->message( "Selected object is not a supervision object");
BEEP;
return 0;
}
......
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