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
384a0080
Commit
384a0080
authored
Nov 21, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plc editor, check that references are not in LibHier added
parent
7ceb1a30
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
52 deletions
+75
-52
src/msg/wb/src/wb_foe_msg.msg
src/msg/wb/src/wb_foe_msg.msg
+1
-0
wb/lib/wb/src/wb_gcg.cpp
wb/lib/wb/src/wb_gcg.cpp
+74
-52
No files found.
src/msg/wb/src/wb_foe_msg.msg
View file @
384a0080
...
...
@@ -128,6 +128,7 @@ disabled <Object is disabled> /error
maxsize <MaxSize is larger than cell size> /error
noseqreset <No SequenceReset object found in main object> /error
compmethod <Invalid compile method> /error
libref <Invalid reference to library hierarchy> /error
.facility FOE,280 /prefix = FOE__ ! Function object editor
...
...
wb/lib/wb/src/wb_gcg.cpp
View file @
384a0080
...
...
@@ -552,61 +552,26 @@ static int gcg_sort_threadlist(
unsigned
long
size
);
static
int
gcg_check_ra_plc_user
(
char
*
filename
);
static
pwr_tStatus
gcg_read_volume_plclist
(
gcg_ctx
gcgctx
,
pwr_tVolumeId
volid
,
unsigned
long
*
plc_count
,
gcg_t_plclist
**
plclist
,
static
int
gcg_check_ra_plc_user
(
char
*
filename
);
static
pwr_tStatus
gcg_read_volume_plclist
(
gcg_ctx
gcgctx
,
pwr_tVolumeId
volid
,
unsigned
long
*
plc_count
,
gcg_t_plclist
**
plclist
,
unsigned
long
*
thread_count
,
gcg_t_threadlist
**
threadlist
);
static
int
gcg_parname_to_pgmname
(
ldh_tSesContext
ldhses
,
pwr_tClassId
cid
,
char
*
parname
,
char
*
pgmname
);
static
pwr_tStatus
gcg_replace_ref
(
gcg_ctx
gcgctx
,
pwr_sAttrRef
*
attrref
,
vldh_t_node
output_node
);
static
int
gcg_set_cmanager
(
vldh_t_wind
wind
);
static
int
gcg_cmanager_find_nodes
(
vldh_t_wind
wind
,
vldh_t_node
mgr
,
vldh_t_node
*
nodelist
,
int
node_count
);
static
int
gcg_cmanager_comp
(
gcg_ctx
gcgctx
,
vldh_t_node
node
);
static
int
gcg_reset_cmanager
(
gcg_ctx
gcgctx
);
static
int
gcg_check_attrref
(
gcg_ctx
gcgctx
,
vldh_t_node
node
,
const
char
*
attr
);
static
int
gcg_is_in_focode
(
gcg_ctx
gcgctx
,
vldh_t_node
node
);
gcg_t_threadlist
**
threadlist
);
static
int
gcg_parname_to_pgmname
(
ldh_tSesContext
ldhses
,
pwr_tClassId
cid
,
char
*
parname
,
char
*
pgmname
);
static
pwr_tStatus
gcg_replace_ref
(
gcg_ctx
gcgctx
,
pwr_sAttrRef
*
attrref
,
vldh_t_node
output_node
);
static
int
gcg_set_cmanager
(
vldh_t_wind
wind
);
static
int
gcg_cmanager_find_nodes
(
vldh_t_wind
wind
,
vldh_t_node
mgr
,
vldh_t_node
*
nodelist
,
int
node_count
);
static
int
gcg_cmanager_comp
(
gcg_ctx
gcgctx
,
vldh_t_node
node
);
static
int
gcg_reset_cmanager
(
gcg_ctx
gcgctx
);
static
int
gcg_check_attrref
(
gcg_ctx
gcgctx
,
vldh_t_node
node
,
const
char
*
attr
);
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
);
static
int
gcg_check_grafcet_reset
(
gcg_ctx
gcgctx
,
vldh_t_node
node
);
static
int
gcg_in_libhier
(
gcg_ctx
gcgctx
,
pwr_tOid
oid
);
...
...
@@ -3375,6 +3340,13 @@ int gcg_get_outputstring (
free
((
char
*
)
objdid
);
return
GSX__NEXTPAR
;
}
/* Check that the object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
*
objdid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
objdid
);
return
GSX__NEXTPAR
;
}
strcpy
(
parstring
,
(
output_bodydef
->
Par
)
->
Param
.
Info
.
PgmName
);
if
(
output_bodydef
->
Par
->
Output
.
Info
.
Flags
&
PWR_MASK_ARRAY
)
...
...
@@ -3408,6 +3380,13 @@ int gcg_get_outputstring (
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
/* Check that object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
attrref
->
Objid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
strcpy
(
parstring
,
(
output_bodydef
->
Par
)
->
Param
.
Info
.
PgmName
);
if
(
output_bodydef
->
Par
->
Output
.
Info
.
Flags
&
PWR_MASK_ARRAY
)
...
...
@@ -3531,6 +3510,13 @@ static int gcg_get_outputstring_spec(
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
/* Check that the object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
attrref
->
Objid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
/* Get the attribute name of last segment */
sts
=
ldh_AttrRefToName
(
ldhses
,
attrref
,
ldh_eName_ArefVol
,
&
name_p
,
&
size
);
...
...
@@ -3586,6 +3572,12 @@ static int gcg_get_outputstring_spec(
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
/* Check that the object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
attrref
->
Objid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
strcpy
(
parstring
,
(
output_bodydef
->
Par
)
->
Param
.
Info
.
PgmName
);
...
...
@@ -3631,6 +3623,12 @@ static int gcg_get_outputstring_spec(
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
/* Check that the object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
attrref
->
Objid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
/* Get the attribute name of last segment */
sts
=
ldh_AttrRefToName
(
ldhses
,
attrref
,
ldh_eName_ArefVol
,
...
...
@@ -3728,6 +3726,12 @@ static int gcg_get_outputstring_spec(
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
/* Check that the object is not in a library hierarchy */
if
(
gcg_in_libhier
(
gcgctx
,
attrref
->
Objid
))
{
gcg_error_msg
(
gcgctx
,
GSX__LIBREF
,
output_node
);
free
((
char
*
)
attrref
);
return
GSX__NEXTPAR
;
}
/* Check if DisableAttr is present */
sts
=
ldh_GetAttrRefInfo
(
ldhses
,
attrref
,
&
info
);
...
...
@@ -16256,3 +16260,21 @@ static int gcg_check_grafcet_reset( gcg_ctx gcgctx, vldh_t_node node)
}
return
GSX__SUCCESS
;
}
static
int
gcg_in_libhier
(
gcg_ctx
gcgctx
,
pwr_tOid
oid
)
{
pwr_tStatus
sts
;
pwr_tOid
parent
;
pwr_tCid
cid
;
for
(
sts
=
ldh_GetParent
(
gcgctx
->
ldhses
,
oid
,
&
parent
);
ODD
(
sts
);
sts
=
ldh_GetParent
(
gcgctx
->
ldhses
,
parent
,
&
parent
))
{
sts
=
ldh_GetObjectClass
(
gcgctx
->
ldhses
,
parent
,
&
cid
);
if
(
EVEN
(
sts
))
return
0
;
if
(
cid
==
pwr_cClass_LibHier
)
return
1
;
}
return
0
;
}
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