Commit 3848e8bc authored by Claes Sjofors's avatar Claes Sjofors

Xtt signal flags, inv/conv/test displayed in collection view

parent 6e628f3e
......@@ -768,10 +768,10 @@ ItemAttr::ItemAttr( XNavBrow *brow, pwr_tObjid item_objid,
ItemBaseAttr( item_objid, attr_name,
attr_type_id, attr_tid, attr_size, attr_flags, item_is_root, item_display_type)
{
pwr_tOName obj_name;
pwr_tObjName obj_name;
pwr_tAName annot;
int sts;
type = xnav_eItemType_Attr;
strcpy( name, attr_name);
......@@ -835,6 +835,7 @@ ItemAttr::ItemAttr( XNavBrow *brow, pwr_tObjid item_objid,
else
brow_SetTraceAttr( node, obj_name, attr_name, flow_eTraceType_User);
}
}
ItemAttrArray::ItemAttrArray( XNavBrow *brow, pwr_tObjid item_objid,
......@@ -1479,7 +1480,7 @@ ItemCollect::ItemCollect( XNavBrow *brow, pwr_tObjid item_objid, char *attr_name
attr_type_id, attr_tid, attr_size, attr_flags, item_is_root, item_eDisplayType_Path)
{
int sts;
pwr_tOName obj_name;
pwr_tAName obj_name;
pwr_tObjid tst_objid;
type = xnav_eItemType_Collect;
......@@ -1510,6 +1511,52 @@ ItemCollect::ItemCollect( XNavBrow *brow, pwr_tObjid item_objid, char *attr_name
brow_SetTraceAttr( node, obj_name, attr, flow_eTraceType_User);
}
set_signal_flags( brow);
}
// Add signal flags
void ItemCollect::set_signal_flags( XNavBrow *brow)
{
pwr_tAName obj_name;
pwr_tStatus sts;
sts = gdh_ObjidToName( objid, obj_name, sizeof(obj_name), cdh_mName_volumeStrict);
if ( EVEN(sts)) throw co_error(sts);
strcat( obj_name, ".");
strcat( obj_name, attr);
char *s = strrchr( obj_name, '.');
if ( s && strcmp( s + 1, "ActualValue") == 0) {
pwr_tAttrRef aref;
pwr_tCid cid;
*s = 0;
sts = gdh_NameToAttrref( pwr_cNObjid, obj_name, &aref);
if ( EVEN(sts)) return;
sts = gdh_GetAttrRefTid( &aref, &cid);
if ( EVEN(sts)) return;
switch ( cid) {
case pwr_cClass_Di:
case pwr_cClass_Do:
case pwr_cClass_Ii:
case pwr_cClass_Io:
case pwr_cClass_Ai:
case pwr_cClass_Ao:
case pwr_cClass_Co:
case pwr_cClass_Po: {
xnav_set_sigchan_flags( brow, &aref, cid, node, 1);
break;
}
default: ;
}
}
}
static int add_window( XNav *xnav, pwr_tObjid objid, brow_tNode node, int *child_exist)
......@@ -2490,6 +2537,8 @@ static void xnav_set_sigchan_flags( XNavBrow *brow, pwr_tAttrRef *arp, pwr_tCid
brow_SetAnnotPixmap( node, annot, brow->pixmap_teston);
else if ( inv)
brow_SetAnnotPixmap( node, annot, brow->pixmap_inverted);
else
brow_RemoveAnnotPixmap( node, annot);
}
......
......@@ -326,6 +326,7 @@ class ItemCollect : public ItemBaseAttr {
ItemCollect( XNavBrow *brow, pwr_tObjid item_objid, char *attr_name,
brow_tNode dest, flow_eDest dest_code, int attr_type_id, pwr_tTid attr_tid,
int attr_size, int attr_flags, int item_is_root);
void set_signal_flags( XNavBrow *brow);
};
class ItemMenu : public Item {
......
......@@ -588,6 +588,14 @@ int XAttNav::trace_scan_bc( brow_tObject object, void *p)
ItemAttr *item;
item = (ItemAttr *)base_item;
if ( item->type == xnav_eItemType_Collect) {
// Add signal flags
XAttNav *xattnav;
brow_GetCtxUserData( brow_GetCtx( item->node), (void **)&xattnav);
((ItemCollect *)item)->set_signal_flags( xattnav->brow);
}
if ( !item->first_scan)
{
if ( item->size > (int) sizeof(item->old_value) &&
......
......@@ -2488,6 +2488,14 @@ int XNav::trace_scan_bc( brow_tObject object, void *p)
ItemAttr *item;
item = (ItemAttr *)base_item;
if ( item->type == xnav_eItemType_Collect) {
// Add signal flags
XNav *xnav;
brow_GetCtxUserData( brow_GetCtx( item->node), (void **)&xnav);
((ItemCollect *)item)->set_signal_flags( xnav->brow);
}
if ( !item->first_scan)
{
if ( item->size > (int) sizeof(item->old_value) &&
......@@ -2508,6 +2516,7 @@ int XNav::trace_scan_bc( brow_tObject object, void *p)
brow_SetAnnotation( object, 1, buf, len);
memcpy( item->old_value, p, min(item->size, (int) sizeof(item->old_value)));
break;
}
case xnav_eItemType_Enum: {
......
......@@ -1215,6 +1215,7 @@ void XNavBrow::create_nodeclasses()
brow_CreateNodeClass( ctx, "NavigatorAttr",
flow_eNodeGroup_Common, &nc_attr);
brow_AddAnnotPixmap( nc_attr, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnotPixmap( nc_attr, 1, 1.4, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnot( nc_attr, 2.9, 0.6, 0,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine,
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