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
dfb46882
Commit
dfb46882
authored
Feb 02, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plc compile, problem with compile of component subwndows fixed
parent
730c04e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
41 deletions
+67
-41
wb/lib/wb/src/wb_gcg.cpp
wb/lib/wb/src/wb_gcg.cpp
+59
-36
wb/lib/wb/src/wb_gcg.h
wb/lib/wb/src/wb_gcg.h
+5
-2
wb/lib/wb/src/wb_utl.cpp
wb/lib/wb/src/wb_utl.cpp
+3
-3
No files found.
wb/lib/wb/src/wb_gcg.cpp
View file @
dfb46882
...
...
@@ -583,6 +583,10 @@ static int gcg_is_in_focode(
gcg_ctx
gcgctx
,
vldh_t_node
node
);
static
void
gcg_pending_compile_add
(
gcg_ctx
gcgctx
,
pwr_tOid
wind
);
static
int
gcg_pending_compile_exec
(
gcg_ctx
gcgctx
);
/*_Methods defined for this module_______________________________________*/
...
...
@@ -2255,7 +2259,8 @@ int gcg_wind_comp_all(
pwr_tObjid
window
,
unsigned
long
codetype
,
int
modified
,
int
debug
int
debug
,
int
skip_plc
)
{
pwr_tObjid
*
windlist
;
...
...
@@ -2481,7 +2486,7 @@ int gcg_wind_comp_all(
/* End of FIX */
if
(
wind_compiled
)
{
if
(
wind_compiled
&&
!
skip_plc
)
{
sts
=
gcg_plc_compile
(
plc
,
codetype
,
&
errorcount
,
&
warningcount
,
1
,
debug
);
if
(
sts
==
GSX__PLCPGM_ERRORS
)
{
...
...
@@ -2851,6 +2856,8 @@ static void gcg_ctx_delete(
free
((
char
*
)
gcgctx
->
iowrite
);
if
(
gcgctx
->
refcount
>
0
)
free
((
char
*
)
gcgctx
->
ref
);
if
(
gcgctx
->
arefcount
>
0
)
free
((
char
*
)
gcgctx
->
aref
);
free
((
char
*
)
gcgctx
);
}
...
...
@@ -6155,45 +6162,31 @@ int gcg_comp_m1( vldh_t_wind wind,
}
}
/* Delete the context for the window */
gcg_ctx_delete
(
gcgctx
);
/* Generate code for the plc module */
/* sts = gcg_comp_m[0]( wind->hw.plc, codetype, 0, 0, 0);
if ( EVEN(sts)) return sts;
*/
/* Generate code for the rtnode */
/* sts = gcg_comp_rtnode( wind->hw.ldhses, 0,
wind->hw.plc, codetype, &node_errorcount,
&node_warningcount);
if ( EVEN(sts)) return sts;
(*errorcount) += node_errorcount;
(*warningcount) += node_warningcount;
*/
if
(
*
errorcount
>
0
)
{
if
(
codetype
)
{
if
(
*
errorcount
>
0
)
{
if
(
codetype
)
{
/* Revert the session */
sts
=
ldh_RevertSession
(
wind
->
hw
.
ldhses
);
if
(
EVEN
(
sts
))
return
sts
;
/* Return to previous session access */
if
(
session_access
!=
ldh_eAccess_ReadWrite
)
{
if
(
session_access
!=
ldh_eAccess_ReadWrite
)
{
/* Set access read write to be able to compile */
sts
=
ldh_SetSession
(
ldhses
,
session_access
);
if
(
EVEN
(
sts
))
return
sts
;
}
}
gcg_pending_compile_exec
(
gcgctx
);
gcg_ctx_delete
(
gcgctx
);
return
GSX__PLCWIND_ERRORS
;
}
else
{
if
(
codetype
)
{
else
{
if
(
codetype
)
{
pwr_tTime
time
;
/* Store compile time for the window */
...
...
@@ -6206,12 +6199,15 @@ int gcg_comp_m1( vldh_t_wind wind,
if
(
EVEN
(
sts
))
return
sts
;
/* Return to previous session access */
if
(
session_access
!=
ldh_eAccess_ReadWrite
)
{
if
(
session_access
!=
ldh_eAccess_ReadWrite
)
{
sts
=
ldh_SetSession
(
ldhses
,
session_access
);
if
(
EVEN
(
sts
))
return
sts
;
}
}
gcg_pending_compile_exec
(
gcgctx
);
gcg_ctx_delete
(
gcgctx
);
return
GSX__SUCCESS
;
}
...
...
@@ -13555,7 +13551,7 @@ int gcg_comp_m53( gcg_ctx gcgctx, vldh_t_node node)
/* Compile the subwindow... */
ldhwb
=
ldh_SessionToWB
(
ldhses
);
sts
=
gcg_wind_comp_all
(
ldhwb
,
ldhses
,
window_objid
,
gcgctx
->
print
,
0
,
gcg_debug
);
gcgctx
->
print
,
0
,
gcg_debug
,
0
);
node
->
hn
.
subwindowobject
[
0
]
=
0
;
}
...
...
@@ -14277,7 +14273,6 @@ int gcg_comp_m58( gcg_ctx gcgctx, vldh_t_node node)
pwr_tObjid
window_objid
;
pwr_tObjid
plcpgm_objid
;
pwr_sAttrRef
attrref
[
2
];
ldh_tWBContext
ldhwb
;
pwr_sPlcWindow
*
windbuffer
;
pwr_sPlcNode
*
nodebuffer
;
unsigned
long
point
;
...
...
@@ -14471,10 +14466,12 @@ int gcg_comp_m58( gcg_ctx gcgctx, vldh_t_node node)
// sts = ldh_SaveSession( ldhses);
// if ( EVEN(sts)) return sts;
gcg_pending_compile_add
(
gcgctx
,
window_objid
);
/* Compile the subwindow... */
ldhwb
=
ldh_SessionToWB
(
ldhses
);
sts
=
gcg_wind_comp_all
(
ldhwb
,
ldhses
,
window_objid
,
gcgctx
->
print
,
0
,
gcg_debug
);
//
ldhwb = ldh_SessionToWB( ldhses);
//
sts = gcg_wind_comp_all( ldhwb, ldhses, window_objid,
//
gcgctx->print, 0, gcg_debug);
node
->
hn
.
subwindowobject
[
0
]
=
0
;
}
else
{
...
...
@@ -14499,9 +14496,11 @@ int gcg_comp_m58( gcg_ctx gcgctx, vldh_t_node node)
sts
=
stat
(
fname
,
&
info
);
if
(
sts
!=
-
1
&&
info
.
st_ctime
>
compile_time
->
tv_sec
)
{
/* Compile the subwindow... */
ldhwb
=
ldh_SessionToWB
(
ldhses
);
sts
=
gcg_wind_comp_all
(
ldhwb
,
ldhses
,
window_objid
,
gcgctx
->
print
,
0
,
gcg_debug
);
gcg_pending_compile_add
(
gcgctx
,
window_objid
);
// ldhwb = ldh_SessionToWB( ldhses);
// sts = gcg_wind_comp_all( ldhwb, ldhses, window_objid,
// gcgctx->print, 0, gcg_debug);
}
free
(
(
char
*
)
compile_time
);
...
...
@@ -16142,3 +16141,27 @@ static int gcg_is_in_focode( gcg_ctx gcgctx, vldh_t_node node)
return
0
;
}
static
void
gcg_pending_compile_add
(
gcg_ctx
gcgctx
,
pwr_tOid
wind
)
{
for
(
unsigned
int
i
=
0
;
i
<
gcgctx
->
pending_compile
.
size
();
i
++
)
{
if
(
cdh_ObjidIsEqual
(
wind
,
gcgctx
->
pending_compile
[
i
]))
return
;
}
gcgctx
->
pending_compile
.
push_back
(
wind
);
}
static
int
gcg_pending_compile_exec
(
gcg_ctx
gcgctx
)
{
pwr_tStatus
sts
;
ldh_tSesContext
ldhses
=
gcgctx
->
ldhses
;
ldh_tWBContext
ldhwb
=
ldh_SessionToWB
(
ldhses
);
for
(
unsigned
int
i
=
0
;
i
<
gcgctx
->
pending_compile
.
size
();
i
++
)
{
sts
=
gcg_wind_comp_all
(
ldhwb
,
ldhses
,
gcgctx
->
pending_compile
[
i
],
gcgctx
->
print
,
0
,
gcg_debug
,
1
);
if
(
EVEN
(
sts
))
return
sts
;
}
return
GSX__SUCCESS
;
}
wb/lib/wb/src/wb_gcg.h
View file @
dfb46882
...
...
@@ -29,6 +29,7 @@
#endif
#include <stdio.h>
#include <vector>
#include "wb_vldh.h"
...
...
@@ -144,7 +145,7 @@ typedef struct {
gcg_t_areflist
*
aref
;
unsigned
long
arefcount
;
unsigned
long
compobjcount
;
pwr_sAttrRef
reset_object
;
pwr_sAttrRef
reset_object
;
unsigned
long
reset_checked
;
unsigned
long
errorcount
;
unsigned
long
warningcount
;
...
...
@@ -155,6 +156,7 @@ typedef struct {
ldh_tSesContext
ldhses
;
vldh_t_node
current_cmanager
;
int
cmanager_active
;
vector
<
pwr_tOid
>
pending_compile
;
}
gcg_t_ctx
,
*
gcg_ctx
;
...
...
@@ -299,7 +301,8 @@ int gcg_wind_comp_all(
pwr_tObjid
window
,
unsigned
long
codetype
,
int
modified
,
int
debug
int
debug
,
int
skip_plc
);
int
gcg_comp_volume
(
...
...
wb/lib/wb/src/wb_utl.cpp
View file @
dfb46882
...
...
@@ -6777,7 +6777,7 @@ int utl_compile (
if
(
EVEN
(
sts
))
return
sts
;
/* Compile the windows */
sts
=
gcg_wind_comp_all
(
ldhwb
,
l_ldhses
,
window
,
1
,
modified
,
debug
);
sts
=
gcg_wind_comp_all
(
ldhwb
,
l_ldhses
,
window
,
1
,
modified
,
debug
,
0
);
if
(
other_volume_attached
)
{
ldh_CloseSession
(
l_ldhses
);
...
...
@@ -6831,7 +6831,7 @@ int utl_compile (
}
/* Compile the windows */
sts
=
gcg_wind_comp_all
(
ldhwb
,
ldhses
,
window
,
1
,
modified
,
debug
);
sts
=
gcg_wind_comp_all
(
ldhwb
,
ldhses
,
window
,
1
,
modified
,
debug
,
0
);
if
(
EVEN
(
sts
))
{
status
=
sts
;
...
...
@@ -6868,7 +6868,7 @@ int utl_compile (
free
((
char
*
)
windbuffer
);
/* Compile the windows */
sts
=
gcg_wind_comp_all
(
ldhwb
,
ldhses
,
window
,
1
,
modified
,
debug
);
sts
=
gcg_wind_comp_all
(
ldhwb
,
ldhses
,
window
,
1
,
modified
,
debug
,
0
);
if
(
EVEN
(
sts
))
{
status
=
sts
;
...
...
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