Commit 693f42fb authored by Claes Sjofors's avatar Claes Sjofors

Xtt 'show device' channels in io module wasn't displayed

parent b38910cf
...@@ -545,6 +545,7 @@ class XNav { ...@@ -545,6 +545,7 @@ class XNav {
int show_subcli(); int show_subcli();
int show_device(); int show_device();
int show_channels( pwr_tObjid card_objid); int show_channels( pwr_tObjid card_objid);
int show_attr_channels( pwr_tAttrRef *mod_aref);
int show_object( pwr_tAttrRef *oarp, brow_tNode node); int show_object( pwr_tAttrRef *oarp, brow_tNode node);
int show_remnode(); int show_remnode();
int show_remtrans( pwr_tObjid remnode_objid); int show_remtrans( pwr_tObjid remnode_objid);
......
...@@ -1076,21 +1076,55 @@ int XNav::show_channels( pwr_tObjid card_objid) ...@@ -1076,21 +1076,55 @@ int XNav::show_channels( pwr_tObjid card_objid)
// Get all intern channels // Get all intern channels
if ( !child_found) { if ( !child_found) {
pwr_tAttrRef card_aref = cdh_ObjidToAref( card_objid);
sts = show_attr_channels( &card_aref);
if ( EVEN(sts)) return sts;
}
brow_ResetNodraw( brow->ctx);
brow_Redraw( brow->ctx, 0);
force_trace_scan();
return XNAV__SUCCESS;
}
int XNav::show_attr_channels( pwr_tAttrRef *mod_aref)
{
gdh_sAttrDef *bd; gdh_sAttrDef *bd;
int rows; int rows;
int i; int i;
int elem; int elem;
pwr_tCid cid; pwr_tCid cid;
pwr_tAttrRef aref; pwr_tAName mod_name;
int offset; int sts;
item_sTable t;
item_sTableSubid ts;
pwr_tTypeId attrtype;
unsigned int attrsize, attroffs, attrelem;
pwr_tSubid subid;
pwr_tOName object_name;
pwr_tAName attr_name;
pwr_sAttrRef attrref;
pwr_sAttrRef signal_aref;
char descr[80];
char namebuf[80];
void *attr_ptr;
ItemChannel *item;
pwr_tClassId chan_classid;
pwr_tAName signal_name;
sts = gdh_GetObjectClass ( card_objid, &cid); sts = gdh_GetAttrRefTid( mod_aref, &cid);
if ( EVEN(sts)) return sts;
sts = gdh_AttrrefToName( mod_aref, mod_name, sizeof(mod_name), cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
sts = gdh_GetObjectBodyDef( cid, &bd, &rows, pwr_cNObjid); sts = gdh_GetObjectBodyDef( cid, &bd, &rows, pwr_cNObjid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
for ( i = 0; i < rows; i++) { for ( i = 0; i < rows; i++) {
switch ( bd[i].attr->Param.TypeRef) { switch ( bd[i].attr->Param.TypeRef) {
case pwr_cClass_ChanAi: case pwr_cClass_ChanAi:
case pwr_cClass_ChanAit: case pwr_cClass_ChanAit:
...@@ -1102,6 +1136,15 @@ int XNav::show_channels( pwr_tObjid card_objid) ...@@ -1102,6 +1136,15 @@ int XNav::show_channels( pwr_tObjid card_objid)
case pwr_cClass_ChanCo: case pwr_cClass_ChanCo:
break; break;
default: default:
if ( bd[i].attr->Param.Info.Flags & PWR_MASK_CLASS) {
// This could be an IO module object, look for channels
pwr_sAttrRef aref;
gdh_ArefANameToAref( mod_aref, bd[i].attrName, &aref);
sts = show_attr_channels( &aref);
if ( EVEN(sts)) return sts;
}
continue; continue;
} }
...@@ -1113,16 +1156,15 @@ int XNav::show_channels( pwr_tObjid card_objid) ...@@ -1113,16 +1156,15 @@ int XNav::show_channels( pwr_tObjid card_objid)
elem = 1; elem = 1;
for ( int j = 0; j < elem; j++) { for ( int j = 0; j < elem; j++) {
offset = bd[i].attr->Param.Info.Offset;
memset( &aref, 0, sizeof(aref)); if ( elem == 1) {
aref.Objid = card_objid; strcpy( object_name, mod_name);
aref.Size = bd[i].attr->Param.Info.Size / elem; strcat( object_name, ".");
aref.Offset = bd[i].attr->Param.Info.Offset + j * aref.Size; strcat( object_name, bd[i].attrName);
aref.Flags.b.ObjectAttr = 1; }
else {
sts = gdh_AttrrefToName ( &aref, object_name, sprintf( object_name, "%s.%s[%d]", mod_name, bd[i].attrName, j);
sizeof(object_name), cdh_mName_volumeStrict); }
if ( EVEN(sts)) return sts;
// Get connected signal // Get connected signal
strcpy( attr_name, object_name); strcpy( attr_name, object_name);
...@@ -1130,7 +1172,7 @@ int XNav::show_channels( pwr_tObjid card_objid) ...@@ -1130,7 +1172,7 @@ int XNav::show_channels( pwr_tObjid card_objid)
sts = gdh_GetObjectInfo( attr_name, sts = gdh_GetObjectInfo( attr_name,
(void *) &signal_aref, sizeof(signal_aref)); (void *) &signal_aref, sizeof(signal_aref));
if ( ODD(sts)) { if ( ODD(sts)) {
sts = gdh_AttrrefToName ( &signal_aref, signal_name, sts = gdh_AttrrefToName( &signal_aref, signal_name,
sizeof(signal_name), cdh_mNName); sizeof(signal_name), cdh_mNName);
if ( EVEN(sts)) { if ( EVEN(sts)) {
signal_aref.Objid = pwr_cNObjid; signal_aref.Objid = pwr_cNObjid;
...@@ -1226,24 +1268,17 @@ int XNav::show_channels( pwr_tObjid card_objid) ...@@ -1226,24 +1268,17 @@ int XNav::show_channels( pwr_tObjid card_objid)
strcpy( t.elem[t.elem_cnt].fix_str, descr); strcpy( t.elem[t.elem_cnt].fix_str, descr);
t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr; t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr;
item = new ItemChannel( brow, this, card_objid, &t, &ts, -1, 0, 0, 1, item = new ItemChannel( brow, this, mod_aref->Objid, &t, &ts, -1, 0, 0, 1,
NULL, flow_eDest_IntoLast); NULL, flow_eDest_IntoLast);
item->signal_aref = signal_aref; item->signal_aref = signal_aref;
} }
} }
free( (char *)bd); free( (char *)bd);
}
brow_ResetNodraw( brow->ctx);
brow_Redraw( brow->ctx, 0);
force_trace_scan();
return XNAV__SUCCESS; return XNAV__SUCCESS;
} }
int XNav::show_object( pwr_tAttrRef *oarp, brow_tNode node) int XNav::show_object( pwr_tAttrRef *oarp, brow_tNode node)
{ {
double node_x, node_y; double node_x, node_y;
......
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