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

Plc fo SupressSup modified

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