Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
479dbac4
Commit
479dbac4
authored
Dec 02, 2003
by
lw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added export to wb_vrepdb
parent
5d9c7552
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
161 additions
and
32 deletions
+161
-32
src/lib/co/src/co_cdh.c
src/lib/co/src/co_cdh.c
+10
-0
src/lib/co/src/co_cdh.h
src/lib/co/src/co_cdh.h
+5
-0
wb/exe/wb_wbltest/src/wb_wbltest.cpp
wb/exe/wb_wbltest/src/wb_wbltest.cpp
+12
-5
wb/lib/wb/src/wb_db.cpp
wb/lib/wb/src/wb_db.cpp
+104
-12
wb/lib/wb/src/wb_db.h
wb/lib/wb/src/wb_db.h
+3
-0
wb/lib/wb/src/wb_pkg.h
wb/lib/wb/src/wb_pkg.h
+1
-1
wb/lib/wb/src/wb_vrepdb.cpp
wb/lib/wb/src/wb_vrepdb.cpp
+21
-9
xtt/lib/ge/src/ge_dyn.cpp
xtt/lib/ge/src/ge_dyn.cpp
+5
-5
No files found.
src/lib/co/src/co_cdh.c
View file @
479dbac4
...
...
@@ -2185,6 +2185,16 @@ cdh_PackName (
return
pack
.
key
;
}
char
*
cdh_Low
(
const
char
*
s
)
{
static
char
buf
[
500
];
return
cdh_ToLower
(
buf
,
s
);
}
char
*
cdh_ToLower
(
char
*
t
,
...
...
src/lib/co/src/co_cdh.h
View file @
479dbac4
...
...
@@ -840,6 +840,11 @@ cdh_ParseName (
pwr_tUInt32
flags
);
char
*
cdh_Low
(
const
char
*
s
);
char
*
cdh_ToLower
(
char
*
t
,
...
...
wb/exe/wb_wbltest/src/wb_wbltest.cpp
View file @
479dbac4
...
...
@@ -3,6 +3,7 @@
#include "wb_erep.h"
#include "wb_env.h"
#include "wb_vrepdbs.h"
#include "wb_vrepdb.h"
#include "wb_vrep.h"
#include "wb_dbs.h"
#include "wb_db.h"
...
...
@@ -19,13 +20,13 @@
#if 1
int
main
(
int
argc
,
char
*
argv
[])
{
pwr_tStatus
sts
;
//dbs_sEnv env;
//dbs_sEnv *ep;
wb_erep
*
erep
=
new
wb_erep
();
pwr_tStatus
sts
;
//dbs_sEnv env;
//dbs_sEnv *ep;
wb_erep
*
erep
=
new
wb_erep
();
if
(
argc
<=
2
)
exit
(
0
);
// ep = dbs_Map(&sts, &env, argv[1]);
// ep = dbs_Map(&sts, &env, argv[1]);
wb_vrepdbs
*
vdbs
=
new
wb_vrepdbs
(
erep
,
argv
[
1
]);
vdbs
->
load
();
...
...
@@ -39,6 +40,12 @@ int main( int argc, char *argv[])
db
.
create
(
vdbs
->
vid
(),
vdbs
->
cid
(),
vdbs
->
name
(),
argv
[
2
]);
db
.
importVolume
(
*
vdbs
);
db
.
close
();
wb_vrepdb
vdb
(
erep
,
argv
[
2
]);
wb_dbs
adbs
(
vdbs
);
adbs
.
setFileName
(
"alasse.dbs"
);
adbs
.
importVolume
(
vdb
);
}
...
...
wb/lib/wb/src/wb_db.cpp
View file @
479dbac4
...
...
@@ -131,7 +131,7 @@ void wb_db_class::iter(void (*print)(pwr_tOid oid, pwr_tCid cid))
/* Initialize the key/data pair so the flags aren't set. */
memset
(
&
m_k
,
0
,
sizeof
(
m_k
));
printf
(
"sizeof(m_k): %d
\n
"
,
sizeof
(
m_k
));
//
printf("sizeof(m_k): %d\n", sizeof(m_k));
m_key
.
set_data
(
&
m_k
);
m_key
.
set_ulen
(
sizeof
(
m_k
));
...
...
@@ -240,8 +240,8 @@ void wb_db_name::iter(void (*print)(pwr_tOid poid, pwr_tObjName name, pwr_tOid o
memset
(
&
m_k
,
0
,
sizeof
(
m_k
));
memset
(
&
m_d
,
0
,
sizeof
(
m_d
));
printf
(
"sizeof(m_k): %d
\n
"
,
sizeof
(
m_k
));
printf
(
"sizeof(m_d): %d
\n
"
,
sizeof
(
m_d
));
//
printf("sizeof(m_k): %d\n", sizeof(m_k));
//
printf("sizeof(m_d): %d\n", sizeof(m_d));
m_key
.
set_data
(
&
m_k
);
m_key
.
set_ulen
(
sizeof
(
m_k
));
...
...
@@ -394,9 +394,6 @@ void wb_db_ohead::iter(void (*print)(pwr_tOid oid, db_sObject *op))
memset
(
&
m_oid
,
0
,
sizeof
(
m_oid
));
memset
(
&
m_o
,
0
,
sizeof
(
m_o
));
printf
(
"sizeof(m_oid): %d
\n
"
,
sizeof
(
m_oid
));
printf
(
"sizeof(m_o): %d
\n
"
,
sizeof
(
m_o
));
m_key
.
set_data
(
&
m_oid
);
m_key
.
set_ulen
(
sizeof
(
m_oid
));
m_key
.
set_flags
(
DB_DBT_USERMEM
);
...
...
@@ -409,13 +406,34 @@ void wb_db_ohead::iter(void (*print)(pwr_tOid oid, db_sObject *op))
/* Walk through the database and print out the key/data pairs. */
//int rc = m_dbc->get(&m_key, &m_data, DB_FIRST);
while
((
rc
=
m_dbc
->
get
(
&
m_key
,
&
m_data
,
DB_NEXT
))
==
0
)
{
//printf("k: %d, d: %d\n", (int)m_key.get_size(), (int)m_data.get_size());
//volatile int a = m_key.get_size();
//a = m_data.get_size();
while
((
rc
=
m_dbc
->
get
(
&
m_key
,
&
m_data
,
DB_NEXT
))
==
0
)
{
print
(
m_oid
,
&
m_o
);
}
m_dbc
->
close
();
}
void
wb_db_ohead
::
iter
(
wb_import
&
i
)
{
int
rc
=
0
;
//Dbc *cp;
rc
=
m_db
->
m_t_ohead
->
cursor
(
m_db
->
m_txn
,
&
m_dbc
,
0
);
memset
(
&
m_oid
,
0
,
sizeof
(
m_oid
));
memset
(
&
m_o
,
0
,
sizeof
(
m_o
));
m_key
.
set_data
(
&
m_oid
);
m_key
.
set_ulen
(
sizeof
(
m_oid
));
m_key
.
set_flags
(
DB_DBT_USERMEM
);
m_data
.
set_data
(
&
m_o
);
m_data
.
set_ulen
(
sizeof
(
m_o
));
m_data
.
set_flags
(
DB_DBT_USERMEM
);
while
((
rc
=
m_dbc
->
get
(
&
m_key
,
&
m_data
,
DB_NEXT
))
==
0
)
{
i
.
importHead
(
m_o
.
oid
,
m_o
.
cid
,
m_o
.
poid
,
m_o
.
boid
,
m_o
.
aoid
,
m_o
.
foid
,
m_o
.
loid
,
m_o
.
name
,
m_o
.
normname
,
m_o
.
flags
,
m_o
.
time
,
m_o
.
body
[
0
].
time
,
m_o
.
body
[
1
].
time
,
m_o
.
body
[
0
].
size
,
m_o
.
body
[
1
].
size
);
}
m_dbc
->
close
();
...
...
@@ -511,6 +529,38 @@ void wb_db_rbody::iter(void (*print)(pwr_tOid oid))
m_dbc
->
close
();
}
void
wb_db_rbody
::
iter
(
wb_import
&
i
)
{
int
rc
=
0
;
m_db
->
m_t_rbody
->
cursor
(
m_db
->
m_txn
,
&
m_dbc
,
0
);
/* Initialize the key/data pair so the flags aren't set. */
memset
(
&
m_oid
,
0
,
sizeof
(
m_oid
));
m_key
.
set_data
(
&
m_oid
);
m_key
.
set_ulen
(
sizeof
(
m_oid
));
m_key
.
set_flags
(
DB_DBT_USERMEM
);
m_data
.
set_flags
(
DB_DBT_MALLOC
);
while
(
1
)
{
try
{
rc
=
m_dbc
->
get
(
&
m_key
,
&
m_data
,
DB_NEXT
);
}
catch
(
DbException
&
e
)
{
printf
(
"Exc: %s
\n
"
,
e
.
what
());
}
if
(
rc
==
DB_NOTFOUND
)
break
;
i
.
importRbody
(
m_oid
,
m_data
.
get_size
(),
m_data
.
get_data
());
free
(
m_data
.
get_data
());
}
m_dbc
->
close
();
}
wb_db_dbody
::
wb_db_dbody
(
wb_db
*
db
,
pwr_tOid
oid
,
size_t
size
,
void
*
p
)
:
m_db
(
db
),
m_oid
(
oid
),
m_size
(
size
),
m_p
(
p
),
m_key
(
&
m_oid
,
sizeof
(
m_oid
)),
m_data
(
p
,
size
)
{
...
...
@@ -600,6 +650,48 @@ void wb_db_dbody::iter(void (*print)(pwr_tOid oid))
m_dbc
->
close
();
}
void
wb_db_dbody
::
iter
(
wb_import
&
i
)
{
int
rc
=
0
;
//static char b[65000];
m_db
->
m_t_dbody
->
cursor
(
m_db
->
m_txn
,
&
m_dbc
,
0
);
/* Initialize the key/data pair so the flags aren't set. */
memset
(
&
m_oid
,
0
,
sizeof
(
m_oid
));
m_key
.
set_data
(
&
m_oid
);
m_key
.
set_ulen
(
sizeof
(
m_oid
));
m_key
.
set_flags
(
DB_DBT_USERMEM
);
//m_data.set_data(b);
//m_data.set_ulen(sizeof(b));
//m_data.set_dlen(sizeof(b));
//m_data.set_size(sizeof(b));
m_data
.
set_flags
(
DB_DBT_MALLOC
);
//m_data.set_flags(DB_DBT_USERMEM);
/* Walk through the database and print out the key/data pairs. */
//int rc = m_dbc->get(&m_key, &m_data, DB_FIRST);
while
(
1
)
{
try
{
rc
=
m_dbc
->
get
(
&
m_key
,
&
m_data
,
DB_NEXT
);
}
catch
(
DbException
&
e
)
{
printf
(
"Exc: %s
\n
"
,
e
.
what
());
}
if
(
rc
==
DB_NOTFOUND
)
break
;
i
.
importDbody
(
m_oid
,
m_data
.
get_size
(),
m_data
.
get_data
());
free
(
m_data
.
get_data
());
}
m_dbc
->
close
();
}
wb_db
::
wb_db
()
{
}
...
...
wb/lib/wb/src/wb_db.h
View file @
479dbac4
...
...
@@ -206,6 +206,7 @@ public:
void
clear
();
void
iter
(
void
(
*
print
)(
pwr_tOid
oid
,
db_sObject
*
op
));
void
iter
(
wb_import
&
i
);
};
class
wb_db_name
...
...
@@ -306,6 +307,7 @@ public:
int
del
(
wb_db_txn
*
txn
);
void
iter
(
void
(
*
print
)(
pwr_tOid
oid
));
void
iter
(
wb_import
&
i
);
};
class
wb_db_rbody
...
...
@@ -334,6 +336,7 @@ public:
int
del
(
wb_db_txn
*
txn
);
void
iter
(
void
(
*
print
)(
pwr_tOid
oid
));
void
iter
(
wb_import
&
i
);
};
class
wb_db_txn
:
public
DbTxn
...
...
wb/lib/wb/src/wb_pkg.h
View file @
479dbac4
...
...
@@ -2,7 +2,7 @@
#define wb_pkg_h
#include <iostream.h>
#include <vector>
#include <vector
.h
>
#include <string>
#include "pwr.h"
#include "pwr_class.h"
...
...
wb/lib/wb/src/wb_vrepdb.cpp
View file @
479dbac4
...
...
@@ -1048,27 +1048,39 @@ void wb_vrepdb::unadopt(wb_db_txn *txn, wb_db_ohead &o)
printf
(
"wb_vrepdb::unadopt, p.put rc %d
\n
"
,
rc
);
}
bool
wb_vrepdb
::
exportVolume
(
wb_import
&
e
)
bool
wb_vrepdb
::
exportVolume
(
wb_import
&
i
)
{
return
false
;
return
i
.
importVolume
(
*
this
)
;
}
bool
wb_vrepdb
::
exportHead
(
wb_import
&
e
)
bool
wb_vrepdb
::
exportHead
(
wb_import
&
i
)
{
return
false
;
wb_db_ohead
*
op
=
new
wb_db_ohead
(
m_db
);
op
->
iter
(
i
);
return
true
;
}
bool
wb_vrepdb
::
exportRbody
(
wb_import
&
e
)
bool
wb_vrepdb
::
exportRbody
(
wb_import
&
i
)
{
return
false
;
wb_db_rbody
*
rp
=
new
wb_db_rbody
(
m_db
);
rp
->
iter
(
i
);
return
true
;
}
bool
wb_vrepdb
::
exportDbody
(
wb_import
&
e
)
bool
wb_vrepdb
::
exportDbody
(
wb_import
&
i
)
{
return
false
;
wb_db_dbody
*
dp
=
new
wb_db_dbody
(
m_db
);
dp
->
iter
(
i
);
return
true
;
}
bool
wb_vrepdb
::
exportMeta
(
wb_import
&
e
)
bool
wb_vrepdb
::
exportMeta
(
wb_import
&
i
)
{
return
false
;
}
...
...
xtt/lib/ge/src/ge_dyn.cpp
View file @
479dbac4
...
...
@@ -2521,7 +2521,7 @@ int GeValue::scan( grow_tObject object)
}
}
grow_SetAnnotationBrief
(
object
,
1
,
buf
,
len
);
memcpy
(
&
old_value
,
p
,
min
(
size
,
(
int
)
sizeof
(
old_value
)));
memcpy
(
&
old_value
,
p
,
MIN
(
size
,
(
int
)
sizeof
(
old_value
)));
return
1
;
}
...
...
@@ -5772,8 +5772,8 @@ int GeIncrAnalog::action( grow_tObject object, glow_tEvent event)
value
+=
increment
;
if
(
!
(
min_value
==
0
&&
max_value
==
0
))
{
value
=
max
(
value
,
min_value
);
value
=
min
(
value
,
max_value
);
value
=
MAX
(
value
,
min_value
);
value
=
MIN
(
value
,
max_value
);
}
sts
=
gdh_SetObjectInfo
(
parsed_name
,
&
value
,
sizeof
(
value
));
if
(
EVEN
(
sts
))
printf
(
"IncrAnalog error: %s
\n
"
,
attribute
);
...
...
@@ -7418,7 +7418,7 @@ int GeFastCurve::scan( grow_tObject object)
free
(
tmp
);
}
}
grow_SetTrendData
(
object
,
data
,
min
(
fast_cnt
+
1
,
3
),
max_points
);
grow_SetTrendData
(
object
,
data
,
MIN
(
fast_cnt
+
1
,
3
),
max_points
);
for
(
i
=
0
;
i
<
fast_cnt
;
i
++
)
free
(
data
[
i
]);
first_scan
=
0
;
...
...
@@ -8577,7 +8577,7 @@ int GeOptionMenu::scan( grow_tObject object)
if
(
!
found
)
grow_SetAnnotation
(
object
,
1
,
""
,
0
);
memcpy
(
&
old_value
,
p
,
min
(
size
,
(
int
)
sizeof
(
old_value
)));
memcpy
(
&
old_value
,
p
,
MIN
(
size
,
(
int
)
sizeof
(
old_value
)));
return
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment