Commit 4ea03d27 authored by claes's avatar claes

Object attributes wasn't displayed in nav

parent db87a91b
/* /*
* Proview $Id: wb_nav.cpp,v 1.13 2007-08-27 09:32:45 claes Exp $ * Proview $Id: wb_nav.cpp,v 1.14 2007-08-28 07:30:36 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
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
#include "xnav_bitmap_attr12.h" #include "xnav_bitmap_attr12.h"
#include "xnav_bitmap_attrarra12.h" #include "xnav_bitmap_attrarra12.h"
#include "xnav_bitmap_attrarel12.h" #include "xnav_bitmap_attrarel12.h"
#include "xnav_bitmap_object12.h"
typedef enum { typedef enum {
nav_mOpen_All = ~0, nav_mOpen_All = ~0,
...@@ -101,7 +102,8 @@ typedef enum { ...@@ -101,7 +102,8 @@ typedef enum {
nav_eItemType_Object, nav_eItemType_Object,
nav_eItemType_Attr, nav_eItemType_Attr,
nav_eItemType_AttrArray, nav_eItemType_AttrArray,
nav_eItemType_AttrArrayElem nav_eItemType_AttrArrayElem,
nav_eItemType_AttrObject
} nav_eItemType; } nav_eItemType;
class Item { class Item {
...@@ -134,9 +136,11 @@ public: ...@@ -134,9 +136,11 @@ public:
int body; int body;
int attr_idx; int attr_idx;
int type_id; int type_id;
pwr_tOName aname;
ItemAttr( Nav *nav, pwr_tObjid item_objid, ItemAttr( Nav *nav, pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code, int attr_body, brow_tNode dest, flow_eDest dest_code, int attr_body,
int idx, char *attr_name, int attr_type_id, int item_is_root); int idx, char *attr_name, char *attr_aname, int attr_type_id,
int item_is_root);
}; };
class ItemAttrArray : public Item { class ItemAttrArray : public Item {
...@@ -145,9 +149,11 @@ public: ...@@ -145,9 +149,11 @@ public:
int attr_idx; int attr_idx;
int elements; int elements;
int type_id; int type_id;
pwr_tOName aname;
ItemAttrArray( Nav *nav, pwr_tObjid item_objid, ItemAttrArray( Nav *nav, pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code, int attr_body, brow_tNode dest, flow_eDest dest_code, int attr_body,
int idx, char *attr_name, int attr_elements, int attr_type_id, int idx, char *attr_name, char *attr_aname, int attr_elements,
int attr_type_id,
int item_is_root); int item_is_root);
int open_children( Nav *nav, double x, double y); int open_children( Nav *nav, double x, double y);
int open_attributes( Nav *nav, double x, double y); int open_attributes( Nav *nav, double x, double y);
...@@ -160,10 +166,30 @@ public: ...@@ -160,10 +166,30 @@ public:
int attr_idx; int attr_idx;
int element; int element;
int type_id; int type_id;
pwr_tOName aname;
ItemAttrArrayElem( Nav *nav, pwr_tObjid item_objid, ItemAttrArrayElem( Nav *nav, pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code, int attr_body, brow_tNode dest, flow_eDest dest_code, int attr_body,
int idx, char *attr_name, int attr_element, int attr_type_id, int idx, char *attr_name, char *attr_aname, int attr_element,
int attr_type_id, int item_is_root);
};
class ItemAttrObject : public Item {
public:
int type_id;
bool is_elem;
int idx;
int element;
int flags;
int size;
int body;
pwr_tOName aname;
ItemAttrObject( Nav *nav, pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code,
char *attr_name, char *attr_aname, int attr_type_id, int attr_size,
bool attr_is_elem, int attr_idx, int attr_flags, int attr_body,
int item_is_root); int item_is_root);
int open_attributes( Nav *nav, double x, double y);
int close( Nav *nav, double x, double y);
}; };
// Prototypes of local functions // Prototypes of local functions
...@@ -404,16 +430,223 @@ int ItemObject::open_attributes( Nav *nav, double x, double y) ...@@ -404,16 +430,223 @@ int ItemObject::open_attributes( Nav *nav, double x, double y)
attr_exist = 1; attr_exist = 1;
item = (Item *) new ItemAttrArray( nav, objid, node, item = (Item *) new ItemAttrArray( nav, objid, node,
flow_eDest_IntoLast, flow_eDest_IntoLast,
j, i, bodydef[i].ParName, j, i, bodydef[i].ParName, 0,
bodydef[i].Par->Param.Info.Elements, bodydef[i].Par->Param.Info.Elements,
bodydef[i].Par->Param.Info.Type, is_root); bodydef[i].Par->Param.Info.Type, is_root);
} }
else if ( bodydef[i].Par->Param.Info.Flags & PWR_MASK_CLASS) {
attr_exist = 1;
item = (Item *) new ItemAttrObject( nav, objid, node,
flow_eDest_IntoLast,
bodydef[i].ParName, 0,
bodydef[i].Par->Param.Info.Type,
bodydef[i].Par->Param.Info.Size, false, 0,
bodydef[i].Par->Param.Info.Flags, j,
is_root);
}
else { else {
attr_exist = 1; attr_exist = 1;
item = (Item *) new ItemAttr( nav, objid, node, item = (Item *) new ItemAttr( nav, objid, node,
flow_eDest_IntoLast, j, i, bodydef[i].ParName, flow_eDest_IntoLast, j, i, bodydef[i].ParName, 0,
bodydef[i].Par->Param.Info.Type, is_root);
}
}
free( (char *)bodydef);
}
if ( ldhses != nav->ldhses)
ldh_CloseSession( ldhses);
if ( attr_exist && !is_root) {
brow_SetOpen( node, nav_mOpen_Attributes);
brow_SetAnnotPixmap( node, 1, nav->pixmap_openattr);
}
brow_ResetNodraw( nav->brow_ctx);
if ( attr_exist)
brow_Redraw( nav->brow_ctx, node_y);
}
return 1;
}
ItemAttrObject::ItemAttrObject( Nav *nav,
pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code,
char *attr_name, char *attr_aname, int attr_type_id,
int attr_size, bool attr_is_elem, int attr_idx,
int attr_flags, int attr_body, int item_is_root) :
Item( item_objid, item_is_root), type_id(attr_type_id),
is_elem(attr_is_elem), idx(attr_idx), flags( attr_flags), body(attr_body)
{
pwr_tOName annot;
int psize;
int sts;
char *s;
ldh_tSession ldhses;
type = nav_eItemType_AttrObject;
if ( !is_elem)
strcpy( name, attr_name);
else
sprintf( name, "%s[%d]", attr_name, idx);
if ( attr_aname && strcmp( attr_aname, "") != 0) {
strcpy( aname, attr_aname);
strcat( aname, ".");
strcat( aname, name);
}
else
strcpy( aname, name);
brow_CreateNode( nav->brow_ctx, attr_name, nav->nc_object,
dest, dest_code, this, 1, &node);
// Objects in mounted volumes has to use its own metavolumes.
if ( ldh_ExternObject( nav->ldhses, objid))
ldh_OpenMntSession( nav->ldhses, objid, &ldhses);
else
ldhses = nav->ldhses;
brow_SetAnnotPixmap( node, 0, nav->pixmap_attrobject);
if ( flags & PWR_MASK_CASTATTR) {
// Replace tid from class definition to tid from actual attribute, TODO...
}
s = strrchr( name, '.');
if ( s)
strcpy( annot, s+1);
else
strcpy( annot, name);
brow_SetAnnotation( node, 0, annot, strlen(annot));
// Set class annotation
sts = ldh_ObjidToName( ldhses, cdh_ClassIdToObjid( type_id), ldh_eName_Object,
annot, sizeof(annot), &psize);
if ( ODD(sts))
brow_SetAnnotation( node, 1, annot, strlen(annot));
if ( ldhses != nav->ldhses)
ldh_CloseSession( ldhses);
}
int ItemAttrObject::open_attributes( Nav *nav, double x, double y)
{
double node_x, node_y;
brow_GetNodePosition( node, &node_x, &node_y);
if ( brow_IsOpen( node) & nav_mOpen_Attributes) {
// Attributes is open, close
brow_SetNodraw( nav->brow_ctx);
brow_CloseNode( nav->brow_ctx, node);
brow_ResetOpen( node, nav_mOpen_Attributes);
brow_RemoveAnnotPixmap( node, 1);
brow_ResetNodraw( nav->brow_ctx);
brow_Redraw( nav->brow_ctx, node_y);
}
else {
Item *item;
int attr_exist;
int sts;
int i, j;
ldh_sParDef *bodydef;
int rows;
pwr_tClassId classid;
char body[20];
char parname[40];
ldh_tSession ldhses;
pwr_tAttrRef aref = cdh_ObjidToAref( objid);
if ( brow_IsOpen( node) & nav_mOpen_Children) {
// Close children first
brow_SetNodraw( nav->brow_ctx);
brow_CloseNode( nav->brow_ctx, node);
brow_ResetOpen( node, nav_mOpen_Children);
brow_SetAnnotPixmap( node, 0, nav->pixmap_map);
brow_ResetNodraw( nav->brow_ctx);
brow_Redraw( nav->brow_ctx, node_y);
}
// Create some attributes
brow_SetNodraw( nav->brow_ctx);
// Objects in mounted volumes has to use its own metavolumes.
if ( ldh_ExternObject( nav->ldhses, objid))
ldh_OpenMntSession( nav->ldhses, objid, &ldhses);
else
ldhses = nav->ldhses;
classid = type_id;
attr_exist = 0;
for ( j = 0; j < 3; j++) {
if ( j == 0)
strcpy( body, "DevBody");
else if ( j == 1)
strcpy( body, "RtBody");
else
strcpy( body, "SysBody");
sts = ldh_GetObjectBodyDef( ldhses, classid, body, 1,
&bodydef, &rows);
if ( EVEN(sts) ) continue;
for ( i = 0; i < rows; i++) {
if ( aref.Flags.b.Object)
strcpy( parname, bodydef[i].ParName);
else {
strcpy( parname, name);
strcat( parname, ".");
strcat( parname, bodydef[i].ParName);
}
if ( bodydef[i].Par->Param.Info.Flags & PWR_MASK_INVISIBLE ||
bodydef[i].Par->Param.Info.Flags & PWR_MASK_RTVIRTUAL)
continue;
if ( bodydef[i].Par->Output.Info.Flags & PWR_MASK_DISABLEATTR &&
i > 0) {
pwr_tDisableAttr disabled;
pwr_sAttrRef aar;
pwr_sAttrRef ar = cdh_ObjidToAref( objid);
sts = ldh_ArefANameToAref( ldhses, &ar, parname, &aar);
if ( EVEN(sts)) return sts;
sts = ldh_AttributeDisabled( ldhses, &aar, &disabled);
if ( EVEN(sts)) return sts;
if ( disabled)
continue;
}
if ( bodydef[i].Par->Param.Info.Flags & PWR_MASK_ARRAY) {
attr_exist = 1;
item = (Item *) new ItemAttrArray( nav, objid, node,
flow_eDest_IntoLast,
j, i, bodydef[i].ParName, aname,
bodydef[i].Par->Param.Info.Elements,
bodydef[i].Par->Param.Info.Type, is_root); bodydef[i].Par->Param.Info.Type, is_root);
} }
else if ( bodydef[i].Par->Param.Info.Flags & PWR_MASK_CLASS) {
attr_exist = 1;
item = (Item *) new ItemAttrObject( nav, objid, node,
flow_eDest_IntoLast,
bodydef[i].ParName, aname,
bodydef[i].Par->Param.Info.Type,
bodydef[i].Par->Param.Info.Size, false, 0,
bodydef[i].Par->Param.Info.Flags, j,
is_root);
}
else {
attr_exist = 1;
item = (Item *) new ItemAttr( nav, objid, node,
flow_eDest_IntoLast, j, i, bodydef[i].ParName,
aname, bodydef[i].Par->Param.Info.Type, is_root);
}
} }
free( (char *)bodydef); free( (char *)bodydef);
} }
...@@ -432,6 +665,25 @@ int ItemObject::open_attributes( Nav *nav, double x, double y) ...@@ -432,6 +665,25 @@ int ItemObject::open_attributes( Nav *nav, double x, double y)
return 1; return 1;
} }
int ItemAttrObject::close( Nav *nav, double x, double y)
{
double node_x, node_y;
brow_GetNodePosition( node, &node_x, &node_y);
if ( brow_IsOpen( node) & nav_mOpen_Attributes) {
// Attributes is open, close
brow_SetNodraw( nav->brow_ctx);
brow_CloseNode( nav->brow_ctx, node);
brow_RemoveAnnotPixmap( node, 1);
brow_ResetOpen( node, nav_mOpen_All);
brow_ResetNodraw( nav->brow_ctx);
brow_Redraw( nav->brow_ctx, node_y);
}
return 1;
}
int ItemAttrArray::close( Nav *nav, double x, double y) int ItemAttrArray::close( Nav *nav, double x, double y)
{ {
double node_x, node_y; double node_x, node_y;
...@@ -449,6 +701,7 @@ int ItemAttrArray::close( Nav *nav, double x, double y) ...@@ -449,6 +701,7 @@ int ItemAttrArray::close( Nav *nav, double x, double y)
return 1; return 1;
} }
int ItemAttrArray::open_children( Nav *nav, double x, double y) int ItemAttrArray::open_children( Nav *nav, double x, double y)
{ {
double node_x, node_y; double node_x, node_y;
...@@ -490,7 +743,8 @@ int ItemAttrArray::open_attributes( Nav *nav, double x, double y) ...@@ -490,7 +743,8 @@ int ItemAttrArray::open_attributes( Nav *nav, double x, double y)
for ( i = 0; i < elements; i++) for ( i = 0; i < elements; i++)
{ {
item = (Item *) new ItemAttrArrayElem( nav, objid, node, item = (Item *) new ItemAttrArrayElem( nav, objid, node,
flow_eDest_IntoLast, body, attr_idx, name, i, type_id, is_root); flow_eDest_IntoLast, body, attr_idx, name,
aname, i, type_id, is_root);
} }
if ( !is_root) { if ( !is_root) {
...@@ -504,7 +758,8 @@ int ItemAttrArray::open_attributes( Nav *nav, double x, double y) ...@@ -504,7 +758,8 @@ int ItemAttrArray::open_attributes( Nav *nav, double x, double y)
ItemAttr::ItemAttr( Nav *nav, pwr_tObjid item_objid, ItemAttr::ItemAttr( Nav *nav, pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code, int attr_body, brow_tNode dest, flow_eDest dest_code, int attr_body,
int idx, char *attr_name, int attr_type_id, int item_is_root) : int idx, char *attr_name, char *attr_aname, int attr_type_id,
int item_is_root) :
Item( item_objid, item_is_root), body(attr_body), Item( item_objid, item_is_root), body(attr_body),
attr_idx(idx), type_id(attr_type_id) attr_idx(idx), type_id(attr_type_id)
{ {
...@@ -513,6 +768,14 @@ ItemAttr::ItemAttr( Nav *nav, pwr_tObjid item_objid, ...@@ -513,6 +768,14 @@ ItemAttr::ItemAttr( Nav *nav, pwr_tObjid item_objid,
type = nav_eItemType_Attr; type = nav_eItemType_Attr;
strcpy( name, attr_name); strcpy( name, attr_name);
if ( attr_aname && strcmp( attr_aname, "") != 0) {
strcpy( aname, attr_aname);
strcat( aname, ".");
strcat( aname, name);
}
else
strcpy( aname, name);
if ( !is_root) { if ( !is_root) {
brow_CreateNode( nav->brow_ctx, attr_name, nav->nc_object, brow_CreateNode( nav->brow_ctx, attr_name, nav->nc_object,
dest, dest_code, NULL, 1, &node); dest, dest_code, NULL, 1, &node);
...@@ -534,8 +797,8 @@ ItemAttr::ItemAttr( Nav *nav, pwr_tObjid item_objid, ...@@ -534,8 +797,8 @@ ItemAttr::ItemAttr( Nav *nav, pwr_tObjid item_objid,
ItemAttrArray::ItemAttrArray( Nav *nav, pwr_tObjid item_objid, ItemAttrArray::ItemAttrArray( Nav *nav, pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code, int attr_body, brow_tNode dest, flow_eDest dest_code, int attr_body,
int idx, char *attr_name, int attr_elements, int attr_type_id, int idx, char *attr_name, char *attr_aname,
int item_is_root) : int attr_elements, int attr_type_id, int item_is_root) :
Item( item_objid, item_is_root), body(attr_body), Item( item_objid, item_is_root), body(attr_body),
attr_idx(idx), elements(attr_elements), type_id(attr_type_id) attr_idx(idx), elements(attr_elements), type_id(attr_type_id)
{ {
...@@ -544,6 +807,15 @@ ItemAttrArray::ItemAttrArray( Nav *nav, pwr_tObjid item_objid, ...@@ -544,6 +807,15 @@ ItemAttrArray::ItemAttrArray( Nav *nav, pwr_tObjid item_objid,
type = nav_eItemType_AttrArray; type = nav_eItemType_AttrArray;
strcpy( name, attr_name); strcpy( name, attr_name);
if ( attr_aname && strcmp( attr_aname, "") != 0) {
strcpy( aname, attr_aname);
strcat( aname, ".");
strcat( aname, name);
}
else
strcpy( aname, name);
if ( !is_root) { if ( !is_root) {
brow_CreateNode( nav->brow_ctx, attr_name, nav->nc_object, brow_CreateNode( nav->brow_ctx, attr_name, nav->nc_object,
dest, dest_code, NULL, 1, &node); dest, dest_code, NULL, 1, &node);
...@@ -558,7 +830,8 @@ ItemAttrArray::ItemAttrArray( Nav *nav, pwr_tObjid item_objid, ...@@ -558,7 +830,8 @@ ItemAttrArray::ItemAttrArray( Nav *nav, pwr_tObjid item_objid,
ItemAttrArrayElem::ItemAttrArrayElem( Nav *nav, pwr_tObjid item_objid, ItemAttrArrayElem::ItemAttrArrayElem( Nav *nav, pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code, int attr_body, brow_tNode dest, flow_eDest dest_code, int attr_body,
int idx, char *attr_name, int attr_element, int attr_type_id, int idx, char *attr_name, char *attr_aname,
int attr_element, int attr_type_id,
int item_is_root) : int item_is_root) :
Item( item_objid, item_is_root), body(attr_body), Item( item_objid, item_is_root), body(attr_body),
attr_idx(idx), element(attr_element), type_id(attr_type_id) attr_idx(idx), element(attr_element), type_id(attr_type_id)
...@@ -569,6 +842,14 @@ ItemAttrArrayElem::ItemAttrArrayElem( Nav *nav, pwr_tObjid item_objid, ...@@ -569,6 +842,14 @@ ItemAttrArrayElem::ItemAttrArrayElem( Nav *nav, pwr_tObjid item_objid,
sprintf( name, "%s[%d]", attr_name, element); sprintf( name, "%s[%d]", attr_name, element);
if ( attr_aname && strcmp( attr_aname, "") != 0) {
strcpy( aname, attr_aname);
strcat( aname, ".");
strcat( aname, name);
}
else
strcpy( aname, name);
if ( !is_root) { if ( !is_root) {
brow_CreateNode( nav->brow_ctx, name, nav->nc_object, brow_CreateNode( nav->brow_ctx, name, nav->nc_object,
dest, dest_code, NULL, 1, &node); dest, dest_code, NULL, 1, &node);
...@@ -926,6 +1207,38 @@ void Nav::allocate_pixmaps() ...@@ -926,6 +1207,38 @@ void Nav::allocate_pixmaps()
brow_AllocAnnotPixmap( brow_ctx, &pixmap_data, brow_AllocAnnotPixmap( brow_ctx, &pixmap_data,
&pixmap_attrarrayelem); &pixmap_attrarrayelem);
i = 0;
pixmap_data[i].width =xnav_bitmap_object12_width;
pixmap_data[i].height =xnav_bitmap_object12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_object12_bits;
pixmap_data[i].width =xnav_bitmap_object12_width;
pixmap_data[i].height =xnav_bitmap_object12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_object12_bits;
pixmap_data[i].width =xnav_bitmap_object12_width;
pixmap_data[i].height =xnav_bitmap_object12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_object12_bits;
pixmap_data[i].width =xnav_bitmap_object12_width;
pixmap_data[i].height =xnav_bitmap_object12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_object12_bits;
pixmap_data[i].width =xnav_bitmap_object12_width;
pixmap_data[i].height =xnav_bitmap_object12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_object12_bits;
pixmap_data[i].width =xnav_bitmap_object12_width;
pixmap_data[i].height =xnav_bitmap_object12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_object12_bits;
pixmap_data[i].width =xnav_bitmap_object12_width;
pixmap_data[i].height =xnav_bitmap_object12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_object12_bits;
pixmap_data[i].width =xnav_bitmap_object12_width;
pixmap_data[i].height =xnav_bitmap_object12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_object12_bits;
pixmap_data[i].width =xnav_bitmap_object12_width;
pixmap_data[i].height =xnav_bitmap_object12_height;
pixmap_data[i++].bits = (char *)xnav_bitmap_object12_bits;
brow_AllocAnnotPixmap( brow_ctx, &pixmap_data,
&pixmap_attrobject);
} }
...@@ -1075,6 +1388,9 @@ int Nav::brow_cb( FlowCtx *ctx, flow_tEvent event) ...@@ -1075,6 +1388,9 @@ int Nav::brow_cb( FlowCtx *ctx, flow_tEvent event)
case nav_eItemType_Object: case nav_eItemType_Object:
((ItemObject *)item)->open_attributes( nav, 0, 0); ((ItemObject *)item)->open_attributes( nav, 0, 0);
break; break;
case nav_eItemType_AttrObject:
((ItemAttrObject *)item)->open_attributes( nav, 0, 0);
break;
case nav_eItemType_AttrArray: case nav_eItemType_AttrArray:
((ItemAttrArray *)item)->open_attributes( nav, 0, 0); ((ItemAttrArray *)item)->open_attributes( nav, 0, 0);
break; break;
...@@ -1109,6 +1425,9 @@ int Nav::brow_cb( FlowCtx *ctx, flow_tEvent event) ...@@ -1109,6 +1425,9 @@ int Nav::brow_cb( FlowCtx *ctx, flow_tEvent event)
case nav_eItemType_Object: case nav_eItemType_Object:
((ItemObject *)item)->close( nav, 0, 0); ((ItemObject *)item)->close( nav, 0, 0);
break; break;
case nav_eItemType_AttrObject:
((ItemAttrObject *)item)->close( nav, 0, 0);
break;
case nav_eItemType_AttrArray: case nav_eItemType_AttrArray:
((ItemAttrArray *)item)->close( nav, 0, 0); ((ItemAttrArray *)item)->close( nav, 0, 0);
break; break;
...@@ -1142,6 +1461,10 @@ int Nav::brow_cb( FlowCtx *ctx, flow_tEvent event) ...@@ -1142,6 +1461,10 @@ int Nav::brow_cb( FlowCtx *ctx, flow_tEvent event)
((ItemAttrArray *)item)->open_children( nav, ((ItemAttrArray *)item)->open_children( nav,
event->object.x, event->object.y); event->object.x, event->object.y);
break; break;
case nav_eItemType_AttrObject:
((ItemAttrObject *)item)->open_attributes( nav,
event->object.x, event->object.y);
break;
default: default:
; ;
} }
...@@ -1159,6 +1482,10 @@ int Nav::brow_cb( FlowCtx *ctx, flow_tEvent event) ...@@ -1159,6 +1482,10 @@ int Nav::brow_cb( FlowCtx *ctx, flow_tEvent event)
((ItemObject *)item)->open_attributes( nav, ((ItemObject *)item)->open_attributes( nav,
event->object.x, event->object.y); event->object.x, event->object.y);
break; break;
case nav_eItemType_AttrObject:
((ItemAttrObject *)item)->open_attributes( nav,
event->object.x, event->object.y);
break;
case nav_eItemType_AttrArray: case nav_eItemType_AttrArray:
((ItemAttrArray *)item)->open_attributes( nav, ((ItemAttrArray *)item)->open_attributes( nav,
event->object.x, event->object.y); event->object.x, event->object.y);
...@@ -1435,10 +1762,22 @@ int Nav::get_select( pwr_sAttrRef *attrref, int *is_attr) ...@@ -1435,10 +1762,22 @@ int Nav::get_select( pwr_sAttrRef *attrref, int *is_attr)
memset( attrref, 0, sizeof(*attrref)); memset( attrref, 0, sizeof(*attrref));
switch( item->type) { switch( item->type) {
case nav_eItemType_Attr: case nav_eItemType_Attr:
strcat( attr_str, ".");
strcat( attr_str, ((ItemAttr *)item)->aname);
sts = ldh_NameToAttrRef( ldhses, attr_str, attrref);
if ( EVEN(sts)) return sts;
*is_attr = 1;
break;
case nav_eItemType_AttrArray: case nav_eItemType_AttrArray:
strcat( attr_str, ".");
strcat( attr_str, ((ItemAttrArray *)item)->aname);
sts = ldh_NameToAttrRef( ldhses, attr_str, attrref);
if ( EVEN(sts)) return sts;
*is_attr = 1;
break;
case nav_eItemType_AttrArrayElem: case nav_eItemType_AttrArrayElem:
strcat( attr_str, "."); strcat( attr_str, ".");
strcat( attr_str, item->name); strcat( attr_str, ((ItemAttrArrayElem *)item)->aname);
sts = ldh_NameToAttrRef( ldhses, attr_str, attrref); sts = ldh_NameToAttrRef( ldhses, attr_str, attrref);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
*is_attr = 1; *is_attr = 1;
......
/* /*
* Proview $Id: wb_nav.h,v 1.6 2007-01-05 10:40:31 claes Exp $ * Proview $Id: wb_nav.h,v 1.7 2007-08-28 07:30:36 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
...@@ -67,6 +67,7 @@ class Nav { ...@@ -67,6 +67,7 @@ class Nav {
flow_sAnnotPixmap *pixmap_attr; flow_sAnnotPixmap *pixmap_attr;
flow_sAnnotPixmap *pixmap_attrarray; flow_sAnnotPixmap *pixmap_attrarray;
flow_sAnnotPixmap *pixmap_attrarrayelem; flow_sAnnotPixmap *pixmap_attrarrayelem;
flow_sAnnotPixmap *pixmap_attrobject;
int (*get_plant_select_cb)( void *, char *); int (*get_plant_select_cb)( void *, char *);
int (*set_focus_cb)( void *, void *); int (*set_focus_cb)( void *, void *);
int (*traverse_focus_cb)( void *, void *); int (*traverse_focus_cb)( void *, void *);
......
/* /*
* Proview $Id: wb_wnav_item.cpp,v 1.23 2007-08-27 09:32:45 claes Exp $ * Proview $Id: wb_wnav_item.cpp,v 1.24 2007-08-28 07:30:36 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
...@@ -419,7 +419,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -419,7 +419,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
if ( bodydef[j].ParClass == pwr_eClass_Output) if ( bodydef[j].ParClass == pwr_eClass_Output)
{ {
new WItemAttrArrayOutput( wnav->brow, ldhses, objid, node, new WItemAttrArrayOutput( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, flow_eDest_IntoLast,
parname, parname,
bodydef[j].Par->Output.Info.Elements, bodydef[j].Par->Output.Info.Elements,
...@@ -431,7 +431,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -431,7 +431,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
output_cnt++; output_cnt++;
} }
else else
new WItemAttrArray( wnav->brow, ldhses, objid, node, new WItemAttrArray( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, flow_eDest_IntoLast,
parname, parname,
bodydef[j].Par->Output.Info.Elements, bodydef[j].Par->Output.Info.Elements,
...@@ -448,7 +448,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -448,7 +448,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
{ {
if ( bodydef[j].Par->Input.Info.Flags & PWR_MASK_NOREMOVE && if ( bodydef[j].Par->Input.Info.Flags & PWR_MASK_NOREMOVE &&
bodydef[j].Par->Input.Info.Flags & PWR_MASK_NOINVERT) bodydef[j].Par->Input.Info.Flags & PWR_MASK_NOINVERT)
new WItemAttr( wnav->brow, ldhses, objid, node, new WItemAttr( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, parname, flow_eDest_IntoLast, parname,
bodydef[j].Par->Input.Info.Type, bodydef[j].Par->Input.Info.Type,
bodydef[j].Par->Input.TypeRef, bodydef[j].Par->Input.TypeRef,
...@@ -456,7 +456,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -456,7 +456,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
bodydef[j].Par->Input.Info.Flags, bodydef[j].Par->Input.Info.Flags,
body, 0); body, 0);
else if ( bodydef[j].Par->Input.Info.Flags & PWR_MASK_NOREMOVE) else if ( bodydef[j].Par->Input.Info.Flags & PWR_MASK_NOREMOVE)
new WItemAttrInputInv( wnav->brow, ldhses, objid, node, new WItemAttrInputInv( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, parname, flow_eDest_IntoLast, parname,
bodydef[j].Par->Input.Info.Type, bodydef[j].Par->Input.Info.Type,
bodydef[j].Par->Input.TypeRef, bodydef[j].Par->Input.TypeRef,
...@@ -464,7 +464,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -464,7 +464,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
bodydef[j].Par->Input.Info.Flags, bodydef[j].Par->Input.Info.Flags,
body, input_cnt); body, input_cnt);
else if ( bodydef[j].Par->Input.Info.Flags & PWR_MASK_NOINVERT) else if ( bodydef[j].Par->Input.Info.Flags & PWR_MASK_NOINVERT)
new WItemAttrInputF( wnav->brow, ldhses, objid, node, new WItemAttrInputF( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, parname, flow_eDest_IntoLast, parname,
bodydef[j].Par->Input.Info.Type, bodydef[j].Par->Input.Info.Type,
bodydef[j].Par->Input.TypeRef, bodydef[j].Par->Input.TypeRef,
...@@ -472,7 +472,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -472,7 +472,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
bodydef[j].Par->Input.Info.Flags, bodydef[j].Par->Input.Info.Flags,
body, input_cnt); body, input_cnt);
else else
new WItemAttrInput( wnav->brow, ldhses, objid, node, new WItemAttrInput( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, parname, flow_eDest_IntoLast, parname,
bodydef[j].Par->Input.Info.Type, bodydef[j].Par->Input.Info.Type,
bodydef[j].Par->Input.TypeRef, bodydef[j].Par->Input.TypeRef,
...@@ -483,7 +483,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -483,7 +483,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
else else
{ {
if ( bodydef[j].Par->Input.Info.Flags & PWR_MASK_NOREMOVE) if ( bodydef[j].Par->Input.Info.Flags & PWR_MASK_NOREMOVE)
new WItemAttr( wnav->brow, ldhses, objid, node, new WItemAttr( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, parname, flow_eDest_IntoLast, parname,
bodydef[j].Par->Input.Info.Type, bodydef[j].Par->Input.Info.Type,
bodydef[j].Par->Input.TypeRef, bodydef[j].Par->Input.TypeRef,
...@@ -491,7 +491,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -491,7 +491,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
bodydef[j].Par->Input.Info.Flags, bodydef[j].Par->Input.Info.Flags,
body, 0); body, 0);
else else
new WItemAttrInputF( wnav->brow, ldhses, objid, node, new WItemAttrInputF( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, parname, flow_eDest_IntoLast, parname,
bodydef[j].Par->Input.Info.Type, bodydef[j].Par->Input.Info.Type,
bodydef[j].Par->Input.TypeRef, bodydef[j].Par->Input.TypeRef,
...@@ -505,7 +505,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -505,7 +505,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
else if ( bodydef[j].ParClass == pwr_eClass_Output) else if ( bodydef[j].ParClass == pwr_eClass_Output)
{ {
if ( bodydef[j].Par->Output.Info.Flags & PWR_MASK_NOREMOVE) if ( bodydef[j].Par->Output.Info.Flags & PWR_MASK_NOREMOVE)
new WItemAttr( wnav->brow, ldhses, objid, node, new WItemAttr( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, parname, flow_eDest_IntoLast, parname,
bodydef[j].Par->Output.Info.Type, bodydef[j].Par->Output.Info.Type,
bodydef[j].Par->Output.TypeRef, bodydef[j].Par->Output.TypeRef,
...@@ -513,7 +513,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -513,7 +513,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
bodydef[j].Par->Output.Info.Flags, bodydef[j].Par->Output.Info.Flags,
body, 0); body, 0);
else else
new WItemAttrOutput( wnav->brow, ldhses, objid, node, new WItemAttrOutput( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, parname, flow_eDest_IntoLast, parname,
bodydef[j].Par->Output.Info.Type, bodydef[j].Par->Output.Info.Type,
bodydef[j].Par->Output.TypeRef, bodydef[j].Par->Output.TypeRef,
...@@ -526,14 +526,14 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -526,14 +526,14 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
else else
{ {
if ( bodydef[j].Par->Output.Info.Flags & PWR_MASK_CLASS) if ( bodydef[j].Par->Output.Info.Flags & PWR_MASK_CLASS)
new WItemAttrObject( wnav->brow, ldhses, objid, node, new WItemAttrObject( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, parname, flow_eDest_IntoLast, parname,
bodydef[j].Par->Output.Info.Type, bodydef[j].Par->Output.Info.Type,
bodydef[j].Par->Output.Info.Size, false, 0, bodydef[j].Par->Output.Info.Size, false, 0,
bodydef[j].Par->Output.Info.Flags, bodydef[j].Par->Output.Info.Flags,
body, 0); body, 0);
else else
new WItemAttr( wnav->brow, ldhses, objid, node, new WItemAttr( wnav->brow, wnav->ldhses, objid, node,
flow_eDest_IntoLast, parname, flow_eDest_IntoLast, parname,
bodydef[j].Par->Output.Info.Type, bodydef[j].Par->Output.Info.Type,
bodydef[j].Par->Output.TypeRef, bodydef[j].Par->Output.TypeRef,
...@@ -547,7 +547,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -547,7 +547,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
sts = ldh_GetDocBlock( ldhses, objid, &block, &size); sts = ldh_GetDocBlock( ldhses, objid, &block, &size);
if ( ODD(sts)) { if ( ODD(sts)) {
new WItemDocBlock( wnav->brow, ldhses, objid, block, size, new WItemDocBlock( wnav->brow, wnav->ldhses, objid, block, size,
node, flow_eDest_IntoLast); node, flow_eDest_IntoLast);
attr_exist = 1; attr_exist = 1;
} }
...@@ -2206,10 +2206,21 @@ WItemAttrObject::WItemAttrObject( ...@@ -2206,10 +2206,21 @@ WItemAttrObject::WItemAttrObject(
// Set class annotation // Set class annotation
if ( ((WNav *)brow->userdata)->gbl.show_class) { if ( ((WNav *)brow->userdata)->gbl.show_class) {
sts = ldh_ObjidToName( ldhses, cdh_ClassIdToObjid( type_id), ldh_eName_Object, ldh_tSession lses;
// Objects in mounted volumes has to use its own metavolumes.
if ( ldh_ExternObject( ldhses, objid))
ldh_OpenMntSession( ldhses, objid, &lses);
else
lses = ldhses;
sts = ldh_ObjidToName( lses, cdh_ClassIdToObjid( type_id), ldh_eName_Object,
annot, sizeof(annot), &psize); annot, sizeof(annot), &psize);
if ( ODD(sts)) if ( ODD(sts))
brow_SetAnnotation( node, next_annot++, annot, strlen(annot)); brow_SetAnnotation( node, next_annot++, annot, strlen(annot));
if ( lses != ldhses)
ldh_CloseSession( lses);
} }
// Set description annotation // Set description annotation
...@@ -2291,18 +2302,25 @@ int WItemAttrObject::open_attributes( double x, double y) ...@@ -2291,18 +2302,25 @@ int WItemAttrObject::open_attributes( double x, double y)
int input_cnt = 0; int input_cnt = 0;
int output_cnt = 0; int output_cnt = 0;
int is_casted = 0; int is_casted = 0;
ldh_tSession lses;
classid = type_id; classid = type_id;
// Objects in mounted volumes has to use its own metavolumes.
if ( ldh_ExternObject( ldhses, objid))
ldh_OpenMntSession( ldhses, objid, &lses);
else
lses = ldhses;
// Check if attrobject is casted // Check if attrobject is casted
if ( flags & PWR_MASK_CASTATTR) { if ( flags & PWR_MASK_CASTATTR) {
pwr_sAttrRef ar = cdh_ObjidToAref( objid); pwr_sAttrRef ar = cdh_ObjidToAref( objid);
pwr_sAttrRef aar; pwr_sAttrRef aar;
sts = ldh_ArefANameToAref( ldhses, &ar, name, &aar); sts = ldh_ArefANameToAref( lses, &ar, name, &aar);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
sts = ldh_GetAttrRefOrigTid( ldhses, &aar, &orig_classid); sts = ldh_GetAttrRefOrigTid( lses, &aar, &orig_classid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( orig_classid != classid) { if ( orig_classid != classid) {
...@@ -2324,10 +2342,10 @@ int WItemAttrObject::open_attributes( double x, double y) ...@@ -2324,10 +2342,10 @@ int WItemAttrObject::open_attributes( double x, double y)
strcpy( body, "SysBody"); strcpy( body, "SysBody");
if ( ((WNav *)brow->userdata)->gbl.show_truedb) if ( ((WNav *)brow->userdata)->gbl.show_truedb)
sts = ldh_GetTrueObjectBodyDef( ldhses, classid, body, 1, sts = ldh_GetTrueObjectBodyDef( lses, classid, body, 1,
&bodydef, &rows); &bodydef, &rows);
else else
sts = ldh_GetObjectBodyDef( ldhses, classid, body, 1, sts = ldh_GetObjectBodyDef( lses, classid, body, 1,
&bodydef, &rows); &bodydef, &rows);
if ( EVEN(sts)) if ( EVEN(sts))
continue; continue;
...@@ -2360,10 +2378,10 @@ int WItemAttrObject::open_attributes( double x, double y) ...@@ -2360,10 +2378,10 @@ int WItemAttrObject::open_attributes( double x, double y)
pwr_sAttrRef aar; pwr_sAttrRef aar;
pwr_sAttrRef ar = cdh_ObjidToAref( objid); pwr_sAttrRef ar = cdh_ObjidToAref( objid);
sts = ldh_ArefANameToAref( ldhses, &ar, parname, &aar); sts = ldh_ArefANameToAref( lses, &ar, parname, &aar);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
sts = ldh_AttributeDisabled( ldhses, &aar, &disabled); sts = ldh_AttributeDisabled( lses, &aar, &disabled);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( disabled) if ( disabled)
...@@ -2497,6 +2515,9 @@ int WItemAttrObject::open_attributes( double x, double y) ...@@ -2497,6 +2515,9 @@ int WItemAttrObject::open_attributes( double x, double y)
} }
if ( lses != ldhses)
ldh_CloseSession( lses);
if ( attr_exist && !is_root) { if ( attr_exist && !is_root) {
brow_SetOpen( node, wnav_mOpen_Attributes); brow_SetOpen( node, wnav_mOpen_Attributes);
brow_SetAnnotPixmap( node, 1, brow->pixmap_openattr); brow_SetAnnotPixmap( node, 1, brow->pixmap_openattr);
......
/* /*
* Proview $Id: wb_wnav_selformat.cpp,v 1.6 2007-04-25 13:39:21 claes Exp $ * Proview $Id: wb_wnav_selformat.cpp,v 1.7 2007-08-28 07:30:36 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
...@@ -90,6 +90,13 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref ...@@ -90,6 +90,13 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
char *name_ptr; char *name_ptr;
pwr_tObjid object = attrref.Objid; pwr_tObjid object = attrref.Objid;
char *name_p; char *name_p;
ldh_tSession lses;
// Objects in mounted volumes has to use its own metavolumes.
if ( ldh_ExternObject( ldhses, attrref.Objid))
ldh_OpenMntSession( ldhses, attrref.Objid, &lses);
else
lses = ldhses;
if ( select_syntax == wnav_eSelectionMode_Extern && !select_attr) { if ( select_syntax == wnav_eSelectionMode_Extern && !select_attr) {
sts = ldh_ObjidToName( ldhses, object, ldh_eName_Objid, sts = ldh_ObjidToName( ldhses, object, ldh_eName_Objid,
...@@ -100,22 +107,23 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref ...@@ -100,22 +107,23 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
return TRUE; return TRUE;
} }
else if ( select_syntax == wnav_eSelectionMode_Extern && select_attr) { else if ( select_syntax == wnav_eSelectionMode_Extern && select_attr) {
sts = ldh_ObjidToName( ldhses, object, ldh_eName_Default, sts = ldh_ObjidToName( lses, object, ldh_eName_Default,
name, sizeof(name), &ret_len); name, sizeof(name), &ret_len);
if (EVEN(sts)) return FALSE; if (EVEN(sts)) return FALSE;
} }
else if ( select_volume) { else if ( select_volume) {
sts = ldh_AttrRefToName(ldhses, &attrref, sts = ldh_AttrRefToName(lses, &attrref,
cdh_mName_volume | cdh_mName_object | cdh_mName_attribute, cdh_mName_volume | cdh_mName_object | cdh_mName_attribute,
&name_p, &ret_len); &name_p, &ret_len);
if (EVEN(sts)) return FALSE; if (EVEN(sts)) return FALSE;
strcpy( name, name_p); strcpy( name, name_p);
} }
else { else {
sts = ldh_AttrRefToName(ldhses, &attrref, sts = ldh_AttrRefToName(lses, &attrref,
cdh_mName_path | cdh_mName_object | cdh_mName_attribute, cdh_mName_path | cdh_mName_object | cdh_mName_attribute,
&name_p, &ret_len); &name_p, &ret_len);
if (EVEN(sts)) return FALSE; if (EVEN(sts)) return FALSE;
strcpy( name, name_p); strcpy( name, name_p);
} }
...@@ -152,13 +160,13 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref ...@@ -152,13 +160,13 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
aref = attrref; aref = attrref;
if (select_attr && !is_class) { if (select_attr && !is_class) {
sts = ldh_GetAttrRefTid( ldhses, &attrref, &classid); sts = ldh_GetAttrRefTid( lses, &attrref, &classid);
if ( EVEN(sts)) return FALSE; if ( EVEN(sts)) return FALSE;
if ( !is_attr || (cdh_tidIsCid(classid) && !attrref.Flags.b.Array)) { if ( !is_attr || (cdh_tidIsCid(classid) && !attrref.Flags.b.Array)) {
// Get the debugparameter if there is one, else add ActualValue // Get the debugparameter if there is one, else add ActualValue
sts = ldh_GetClassBody(ldhses, classid, sts = ldh_GetClassBody(lses, classid,
"GraphPlcNode", &body_class, (char **)&graph_body, &size); "GraphPlcNode", &body_class, (char **)&graph_body, &size);
if ( ODD(sts)) if ( ODD(sts))
strcpy(attr_name, graph_body->debugpar); strcpy(attr_name, graph_body->debugpar);
...@@ -169,13 +177,13 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref ...@@ -169,13 +177,13 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
strcat(name, attr_name); strcat(name, attr_name);
// Check if attribute exists // Check if attribute exists
sts = ldh_NameToAttrRef(ldhses, name, &aref); sts = ldh_NameToAttrRef(lses, name, &aref);
if (ODD(sts)) { if (ODD(sts)) {
sts = ldh_GetAttrRefTid( ldhses, &aref, &classid); sts = ldh_GetAttrRefTid( lses, &aref, &classid);
if ( EVEN(sts)) return FALSE; if ( EVEN(sts)) return FALSE;
if (select_syntax == wnav_eSelectionMode_Extern && select_attr) { if (select_syntax == wnav_eSelectionMode_Extern && select_attr) {
sts = ldh_AttrRefToName(ldhses, &aref, sts = ldh_AttrRefToName(lses, &aref,
ldh_eName_ArefExport, ldh_eName_ArefExport,
&name_ptr, &ret_len); &name_ptr, &ret_len);
if (EVEN(sts)) return FALSE; if (EVEN(sts)) return FALSE;
...@@ -192,7 +200,7 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref ...@@ -192,7 +200,7 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
ldh_sAttrRefInfo info; ldh_sAttrRefInfo info;
int idx; int idx;
ldh_GetAttrRefInfo( ldhses, &aref, &info); ldh_GetAttrRefInfo( lses, &aref, &info);
if ( ODD(sts) && if ( ODD(sts) &&
wnav_type_to_string( info.type, type_buff, NULL)) { wnav_type_to_string( info.type, type_buff, NULL)) {
char num[8]; char num[8];
...@@ -206,9 +214,9 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref ...@@ -206,9 +214,9 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
*p2 = 0; *p2 = 0;
// Get attrref info for array // Get attrref info for array
sts = ldh_NameToAttrRef(ldhses, buff, &aref); sts = ldh_NameToAttrRef(lses, buff, &aref);
if (ODD(sts)) if (ODD(sts))
sts = ldh_GetAttrRefInfo( ldhses, &aref, &info); sts = ldh_GetAttrRefInfo( lses, &aref, &info);
} }
if ( info.type == pwr_eType_String) { if ( info.type == pwr_eType_String) {
sprintf(num, "%d", info.size/info.nElement); sprintf(num, "%d", info.size/info.nElement);
...@@ -228,14 +236,17 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref ...@@ -228,14 +236,17 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
} }
} }
if ( select_syntax == wnav_eSelectionMode_Extern && select_attr) { if ( select_syntax == wnav_eSelectionMode_Extern && select_attr) {
sts = ldh_NameToAttrRef(ldhses, buff, &aref); sts = ldh_NameToAttrRef(lses, buff, &aref);
if (EVEN(sts)) return FALSE; if (EVEN(sts)) return FALSE;
sts = ldh_AttrRefToName( ldhses, &aref, sts = ldh_AttrRefToName( lses, &aref,
ldh_eName_ArefExport, &p1, &size); ldh_eName_ArefExport, &p1, &size);
if (EVEN(sts)) return FALSE; if (EVEN(sts)) return FALSE;
strcpy( buff, p1); strcpy( buff, p1);
} }
if ( lses != ldhses)
ldh_CloseSession( lses);
return TRUE; return TRUE;
} }
......
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