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,28 +843,23 @@ int gre_node_annot_message( ...@@ -843,28 +843,23 @@ 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: {
case pwr_eClass_Input:
{
annotnr = bodydef[i].Par->Input.Graph.NiNaAnnot; annotnr = bodydef[i].Par->Input.Graph.NiNaAnnot;
type = bodydef[i].Par->Input.Info.Type; type = bodydef[i].Par->Input.Info.Type;
parname = bodydef[i].ParName; parname = bodydef[i].ParName;
break; break;
} }
case pwr_eClass_Intern: case pwr_eClass_Intern: {
{
annotnr = bodydef[i].Par->Intern.Graph.NiNaAnnot; annotnr = bodydef[i].Par->Intern.Graph.NiNaAnnot;
type = bodydef[i].Par->Intern.Info.Type; type = bodydef[i].Par->Intern.Info.Type;
parname = bodydef[i].ParName; parname = bodydef[i].ParName;
break; break;
} }
case pwr_eClass_Output: case pwr_eClass_Output: {
{
annotnr = bodydef[i].Par->Output.Graph.NiNaAnnot; annotnr = bodydef[i].Par->Output.Graph.NiNaAnnot;
type = bodydef[i].Par->Output.Info.Type; type = bodydef[i].Par->Output.Info.Type;
parname = bodydef[i].ParName; parname = bodydef[i].ParName;
...@@ -873,8 +868,7 @@ int gre_node_annot_message( ...@@ -873,8 +868,7 @@ int gre_node_annot_message(
default: default:
; ;
} }
if( annotnr != 0 ) if( annotnr != 0) {
{
/* Get the parameter value */ /* Get the parameter value */
sts = ldh_GetObjectPar( (node->hn.wind)->hw.ldhses, sts = ldh_GetObjectPar( (node->hn.wind)->hw.ldhses,
node->ln.oid, node->ln.oid,
...@@ -883,36 +877,30 @@ int gre_node_annot_message( ...@@ -883,36 +877,30 @@ int gre_node_annot_message(
(char **)&parvalue, &size); (char **)&parvalue, &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
switch ( type ) switch ( type ) {
{ case pwr_eType_Float32: {
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);
...@@ -920,9 +908,24 @@ int gre_node_annot_message( ...@@ -920,9 +908,24 @@ int gre_node_annot_message(
} }
break; 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);
} }
if ( strcmp( annot_str, "") != 0) break;
{ }
}
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));
......
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