Commit 5e4fc084 authored by claes's avatar claes

Search string didn't work on attrrefs

parent 841d4681
/* /*
* Proview $Id: wb_gre.c,v 1.18 2006-04-24 13:22:24 claes Exp $ * Proview $Id: wb_gre.c,v 1.19 2006-06-15 12:16:33 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -843,95 +843,98 @@ int gre_node_annot_message( ...@@ -843,95 +843,98 @@ int gre_node_annot_message(
*message = '\0'; *message = '\0';
annotcount = 0; annotcount = 0;
for ( i = 0; i < rows; i++) for ( i = 0; i < rows; i++) {
{ strcpy( annot_str, "");
strcpy( annot_str, ""); annotnr = 0;
annotnr = 0; switch ( bodydef[i].ParClass ) {
switch ( bodydef[i].ParClass ) case pwr_eClass_Input: {
{ annotnr = bodydef[i].Par->Input.Graph.NiNaAnnot;
case pwr_eClass_Input: type = bodydef[i].Par->Input.Info.Type;
{ parname = bodydef[i].ParName;
annotnr = bodydef[i].Par->Input.Graph.NiNaAnnot; break;
type = bodydef[i].Par->Input.Info.Type; }
parname = bodydef[i].ParName; case pwr_eClass_Intern: {
break; annotnr = bodydef[i].Par->Intern.Graph.NiNaAnnot;
} type = bodydef[i].Par->Intern.Info.Type;
case pwr_eClass_Intern: parname = bodydef[i].ParName;
{ break;
annotnr = bodydef[i].Par->Intern.Graph.NiNaAnnot; }
type = bodydef[i].Par->Intern.Info.Type; case pwr_eClass_Output: {
parname = bodydef[i].ParName; annotnr = bodydef[i].Par->Output.Graph.NiNaAnnot;
break; type = bodydef[i].Par->Output.Info.Type;
} parname = bodydef[i].ParName;
case pwr_eClass_Output: break;
{ }
annotnr = bodydef[i].Par->Output.Graph.NiNaAnnot; default:
type = bodydef[i].Par->Output.Info.Type; ;
parname = bodydef[i].ParName; }
break; if( annotnr != 0) {
} /* Get the parameter value */
default: sts = ldh_GetObjectPar( (node->hn.wind)->hw.ldhses,
; node->ln.oid,
} "DevBody",
if( annotnr != 0 ) bodydef[i].ParName,
{ (char **)&parvalue, &size);
/* Get the parameter value */ if ( EVEN(sts)) return sts;
sts = ldh_GetObjectPar( (node->hn.wind)->hw.ldhses,
node->ln.oid, switch ( type ) {
"DevBody", case pwr_eType_Float32: {
bodydef[i].ParName,
(char **)&parvalue, &size);
if ( EVEN(sts)) return sts;
switch ( type )
{
case pwr_eType_Float32:
{
parfloat = (pwr_tFloat32 *)parvalue; parfloat = (pwr_tFloat32 *)parvalue;
sprintf( annot_str,"%f", *parfloat); sprintf( annot_str,"%f", *parfloat);
break; break;
} }
case pwr_eType_String: case pwr_eType_String:
case pwr_eType_Text: case pwr_eType_Text: {
{
strncpy( annot_str, parvalue, strncpy( annot_str, parvalue,
co_min( sizeof(annot_str), annot_max_size)); co_min( sizeof(annot_str), annot_max_size));
annot_str[co_min( sizeof(annot_str), annot_max_size)-1] = 0; annot_str[co_min( sizeof(annot_str), annot_max_size)-1] = 0;
break; break;
} }
case pwr_eType_Char: case pwr_eType_Char: {
{
annot_str[0] = *parvalue; annot_str[0] = *parvalue;
annot_str[1] = '\0'; annot_str[1] = '\0';
break; break;
} }
case pwr_eType_ObjDId: case pwr_eType_Objid: {
{
/* Get the object name from ldh */ /* Get the object name from ldh */
parobjdid = (pwr_tObjid *)parvalue; parobjdid = (pwr_tObjid *)parvalue;
if ( cdh_ObjidIsNull(*parobjdid)) if ( cdh_ObjidIsNull(*parobjdid))
annot_str[0] = '\0'; annot_str[0] = '\0';
else else {
{ sts = ldh_ObjidToName( (node->hn.wind)->hw.ldhses,
sts = ldh_ObjidToName( (node->hn.wind)->hw.ldhses, *parobjdid, ldh_eName_Object,
*parobjdid, ldh_eName_Object, annot_str, sizeof( annot_str), &size);
annot_str, sizeof( annot_str), &size); if ( EVEN(sts)) annot_str[0] = '\0';
if ( EVEN(sts)) annot_str[0] = '\0'; }
} break;
}
case pwr_eType_AttrRef: {
/* Get the object name from ldh */
pwr_tAttrRef *arp = (pwr_tAttrRef *)parvalue;
char *name;
if ( cdh_ObjidIsNull(arp->Objid))
annot_str[0] = '\0';
else {
sts = ldh_AttrRefToName( (node->hn.wind)->hw.ldhses,
arp, ldh_eName_ArefObject,
&name, &size);
if ( EVEN(sts)) annot_str[0] = '\0';
strcpy( annot_str, name);
}
break; break;
} }
} }
if ( strcmp( annot_str, "") != 0) if ( strcmp( annot_str, "") != 0) {
{
if (annotcount != 0) if (annotcount != 0)
strncat( message, ", ", msg_size-strlen(message)); strncat( message, ", ", msg_size-strlen(message));
strncat( message, annot_str, msg_size-strlen(message)); strncat( message, annot_str, msg_size-strlen(message));
annotcount++; annotcount++;
} }
free((char *) parvalue); free((char *) parvalue);
if ( annotcount >= 3 ) break; if ( annotcount >= 3 ) break;
} }
} }
free((char *) bodydef); free((char *) bodydef);
message[msg_size-1] = 0; message[msg_size-1] = 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