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
6f989254
Commit
6f989254
authored
Dec 09, 2009
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Connect Attribute method added to SevHist
parent
44da3e53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
1 deletion
+78
-1
src/wbl/pwrb/src/pwrb_c_sevhist.wb_load
src/wbl/pwrb/src/pwrb_c_sevhist.wb_load
+13
-0
wb/lib/wb/src/wb_c_object.cpp
wb/lib/wb/src/wb_c_object.cpp
+64
-0
wb/lib/wb/src/wb_session.cpp
wb/lib/wb/src/wb_session.cpp
+1
-1
No files found.
src/wbl/pwrb/src/pwrb_c_sevhist.wb_load
View file @
6f989254
...
...
@@ -129,6 +129,19 @@ SObject pwrb:Class
Attr MethodName = "SevHist-PostMove"
EndBody
EndObject
Object ConfiguratorPosan $Menu
Object Pointed $Menu
Object ConnectAttribute $MenuButton
Body SysBody
Attr ButtonName = "Connect Attribute"
Attr MethodName = "$Object-ConnectAttribute"
Attr MethodArguments[0] = "Attribute"
Attr FilterName = "$Object-ConnectAttributeFilter"
Attr FilterArguments[0] = "Attribute"
EndBody
EndObject
EndObject
EndObject
Object ConfiguratorPoson $Menu
Object Pointed $Menu
Object ConnectThread $MenuButton
...
...
wb/lib/wb/src/wb_c_object.cpp
View file @
6f989254
...
...
@@ -29,6 +29,7 @@
#include "co_cdh.h"
#include "co_dcli.h"
#include "co_api.h"
#include "co_msg.h"
#include "cow_login.h"
#include "wb_wtt.h"
...
...
@@ -1111,6 +1112,67 @@ static pwr_tStatus PM_SyntaxCheckFilter( ldh_sMenuCall *ip)
return
1
;
}
/*----------------------------------------------------------------------------*\
To connect an object to an attribute
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
ConnectAttribute
(
ldh_sMenuCall
*
ip
)
{
pwr_tStatus
sts
;
pwr_sMenuButton
mb
;
pwr_sAttrRef
PattrRef
;
sts
=
ldh_ReadObjectBody
(
ip
->
PointedSession
,
ip
->
ItemList
[
ip
->
ChosenItem
].
MenuObject
,
"SysBody"
,
&
mb
,
sizeof
(
pwr_sMenuButton
));
if
(
EVEN
(
sts
))
return
sts
;
// Assume RtBody or SysBody
char
*
aname_p
;
pwr_tAName
aname
;
int
size
;
sts
=
ldh_AttrRefToName
(
ip
->
PointedSession
,
&
ip
->
Pointed
,
ldh_eName_ArefVol
,
&
aname_p
,
&
size
);
if
(
EVEN
(
sts
))
return
0
;
strncpy
(
aname
,
aname_p
,
sizeof
(
aname
));
strcat
(
aname
,
"."
);
strcat
(
aname
,
mb
.
MethodArguments
[
0
]);
sts
=
ldh_NameToAttrRef
(
ip
->
PointedSession
,
aname
,
&
PattrRef
);
if
(
ODD
(
sts
))
sts
=
ldh_WriteAttribute
(
ip
->
PointedSession
,
&
PattrRef
,
&
ip
->
Selected
[
0
],
sizeof
(
pwr_tAttrRef
));
if
(
ip
->
message_cb
)
{
char
msg
[
200
];
if
(
ODD
(
sts
))
{
pwr_tOName
name
;
sts
=
ldh_AttrRefToName
(
ip
->
PointedSession
,
&
ip
->
Selected
[
0
],
ldh_eName_Hierarchy
,
&
aname_p
,
&
size
);
if
(
ODD
(
sts
))
strncpy
(
name
,
aname_p
,
sizeof
(
name
));
else
cdh_ObjidToString
(
name
,
ip
->
Selected
[
0
].
Objid
,
1
);
sprintf
(
msg
,
"%s connected to: %s"
,
mb
.
MethodArguments
[
0
],
name
);
ip
->
wtt
->
message
(
'I'
,
msg
);
}
else
{
msg_GetMsg
(
sts
,
msg
,
sizeof
(
msg
));
ip
->
wtt
->
message
(
'E'
,
msg
);
}
}
return
LDH__SUCCESS
;
}
static
pwr_tStatus
ConnectAttributeFilter
(
ldh_sMenuCall
*
ip
)
{
return
1
;
}
pwr_dExport
pwr_BindMethods
(
$
Object
)
=
{
pwr_BindMethod
(
CreateObject
),
...
...
@@ -1144,6 +1206,8 @@ pwr_dExport pwr_BindMethods($Object) = {
pwr_BindMethod
(
CrossreferencesFilter
),
pwr_BindMethod
(
PM_SyntaxCheck
),
pwr_BindMethod
(
PM_SyntaxCheckFilter
),
pwr_BindMethod
(
ConnectAttribute
),
pwr_BindMethod
(
ConnectAttributeFilter
),
pwr_NullMethod
};
...
...
wb/lib/wb/src/wb_session.cpp
View file @
6f989254
...
...
@@ -592,7 +592,7 @@ pwr_tStatus wb_session::getMenu( ldh_sMenuCall *ip)
if
(
EVEN
(
sts
))
return
sts
;
wb_orep
*
o
=
m_vrep
->
erep
()
->
object
(
&
sts
,
Menu
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
break
;
o
->
ref
();
Object
=
o
->
oid
();
...
...
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