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
4ea03d27
Commit
4ea03d27
authored
Aug 28, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Object attributes wasn't displayed in nav
parent
db87a91b
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
423 additions
and
51 deletions
+423
-51
wb/lib/wb/src/wb_nav.cpp
wb/lib/wb/src/wb_nav.cpp
+353
-14
wb/lib/wb/src/wb_nav.h
wb/lib/wb/src/wb_nav.h
+2
-1
wb/lib/wb/src/wb_wnav_item.cpp
wb/lib/wb/src/wb_wnav_item.cpp
+42
-21
wb/lib/wb/src/wb_wnav_selformat.cpp
wb/lib/wb/src/wb_wnav_selformat.cpp
+26
-15
No files found.
wb/lib/wb/src/wb_nav.cpp
View file @
4ea03d27
This diff is collapsed.
Click to expand it.
wb/lib/wb/src/wb_nav.h
View file @
4ea03d27
/*
/*
* Proview $Id: wb_nav.h,v 1.
6 2007-01-05 10:40:31
claes Exp $
* Proview $Id: wb_nav.h,v 1.
7 2007-08-28 07:30:36
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -67,6 +67,7 @@ class Nav {
...
@@ -67,6 +67,7 @@ class Nav {
flow_sAnnotPixmap
*
pixmap_attr
;
flow_sAnnotPixmap
*
pixmap_attr
;
flow_sAnnotPixmap
*
pixmap_attrarray
;
flow_sAnnotPixmap
*
pixmap_attrarray
;
flow_sAnnotPixmap
*
pixmap_attrarrayelem
;
flow_sAnnotPixmap
*
pixmap_attrarrayelem
;
flow_sAnnotPixmap
*
pixmap_attrobject
;
int
(
*
get_plant_select_cb
)(
void
*
,
char
*
);
int
(
*
get_plant_select_cb
)(
void
*
,
char
*
);
int
(
*
set_focus_cb
)(
void
*
,
void
*
);
int
(
*
set_focus_cb
)(
void
*
,
void
*
);
int
(
*
traverse_focus_cb
)(
void
*
,
void
*
);
int
(
*
traverse_focus_cb
)(
void
*
,
void
*
);
...
...
wb/lib/wb/src/wb_wnav_item.cpp
View file @
4ea03d27
/*
/*
* Proview $Id: wb_wnav_item.cpp,v 1.2
3 2007-08-27 09:32:45
claes Exp $
* Proview $Id: wb_wnav_item.cpp,v 1.2
4 2007-08-28 07:30:36
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -419,7 +419,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -419,7 +419,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
if
(
bodydef
[
j
].
ParClass
==
pwr_eClass_Output
)
if
(
bodydef
[
j
].
ParClass
==
pwr_eClass_Output
)
{
{
new
WItemAttrArrayOutput
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttrArrayOutput
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
flow_eDest_IntoLast
,
parname
,
parname
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Elements
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Elements
,
...
@@ -431,7 +431,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -431,7 +431,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
output_cnt
++
;
output_cnt
++
;
}
}
else
else
new
WItemAttrArray
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttrArray
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
flow_eDest_IntoLast
,
parname
,
parname
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Elements
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Elements
,
...
@@ -448,7 +448,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -448,7 +448,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
{
{
if
(
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_NOREMOVE
&&
if
(
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_NOREMOVE
&&
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_NOINVERT
)
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_NOINVERT
)
new
WItemAttr
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttr
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
parname
,
flow_eDest_IntoLast
,
parname
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
...
@@ -456,7 +456,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -456,7 +456,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
,
body
,
0
);
body
,
0
);
else
if
(
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_NOREMOVE
)
else
if
(
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_NOREMOVE
)
new
WItemAttrInputInv
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttrInputInv
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
parname
,
flow_eDest_IntoLast
,
parname
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
...
@@ -464,7 +464,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -464,7 +464,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
,
body
,
input_cnt
);
body
,
input_cnt
);
else
if
(
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_NOINVERT
)
else
if
(
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_NOINVERT
)
new
WItemAttrInputF
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttrInputF
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
parname
,
flow_eDest_IntoLast
,
parname
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
...
@@ -472,7 +472,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -472,7 +472,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
,
body
,
input_cnt
);
body
,
input_cnt
);
else
else
new
WItemAttrInput
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttrInput
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
parname
,
flow_eDest_IntoLast
,
parname
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
...
@@ -483,7 +483,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -483,7 +483,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
else
else
{
{
if
(
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_NOREMOVE
)
if
(
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
&
PWR_MASK_NOREMOVE
)
new
WItemAttr
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttr
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
parname
,
flow_eDest_IntoLast
,
parname
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
...
@@ -491,7 +491,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -491,7 +491,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Flags
,
body
,
0
);
body
,
0
);
else
else
new
WItemAttrInputF
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttrInputF
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
parname
,
flow_eDest_IntoLast
,
parname
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
bodydef
[
j
].
Par
->
Input
.
TypeRef
,
...
@@ -505,7 +505,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -505,7 +505,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
else
if
(
bodydef
[
j
].
ParClass
==
pwr_eClass_Output
)
else
if
(
bodydef
[
j
].
ParClass
==
pwr_eClass_Output
)
{
{
if
(
bodydef
[
j
].
Par
->
Output
.
Info
.
Flags
&
PWR_MASK_NOREMOVE
)
if
(
bodydef
[
j
].
Par
->
Output
.
Info
.
Flags
&
PWR_MASK_NOREMOVE
)
new
WItemAttr
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttr
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
parname
,
flow_eDest_IntoLast
,
parname
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Output
.
TypeRef
,
bodydef
[
j
].
Par
->
Output
.
TypeRef
,
...
@@ -513,7 +513,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -513,7 +513,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
bodydef
[
j
].
Par
->
Output
.
Info
.
Flags
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Flags
,
body
,
0
);
body
,
0
);
else
else
new
WItemAttrOutput
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttrOutput
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
parname
,
flow_eDest_IntoLast
,
parname
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Output
.
TypeRef
,
bodydef
[
j
].
Par
->
Output
.
TypeRef
,
...
@@ -526,14 +526,14 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -526,14 +526,14 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
else
else
{
{
if
(
bodydef
[
j
].
Par
->
Output
.
Info
.
Flags
&
PWR_MASK_CLASS
)
if
(
bodydef
[
j
].
Par
->
Output
.
Info
.
Flags
&
PWR_MASK_CLASS
)
new
WItemAttrObject
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttrObject
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
parname
,
flow_eDest_IntoLast
,
parname
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Size
,
false
,
0
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Size
,
false
,
0
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Flags
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Flags
,
body
,
0
);
body
,
0
);
else
else
new
WItemAttr
(
wnav
->
brow
,
ldhses
,
objid
,
node
,
new
WItemAttr
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
node
,
flow_eDest_IntoLast
,
parname
,
flow_eDest_IntoLast
,
parname
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Output
.
Info
.
Type
,
bodydef
[
j
].
Par
->
Output
.
TypeRef
,
bodydef
[
j
].
Par
->
Output
.
TypeRef
,
...
@@ -547,7 +547,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
...
@@ -547,7 +547,7 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
sts
=
ldh_GetDocBlock
(
ldhses
,
objid
,
&
block
,
&
size
);
sts
=
ldh_GetDocBlock
(
ldhses
,
objid
,
&
block
,
&
size
);
if
(
ODD
(
sts
))
{
if
(
ODD
(
sts
))
{
new
WItemDocBlock
(
wnav
->
brow
,
ldhses
,
objid
,
block
,
size
,
new
WItemDocBlock
(
wnav
->
brow
,
wnav
->
ldhses
,
objid
,
block
,
size
,
node
,
flow_eDest_IntoLast
);
node
,
flow_eDest_IntoLast
);
attr_exist
=
1
;
attr_exist
=
1
;
}
}
...
@@ -2206,10 +2206,21 @@ WItemAttrObject::WItemAttrObject(
...
@@ -2206,10 +2206,21 @@ WItemAttrObject::WItemAttrObject(
// Set class annotation
// Set class annotation
if
(
((
WNav
*
)
brow
->
userdata
)
->
gbl
.
show_class
)
{
if
(
((
WNav
*
)
brow
->
userdata
)
->
gbl
.
show_class
)
{
sts
=
ldh_ObjidToName
(
ldhses
,
cdh_ClassIdToObjid
(
type_id
),
ldh_eName_Object
,
ldh_tSession
lses
;
// Objects in mounted volumes has to use its own metavolumes.
if
(
ldh_ExternObject
(
ldhses
,
objid
))
ldh_OpenMntSession
(
ldhses
,
objid
,
&
lses
);
else
lses
=
ldhses
;
sts
=
ldh_ObjidToName
(
lses
,
cdh_ClassIdToObjid
(
type_id
),
ldh_eName_Object
,
annot
,
sizeof
(
annot
),
&
psize
);
annot
,
sizeof
(
annot
),
&
psize
);
if
(
ODD
(
sts
))
if
(
ODD
(
sts
))
brow_SetAnnotation
(
node
,
next_annot
++
,
annot
,
strlen
(
annot
));
brow_SetAnnotation
(
node
,
next_annot
++
,
annot
,
strlen
(
annot
));
if
(
lses
!=
ldhses
)
ldh_CloseSession
(
lses
);
}
}
// Set description annotation
// Set description annotation
...
@@ -2291,18 +2302,25 @@ int WItemAttrObject::open_attributes( double x, double y)
...
@@ -2291,18 +2302,25 @@ int WItemAttrObject::open_attributes( double x, double y)
int
input_cnt
=
0
;
int
input_cnt
=
0
;
int
output_cnt
=
0
;
int
output_cnt
=
0
;
int
is_casted
=
0
;
int
is_casted
=
0
;
ldh_tSession
lses
;
classid
=
type_id
;
classid
=
type_id
;
// Objects in mounted volumes has to use its own metavolumes.
if
(
ldh_ExternObject
(
ldhses
,
objid
))
ldh_OpenMntSession
(
ldhses
,
objid
,
&
lses
);
else
lses
=
ldhses
;
// Check if attrobject is casted
// Check if attrobject is casted
if
(
flags
&
PWR_MASK_CASTATTR
)
{
if
(
flags
&
PWR_MASK_CASTATTR
)
{
pwr_sAttrRef
ar
=
cdh_ObjidToAref
(
objid
);
pwr_sAttrRef
ar
=
cdh_ObjidToAref
(
objid
);
pwr_sAttrRef
aar
;
pwr_sAttrRef
aar
;
sts
=
ldh_ArefANameToAref
(
l
dh
ses
,
&
ar
,
name
,
&
aar
);
sts
=
ldh_ArefANameToAref
(
lses
,
&
ar
,
name
,
&
aar
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_GetAttrRefOrigTid
(
l
dh
ses
,
&
aar
,
&
orig_classid
);
sts
=
ldh_GetAttrRefOrigTid
(
lses
,
&
aar
,
&
orig_classid
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
if
(
orig_classid
!=
classid
)
{
if
(
orig_classid
!=
classid
)
{
...
@@ -2324,10 +2342,10 @@ int WItemAttrObject::open_attributes( double x, double y)
...
@@ -2324,10 +2342,10 @@ int WItemAttrObject::open_attributes( double x, double y)
strcpy
(
body
,
"SysBody"
);
strcpy
(
body
,
"SysBody"
);
if
(
((
WNav
*
)
brow
->
userdata
)
->
gbl
.
show_truedb
)
if
(
((
WNav
*
)
brow
->
userdata
)
->
gbl
.
show_truedb
)
sts
=
ldh_GetTrueObjectBodyDef
(
l
dh
ses
,
classid
,
body
,
1
,
sts
=
ldh_GetTrueObjectBodyDef
(
lses
,
classid
,
body
,
1
,
&
bodydef
,
&
rows
);
&
bodydef
,
&
rows
);
else
else
sts
=
ldh_GetObjectBodyDef
(
l
dh
ses
,
classid
,
body
,
1
,
sts
=
ldh_GetObjectBodyDef
(
lses
,
classid
,
body
,
1
,
&
bodydef
,
&
rows
);
&
bodydef
,
&
rows
);
if
(
EVEN
(
sts
))
if
(
EVEN
(
sts
))
continue
;
continue
;
...
@@ -2360,10 +2378,10 @@ int WItemAttrObject::open_attributes( double x, double y)
...
@@ -2360,10 +2378,10 @@ int WItemAttrObject::open_attributes( double x, double y)
pwr_sAttrRef
aar
;
pwr_sAttrRef
aar
;
pwr_sAttrRef
ar
=
cdh_ObjidToAref
(
objid
);
pwr_sAttrRef
ar
=
cdh_ObjidToAref
(
objid
);
sts
=
ldh_ArefANameToAref
(
l
dh
ses
,
&
ar
,
parname
,
&
aar
);
sts
=
ldh_ArefANameToAref
(
lses
,
&
ar
,
parname
,
&
aar
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ldh_AttributeDisabled
(
l
dh
ses
,
&
aar
,
&
disabled
);
sts
=
ldh_AttributeDisabled
(
lses
,
&
aar
,
&
disabled
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
if
(
disabled
)
if
(
disabled
)
...
@@ -2497,6 +2515,9 @@ int WItemAttrObject::open_attributes( double x, double y)
...
@@ -2497,6 +2515,9 @@ int WItemAttrObject::open_attributes( double x, double y)
}
}
if
(
lses
!=
ldhses
)
ldh_CloseSession
(
lses
);
if
(
attr_exist
&&
!
is_root
)
{
if
(
attr_exist
&&
!
is_root
)
{
brow_SetOpen
(
node
,
wnav_mOpen_Attributes
);
brow_SetOpen
(
node
,
wnav_mOpen_Attributes
);
brow_SetAnnotPixmap
(
node
,
1
,
brow
->
pixmap_openattr
);
brow_SetAnnotPixmap
(
node
,
1
,
brow
->
pixmap_openattr
);
...
...
wb/lib/wb/src/wb_wnav_selformat.cpp
View file @
4ea03d27
/*
/*
* Proview $Id: wb_wnav_selformat.cpp,v 1.
6 2007-04-25 13:39:21
claes Exp $
* Proview $Id: wb_wnav_selformat.cpp,v 1.
7 2007-08-28 07:30:36
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -90,32 +90,40 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
...
@@ -90,32 +90,40 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
char
*
name_ptr
;
char
*
name_ptr
;
pwr_tObjid
object
=
attrref
.
Objid
;
pwr_tObjid
object
=
attrref
.
Objid
;
char
*
name_p
;
char
*
name_p
;
ldh_tSession
lses
;
// Objects in mounted volumes has to use its own metavolumes.
if
(
ldh_ExternObject
(
ldhses
,
attrref
.
Objid
))
ldh_OpenMntSession
(
ldhses
,
attrref
.
Objid
,
&
lses
);
else
lses
=
ldhses
;
if
(
select_syntax
==
wnav_eSelectionMode_Extern
&&
!
select_attr
)
{
if
(
select_syntax
==
wnav_eSelectionMode_Extern
&&
!
select_attr
)
{
sts
=
ldh_ObjidToName
(
ldhses
,
object
,
ldh_eName_Objid
,
sts
=
ldh_ObjidToName
(
ldhses
,
object
,
ldh_eName_Objid
,
name
,
sizeof
(
name
),
&
ret_len
);
name
,
sizeof
(
name
),
&
ret_len
);
if
(
EVEN
(
sts
))
return
FALSE
;
if
(
EVEN
(
sts
))
return
FALSE
;
strcpy
(
buff
,
name
);
strcpy
(
buff
,
name
);
return
TRUE
;
return
TRUE
;
}
}
else
if
(
select_syntax
==
wnav_eSelectionMode_Extern
&&
select_attr
)
{
else
if
(
select_syntax
==
wnav_eSelectionMode_Extern
&&
select_attr
)
{
sts
=
ldh_ObjidToName
(
l
dh
ses
,
object
,
ldh_eName_Default
,
sts
=
ldh_ObjidToName
(
lses
,
object
,
ldh_eName_Default
,
name
,
sizeof
(
name
),
&
ret_len
);
name
,
sizeof
(
name
),
&
ret_len
);
if
(
EVEN
(
sts
))
return
FALSE
;
if
(
EVEN
(
sts
))
return
FALSE
;
}
}
else
if
(
select_volume
)
{
else
if
(
select_volume
)
{
sts
=
ldh_AttrRefToName
(
l
dh
ses
,
&
attrref
,
sts
=
ldh_AttrRefToName
(
lses
,
&
attrref
,
cdh_mName_volume
|
cdh_mName_object
|
cdh_mName_attribute
,
cdh_mName_volume
|
cdh_mName_object
|
cdh_mName_attribute
,
&
name_p
,
&
ret_len
);
&
name_p
,
&
ret_len
);
if
(
EVEN
(
sts
))
return
FALSE
;
if
(
EVEN
(
sts
))
return
FALSE
;
strcpy
(
name
,
name_p
);
strcpy
(
name
,
name_p
);
}
}
else
{
else
{
sts
=
ldh_AttrRefToName
(
l
dh
ses
,
&
attrref
,
sts
=
ldh_AttrRefToName
(
lses
,
&
attrref
,
cdh_mName_path
|
cdh_mName_object
|
cdh_mName_attribute
,
cdh_mName_path
|
cdh_mName_object
|
cdh_mName_attribute
,
&
name_p
,
&
ret_len
);
&
name_p
,
&
ret_len
);
if
(
EVEN
(
sts
))
return
FALSE
;
if
(
EVEN
(
sts
))
return
FALSE
;
strcpy
(
name
,
name_p
);
strcpy
(
name
,
name_p
);
}
}
...
@@ -152,13 +160,13 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
...
@@ -152,13 +160,13 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
aref
=
attrref
;
aref
=
attrref
;
if
(
select_attr
&&
!
is_class
)
{
if
(
select_attr
&&
!
is_class
)
{
sts
=
ldh_GetAttrRefTid
(
l
dh
ses
,
&
attrref
,
&
classid
);
sts
=
ldh_GetAttrRefTid
(
lses
,
&
attrref
,
&
classid
);
if
(
EVEN
(
sts
))
return
FALSE
;
if
(
EVEN
(
sts
))
return
FALSE
;
if
(
!
is_attr
||
(
cdh_tidIsCid
(
classid
)
&&
!
attrref
.
Flags
.
b
.
Array
))
{
if
(
!
is_attr
||
(
cdh_tidIsCid
(
classid
)
&&
!
attrref
.
Flags
.
b
.
Array
))
{
// Get the debugparameter if there is one, else add ActualValue
// Get the debugparameter if there is one, else add ActualValue
sts
=
ldh_GetClassBody
(
l
dh
ses
,
classid
,
sts
=
ldh_GetClassBody
(
lses
,
classid
,
"GraphPlcNode"
,
&
body_class
,
(
char
**
)
&
graph_body
,
&
size
);
"GraphPlcNode"
,
&
body_class
,
(
char
**
)
&
graph_body
,
&
size
);
if
(
ODD
(
sts
))
if
(
ODD
(
sts
))
strcpy
(
attr_name
,
graph_body
->
debugpar
);
strcpy
(
attr_name
,
graph_body
->
debugpar
);
...
@@ -169,13 +177,13 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
...
@@ -169,13 +177,13 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
strcat
(
name
,
attr_name
);
strcat
(
name
,
attr_name
);
// Check if attribute exists
// Check if attribute exists
sts
=
ldh_NameToAttrRef
(
l
dh
ses
,
name
,
&
aref
);
sts
=
ldh_NameToAttrRef
(
lses
,
name
,
&
aref
);
if
(
ODD
(
sts
))
{
if
(
ODD
(
sts
))
{
sts
=
ldh_GetAttrRefTid
(
l
dh
ses
,
&
aref
,
&
classid
);
sts
=
ldh_GetAttrRefTid
(
lses
,
&
aref
,
&
classid
);
if
(
EVEN
(
sts
))
return
FALSE
;
if
(
EVEN
(
sts
))
return
FALSE
;
if
(
select_syntax
==
wnav_eSelectionMode_Extern
&&
select_attr
)
{
if
(
select_syntax
==
wnav_eSelectionMode_Extern
&&
select_attr
)
{
sts
=
ldh_AttrRefToName
(
l
dh
ses
,
&
aref
,
sts
=
ldh_AttrRefToName
(
lses
,
&
aref
,
ldh_eName_ArefExport
,
ldh_eName_ArefExport
,
&
name_ptr
,
&
ret_len
);
&
name_ptr
,
&
ret_len
);
if
(
EVEN
(
sts
))
return
FALSE
;
if
(
EVEN
(
sts
))
return
FALSE
;
...
@@ -192,7 +200,7 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
...
@@ -192,7 +200,7 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
ldh_sAttrRefInfo
info
;
ldh_sAttrRefInfo
info
;
int
idx
;
int
idx
;
ldh_GetAttrRefInfo
(
l
dh
ses
,
&
aref
,
&
info
);
ldh_GetAttrRefInfo
(
lses
,
&
aref
,
&
info
);
if
(
ODD
(
sts
)
&&
if
(
ODD
(
sts
)
&&
wnav_type_to_string
(
info
.
type
,
type_buff
,
NULL
))
{
wnav_type_to_string
(
info
.
type
,
type_buff
,
NULL
))
{
char
num
[
8
];
char
num
[
8
];
...
@@ -206,9 +214,9 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
...
@@ -206,9 +214,9 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
*
p2
=
0
;
*
p2
=
0
;
// Get attrref info for array
// Get attrref info for array
sts
=
ldh_NameToAttrRef
(
l
dh
ses
,
buff
,
&
aref
);
sts
=
ldh_NameToAttrRef
(
lses
,
buff
,
&
aref
);
if
(
ODD
(
sts
))
if
(
ODD
(
sts
))
sts
=
ldh_GetAttrRefInfo
(
l
dh
ses
,
&
aref
,
&
info
);
sts
=
ldh_GetAttrRefInfo
(
lses
,
&
aref
,
&
info
);
}
}
if
(
info
.
type
==
pwr_eType_String
)
{
if
(
info
.
type
==
pwr_eType_String
)
{
sprintf
(
num
,
"%d"
,
info
.
size
/
info
.
nElement
);
sprintf
(
num
,
"%d"
,
info
.
size
/
info
.
nElement
);
...
@@ -228,14 +236,17 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
...
@@ -228,14 +236,17 @@ pwr_tBoolean wnav_format_selection( ldh_tSesContext ldhses, pwr_sAttrRef attrref
}
}
}
}
if
(
select_syntax
==
wnav_eSelectionMode_Extern
&&
select_attr
)
{
if
(
select_syntax
==
wnav_eSelectionMode_Extern
&&
select_attr
)
{
sts
=
ldh_NameToAttrRef
(
l
dh
ses
,
buff
,
&
aref
);
sts
=
ldh_NameToAttrRef
(
lses
,
buff
,
&
aref
);
if
(
EVEN
(
sts
))
return
FALSE
;
if
(
EVEN
(
sts
))
return
FALSE
;
sts
=
ldh_AttrRefToName
(
l
dh
ses
,
&
aref
,
sts
=
ldh_AttrRefToName
(
lses
,
&
aref
,
ldh_eName_ArefExport
,
&
p1
,
&
size
);
ldh_eName_ArefExport
,
&
p1
,
&
size
);
if
(
EVEN
(
sts
))
return
FALSE
;
if
(
EVEN
(
sts
))
return
FALSE
;
strcpy
(
buff
,
p1
);
strcpy
(
buff
,
p1
);
}
}
if
(
lses
!=
ldhses
)
ldh_CloseSession
(
lses
);
return
TRUE
;
return
TRUE
;
}
}
...
...
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