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
697a10ac
Commit
697a10ac
authored
Dec 13, 2017
by
Marcus Nordenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add editing support for bit values in PROFINET Configurator
parent
478e6708
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
10 deletions
+24
-10
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
+24
-10
No files found.
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
View file @
697a10ac
...
...
@@ -4142,7 +4142,7 @@ ItemPnParEnum::ItemPnParEnum( GsdmlAttrNav *attrnav, const char *item_name,
// Get the values and corresponding texts
gsdml_ValueItem
*
vi
=
(
gsdml_ValueItem
*
)
value_ref
->
Body
.
ValueItemTarget
.
p
;
gsdml_Valuelist
*
allowed_values
=
0
;
if
(
strcmp
(
value_ref
->
Body
.
AllowedValues
,
""
)
!=
0
)
allowed_values
=
new
gsdml_Valuelist
(
value_ref
->
Body
.
AllowedValues
);
...
...
@@ -4151,9 +4151,12 @@ ItemPnParEnum::ItemPnParEnum( GsdmlAttrNav *attrnav, const char *item_name,
for
(
unsigned
int
i
=
0
;
i
<
vi
->
Assignments
->
Assign
.
size
();
i
++
)
{
ParEnumValue
eval
;
int
num
;
num
=
sscanf
(
vi
->
Assignments
->
Assign
[
i
]
->
Body
.
Content
,
"%u"
,
&
eval
.
value
);
if
(
num
!=
1
)
continue
;
if
(
allowed_values
&&
!
allowed_values
->
in_list
(
eval
.
value
))
continue
;
...
...
@@ -4163,6 +4166,20 @@ ItemPnParEnum::ItemPnParEnum( GsdmlAttrNav *attrnav, const char *item_name,
values
.
push_back
(
eval
);
}
}
else
if
(
datatype
==
gsdml_eValueDataType_Bit
)
{
ParEnumValue
eval
;
eval
.
value
=
1
;
strncpy
(
eval
.
text
,
"On"
,
sizeof
(
eval
.
text
));
eval
.
value
<<=
bit_offset
;
values
.
push_back
(
eval
);
eval
.
value
=
0
;
strncpy
(
eval
.
text
,
"Off"
,
sizeof
(
eval
.
text
));
values
.
push_back
(
eval
);
}
if
(
allowed_values
)
delete
allowed_values
;
...
...
@@ -4218,15 +4235,12 @@ int ItemPnParEnum::open_children( GsdmlAttrNav *attrnav, double x, double y)
else
{
brow_SetNodraw
(
attrnav
->
brow
->
ctx
);
gsdml_ValueItem
*
vi
=
(
gsdml_ValueItem
*
)
value_ref
->
Body
.
ValueItemTarget
.
p
;
if
(
vi
&&
vi
->
Assignments
)
{
for
(
unsigned
int
i
=
0
;
i
<
values
.
size
();
i
++
)
{
new
ItemPnParEnumBit
(
attrnav
,
values
[
i
].
text
,
datatype
,
data
,
byte_offset
,
values
[
i
].
value
,
mask
,
noedit
,
node
,
flow_eDest_IntoLast
);
}
for
(
unsigned
int
i
=
0
;
i
<
values
.
size
();
i
++
)
{
new
ItemPnParEnumBit
(
attrnav
,
values
[
i
].
text
,
datatype
,
data
,
byte_offset
,
values
[
i
].
value
,
mask
,
noedit
,
node
,
flow_eDest_IntoLast
);
}
brow_SetOpen
(
node
,
attrnav_mOpen_Children
);
brow_SetAnnotPixmap
(
node
,
0
,
attrnav
->
brow
->
pixmap_openmap
);
brow_ResetNodraw
(
attrnav
->
brow
->
ctx
);
...
...
@@ -4973,4 +4987,4 @@ int ItemPnEnumSendClock::scan( GsdmlAttrNav *attrnav, void *p)
old_value
=
*
(
int
*
)
p
;
return
1
;
}
\ No newline at end of file
}
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