Commit 1b4cf5b4 authored by claes's avatar claes

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

parent 3e9bdee9
#! /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.
#
# This program is free software; you can redistribute it and/or
......@@ -106,7 +106,7 @@ reload_dumpdb()
dump_file=$pwrp_db/$cdb.wb_dmp
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
}
......
/*
* 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.
*
* 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
{
wb_session *sp = (wb_session *)session;
wb_object s_o = sp->object(srcoid);
if ( !s_o) return s_o.sts();
wb_object d_o = sp->object(dstoid);
if ( !d_o) return d_o.sts();
wb_destination d = d_o.destination(dest);
wb_object o = sp->copyObject(s_o, d, name);
try {
wb_object s_o = sp->object(srcoid);
if ( !s_o) return s_o.sts();
wb_object d_o = sp->object(dstoid);
if ( !d_o) return d_o.sts();
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();
return o.sts();
*oid = o.oid();
return o.sts();
}
catch (wb_error& e) {
return e.sts();
}
}
pwr_tStatus
......@@ -1837,7 +1842,7 @@ ldh_CreateLoadFile(ldh_tSession session)
pwr_tStatus
ldh_WbDump( ldh_tSession session, char *objname, char *dumpfile, int keep_name,
int noindex)
int noindex, int nofocode)
{
wb_session *sp = (wb_session*)session;
char fname[200];
......@@ -1857,6 +1862,8 @@ ldh_WbDump( ldh_tSession session, char *objname, char *dumpfile, int keep_name,
wprint.keepName();
if ( noindex)
wprint.noIndex();
if ( nofocode)
wprint.noFoCode();
if ( !objname)
wprint.printVolume( *sp);
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.
*
* This program is free software; you can redistribute it and/or
......@@ -1118,7 +1118,8 @@ ldh_WbDump(
char *objname,
char *dumpfile,
int keep_name,
int noindex
int noindex,
int nofocode
);
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.
*
* This program is free software; you can redistribute it and/or
......@@ -38,6 +38,7 @@
wb_print_wbl::wb_print_wbl(ostream& os, int levelIndentation) :
m_errCnt(0),
m_idxFlag(true),
m_noFoCodeFlag(false),
m_timeFlag(true),
m_level(0),
m_levelInd(levelIndentation),
......@@ -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);
if (recursive) {
for (to = o.first(); to; to = to.after())
printObject(v, to);
if ( !(m_noFoCodeFlag && isFoCodeObject( v, o))) {
for (to = o.first(); to; to = to.after())
printObject(v, to);
}
}
indent(-1) << "EndObject" << endl;
......@@ -680,7 +683,7 @@ bool wb_print_wbl::printValue (wb_volume& v,
break;
case pwr_eType_Objid:
if (cdh_ObjidIsNull(*(pwr_tOid *) val))
sprintf(sval, "0");
sprintf(sval, "\"_O0.0.0.0:0\"");
else {
o = v.object(*(pwr_tOid *)val);
if (o) {
......@@ -739,7 +742,7 @@ bool wb_print_wbl::printValue (wb_volume& v,
break;
case pwr_eType_AttrRef: /** @todo */
if (cdh_ObjidIsNull(((pwr_sAttrRef*)val)->Objid))
sprintf(sval, "0");
sprintf(sval, "\"_O0.0.0.0:0\"");
else {
wb_attribute a = v.attribute((pwr_sAttrRef*)val);
if (a)
......@@ -892,3 +895,25 @@ ostream& wb_print_wbl::indent(int levelIncr)
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.
*
* This program is free software; you can redistribute it and/or
......@@ -43,6 +43,7 @@ class wb_print_wbl
protected:
int m_errCnt;
bool m_idxFlag;
bool m_noFoCodeFlag;
bool m_timeFlag;
int m_level;
int m_levelInd;
......@@ -89,6 +90,8 @@ protected:
void *val,
int varSize,
char **svalp);
bool isFoCodeObject( wb_volume& v,
wb_object& o);
public:
......@@ -99,6 +102,7 @@ public:
void resetErrCnt() {m_errCnt = 0; }
void keepName() { m_keepName = true;}
void noIndex() { m_idxFlag = false;}
void noFoCode() { m_noFoCodeFlag = true;}
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
......
/*
* 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.
*
* This program is free software; you can redistribute it and/or
......@@ -294,7 +294,7 @@ dcli_tCmdTable wnav_command_table[] = {
"WB",
&wnav_wb_func,
{ "dcli_arg1", "/OUTPUT", "/HIERARCHY", "/LOADFILE", "/NOINDEX",
"/KEEPNAME",
"/KEEPNAME", "/NOFOCODE",
""}
},
{
......@@ -3881,6 +3881,7 @@ static int wnav_wb_func( void *client_data,
pwr_tStatus sts;
int keepname;
int noindex;
int nofocode;
if ( EVEN( dcli_get_qualifier( "/OUTPUT" , outputstr, sizeof(outputstr))))
{
......@@ -3895,10 +3896,12 @@ static int wnav_wb_func( void *client_data,
keepname = ODD( dcli_get_qualifier( "/KEEPNAME", 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 = ldh_WbDump( wnav->ldhses, hierarchystr_p, outputstr, keepname, noindex);
sts = ldh_WbDump( wnav->ldhses, hierarchystr_p, outputstr, keepname, noindex,
nofocode);
if ( EVEN(sts))
wnav->message(' ', wnav_get_message(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