Commit cdf8e874 authored by claes's avatar claes

Errorhandling at qcom timeout

parent 21191f32
......@@ -39,6 +39,7 @@ extern "C" {
#include "co_nav_msg.h"
#include "xtt_localdb.h"
#include "xtt_url.h"
#include "co_error.h"
//
......@@ -70,9 +71,11 @@ ItemObject::ItemObject( XNavBrow *brow, pwr_tObjid item_objid,
type = xnav_eItemType_Object;
sts = gdh_ObjidToName( objid, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) throw co_error(sts);
if ( !is_root)
{
sts = gdh_ObjidToName( objid, segname, sizeof(segname), cdh_mName_object);
if ( EVEN(sts)) throw co_error(sts);
brow_CreateNode( brow->ctx, segname, brow->nc_object,
dest, dest_code, (void *) this, 1, &node);
......@@ -87,12 +90,16 @@ ItemObject::ItemObject( XNavBrow *brow, pwr_tObjid item_objid,
// Set class annotation
sts = gdh_GetObjectClass( objid, &classid);
if ( EVEN(sts)) throw co_error(sts);
sts = gdh_ObjidToName( cdh_ClassIdToObjid( classid),
segname, sizeof(segname), cdh_mName_object);
if ( EVEN(sts)) throw co_error(sts);
brow_SetAnnotation( node, 1, segname, strlen(segname));
// Set description annotation
sts = gdh_ObjidToName( objid, segname, sizeof(segname), cdh_mNName);
if ( EVEN(sts)) throw co_error(sts);
strcat( segname, ".Description");
sts = gdh_GetObjectInfo( segname, descr, sizeof(descr));
if ( ODD(sts))
......@@ -626,6 +633,8 @@ ItemAttr::ItemAttr( XNavBrow *brow, pwr_tObjid item_objid,
{
case item_eDisplayType_Path:
sts = gdh_ObjidToName( objid, obj_name, sizeof(obj_name), cdh_mNName);
if ( EVEN(sts)) throw co_error(sts);
sprintf( annot, "%s.%s", obj_name, attr_name);
break;
default:
......@@ -646,6 +655,8 @@ ItemAttr::ItemAttr( XNavBrow *brow, pwr_tObjid item_objid,
}
brow_SetAnnotation( node, 0, annot, strlen(annot));
sts = gdh_ObjidToName( objid, obj_name, sizeof(obj_name), cdh_mName_volumeStrict);
if ( EVEN(sts)) throw co_error(sts);
brow_SetTraceAttr( node, obj_name, attr_name, flow_eTraceType_User);
}
}
......@@ -692,6 +703,7 @@ ItemAttrArrayElem::ItemAttrArrayElem( XNavBrow *brow, pwr_tObjid item_objid,
{
case item_eDisplayType_Path:
sts = gdh_ObjidToName( objid, obj_name, sizeof(obj_name), cdh_mNName);
if ( EVEN(sts)) throw co_error(sts);
strcpy( annot, obj_name);
strcat( annot, ".");
strcat( annot, name);
......@@ -708,6 +720,7 @@ ItemAttrArrayElem::ItemAttrArrayElem( XNavBrow *brow, pwr_tObjid item_objid,
brow_SetAnnotPixmap( node, 0, brow->pixmap_attrarrayelem);
brow_SetAnnotation( node, 0, annot, strlen(annot));
sts = gdh_ObjidToName( objid, obj_name, sizeof(obj_name), cdh_mName_volumeStrict);
if ( EVEN(sts)) throw co_error(sts);
brow_SetTraceAttr( node, obj_name, name, flow_eTraceType_User);
}
}
......@@ -951,6 +964,7 @@ ItemCollect::ItemCollect( XNavBrow *brow, pwr_tObjid item_objid, char *attr_name
if ( !is_root)
{
sts = gdh_ObjidToName( objid, obj_name, sizeof(obj_name), cdh_mNName);
if ( EVEN(sts)) throw co_error(sts);
sts = gdh_NameToObjid( obj_name, &tst_objid);
if ( EVEN(sts)) {
// Try volume name
......
......@@ -45,6 +45,7 @@ extern "C" {
#include "co_mrm_util.h"
}
#include "co_lng.h"
#include "co_error.h"
#include "xtt_xnav.h"
#include "xtt_item.h"
#include "xtt_menu.h"
......@@ -750,8 +751,8 @@ void XNav::show_crossref()
brow_GetUserData( node_list[0], (void **)&item);
free( node_list);
switch( item->type)
{
try {
switch( item->type) {
case xnav_eItemType_Object:
case xnav_eItemType_Table:
((ItemBaseObject *)item)->open_crossref( brow, this, 0, 0);
......@@ -762,6 +763,12 @@ void XNav::show_crossref()
default:
message( 'E', "Can't show crossreferences for this object type");
}
}
catch ( co_error& e) {
brow_push_all();
brow_Redraw( brow->ctx, 0);
message('E', (char *)e.what().c_str());
}
}
//
......@@ -783,8 +790,8 @@ void XNav::start_trace_selected()
brow_GetUserData( node_list[0], (void **)&item);
free( node_list);
switch( item->type)
{
try {
switch( item->type) {
case xnav_eItemType_Object:
((ItemObject *)item)->open_trace( brow, this, 0, 0);
break;
......@@ -797,6 +804,12 @@ void XNav::start_trace_selected()
default:
message( 'E', "Can't start trace for this object type");
}
}
catch ( co_error& e) {
brow_push_all();
brow_Redraw( brow->ctx, 0);
message('E', (char *)e.what().c_str());
}
}
void XNav::start_trace( pwr_tObjid objid, char *object_str)
......@@ -1575,8 +1588,8 @@ static int xnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
return 1;
xnav->message( ' ', null_str);
switch ( event->event)
{
try {
switch ( event->event) {
case flow_eEvent_Key_Up:
{
brow_tNode *node_list;
......@@ -2157,6 +2170,12 @@ static int xnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
default:
;
}
}
catch ( co_error& e) {
xnav->brow_push_all();
brow_Redraw( xnav->brow->ctx, 0);
xnav->message('E', (char *)e.what().c_str());
}
return 1;
}
......@@ -2517,8 +2536,8 @@ int XNav::display_object( pwr_tObjid objid, int open)
show_database();
brow_SetNodraw( brow->ctx);
for ( i = parent_cnt; i > 0; i--)
{
try {
for ( i = parent_cnt; i > 0; i--) {
sts = find( parent_list[i - 1], (void **) &item);
if ( EVEN(sts)) return sts;
item->open_children( brow, 0, 0);
......@@ -2538,7 +2557,12 @@ int XNav::display_object( pwr_tObjid objid, int open)
brow_CenterObject( brow->ctx, item->node, 0.00);
else
brow_CenterObject( brow->ctx, item->node, 0.80);
}
catch ( co_error& e) {
brow_push_all();
brow_Redraw( brow->ctx, 0);
message('E', (char *)e.what().c_str());
}
return 1;
}
......
......@@ -48,6 +48,7 @@ extern "C" {
#include "rt_trace.h"
}
#include "co_lng.h"
#include "co_error.h"
#include "xtt_xnav.h"
#include "xtt_ge.h"
#include "xtt_item.h"
......@@ -906,6 +907,7 @@ static int xnav_show_func( void *client_data,
}
newlist = ODD( dcli_get_qualifier( "/NEW", NULL));
try {
if ( !newlist)
xnav->display_object( objid, 1);
else {
......@@ -918,6 +920,13 @@ static int xnav_show_func( void *client_data,
item->open_children( xnav->brow, 0, 0);
delete item;
}
}
catch ( co_error& e) {
xnav->brow_push_all();
brow_Redraw( xnav->brow->ctx, 0);
xnav->message('E', (char *)e.what().c_str());
}
return XNAV__SUCCESS;
}
else if ( strncmp( arg1_str, "OBJECT", strlen( arg1_str)) == 0)
......@@ -1786,6 +1795,7 @@ static int xnav_add_func( void *client_data,
else
object = 0;
try {
if ( object)
new ItemObject( xnav->brow, objid, NULL, flow_eDest_IntoLast, 0);
else if ( command)
......@@ -1795,6 +1805,12 @@ static int xnav_add_func( void *client_data,
// new ItemMenu( xnav->brow, text_str, NULL,
// flow_eDest_IntoLast, (xnav_sMenu *) menu->action,
// 0);
}
catch ( co_error& e) {
xnav->brow_push_all();
brow_Redraw( xnav->brow->ctx, 0);
xnav->message('E', (char *)e.what().c_str());
}
return XNAV__SUCCESS;
}
......@@ -4815,8 +4831,8 @@ int XNav::show_par_hier_class_name(
brow_pop();
}
if ( single_object)
{
try {
if ( single_object) {
item = new ItemObject( brow, objid, NULL, flow_eDest_IntoLast, 1);
item->open_attribute( brow, 0, 0, parametername, element);
delete item;
......@@ -4842,6 +4858,13 @@ int XNav::show_par_hier_class_name(
// return XNAV__HOLDCOMMAND;
// }
}
}
catch ( co_error& e) {
brow_push_all();
brow_Redraw( brow->ctx, 0);
message('E', (char *)e.what().c_str());
}
return XNAV__SUCCESS;
}
......
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