Commit 15215979 authored by Claes Sjofors's avatar Claes Sjofors

gdh_RefObjectInfoList, error status and message for invalid local attributes in Ge graphs

parent cc36a5c5
...@@ -3115,7 +3115,7 @@ gdh_RefObjectInfoList ( ...@@ -3115,7 +3115,7 @@ gdh_RefObjectInfoList (
If supplied as NULL, it is ignored. */ If supplied as NULL, it is ignored. */
) )
{ {
pwr_tStatus sts = GDH__SUCCESS; pwr_tStatus sts, rsts = GDH__SUCCESS;
pwr_tUInt32 i; pwr_tUInt32 i;
OBJREF_STRUCT *objrefp; OBJREF_STRUCT *objrefp;
pwr_tSubid *subidarr; pwr_tSubid *subidarr;
...@@ -3148,7 +3148,11 @@ gdh_RefObjectInfoList ( ...@@ -3148,7 +3148,11 @@ gdh_RefObjectInfoList (
for (i=0; i < n; i++, objrefp++) { for (i=0; i < n; i++, objrefp++) {
sts = gdh_NameToAttrref(pwr_cNObjid, objrefp->fullname, &aref); sts = gdh_NameToAttrref(pwr_cNObjid, objrefp->fullname, &aref);
if (EVEN (sts)) { if (EVEN (sts)) {
dl = FALSE; gdh_GetObjectLocation(aref.Objid, &dl);
if ( dl) {
rsts = sts;
continue;
}
} else { } else {
gdh_GetObjectLocation(aref.Objid, &dl); gdh_GetObjectLocation(aref.Objid, &dl);
} }
...@@ -3191,7 +3195,7 @@ gdh_RefObjectInfoList ( ...@@ -3191,7 +3195,7 @@ gdh_RefObjectInfoList (
free(isattrref); free(isattrref);
free(object); free(object);
return GDH__SUCCESS; return rsts;
} }
/** /**
......
...@@ -4494,13 +4494,18 @@ int Graph::ref_object_info_all() ...@@ -4494,13 +4494,18 @@ int Graph::ref_object_info_all()
gdh_SetSubscriptionDefaults( dt, tmo); gdh_SetSubscriptionDefaults( dt, tmo);
sts = gdh_RefObjectInfoList( refcnt, oref, refid); sts = gdh_RefObjectInfoList( refcnt, oref, refid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) {
printf( "** Link error for local object\n");
}
refcnt = 0; refcnt = 0;
for ( unsigned int i = 0; i < reflist.size(); i++) { for ( unsigned int i = 0; i < reflist.size(); i++) {
if ( reflist[i].m_cycle == cycle[j]) { if ( reflist[i].m_cycle == cycle[j]) {
*reflist[i].m_data = oref[refcnt].adrs; *reflist[i].m_data = oref[refcnt].adrs;
*reflist[i].m_id = refid[refcnt]; *reflist[i].m_id = refid[refcnt];
if ( EVEN(sts) && cdh_RefIdIsNull( refid[refcnt]))
printf( "** %s\n", reflist[i].m_name);
refcnt++; refcnt++;
} }
} }
...@@ -4908,6 +4913,7 @@ int graph_attr_string_to_value( int type_id, const char *value_str, ...@@ -4908,6 +4913,7 @@ int graph_attr_string_to_value( int type_id, const char *value_str,
break; break;
} }
case pwr_eType_Int32: case pwr_eType_Int32:
case pwr_eType_Enum:
{ {
if ( sscanf( value_str, "%d", (int *)buffer_ptr) != 1) if ( sscanf( value_str, "%d", (int *)buffer_ptr) != 1)
return GE__INPUT_SYNTAX; return GE__INPUT_SYNTAX;
...@@ -4937,7 +4943,6 @@ int graph_attr_string_to_value( int type_id, const char *value_str, ...@@ -4937,7 +4943,6 @@ int graph_attr_string_to_value( int type_id, const char *value_str,
} }
case pwr_eType_UInt32: case pwr_eType_UInt32:
case pwr_eType_Mask: case pwr_eType_Mask:
case pwr_eType_Enum:
{ {
if ( sscanf( value_str, "%lu", (unsigned long *)buffer_ptr) != 1) if ( sscanf( value_str, "%lu", (unsigned long *)buffer_ptr) != 1)
return GE__INPUT_SYNTAX; return GE__INPUT_SYNTAX;
......
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