PDA

View Full Version : session graphic setup



egcp
06-20-2006, 02:05 PM
Hi,

I'm running PV-Wave 8.5 on Fedora Core 4 (Linux). It works very well, but there is a problem with the default setting of the graphics. If I start wave and create a simple graph:
../ WAVE> a=indgen(10,10)
../ WAVE> plot, a

The graph shows up in red with a black background, instead of the common white on black. My wavestartup is the default with nothing added, and I'm not running any program or command before the commands above.

However, if the first thing that I run when I start a PV-Wave session is the demo
../ WAVE> demo
then everything works fine, even the status bar when navigator is initializing, and the navigator menus start with a more sensible smaller font. I don't have to run any of the different demos. I just start the demo and then exit it. So, what are the settings that the demo program is running that fixes the graphics and fonts?

Thanks,
egcp

brian
06-20-2006, 05:03 PM
Hello,

If you examine the demo source (main file wd_demo.pro ~ln 970) distributed with PV_WAVE, you will find the following code:



;Set the device color mode
WINDOW, /Free, /Pixmap
IF (!D.DISPLAY_DEPTH) EQ 24 THEN BEGIN
IF (!version.platform EQ 'linux') THEN $
DEVICE, True=24
ENDIF ELSE BEGIN
IF !D.Display_Depth GT 8 THEN BEGIN
DEVICE, Pseudo=8
ENDIF ELSE BEGIN
DEVICE, Pseudo=8
ENDELSE
ENDELSE


Note the difference between linux and other platforms. This has been due to some peculiarities with XFree86 (X windows server distributed with Red Hat) in the past. I recommend you try the
DEVICE, True=24 command.

If this resolves the issue you may want to seek more information at:

http://www.vni.com/cgi-bin/tipsengine.pl?id=442&formType=GET&kw=linux+true%3d24&type=AND&int=FALSE&inh=FALSE

Hope this helps,

brian

egcp
06-21-2006, 06:14 PM
Hi Brian,

Thanks. I added DEVICE, True=24 to my wavestartup file, but the funny thing is that the !D.Display_Depth variable does not get updated (still shows a value of 8) until the first graphic comand is issued. So, the first plot shows up as red on a black background and the ones after that show correctly as white on black.
I added LOADCT, 0 after the DEVICE, True=24 on the wavestartup and that does the trick.

Now with respect to changing the fonts I looked at setfont.pro that is called by demo and the default font does not exist in Linux anymore. I tried using fonts that are on my system (DEVICE, /List_Fonts), and then setting
DEVICE, Font=fnt, where fnt='one of my fonts'. But when I start the Navigator it always start with the same font. Am I missing something?

Thanks,
egcp

brian
06-22-2006, 08:57 AM
Hello egcp,

I must admit I'm unable to find a significant amount of information about this, perhaps someone can assist us if there any error here.

I did a quick search in the <vni_dir>/navigator-1_1/lib source file for .ads extensions (there are quite a few). Many of these resource files are located in the <vni_dir>/wave/xres/american/vdatools directory. Specifically wzglobal.ads has the following font information:



!
! Default hardware font
!
DefaultGraelFont_windows: Arial, 10
DefaultGraelFont_unix: !3!P14
DefaultGraelFont_vms: !3!P14


This resource file appears to be called in many of the vdatools. Indeed there is an example in the Application Developers guide that alludes to this:



Example
This example shows a portion of the string resource file for the WzPlot
VDA Tool: wzglobal.ads. An excerpt from the source code for the WzPlot
VDA Tool shows how TmGetMessage is used to load this file into the
resource database and extract a string from the database. In this example,
the string is extracted and printed in the Message Area of the WzPlot window
whenever a new variable is passed to WzPlot.

String resource file excerpt:
! Data Import Messages (in wzglobal.ads)
!
imported_var: Imported Variable:

WzPlot source code:

msg = TmGetMessage('wzglobal.ads', 'imported_var')
; Get the appropriate message text from the string resource file.
msg = msg + variable_list(j)
; Build a message string with the variable name.
WoAddMessage, tool_name, Message=msg
; Display the message in the VDA Tool's Message Area.


It seems to me that if you like the behavior in the navigator you can peruse this resource file to determine your preferred settings.

I hope this helps.

Regards,

brian

brian
06-22-2006, 09:51 AM
Hello egcp,

Another neat trick is to generate code from Navigator to retrieve settings. In particular I created an array (a=indgen(100)), started navigator, selected the wzplot tool and selected File-->Generate Code. Some of the interesting excerpts are as follows:

Re: color table and WoColorConvert (important for 24 bit mapping to color map)

