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. * 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
...@@ -298,3 +298,8 @@ wb_name wb_bdrep::longName() const ...@@ -298,3 +298,8 @@ wb_name wb_bdrep::longName() const
{ {
return m_orep->longName(); 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. * 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
...@@ -58,7 +58,7 @@ public: ...@@ -58,7 +58,7 @@ public:
wb_adrep *super( pwr_tStatus *sts); wb_adrep *super( pwr_tStatus *sts);
pwr_tStatus sts() { return m_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. * 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
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
**/ **/
#include "co_cdh.h" #include "co_cdh.h"
#include "co_time.h"
#include "wb_cdrep.h" #include "wb_cdrep.h"
#include "wb_erep.h" #include "wb_erep.h"
#include "wb_merep.h" #include "wb_merep.h"
...@@ -450,6 +451,32 @@ pwr_tTime wb_cdrep::ohTime() ...@@ -450,6 +451,32 @@ pwr_tTime wb_cdrep::ohTime()
return m_orep->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_cdrep* wb_cdrep::super( pwr_tStatus *sts)
{ {
wb_bdrep *bd = bdrep( sts, pwr_eBix_rt); 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 ...@@ -759,5 +786,9 @@ void wb_cdrep::updateTemplate( pwr_eBix bix, void *b, pwr_tOid oid, pwr_tOid toi
delete bd; 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. * 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
...@@ -76,6 +76,8 @@ public: ...@@ -76,6 +76,8 @@ public:
wb_orep *menuFirst( pwr_tStatus *sts, wb_orep *orep, void **o); wb_orep *menuFirst( pwr_tStatus *sts, wb_orep *orep, void **o);
pwr_tTime ohTime(); pwr_tTime ohTime();
pwr_tTime modTime();
pwr_tTime structModTime();
void convertSubClass( pwr_tCid cid, wb_merep *merep, void convertSubClass( pwr_tCid cid, wb_merep *merep,
void *body_source, void *body_target); void *body_source, void *body_target);
void convertObject( wb_merep *merep, void *rbody, void *dbody, void convertObject( wb_merep *merep, void *rbody, void *dbody,
...@@ -86,6 +88,7 @@ public: ...@@ -86,6 +88,7 @@ public:
pwr_tOid toid); pwr_tOid toid);
void updateTemplate( pwr_eBix bix, void *b, pwr_tOid oid, pwr_tOid toid); void updateTemplate( pwr_eBix bix, void *b, pwr_tOid oid, pwr_tOid toid);
pwr_tStatus sts() { return m_sts;} pwr_tStatus sts() { return m_sts;}
ldh_eVolRep vtype() const;
}; };
#endif #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. * 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
...@@ -2055,6 +2055,17 @@ ldh_GetSubClass(ldh_tSession session, pwr_tCid supercid, pwr_tCid subcid, pwr_tC ...@@ -2055,6 +2055,17 @@ ldh_GetSubClass(ldh_tSession session, pwr_tCid supercid, pwr_tCid subcid, pwr_tC
return sp->sts(); 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 #endif
...@@ -2062,3 +2073,4 @@ ldh_GetSubClass(ldh_tSession session, pwr_tCid supercid, pwr_tCid subcid, pwr_tC ...@@ -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. * 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
...@@ -1175,6 +1175,13 @@ ldh_GetSubClass( ...@@ -1175,6 +1175,13 @@ ldh_GetSubClass(
pwr_tCid *nextsubcid pwr_tCid *nextsubcid
); );
pwr_tStatus
ldh_GetModTime(
ldh_tSession session,
pwr_tOid oid,
pwr_tTime *time
);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #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. * 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,6 +364,13 @@ void wb_merep::classVersion( pwr_tStatus *sts, pwr_tCid cid, pwr_tTime *time) ...@@ -364,6 +364,13 @@ void wb_merep::classVersion( pwr_tStatus *sts, pwr_tCid cid, pwr_tTime *time)
wb_cdrep *cd = cdrep( sts, cid); wb_cdrep *cd = cdrep( sts, cid);
if ( !cd) return; 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); wb_bdrep *bd = cd->bdrep( sts, pwr_eBix_rt);
if ( !bd) { if ( !bd) {
delete cd; delete cd;
...@@ -375,7 +382,7 @@ void wb_merep::classVersion( pwr_tStatus *sts, pwr_tCid cid, pwr_tTime *time) ...@@ -375,7 +382,7 @@ void wb_merep::classVersion( pwr_tStatus *sts, pwr_tCid cid, pwr_tTime *time)
return; return;
} }
*time = cd->ohTime(); *time = cd->structModTime();
wb_adrep *ad, *oad; wb_adrep *ad, *oad;
for ( ad = bd->adrep( sts); ad;) { 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. * 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
...@@ -290,6 +290,34 @@ pwr_tTime wb_object::ohTime() ...@@ -290,6 +290,34 @@ pwr_tTime wb_object::ohTime()
return m_orep->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() pwr_mClassDef wb_object::flags()
{ {
check(); 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. * 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
...@@ -82,9 +82,11 @@ public: ...@@ -82,9 +82,11 @@ public:
const char *name(); const char *name();
wb_name longName(); 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 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 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(); 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. * 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
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
**/ **/
#include "wb_orep.h" #include "wb_orep.h"
#include "co_time.h"
wb_orep::wb_orep() : m_nRef(0) wb_orep::wb_orep() : m_nRef(0)
{ {
...@@ -37,3 +38,38 @@ wb_orep *wb_orep::ref() ...@@ -37,3 +38,38 @@ wb_orep *wb_orep::ref()
m_nRef++; m_nRef++;
return this; 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. * 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
...@@ -62,6 +62,8 @@ public: ...@@ -62,6 +62,8 @@ public:
virtual const char * name() const = 0; virtual const char * name() const = 0;
virtual wb_name longName() = 0; virtual wb_name longName() = 0;
virtual pwr_tTime ohTime() const = 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 pwr_mClassDef flags() const = 0;
virtual bool isOffspringOf(const wb_orep *o) const = 0; virtual bool isOffspringOf(const wb_orep *o) const = 0;
...@@ -85,6 +87,10 @@ public: ...@@ -85,6 +87,10 @@ public:
virtual wb_erep *erep() const = 0; virtual wb_erep *erep() const = 0;
virtual wb_vrep *vrep() const = 0; virtual wb_vrep *vrep() const = 0;
virtual ldh_eVolRep vtype() const = 0;
pwr_tTime modTime();
pwr_tTime treeModTime();
}; };
#endif #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. * 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
...@@ -129,10 +129,24 @@ const char * wb_orepdb::name() const ...@@ -129,10 +129,24 @@ const char * wb_orepdb::name() const
pwr_tTime wb_orepdb::ohTime() const pwr_tTime wb_orepdb::ohTime() const
{ {
pwr_tStatus sts; pwr_tStatus sts;
return m_vrep->ohTime(&sts, (wb_orep*)this); 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_mClassDef wb_orepdb::flags() const
{ {
pwr_tStatus sts; 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. * 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
...@@ -55,6 +55,8 @@ public: ...@@ -55,6 +55,8 @@ public:
virtual const char * name() const; virtual const char * name() const;
virtual wb_name longName(); virtual wb_name longName();
virtual pwr_tTime ohTime() const; virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const; virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const; virtual bool isOffspringOf(const wb_orep *o) const;
...@@ -76,6 +78,7 @@ public: ...@@ -76,6 +78,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();} wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;} wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Db;}
}; };
#endif #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. * 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
...@@ -156,6 +156,16 @@ pwr_tTime wb_orepdbs::ohTime() const ...@@ -156,6 +156,16 @@ pwr_tTime wb_orepdbs::ohTime() const
return m_o->time; 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 pwr_mClassDef wb_orepdbs::flags() const
{ {
return m_o->ohFlags; 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. * 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
...@@ -58,6 +58,8 @@ public: ...@@ -58,6 +58,8 @@ public:
virtual const char * name() const; virtual const char * name() const;
virtual wb_name longName(); virtual wb_name longName();
virtual pwr_tTime ohTime() const; virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const; virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const; virtual bool isOffspringOf(const wb_orep *o) const;
...@@ -79,6 +81,7 @@ public: ...@@ -79,6 +81,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();} wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;} wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Dbs;}
dbs_sObject *o() const { return m_o;} 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. * 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
...@@ -89,8 +89,17 @@ wb_name wb_orepext::longName() ...@@ -89,8 +89,17 @@ wb_name wb_orepext::longName()
pwr_tTime wb_orepext::ohTime() const pwr_tTime wb_orepext::ohTime() const
{ {
pwr_tTime t = {0,0}; return m_extobject.time;
return t; }
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 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. * 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
...@@ -53,6 +53,8 @@ public: ...@@ -53,6 +53,8 @@ public:
virtual const char * name() const; virtual const char * name() const;
virtual wb_name longName(); virtual wb_name longName();
virtual pwr_tTime ohTime() const; virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const; virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const; virtual bool isOffspringOf(const wb_orep *o) const;
...@@ -75,6 +77,7 @@ public: ...@@ -75,6 +77,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();} wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;} 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, int *size) const { return false;}
virtual bool docBlock( char *block) { 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. * 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
...@@ -103,8 +103,17 @@ wb_name wb_orepmem::longName() ...@@ -103,8 +103,17 @@ wb_name wb_orepmem::longName()
pwr_tTime wb_orepmem::ohTime() const pwr_tTime wb_orepmem::ohTime() const
{ {
pwr_tTime t = {0,0}; return m_memobject->m_ohtime;
return t; }
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 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. * 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
...@@ -54,6 +54,8 @@ public: ...@@ -54,6 +54,8 @@ public:
virtual const char * name() const; virtual const char * name() const;
virtual wb_name longName(); virtual wb_name longName();
virtual pwr_tTime ohTime() const; virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const; virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const; virtual bool isOffspringOf(const wb_orep *o) const;
...@@ -78,6 +80,7 @@ public: ...@@ -78,6 +80,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();} wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;} 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, int *size) const;
virtual bool docBlock( char *block); 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. * 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
...@@ -55,6 +55,8 @@ public: ...@@ -55,6 +55,8 @@ public:
return wb_name( str); return wb_name( str);
} }
virtual pwr_tTime ohTime() const { pwr_tTime t = {0,0}; return t;} 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 pwr_mClassDef flags() const { pwr_mClassDef m; m.m = 0; return m;}
virtual bool isOffspringOf(const wb_orep *o) const {return false;} virtual bool isOffspringOf(const wb_orep *o) const {return false;}
...@@ -71,6 +73,7 @@ public: ...@@ -71,6 +73,7 @@ public:
virtual wb_adrep *attribute(pwr_tStatus *sts) {*sts = LDH__NOSUCHOBJ; return 0;} virtual wb_adrep *attribute(pwr_tStatus *sts) {*sts = LDH__NOSUCHOBJ; return 0;}
wb_erep *erep() const { return m_vrep->erep();} wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;} 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, int *size) const {return false;}
virtual bool docBlock( char *block) {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. * 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
...@@ -103,7 +103,19 @@ wb_name wb_orepwbl::longName() ...@@ -103,7 +103,19 @@ wb_name wb_orepwbl::longName()
pwr_tTime wb_orepwbl::ohTime() const 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. * 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
...@@ -54,6 +54,8 @@ public: ...@@ -54,6 +54,8 @@ public:
virtual const char * name() const; virtual const char * name() const;
virtual wb_name longName(); virtual wb_name longName();
virtual pwr_tTime ohTime() const; virtual pwr_tTime ohTime() const;
virtual pwr_tTime rbTime() const;
virtual pwr_tTime dbTime() const;
virtual pwr_mClassDef flags() const; virtual pwr_mClassDef flags() const;
virtual bool isOffspringOf(const wb_orep *o) const; virtual bool isOffspringOf(const wb_orep *o) const;
...@@ -78,6 +80,7 @@ public: ...@@ -78,6 +80,7 @@ public:
wb_erep *erep() const { return m_vrep->erep();} wb_erep *erep() const { return m_vrep->erep();}
wb_vrep *vrep() const { return m_vrep;} wb_vrep *vrep() const { return m_vrep;}
virtual ldh_eVolRep vtype() const { return ldh_eVolRep_Wbl;}
bool docBlock( char **block, int *size) const; 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. * 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_timeFlag(true),
m_level(0), m_level(0),
m_levelInd(levelIndentation), m_levelInd(levelIndentation),
m_keepName(false), m_keepName(false),
...@@ -106,6 +107,7 @@ void wb_print_wbl::printBody(wb_volume& v, ...@@ -106,6 +107,7 @@ void wb_print_wbl::printBody(wb_volume& v,
wb_attribute attr; wb_attribute attr;
wb_attribute tattr; wb_attribute tattr;
const char* bname; const char* bname;
char timestr[40] = " ";
wb_bdef bdef = cdef.bdef(bix); wb_bdef bdef = cdef.bdef(bix);
...@@ -122,8 +124,25 @@ void wb_print_wbl::printBody(wb_volume& v, ...@@ -122,8 +124,25 @@ void wb_print_wbl::printBody(wb_volume& v,
return; return;
} }
if ( m_timeFlag) {
indent(1) << "Body " << bdef.name() << endl; // 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()) { for (adef = bdef.adef(); adef; adef = adef.next()) {
attr = o.attribute(bname, adef.name()); attr = o.attribute(bname, adef.name());
tattr = templ.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) ...@@ -425,6 +444,14 @@ void wb_print_wbl::printObject(wb_volume& v, wb_object& o, bool recursive)
} }
m_os << " " << idx; 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; m_os << endl;
wb_object co = v.object(cdh_ClassIdToObjid(cdef.cid())); 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. * 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_timeFlag;
int m_level; int m_level;
int m_levelInd; int m_levelInd;
char m_indBuf[256]; 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. * 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
...@@ -81,6 +81,8 @@ public: ...@@ -81,6 +81,8 @@ public:
virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o) = 0; 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 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 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 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; 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. * 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
...@@ -818,6 +818,36 @@ pwr_tTime wb_vrepdb::ohTime(pwr_tStatus *sts, const wb_orep *orp) ...@@ -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) pwr_mClassDef wb_vrepdb::flags(pwr_tStatus *sts, const wb_orep *orp)
{ {
*sts = LDH__SUCCESS; *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. * 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
...@@ -98,6 +98,8 @@ public: ...@@ -98,6 +98,8 @@ public:
virtual wb_vrep *next(); virtual wb_vrep *next();
virtual pwr_tTime ohTime(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 pwr_mClassDef flags(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid oid(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); 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. * 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
...@@ -170,6 +170,16 @@ pwr_tTime wb_vrepdbs::ohTime(pwr_tStatus *sts, const wb_orep *o) ...@@ -170,6 +170,16 @@ pwr_tTime wb_vrepdbs::ohTime(pwr_tStatus *sts, const wb_orep *o)
return o->ohTime(); 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) pwr_mClassDef wb_vrepdbs::flags(pwr_tStatus *sts, const wb_orep *o)
{ {
return o->flags(); 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. * 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
...@@ -75,6 +75,8 @@ public: ...@@ -75,6 +75,8 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o); 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 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_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;} 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. * 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
...@@ -171,7 +171,9 @@ public: ...@@ -171,7 +171,9 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();} 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 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;} 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. * 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
...@@ -514,7 +514,11 @@ void wb_vrepmem::objectName(const wb_orep *o, char *str) ...@@ -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) 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; *sts = LDH__SUCCESS;
clock_gettime(CLOCK_REALTIME, &time);
mem_object *n = ((wb_orepmem *) o)->memobject(); 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 ...@@ -525,6 +529,7 @@ bool wb_vrepmem::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size
return false; return false;
} }
memcpy( (char *)n->rbody + offset, p, MIN(n->rbody_size - offset, size)); memcpy( (char *)n->rbody + offset, p, MIN(n->rbody_size - offset, size));
n->m_rbtime = time;
return true; return true;
case pwr_eBix_dev: case pwr_eBix_dev:
if ( n->dbody_size == 0) { if ( n->dbody_size == 0) {
...@@ -532,6 +537,7 @@ bool wb_vrepmem::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size ...@@ -532,6 +537,7 @@ bool wb_vrepmem::writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size
return false; return false;
} }
memcpy( (char *)n->dbody + offset, p, MIN(n->dbody_size - offset, size)); memcpy( (char *)n->dbody + offset, p, MIN(n->dbody_size - offset, size));
n->m_dbtime = time;
return true; return true;
default: default:
*sts = LDH__NOSUCHBODY; *sts = LDH__NOSUCHBODY;
...@@ -574,7 +580,10 @@ void *wb_vrepmem::readAttribute(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix ...@@ -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) bool wb_vrepmem::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p)
{ {
pwr_tTime time;
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
clock_gettime(CLOCK_REALTIME, &time);
mem_object *n = ((wb_orepmem *) o)->memobject(); 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) ...@@ -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); memcpy( n->rbody, p, n->rbody_size);
n->m_rbtime = time;
return true; return true;
case pwr_eBix_dev: case pwr_eBix_dev:
if ( n->dbody_size == 0) { if ( n->dbody_size == 0) {
...@@ -593,6 +603,7 @@ bool wb_vrepmem::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p) ...@@ -593,6 +603,7 @@ bool wb_vrepmem::writeBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p)
return false; return false;
} }
memcpy( n->dbody, p, n->dbody_size); memcpy( n->dbody, p, n->dbody_size);
n->m_dbtime = time;
return true; return true;
default: default:
*sts = LDH__NOSUCHBODY; *sts = LDH__NOSUCHBODY;
...@@ -681,6 +692,9 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination ...@@ -681,6 +692,9 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
ldh_eDest code = d.code(); ldh_eDest code = d.code();
char name_str[32]; char name_str[32];
pwr_tOix oix; pwr_tOix oix;
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
if ( d.oid().oix == 0) { if ( d.oid().oix == 0) {
dest = root_object; dest = root_object;
...@@ -717,20 +731,24 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination ...@@ -717,20 +731,24 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
strcpy( name_str, name.object()); strcpy( name_str, name.object());
} }
mem_object *memo = new mem_object(); mem_object *memo = new mem_object();
strcpy( memo->m_name, name_str); strcpy( memo->m_name, name_str);
memo->m_oid.oix = oix; memo->m_oid.oix = oix;
memo->m_oid.vid = m_vid; memo->m_oid.vid = m_vid;
memo->m_cid = cdef.cid(); memo->m_cid = cdef.cid();
memo->m_flags = cdef.flags(); memo->m_flags = cdef.flags();
memo->m_ohtime = time;
memo->rbody_size = cdef.size( pwr_eBix_rt); memo->rbody_size = cdef.size( pwr_eBix_rt);
if ( memo->rbody_size) { if ( memo->rbody_size) {
memo->m_rbtime = time;
memo->rbody = malloc( memo->rbody_size); memo->rbody = malloc( memo->rbody_size);
cdef.templateBody( sts, pwr_eBix_rt, memo->rbody, memo->m_oid); cdef.templateBody( sts, pwr_eBix_rt, memo->rbody, memo->m_oid);
if ( EVEN(*sts)) return 0; if ( EVEN(*sts)) return 0;
} }
memo->dbody_size = cdef.size( pwr_eBix_dev); memo->dbody_size = cdef.size( pwr_eBix_dev);
if ( memo->dbody_size) { if ( memo->dbody_size) {
memo->m_dbtime = time;
memo->dbody = malloc( memo->dbody_size); memo->dbody = malloc( memo->dbody_size);
cdef.templateBody( sts, pwr_eBix_dev, memo->dbody, memo->m_oid); cdef.templateBody( sts, pwr_eBix_dev, memo->dbody, memo->m_oid);
if ( EVEN(*sts)) return 0; if ( EVEN(*sts)) return 0;
...@@ -830,6 +848,9 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin ...@@ -830,6 +848,9 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
mem_object *dest; mem_object *dest;
ldh_eDest code = d.code(); ldh_eDest code = d.code();
char name_str[32]; char name_str[32];
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
if ( cdh_ObjidIsNull( d.oid())) { if ( cdh_ObjidIsNull( d.oid())) {
dest = root_object; dest = root_object;
...@@ -867,12 +888,14 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin ...@@ -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.oix = oix;
memo->m_oid.vid = m_vid; memo->m_oid.vid = m_vid;
memo->m_cid = orep->cid(); memo->m_cid = orep->cid();
memo->m_ohtime = time;
wb_attribute rbody; wb_attribute rbody;
rbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "RtBody"); rbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "RtBody");
if ( !rbody) if ( !rbody)
rbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "SysBody"); rbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "SysBody");
if ( rbody) { if ( rbody) {
memo->m_rbtime = time;
memo->rbody_size = rbody.size(); memo->rbody_size = rbody.size();
memo->rbody = malloc( memo->rbody_size); memo->rbody = malloc( memo->rbody_size);
rbody.value( memo->rbody); rbody.value( memo->rbody);
...@@ -881,6 +904,7 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin ...@@ -881,6 +904,7 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
wb_attribute dbody; wb_attribute dbody;
dbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "DevBody"); dbody = wb_attribute( LDH__SUCCESS, (wb_orep *)orep, "DevBody");
if ( dbody) { if ( dbody) {
memo->m_dbtime = time;
memo->dbody_size = dbody.size(); memo->dbody_size = dbody.size();
memo->dbody = malloc( memo->dbody_size); memo->dbody = malloc( memo->dbody_size);
dbody.value( memo->dbody); dbody.value( memo->dbody);
...@@ -953,6 +977,9 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d) ...@@ -953,6 +977,9 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
{ {
mem_object *dest; mem_object *dest;
ldh_eDest code = d.code(); ldh_eDest code = d.code();
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
if ( cdh_ObjidIsEqual( d.oid(), orep->oid())) if ( cdh_ObjidIsEqual( d.oid(), orep->oid()))
return false; return false;
...@@ -1038,6 +1065,8 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d) ...@@ -1038,6 +1065,8 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
return false; return false;
} }
memo->m_ohtime = time;
return true; return true;
} }
...@@ -1105,6 +1134,10 @@ void wb_vrepmem::deleteChildren( mem_object *memo) ...@@ -1105,6 +1134,10 @@ void wb_vrepmem::deleteChildren( mem_object *memo)
bool wb_vrepmem::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name) 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(); mem_object *memo = ((wb_orepmem *)orep)->memobject();
if ( !memo) return false; if ( !memo) return false;
...@@ -1128,6 +1161,9 @@ bool wb_vrepmem::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name) ...@@ -1128,6 +1161,9 @@ bool wb_vrepmem::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name)
strcpy( memo->m_name, old_name); strcpy( memo->m_name, old_name);
return LDH__NAMALREXI; return LDH__NAMALREXI;
} }
memo->m_ohtime = time;
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
return true; return true;
} }
...@@ -1399,6 +1435,9 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode, ...@@ -1399,6 +1435,9 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode,
pwr_tOid *roid) pwr_tOid *roid)
{ {
pwr_tStatus sts; pwr_tStatus sts;
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
mem_object *memo = new mem_object(); mem_object *memo = new mem_object();
strcpy( memo->m_name, name); strcpy( memo->m_name, name);
...@@ -1475,13 +1514,16 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode, ...@@ -1475,13 +1514,16 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode,
memo->m_oid.vid = m_vid; memo->m_oid.vid = m_vid;
memo->m_cid = cid; memo->m_cid = cid;
memo->m_flags = flags; memo->m_flags = flags;
memo->m_ohtime = time;
memo->rbody_size = rbSize; memo->rbody_size = rbSize;
if ( memo->rbody_size) { if ( memo->rbody_size) {
memo->m_rbtime = time;
memo->rbody = malloc( memo->rbody_size); memo->rbody = malloc( memo->rbody_size);
memcpy( memo->rbody, rbody, memo->rbody_size); memcpy( memo->rbody, rbody, memo->rbody_size);
} }
memo->dbody_size = dbSize; memo->dbody_size = dbSize;
if ( memo->dbody_size) { if ( memo->dbody_size) {
memo->m_dbtime = time;
memo->dbody = malloc( memo->dbody_size); memo->dbody = malloc( memo->dbody_size);
memcpy( memo->dbody, dbody, memo->dbody_size); memcpy( memo->dbody, dbody, memo->dbody_size);
} }
...@@ -1716,7 +1758,7 @@ bool wb_vrepmem::importBuildObject( mem_object *memo) ...@@ -1716,7 +1758,7 @@ bool wb_vrepmem::importBuildObject( mem_object *memo)
bool wb_vrepmem::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid, 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, pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid, pwr_tOid loid,
const char *name, const char *normname, pwr_mClassDef flags, 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) size_t rbSize, size_t dbSize)
{ {
...@@ -1732,7 +1774,9 @@ bool wb_vrepmem::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid, ...@@ -1732,7 +1774,9 @@ bool wb_vrepmem::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
memo->bwsoid = boid; memo->bwsoid = boid;
memo->fwsoid = aoid; memo->fwsoid = aoid;
memo->fchoid = foid; memo->fchoid = foid;
memo->time = time; memo->m_ohtime = ohTime;
memo->m_rbtime = rbTime;
memo->m_dbtime = dbTime;
if (oid.oix == pwr_cNOix) { if (oid.oix == pwr_cNOix) {
// this is the volume object // 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. * 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
...@@ -45,6 +45,12 @@ class mem_object ...@@ -45,6 +45,12 @@ class mem_object
m_flags.m = 0; m_flags.m = 0;
m_oid.oix = 0; m_oid.oix = 0;
m_oid.vid = 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() { ~mem_object() {
if ( rbody_size) free( rbody); if ( rbody_size) free( rbody);
...@@ -180,7 +186,9 @@ class mem_object ...@@ -180,7 +186,9 @@ class mem_object
pwr_tOid fwsoid; pwr_tOid fwsoid;
pwr_tOid fchoid; pwr_tOid fchoid;
int is_built; int is_built;
pwr_tTime time; pwr_tTime m_ohtime;
pwr_tTime m_rbtime;
pwr_tTime m_dbtime;
}; };
class wb_orepmem; class wb_orepmem;
...@@ -256,7 +264,9 @@ public: ...@@ -256,7 +264,9 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();} 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 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;} 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. * 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
...@@ -88,7 +88,9 @@ public: ...@@ -88,7 +88,9 @@ public:
virtual pwr_tOid aoid(pwr_tStatus *sts, const wb_orep *o) { return pwr_cNOid;} 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 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 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 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 void objectName(const wb_orep *o, char *str);
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent) { return false;} 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. * 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
...@@ -139,7 +139,9 @@ public: ...@@ -139,7 +139,9 @@ public:
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o) { return wb_name();} 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 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 { ...@@ -35,6 +35,7 @@ tokens {
INT; INT;
OID; OID;
DOCBLOCK; DOCBLOCK;
ASC_TIME;
} }
EQ : '=' EQ : '='
...@@ -124,6 +125,8 @@ options { ...@@ -124,6 +125,8 @@ options {
{$setType(ATTRIBUTE);} {$setType(ATTRIBUTE);}
| (DIGITS '.' DIGITS '.' ) => DIGITS '.' DIGITS '.' DIGITS '.' DIGITS (':' DIGITS)? | (DIGITS '.' DIGITS '.' ) => DIGITS '.' DIGITS '.' DIGITS '.' DIGITS (':' DIGITS)?
{$setType(OID);} {$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')+)? | (DIGITS '.') => DIGITS '.' ('0'..'9')* (('e'|'E') ('+'|'-')? ('0'..'9')+)?
{$setType(NUM_FLOAT);} {$setType(NUM_FLOAT);}
| ('-' DIGITS '.') => '-' DIGITS '.' ('0'..'9')* (('e'|'E') ('+'|'-')? ('0'..'9')+)? | ('-' DIGITS '.') => '-' DIGITS '.' ('0'..'9')* (('e'|'E') ('+'|'-')? ('0'..'9')+)?
...@@ -137,6 +140,11 @@ options { ...@@ -137,6 +140,11 @@ options {
| ('a'..'z'|'A'..'Z'|'$'|'_'|SWEC) ('a'..'z'|'A'..'Z'|'0'..'9'|'$'|'_'|SWEC)* | ('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 CHAR_LITERAL
: '\'' (ESC|~'\'') '\'' : '\'' (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. * 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
...@@ -369,6 +369,13 @@ int wb_wblnode::stringToOix( const char *buf, pwr_tOix *oix) const ...@@ -369,6 +369,13 @@ int wb_wblnode::stringToOix( const char *buf, pwr_tOix *oix) const
return 1; 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 wb_wblnode::lookup( int *type, const char *keyword, wbl_sSym *table)
{ {
int cond; int cond;
...@@ -980,9 +987,26 @@ void wb_wblnode::buildBody( ref_wblnode object) ...@@ -980,9 +987,26 @@ void wb_wblnode::buildBody( ref_wblnode object)
m_vrep->error( "Bad body name", getFileName(), line_number); 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 = first_child->getNextSibling()) first_child = first_child->getNextSibling())
first_child->buildAttr( object, bix); first_child->buildAttr( object, bix);
next_sibling = getNextSibling(); next_sibling = getNextSibling();
...@@ -1501,6 +1525,9 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol) ...@@ -1501,6 +1525,9 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol)
m_vrep->error( "Bad object name", getFileName(), line_number); m_vrep->error( "Bad object name", getFileName(), line_number);
} }
// Filetime is default for ohtime
o->m_ohtime = getFileTime();
// Get class // Get class
if ( first_child) { if ( first_child) {
string class_name = first_child->getText(); string class_name = first_child->getText();
...@@ -1556,16 +1583,28 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol) ...@@ -1556,16 +1583,28 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol)
// Get oix // Get oix
ref_wblnode second_child = first_child->getNextSibling(); ref_wblnode second_child = first_child->getNextSibling();
if ( second_child) { if ( second_child) {
ref_wblnode third_child = second_child->getNextSibling();
switch ( second_child->getType()) { switch ( second_child->getType()) {
case tokens.VALUE: case tokens.VALUE:
case tokens.INT: case tokens.INT: {
{
string oixstr = second_child->getText(); string oixstr = second_child->getText();
if ( !stringToOix( oixstr.c_str(), &o->m_oid.oix)) { if ( !stringToOix( oixstr.c_str(), &o->m_oid.oix)) {
o->m_oid.oix = m_vrep->nextOix(); 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; 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.ENDOBJECT:
case tokens.OBJECT: case tokens.OBJECT:
case tokens.BODY: case tokens.BODY:
...@@ -1821,7 +1860,7 @@ bool wb_wblnode::exportHead(wb_import &i) ...@@ -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(), i.importHead( o->m_oid, o->m_cid, fthoid, bwsoid, fwsoid, fchoid, lchoid, name(),
n.normName(cdh_mName_object), o->m_flags, 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) if ( o->fch)
o->fch->exportHead( i); 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. * 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
...@@ -80,9 +80,9 @@ class wbl_type { ...@@ -80,9 +80,9 @@ class wbl_type {
class wbl_body { class wbl_body {
public: public:
wbl_body() : bix(pwr_eBix__), size(0) {}; wbl_body() : bix(pwr_eBix__), size(0) {}
pwr_eBix bix; pwr_eBix bix;
size_t size; size_t size;
}; };
class wbl_attribute { class wbl_attribute {
...@@ -114,6 +114,12 @@ class wbl_object { ...@@ -114,6 +114,12 @@ class wbl_object {
m_flags.m = 0; m_flags.m = 0;
m_oid.oix = 0; m_oid.oix = 0;
m_oid.vid = 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() { ~wbl_object() {
if ( rbody_size) free( rbody); if ( rbody_size) free( rbody);
...@@ -126,6 +132,9 @@ class wbl_object { ...@@ -126,6 +132,9 @@ class wbl_object {
pwr_tCid m_cid; pwr_tCid m_cid;
pwr_tTid m_tid; pwr_tTid m_tid;
pwr_tOid m_oid; pwr_tOid m_oid;
pwr_tTime m_ohtime;
pwr_tTime m_rbtime;
pwr_tTime m_dbtime;
char cname[32]; char cname[32];
pwr_mClassDef m_flags; pwr_mClassDef m_flags;
wb_wblnode *fth; wb_wblnode *fth;
...@@ -269,6 +278,7 @@ public: ...@@ -269,6 +278,7 @@ public:
ref_wblnode get_o_lch(); ref_wblnode get_o_lch();
int classNameToCid( char *cname, pwr_tCid *cid); int classNameToCid( char *cname, pwr_tCid *cid);
int stringToOix( const char *buf, pwr_tOix *oix) const; 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;} pwr_tCid Cid() { return o->c.cid;}
int attrStringToValue( int type_id, char *value_str, int attrStringToValue( int type_id, char *value_str,
void *buffer_ptr, size_t buff_size, size_t attr_size); void *buffer_ptr, size_t buff_size, size_t attr_size);
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ header { ...@@ -8,7 +8,7 @@ header {
header "post_include_hpp" { header "post_include_hpp" {
extern int wblparser_error_cnt; 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); void reportError(const RecognitionException& ex);
} }
header "post_include_cpp" { header "post_include_cpp" {
...@@ -49,11 +49,11 @@ sobject ...@@ -49,11 +49,11 @@ sobject
; ;
object object
: OBJECT^ cid (oix)? (body)* ((DOCBLOCK)? object)* ENDOBJECT : OBJECT^ cid (oix)? (ASC_TIME)? (body)* ((DOCBLOCK)? object)* ENDOBJECT
; ;
body body
: BODY^ (attribute)* ENDBODY : BODY^ (ASC_TIME)? (attribute)* ENDBODY
; ;
attribute attribute
......
...@@ -25,17 +25,18 @@ struct wb_wblparserTokenTypes { ...@@ -25,17 +25,18 @@ struct wb_wblparserTokenTypes {
INT = 21, INT = 21,
OID = 22, OID = 22,
DOCBLOCK = 23, DOCBLOCK = 23,
EQ = 24, ASC_TIME = 24,
OREQ = 25, EQ = 25,
WS = 26, OREQ = 26,
COMMENT = 27, WS = 27,
INDEX = 28, COMMENT = 28,
VALUE = 29, INDEX = 29,
CHAR_LITERAL = 30, VALUE = 30,
STRING_LITERAL = 31, CHAR_LITERAL = 31,
DIGITS = 32, STRING_LITERAL = 32,
ESC = 33, DIGITS = 33,
SWEC = 34, ESC = 34,
SWEC = 35,
NULL_TREE_LOOKAHEAD = 3 NULL_TREE_LOOKAHEAD = 3
}; };
}; };
......
...@@ -20,14 +20,15 @@ NUM_FLOAT=20 ...@@ -20,14 +20,15 @@ NUM_FLOAT=20
INT=21 INT=21
OID=22 OID=22
DOCBLOCK=23 DOCBLOCK=23
EQ=24 ASC_TIME=24
OREQ=25 EQ=25
WS=26 OREQ=26
COMMENT=27 WS=27
INDEX("an index")=28 COMMENT=28
VALUE("an identifer")=29 INDEX("an index")=29
CHAR_LITERAL=30 VALUE("an identifer")=30
STRING_LITERAL=31 CHAR_LITERAL=31
DIGITS=32 STRING_LITERAL=32
ESC=33 DIGITS=33
SWEC=34 ESC=34
SWEC=35
...@@ -25,17 +25,18 @@ struct wb_wblvocabTokenTypes { ...@@ -25,17 +25,18 @@ struct wb_wblvocabTokenTypes {
INT = 21, INT = 21,
OID = 22, OID = 22,
DOCBLOCK = 23, DOCBLOCK = 23,
EQ = 24, ASC_TIME = 24,
OREQ = 25, EQ = 25,
WS = 26, OREQ = 26,
COMMENT = 27, WS = 27,
INDEX = 28, COMMENT = 28,
VALUE = 29, INDEX = 29,
CHAR_LITERAL = 30, VALUE = 30,
STRING_LITERAL = 31, CHAR_LITERAL = 31,
DIGITS = 32, STRING_LITERAL = 32,
ESC = 33, DIGITS = 33,
SWEC = 34, ESC = 34,
SWEC = 35,
NULL_TREE_LOOKAHEAD = 3 NULL_TREE_LOOKAHEAD = 3
}; };
}; };
......
...@@ -20,14 +20,15 @@ NUM_FLOAT=20 ...@@ -20,14 +20,15 @@ NUM_FLOAT=20
INT=21 INT=21
OID=22 OID=22
DOCBLOCK=23 DOCBLOCK=23
EQ=24 ASC_TIME=24
OREQ=25 EQ=25
WS=26 OREQ=26
COMMENT=27 WS=27
INDEX("an index")=28 COMMENT=28
VALUE("an identifer")=29 INDEX("an index")=29
CHAR_LITERAL=30 VALUE("an identifer")=30
STRING_LITERAL=31 CHAR_LITERAL=31
DIGITS=32 STRING_LITERAL=32
ESC=33 DIGITS=33
SWEC=34 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. * 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
...@@ -344,12 +344,19 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y) ...@@ -344,12 +344,19 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
// Display object name // Display object name
if ( wnav->editmode) if ( wnav->editmode) {
{
item = (WItem *) new WItemObjectName( wnav->brow, wnav->ldhses, objid, item = (WItem *) new WItemObjectName( wnav->brow, wnav->ldhses, objid,
node, flow_eDest_IntoLast); node, flow_eDest_IntoLast);
attr_exist = 1; 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 // Get bodydef for rtbody, devbody or sysbody
sts = ldh_GetObjectClass( wnav->ldhses, objid, &classid); sts = ldh_GetObjectClass( wnav->ldhses, objid, &classid);
...@@ -929,6 +936,50 @@ int WItemObjectName::get_value( char **value) ...@@ -929,6 +936,50 @@ int WItemObjectName::get_value( char **value)
return WNAV__SUCCESS; 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, WItemFile::WItemFile( WNav *wnav, char *item_name, char *text,
char *item_file_name, item_eFileType item_filetype, char *item_file_name, item_eFileType item_filetype,
brow_tNode dest, flow_eDest dest_code) : 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. * 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
...@@ -59,7 +59,8 @@ typedef enum { ...@@ -59,7 +59,8 @@ typedef enum {
wnav_eItemType_File, wnav_eItemType_File,
wnav_eItemType_Text, wnav_eItemType_Text,
wnav_eItemType_Crossref, wnav_eItemType_Crossref,
wnav_eItemType_DocBlock wnav_eItemType_DocBlock,
wnav_eItemType_ObjectModTime
} wnav_eItemType; } wnav_eItemType;
typedef enum { typedef enum {
...@@ -188,6 +189,18 @@ class WItemObjectName : public WItem { ...@@ -188,6 +189,18 @@ class WItemObjectName : public WItem {
int get_value( char **value); // The value should be freed with free 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 { class WItemDocBlock : public WItem {
public: public:
WItemDocBlock( 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