Commit 29e0f70d authored by Claes Sjofors's avatar Claes Sjofors

LockAttribute added to sup objects to inhibit the plc compiler to set Attribute

parent a11530ea
...@@ -676,6 +676,17 @@ SObject pwrb:Class ...@@ -676,6 +676,17 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
EndBody EndBody
EndObject EndObject
!/**
! 'Attribute' is assigned a value that should not be changed.
! Normally the 'Attribute' value is fetched from the object connected
! to the In input pin. If LockAttribute is set, and Attribute is
! assigned a value, this value will not be changed by the compiler.
!*/
Object LockAttribute $Intern 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object PlcNode $Buffer 2 Object PlcNode $Buffer 2
Body SysBody Body SysBody
Attr Class = pwr_eClass_PlcNode Attr Class = pwr_eClass_PlcNode
......
...@@ -638,6 +638,17 @@ SObject pwrb:Class ...@@ -638,6 +638,17 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
EndBody EndBody
EndObject EndObject
!/**
! 'Attribute' is assigned a value that should not be changed.
! Normally the 'Attribute' value is fetched from the object connected
! to the In input pin. If LockAttribute is set, and Attribute is
! assigned a value, this value will not be changed by the compiler.
!*/
Object LockAttribute $Intern 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object PlcNode $Buffer 2 Object PlcNode $Buffer 2
Body SysBody Body SysBody
Attr Class = pwr_eClass_PlcNode Attr Class = pwr_eClass_PlcNode
......
...@@ -578,6 +578,8 @@ static int gcg_check_attrref( ...@@ -578,6 +578,8 @@ static int gcg_check_attrref(
static int gcg_is_in_focode( static int gcg_is_in_focode(
gcg_ctx gcgctx, gcg_ctx gcgctx,
vldh_t_node node); vldh_t_node node);
/*_Methods defined for this module_______________________________________*/ /*_Methods defined for this module_______________________________________*/
...@@ -8880,6 +8882,7 @@ int gcg_comp_m25( gcg_ctx gcgctx, vldh_t_node node) ...@@ -8880,6 +8882,7 @@ int gcg_comp_m25( gcg_ctx gcgctx, vldh_t_node node)
ldh_sParDef output_bodydef; ldh_sParDef output_bodydef;
pwr_sAttrRef *a_ptr; pwr_sAttrRef *a_ptr;
pwr_sAttrRef aref; pwr_sAttrRef aref;
pwr_tBoolean *lock_ptr;
int keep = 0; int keep = 0;
int size; int size;
gcg_t_nocondef nocondef[2]; gcg_t_nocondef nocondef[2];
...@@ -8945,17 +8948,14 @@ int gcg_comp_m25( gcg_ctx gcgctx, vldh_t_node node) ...@@ -8945,17 +8948,14 @@ int gcg_comp_m25( gcg_ctx gcgctx, vldh_t_node node)
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
} }
else { else {
#if 0 // Check if attribute is locked
// Removed 2007-05-28 cs, Attribute is not updated if connection is changed !! sts = ldh_GetObjectPar( gcgctx->ldhses, node->ln.oid, "DevBody",
pwr_tOid parent; "LockAttribute", (char **)&lock_ptr, &size);
sts = ldh_GetParent( gcgctx->ldhses, aref.Objid, &parent);
if ( ODD(sts)) { if ( ODD(sts)) {
if ( !gcg_is_window( gcgctx, parent)) { if ( *lock_ptr)
/* Keep this attribute */
keep = 1; keep = 1;
} free( (char *)lock_ptr);
} }
#endif
} }
} }
if ( !keep) { if ( !keep) {
...@@ -15902,7 +15902,7 @@ static pwr_tStatus gcg_replace_ref( gcg_ctx gcgctx, pwr_sAttrRef *attrref, ...@@ -15902,7 +15902,7 @@ static pwr_tStatus gcg_replace_ref( gcg_ctx gcgctx, pwr_sAttrRef *attrref,
return GSX__SUCCESS; return GSX__SUCCESS;
} }
#if 0 // Not used any mord #if 0 // Not used any more
static int gcg_is_window( gcg_ctx gcgctx, pwr_tOid oid) static int gcg_is_window( gcg_ctx gcgctx, pwr_tOid oid)
{ {
pwr_sPlcWindow *windbuffer; pwr_sPlcWindow *windbuffer;
...@@ -15921,7 +15921,6 @@ static int gcg_is_window( gcg_ctx gcgctx, pwr_tOid oid) ...@@ -15921,7 +15921,6 @@ static int gcg_is_window( gcg_ctx gcgctx, pwr_tOid oid)
} }
#endif #endif
/************************************************************************* /*************************************************************************
* *
* Set compilation manager for all nodes in a window. * Set compilation manager for all nodes in a window.
......
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