Commit fbd89fcb authored by claes's avatar claes

Reference instance i 'open graph' didn't work on attrref

parent 0481bce7
/* /*
* Proview $Id: xtt_xnav_command.cpp,v 1.31 2007-05-16 12:37:39 claes Exp $ * Proview $Id: xtt_xnav_command.cpp,v 1.32 2007-11-02 07:10:54 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
...@@ -2247,15 +2247,47 @@ static int xnav_open_func( void *client_data, ...@@ -2247,15 +2247,47 @@ static int xnav_open_func( void *client_data,
instance_p = instance_str; instance_p = instance_str;
if ( instance_str[0] == '&') { if ( instance_str[0] == '&') {
pwr_tOid oid;
pwr_tStatus sts; pwr_tStatus sts;
pwr_tTid tid;
pwr_tUInt32 size, offs, elem;
sts = gdh_GetAttributeCharacteristics( &instance_str[1], &tid, &size,
&offs, &elem);
if ( EVEN(sts)) {
xnav->message('E', "Instance object not found");
return XNAV__HOLDCOMMAND;
}
switch ( tid) {
case pwr_eType_Objid: {
pwr_tOid oid;
// Objid attribute the contains the instance // Objid attribute the contains the instance
sts = gdh_GetObjectInfo( &instance_str[1], &oid, sizeof(oid)); sts = gdh_GetObjectInfo( &instance_str[1], &oid, sizeof(oid));
if ( ODD(sts)) if ( ODD(sts))
sts = gdh_ObjidToName( oid, instance_str, sizeof(instance_str), sts = gdh_ObjidToName( oid, instance_str, sizeof(instance_str),
cdh_mName_volumeStrict); cdh_mName_volumeStrict);
if ( EVEN(sts)) { if ( EVEN(sts)) {
xnav->message('E', "Instance object not found");
return XNAV__HOLDCOMMAND;
}
break;
}
case pwr_eType_AttrRef: {
pwr_tAttrRef aref;
// Objid attribute the contains the instance
sts = gdh_GetObjectInfo( &instance_str[1], &aref, sizeof(aref));
if ( ODD(sts))
sts = gdh_AttrrefToName( &aref, instance_str, sizeof(instance_str),
cdh_mName_volumeStrict);
if ( EVEN(sts)) {
xnav->message('E', "Instance object not found");
return XNAV__HOLDCOMMAND;
}
break;
}
default:
xnav->message('E', "Instance object not found"); xnav->message('E', "Instance object not found");
return XNAV__HOLDCOMMAND; return XNAV__HOLDCOMMAND;
} }
......
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