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);
......@@ -761,6 +762,12 @@ void XNav::show_crossref()
break;
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;
......@@ -796,6 +803,12 @@ void XNav::start_trace_selected()
break;
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());
}
}
......@@ -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;
......@@ -2156,6 +2169,12 @@ static int xnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
break;
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,28 +2536,33 @@ int XNav::display_object( pwr_tObjid objid, int open)
show_database();
brow_SetNodraw( brow->ctx);
for ( i = parent_cnt; i > 0; i--)
{
sts = find( parent_list[i - 1], (void **) &item);
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);
}
sts = find( objid, (void **) &item);
if ( EVEN(sts)) return sts;
item->open_children( brow, 0, 0);
}
sts = find( objid, (void **) &item);
if ( EVEN(sts)) return sts;
brow_SetInverse( item->node, 1);
brow_SelectInsert( brow->ctx, item->node);
if ( open) {
((ItemBaseObject *)item)->open_children( brow, 0, 0);
}
brow_ResetNodraw( brow->ctx);
brow_Redraw( brow->ctx, 0);
brow_SetInverse( item->node, 1);
brow_SelectInsert( brow->ctx, item->node);
if ( open) {
((ItemBaseObject *)item)->open_children( brow, 0, 0);
}
if ( open)
brow_CenterObject( brow->ctx, item->node, 0.00);
else
brow_CenterObject( brow->ctx, item->node, 0.80);
brow_ResetNodraw( brow->ctx);
brow_Redraw( brow->ctx, 0);
if ( 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,18 +907,26 @@ static int xnav_show_func( void *client_data,
}
newlist = ODD( dcli_get_qualifier( "/NEW", NULL));
if ( !newlist)
xnav->display_object( objid, 1);
else {
sts = gdh_ObjidToName ( objid, name_str, sizeof(name_str),
cdh_mNName);
xnav->brow_pop();
ItemObject *item = new ItemObject( xnav->brow, objid, NULL,
try {
if ( !newlist)
xnav->display_object( objid, 1);
else {
sts = gdh_ObjidToName ( objid, name_str, sizeof(name_str),
cdh_mNName);
xnav->brow_pop();
ItemObject *item = new ItemObject( xnav->brow, objid, NULL,
flow_eDest_IntoLast, 1);
new ItemHeader( xnav->brow, "Title", name_str, NULL, flow_eDest_IntoLast);
item->open_children( xnav->brow, 0, 0);
delete item;
new ItemHeader( xnav->brow, "Title", name_str, NULL, flow_eDest_IntoLast);
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,15 +1795,22 @@ static int xnav_add_func( void *client_data,
else
object = 0;
if ( object)
new ItemObject( xnav->brow, objid, NULL, flow_eDest_IntoLast, 0);
else if ( command)
new ItemCommand( xnav->brow, text_str, NULL,
flow_eDest_IntoLast, command_str, 0, xnav->brow->pixmap_map);
try {
if ( object)
new ItemObject( xnav->brow, objid, NULL, flow_eDest_IntoLast, 0);
else if ( command)
new ItemCommand( xnav->brow, text_str, NULL,
flow_eDest_IntoLast, command_str, 0, xnav->brow->pixmap_map);
// else
// 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,33 +4831,40 @@ int XNav::show_par_hier_class_name(
brow_pop();
}
if ( single_object)
{
item = new ItemObject( brow, objid, NULL, flow_eDest_IntoLast, 1);
item->open_attribute( brow, 0, 0, parametername, element);
delete item;
// sts = rtt_show_parameter_add( objid, &menulist,
try {
if ( single_object) {
item = new ItemObject( brow, objid, NULL, flow_eDest_IntoLast, 1);
item->open_attribute( brow, 0, 0, parametername, element);
delete item;
// sts = rtt_show_parameter_add( objid, &menulist,
// parametername, &index, &element, 0);
}
else
{
// sts = rtt_get_objects_hier_class_name( parent_ctx, hierobjid,
}
else
{
// sts = rtt_get_objects_hier_class_name( parent_ctx, hierobjid,
// classid, name, max_objects, global,
// &rtt_show_parameter_add, (void *) &menulist,
// (void *) parametername, (void *) &index,
// (void *) &element, 0);
// if ( sts == XNAV__MAXCOUNT)
// message('E',"To many object, all objects could not be shown");
// else if ( EVEN (sts)) return sts;
// if ( index)
// sts = rtt_menu_upd_bubblesort( menulist);
// else
// {
// message('E', "No objects found");
// return XNAV__HOLDCOMMAND;
// }
// if ( sts == XNAV__MAXCOUNT)
// message('E',"To many object, all objects could not be shown");
// else if ( EVEN (sts)) return sts;
// if ( index)
// sts = rtt_menu_upd_bubblesort( menulist);
// else
// {
// message('E', "No objects found");
// 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