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
aa831840
Commit
aa831840
authored
Sep 18, 2013
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SevHist.Attribute set when object created under sensors and switches (refs #146)
parent
2882f1c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
wb/lib/wb/src/wb_c_sevhist.cpp
wb/lib/wb/src/wb_c_sevhist.cpp
+25
-1
No files found.
wb/lib/wb/src/wb_c_sevhist.cpp
View file @
aa831840
...
...
@@ -41,6 +41,7 @@
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
...
...
@@ -62,6 +63,8 @@ static pwr_tStatus PostCreate (
pwr_sAttrRef
Attribute
;
pwr_tOid
oid
;
pwr_tOid
toid
;
pwr_tCid
fcid
,
scid
,
cid
;
pwr_tOName
AName
;
int
cnt
=
0
;
...
...
@@ -69,12 +72,33 @@ static pwr_tStatus PostCreate (
If father of SevHist has an "ActualValue" attribute, then make this SevHist
refer to this attribute.
*/
sts
=
ldh_GetObjectClass
(
Session
,
Father
,
&
fcid
);
if
(
EVEN
(
sts
))
return
PWRB__SUCCESS
;
scid
=
cid
=
fcid
;
sts
=
ldh_GetSuperClass
(
Session
,
scid
,
&
scid
);
while
(
ODD
(
sts
)
&&
cid
!=
pwr_cClass_Component
&&
cid
!=
pwr_cClass_Aggregate
)
{
scid
=
cid
;
sts
=
ldh_GetSuperClass
(
Session
,
scid
,
&
cid
);
}
switch
(
scid
)
{
case
pwr_cClass_BaseSensor
:
strcpy
(
AName
,
".Value.ActualValue"
);
break
;
case
pwr_cClass_BaseSupSwitch
:
case
pwr_cClass_BaseSwitch
:
strcpy
(
AName
,
".Switch.ActualValue"
);
break
;
default:
strcpy
(
AName
,
".ActualValue"
);
}
sts
=
ldh_ObjidToName
(
Session
,
Father
,
ldh_eName_Hierarchy
,
Name
,
sizeof
(
Name
),
&
size
);
if
(
EVEN
(
sts
))
return
PWRB__SUCCESS
;
strcat
(
Name
,
".ActualValue"
);
strcat
(
Name
,
AName
);
sts
=
ldh_NameToAttrRef
(
Session
,
Name
,
&
Attribute
);
if
(
EVEN
(
sts
))
{
...
...
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