;
; Restore previous color table (Change if necessary).
;
RED_COLOR = [0,255,204,255,0,0,0,255,255,255,153,0,0,140,255,84 ,171,255,192,115,0,2,3,4,5,6,7,8,9,10,11,12,14,15, 16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33 ,34,35,36,37,38,40,41,42,43,44,45,46,47,48,49,50,5 1,53,54,55,56,57,58,59,60,61,62,63,65,66,67,68,69, 70,71,72,73,74,75,76,78,79,80,81,82,83,84,85,86,87]
RED_COLOR2 = [88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,1 05,106,107,108,109,110,111,112,113,114,116,117,118 ,119,120,121,122,123,124,125,126,127,129,130,131,1 32,133,134,135,136,137,138,139,140,142,143,144,145 ,146,147,148,149,150,151,152,153,155,156,157,158,1 59,160,161,162,163,164,165,167,168,169,170,171,172 ,173,174,175,176,177,178,180,181,182,183,184,185,1 86,187,188,189,190,191,193,194,195,196]
RED_COLOR3 = [197,198,199,200,201,202,203,204,206,207,208,209,21 0,211,212,213,214,215,216,218,219,220,221,222,223, 224,225,226,227,228,229,231,232,233,234,235,236,23 7,238,239,240,241,242,244,245,246,247,248,249,250, 251,252,253,254,255]
RED_COLOR = [RED_COLOR, RED_COLOR2, RED_COLOR3]
GREEN_COLOR = [0,255,204,0,255,0,255,0,255,128,212,255,128,0,0,84 ,171,255,255,255,0,2,3,4,5,6,7,8,9,10,11,12,14,15, 16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33 ,34,35,36,37,38,40,41,42,43,44,45,46,47,48,49,50,5 1,53,54,55,56,57,58,59,60,61,62,63,65,66,67,68,69, 70,71,72,73,74,75,76,78,79,80,81,82,83,84,85,86,87]
GREEN_COLOR2 = [88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,1 05,106,107,108,109,110,111,112,113,114,116,117,118 ,119,120,121,122,123,124,125,126,127,129,130,131,1 32,133,134,135,136,137,138,139,140,142,143,144,145 ,146,147,148,149,150,151,152,153,155,156,157,158,1 59,160,161,162,163,164,165,167,168,169,170,171,172 ,173,174,175,176,177,178,180,181,182,183,184,185,1 86,187,188,189,190,191,193,194,195,196]
GREEN_COLOR3 = [197,198,199,200,201,202,203,204,206,207,208,209,21 0,211,212,213,214,215,216,218,219,220,221,222,223, 224,225,226,227,228,229,231,232,233,234,235,236,23 7,238,239,240,241,242,244,245,246,247,248,249,250, 251,252,253,254,255]
GREEN_COLOR = [GREEN_COLOR, GREEN_COLOR2, GREEN_COLOR3]
BLUE_COLOR = [0,255,204,0,0,255,255,212,0,0,0,153,255,212,140,84 ,171,84,115,153,0,2,3,4,5,6,7,8,9,10,11,12,14,15,1 6,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33, 34,35,36,37,38,40,41,42,43,44,45,46,47,48,49,50,51 ,53,54,55,56,57,58,59,60,61,62,63,65,66,67,68,69,7 0,71,72,73,74,75,76,78,79,80,81,82,83,84,85,86,87]
BLUE_COLOR2 = [88,89,91,92,93,94,95,96,97,98,99,100,101,102,104,1 05,106,107,108,109,110,111,112,113,114,116,117,118 ,119,120,121,122,123,124,125,126,127,129,130,131,1 32,133,134,135,136,137,138,139,140,142,143,144,145 ,146,147,148,149,150,151,152,153,155,156,157,158,1 59,160,161,162,163,164,165,167,168,169,170,171,172 ,173,174,175,176,177,178,180,181,182,183,184,185,1 86,187,188,189,190,191,193,194,195,196]
BLUE_COLOR3 = [197,198,199,200,201,202,203,204,206,207,208,209,21 0,211,212,213,214,215,216,218,219,220,221,222,223, 224,225,226,227,228,229,231,232,233,234,235,236,23 7,238,239,240,241,242,244,245,246,247,248,249,250, 251,252,253,254,255]
BLUE_COLOR = [BLUE_COLOR, BLUE_COLOR2, BLUE_COLOR3]
TVLCT, RED_COLOR, GREEN_COLOR, BLUE_COLOR

;
; From WzPlot, display internal state:WzPlot_0
;
PLOT, Position=[0.100000, 0.100000, 0.950000, 0.950000], A, Xrange = [0.0D0, 100.0D0], Yrange = [0.0D0, 100.0D0] , Xstyle=5, Ystyle=5, Color=WoColorConvert(0, /IndexToColor), Linestyle=0, Thick=1.00000, Background=WoColorConvert(2, /IndexToColor)


Re: Tm*Font procedures and in line font example



PLOTS, [69.485413, 91.728060, 91.728060, 69.485413, 69.485413], [14.660044, 14.660044, 39.016662, 39.016662, 14.660044], Color=WoColorConvert(0, /IndexToColor), Linestyle=0, Thick=1.00000, /Data
s = TmSetFont('!8')
XYOUTS,74.378795,30.020073, "!8Legend!3", Color=WoColorConvert(0, /IndexToColor), Size=1.76458, /Data
s = TmResetFont()
s = TmSetFont('!3')
XYOUTS,81.941295,19.048624,"!3A!3", Size=1.76458, Color=WoColorConvert(0, /IndexToColor), /Data
s = TmResetFont()
PLOTS, [71.709677,80.606736], [19.048624,19.048624], Color=WoColorConvert(0, /IndexToColor), Linestyle=0, /Data


Regards,

brian

egcp
07-05-2006, 01:57 PM
Thanks Brian.

The file that determines the fonts for the NAVIGATOR menus is VDATools located in <vni_dir>/wave/xres/american/vdatools.


VDATools*fontList: *-lucida*bold*r*normal*14*
VDATools*statusFontList: *-lucida*bold*r*normal*12*
VDATools*fallbackStatusFontList: *-lucidatypewriter*bold*r*normal*10*
VDATools*previewLayout.preview.fontList: *courier*bold*r*normal*14*
! The following resources represent the height of the font in
! pixels and the spacing (in pixels) between lines in the message
! area. They are used to set the initial height of the message area.
VDATools*fontHeight: 14
VDATools*messageSpacing: 5

Thanks again,
egcp