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
a2d2f629
Commit
a2d2f629
authored
Nov 19, 2014
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xtt crossref string and function didn't search in subvolumes (refs #194)
parent
c4b557a6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
197 additions
and
127 deletions
+197
-127
src/lib/co/src/co_api.cpp
src/lib/co/src/co_api.cpp
+6
-6
src/lib/co/src/co_api.h
src/lib/co/src/co_api.h
+2
-2
src/lib/co/src/co_nav_crr.cpp
src/lib/co/src/co_nav_crr.cpp
+142
-112
src/lib/co/src/co_nav_crr.h
src/lib/co/src/co_nav_crr.h
+1
-1
src/msg/rt/src/rt_xnav_msg.msg
src/msg/rt/src/rt_xnav_msg.msg
+1
-1
src/msg/wb/src/wb_wnav_msg.msg
src/msg/wb/src/wb_wnav_msg.msg
+1
-0
wb/lib/wb/src/wb_wnav_crr.cpp
wb/lib/wb/src/wb_wnav_crr.cpp
+5
-2
xtt/lib/xtt/src/xtt_xnav_crr.cpp
xtt/lib/xtt/src/xtt_xnav_crr.cpp
+39
-3
No files found.
src/lib/co/src/co_api.cpp
View file @
a2d2f629
...
...
@@ -87,9 +87,9 @@ char *lng_get_language_str()
//
int
crr_signal
(
void
*
parent_ctx
,
char
*
signalname
,
void
(
*
insert_cb
)(
void
*
,
void
*
,
navc_eItemType
,
char
*
,
char
*
,
int
),
int
(
*
name_to_objid_cb
)(
void
*
,
char
*
,
pwr_tObjid
*
),
int
(
*
get_volume_cb
)(
void
*
,
pwr_tVolumeId
*
))
void
(
*
insert_cb
)(
void
*
,
void
*
,
navc_eItemType
,
char
*
,
char
*
,
int
),
int
(
*
name_to_objid_cb
)(
void
*
,
char
*
,
pwr_tObjid
*
),
int
(
*
get_volume_cb
)(
void
*
,
pwr_tVid
*
,
pwr_tVid
))
{
int
sts
;
NavCrr
*
navcrr
=
new
NavCrr
(
parent_ctx
,
0
);
...
...
@@ -103,9 +103,9 @@ int crr_signal( void *parent_ctx, char *signalname,
}
int
crr_object
(
void
*
parent_ctx
,
char
*
objectname
,
void
(
*
insert_cb
)(
void
*
,
void
*
,
navc_eItemType
,
char
*
,
char
*
,
int
),
int
(
*
name_to_objid_cb
)(
void
*
,
char
*
,
pwr_tObjid
*
),
int
(
*
get_volume_cb
)(
void
*
,
pwr_tVolumeId
*
))
void
(
*
insert_cb
)(
void
*
,
void
*
,
navc_eItemType
,
char
*
,
char
*
,
int
),
int
(
*
name_to_objid_cb
)(
void
*
,
char
*
,
pwr_tObjid
*
),
int
(
*
get_volume_cb
)(
void
*
,
pwr_tVid
*
,
pwr_tVid
))
{
int
sts
;
NavCrr
*
navcrr
=
new
NavCrr
(
parent_ctx
,
0
);
...
...
src/lib/co/src/co_api.h
View file @
a2d2f629
...
...
@@ -66,11 +66,11 @@ char *lng_get_language_str();
int
crr_signal
(
void
*
parent_ctx
,
char
*
signalname
,
void
(
*
insert_cb
)(
void
*
,
void
*
,
navc_eItemType
,
char
*
,
char
*
,
int
),
int
(
*
name_to_objid_cb
)(
void
*
,
char
*
,
pwr_tObjid
*
),
int
(
*
get_volume_cb
)(
void
*
,
pwr_tV
olumeId
*
));
int
(
*
get_volume_cb
)(
void
*
,
pwr_tV
id
*
,
pwr_tVid
));
int
crr_object
(
void
*
parent_ctx
,
char
*
objectname
,
void
(
*
insert_cb
)(
void
*
,
void
*
,
navc_eItemType
,
char
*
,
char
*
,
int
),
int
(
*
name_to_objid_cb
)(
void
*
,
char
*
,
pwr_tObjid
*
),
int
(
*
get_volume_cb
)(
void
*
,
pwr_tV
olumeId
*
));
int
(
*
get_volume_cb
)(
void
*
,
pwr_tV
id
*
,
pwr_tVid
));
#if defined __cplusplus
}
#endif
...
...
src/lib/co/src/co_nav_crr.cpp
View file @
a2d2f629
...
...
@@ -253,7 +253,7 @@ int NavCrr::crr_signal(
volid
=
objid
.
vid
;
}
else
{
sts
=
(
get_volume_cb
)(
parent_ctx
,
&
volid
);
sts
=
(
get_volume_cb
)(
parent_ctx
,
&
volid
,
0
);
if
(
EVEN
(
sts
))
return
sts
;
}
...
...
@@ -428,7 +428,7 @@ int NavCrr::crr_object(
volid
=
objid
.
vid
;
}
else
{
sts
=
(
get_volume_cb
)(
parent_ctx
,
&
volid
);
sts
=
(
get_volume_cb
)(
parent_ctx
,
&
volid
,
0
);
if
(
EVEN
(
sts
))
return
sts
;
}
...
...
@@ -588,132 +588,162 @@ int NavCrr::crr_code(
int
objname_written
;
int
hit
;
char
*
tst_char
;
pwr_tVid
prev_volid
=
0
;
int
vol_cnt
=
0
;
int
end_of_file
;
/* Open file */
if
(
filename
==
NULL
)
{
sts
=
(
get_volume_cb
)(
parent_ctx
,
&
volid
);
if
(
EVEN
(
sts
))
return
sts
;
while
(
1
)
{
end_of_file
=
0
;
sprintf
(
default_filename
,
"%srtt_crrc_%s.dat"
,
dcli_pwr_dir
(
"pwrp_load"
),
nav_VolumeIdToStr
(
volid
));
dcli_get_defaultfilename
(
default_filename
,
filestr
,
NULL
);
file
=
fopen
(
filestr
,
"r"
);
}
else
{
dcli_get_defaultfilename
(
filename
,
filestr
,
".lis"
);
file
=
fopen
(
filestr
,
"r"
);
}
if
(
file
==
0
)
return
NAV__NOFILE
;
/* Case sensitive if any lowercase */
if
(
!
case_sensitive
)
for
(
s
=
str
;
*
s
!=
0
;
s
++
)
{
if
(
*
s
!=
'_'
&&
!
isupper
(
*
s
))
case_sensitive
=
1
;
}
/* Open file */
if
(
filename
==
NULL
)
{
sts
=
(
get_volume_cb
)(
parent_ctx
,
&
volid
,
prev_volid
);
if
(
EVEN
(
sts
))
break
;
while
(
strncmp
(
line
,
" _Obj_ "
,
7
)
!=
0
)
{
sts
=
nav_get_signal_line
(
file
,
line
,
sizeof
(
line
),
&
spaces
,
object
,
&
lines
);
if
(
EVEN
(
sts
))
goto
finish
;
}
prev_volid
=
volid
;
sprintf
(
default_filename
,
"%srtt_crrc_%s.dat"
,
dcli_pwr_dir
(
"pwrp_load"
),
nav_VolumeIdToStr
(
volid
));
dcli_get_defaultfilename
(
default_filename
,
filestr
,
NULL
);
file
=
fopen
(
filestr
,
"r"
);
}
else
{
if
(
vol_cnt
==
1
)
break
;
first
=
1
;
while
(
1
)
{
strcpy
(
objname
,
&
line
[
7
]);
for
(
s
=
objname
;
!
(
*
s
==
32
||
*
s
==
9
||
*
s
==
0
);
s
++
);
*
s
=
0
;
dcli_get_defaultfilename
(
filename
,
filestr
,
".lis"
);
file
=
fopen
(
filestr
,
"r"
);
}
vol_cnt
++
;
if
(
file
==
0
)
continue
;
/* Case sensitive if any lowercase */
if
(
!
case_sensitive
)
for
(
s
=
str
;
*
s
!=
0
;
s
++
)
{
if
(
*
s
!=
'_'
&&
!
isupper
(
*
s
))
case_sensitive
=
1
;
}
sts
=
nav_get_signal_line
(
file
,
line
,
sizeof
(
line
),
&
spaces
,
object
,
&
lines
);
objname_written
=
0
;
while
(
strncmp
(
line
,
" _Obj_ "
,
7
)
!=
0
)
{
if
(
!
case_sensitive
)
cdh_ToUpper
(
tst_line
,
line
);
else
strcpy
(
tst_line
,
line
);
hit
=
0
;
if
(
!
func
)
{
if
(
strstr
(
tst_line
,
str
)
!=
0
)
hit
=
1
;
sts
=
nav_get_signal_line
(
file
,
line
,
sizeof
(
line
),
&
spaces
,
object
,
&
lines
);
if
(
EVEN
(
sts
))
{
fclose
(
file
);
end_of_file
=
1
;
break
;
}
else
{
if
(
(
s
=
strstr
(
tst_line
,
str
))
!=
0
)
{
hit
=
1
;
/* Check char after */
tst_char
=
s
+
strlen
(
str
);
if
(
isalpha
(
*
tst_char
)
||
isdigit
(
*
tst_char
)
||
*
tst_char
==
'_'
)
hit
=
0
;
/* Check char before */
if
(
s
!=
tst_line
)
{
tst_char
=
s
-
1
;
if
(
isalpha
(
*
tst_char
)
||
isdigit
(
*
tst_char
)
||
*
tst_char
==
'_'
)
hit
=
0
;
}
}
}
if
(
hit
)
{
/* Hit, print this object */
if
(
signalcount
==
0
)
{
if
(
func
)
{
sprintf
(
title
,
"Crossreferens list Function
\"
%s
\"\n\n
"
,
str
);
(
insert_cb
)(
parent_ctx
,
parent_node
,
navc_eItemType_Header
,
title
,
NULL
,
0
);
}
else
{
sprintf
(
title
,
"Crossreferens list String
\"
%s
\"\n\n
"
,
str
);
(
insert_cb
)(
parent_ctx
,
parent_node
,
navc_eItemType_Header
,
title
,
NULL
,
0
);
}
}
signalcount
++
;
}
if
(
end_of_file
)
continue
;
if
(
!
objname_written
)
{
(
insert_cb
)(
parent_ctx
,
parent_node
,
navc_eItemType_Crossref
,
objname
,
(
char
*
)
""
,
2
);
objname_written
=
1
;
first
=
1
;
while
(
1
)
{
strcpy
(
objname
,
&
line
[
7
]);
for
(
s
=
objname
;
!
(
*
s
==
32
||
*
s
==
9
||
*
s
==
0
);
s
++
);
*
s
=
0
;
sts
=
nav_get_signal_line
(
file
,
line
,
sizeof
(
line
),
&
spaces
,
object
,
&
lines
);
objname_written
=
0
;
while
(
strncmp
(
line
,
" _Obj_ "
,
7
)
!=
0
)
{
if
(
!
case_sensitive
)
cdh_ToUpper
(
tst_line
,
line
);
else
strcpy
(
tst_line
,
line
);
hit
=
0
;
if
(
!
func
)
{
if
(
strstr
(
tst_line
,
str
)
!=
0
)
hit
=
1
;
}
strcpy
(
tst_line
,
" "
);
strcat
(
tst_line
,
line
);
(
insert_cb
)(
parent_ctx
,
parent_node
,
navc_eItemType_Text
,
tst_line
,
NULL
,
0
);
if
(
brief
)
{
while
(
strncmp
(
line
,
" _Obj_ "
,
7
)
!=
0
)
{
sts
=
nav_get_signal_line
(
file
,
line
,
sizeof
(
line
),
&
spaces
,
object
,
&
lines
);
if
(
EVEN
(
sts
))
goto
finish
;
}
else
{
if
(
(
s
=
strstr
(
tst_line
,
str
))
!=
0
)
{
hit
=
1
;
/* Check char after */
tst_char
=
s
+
strlen
(
str
);
if
(
isalpha
(
*
tst_char
)
||
isdigit
(
*
tst_char
)
||
*
tst_char
==
'_'
)
hit
=
0
;
/* Check char before */
if
(
s
!=
tst_line
)
{
tst_char
=
s
-
1
;
if
(
isalpha
(
*
tst_char
)
||
isdigit
(
*
tst_char
)
||
*
tst_char
==
'_'
)
hit
=
0
;
}
}
}
if
(
hit
)
{
/* Hit, print this object */
if
(
signalcount
==
0
)
{
if
(
func
)
{
sprintf
(
title
,
"Crossreferens list Function
\"
%s
\"\n\n
"
,
str
);
(
insert_cb
)(
parent_ctx
,
parent_node
,
navc_eItemType_Header
,
title
,
NULL
,
0
);
}
else
{
sprintf
(
title
,
"Crossreferens list String
\"
%s
\"\n\n
"
,
str
);
(
insert_cb
)(
parent_ctx
,
parent_node
,
navc_eItemType_Header
,
title
,
NULL
,
0
);
}
}
signalcount
++
;
if
(
!
objname_written
)
{
(
insert_cb
)(
parent_ctx
,
parent_node
,
navc_eItemType_Crossref
,
objname
,
(
char
*
)
""
,
2
);
objname_written
=
1
;
}
strcpy
(
tst_line
,
" "
);
strcat
(
tst_line
,
line
);
(
insert_cb
)(
parent_ctx
,
parent_node
,
navc_eItemType_Text
,
tst_line
,
NULL
,
0
);
if
(
brief
)
{
while
(
strncmp
(
line
,
" _Obj_ "
,
7
)
!=
0
)
{
sts
=
nav_get_signal_line
(
file
,
line
,
sizeof
(
line
),
&
spaces
,
object
,
&
lines
);
if
(
EVEN
(
sts
))
{
end_of_file
=
1
;
break
;
}
}
if
(
end_of_file
)
break
;
}
else
{
sts
=
nav_get_signal_line
(
file
,
line
,
sizeof
(
line
),
&
spaces
,
object
,
&
lines
);
if
(
EVEN
(
sts
))
{
end_of_file
=
1
;
break
;
}
}
}
else
{
sts
=
nav_get_signal_line
(
file
,
line
,
sizeof
(
line
),
&
spaces
,
object
,
&
lines
);
if
(
EVEN
(
sts
))
goto
finish
;
sts
=
nav_get_signal_line
(
file
,
line
,
sizeof
(
line
),
&
spaces
,
object
,
&
lines
);
if
(
EVEN
(
sts
))
{
end_of_file
=
1
;
break
;
}
}
}
else
{
sts
=
nav_get_signal_line
(
file
,
line
,
sizeof
(
line
),
&
spaces
,
object
,
&
lines
);
if
(
EVEN
(
sts
))
goto
finish
;
}
if
(
end_of_file
)
break
;
}
if
(
end_of_file
)
break
;
}
}
finish:
fclose
(
file
);
if
(
signalcount
>
0
)
{
fclose
(
file
);
}
else
{
if
(
signalcount
==
0
)
{
if
(
func
)
return
NAV__STRINGNOTFOUND
;
else
...
...
src/lib/co/src/co_nav_crr.h
View file @
a2d2f629
...
...
@@ -61,7 +61,7 @@ class NavCrr {
void
(
*
insert_cb
)(
void
*
,
void
*
,
navc_eItemType
,
char
*
,
char
*
,
int
);
int
(
*
name_to_objid_cb
)(
void
*
,
char
*
,
pwr_tObjid
*
);
int
(
*
get_volume_cb
)(
void
*
,
pwr_tV
olumeId
*
);
int
(
*
get_volume_cb
)(
void
*
,
pwr_tV
id
*
,
pwr_tVid
);
int
crr_signal
(
char
*
filename
,
char
*
signalname
);
int
crr_object
(
char
*
filename
,
char
*
objectname
);
int
crr_code
(
char
*
filename
,
char
*
str
,
int
brief
,
int
func
,
...
...
src/msg/rt/src/rt_xnav_msg.msg
View file @
a2d2f629
...
...
@@ -74,4 +74,4 @@ notcollectw <Not collect window> /error
noclassgraph <No classgraph found> /error
notauthorized <Not authorized for this operation> /error
novalidcurve <No valid curve found> /error
nosuchvolume <No such volume> /error
src/msg/wb/src/wb_wnav_msg.msg
View file @
a2d2f629
...
...
@@ -80,6 +80,7 @@ volnameexist <Volume name already exist> /error
createdbs <Create loadfile error> /error
edit <In edit mode> /error
notauthorized <User not authorized for requested operation> /error
nosuchvolume <No such volume> /error
wb/lib/wb/src/wb_wnav_crr.cpp
View file @
a2d2f629
...
...
@@ -127,7 +127,7 @@ int wnav_crr_name_to_objid_cb( void *ctx, char *name, pwr_tObjid *objid)
return
ldh_NameToObjid
(
cctx
->
ldhses
,
objid
,
name
);
}
int
wnav_crr_get_volume_cb
(
void
*
ctx
,
pwr_tV
olumeId
*
vol
id
)
int
wnav_crr_get_volume_cb
(
void
*
ctx
,
pwr_tV
id
*
vid
,
pwr_tVid
prev_v
id
)
{
int
sts
;
ldh_sVolumeInfo
info
;
...
...
@@ -135,7 +135,10 @@ int wnav_crr_get_volume_cb( void *ctx, pwr_tVolumeId *volid)
ldh_tVolContext
volctx
=
ldh_SessionToVol
(
cctx
->
ldhses
);
sts
=
ldh_GetVolumeInfo
(
volctx
,
&
info
);
*
volid
=
info
.
Volume
;
if
(
prev_vid
)
return
WNAV__NOSUCHVOLUME
;
*
vid
=
info
.
Volume
;
return
WNAV__SUCCESS
;
}
...
...
xtt/lib/xtt/src/xtt_xnav_crr.cpp
View file @
a2d2f629
...
...
@@ -99,16 +99,52 @@ int xnav_crr_name_to_objid_cb( void *ctx, char *name, pwr_tObjid *objid)
return
gdh_NameToObjid
(
name
,
objid
);
}
int
xnav_crr_get_volume_cb
(
void
*
ctx
,
pwr_tV
olumeId
*
vol
id
)
int
xnav_crr_get_volume_cb
(
void
*
ctx
,
pwr_tV
id
*
vid
,
pwr_tVid
prev_v
id
)
{
int
sts
;
pwr_tObjid
objid
;
pwr_tVid
v
;
gdh_sVolumeInfo
info
;
sts
=
gdh_GetNodeObject
(
0
,
&
objid
);
if
(
EVEN
(
sts
))
return
sts
;
*
volid
=
objid
.
vid
;
return
XNAV__SUCCESS
;
if
(
prev_vid
==
0
)
{
*
vid
=
objid
.
vid
;
return
XNAV__SUCCESS
;
}
int
next
=
0
;
for
(
sts
=
gdh_GetVolumeList
(
&
v
);
ODD
(
sts
);
sts
=
gdh_GetNextVolume
(
v
,
&
v
))
{
int
volume_found
=
0
;
sts
=
gdh_GetVolumeInfo
(
v
,
&
info
);
if
(
EVEN
(
sts
))
return
sts
;
switch
(
info
.
cid
)
{
case
pwr_eClass_SubVolume
:
case
pwr_eClass_SharedVolume
:
volume_found
=
1
;
break
;
default:
;
}
if
(
!
volume_found
)
continue
;
if
(
prev_vid
==
objid
.
vid
)
{
*
vid
=
v
;
return
XNAV__SUCCESS
;
}
if
(
prev_vid
==
v
)
{
next
=
1
;
}
else
if
(
next
)
{
*
vid
=
v
;
return
XNAV__SUCCESS
;
}
}
return
XNAV__NOSUCHVOLUME
;
}
int
xnav_crr_signal
(
...
...
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