Commit 195c155c authored by claes's avatar claes

ohTime, rbTime and dbTime in wb_load files and orep, classversion modified

parent 0f3466cd
/**
* Proview $Id: wb_bdrep.cpp,v 1.15 2005-09-01 14:57:57 claes Exp $
* Proview $Id: wb_bdrep.cpp,v 1.16 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -298,3 +298,8 @@ wb_name wb_bdrep::longName() const
{
return m_orep->longName();
}
pwr_tTime wb_bdrep::modTime()
{
return m_orep->treeModTime();
}
/**
* Proview $Id: wb_bdrep.h,v 1.12 2005-09-01 14:57:57 claes Exp $
* Proview $Id: wb_bdrep.h,v 1.13 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -58,7 +58,7 @@ public:
wb_adrep *super( pwr_tStatus *sts);
pwr_tStatus sts() { return m_sts;}
pwr_tTime modTime();
};
......
/**
* Proview $Id: wb_cdrep.cpp,v 1.25 2005-09-01 14:57:57 claes Exp $
* Proview $Id: wb_cdrep.cpp,v 1.26 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -18,6 +18,7 @@
**/
#include "co_cdh.h"
#include "co_time.h"
#include "wb_cdrep.h"
#include "wb_erep.h"
#include "wb_merep.h"
......@@ -450,6 +451,32 @@ pwr_tTime wb_cdrep::ohTime()
return m_orep->ohTime();
}
pwr_tTime wb_cdrep::modTime()
{
return m_orep->treeModTime();
}
pwr_tTime wb_cdrep::structModTime()
{
pwr_tStatus sts;
pwr_tTime t = m_orep->modTime();
wb_bdrep *rbd = bdrep( &sts, pwr_eBix_rt);
if ( ODD(sts)) {
pwr_tTime rbt = rbd->modTime();
if ( time_Acomp( &rbt, &t) == 1)
t = rbt;
delete rbd;
}
wb_bdrep *dbd = bdrep( &sts, pwr_eBix_dev);
if ( ODD(sts)) {
pwr_tTime dbt = dbd->modTime();
if ( time_Acomp( &dbt, &t) == 1)
t = dbt;
}
return t;
}
wb_cdrep* wb_cdrep::super( pwr_tStatus *sts)
{
wb_bdrep *bd = bdrep( sts, pwr_eBix_rt);
......@@ -759,5 +786,9 @@ void wb_cdrep::updateTemplate( pwr_eBix bix, void *b, pwr_tOid oid, pwr_tOid toi
delete bd;
}
ldh_eVolRep wb_cdrep::vtype() const
{
return m_orep->vtype();
}
/**
* Proview $Id: wb_cdrep.h,v 1.19 2005-09-01 14:57:57 claes Exp $
* Proview $Id: wb_cdrep.h,v 1.20 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -76,6 +76,8 @@ public:
wb_orep *menuFirst( pwr_tStatus *sts, wb_orep *orep, void **o);
pwr_tTime ohTime();
pwr_tTime modTime();
pwr_tTime structModTime();
void convertSubClass( pwr_tCid cid, wb_merep *merep,
void *body_source, void *body_target);
void convertObject( wb_merep *merep, void *rbody, void *dbody,
......@@ -86,6 +88,7 @@ public:
pwr_tOid toid);
void updateTemplate( pwr_eBix bix, void *b, pwr_tOid oid, pwr_tOid toid);
pwr_tStatus sts() { return m_sts;}
ldh_eVolRep vtype() const;
};
#endif
......
/**
* Proview $Id: wb_ldh.cpp,v 1.43 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_ldh.cpp,v 1.44 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -2055,6 +2055,17 @@ ldh_GetSubClass(ldh_tSession session, pwr_tCid supercid, pwr_tCid subcid, pwr_tC
return sp->sts();
}
pwr_tStatus
ldh_GetModTime(ldh_tSession session, pwr_tOid oid, pwr_tTime *time)
{
wb_session *sp = (wb_session *)session;
wb_object o = sp->object(oid);
if (!o) return o.sts();
*time = o.modTime();
return o.sts();
}
#endif
......@@ -2062,3 +2073,4 @@ ldh_GetSubClass(ldh_tSession session, pwr_tCid supercid, pwr_tCid subcid, pwr_tC
/**
* Proview $Id: wb_ldh.h,v 1.25 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_ldh.h,v 1.26 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -1175,6 +1175,13 @@ ldh_GetSubClass(
pwr_tCid *nextsubcid
);
pwr_tStatus
ldh_GetModTime(
ldh_tSession session,
pwr_tOid oid,
pwr_tTime *time
);
#ifdef __cplusplus
}
#endif
......
/**
* Proview $Id: wb_merep.cpp,v 1.29 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_merep.cpp,v 1.30 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -364,6 +364,13 @@ void wb_merep::classVersion( pwr_tStatus *sts, pwr_tCid cid, pwr_tTime *time)
wb_cdrep *cd = cdrep( sts, cid);
if ( !cd) return;
if ( cd->vtype() == ldh_eVolRep_Dbs) {
// ohTime contains class version for a class in vrepdbs
*time = cd->ohTime();
*sts = LDH__SUCCESS;
return;
}
wb_bdrep *bd = cd->bdrep( sts, pwr_eBix_rt);
if ( !bd) {
delete cd;
......@@ -375,7 +382,7 @@ void wb_merep::classVersion( pwr_tStatus *sts, pwr_tCid cid, pwr_tTime *time)
return;
}
*time = cd->ohTime();
*time = cd->structModTime();
wb_adrep *ad, *oad;
for ( ad = bd->adrep( sts); ad;) {
......
/**
* Proview $Id: wb_object.cpp,v 1.13 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_object.cpp,v 1.14 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -290,6 +290,34 @@ pwr_tTime wb_object::ohTime()
return m_orep->ohTime();
}
pwr_tTime wb_object::rbTime()
{
check();
return m_orep->rbTime();
}
pwr_tTime wb_object::dbTime()
{
check();
return m_orep->dbTime();
}
pwr_tTime wb_object::modTime()
{
check();
return m_orep->modTime();
}
pwr_tTime wb_object::treeModTime()
{
check();
return m_orep->treeModTime();
}
pwr_mClassDef wb_object::flags()
{
check();
......
/**
* Proview $Id: wb_object.h,v 1.12 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_object.h,v 1.13 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -82,9 +82,11 @@ public:
const char *name();
wb_name longName();
pwr_tTime ohTime(); //< time when this object was last changed
pwr_tTime ohTime(); //< time when header of this object was last changed
pwr_tTime rbTime(); //< time when run time body of this object was last changed
pwr_tTime dbTime(); //< time when development body of this object was last changed
pwr_tTime modTime(); //< time when this object was last changed
pwr_tTime treeModTime(); //< time when this object or any ancestor was last changed
pwr_mClassDef flags();
......
/**
* Proview $Id: wb_orep.cpp,v 1.5 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orep.cpp,v 1.6 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -18,6 +18,7 @@
**/
#include "wb_orep.h"
#include "co_time.h"
wb_orep::wb_orep() : m_nRef(0)
{
......@@ -37,3 +38,38 @@ wb_orep *wb_orep::ref()
m_nRef++;
return this;
}
pwr_tTime wb_orep::modTime()
{
pwr_tTime t = ohTime();
pwr_tTime rbt = rbTime();
pwr_tTime dbt = dbTime();
if ( time_Acomp( &rbt, &t) == 1)
t = rbt;
if ( time_Acomp( &dbt, &rbt) == 1)
t = dbt;
return t;
}
pwr_tTime wb_orep::treeModTime()
{
pwr_tStatus sts;
pwr_tTime t = modTime();
pwr_tTime tchild;
wb_orep *after;
for ( wb_orep *child = first( &sts);
ODD(sts);
child = after) {
child->ref();
tchild = child->treeModTime();
if ( time_Acomp( &tchild, &t) == 1)
t = tchild;
after = child->after( &sts);
child->unref();
}
return t;
}
/**
* Proview $Id: wb_orep.h,v 1.12 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orep.h,v 1.13 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -62,6 +62,8 @@ public:
virtual const char * name() const = 0;
virtual wb_name longName() = 0;
virtual pwr_tTime ohTime() const = 0;
virtual pwr_tTime rbTime() const = 0;
virtual pwr_tTime dbTime() const = 0;
virtual pwr_mClassDef flags() const = 0;
virtual bool isOffspringOf(const wb_orep *o) const = 0;
......@@ -85,6 +87,10 @@ public:
virtual wb_erep *erep() const = 0;
virtual wb_vrep *vrep() const = 0;
virtual ldh_eVolRep vtype() const = 0;
pwr_tTime modTime();
pwr_tTime treeModTime();
};
#endif
/**
* Proview $Id: wb_orepdb.cpp,v 1.9 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepdb.cpp,v 1.10 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -129,10 +129,24 @@ const char * wb_orepdb::name() const
pwr_tTime wb_orepdb::ohTime() const
{
pwr_tStatus sts;
return m_vrep->ohTime(&sts, (wb_orep*)this);
}
pwr_tTime wb_orepdb::rbTime() const
{
pwr_tStatus sts;
return m_vrep->rbTime(&sts, (wb_orep*)this);
}
pwr_tTime wb_orepdb::dbTime() const
{
pwr_tStatus sts;
return m_vrep->dbTime(&sts, (wb_orep*)this);
}
pwr_mClassDef wb_orepdb::flags() const
{
pwr_tStatus sts;
......
/**
* Proview $Id: wb_orepdb.h,v 1.10 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepdb.h,v 1.11 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -55,6 +55,8 @@ public:
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const;
......@@ -76,6 +78,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Db;}
};
#endif
/**
* Proview $Id: wb_orepdbs.cpp,v 1.14 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepdbs.cpp,v 1.15 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -156,6 +156,16 @@ pwr_tTime wb_orepdbs::ohTime() const
return m_o->time;
}
pwr_tTime wb_orepdbs::rbTime() const
{
return m_o->rbody.time;
}
pwr_tTime wb_orepdbs::dbTime() const
{
return m_o->dbody.time;
}
pwr_mClassDef wb_orepdbs::flags() const
{
return m_o->ohFlags;
......
/**
* Proview $Id: wb_orepdbs.h,v 1.14 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepdbs.h,v 1.15 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -58,6 +58,8 @@ public:
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const;
......@@ -79,6 +81,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Dbs;}
dbs_sObject *o() const { return m_o;}
......
/**
* Proview $Id: wb_orepext.cpp,v 1.2 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepext.cpp,v 1.3 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -89,8 +89,17 @@ wb_name wb_orepext::longName()
pwr_tTime wb_orepext::ohTime() const
{
pwr_tTime t = {0,0};
return t;
return m_extobject.time;
}
pwr_tTime wb_orepext::rbTime() const
{
return m_extobject.time;
}
pwr_tTime wb_orepext::dbTime() const
{
return m_extobject.time;
}
pwr_mClassDef wb_orepext::flags() const
......
/**
* Proview $Id: wb_orepext.h,v 1.2 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepext.h,v 1.3 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -53,6 +53,8 @@ public:
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const;
......@@ -75,6 +77,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Ext;}
virtual bool docBlock( char **block, int *size) const { return false;}
virtual bool docBlock( char *block) { return false;}
......
/**
* Proview $Id: wb_orepmem.cpp,v 1.4 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepmem.cpp,v 1.5 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -103,8 +103,17 @@ wb_name wb_orepmem::longName()
pwr_tTime wb_orepmem::ohTime() const
{
pwr_tTime t = {0,0};
return t;
return m_memobject->m_ohtime;
}
pwr_tTime wb_orepmem::rbTime() const
{
return m_memobject->m_rbtime;
}
pwr_tTime wb_orepmem::dbTime() const
{
return m_memobject->m_dbtime;
}
pwr_mClassDef wb_orepmem::flags() const
......
/**
* Proview $Id: wb_orepmem.h,v 1.4 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepmem.h,v 1.5 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -54,6 +54,8 @@ public:
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const;
......@@ -78,6 +80,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Mem;}
virtual bool docBlock( char **block, int *size) const;
virtual bool docBlock( char *block);
......
/**
* Proview $Id: wb_orepref.h,v 1.2 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepref.h,v 1.3 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -55,6 +55,8 @@ public:
return wb_name( str);
}
virtual pwr_tTime ohTime() const { pwr_tTime t = {0,0}; return t;}
virtual pwr_tTime rbTime() const { pwr_tTime t = {0,0}; return t;}
virtual pwr_tTime dbTime() const { pwr_tTime t = {0,0}; return t;}
virtual pwr_mClassDef flags() const { pwr_mClassDef m; m.m = 0; return m;}
virtual bool isOffspringOf(const wb_orep *o) const {return false;}
......@@ -71,6 +73,7 @@ public:
virtual wb_adrep *attribute(pwr_tStatus *sts) {*sts = LDH__NOSUCHOBJ; return 0;}
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Ref;}
virtual bool docBlock( char **block, int *size) const {return false;}
virtual bool docBlock( char *block) {return false;}
......
/**
* Proview $Id: wb_orepwbl.cpp,v 1.11 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepwbl.cpp,v 1.12 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -103,7 +103,19 @@ wb_name wb_orepwbl::longName()
pwr_tTime wb_orepwbl::ohTime() const
{
return m_wblnode->getFileTime();
return m_wblnode->o->m_ohtime;
}
pwr_tTime wb_orepwbl::rbTime() const
{
return m_wblnode->o->m_rbtime;
}
pwr_tTime wb_orepwbl::dbTime() const
{
return m_wblnode->o->m_dbtime;
}
......
/**
* Proview $Id: wb_orepwbl.h,v 1.10 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_orepwbl.h,v 1.11 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -54,6 +54,8 @@ public:
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const;
......@@ -78,6 +80,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Wbl;}
bool docBlock( char **block, int *size) const;
};
......
/**
* Proview $Id: wb_print_wbl.cpp,v 1.11 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_print_wbl.cpp,v 1.12 2005-09-06 08:02:04 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_timeFlag(true),
m_level(0),
m_levelInd(levelIndentation),
m_keepName(false),
......@@ -106,6 +107,7 @@ void wb_print_wbl::printBody(wb_volume& v,
wb_attribute attr;
wb_attribute tattr;
const char* bname;
char timestr[40] = " ";
wb_bdef bdef = cdef.bdef(bix);
......@@ -122,8 +124,25 @@ void wb_print_wbl::printBody(wb_volume& v,
return;
}
indent(1) << "Body " << bdef.name() << endl;
if ( m_timeFlag) {
// Get body time
pwr_tTime btime;
switch ( bix) {
case pwr_eBix_rt:
btime = o.rbTime();
strcpy( timestr, " ");
time_AtoAscii( &btime, time_eFormat_DateAndTime, &timestr[1], sizeof(timestr)-1);
break;
case pwr_eBix_dev:
btime = o.dbTime();
strcpy( timestr, " ");
time_AtoAscii( &btime, time_eFormat_DateAndTime, &timestr[1], sizeof(timestr)-1);
break;
default: ;
}
}
indent(1) << "Body " << bdef.name() << timestr << endl;
for (adef = bdef.adef(); adef; adef = adef.next()) {
attr = o.attribute(bname, adef.name());
tattr = templ.attribute(bname, adef.name());
......@@ -425,6 +444,14 @@ void wb_print_wbl::printObject(wb_volume& v, wb_object& o, bool recursive)
}
m_os << " " << idx;
}
if ( m_timeFlag) {
// Get oh time
char timestr[40];
pwr_tTime ohtime = o.ohTime();
time_AtoAscii( &ohtime, time_eFormat_DateAndTime, timestr, sizeof(timestr));
m_os << " " << timestr;
}
m_os << endl;
wb_object co = v.object(cdh_ClassIdToObjid(cdef.cid()));
......
/**
* Proview $Id: wb_print_wbl.h,v 1.6 2005-09-01 14:57:58 claes Exp $
* Proview $Id: wb_print_wbl.h,v 1.7 2005-09-06 08:02:04 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_timeFlag;
int m_level;
int m_levelInd;
char m_indBuf[256];
......
/**
* Proview $Id: wb_vrep.h,v 1.22 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrep.h,v 1.23 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -81,6 +81,8 @@ public:
virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o) = 0;
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) = 0;
......
/**
* Proview $Id: wb_vrepdb.cpp,v 1.38 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepdb.cpp,v 1.39 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -818,6 +818,36 @@ pwr_tTime wb_vrepdb::ohTime(pwr_tStatus *sts, const wb_orep *orp)
}
}
pwr_tTime wb_vrepdb::rbTime(pwr_tStatus *sts, const wb_orep *orp)
{
*sts = LDH__SUCCESS;
try {
return m_ohead.get(m_db->m_txn, orp->oid()).rbTime();
}
catch (DbException &e) {
*sts = LDH__NOSUCHOBJ;
pwr_tTime t = {0, 0};
printf("vrepdb: %s\n", e.what());
return t;
}
}
pwr_tTime wb_vrepdb::dbTime(pwr_tStatus *sts, const wb_orep *orp)
{
*sts = LDH__SUCCESS;
try {
return m_ohead.get(m_db->m_txn, orp->oid()).dbTime();
}
catch (DbException &e) {
*sts = LDH__NOSUCHOBJ;
pwr_tTime t = {0, 0};
printf("vrepdb: %s\n", e.what());
return t;
}
}
pwr_mClassDef wb_vrepdb::flags(pwr_tStatus *sts, const wb_orep *orp)
{
*sts = LDH__SUCCESS;
......
/**
* Proview $Id: wb_vrepdb.h,v 1.26 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepdb.h,v 1.27 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -98,6 +98,8 @@ public:
virtual wb_vrep *next();
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid oid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tVid vid(pwr_tStatus *sts, const wb_orep *o);
......
/**
* Proview $Id: wb_vrepdbs.cpp,v 1.43 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepdbs.cpp,v 1.44 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -170,6 +170,16 @@ pwr_tTime wb_vrepdbs::ohTime(pwr_tStatus *sts, const wb_orep *o)
return o->ohTime();
}
pwr_tTime wb_vrepdbs::rbTime(pwr_tStatus *sts, const wb_orep *o)
{
return o->rbTime();
}
pwr_tTime wb_vrepdbs::dbTime(pwr_tStatus *sts, const wb_orep *o)
{
return o->dbTime();
}
pwr_mClassDef wb_vrepdbs::flags(pwr_tStatus *sts, const wb_orep *o)
{
return o->flags();
......
/**
* Proview $Id: wb_vrepdbs.h,v 1.31 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepdbs.h,v 1.32 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -75,6 +75,8 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o);
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;}
......
/**
* Proview $Id: wb_vrepext.h,v 1.2 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepext.h,v 1.3 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -171,7 +171,9 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { pwr_tTime t = {0, 0}; return t;}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { return o->ohTime();}
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o) { return o->rbTime();}
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o) { return o->dbTime();}
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o) { pwr_mClassDef f; f.m = 0; return f;}
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;}
......
/**
* Proview $Id: wb_vrepmem.cpp,v 1.16 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepmem.cpp,v 1.17 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -514,7 +514,11 @@ void wb_vrepmem::objectName(const wb_orep *o, char *str)
bool wb_vrepmem::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p)
{
pwr_tTime time;
*sts = LDH__SUCCESS;
clock_gettime(CLOCK_REALTIME, &time);
mem_object *n = ((wb_orepmem *) o)->memobject();
......@@ -525,6 +529,7 @@ bool wb_vrepmem::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size
return false;
}
memcpy( (char *)n->rbody + offset, p, MIN(n->rbody_size - offset, size));
n->m_rbtime = time;
return true;
case pwr_eBix_dev:
if ( n->dbody_size == 0) {
......@@ -532,6 +537,7 @@ bool wb_vrepmem::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size
return false;
}
memcpy( (char *)n->dbody + offset, p, MIN(n->dbody_size - offset, size));
n->m_dbtime = time;
return true;
default:
*sts = LDH__NOSUCHBODY;
......@@ -574,7 +580,10 @@ void *wb_vrepmem::readAttribute(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix
bool wb_vrepmem::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p)
{
pwr_tTime time;
*sts = LDH__SUCCESS;
clock_gettime(CLOCK_REALTIME, &time);
mem_object *n = ((wb_orepmem *) o)->memobject();
......@@ -586,6 +595,7 @@ bool wb_vrepmem::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p)
}
memcpy( n->rbody, p, n->rbody_size);
n->m_rbtime = time;
return true;
case pwr_eBix_dev:
if ( n->dbody_size == 0) {
......@@ -593,6 +603,7 @@ bool wb_vrepmem::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p)
return false;
}
memcpy( n->dbody, p, n->dbody_size);
n->m_dbtime = time;
return true;
default:
*sts = LDH__NOSUCHBODY;
......@@ -681,6 +692,9 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
ldh_eDest code = d.code();
char name_str[32];
pwr_tOix oix;
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
if ( d.oid().oix == 0) {
dest = root_object;
......@@ -717,20 +731,24 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
strcpy( name_str, name.object());
}
mem_object *memo = new mem_object();
strcpy( memo->m_name, name_str);
memo->m_oid.oix = oix;
memo->m_oid.vid = m_vid;
memo->m_cid = cdef.cid();
memo->m_flags = cdef.flags();
memo->m_ohtime = time;
memo->rbody_size = cdef.size( pwr_eBix_rt);
if ( memo->rbody_size) {
memo->m_rbtime = time;
memo->rbody = malloc( memo->rbody_size);
cdef.templateBody( sts, pwr_eBix_rt, memo->rbody, memo->m_oid);
if ( EVEN(*sts)) return 0;
}
memo->dbody_size = cdef.size( pwr_eBix_dev);
if ( memo->dbody_size) {
memo->m_dbtime = time;
memo->dbody = malloc( memo->dbody_size);
cdef.templateBody( sts, pwr_eBix_dev, memo->dbody, memo->m_oid);
if ( EVEN(*sts)) return 0;
......@@ -830,6 +848,9 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
mem_object *dest;
ldh_eDest code = d.code();
char name_str[32];
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
if ( cdh_ObjidIsNull( d.oid())) {
dest = root_object;
......@@ -867,12 +888,14 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
memo->m_oid.oix = oix;
memo->m_oid.vid = m_vid;
memo->m_cid = orep->cid();
memo->m_ohtime = time;
wb_attribute rbody;
rbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "RtBody");
if ( !rbody)
rbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "SysBody");
if ( rbody) {
memo->m_rbtime = time;
memo->rbody_size = rbody.size();
memo->rbody = malloc( memo->rbody_size);
rbody.value( memo->rbody);
......@@ -881,6 +904,7 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
wb_attribute dbody;
dbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "DevBody");
if ( dbody) {
memo->m_dbtime = time;
memo->dbody_size = dbody.size();
memo->dbody = malloc( memo->dbody_size);
dbody.value( memo->dbody);
......@@ -953,6 +977,9 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
{
mem_object *dest;
ldh_eDest code = d.code();
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
if ( cdh_ObjidIsEqual( d.oid(), orep->oid()))
return false;
......@@ -1038,6 +1065,8 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
return false;
}
memo->m_ohtime = time;
return true;
}
......@@ -1105,6 +1134,10 @@ void wb_vrepmem::deleteChildren( mem_object *memo)
bool wb_vrepmem::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name)
{
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
mem_object *memo = ((wb_orepmem *)orep)->memobject();
if ( !memo) return false;
......@@ -1128,6 +1161,9 @@ bool wb_vrepmem::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name)
strcpy( memo->m_name, old_name);
return LDH__NAMALREXI;
}
memo->m_ohtime = time;
*sts = LDH__SUCCESS;
return true;
}
......@@ -1399,6 +1435,9 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode,
pwr_tOid *roid)
{
pwr_tStatus sts;
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
mem_object *memo = new mem_object();
strcpy( memo->m_name, name);
......@@ -1475,13 +1514,16 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode,
memo->m_oid.vid = m_vid;
memo->m_cid = cid;
memo->m_flags = flags;
memo->m_ohtime = time;
memo->rbody_size = rbSize;
if ( memo->rbody_size) {
memo->m_rbtime = time;
memo->rbody = malloc( memo->rbody_size);
memcpy( memo->rbody, rbody, memo->rbody_size);
}
memo->dbody_size = dbSize;
if ( memo->dbody_size) {
memo->m_dbtime = time;
memo->dbody = malloc( memo->dbody_size);
memcpy( memo->dbody, dbody, memo->dbody_size);
}
......@@ -1716,7 +1758,7 @@ bool wb_vrepmem::importBuildObject( mem_object *memo)
bool wb_vrepmem::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid, pwr_tOid loid,
const char *name, const char *normname, pwr_mClassDef flags,
pwr_tTime time, pwr_tTime rbTime, pwr_tTime dbTime,
pwr_tTime ohTime, pwr_tTime rbTime, pwr_tTime dbTime,
size_t rbSize, size_t dbSize)
{
......@@ -1732,7 +1774,9 @@ bool wb_vrepmem::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
memo->bwsoid = boid;
memo->fwsoid = aoid;
memo->fchoid = foid;
memo->time = time;
memo->m_ohtime = ohTime;
memo->m_rbtime = rbTime;
memo->m_dbtime = dbTime;
if (oid.oix == pwr_cNOix) {
// this is the volume object
......
/**
* Proview $Id: wb_vrepmem.h,v 1.15 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepmem.h,v 1.16 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -45,6 +45,12 @@ class mem_object
m_flags.m = 0;
m_oid.oix = 0;
m_oid.vid = 0;
m_ohtime.tv_sec = 0;
m_ohtime.tv_nsec = 0;
m_rbtime.tv_sec = 0;
m_rbtime.tv_nsec = 0;
m_dbtime.tv_sec = 0;
m_dbtime.tv_nsec = 0;
}
~mem_object() {
if ( rbody_size) free( rbody);
......@@ -180,7 +186,9 @@ class mem_object
pwr_tOid fwsoid;
pwr_tOid fchoid;
int is_built;
pwr_tTime time;
pwr_tTime m_ohtime;
pwr_tTime m_rbtime;
pwr_tTime m_dbtime;
};
class wb_orepmem;
......@@ -256,7 +264,9 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { pwr_tTime t = {0, 0}; return t;}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { return o->ohTime();}
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o) { return o->rbTime();}
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o) { return o->dbTime();}
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o) { pwr_mClassDef f; f.m = 0; return f;}
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;}
......
/**
* Proview $Id: wb_vrepref.h,v 1.3 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepref.h,v 1.4 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -88,7 +88,9 @@ public:
virtual pwr_tOid aoid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;}
virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o) { return "";}
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { pwr_tTime t = {0, 0}; return t;}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { return o->ohTime();}
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o) { return o->rbTime();}
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o) { return o->dbTime();}
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o) { pwr_mClassDef f; f.m = 0; return f;}
virtual void objectName(const wb_orep *o, char *str);
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;}
......
/**
* Proview $Id: wb_vrepwbl.h,v 1.33 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_vrepwbl.h,v 1.34 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -139,7 +139,9 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { pwr_tTime t = {0, 0}; return t;}
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o) { return o->ohTime();}
virtual pwr_tTime rbTime(pwr_tStatus *sts, const wb_orep *o) { return o->rbTime();}
virtual pwr_tTime dbTime(pwr_tStatus *sts, const wb_orep *o) { return o->dbTime();}
virtual pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o) { pwr_mClassDef f; f.m = 0; return f;}
......
This diff is collapsed.
......@@ -35,6 +35,7 @@ tokens {
INT;
OID;
DOCBLOCK;
ASC_TIME;
}
EQ : '='
......@@ -124,6 +125,8 @@ options {
{$setType(ATTRIBUTE);}
| (DIGITS '.' DIGITS '.' ) => DIGITS '.' DIGITS '.' DIGITS '.' DIGITS (':' DIGITS)?
{$setType(OID);}
| ( ('0'..'9') ('0'..'9') '-' ('a'..'z'|'A'..'Z')('a'..'z'|'A'..'Z')('a'..'z'|'A'..'Z') '-') => ( ('0'..'9') ('0'..'9') '-' ('a'..'z'|'A'..'Z')('a'..'z'|'A'..'Z')('a'..'z'|'A'..'Z') '-' ('0'..'9')('0'..'9')('0'..'9')('0'..'9') ' ' ('0'..'9')('0'..'9') ':' ('0'..'9')('0'..'9') ':' ('0'..'9')('0'..'9') ('.' ('0'..'9')('0'..'9'))?)
{$setType(ASC_TIME);}
| (DIGITS '.') => DIGITS '.' ('0'..'9')* (('e'|'E') ('+'|'-')? ('0'..'9')+)?
{$setType(NUM_FLOAT);}
| ('-' DIGITS '.') => '-' DIGITS '.' ('0'..'9')* (('e'|'E') ('+'|'-')? ('0'..'9')+)?
......@@ -137,6 +140,11 @@ options {
| ('a'..'z'|'A'..'Z'|'$'|'_'|SWEC) ('a'..'z'|'A'..'Z'|'0'..'9'|'$'|'_'|SWEC)*
;
/*
{$setType(ASC_TIME);}
| ('0'..'9')+ '-' (SWEC)+ '-' ('0'..'9')+ ' ' ('0'..'9')+ ':' ('0'..'9')+ ':' ('0'..'9')+ ('.' ('0'..'9')+)?
*/
CHAR_LITERAL
: '\'' (ESC|~'\'') '\''
;
......
/**
* Proview $Id: wb_wblnode.cpp,v 1.44 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_wblnode.cpp,v 1.45 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -369,6 +369,13 @@ int wb_wblnode::stringToOix( const char *buf, pwr_tOix *oix) const
return 1;
}
int wb_wblnode::stringToTime( const char *buf, pwr_tTime *time) const
{
pwr_tStatus sts;
sts = time_AsciiToA( (char *)buf, time);
return ODD(sts);
}
int wb_wblnode::lookup( int *type, const char *keyword, wbl_sSym *table)
{
int cond;
......@@ -980,9 +987,26 @@ void wb_wblnode::buildBody( ref_wblnode object)
m_vrep->error( "Bad body name", getFileName(), line_number);
}
for ( first_child = getFirstChild();
first_child = getFirstChild();
// First child might be body time
if ( first_child && first_child->getType() == tokens.ASC_TIME) {
string timestr = first_child->getText();
pwr_tTime bodytime;
if ( stringToTime( timestr.c_str(), &bodytime)) {
if ( bix == pwr_eBix_rt)
object->o->m_rbtime = bodytime;
else
object->o->m_dbtime = bodytime;
}
else
m_vrep->error( "Time syntax", getFileName(), line_number);
first_child = first_child->getNextSibling();
}
for ( ;
first_child;
first_child = first_child->getNextSibling())
first_child = first_child->getNextSibling())
first_child->buildAttr( object, bix);
next_sibling = getNextSibling();
......@@ -1501,6 +1525,9 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol)
m_vrep->error( "Bad object name", getFileName(), line_number);
}
// Filetime is default for ohtime
o->m_ohtime = getFileTime();
// Get class
if ( first_child) {
string class_name = first_child->getText();
......@@ -1556,16 +1583,28 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol)
// Get oix
ref_wblnode second_child = first_child->getNextSibling();
if ( second_child) {
ref_wblnode third_child = second_child->getNextSibling();
switch ( second_child->getType()) {
case tokens.VALUE:
case tokens.INT:
{
case tokens.INT: {
string oixstr = second_child->getText();
if ( !stringToOix( oixstr.c_str(), &o->m_oid.oix)) {
o->m_oid.oix = m_vrep->nextOix();
}
if ( third_child && third_child->getType() == tokens.ASC_TIME) {
string timestr = third_child->getText();
if ( !stringToTime( timestr.c_str(), &o->m_ohtime))
m_vrep->error( "Time syntax", getFileName(), line_number);
}
break;
}
case tokens.ASC_TIME: {
string timestr = second_child->getText();
if ( !stringToTime( timestr.c_str(), &o->m_ohtime))
m_vrep->error( "Time syntax", getFileName(), line_number);
break;
}
case tokens.ENDOBJECT:
case tokens.OBJECT:
case tokens.BODY:
......@@ -1821,7 +1860,7 @@ bool wb_wblnode::exportHead(wb_import &i)
i.importHead( o->m_oid, o->m_cid, fthoid, bwsoid, fwsoid, fchoid, lchoid, name(),
n.normName(cdh_mName_object), o->m_flags,
getFileTime(), getFileTime(), getFileTime(), o->rbody_size, o->dbody_size);
o->m_ohtime, o->m_rbtime, o->m_dbtime, o->rbody_size, o->dbody_size);
if ( o->fch)
o->fch->exportHead( i);
......
/**
* Proview $Id: wb_wblnode.h,v 1.17 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_wblnode.h,v 1.18 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -80,9 +80,9 @@ class wbl_type {
class wbl_body {
public:
wbl_body() : bix(pwr_eBix__), size(0) {};
pwr_eBix bix;
size_t size;
wbl_body() : bix(pwr_eBix__), size(0) {}
pwr_eBix bix;
size_t size;
};
class wbl_attribute {
......@@ -114,6 +114,12 @@ class wbl_object {
m_flags.m = 0;
m_oid.oix = 0;
m_oid.vid = 0;
m_ohtime.tv_sec = 0;
m_ohtime.tv_nsec = 0;
m_rbtime.tv_sec = 0;
m_rbtime.tv_nsec = 0;
m_dbtime.tv_sec = 0;
m_dbtime.tv_nsec = 0;
};
~wbl_object() {
if ( rbody_size) free( rbody);
......@@ -126,6 +132,9 @@ class wbl_object {
pwr_tCid m_cid;
pwr_tTid m_tid;
pwr_tOid m_oid;
pwr_tTime m_ohtime;
pwr_tTime m_rbtime;
pwr_tTime m_dbtime;
char cname[32];
pwr_mClassDef m_flags;
wb_wblnode *fth;
......@@ -269,6 +278,7 @@ public:
ref_wblnode get_o_lch();
int classNameToCid( char *cname, pwr_tCid *cid);
int stringToOix( const char *buf, pwr_tOix *oix) const;
int stringToTime( const char *buf, pwr_tTime *time) const;
pwr_tCid Cid() { return o->c.cid;}
int attrStringToValue( int type_id, char *value_str,
void *buffer_ptr, size_t buff_size, size_t attr_size);
......
This diff is collapsed.
......@@ -8,7 +8,7 @@ header {
header "post_include_hpp" {
extern int wblparser_error_cnt;
# This declarations should be moved inside parser class in wb_wblparser.hpp !!
# This_declarations_should_be_moved_inside_parser_class_in_wb_wblparser_hpp_!!
void reportError(const RecognitionException& ex);
}
header "post_include_cpp" {
......@@ -49,11 +49,11 @@ sobject
;
object
: OBJECT^ cid (oix)? (body)* ((DOCBLOCK)? object)* ENDOBJECT
: OBJECT^ cid (oix)? (ASC_TIME)? (body)* ((DOCBLOCK)? object)* ENDOBJECT
;
body
: BODY^ (attribute)* ENDBODY
: BODY^ (ASC_TIME)? (attribute)* ENDBODY
;
attribute
......
......@@ -25,17 +25,18 @@ struct wb_wblparserTokenTypes {
INT = 21,
OID = 22,
DOCBLOCK = 23,
EQ = 24,
OREQ = 25,
WS = 26,
COMMENT = 27,
INDEX = 28,
VALUE = 29,
CHAR_LITERAL = 30,
STRING_LITERAL = 31,
DIGITS = 32,
ESC = 33,
SWEC = 34,
ASC_TIME = 24,
EQ = 25,
OREQ = 26,
WS = 27,
COMMENT = 28,
INDEX = 29,
VALUE = 30,
CHAR_LITERAL = 31,
STRING_LITERAL = 32,
DIGITS = 33,
ESC = 34,
SWEC = 35,
NULL_TREE_LOOKAHEAD = 3
};
};
......
......@@ -20,14 +20,15 @@ NUM_FLOAT=20
INT=21
OID=22
DOCBLOCK=23
EQ=24
OREQ=25
WS=26
COMMENT=27
INDEX("an index")=28
VALUE("an identifer")=29
CHAR_LITERAL=30
STRING_LITERAL=31
DIGITS=32
ESC=33
SWEC=34
ASC_TIME=24
EQ=25
OREQ=26
WS=27
COMMENT=28
INDEX("an index")=29
VALUE("an identifer")=30
CHAR_LITERAL=31
STRING_LITERAL=32
DIGITS=33
ESC=34
SWEC=35
......@@ -25,17 +25,18 @@ struct wb_wblvocabTokenTypes {
INT = 21,
OID = 22,
DOCBLOCK = 23,
EQ = 24,
OREQ = 25,
WS = 26,
COMMENT = 27,
INDEX = 28,
VALUE = 29,
CHAR_LITERAL = 30,
STRING_LITERAL = 31,
DIGITS = 32,
ESC = 33,
SWEC = 34,
ASC_TIME = 24,
EQ = 25,
OREQ = 26,
WS = 27,
COMMENT = 28,
INDEX = 29,
VALUE = 30,
CHAR_LITERAL = 31,
STRING_LITERAL = 32,
DIGITS = 33,
ESC = 34,
SWEC = 35,
NULL_TREE_LOOKAHEAD = 3
};
};
......
......@@ -20,14 +20,15 @@ NUM_FLOAT=20
INT=21
OID=22
DOCBLOCK=23
EQ=24
OREQ=25
WS=26
COMMENT=27
INDEX("an index")=28
VALUE("an identifer")=29
CHAR_LITERAL=30
STRING_LITERAL=31
DIGITS=32
ESC=33
SWEC=34
ASC_TIME=24
EQ=25
OREQ=26
WS=27
COMMENT=28
INDEX("an index")=29
VALUE("an identifer")=30
CHAR_LITERAL=31
STRING_LITERAL=32
DIGITS=33
ESC=34
SWEC=35
/**
* Proview $Id: wb_wnav_item.cpp,v 1.13 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_wnav_item.cpp,v 1.14 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -344,12 +344,19 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
// Display object name
if ( wnav->editmode)
{
if ( wnav->editmode) {
item = (WItem *) new WItemObjectName( wnav->brow, wnav->ldhses, objid,
node, flow_eDest_IntoLast);
attr_exist = 1;
}
// Display modification time
if ( wnav->gbl.show_truedb) {
item = (WItem *) new WItemObjectModTime( wnav->brow, wnav->ldhses, objid,
node, flow_eDest_IntoLast);
attr_exist = 1;
}
// Get bodydef for rtbody, devbody or sysbody
sts = ldh_GetObjectClass( wnav->ldhses, objid, &classid);
......@@ -929,6 +936,50 @@ int WItemObjectName::get_value( char **value)
return WNAV__SUCCESS;
}
WItemObjectModTime::WItemObjectModTime(
WNavBrow *item_brow, ldh_tSesContext item_ldhses,
pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code) :
WItem( item_objid, 0), brow(item_brow), ldhses(item_ldhses)
{
int sts;
char timestr[40];
pwr_tTime time;
type = wnav_eItemType_ObjectModTime;
sts = ldh_GetModTime( ldhses, objid, &time);
if ( ODD(sts))
sts = time_AtoAscii( &time, time_eFormat_DateAndTime, timestr, sizeof(timestr));
if ( EVEN(sts))
strcpy( timestr, "Undefined");
brow_CreateNode( brow->ctx, "ModTime", brow->nc_attr,
dest, dest_code, (void *) this, 1, &node);
brow_SetAnnotPixmap( node, 0, brow->pixmap_objname);
// Set name
brow_SetAnnotation( node, 0, "ModificationTime", strlen("ModificaionTime"));
brow_SetAnnotation( node, 1, timestr, strlen(timestr));
}
int WItemObjectModTime::update()
{
char timestr[40];
pwr_tTime time;
int sts;
sts = ldh_GetModTime( ldhses, objid, &time);
if ( ODD(sts))
sts = time_AtoAscii( &time, time_eFormat_DateAndTime, timestr, sizeof(timestr));
if ( EVEN(sts))
strcpy( timestr, "Undefined");
brow_SetAnnotation( node, 1, timestr, strlen(timestr));
return WNAV__SUCCESS;
}
WItemFile::WItemFile( WNav *wnav, char *item_name, char *text,
char *item_file_name, item_eFileType item_filetype,
brow_tNode dest, flow_eDest dest_code) :
......
/**
* Proview $Id: wb_wnav_item.h,v 1.8 2005-09-01 14:57:59 claes Exp $
* Proview $Id: wb_wnav_item.h,v 1.9 2005-09-06 08:02:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -59,7 +59,8 @@ typedef enum {
wnav_eItemType_File,
wnav_eItemType_Text,
wnav_eItemType_Crossref,
wnav_eItemType_DocBlock
wnav_eItemType_DocBlock,
wnav_eItemType_ObjectModTime
} wnav_eItemType;
typedef enum {
......@@ -188,6 +189,18 @@ class WItemObjectName : public WItem {
int get_value( char **value); // The value should be freed with free
};
class WItemObjectModTime : public WItem {
public:
WItemObjectModTime(
WNavBrow *item_brow, ldh_tSesContext item_ldhses,
pwr_tObjid item_objid,
brow_tNode dest, flow_eDest dest_code);
WNavBrow *brow;
ldh_tSesContext ldhses;
int update();
};
class WItemDocBlock : public WItem {
public:
WItemDocBlock(
......
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