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
76a0cab1
Commit
76a0cab1
authored
May 27, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Template values of attribute objects inserted into new template objects
parent
00ee9320
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
wb/lib/wb/src/wb_wblnode.cpp
wb/lib/wb/src/wb_wblnode.cpp
+51
-0
wb/lib/wb/src/wb_wblnode.h
wb/lib/wb/src/wb_wblnode.h
+7
-0
No files found.
wb/lib/wb/src/wb_wblnode.cpp
View file @
76a0cab1
...
@@ -704,6 +704,38 @@ void wb_wblnode::postBuild()
...
@@ -704,6 +704,38 @@ void wb_wblnode::postBuild()
((
pwr_sGraphPlcNode
*
)
o
->
rbody
)
->
default_mask
[
1
]
=
mask
;
((
pwr_sGraphPlcNode
*
)
o
->
rbody
)
->
default_mask
[
1
]
=
mask
;
}
}
}
}
else
if
(
isTemplate
()
&&
o
->
templ
.
created
)
{
// New template object, insert template values of attribute objects into body
size_t
size
;
void
*
body
;
ch
=
o
->
fth
->
o
->
fch
;
while
(
ch
)
{
if
(
ch
->
isObjBodyDef
()
&&
ch
->
o
->
b
.
bix
==
pwr_eBix_rt
)
{
wb_wblnode
*
attr
=
ch
->
o
->
fch
;
while
(
attr
)
{
if
(
attr
->
isAttribute
())
{
if
(
cdh_tidIsCid
(
attr
->
o
->
a
.
tid
))
{
// Copy template for this object to offset of the attribute
if
(
m_vrep
->
getTemplateBody
(
attr
->
o
->
a
.
tid
,
pwr_eBix_sys
,
&
size
,
&
body
))
{
if
(
size
!=
attr
->
o
->
a
.
size
||
attr
->
o
->
a
.
offset
+
size
>
o
->
rbody_size
)
m_vrep
->
error
(
"AttrObject size mismatch"
,
getFileName
(),
line_number
);
else
memcpy
(
(
char
*
)
o
->
rbody
+
attr
->
o
->
a
.
offset
,
body
,
size
);
free
(
body
);
}
}
}
attr
=
attr
->
o
->
fws
;
}
break
;
}
ch
=
ch
->
o
->
fws
;
}
}
}
}
void
wb_wblnode
::
buildObjBodyDef
(
ref_wblnode
classdef
)
void
wb_wblnode
::
buildObjBodyDef
(
ref_wblnode
classdef
)
...
@@ -809,6 +841,24 @@ void wb_wblnode::buildAttribute( ref_wblnode classdef, ref_wblnode objbodydef,
...
@@ -809,6 +841,24 @@ void wb_wblnode::buildAttribute( ref_wblnode classdef, ref_wblnode objbodydef,
}
}
((
pwr_sParam
*
)
o
->
rbody
)
->
Info
.
ParamIndex
=
*
bindex
;
((
pwr_sParam
*
)
o
->
rbody
)
->
Info
.
ParamIndex
=
*
bindex
;
(
*
bindex
)
++
;
(
*
bindex
)
++
;
// Do some syntax check of flags and typeref
if
(
((
pwr_sParam
*
)
o
->
rbody
)
->
Info
.
Flags
&
PWR_MASK_SUPERCLASS
&&
strcmp
(
name
(),
"Super"
)
!=
0
)
m_vrep
->
error
(
"Super class attribute not named Super"
,
getFileName
(),
line_number
);
if
(
strcmp
(
name
(),
"Super"
)
==
0
)
{
if
(
!
(((
pwr_sParam
*
)
o
->
rbody
)
->
Info
.
Flags
&
PWR_MASK_SUPERCLASS
))
m_vrep
->
error
(
"Super class flag not set"
,
getFileName
(),
line_number
);
if
(
!
(((
pwr_sParam
*
)
o
->
rbody
)
->
Info
.
Flags
&
PWR_MASK_CLASS
))
m_vrep
->
error
(
"Class flag not set"
,
getFileName
(),
line_number
);
if
(
!
cdh_tidIsCid
(
o
->
a
.
tid
))
m_vrep
->
error
(
"TypeRef is not a class"
,
getFileName
(),
line_number
);
}
if
(
((
pwr_sParam
*
)
o
->
rbody
)
->
Info
.
Flags
&
PWR_MASK_CLASS
&&
!
cdh_tidIsCid
(
o
->
a
.
tid
))
m_vrep
->
error
(
"TypeRef is not a class"
,
getFileName
(),
line_number
);
}
}
void
wb_wblnode
::
buildBuffer
(
ref_wblnode
classdef
,
ref_wblnode
objbodydef
,
void
wb_wblnode
::
buildBuffer
(
ref_wblnode
classdef
,
ref_wblnode
objbodydef
,
...
@@ -1556,6 +1606,7 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol)
...
@@ -1556,6 +1606,7 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol)
strcpy
(
o
->
c
.
templ
->
o
->
cname
,
name
());
strcpy
(
o
->
c
.
templ
->
o
->
cname
,
name
());
// o->c.templ->o->m_oid.oix = m_vrep->nextOix();
// o->c.templ->o->m_oid.oix = m_vrep->nextOix();
o
->
c
.
templ
->
o
->
m_cid
=
o
->
c
.
cid
;
o
->
c
.
templ
->
o
->
m_cid
=
o
->
c
.
cid
;
o
->
c
.
templ
->
o
->
templ
.
created
=
true
;
o
->
c
.
templ
->
node_type
=
wbl_eNodeType_Template
;
o
->
c
.
templ
->
node_type
=
wbl_eNodeType_Template
;
}
}
}
}
...
...
wb/lib/wb/src/wb_wblnode.h
View file @
76a0cab1
...
@@ -79,6 +79,12 @@ class wbl_attribute {
...
@@ -79,6 +79,12 @@ class wbl_attribute {
pwr_eType
type
;
pwr_eType
type
;
};
};
class
wbl_template
{
public:
wbl_template
()
:
created
(
0
)
{};
bool
created
;
};
class
wbl_object
{
class
wbl_object
{
public:
public:
wbl_object
()
:
rbody_size
(
0
),
dbody_size
(
0
),
rbody
(
0
),
dbody
(
0
),
wbl_object
()
:
rbody_size
(
0
),
dbody_size
(
0
),
rbody
(
0
),
dbody
(
0
),
...
@@ -114,6 +120,7 @@ class wbl_object {
...
@@ -114,6 +120,7 @@ class wbl_object {
wbl_type
ty
;
wbl_type
ty
;
wbl_body
b
;
wbl_body
b
;
wbl_attribute
a
;
wbl_attribute
a
;
wbl_template
templ
;
};
};
...
...
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