Commit 734e269e authored by Claes Sjofors's avatar Claes Sjofors

Wb script function GetAttribute didn't work for attribute objects

parent b42627c1
...@@ -1292,9 +1292,10 @@ static int wccm_attribute_func ( ...@@ -1292,9 +1292,10 @@ static int wccm_attribute_func (
char *s; char *s;
char *t; char *t;
char upper_name[80]; char upper_name[80];
pwr_tObjid objid; pwr_tAttrRef aref;
char objname[120]; pwr_tAName aname;
char attrname[32]; char attrname[32];
pwr_tAName pname;
int len; int len;
int decl; int decl;
int int_val; int int_val;
...@@ -1311,8 +1312,8 @@ static int wccm_attribute_func ( ...@@ -1311,8 +1312,8 @@ static int wccm_attribute_func (
} }
/* Parse the string in name and attribute */ /* Parse the string in name and attribute */
strcpy( objname, name); strcpy( aname, name);
s = strrchr( objname, '.'); s = strrchr( aname, '.');
if ( s == 0) if ( s == 0)
return FOE__NOPAR; return FOE__NOPAR;
*s = 0; *s = 0;
...@@ -1341,11 +1342,11 @@ static int wccm_attribute_func ( ...@@ -1341,11 +1342,11 @@ static int wccm_attribute_func (
} }
} }
sts = ldh_NameToObjid( ldhses, &objid, objname); sts = ldh_NameToAttrRef( ldhses, aname, &aref);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
/* Get the class of the object */ /* Get the class of the object */
sts = ldh_GetObjectClass( ldhses, objid, &cid); sts = ldh_GetAttrRefTid( ldhses, &aref, &cid);
found = 0; found = 0;
for ( i = 0; i < 3; i++ ) for ( i = 0; i < 3; i++ )
...@@ -1391,8 +1392,17 @@ static int wccm_attribute_func ( ...@@ -1391,8 +1392,17 @@ static int wccm_attribute_func (
elements = 1; elements = 1;
/* Get the parameter value in object */ /* Get the parameter value in object */
sts = ldh_GetObjectPar( ldhses, objid, body, s = strchr( aname, '.');
attrname, (char **)&object_par, &size); if ( s) {
strcpy( pname, s+1);
strcat( pname, ".");
strcat( pname, attrname);
}
else
strcpy( pname, attrname);
sts = ldh_GetObjectPar( ldhses, aref.Objid, body,
pname, (char **)&object_par, &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
object_element = object_par + element * size / elements; object_element = object_par + element * size / elements;
......
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