Commit a701fd68 authored by claes's avatar claes

Handling of lost classes

parent 1b221978
/* /*
* Proview $Id: wb_print_wbl.cpp,v 1.19 2007-04-25 13:39:21 claes Exp $ * Proview $Id: wb_print_wbl.cpp,v 1.20 2007-09-19 15:13:02 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
...@@ -404,7 +404,8 @@ void wb_print_wbl::printObject(wb_volume& v, wb_object& o, bool recursive) ...@@ -404,7 +404,8 @@ void wb_print_wbl::printObject(wb_volume& v, wb_object& o, bool recursive)
if ( !cdef) { if ( !cdef) {
m_os << "! %WBDUMP-E-Error Failed to get object class" << endl; m_os << "! %WBDUMP-E-Error Failed to get object class" << endl;
m_errCnt++; m_errCnt++;
return; // return;
cdef = v.cdef( pwr_eClass_ClassLost);
} }
const char* cname = cdef.name(); const char* cname = cdef.name();
char *block; char *block;
...@@ -762,12 +763,18 @@ bool wb_print_wbl::printValue (wb_volume& v, ...@@ -762,12 +763,18 @@ bool wb_print_wbl::printValue (wb_volume& v,
if (cdh_ObjidIsNull(((pwr_sAttrRef*)val)->Objid)) if (cdh_ObjidIsNull(((pwr_sAttrRef*)val)->Objid))
sprintf(sval, "\"_O0.0.0.0:0\""); sprintf(sval, "\"_O0.0.0.0:0\"");
else { else {
try {
wb_attribute a = v.attribute((pwr_sAttrRef*)val); wb_attribute a = v.attribute((pwr_sAttrRef*)val);
if (a) if (a)
sprintf(sval, "\"%s\"", a.longName().c_str()); sprintf(sval, "\"%s\"", a.longName().c_str());
else { else {
sprintf(sval, "\"%s\"", cdh_ArefToString(NULL, (pwr_sAttrRef*)val, 1)); sprintf(sval, "\"%s\"", cdh_ArefToString(NULL, (pwr_sAttrRef*)val, 1));
} }
} catch ( wb_error &e) {
sprintf(sval, "Unknown attribute reference");
m_errCnt++;
retval = FALSE;
}
} }
#if 0 #if 0
} else { } else {
...@@ -920,6 +927,8 @@ bool wb_print_wbl::isFoCodeObject( wb_volume& v, wb_object& o) ...@@ -920,6 +927,8 @@ bool wb_print_wbl::isFoCodeObject( wb_volume& v, wb_object& o)
// Check if object has GraphPlcNode body and compmethod 58 // Check if object has GraphPlcNode body and compmethod 58
wb_cdef cd = v.cdef( o); wb_cdef cd = v.cdef( o);
if ( !cd)
return false;
wb_object go = cd.classBody( "GraphPlcNode"); wb_object go = cd.classBody( "GraphPlcNode");
if ( !go) if ( !go)
......
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