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
a9e67924
Commit
a9e67924
authored
Sep 15, 2006
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
co_pvd_file and co_pvd_udb moved to rt
parent
e4eda1c1
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
867 additions
and
17 deletions
+867
-17
src/exe/rt_pvd_udb/src/rt_pvd_udb.cpp
src/exe/rt_pvd_udb/src/rt_pvd_udb.cpp
+3
-3
src/lib/rt/src/rt_pvd_file.cpp
src/lib/rt/src/rt_pvd_file.cpp
+522
-0
src/lib/rt/src/rt_pvd_file.h
src/lib/rt/src/rt_pvd_file.h
+65
-0
src/lib/rt/src/rt_pvd_udb.cpp
src/lib/rt/src/rt_pvd_udb.cpp
+215
-0
src/lib/rt/src/rt_pvd_udb.h
src/lib/rt/src/rt_pvd_udb.h
+47
-0
wb/exp/wb/src/wb_provider.cpp
wb/exp/wb/src/wb_provider.cpp
+3
-2
wb/lib/wb/src/wb_pvd_gvl.h
wb/lib/wb/src/wb_pvd_gvl.h
+3
-3
wb/lib/wb/src/wb_pvd_pl.cpp
wb/lib/wb/src/wb_pvd_pl.cpp
+3
-3
wb/lib/wb/src/wb_pvd_pl.h
wb/lib/wb/src/wb_pvd_pl.h
+3
-3
wb/lib/wb/src/wb_vrepext.cpp
wb/lib/wb/src/wb_vrepext.cpp
+3
-3
No files found.
src/exe/rt_pvd_udb/src/rt_pvd_udb.cpp
View file @
a9e67924
/*
* Proview $Id: rt_pvd_udb.cpp,v 1.
1 2006-09-14 14:16:07
claes Exp $
* Proview $Id: rt_pvd_udb.cpp,v 1.
2 2006-09-15 09:33:20
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -22,12 +22,12 @@
#include "rt_procom.h"
#include "co_provider.h"
#include "rt_gdh_msg.h"
#include "
co
_pvd_udb.h"
#include "
rt
_pvd_udb.h"
#include "wb_ldh.h"
int
main
()
{
co
_pvd_udb
provider
(
pvd_eEnv_Rt
);
rt
_pvd_udb
provider
(
pvd_eEnv_Rt
);
rt_procom
procom
(
&
provider
,
errh_eAnix_appl20
,
// Application index
"rt_pvd_udb"
,
// Process name
...
...
src/lib/rt/src/rt_pvd_file.cpp
0 → 100644
View file @
a9e67924
This diff is collapsed.
Click to expand it.
src/lib/rt/src/rt_pvd_file.h
0 → 100644
View file @
a9e67924
/*
* Proview $Id: rt_pvd_file.h,v 1.1 2006-09-15 09:33:20 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef rt_pvd_file_h
#define rt_pvd_file_h
#include "co_provider.h"
#include "co_procom.h"
class
rt_pvd_file
:
public
co_provider
{
public:
rt_pvd_file
(
pvd_eEnv
env
=
pvd_eEnv_Wb
)
:
co_provider
(
env
),
root
(
0
),
next_oix
(
1
)
{}
virtual
void
object
(
co_procom
*
pcom
);
virtual
void
objectOid
(
co_procom
*
pcom
,
pwr_tOix
oix
);
virtual
void
objectName
(
co_procom
*
pcom
,
char
*
name
);
virtual
void
objectBody
(
co_procom
*
pcom
,
pwr_tOix
oix
);
virtual
void
createObject
(
co_procom
*
pcom
,
pwr_tOix
destoix
,
int
desttype
,
pwr_tCid
cid
,
char
*
name
);
virtual
void
moveObject
(
co_procom
*
pcom
,
pwr_tOix
oix
,
pwr_tOix
destoix
,
int
desttype
);
virtual
void
copyObject
(
co_procom
*
pcom
,
pwr_tOix
oix
,
pwr_tOix
destoix
,
int
desttype
,
char
*
name
);
virtual
void
deleteObject
(
co_procom
*
pcom
,
pwr_tOix
oix
);
virtual
void
deleteFamily
(
co_procom
*
pcom
,
pwr_tOix
oix
);
virtual
void
renameObject
(
co_procom
*
pcom
,
pwr_tOix
oix
,
char
*
name
);
virtual
void
writeAttribute
(
co_procom
*
pcom
,
pwr_tOix
oix
,
unsigned
int
offset
,
unsigned
int
size
,
char
*
buffer
);
virtual
void
readAttribute
(
co_procom
*
pcom
,
pwr_tOix
oix
,
unsigned
int
offset
,
unsigned
int
size
);
virtual
void
subAssociateBuffer
(
co_procom
*
pcom
,
void
**
buff
,
int
oix
,
int
offset
,
int
size
,
pwr_tSubid
sid
);
virtual
void
commit
(
co_procom
*
pcom
);
virtual
void
abort
(
co_procom
*
pcom
);
virtual
char
*
longname
(
pwr_tOix
oix
);
virtual
void
delete_tree
(
pwr_tOix
oix
);
virtual
void
save
(
pwr_tStatus
*
sts
)
{}
virtual
void
load
(
pwr_tStatus
*
rsts
)
{}
virtual
bool
find
(
pwr_tOix
fthoix
,
char
*
name
,
pwr_tOix
*
oix
);
vector
<
procom_obj
>
m_list
;
pwr_tOix
root
;
pwr_tOix
next_oix
;
};
#endif
src/lib/rt/src/rt_pvd_udb.cpp
0 → 100644
View file @
a9e67924
/*
* Proview $Id: rt_pvd_udb.cpp,v 1.1 2006-09-15 09:33:20 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#include <vector.h>
#include <string.h>
#include <stdio.h>
#include <iostream.h>
#include <fstream.h>
#include "pwr.h"
#include "pwr_class.h"
#include "pwr_baseclasses.h"
#include "wb_vext.h"
#include "rt_pvd_udb.h"
#include "wb_ldh.h"
#include "wb_ldh_msg.h"
extern
"C"
{
#include "co_cdh.h"
#include "co_dcli.h"
}
void
rt_pvd_udb
::
save
(
pwr_tStatus
*
sts
)
{
gu
->
clear
();
for
(
int
i
=
1
;
i
<
(
int
)
m_list
.
size
();
i
++
)
{
if
(
m_list
[
i
].
flags
&
procom_obj_mFlags_Deleted
)
continue
;
switch
(
m_list
[
i
].
cid
)
{
case
pwr_cClass_SystemGroupReg
:
{
pwr_sClass_SystemGroupReg
*
body
=
(
pwr_sClass_SystemGroupReg
*
)
m_list
[
i
].
body
;
*
sts
=
gu
->
add_system
(
groupname
(
longname
(
m_list
[
i
].
oix
)),
body
->
Attributes
);
if
(
EVEN
(
*
sts
))
return
;
break
;
}
case
pwr_cClass_UserReg
:
{
pwr_sClass_UserReg
*
body
=
(
pwr_sClass_UserReg
*
)
m_list
[
i
].
body
;
char
gname
[
120
];
char
*
s
;
strcpy
(
gname
,
longname
(
m_list
[
i
].
oix
));
if
(
(
s
=
strrchr
(
gname
,
'-'
)))
*
s
=
0
;
*
sts
=
gu
->
add_user
(
groupname
(
gname
),
m_list
[
i
].
name
,
body
->
Password
,
body
->
Privileges
);
if
(
EVEN
(
*
sts
))
return
;
break
;
}
default:
;
}
}
*
sts
=
gu
->
save
();
}
char
*
rt_pvd_udb
::
groupname
(
char
*
name
)
{
static
char
str
[
200
];
char
*
s
,
*
t
;
for
(
s
=
name
,
t
=
str
;
*
s
;
s
++
,
t
++
)
{
if
(
*
s
==
'-'
)
*
t
=
'.'
;
else
*
t
=
*
s
;
}
*
t
=
0
;
return
str
;
}
void
rt_pvd_udb
::
load
(
pwr_tStatus
*
rsts
)
{
char
filename
[
256
];
int
sts
;
if
(
gu
)
gu
->
clear
();
else
gu
=
new
GeUser
();
sts
=
dcli_get_defaultfilename
(
user_cFilename
,
filename
,
""
);
gu
->
load
(
filename
);
// Create Root object
procom_obj
rootitem
;
if
(
m_env
==
pvd_eEnv_Wb
)
{
strcpy
(
rootitem
.
name
,
"UserDatabase"
);
rootitem
.
cid
=
pwr_eClass_PlantHier
;
rootitem
.
oix
=
0
;
}
else
{
strcpy
(
rootitem
.
name
,
"VolUserDatabase"
);
rootitem
.
cid
=
pwr_eClass_ExternVolume
;
rootitem
.
oix
=
0
;
rootitem
.
body_size
=
sizeof
(
pwr_sExternVolume
);
rootitem
.
body
=
calloc
(
1
,
rootitem
.
body_size
);
}
m_list
.
push_back
(
rootitem
);
menu_stack
[
menu_cnt
]
=
rootitem
.
oix
;
menu_cnt
++
;
SystemList
*
systemgroup
=
gu
->
root_system
();
while
(
systemgroup
)
{
load_systemgroup
(
systemgroup
);
systemgroup
=
systemgroup
->
next_system
();
}
if
(
m_env
==
pvd_eEnv_Rt
)
{
// Convert to Rt style
for
(
int
i
=
1
;
i
<
(
int
)
m_list
.
size
();
i
++
)
{
if
(
m_list
[
i
].
bwsoix
==
0
)
m_list
[
i
].
bwsoix
=
m_list
[
m_list
[
i
].
fthoix
].
lchoix
;
if
(
m_list
[
i
].
fwsoix
==
0
)
m_list
[
i
].
fwsoix
=
m_list
[
m_list
[
i
].
fthoix
].
fchoix
;
}
}
}
void
rt_pvd_udb
::
load_systemgroup
(
SystemList
*
systemgroup
)
{
procom_obj
item
;
pwr_sClass_SystemGroupReg
*
body
;
char
sname
[
120
];
char
*
s
;
item
.
oix
=
next_oix
++
;
item
.
cid
=
pwr_cClass_SystemGroupReg
;
item
.
fthoix
=
menu_stack
[
menu_cnt
-
1
];
item
.
bwsoix
=
m_list
[
item
.
fthoix
].
lchoix
;
if
(
item
.
bwsoix
)
m_list
[
item
.
bwsoix
].
fwsoix
=
item
.
oix
;
if
(
m_list
[
item
.
fthoix
].
fchoix
==
0
)
m_list
[
item
.
fthoix
].
fchoix
=
item
.
oix
;
m_list
[
item
.
fthoix
].
lchoix
=
item
.
oix
;
item
.
body_size
=
sizeof
(
pwr_sClass_SystemGroupReg
);
body
=
(
pwr_sClass_SystemGroupReg
*
)
calloc
(
1
,
item
.
body_size
);
item
.
body
=
body
;
gu
->
get_system_name
(
systemgroup
,
sname
);
if
((
s
=
strrchr
(
sname
,
'.'
)))
strcpy
(
item
.
name
,
s
+
1
);
else
strcpy
(
item
.
name
,
sname
);
gu
->
get_system_data
(
sname
,
&
body
->
Attributes
);
menu_stack
[
menu_cnt
]
=
item
.
oix
;
menu_cnt
++
;
m_list
.
push_back
(
item
);
UserList
*
user
=
systemgroup
->
first_user
();
while
(
user
)
{
load_user
(
user
,
systemgroup
);
user
=
user
->
next_user
();
}
SystemList
*
sg
=
systemgroup
->
first_system
();
while
(
sg
)
{
load_systemgroup
(
sg
);
sg
=
sg
->
next_system
();
}
menu_cnt
--
;
}
void
rt_pvd_udb
::
load_user
(
UserList
*
user
,
SystemList
*
sg
)
{
procom_obj
item
;
pwr_sClass_UserReg
*
body
;
item
.
oix
=
next_oix
++
;
item
.
cid
=
pwr_cClass_UserReg
;
item
.
fthoix
=
menu_stack
[
menu_cnt
-
1
];
item
.
bwsoix
=
m_list
[
item
.
fthoix
].
lchoix
;
if
(
item
.
bwsoix
)
m_list
[
item
.
bwsoix
].
fwsoix
=
item
.
oix
;
if
(
m_list
[
item
.
fthoix
].
fchoix
==
0
)
m_list
[
item
.
fthoix
].
fchoix
=
item
.
oix
;
m_list
[
item
.
fthoix
].
lchoix
=
item
.
oix
;
item
.
body_size
=
sizeof
(
pwr_sClass_UserReg
);
body
=
(
pwr_sClass_UserReg
*
)
calloc
(
1
,
item
.
body_size
);
item
.
body
=
body
;
strcpy
(
item
.
name
,
user
->
get_name
());
user
->
get_data
(
body
->
Password
,
&
body
->
Privileges
);
m_list
.
push_back
(
item
);
}
src/lib/rt/src/rt_pvd_udb.h
0 → 100644
View file @
a9e67924
/*
* Proview $Id: rt_pvd_udb.h,v 1.1 2006-09-15 09:33:20 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
// Provider for user database
#ifndef rt_pvd_udb_h
#define rt_pvd_udb_h
#include "rt_pvd_file.h"
#include "co_user.h"
class
rt_pvd_udb
:
public
rt_pvd_file
{
public:
rt_pvd_udb
(
pvd_eEnv
env
=
pvd_eEnv_Wb
)
:
rt_pvd_file
(
env
),
gu
(
0
),
menu_cnt
(
0
)
{
pwr_tStatus
sts
;
load
(
&
sts
);
}
void
load
(
pwr_tStatus
*
rsts
);
void
load_systemgroup
(
SystemList
*
systemgroup
);
void
load_user
(
UserList
*
user
,
SystemList
*
sg
);
void
save
(
pwr_tStatus
*
sts
);
char
*
groupname
(
char
*
name
);
GeUser
*
gu
;
int
menu_stack
[
100
];
int
menu_cnt
;
};
#endif
wb/exp/wb/src/wb_provider.cpp
View file @
a9e67924
/*
* Proview $Id: wb_provider.cpp,v 1.
6 2006-01-31 09:11:25
claes Exp $
* Proview $Id: wb_provider.cpp,v 1.
7 2006-09-15 09:33:20
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -34,7 +34,8 @@ extern "C" {
}
#include "wb_vext.h"
#include "wb_provider.h"
#include "wb_procom.h"
#include "co_provider.h"
void
wb_procom
::
put
(
vext_sAMsg
*
msg
,
int
size
,
pwr_tStatus
*
sts
)
{
...
...
wb/lib/wb/src/wb_pvd_gvl.h
View file @
a9e67924
/*
* Proview $Id: wb_pvd_gvl.h,v 1.
2 2006-09-14 14:16
:20 claes Exp $
* Proview $Id: wb_pvd_gvl.h,v 1.
3 2006-09-15 09:33
:20 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -20,9 +20,9 @@
#ifndef wb_pvd_gvl_h
#define wb_pvd_gvl_h
#include "
co
_pvd_file.h"
#include "
rt
_pvd_file.h"
class
wb_pvd_gvl
:
public
co
_pvd_file
{
class
wb_pvd_gvl
:
public
rt
_pvd_file
{
public:
wb_pvd_gvl
()
{
...
...
wb/lib/wb/src/wb_pvd_pl.cpp
View file @
a9e67924
/*
* Proview $Id: wb_pvd_pl.cpp,v 1.
6 2006-09-14 14:16
:20 claes Exp $
* Proview $Id: wb_pvd_pl.cpp,v 1.
7 2006-09-15 09:33
:20 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -103,7 +103,7 @@ void wb_pvd_pl::writeAttribute( co_procom *pcom, pwr_tOix oix, unsigned int offs
default:
;
}
co
_pvd_file
::
writeAttribute
(
pcom
,
oix
,
offset
,
size
,
buffer
);
rt
_pvd_file
::
writeAttribute
(
pcom
,
oix
,
offset
,
size
,
buffer
);
}
void
wb_pvd_pl
::
createObject
(
co_procom
*
pcom
,
pwr_tOix
destoix
,
int
desttype
,
...
...
@@ -111,7 +111,7 @@ void wb_pvd_pl::createObject( co_procom *pcom, pwr_tOix destoix, int desttype,
{
pwr_tOix
oix
=
next_oix
;
co
_pvd_file
::
createObject
(
pcom
,
destoix
,
desttype
,
cid
,
name
);
rt
_pvd_file
::
createObject
(
pcom
,
destoix
,
desttype
,
cid
,
name
);
switch
(
cid
)
{
case
pwr_cClass_ProjectReg
:
{
...
...
wb/lib/wb/src/wb_pvd_pl.h
View file @
a9e67924
/*
* Proview $Id: wb_pvd_pl.h,v 1.
3 2006-09-14 14:16
:20 claes Exp $
* Proview $Id: wb_pvd_pl.h,v 1.
4 2006-09-15 09:33
:20 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -20,7 +20,7 @@
#ifndef wb_pvd_pl_h
#define wb_pvd_pl_h
#include "
co
_pvd_file.h"
#include "
rt
_pvd_file.h"
typedef
enum
{
pl_mFlags_ProjectModified
=
1
<<
16
,
...
...
@@ -28,7 +28,7 @@ typedef enum {
pl_mFlags_Disabled
=
1
<<
18
}
pl_mFlags
;
class
wb_pvd_pl
:
public
co
_pvd_file
{
class
wb_pvd_pl
:
public
rt
_pvd_file
{
public:
wb_pvd_pl
()
{
...
...
wb/lib/wb/src/wb_vrepext.cpp
View file @
a9e67924
/*
* Proview $Id: wb_vrepext.cpp,v 1.
7 2006-09-14 14:16
:20 claes Exp $
* Proview $Id: wb_vrepext.cpp,v 1.
8 2006-09-15 09:33
:20 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -45,7 +45,7 @@
#include "wb_volume.h"
#include "pwr_baseclasses.h"
#include "wb_pvd_gvl.h"
#include "
co
_pvd_udb.h"
#include "
rt
_pvd_udb.h"
#include "wb_pvd_pl.h"
extern
"C"
{
#include "co_dcli.h"
...
...
@@ -84,7 +84,7 @@ wb_vrepext::wb_vrepext( wb_erep *erep, pwr_tVid vid, char *name, char *provider)
}
else
if
(
cdh_NoCaseStrcmp
(
provider
,
"UserDatabase"
)
==
0
)
{
m_ptype
=
procom_eType_Local
;
m_provider
=
new
co
_pvd_udb
();
m_provider
=
new
rt
_pvd_udb
();
m_procom
=
new
wb_procom
(
provider
,
m_provider
,
procom_eType_Local
);
}
}
...
...
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