Commit 1b4cf5b4 authored by claes's avatar claes

wb dump with function object plc code (gcc m58) excluded in dumpfile

parent 3e9bdee9
#! /bin/bash #! /bin/bash
# #
# Proview $Id: reload.sh,v 1.8 2005-09-01 14:57:49 claes Exp $ # Proview $Id: reload.sh,v 1.9 2005-12-20 11:56:35 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
...@@ -106,7 +106,7 @@ reload_dumpdb() ...@@ -106,7 +106,7 @@ reload_dumpdb()
dump_file=$pwrp_db/$cdb.wb_dmp dump_file=$pwrp_db/$cdb.wb_dmp
echo "Dumping volume $cdb in $dump_file" echo "Dumping volume $cdb in $dump_file"
wb_cmd -v $cdb wb dump/out=\"$dump_file\" wb_cmd -v $cdb wb dump/nofocode/out=\"$dump_file\"
done done
} }
......
/* /*
* Proview $Id: wb_ldh.cpp,v 1.49 2005-12-15 07:41:17 claes Exp $ * Proview $Id: wb_ldh.cpp,v 1.50 2005-12-20 11:57:29 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
...@@ -364,17 +364,22 @@ ldh_CopyObject(ldh_tSession session, pwr_tObjid *oid, char *name, pwr_tObjid src ...@@ -364,17 +364,22 @@ ldh_CopyObject(ldh_tSession session, pwr_tObjid *oid, char *name, pwr_tObjid src
{ {
wb_session *sp = (wb_session *)session; wb_session *sp = (wb_session *)session;
wb_object s_o = sp->object(srcoid); try {
if ( !s_o) return s_o.sts(); wb_object s_o = sp->object(srcoid);
wb_object d_o = sp->object(dstoid); if ( !s_o) return s_o.sts();
if ( !d_o) return d_o.sts(); wb_object d_o = sp->object(dstoid);
wb_destination d = d_o.destination(dest); if ( !d_o) return d_o.sts();
wb_object o = sp->copyObject(s_o, d, name); wb_destination d = d_o.destination(dest);
wb_object o = sp->copyObject(s_o, d, name);
if (!o) return o.sts(); if (!o) return o.sts();
*oid = o.oid(); *oid = o.oid();
return o.sts(); return o.sts();
}
catch (wb_error& e) {
return e.sts();
}
} }
pwr_tStatus pwr_tStatus
...@@ -1837,7 +1842,7 @@ ldh_CreateLoadFile(ldh_tSession session) ...@@ -1837,7 +1842,7 @@ ldh_CreateLoadFile(ldh_tSession session)
pwr_tStatus pwr_tStatus
ldh_WbDump( ldh_tSession session, char *objname, char *dumpfile, int keep_name, ldh_WbDump( ldh_tSession session, char *objname, char *dumpfile, int keep_name,
int noindex) int noindex, int nofocode)
{ {
wb_session *sp = (wb_session*)session; wb_session *sp = (wb_session*)session;
char fname[200]; char fname[200];
...@@ -1857,6 +1862,8 @@ ldh_WbDump( ldh_tSession session, char *objname, char *dumpfile, int keep_name, ...@@ -1857,6 +1862,8 @@ ldh_WbDump( ldh_tSession session, char *objname, char *dumpfile, int keep_name,
wprint.keepName(); wprint.keepName();
if ( noindex) if ( noindex)
wprint.noIndex(); wprint.noIndex();
if ( nofocode)
wprint.noFoCode();
if ( !objname) if ( !objname)
wprint.printVolume( *sp); wprint.printVolume( *sp);
else { else {
......
/* /*
* Proview $Id: wb_ldh.h,v 1.32 2005-12-15 07:41:17 claes Exp $ * Proview $Id: wb_ldh.h,v 1.33 2005-12-20 11:57:29 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
...@@ -1118,7 +1118,8 @@ ldh_WbDump( ...@@ -1118,7 +1118,8 @@ ldh_WbDump(
char *objname, char *objname,
char *dumpfile, char *dumpfile,
int keep_name, int keep_name,
int noindex int noindex,
int nofocode
); );
pwr_tStatus pwr_tStatus
......
/* /*
* Proview $Id: wb_print_wbl.cpp,v 1.15 2005-10-18 05:12:19 claes Exp $ * Proview $Id: wb_print_wbl.cpp,v 1.16 2005-12-20 11:56:35 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
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
wb_print_wbl::wb_print_wbl(ostream& os, int levelIndentation) : wb_print_wbl::wb_print_wbl(ostream& os, int levelIndentation) :
m_errCnt(0), m_errCnt(0),
m_idxFlag(true), m_idxFlag(true),
m_noFoCodeFlag(false),
m_timeFlag(true), m_timeFlag(true),
m_level(0), m_level(0),
m_levelInd(levelIndentation), m_levelInd(levelIndentation),
...@@ -468,8 +469,10 @@ void wb_print_wbl::printObject(wb_volume& v, wb_object& o, bool recursive) ...@@ -468,8 +469,10 @@ void wb_print_wbl::printObject(wb_volume& v, wb_object& o, bool recursive)
printBody(v, o, templ, cdef, pwr_eBix_dev); printBody(v, o, templ, cdef, pwr_eBix_dev);
if (recursive) { if (recursive) {
for (to = o.first(); to; to = to.after()) if ( !(m_noFoCodeFlag && isFoCodeObject( v, o))) {
printObject(v, to); for (to = o.first(); to; to = to.after())
printObject(v, to);
}
} }
indent(-1) << "EndObject" << endl; indent(-1) << "EndObject" << endl;
...@@ -680,7 +683,7 @@ bool wb_print_wbl::printValue (wb_volume& v, ...@@ -680,7 +683,7 @@ bool wb_print_wbl::printValue (wb_volume& v,
break; break;
case pwr_eType_Objid: case pwr_eType_Objid:
if (cdh_ObjidIsNull(*(pwr_tOid *) val)) if (cdh_ObjidIsNull(*(pwr_tOid *) val))
sprintf(sval, "0"); sprintf(sval, "\"_O0.0.0.0:0\"");
else { else {
o = v.object(*(pwr_tOid *)val); o = v.object(*(pwr_tOid *)val);
if (o) { if (o) {
...@@ -739,7 +742,7 @@ bool wb_print_wbl::printValue (wb_volume& v, ...@@ -739,7 +742,7 @@ bool wb_print_wbl::printValue (wb_volume& v,
break; break;
case pwr_eType_AttrRef: /** @todo */ case pwr_eType_AttrRef: /** @todo */
if (cdh_ObjidIsNull(((pwr_sAttrRef*)val)->Objid)) if (cdh_ObjidIsNull(((pwr_sAttrRef*)val)->Objid))
sprintf(sval, "0"); sprintf(sval, "\"_O0.0.0.0:0\"");
else { else {
wb_attribute a = v.attribute((pwr_sAttrRef*)val); wb_attribute a = v.attribute((pwr_sAttrRef*)val);
if (a) if (a)
...@@ -892,3 +895,25 @@ ostream& wb_print_wbl::indent(int levelIncr) ...@@ -892,3 +895,25 @@ ostream& wb_print_wbl::indent(int levelIncr)
return m_os; return m_os;
} }
bool wb_print_wbl::isFoCodeObject( wb_volume& v, wb_object& o)
{
pwr_tInt32 compmethod;
// Check if object has GraphPlcNode body and compmethod 58
wb_cdef cd = v.cdef( o);
wb_object go = cd.classBody( "GraphPlcNode");
if ( !go)
return false;
wb_attribute a = v.attribute( go, "compmethod");
if ( !a)
return false;
a.value( &compmethod);
if ( compmethod == 58)
return true;
return false;
}
/* /*
* Proview $Id: wb_print_wbl.h,v 1.9 2005-09-20 13:14:28 claes Exp $ * Proview $Id: wb_print_wbl.h,v 1.10 2005-12-20 11:56:35 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
...@@ -43,6 +43,7 @@ class wb_print_wbl ...@@ -43,6 +43,7 @@ class wb_print_wbl
protected: protected:
int m_errCnt; int m_errCnt;
bool m_idxFlag; bool m_idxFlag;
bool m_noFoCodeFlag;
bool m_timeFlag; bool m_timeFlag;
int m_level; int m_level;
int m_levelInd; int m_levelInd;
...@@ -89,6 +90,8 @@ protected: ...@@ -89,6 +90,8 @@ protected:
void *val, void *val,
int varSize, int varSize,
char **svalp); char **svalp);
bool isFoCodeObject( wb_volume& v,
wb_object& o);
public: public:
...@@ -99,6 +102,7 @@ public: ...@@ -99,6 +102,7 @@ public:
void resetErrCnt() {m_errCnt = 0; } void resetErrCnt() {m_errCnt = 0; }
void keepName() { m_keepName = true;} void keepName() { m_keepName = true;}
void noIndex() { m_idxFlag = false;} void noIndex() { m_idxFlag = false;}
void noFoCode() { m_noFoCodeFlag = true;}
void printHierarchy(wb_volume& v, wb_object& o); //< Prints a hierarchy void printHierarchy(wb_volume& v, wb_object& o); //< Prints a hierarchy
void printObject(wb_volume& v, wb_object& o, bool recursive = true); //< Prints an object void printObject(wb_volume& v, wb_object& o, bool recursive = true); //< Prints an object
......
/* /*
* Proview $Id: wb_wnav_command.cpp,v 1.35 2005-11-22 12:31:15 claes Exp $ * Proview $Id: wb_wnav_command.cpp,v 1.36 2005-12-20 11:56:35 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
...@@ -294,7 +294,7 @@ dcli_tCmdTable wnav_command_table[] = { ...@@ -294,7 +294,7 @@ dcli_tCmdTable wnav_command_table[] = {
"WB", "WB",
&wnav_wb_func, &wnav_wb_func,
{ "dcli_arg1", "/OUTPUT", "/HIERARCHY", "/LOADFILE", "/NOINDEX", { "dcli_arg1", "/OUTPUT", "/HIERARCHY", "/LOADFILE", "/NOINDEX",
"/KEEPNAME", "/KEEPNAME", "/NOFOCODE",
""} ""}
}, },
{ {
...@@ -3881,6 +3881,7 @@ static int wnav_wb_func( void *client_data, ...@@ -3881,6 +3881,7 @@ static int wnav_wb_func( void *client_data,
pwr_tStatus sts; pwr_tStatus sts;
int keepname; int keepname;
int noindex; int noindex;
int nofocode;
if ( EVEN( dcli_get_qualifier( "/OUTPUT" , outputstr, sizeof(outputstr)))) if ( EVEN( dcli_get_qualifier( "/OUTPUT" , outputstr, sizeof(outputstr))))
{ {
...@@ -3895,10 +3896,12 @@ static int wnav_wb_func( void *client_data, ...@@ -3895,10 +3896,12 @@ static int wnav_wb_func( void *client_data,
keepname = ODD( dcli_get_qualifier( "/KEEPNAME", 0, 0)); keepname = ODD( dcli_get_qualifier( "/KEEPNAME", 0, 0));
noindex = ODD( dcli_get_qualifier( "/NOINDEX", 0, 0)); noindex = ODD( dcli_get_qualifier( "/NOINDEX", 0, 0));
nofocode = ODD( dcli_get_qualifier( "/NOFOCODE", 0, 0));
sts = wnav_wccm_get_ldhsession_cb( wnav, &wnav->ldhses); sts = wnav_wccm_get_ldhsession_cb( wnav, &wnav->ldhses);
sts = ldh_WbDump( wnav->ldhses, hierarchystr_p, outputstr, keepname, noindex); sts = ldh_WbDump( wnav->ldhses, hierarchystr_p, outputstr, keepname, noindex,
nofocode);
if ( EVEN(sts)) if ( EVEN(sts))
wnav->message(' ', wnav_get_message(sts)); wnav->message(' ', wnav_get_message(sts));
return sts; return sts;
......
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