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
5b3bf603
Commit
5b3bf603
authored
Jun 10, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for ReflextionX that can't handle aspect ratio correct
parent
942751fa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
20 deletions
+119
-20
xtt/lib/xtt/src/xtt_ge.cpp
xtt/lib/xtt/src/xtt_ge.cpp
+15
-5
xtt/lib/xtt/src/xtt_xnav.h
xtt/lib/xtt/src/xtt_xnav.h
+14
-12
xtt/lib/xtt/src/xtt_xnav_command.cpp
xtt/lib/xtt/src/xtt_xnav_command.cpp
+90
-3
No files found.
xtt/lib/xtt/src/xtt_ge.cpp
View file @
5b3bf603
...
...
@@ -40,7 +40,7 @@ extern "C" {
#include "co_lng.h"
#include "xtt_ge.h"
#include "ge_graph.h"
#include "xtt_xnav.h"
//
// Test program
...
...
@@ -110,13 +110,23 @@ static void ge_graph_init_cb( void *client_data)
sts
=
((
Graph
*
)
gectx
->
graph
)
->
get_default_size
(
&
default_width
,
&
default_height
);
if
(
ODD
(
sts
))
{
short
x1
,
x2
,
y1
,
y2
;
i
=
0
;
XtSetArg
(
args
[
i
],
XmNwidth
,
default_width
);
i
++
;
XtSetArg
(
args
[
i
],
XmNheight
,
default_height
);
i
++
;
XtSetArg
(
args
[
i
],
XmNminAspectX
,
default_width
);
i
++
;
XtSetArg
(
args
[
i
],
XmNminAspectY
,
default_height
);
i
++
;
XtSetArg
(
args
[
i
],
XmNmaxAspectX
,
default_width
);
i
++
;
XtSetArg
(
args
[
i
],
XmNmaxAspectY
,
default_height
);
i
++
;
x1
=
default_width
;
y1
=
default_height
;
x2
=
default_width
;
y2
=
default_height
;
// This condition is due to a bug in Reflection X 11.0.5...
if
(
!
((
XNav
*
)
gectx
->
parent_ctx
)
->
gbl
.
no_graph_ratio
)
{
XtSetArg
(
args
[
i
],
XmNminAspectX
,
x1
);
i
++
;
XtSetArg
(
args
[
i
],
XmNminAspectY
,
y1
);
i
++
;
XtSetArg
(
args
[
i
],
XmNmaxAspectX
,
x2
);
i
++
;
XtSetArg
(
args
[
i
],
XmNmaxAspectY
,
y2
);
i
++
;
}
XtSetValues
(
gectx
->
toplevel
,
args
,
i
);
}
}
...
...
xtt/lib/xtt/src/xtt_xnav.h
View file @
5b3bf603
...
...
@@ -193,7 +193,8 @@ class XNavGbl {
XNavGbl
()
:
priv
(
0
),
UserObject
(
pwr_cNObjid
),
AlarmAutoLoad
(
0
),
AlarmMessage
(
0
),
AlarmBeep
(
0
),
AlarmReturn
(
0
),
AlarmAck
(
0
),
gdh_started
(
1
),
verify
(
0
),
scantime
(
0.5
),
signal_test_mode
(
0
),
advanced_user
(
0
),
show_truedb
(
0
)
verify
(
0
),
scantime
(
0.5
),
signal_test_mode
(
0
),
advanced_user
(
0
),
show_truedb
(
0
),
no_graph_ratio
(
0
)
{
strcpy
(
version
,
xnav_cVersion
);
strcpy
(
time
,
""
);
strcpy
(
ConfigureObject
,
""
);
strcpy
(
AlarmLastMessage
,
""
);
...
...
@@ -232,6 +233,7 @@ class XNavGbl {
int
signal_test_mode
;
int
advanced_user
;
int
show_truedb
;
int
no_graph_ratio
;
int
load_config
(
void
*
xnav
);
int
symbolfile_exec
(
void
*
xnav
);
...
...
xtt/lib/xtt/src/xtt_xnav_command.cpp
View file @
5b3bf603
...
...
@@ -302,7 +302,7 @@ dcli_tCmdTable xnav_command_table[] = {
"PRINT"
,
&
xnav_print_func
,
{
"dcli_arg1"
,
"dcli_arg2"
,
"/NAME"
,
"/FILE"
,
"/OBJECT"
,
"/OBJECT"
,
"/CLASSGRAPH"
,
"/INSTANCE"
,
""
}
},
{
""
,}};
...
...
@@ -665,6 +665,11 @@ static int xnav_set_func( void *client_data,
cdh_ToLower
(
language_str
,
language_str
);
Lng
::
set
(
language_str
);
}
else
if
(
strncmp
(
arg1_str
,
"NORATIO"
,
strlen
(
arg1_str
))
==
0
)
{
// Command is "SET NORATIO"
xnav
->
gbl
.
no_graph_ratio
=
1
;
}
else
xnav
->
message
(
'E'
,
"Syntax error"
);
return
1
;
...
...
@@ -4275,9 +4280,29 @@ static int xnav_print_func(void *client_data,
if
(
strncmp
(
arg1_str
,
"GRAPH"
,
strlen
(
arg1_str
))
==
0
)
{
char
file_str
[
80
];
char
name_str
[
80
]
=
""
;
char
instance_str
[
80
]
;
ge_tCtx
gectx
;
char
fname
[
200
];
int
classgraph
;
char
*
instance_p
;
int
sts
;
if
(
ODD
(
dcli_get_qualifier
(
"/INSTANCE"
,
instance_str
)))
{
instance_p
=
instance_str
;
}
else
instance_p
=
0
;
if
(
ODD
(
dcli_get_qualifier
(
"/CLASSGRAPH"
,
0
)))
{
classgraph
=
1
;
if
(
!
instance_p
)
{
xnav
->
message
(
'E'
,
"Instance is missing"
);
return
XNAV__HOLDCOMMAND
;
}
}
else
classgraph
=
0
;
if
(
ODD
(
dcli_get_qualifier
(
"dcli_arg2"
,
file_str
)))
{
if
(
file_str
[
0
]
==
'/'
)
{
...
...
@@ -4289,8 +4314,70 @@ static int xnav_print_func(void *client_data,
// Get base class graphs on $pwr_exe
cdh_ToLower
(
fname
,
file_str
);
}
else
if
(
classgraph
)
{
// Get file from class of instance object
pwr_sAttrRef
aref
;
char
cname
[
80
];
pwr_tCid
cid
;
char
found_file
[
200
];
if
(
!
instance_p
)
{
xnav
->
message
(
'E'
,
"Enter instance object"
);
return
XNAV__HOLDCOMMAND
;
}
sts
=
gdh_NameToAttrref
(
pwr_cNObjid
,
instance_p
,
&
aref
);
if
(
EVEN
(
sts
))
{
xnav
->
message
(
'E'
,
"Instance object not found"
);
return
XNAV__HOLDCOMMAND
;
}
sts
=
gdh_GetAttrRefTid
(
&
aref
,
&
cid
);
while
(
ODD
(
sts
))
{
// Try all superclasses
sts
=
gdh_ObjidToName
(
cdh_ClassIdToObjid
(
cid
),
cname
,
sizeof
(
cname
),
cdh_mName_object
);
if
(
EVEN
(
sts
))
return
sts
;
cdh_ToLower
(
cname
,
cname
);
if
(
cdh_CidToVid
(
cid
)
<
cdh_cUserClassVolMin
||
(
cdh_CidToVid
(
cid
)
>=
cdh_cManufactClassVolMin
&&
cdh_CidToVid
(
cid
)
<=
cdh_cManufactClassVolMax
))
{
if
(
cname
[
0
]
==
'$'
)
sprintf
(
file_str
,
"pwr_c_%s"
,
&
cname
[
1
]);
else
sprintf
(
file_str
,
"pwr_c_%s"
,
cname
);
}
else
strcpy
(
file_str
,
cname
);
// Get base class graphs on $pwr_exe
cdh_ToLower
(
fname
,
file_str
);
if
(
instance_p
&&
(
strncmp
(
fname
,
"pwr_c_"
,
6
)
==
0
||
strncmp
(
fname
,
"pwr_c_"
,
6
)
==
0
))
{
strcpy
(
fname
,
"$pwr_exe/"
);
strcat
(
fname
,
file_str
);
strcpy
(
file_str
,
fname
);
}
else
{
strcpy
(
fname
,
"$pwrp_exe/"
);
strcat
(
fname
,
file_str
);
strcpy
(
file_str
,
fname
);
}
strcat
(
fname
,
".pwg"
);
sts
=
dcli_search_file
(
fname
,
found_file
,
DCLI_DIR_SEARCH_INIT
);
dcli_search_file
(
fname
,
found_file
,
DCLI_DIR_SEARCH_END
);
if
(
ODD
(
sts
))
break
;
sts
=
gdh_GetSuperClass
(
cid
,
&
cid
);
}
if
(
EVEN
(
sts
))
{
xnav
->
message
(
'E'
,
"No classgraph found"
);
return
XNAV__HOLDCOMMAND
;
}
}
if
(
xnav
->
appl
.
find
(
applist_eType_Graph
,
file_str
,
name_str
,
if
(
xnav
->
appl
.
find
(
applist_eType_Graph
,
file_str
,
instance_p
,
(
void
**
)
&
gectx
))
ge_print
(
gectx
);
else
{
...
...
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