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
693f42fb
Commit
693f42fb
authored
Jan 20, 2012
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xtt 'show device' channels in io module wasn't displayed
parent
b38910cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
176 additions
and
140 deletions
+176
-140
xtt/lib/xtt/src/xtt_xnav.h
xtt/lib/xtt/src/xtt_xnav.h
+1
-0
xtt/lib/xtt/src/xtt_xnav_tables.cpp
xtt/lib/xtt/src/xtt_xnav_tables.cpp
+175
-140
No files found.
xtt/lib/xtt/src/xtt_xnav.h
View file @
693f42fb
...
@@ -545,6 +545,7 @@ class XNav {
...
@@ -545,6 +545,7 @@ class XNav {
int
show_subcli
();
int
show_subcli
();
int
show_device
();
int
show_device
();
int
show_channels
(
pwr_tObjid
card_objid
);
int
show_channels
(
pwr_tObjid
card_objid
);
int
show_attr_channels
(
pwr_tAttrRef
*
mod_aref
);
int
show_object
(
pwr_tAttrRef
*
oarp
,
brow_tNode
node
);
int
show_object
(
pwr_tAttrRef
*
oarp
,
brow_tNode
node
);
int
show_remnode
();
int
show_remnode
();
int
show_remtrans
(
pwr_tObjid
remnode_objid
);
int
show_remtrans
(
pwr_tObjid
remnode_objid
);
...
...
xtt/lib/xtt/src/xtt_xnav_tables.cpp
View file @
693f42fb
...
@@ -1076,174 +1076,209 @@ int XNav::show_channels( pwr_tObjid card_objid)
...
@@ -1076,174 +1076,209 @@ int XNav::show_channels( pwr_tObjid card_objid)
// Get all intern channels
// Get all intern channels
if
(
!
child_found
)
{
if
(
!
child_found
)
{
gdh_sAttrDef
*
bd
;
pwr_tAttrRef
card_aref
=
cdh_ObjidToAref
(
card_objid
);
int
rows
;
int
i
;
int
elem
;
pwr_tCid
cid
;
pwr_tAttrRef
aref
;
int
offset
;
sts
=
gdh_GetObjectClass
(
card_objid
,
&
cid
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
gdh_GetObjectBodyDef
(
cid
,
&
bd
,
&
rows
,
pwr_cNObjid
);
sts
=
show_attr_channels
(
&
card_aref
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
}
brow_ResetNodraw
(
brow
->
ctx
);
brow_Redraw
(
brow
->
ctx
,
0
);
force_trace_scan
();
return
XNAV__SUCCESS
;
}
for
(
i
=
0
;
i
<
rows
;
i
++
)
{
switch
(
bd
[
i
].
attr
->
Param
.
TypeRef
)
{
case
pwr_cClass_ChanAi
:
case
pwr_cClass_ChanAit
:
case
pwr_cClass_ChanAo
:
case
pwr_cClass_ChanDi
:
case
pwr_cClass_ChanDo
:
case
pwr_cClass_ChanIi
:
case
pwr_cClass_ChanIo
:
case
pwr_cClass_ChanCo
:
break
;
default:
continue
;
}
chan_classid
=
bd
[
i
].
attr
->
Param
.
TypeRef
;
int
XNav
::
show_attr_channels
(
pwr_tAttrRef
*
mod_aref
)
{
gdh_sAttrDef
*
bd
;
int
rows
;
int
i
;
int
elem
;
pwr_tCid
cid
;
pwr_tAName
mod_name
;
int
sts
;
item_sTable
t
;
item_sTableSubid
ts
;
pwr_tTypeId
attrtype
;
unsigned
int
attrsize
,
attroffs
,
attrelem
;
pwr_tSubid
subid
;
pwr_tOName
object_name
;
pwr_tAName
attr_name
;
pwr_sAttrRef
attrref
;
pwr_sAttrRef
signal_aref
;
char
descr
[
80
];
char
namebuf
[
80
];
void
*
attr_ptr
;
ItemChannel
*
item
;
pwr_tClassId
chan_classid
;
pwr_tAName
signal_name
;
if
(
bd
[
i
].
attr
->
Param
.
Info
.
Flags
&
PWR_MASK_ARRAY
)
sts
=
gdh_GetAttrRefTid
(
mod_aref
,
&
cid
);
elem
=
bd
[
i
].
attr
->
Param
.
Info
.
Elements
;
if
(
EVEN
(
sts
))
return
sts
;
else
elem
=
1
;
sts
=
gdh_AttrrefToName
(
mod_aref
,
mod_name
,
sizeof
(
mod_name
),
cdh_mName_volumeStrict
);
if
(
EVEN
(
sts
))
return
sts
;
for
(
int
j
=
0
;
j
<
elem
;
j
++
)
{
offset
=
bd
[
i
].
attr
->
Param
.
Info
.
Offset
;
sts
=
gdh_GetObjectBodyDef
(
cid
,
&
bd
,
&
rows
,
pwr_cNObjid
);
memset
(
&
aref
,
0
,
sizeof
(
aref
));
if
(
EVEN
(
sts
))
return
sts
;
aref
.
Objid
=
card_objid
;
aref
.
Size
=
bd
[
i
].
attr
->
Param
.
Info
.
Size
/
elem
;
for
(
i
=
0
;
i
<
rows
;
i
++
)
{
aref
.
Offset
=
bd
[
i
].
attr
->
Param
.
Info
.
Offset
+
j
*
aref
.
Size
;
aref
.
Flags
.
b
.
ObjectAttr
=
1
;
switch
(
bd
[
i
].
attr
->
Param
.
TypeRef
)
{
case
pwr_cClass_ChanAi
:
sts
=
gdh_AttrrefToName
(
&
aref
,
object_name
,
case
pwr_cClass_ChanAit
:
sizeof
(
object_name
),
cdh_mName_volumeStrict
);
case
pwr_cClass_ChanAo
:
case
pwr_cClass_ChanDi
:
case
pwr_cClass_ChanDo
:
case
pwr_cClass_ChanIi
:
case
pwr_cClass_ChanIo
:
case
pwr_cClass_ChanCo
:
break
;
default:
if
(
bd
[
i
].
attr
->
Param
.
Info
.
Flags
&
PWR_MASK_CLASS
)
{
// This could be an IO module object, look for channels
pwr_sAttrRef
aref
;
gdh_ArefANameToAref
(
mod_aref
,
bd
[
i
].
attrName
,
&
aref
);
sts
=
show_attr_channels
(
&
aref
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
}
continue
;
}
// Get connected signal
chan_classid
=
bd
[
i
].
attr
->
Param
.
TypeRef
;
strcpy
(
attr_name
,
object_name
);
strcat
(
attr_name
,
".SigChanCon"
);
if
(
bd
[
i
].
attr
->
Param
.
Info
.
Flags
&
PWR_MASK_ARRAY
)
sts
=
gdh_GetObjectInfo
(
attr_name
,
elem
=
bd
[
i
].
attr
->
Param
.
Info
.
Elements
;
(
void
*
)
&
signal_aref
,
sizeof
(
signal_aref
));
else
if
(
ODD
(
sts
))
{
elem
=
1
;
sts
=
gdh_AttrrefToName
(
&
signal_aref
,
signal_name
,
sizeof
(
signal_name
),
cdh_mNName
);
if
(
EVEN
(
sts
))
{
signal_aref
.
Objid
=
pwr_cNObjid
;
strcpy
(
signal_name
,
"-"
);
}
}
else
signal_aref
.
Objid
=
pwr_cNObjid
;
t
.
elem_cnt
=
0
;
for
(
int
j
=
0
;
j
<
elem
;
j
++
)
{
ts
.
subid_cnt
=
0
;
// Object name
if
(
elem
==
1
)
{
xnav_cut_segments
(
namebuf
,
object_name
,
2
);
strcpy
(
object_name
,
mod_name
);
strcat
(
object_name
,
"."
);
strcat
(
object_name
,
bd
[
i
].
attrName
);
}
else
{
sprintf
(
object_name
,
"%s.%s[%d]"
,
mod_name
,
bd
[
i
].
attrName
,
j
);
}
// Get connected signal
strcpy
(
attr_name
,
object_name
);
strcat
(
attr_name
,
".SigChanCon"
);
sts
=
gdh_GetObjectInfo
(
attr_name
,
(
void
*
)
&
signal_aref
,
sizeof
(
signal_aref
));
if
(
ODD
(
sts
))
{
sts
=
gdh_AttrrefToName
(
&
signal_aref
,
signal_name
,
sizeof
(
signal_name
),
cdh_mNName
);
if
(
EVEN
(
sts
))
{
signal_aref
.
Objid
=
pwr_cNObjid
;
strcpy
(
signal_name
,
"-"
);
}
}
else
signal_aref
.
Objid
=
pwr_cNObjid
;
t
.
elem_cnt
=
0
;
ts
.
subid_cnt
=
0
;
// Object name
xnav_cut_segments
(
namebuf
,
object_name
,
2
);
strcpy
(
t
.
elem
[
t
.
elem_cnt
].
fix_str
,
namebuf
);
strcpy
(
t
.
elem
[
t
.
elem_cnt
].
fix_str
,
namebuf
);
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_FixStr
;
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_FixStr
;
// Value
if
(
cdh_ObjidIsNotNull
(
signal_aref
.
Objid
))
{
strcpy
(
attr_name
,
signal_name
);
switch
(
chan_classid
)
{
case
pwr_cClass_ChanDi
:
case
pwr_cClass_ChanDo
:
case
pwr_cClass_ChanAi
:
case
pwr_cClass_ChanAo
:
case
pwr_cClass_ChanIi
:
case
pwr_cClass_ChanIo
:
strcat
(
attr_name
,
".ActualValue"
);
break
;
case
pwr_cClass_ChanCo
:
strcat
(
attr_name
,
".RawValue"
);
break
;
}
sts
=
gdh_GetAttributeCharacteristics
(
attr_name
,
&
attrtype
,
&
attrsize
,
&
attroffs
,
&
attrelem
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
gdh_NameToAttrref
(
pwr_cNObjid
,
attr_name
,
&
attrref
);
// Value
if
(
EVEN
(
sts
))
return
sts
;
if
(
cdh_ObjidIsNotNull
(
signal_aref
.
Objid
))
{
strcpy
(
attr_name
,
signal_name
);
switch
(
chan_classid
)
{
case
pwr_cClass_ChanDi
:
case
pwr_cClass_ChanDo
:
case
pwr_cClass_ChanAi
:
case
pwr_cClass_ChanAo
:
case
pwr_cClass_ChanIi
:
case
pwr_cClass_ChanIo
:
strcat
(
attr_name
,
".ActualValue"
);
break
;
case
pwr_cClass_ChanCo
:
strcat
(
attr_name
,
".RawValue"
);
break
;
}
sts
=
gdh_GetAttributeCharacteristics
(
attr_name
,
&
attrtype
,
&
attrsize
,
&
attroffs
,
&
attrelem
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
gdh_DLRefObjectInfoAttrref
(
&
attrref
,
&
attr_ptr
,
&
subid
);
sts
=
gdh_NameToAttrref
(
pwr_cNObjid
,
attr_name
,
&
attrref
);
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
t
.
elem
[
t
.
elem_cnt
].
value_p
=
attr_ptr
;
sts
=
gdh_DLRefObjectInfoAttrref
(
&
attrref
,
&
attr_ptr
,
&
subid
);
t
.
elem
[
t
.
elem_cnt
].
type_id
=
attrtype
;
if
(
EVEN
(
sts
))
return
sts
;
t
.
elem
[
t
.
elem_cnt
].
size
=
attrsize
;
switch
(
chan_classid
)
{
t
.
elem
[
t
.
elem_cnt
].
value_p
=
attr_ptr
;
case
pwr_cClass_ChanDi
:
t
.
elem
[
t
.
elem_cnt
].
type_id
=
attrtype
;
case
pwr_cClass_ChanDo
:
t
.
elem
[
t
.
elem_cnt
].
size
=
attrsize
;
case
pwr_cClass_ChanIi
:
case
pwr_cClass_ChanIo
:
switch
(
chan_classid
)
{
case
pwr_cClass_ChanCo
:
case
pwr_cClass_ChanDi
:
strcpy
(
t
.
elem
[
t
.
elem_cnt
++
].
format
,
"%8d"
);
case
pwr_cClass_ChanDo
:
break
;
case
pwr_cClass_ChanIi
:
case
pwr_cClass_ChanAi
:
case
pwr_cClass_ChanIo
:
case
pwr_cClass_ChanAo
:
case
pwr_cClass_ChanCo
:
strcpy
(
t
.
elem
[
t
.
elem_cnt
++
].
format
,
"%f"
);
strcpy
(
t
.
elem
[
t
.
elem_cnt
++
].
format
,
"%8d"
);
break
;
break
;
}
case
pwr_cClass_ChanAi
:
ts
.
subid
[
ts
.
subid_cnt
++
]
=
subid
;
case
pwr_cClass_ChanAo
:
strcpy
(
t
.
elem
[
t
.
elem_cnt
++
].
format
,
"%f"
);
break
;
}
}
else
ts
.
subid
[
ts
.
subid_cnt
++
]
=
subid
;
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_Empty
;
}
else
// Flags
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_Empty
;
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_Empty
;
// Signal
// Flags
if
(
cdh_ObjidIsNotNull
(
signal_aref
.
Objid
))
{
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_Empty
;
// Signal
if
(
cdh_ObjidIsNotNull
(
signal_aref
.
Objid
))
{
strcpy
(
t
.
elem
[
t
.
elem_cnt
].
fix_str
,
signal_name
);
strcpy
(
t
.
elem
[
t
.
elem_cnt
].
fix_str
,
signal_name
);
}
}
else
else
strcpy
(
t
.
elem
[
t
.
elem_cnt
].
fix_str
,
"-"
);
strcpy
(
t
.
elem
[
t
.
elem_cnt
].
fix_str
,
"-"
);
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_FixStr
;
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_FixStr
;
// Description in signal
// Description in signal
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_Empty
;
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_Empty
;
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_Empty
;
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_Empty
;
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_Empty
;
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_Empty
;
if
(
cdh_ObjidIsNotNull
(
signal_aref
.
Objid
))
if
(
cdh_ObjidIsNotNull
(
signal_aref
.
Objid
))
strcpy
(
attr_name
,
signal_name
);
strcpy
(
attr_name
,
signal_name
);
else
else
strcpy
(
attr_name
,
object_name
);
strcpy
(
attr_name
,
object_name
);
strcat
(
attr_name
,
".Description"
);
strcat
(
attr_name
,
".Description"
);
sts
=
gdh_GetObjectInfo
(
attr_name
,
sts
=
gdh_GetObjectInfo
(
attr_name
,
(
void
*
)
&
descr
,
sizeof
(
descr
));
(
void
*
)
&
descr
,
sizeof
(
descr
));
if
(
EVEN
(
sts
))
return
sts
;
if
(
EVEN
(
sts
))
return
sts
;
strcpy
(
t
.
elem
[
t
.
elem_cnt
].
fix_str
,
descr
);
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_FixStr
;
item
=
new
ItemChannel
(
brow
,
this
,
card_objid
,
&
t
,
&
ts
,
-
1
,
0
,
0
,
1
,
strcpy
(
t
.
elem
[
t
.
elem_cnt
].
fix_str
,
descr
);
NULL
,
flow_eDest_IntoLast
);
t
.
elem
[
t
.
elem_cnt
++
].
type_id
=
xnav_eType_FixStr
;
item
->
signal_aref
=
signal_aref
;
item
=
new
ItemChannel
(
brow
,
this
,
mod_aref
->
Objid
,
&
t
,
&
ts
,
-
1
,
0
,
0
,
1
,
}
NULL
,
flow_eDest_IntoLast
);
item
->
signal_aref
=
signal_aref
;
}
}
free
(
(
char
*
)
bd
);
}
}
free
(
(
char
*
)
bd
);
brow_ResetNodraw
(
brow
->
ctx
);
brow_Redraw
(
brow
->
ctx
,
0
);
force_trace_scan
();
return
XNAV__SUCCESS
;
return
XNAV__SUCCESS
;
}
}
int
XNav
::
show_object
(
pwr_tAttrRef
*
oarp
,
brow_tNode
node
)
int
XNav
::
show_object
(
pwr_tAttrRef
*
oarp
,
brow_tNode
node
)
{
{
double
node_x
,
node_y
;
double
node_x
,
node_y
;
...
...
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