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
efa521d7
Commit
efa521d7
authored
Jun 08, 2012
by
Robert Karlsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Profinet configurator, added flexibility to changing device type when keeping same gsdml-file
parent
df7661d9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
8 deletions
+101
-8
profibus/changelog.txt
profibus/changelog.txt
+3
-0
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
+96
-8
profibus/lib/cow/src/cow_pn_gsdml_attrnav.h
profibus/lib/cow/src/cow_pn_gsdml_attrnav.h
+2
-0
No files found.
profibus/changelog.txt
View file @
efa521d7
...
...
@@ -46,3 +46,6 @@
120102 cs profinet Profinet, set correct status on profinet device when losing connection
120120 cs profinet Profinet, IO status wasn't set properly
120227 cs profinet Profinet configurator bugfix in submodule index
120608 rk profinet Profinet configurator bugfix in submodule index
120608 rk profinet Profinet configurator bugfix in module deletion
120608 rk profinet Profinet configurator, added flexibility when changeing device type keeping same gsdml-file
profibus/lib/cow/src/cow_pn_gsdml_attrnav.cpp
View file @
efa521d7
...
...
@@ -1039,6 +1039,85 @@ void GsdmlAttrNav::device_changed_ok( void *ctx, void *data)
}
void
GsdmlAttrNav
::
device_update_change
(
void
*
ctx
)
{
GsdmlAttrNav
*
attrnav
=
(
GsdmlAttrNav
*
)
ctx
;
// Get new item
attrnav
->
device_item
=
attrnav
->
gsdml
->
ApplicationProcess
->
DeviceAccessPointList
->
DeviceAccessPointItem
[
attrnav
->
device_num
-
1
];
gsdml_UseableModules
*
um
=
attrnav
->
device_item
->
UseableModules
;
// Save the enum numbers for the slots
for
(
unsigned
int
ii
=
0
;
ii
<
attrnav
->
dev_data
.
slot_data
.
size
();
ii
++
)
{
if
(
ii
==
0
)
{
attrnav
->
dev_data
.
slot_data
[
ii
]
->
slot_reset
();
attrnav
->
dev_data
.
slot_data
[
ii
]
->
module_ident_number
=
attrnav
->
device_item
->
Body
.
ModuleIdentNumber
;
continue
;
}
if
(
attrnav
->
dev_data
.
slot_data
[
ii
]
->
module_enum_number
==
0
)
{
break
;
}
for
(
unsigned
int
jj
=
0
;
jj
<
um
->
ModuleItemRef
.
size
();
jj
++
)
{
gsdml_ModuleItem
*
mi
=
(
gsdml_ModuleItem
*
)
um
->
ModuleItemRef
[
jj
]
->
Body
.
ModuleItemTarget
.
p
;
if
(
attrnav
->
dev_data
.
slot_data
[
ii
]
->
module_ident_number
==
mi
->
Body
.
ModuleIdentNumber
)
{
attrnav
->
dev_data
.
slot_data
[
ii
]
->
module_enum_number
=
jj
+
1
;
break
;
}
}
}
}
pwr_tBoolean
GsdmlAttrNav
::
device_check_change_ok
(
void
*
ctx
)
{
GsdmlAttrNav
*
attrnav
=
(
GsdmlAttrNav
*
)
ctx
;
pwr_tBoolean
found
,
check_ok
;
gsdml_UseableModules
*
um
=
attrnav
->
gsdml
->
ApplicationProcess
->
DeviceAccessPointList
->
DeviceAccessPointItem
[
attrnav
->
device_num
-
1
]
->
UseableModules
;
check_ok
=
true
;
for
(
unsigned
int
ii
=
0
;
ii
<
attrnav
->
dev_data
.
slot_data
.
size
();
ii
++
)
{
if
(
ii
==
0
)
{
continue
;
}
if
(
attrnav
->
dev_data
.
slot_data
[
ii
]
->
module_enum_number
==
0
)
{
break
;
}
found
=
FALSE
;
for
(
unsigned
int
jj
=
0
;
jj
<
um
->
ModuleItemRef
.
size
();
jj
++
)
{
if
(
um
->
ModuleItemRef
[
jj
]
->
Body
.
AllowedInSlots
.
list
&&
um
->
ModuleItemRef
[
jj
]
->
Body
.
AllowedInSlots
.
list
->
in_list
(
ii
))
{
gsdml_ModuleItem
*
mi
=
(
gsdml_ModuleItem
*
)
um
->
ModuleItemRef
[
jj
]
->
Body
.
ModuleItemTarget
.
p
;
if
(
attrnav
->
dev_data
.
slot_data
[
ii
]
->
module_ident_number
==
mi
->
Body
.
ModuleIdentNumber
)
{
found
=
TRUE
;
break
;
}
}
}
if
(
!
found
)
{
check_ok
=
FALSE
;
break
;
}
}
return
check_ok
;
}
void
GsdmlAttrNav
::
device_changed_cancel
(
void
*
ctx
,
void
*
data
)
{
long
int
old_device
=
(
long
int
)
data
;
...
...
@@ -1504,8 +1583,10 @@ int GsdmlAttrNav::save( const char *filename)
ModuleItemRef
[
dev_data
.
slot_data
[
i
]
->
module_enum_number
-
1
]
->
Body
.
ModuleItemTarget
.
p
;
dev_data
.
slot_data
[
i
]
->
module_ident_number
=
mi
->
Body
.
ModuleIdentNumber
;
}
else
else
{
dev_data
.
slot_data
[
i
]
->
module_ident_number
=
0
;
dev_data
.
slot_data
[
i
]
->
module_class
=
0
;
}
}
}
...
...
@@ -1662,6 +1743,7 @@ int GsdmlAttrNav::save( const char *filename)
}
ssd
->
api
=
vsd
->
Body
.
API
;
ssd
->
submodule_ident_number
=
vsd
->
Body
.
SubmoduleIdentNumber
;
if
(
!
vsd
->
IOData
)
continue
;
...
...
@@ -2126,6 +2208,11 @@ int ItemPnDevice::scan( GsdmlAttrNav *attrnav, void *p)
GsdmlAttrNav
::
device_changed_ok
(
attrnav
,
(
void
*
)
old_value
);
return
1
;
}
else
{
if
(
GsdmlAttrNav
::
device_check_change_ok
(
attrnav
))
{
GsdmlAttrNav
::
device_update_change
(
attrnav
);
}
else
{
attrnav
->
wow
->
DisplayQuestion
(
attrnav
,
"Device Changed"
,
"All configuration data will be lost when changing the device.
\n
"
...
...
@@ -2136,6 +2223,7 @@ int ItemPnDevice::scan( GsdmlAttrNav *attrnav, void *p)
return
1
;
}
}
}
if
(
*
(
int
*
)
p
==
0
)
strcpy
(
buf
,
"No"
);
...
...
profibus/lib/cow/src/cow_pn_gsdml_attrnav.h
View file @
efa521d7
...
...
@@ -220,6 +220,8 @@ class GsdmlAttrNav {
static
int
brow_cb
(
FlowCtx
*
ctx
,
flow_tEvent
event
);
static
void
device_changed_ok
(
void
*
ctx
,
void
*
data
);
static
void
device_changed_cancel
(
void
*
ctx
,
void
*
data
);
static
pwr_tBoolean
device_check_change_ok
(
void
*
ctx
);
static
void
device_update_change
(
void
*
ctx
);
};
class
ItemPn
{
...
...
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