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
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
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
Body SysBody
Attr Class = pwr_eClass_PlcNode
......
......@@ -638,6 +638,17 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
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
Body SysBody
Attr Class = pwr_eClass_PlcNode
......
......@@ -578,6 +578,8 @@ static int gcg_check_attrref(
static int gcg_is_in_focode(
gcg_ctx gcgctx,
vldh_t_node node);
/*_Methods defined for this module_______________________________________*/
......@@ -8880,6 +8882,7 @@ int gcg_comp_m25( gcg_ctx gcgctx, vldh_t_node node)
ldh_sParDef output_bodydef;
pwr_sAttrRef *a_ptr;
pwr_sAttrRef aref;
pwr_tBoolean *lock_ptr;
int keep = 0;
int size;
gcg_t_nocondef nocondef[2];
......@@ -8945,17 +8948,14 @@ int gcg_comp_m25( gcg_ctx gcgctx, vldh_t_node node)
if ( EVEN(sts)) return sts;
}
else {
#if 0
// Removed 2007-05-28 cs, Attribute is not updated if connection is changed !!
pwr_tOid parent;
sts = ldh_GetParent( gcgctx->ldhses, aref.Objid, &parent);
// Check if attribute is locked
sts = ldh_GetObjectPar( gcgctx->ldhses, node->ln.oid, "DevBody",
"LockAttribute", (char **)&lock_ptr, &size);
if ( ODD(sts)) {
if ( !gcg_is_window( gcgctx, parent)) {
/* Keep this attribute */
if ( *lock_ptr)
keep = 1;
}
free( (char *)lock_ptr);
}
#endif
}
}
if ( !keep) {
......@@ -15902,7 +15902,7 @@ static pwr_tStatus gcg_replace_ref( gcg_ctx gcgctx, pwr_sAttrRef *attrref,
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)
{
pwr_sPlcWindow *windbuffer;
......@@ -15921,7 +15921,6 @@ static int gcg_is_window( gcg_ctx gcgctx, pwr_tOid oid)
}
#endif
/*************************************************************************
*
* 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