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
a792d6c2
Commit
a792d6c2
authored
Nov 03, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DataCopy, DataReset bugfix, didn't work for attribute object references
parent
83ea0748
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
110 additions
and
73 deletions
+110
-73
wb/lib/wb/src/wb_gcg.cpp
wb/lib/wb/src/wb_gcg.cpp
+110
-73
No files found.
wb/lib/wb/src/wb_gcg.cpp
View file @
a792d6c2
...
@@ -12279,10 +12279,10 @@ int gcg_comp_m45( gcg_ctx gcgctx, vldh_t_node node)
...
@@ -12279,10 +12279,10 @@ int gcg_comp_m45( gcg_ctx gcgctx, vldh_t_node node)
char
output_prefix
;
char
output_prefix
;
char
*
name
;
char
*
name
;
char
*
refstructname
;
char
*
refstructname
;
pwr_t
Objid
refobjdid
;
pwr_t
AttrRef
refaref
;
pwr_t
Objid
*
refobjdid
_ptr
;
pwr_t
AttrRef
*
refaref
_ptr
;
ldh_tSesContext
ldhses
;
ldh_tSesContext
ldhses
;
pwr_tClassId
cid
;
pwr_tClassId
cid
,
refcid
;
int
dataclass_found
;
int
dataclass_found
;
ldhses
=
(
node
->
hn
.
wind
)
->
hw
.
ldhses
;
ldhses
=
(
node
->
hn
.
wind
)
->
hw
.
ldhses
;
...
@@ -12332,13 +12332,17 @@ int gcg_comp_m45( gcg_ctx gcgctx, vldh_t_node node)
...
@@ -12332,13 +12332,17 @@ int gcg_comp_m45( gcg_ctx gcgctx, vldh_t_node node)
output_node
->
ln
.
oid
,
output_node
->
ln
.
oid
,
"DevBody"
,
"DevBody"
,
"DataObject"
,
"DataObject"
,
(
char
**
)
&
ref
objdid
_ptr
,
&
size
);
(
char
**
)
&
ref
aref
_ptr
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
ref
objdid
=
*
refobjdid
_ptr
;
ref
aref
=
*
refaref
_ptr
;
free
((
char
*
)
ref
objdid
_ptr
);
free
((
char
*
)
ref
aref
_ptr
);
sts
=
gcg_get_structname
(
gcgctx
,
refobjdid
,
&
refstructname
);
sts
=
ldh_GetAttrRefOrigTid
(
gcgctx
->
wind
->
hw
.
ldhses
,
&
refaref
,
&
refcid
);
if
(
EVEN
(
sts
))
return
sts
;
/* Get name for this class */
sts
=
gcg_get_structname_from_cid
(
gcgctx
,
refcid
,
&
refstructname
);
if
(
EVEN
(
sts
))
if
(
EVEN
(
sts
))
return
GSX__NEXTNODE
;
return
GSX__NEXTNODE
;
...
@@ -13181,12 +13185,16 @@ int gcg_comp_m52( gcg_ctx gcgctx, vldh_t_node node)
...
@@ -13181,12 +13185,16 @@ int gcg_comp_m52( gcg_ctx gcgctx, vldh_t_node node)
int
size
;
int
size
;
pwr_tObjid
refobjdid
;
pwr_tObjid
refobjdid
;
pwr_tObjid
*
refobjdid_ptr
;
pwr_tObjid
*
refobjdid_ptr
;
char
*
par
ameter
;
char
*
par
;
unsigned
long
info_type
;
unsigned
long
info_type
;
int
found
,
i
;
int
found
,
i
;
ldh_tSesContext
ldhses
;
ldh_tSesContext
ldhses
;
pwr_tClassId
cid
;
pwr_tClassId
cid
;
int
info_pointer_flag
;
int
info_pointer_flag
;
pwr_tString80
parameter
;
char
*
s
;
int
pfound
;
int
idx
;
ldhses
=
(
node
->
hn
.
wind
)
->
hw
.
ldhses
;
ldhses
=
(
node
->
hn
.
wind
)
->
hw
.
ldhses
;
...
@@ -13235,83 +13243,114 @@ int gcg_comp_m52( gcg_ctx gcgctx, vldh_t_node node)
...
@@ -13235,83 +13243,114 @@ int gcg_comp_m52( gcg_ctx gcgctx, vldh_t_node node)
node
->
ln
.
oid
,
node
->
ln
.
oid
,
"DevBody"
,
"DevBody"
,
bodydef
[
1
].
ParName
,
bodydef
[
1
].
ParName
,
(
char
**
)
&
par
ameter
,
&
size
);
(
char
**
)
&
par
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
strncpy
(
parameter
,
par
,
sizeof
(
parameter
));
free
((
char
*
)
par
);
free
((
char
*
)
bodydef
);
free
((
char
*
)
bodydef
);
/* Check that the parameter exists in the referenced object */
/* Check that the parameter exists in the referenced object */
sts
=
ldh_GetObjectBodyDef
(
ldhses
,
cid
,
"RtBody"
,
1
,
pfound
=
0
;
&
bodydef
,
&
rows
);
if
(
strncmp
(
parameter
,
"Data["
,
5
)
==
0
&&
sscanf
(
&
parameter
[
5
],
"%d"
,
&
idx
)
==
1
)
{
if
(
EVEN
(
sts
)
)
s
=
strrchr
(
parameter
,
']'
);
{
if
(
s
&&
strcmp
(
s
,
"].DataP"
)
==
0
)
{
gcg_error_msg
(
gcgctx
,
GSX__REFCLASS
,
node
);
pfound
=
1
;
return
GSX__NEXTNODE
;
info_pointer_flag
=
1
;
info_type
=
0
;
}
else
if
(
s
&&
strcmp
(
s
,
"].Data_Objid"
)
==
0
)
{
pfound
=
1
;
info_pointer_flag
=
0
;
info_type
=
pwr_eType_Objid
;
}
if
(
pfound
)
{
switch
(
cid
)
{
case
pwr_cClass_NMpsCell60
:
case
pwr_cClass_NMpsStoreCell60
:
if
(
idx
>=
60
)
{
gcg_error_msg
(
gcgctx
,
GSX__REFPARTYPE
,
node
);
return
GSX__NEXTNODE
;
}
break
;
case
pwr_cClass_NMpsCell120
:
case
pwr_cClass_NMpsStoreCell120
:
if
(
idx
>=
120
)
{
gcg_error_msg
(
gcgctx
,
GSX__REFPARTYPE
,
node
);
return
GSX__NEXTNODE
;
}
break
;
default:
gcg_error_msg
(
gcgctx
,
GSX__REFPARTYPE
,
node
);
return
GSX__NEXTNODE
;
}
}
}
}
for
(
i
=
0
,
found
=
0
;
i
<
rows
;
i
++
)
if
(
!
pfound
)
{
{
sts
=
ldh_GetObjectBodyDef
(
ldhses
,
cid
,
"RtBody"
,
1
,
/* ML 961009. Use ParName instead of PgmName */
&
bodydef
,
&
rows
);
if
(
strcmp
(
bodydef
[
i
].
ParName
,
parameter
)
==
0
)
if
(
EVEN
(
sts
)
)
{
{
gcg_error_msg
(
gcgctx
,
GSX__REFCLASS
,
node
);
found
=
1
;
return
GSX__NEXTNODE
;
break
;
}
for
(
i
=
0
,
found
=
0
;
i
<
rows
;
i
++
)
{
/* ML 961009. Use ParName instead of PgmName */
if
(
strcmp
(
bodydef
[
i
].
ParName
,
parameter
)
==
0
)
{
found
=
1
;
break
;
}
}
if
(
!
found
)
{
gcg_error_msg
(
gcgctx
,
GSX__REFPAR
,
node
);
free
((
char
*
)
bodydef
);
return
GSX__NEXTNODE
;
}
}
}
if
(
!
found
)
{
free
((
char
*
)
parameter
);
gcg_error_msg
(
gcgctx
,
GSX__REFPAR
,
node
);
free
((
char
*
)
bodydef
);
return
GSX__NEXTNODE
;
}
/* Check type of parameter */
/* Check type of parameter */
switch
(
bodydef
[
i
].
ParClass
)
{
switch
(
bodydef
[
i
].
ParClass
)
{
case
pwr_eClass_Input
:
case
pwr_eClass_Input
:
info_type
=
bodydef
[
i
].
Par
->
Input
.
Info
.
Type
;
info_type
=
bodydef
[
i
].
Par
->
Input
.
Info
.
Type
;
if
(
bodydef
[
i
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_RTVIRTUAL
)
if
(
bodydef
[
i
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_RTVIRTUAL
)
{
{
/* Parameter is not defined in runtime */
/* Parameter is not defined in runtime */
gcg_error_msg
(
gcgctx
,
GSX__REFPARTYPE
,
node
);
free
((
char
*
)
bodydef
);
return
GSX__NEXTNODE
;
}
break
;
case
pwr_eClass_Output
:
info_type
=
bodydef
[
i
].
Par
->
Output
.
Info
.
Type
;
info_pointer_flag
=
PWR_MASK_POINTER
&
bodydef
[
i
].
Par
->
Output
.
Info
.
Flags
;
break
;
case
pwr_eClass_Intern
:
info_type
=
bodydef
[
i
].
Par
->
Intern
.
Info
.
Type
;
info_pointer_flag
=
PWR_MASK_POINTER
&
bodydef
[
i
].
Par
->
Intern
.
Info
.
Flags
;
break
;
case
pwr_eClass_Param
:
info_type
=
bodydef
[
i
].
Par
->
Param
.
Info
.
Type
;
info_pointer_flag
=
PWR_MASK_POINTER
&
bodydef
[
i
].
Par
->
Param
.
Info
.
Flags
;
break
;
default:
/* Not allowed parameter type */
gcg_error_msg
(
gcgctx
,
GSX__REFPARTYPE
,
node
);
gcg_error_msg
(
gcgctx
,
GSX__REFPARTYPE
,
node
);
free
((
char
*
)
bodydef
);
free
((
char
*
)
bodydef
);
return
GSX__NEXTNODE
;
return
GSX__NEXTNODE
;
}
}
break
;
free
((
char
*
)
bodydef
);
case
pwr_eClass_Output
:
}
info_type
=
bodydef
[
i
].
Par
->
Output
.
Info
.
Type
;
info_pointer_flag
=
if
(
node
->
ln
.
cid
==
pwr_cClass_GetDap
)
{
PWR_MASK_POINTER
&
bodydef
[
i
].
Par
->
Output
.
Info
.
Flags
;
if
(
!
info_pointer_flag
)
{
break
;
case
pwr_eClass_Intern
:
info_type
=
bodydef
[
i
].
Par
->
Intern
.
Info
.
Type
;
info_pointer_flag
=
PWR_MASK_POINTER
&
bodydef
[
i
].
Par
->
Intern
.
Info
.
Flags
;
break
;
case
pwr_eClass_Param
:
info_type
=
bodydef
[
i
].
Par
->
Param
.
Info
.
Type
;
info_pointer_flag
=
PWR_MASK_POINTER
&
bodydef
[
i
].
Par
->
Param
.
Info
.
Flags
;
break
;
default:
/* Not allowed parameter type */
gcg_error_msg
(
gcgctx
,
GSX__REFPARTYPE
,
node
);
free
((
char
*
)
bodydef
);
return
GSX__NEXTNODE
;
}
free
((
char
*
)
bodydef
);
if
(
node
->
ln
.
cid
==
pwr_cClass_GetDap
)
{
if
(
!
info_pointer_flag
)
{
gcg_error_msg
(
gcgctx
,
GSX__REFPARTYPE
,
node
);
gcg_error_msg
(
gcgctx
,
GSX__REFPARTYPE
,
node
);
return
GSX__NEXTNODE
;
return
GSX__NEXTNODE
;
}
}
}
}
else
if
(
node
->
ln
.
cid
==
pwr_cClass_GetObjidp
)
else
if
(
node
->
ln
.
cid
==
pwr_cClass_GetObjidp
)
{
{
if
(
info_type
!=
pwr_eType_Objid
)
{
if
(
info_type
!=
pwr_eType_Objid
)
{
gcg_error_msg
(
gcgctx
,
GSX__REFPARTYPE
,
node
);
gcg_error_msg
(
gcgctx
,
GSX__REFPARTYPE
,
node
);
return
GSX__NEXTNODE
;
return
GSX__NEXTNODE
;
}
}
...
@@ -13327,8 +13366,6 @@ int gcg_comp_m52( gcg_ctx gcgctx, vldh_t_node node)
...
@@ -13327,8 +13366,6 @@ int gcg_comp_m52( gcg_ctx gcgctx, vldh_t_node node)
vldh_IdToStr
(
0
,
refobjdid
),
vldh_IdToStr
(
0
,
refobjdid
),
parameter
);
parameter
);
free
((
char
*
)
parameter
);
/* Insert object in ref list */
/* Insert object in ref list */
gcg_ref_insert
(
gcgctx
,
refobjdid
,
GCG_PREFIX_REF
);
gcg_ref_insert
(
gcgctx
,
refobjdid
,
GCG_PREFIX_REF
);
...
...
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