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
f1c65f83
Commit
f1c65f83
authored
Sep 06, 2012
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build method for classdef to copy object graph (refs #55)
parent
b94d9e71
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
2 deletions
+87
-2
wb/lib/wb/src/wb_build.cpp
wb/lib/wb/src/wb_build.cpp
+86
-2
wb/lib/wb/src/wb_build.h
wb/lib/wb/src/wb_build.h
+1
-0
No files found.
wb/lib/wb/src/wb_build.cpp
View file @
f1c65f83
...
...
@@ -89,6 +89,9 @@ void wb_build::classlist( pwr_tCid cid)
case
pwr_cClass_PlcProcess
:
application
(
o
.
oid
());
break
;
case
pwr_eClass_ClassDef
:
classdef
(
o
.
oid
());
break
;
default:
m_sts
=
PWRB__NOBUILT
;
}
...
...
@@ -448,6 +451,19 @@ void wb_build::classvolume( pwr_tVid vid)
pwr_tObjName
name
;
pwr_tTime
wbl_time
,
dbs_time
,
h_time
;
pwr_tStatus
fsts
;
pwr_tStatus
sumsts
=
PWRB__NOBUILT
;
wb_log
::
push
();
if
(
!
opt
.
manual
)
{
// Build all ClassDef
classlist
(
pwr_eClass_ClassDef
);
if
(
evenSts
())
return
;
if
(
sumsts
==
PWRB__NOBUILT
&&
m_sts
!=
PWRB__NOBUILT
)
sumsts
=
m_sts
;
}
wb_log
::
pull
();
if
(
vid
==
0
)
{
// Build current volume
...
...
@@ -502,9 +518,10 @@ void wb_build::classvolume( pwr_tVid vid)
mtime
.
tv_sec
>
dbs_time
.
tv_sec
)
{
sprintf
(
cmd
,
"create snapshot/file=
\"
$pwrp_db/%s.wb_load
\"
"
,
name
);
m_sts
=
m_wnav
->
command
(
cmd
);
sumsts
=
m_sts
;
}
else
m_sts
=
PWRB__NOBUILT
;
m_sts
=
sumsts
;
// Get time for struct file
sprintf
(
fname
,
"$pwrp_inc/pwr_%sclasses.h"
,
name
);
...
...
@@ -515,9 +532,12 @@ void wb_build::classvolume( pwr_tVid vid)
if
(
opt
.
force
||
EVEN
(
fsts
)
||
wbl_time
.
tv_sec
>
h_time
.
tv_sec
)
{
sprintf
(
cmd
,
"create struct/file=
\"
$pwrp_db/%s.wb_load
\"
"
,
name
);
m_sts
=
m_wnav
->
command
(
cmd
);
sumsts
=
m_sts
;
}
else
m_sts
=
sumsts
;
if
(
m_
sts
!=
PWRB__NOBUILT
)
{
if
(
sum
sts
!=
PWRB__NOBUILT
)
{
char
msg
[
80
];
sprintf
(
msg
,
"Build: Volume %s"
,
name
);
...
...
@@ -1166,5 +1186,69 @@ void wb_build::webbrowserconfig( pwr_tOid oid)
}
}
void
wb_build
::
classdef
(
pwr_tOid
oid
)
{
pwr_tFileName
src_fname
,
dest_fname
;
pwr_tCmd
cmd
;
pwr_tString80
action
;
pwr_tString80
name
;
pwr_tTime
dest_time
,
src_time
;
int
check_hierarchy
=
cdh_ObjidIsNotNull
(
m_hierarchy
);
int
hierarchy_found
=
0
;
char
*
s
;
wb_object
o
=
m_session
.
object
(
oid
);
if
(
!
o
)
{
m_sts
=
o
.
sts
();
return
;
}
// Check that no ancestor is a LibHier
for
(
wb_object
p
=
o
.
parent
();
p
.
oddSts
();
p
=
p
.
parent
())
{
if
(
p
.
cid
()
==
pwr_eClass_LibHier
)
{
m_sts
=
PWRB__INLIBHIER
;
return
;
}
if
(
check_hierarchy
&&
cdh_ObjidIsEqual
(
m_hierarchy
,
p
.
oid
()))
hierarchy_found
=
1
;
}
if
(
check_hierarchy
&&
!
hierarchy_found
)
{
m_sts
=
PWRB__NOBUILT
;
return
;
}
strcpy
(
action
,
cdh_Low
(
o
.
name
()));
strcat
(
action
,
".pwg"
);
strcpy
(
src_fname
,
"$pwrp_pop/"
);
strcat
(
src_fname
,
action
);
dcli_translate_filename
(
src_fname
,
src_fname
);
m_sts
=
dcli_file_time
(
src_fname
,
&
src_time
);
if
(
evenSts
())
{
m_sts
=
PWRB__NOBUILT
;
return
;
}
strcpy
(
dest_fname
,
"$pwrp_exe/"
);
strcat
(
dest_fname
,
action
);
dcli_translate_filename
(
dest_fname
,
dest_fname
);
m_sts
=
dcli_file_time
(
dest_fname
,
&
dest_time
);
if
(
opt
.
force
||
evenSts
()
||
src_time
.
tv_sec
>
dest_time
.
tv_sec
)
{
sprintf
(
cmd
,
"cp %s %s"
,
src_fname
,
dest_fname
);
system
(
cmd
);
sprintf
(
cmd
,
"Build: ClassDef copy $pwrp_pop/%s -> $pwrp_exe"
,
action
);
MsgWindow
::
message
(
'I'
,
cmd
,
msgw_ePop_No
,
oid
);
strcpy
(
name
,
action
);
if
((
s
=
strrchr
(
name
,
'.'
)))
*
s
=
0
;
wb_log
::
log
(
wlog_eCategory_GeBuild
,
name
,
0
);
m_sts
=
PWRB__SUCCESS
;
}
else
m_sts
=
PWRB__NOBUILT
;
}
wb/lib/wb/src/wb_build.h
View file @
f1c65f83
...
...
@@ -64,6 +64,7 @@ class wb_build : public wb_status
void
webbrowserconfig
(
pwr_tOid
oid
);
void
webgraph
(
pwr_tOid
oid
);
void
application
(
pwr_tOid
oid
);
void
classdef
(
pwr_tOid
oid
);
wb_build_opt
opt
;
wb_session
m_session
;
...
...
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