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
c0688e77
Commit
c0688e77
authored
Nov 22, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Profinet Device method, CopyDevice, added
parent
3fd39085
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
2 deletions
+112
-2
profibus/lib/wb/gtk/wb_c_pndevice_gtk.cpp
profibus/lib/wb/gtk/wb_c_pndevice_gtk.cpp
+82
-0
profibus/wbl/mcomp/src/profibus.wb_load
profibus/wbl/mcomp/src/profibus.wb_load
+30
-2
No files found.
profibus/lib/wb/gtk/wb_c_pndevice_gtk.cpp
View file @
c0688e77
...
...
@@ -140,6 +140,86 @@ static pwr_tStatus ConfigureFilter (
return
1
;
}
//
// Copy Device.
//
static
pwr_tStatus
CopyDevice
(
ldh_sMenuCall
*
ip
)
{
char
*
gsdml
;
int
size
;
int
sts
;
pwr_tOid
oid
;
pwr_tAttrRef
aref
[
2
];
pwr_tFileName
datafile_src
,
datafile_dest
;
pwr_tFileName
found_file
;
pwr_tCmd
cmd
;
// Check if data file exist
sprintf
(
datafile_src
,
"$pwrp_load/pwr_pn_%s.xml"
,
id_to_string
(
ip
->
Pointed
.
Objid
));
dcli_translate_filename
(
datafile_src
,
datafile_src
);
sts
=
dcli_search_file
(
datafile_src
,
found_file
,
DCLI_DIR_SEARCH_INIT
);
dcli_search_file
(
datafile_src
,
found_file
,
DCLI_DIR_SEARCH_END
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_GetObjectPar
(
ip
->
PointedSession
,
ip
->
Pointed
.
Objid
,
"RtBody"
,
"GSDMLfile"
,
&
gsdml
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
strcmp
(
gsdml
,
""
)
==
0
)
{
free
(
gsdml
);
return
0
;
}
free
(
gsdml
);
memset
(
aref
,
0
,
sizeof
(
aref
));
aref
[
0
]
=
ip
->
Pointed
;
sts
=
ldh_CopyObjectTrees
(
ip
->
PointedSession
,
aref
,
ip
->
Pointed
.
Objid
,
ldh_eDest_After
,
0
,
1
,
0
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_GetNextSibling
(
ip
->
PointedSession
,
ip
->
Pointed
.
Objid
,
&
oid
);
if
(
EVEN
(
sts
))
return
sts
;
sprintf
(
datafile_dest
,
"$pwrp_load/pwr_pn_%s.xml"
,
id_to_string
(
oid
));
dcli_translate_filename
(
datafile_dest
,
datafile_dest
);
snprintf
(
cmd
,
sizeof
(
cmd
),
"cp %s %s"
,
datafile_src
,
datafile_dest
);
system
(
cmd
);
return
1
;
}
static
pwr_tStatus
CopyDeviceFilter
(
ldh_sMenuCall
*
ip
)
{
char
*
gsdml
;
int
size
;
int
sts
;
pwr_tFileName
datafile
;
pwr_tFileName
found_file
;
// Check if data file exist
sprintf
(
datafile
,
"$pwrp_load/pwr_pn_%s.xml"
,
id_to_string
(
ip
->
Pointed
.
Objid
));
dcli_translate_filename
(
datafile
,
datafile
);
sts
=
dcli_search_file
(
datafile
,
found_file
,
DCLI_DIR_SEARCH_INIT
);
dcli_search_file
(
datafile
,
found_file
,
DCLI_DIR_SEARCH_END
);
if
(
EVEN
(
sts
))
return
0
;
sts
=
ldh_GetObjectPar
(
ip
->
PointedSession
,
ip
->
Pointed
.
Objid
,
"RtBody"
,
"GSDMLfile"
,
&
gsdml
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
strcmp
(
gsdml
,
""
)
==
0
)
{
free
(
gsdml
);
return
0
;
}
free
(
gsdml
);
return
1
;
}
//
// Syntax check.
//
...
...
@@ -213,6 +293,8 @@ static pwr_tStatus SetIoDeviceData (
pwr_dExport
pwr_BindMethods
(
PnDevice
)
=
{
pwr_BindMethod
(
Configure
),
pwr_BindMethod
(
ConfigureFilter
),
pwr_BindMethod
(
CopyDevice
),
pwr_BindMethod
(
CopyDeviceFilter
),
pwr_BindMethod
(
SyntaxCheck
),
pwr_BindMethod
(
GetIoDeviceData
),
pwr_BindMethod
(
SetIoDeviceData
),
...
...
profibus/wbl/mcomp/src/profibus.wb_load
View file @
c0688e77
Volume Profibus $ClassVolume 0.0.250.7
Body SysBody 05-SEP-2005 17:51:40.00
Attr NextOix = "_X2
09
"
Attr NextOix = "_X2
13
"
Attr NextCix = "_X20"
Attr NextTix[0] = "_X12"
EndBody
...
...
@@ -3204,7 +3204,7 @@ Volume Profibus $ClassVolume 0.0.250.7
Object WriteReq $Attribute 105 07-SEP-2011 10:24:03.67
Body SysBody 07-SEP-2011 10:24:13.69
Attr PgmName = "WriteReq"
Attr Flags = 1
6908288
Attr Flags = 1
31072
Attr TypeRef = "Profibus:Class-PnWriteReq"
EndBody
EndObject
...
...
@@ -3218,6 +3218,13 @@ Volume Profibus $ClassVolume 0.0.250.7
Attr FilterName = "PnDevice-ConfigureFilter"
EndBody
EndObject
Object CopyDevice $MenuButton 213 22-NOV-2011 10:13:58.01
Body SysBody 22-NOV-2011 10:13:58.01
Attr ButtonName = "CopyDevice"
Attr MethodName = "PnDevice-CopyDevice"
Attr FilterName = "PnDevice-CopyDeviceFilter"
EndBody
EndObject
EndObject
EndObject
Object ConfiguratorPoscn $Menu 125 21-APR-2009 13:41:08.17
...
...
@@ -3229,6 +3236,13 @@ Volume Profibus $ClassVolume 0.0.250.7
Attr FilterName = "PnDevice-ConfigureFilter"
EndBody
EndObject
Object CopyDevice $MenuButton 212 22-NOV-2011 10:13:53.30
Body SysBody 22-NOV-2011 10:13:53.30
Attr ButtonName = "CopyDevice"
Attr MethodName = "PnDevice-CopyDevice"
Attr FilterName = "PnDevice-CopyDeviceFilter"
EndBody
EndObject
EndObject
EndObject
Object ConfiguratorPosos $Menu 128 21-APR-2009 13:41:08.17
...
...
@@ -3240,6 +3254,13 @@ Volume Profibus $ClassVolume 0.0.250.7
Attr FilterName = "PnDevice-ConfigureFilter"
EndBody
EndObject
Object CopyDevice $MenuButton 211 22-NOV-2011 10:13:47.81
Body SysBody 22-NOV-2011 10:13:47.81
Attr ButtonName = "CopyDevice"
Attr MethodName = "PnDevice-CopyDevice"
Attr FilterName = "PnDevice-CopyDeviceFilter"
EndBody
EndObject
EndObject
EndObject
Object ConfiguratorPoson $Menu 131 21-APR-2009 13:41:08.17
...
...
@@ -3251,6 +3272,13 @@ Volume Profibus $ClassVolume 0.0.250.7
Attr FilterName = "PnDevice-ConfigureFilter"
EndBody
EndObject
Object CopyDevice $MenuButton 210 22-NOV-2011 10:13:27.97
Body SysBody 22-NOV-2011 10:12:33.44
Attr ButtonName = "CopyDevice"
Attr MethodName = "PnDevice-CopyDevice"
Attr FilterName = "PnDevice-CopyDeviceFilter"
EndBody
EndObject
Object ConnectThread $MenuButton 134 21-APR-2009 13:41:08.17
Body SysBody 21-APR-2009 13:41:08.17
Attr ButtonName = "Connect PlcThread"
...
...
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