home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MGA Millennium Bulk
/
BLK_5_FEB_96.iso
/
mga-demo
/
mgademo.mst
< prev
next >
Wrap
Text File
|
1995-06-22
|
12KB
|
401 lines
' **** MGA-DEMO Millennium demo MS-Test script - Kim Pallister **** '
' *** The following conditions are assumed:
' *** Software: 1.02.22 MGA drivers running on 2mb Millenium
' *** Driver setup:640x480x16 3D, DCI enabled
' *** Modeswitch, Follow display : Off
' *** Panlock, Maxview, CenterWin, CenterPopup : Off
'$include 'fasttest.inc' ' *** include fasttest commands
'$include 'mstest.inc' ' *** include mstest commands
xlogon ' *** turn logging on ***
xminwindow '*** to minimize MSTEST and place focus on Prog.mgr
' now ready to begin
' declare global vars
GLOBAL success AS INTEGER 'used as error flag
GLOBAL abortcode AS INTEGER 'used to identify error
GLOBAL abortstring AS STRING 'used to identify error
GLOBAL VIDDIR AS STRING 'stores directory containing video files
GLOBAL AVIFILE AS STRING 'stores name of AVI file used
GLOBAL THREEDDIR AS STRING 'stores directory containing 3D viewer
GLOBAL WINTACHDIR AS STRING 'stores directory containing Wintach
GLOBAL PPTDIR AS STRING 'stores directory containing PowerPoint Viewer
GLOBAL MGADIR AS STRING 'stores directory containing MGA drivers
GLOBAL WINDIR AS STRING 'stores directory containing Windows
GLOBAL tempfilestr AS STRING 'temp var file dir and file names
GLOBAL inifilenum AS INTEGER 'stores fiel number
GLOBAL msgstr AS INTEGER ' just for testing
GLOBAL loopcount AS INTEGER ' just for testing
' *** begin ***
main:
gosub checkinifile 'check if ini file present, if not abort
if (success=1) then
abortcode=1
goto abortroutine
end if
gosub readinifile 'read ini file, if any error, abort
if (success=1) then
abortcode=2
goto abortroutine
end if
gosub checkifmodevalid 'check if in valid mode, if not abort
if (success=1) then
abortcode=3
goto abortroutine
else 'remove later
pause "current mode is valid, press ok to continue"
end if
gosub openapps 'open apps, if not successful, abort
if (success=1) then
abortcode=4
goto abortroutine
end if
pause "Setup successful, Press Enter or Click OK to start demo."
' Prime the Loop by putting up first slide
hwnd = WFndWndC("Microsoft PowerPoint Viewer", NULL, FW_DEFAULT)
WSetActWnd hwnd
wreswnd hwnd
WButtonClick "Show" 'show slide
sleep 3 'wait
xkey "escape" 'back out
' the following is the body of the looped demo
while ((success=0) AND (loopcount < 5)) 'remove latter part later
loopcount = loopcount +1 ' temporary
gosub videortn 'play AVI file
'sleep 1 'pause 1 second, try romving later
hwnd = WFndWndC("Microsoft PowerPoint Viewer", NULL, FW_DEFAULT)
WSetActWnd hwnd
xalt "n" 'switch to name box
xtext "mgademo2.ppt" 'switch to next slide
WButtonClick "Show" 'show slide
sleep 3 'wait
xkey "escape" 'back out
gosub threedrtn 'play 3D segment
hwnd = WFndWndC("Microsoft PowerPoint Viewer", NULL, FW_DEFAULT)
WSetActWnd hwnd
xalt "n" 'switch to name box
xtext "mgademo3.ppt" 'switch to next slide
WButtonClick "Show" 'show slide
sleep 3 'wait
xkey "escape" 'back out
gosub wintachrtn 'do Wintach segment
hwnd = WFndWndC("Microsoft PowerPoint Viewer", NULL, FW_DEFAULT)
WSetActWnd hwnd
xalt "n" 'switch to name box
xtext "mgademo1.ppt" 'switch to next slide
WButtonClick "Show" 'show slide
sleep 3 'wait
xkey "escape" 'back out
gosub checkexitkey 'check if exit keystroke pressed
' display status box (temporary)
message$ = "Loopcount ="
message$ = message$ + str$(loopcount)
font$ = "MS sans serif"
STATUSBOX message$, 0, 0, 0, 0, 1, 1, font$, 24, 500
sleep 1
STATUSBOX CLOSE
'pause "press enter"
wend 'of while loop
end ' of script
' the following is a subroutine to check if INI file exists
checkinifile:
'check for ini file here
success=0
return
' the following reads the directory names into their vars
readinifile:
success=1
if exists("mgademo.ini") then
'pause "INI file found "
inifilenum = freefile
open "mgademo.ini" for input as inifilenum
'pause "ini file opened"
while (not (eof(inifilenum)))
line input #inifilenum, tempfilestr
'pause tempfilestr
gosub comparestrings
wend
close #inifilenum 'clos ini file
else
success=1 'file not found
endif
success = 0
return
comparestrings:
'pause ("*"+ (left$(tempfilestr,6)) + "*")
if (left$(tempfilestr,6) = "WINDIR") then
WINDIR=right$(tempfilestr,( len(tempfilestr)-(6+1) ))
'pause ("WINDIR = "+WINDIR)
'end if
elseif (left$(tempfilestr,6) = "MGADIR") then
MGADIR=right$(tempfilestr,( len(tempfilestr)-(6+1) ))
'pause ("MGADIR = " + MGADIR)
'end if
elseif (left$(tempfilestr,6) = "VIDDIR") then
VIDDIR=right$(tempfilestr,( len(tempfilestr)-(6+1) ))
'pause ("VIDDIR = "+VIDDIR)
'end if
elseif (left$(tempfilestr,9) = "THREEDDIR") then
THREEDDIR=right$(tempfilestr,( len(tempfilestr)-(9+1) ))
'pause ("THREEDDIR = "+THREEDDIR)
'end if
elseif (left$(tempfilestr,10) = "WINTACHDIR") then
WINTACHDIR=right$(tempfilestr,( len(tempfilestr)-(10+1) ))
'pause ("WINTACHDIR = "+WINTACHDIR)
'end if
elseif (left$(tempfilestr,6) = "PPTDIR") then
PPTDIR=right$(tempfilestr,( len(tempfilestr)-(6+1) ))
'pause ("PPTDIR = "+PPTDIR)
'end if
elseif (left$(tempfilestr,7) = "AVIFILE") then
AVIFILE=right$(tempfilestr,( len(tempfilestr)-(7+1) ))
'pause ("AVIFILE = "+AVIFILE)
else
success=1
'unknown line
end if
'WINDIR="C:\windows\"
'MGADIR="\mga\cpanel\" ' temporary
'VIDDIR="\mga-demo\video\"
''THREEDDIR="\mga-demo\3ddemo\"
'THREEDDIR="\mga-demo\3d-demo\"
'WINTACHDIR="\mga-demo\wintach\"
'PPTDIR="\mga-demo\pptview\"
'AVIFILE="MGA-15.AVI"
success=0
return
' the following is a subroutine to check if the mode used is 640x480x16bit
checkifmodevalid:
success=1 'start by setting flag to error
'check if control center running
hwnd = WFndWndC("MGACTRL.EXE", NULL, FW_PART)
If WIsMinimized (hwnd) Then 'only continue if found
'Pause "MGA ctrl found, minimized"
sleep 1
filestr$ = MGADIR + "MGAPANEL.EXE"
'pause filestr$
xstartapp filestr$,""
sleep 1
hwnd = WFndWndC("MGA MILLENIUM CONTROL PANEL", NULL, FW_PART)
WSetActWnd hwnd
wreswnd hwnd ' bring up ctrl panel
sleep 1
'pause "everything ok so far"
if WOptionExists ("mode 1:") then
WOptionClick ("mode 1:")
xkey "tab"
xkey "enter"
WOptionClick ("640x480")
WOptionClick ("16-bit 65K colors")
WOptionClick ("3D Acceleration")
WButtonClick ("OK") ' confirm setup
WButtonClick ("OK") ' confirm to exit control panel
sleep 1
if WButtonExists ("Restart Windows", 1) then
abortcode=2
goto abortroutine
else
'pause "Mode seems OK" 'ctrl panel didnt ask to restart
success=0 'set flag to ok
end if
else
'pause "couldn't find mode 1" 'ctrl panel didnt run
end if
else
'pause "mga panel not run"
end if
return ' end of check-current-mode subroutine
' the following opens and minimizes the apps
openapps:
'pause "entering openapps"
success=1
'open Powerpoint viewer
filestr$=PPTDIR + "pptview.exe"
xstartapp filestr$, ""
textstr$=PPTDIR + "MGADEMO1.PPT"
xtext textstr$
xminwindow
sleep 1
'open MediaPlayer with AVI
filestr$ = windir + "mplayer.exe" + " " + VIDDIR + AVIFILE
xstartapp filestr$, ""
sleep 2
xctrl "w" ' combine windows
xminwindow
sleep 1
'open 3D demo
filestr$ = threeddir + "dyna3dw.exe" + " " + threeddir + "matrox.bin"
xstartapp filestr$, ""
sleep 1
xminwindow
'open Wintach
filestr$=WINTACHDIR + "wintach.exe"
xstartapp filestr$, ""
xminwindow
sleep 1
success=0
return
' video segment of loop
videortn:
success = 1
hwnd = WFndWndC(AVIFILE, NULL, FW_PART)
WSetActWnd hwnd
wreswnd hwnd
'sleep 1
xctrl "2" ' zoom by two
xctrl "F5" ' send MCI command string
xtext "set time format frames"
xkey "enter"
'WButtonClick "send"
if (AVIFILE = "MGA-30.AVI") then
xtext "play from 0 to 1800" ' string
else
xtext "play from 0 to 899"
endif
'WbuttonClick "send"
xkey "enter" ' execute
'xkey "enter" ' execute
WButtonClick "Close" ' close dialogue box
sleep 60
xctrl "F5" ' send MCI command string
xtext "stop" ' stop
xkey "enter" ' execute
WButtonClick "Close" ' close dialogue box
xminwindow
'sleep 1
success = 0
return
'end video segment
threedrtn:
success=1
hwnd = WFndWndC("3D Window", NULL, FW_PART)
WMaxWnd hwnd
sleep 1
WOptionClick "Zoom/Twist"
QueMouseClick VK_LBUTTON, 321, 414 ' click to enable rotation
QueFlush FALSE
for x=1 to 15 ' and zoom up
xkey "up"
next x
for x=1 to 90 ' twist
xkey "left"
next x
for x=1 to 5 ' zoom up
xkey "up"
next x
QueMouseClick VK_LBUTTON, 321, 414
QueFlush FALSE
WOptionClick "Rotation"
QueMouseClick VK_LBUTTON, 321, 414
QueFlush FALSE
for x=1 to 200
xkey "left"
next x
QueMouseClick VK_LBUTTON, 321, 414
QueFlush FALSE
wbuttonclick "cancel"
xminwindow
success=0
return
wintachrtn:
success = 1
hwnd = WFndWndC("WinTach", NULL, FW_PART)
WSetActWnd hwnd
wreswnd hwnd
sleep 1
xalt "s" 'bring up START BENCHMARK menu
xkey "w" ' do word proc. segment
if (wbuttonexists ("ok")) then
wbuttonclick "ok"
xalt"s"
xkey"w"
end if
'sleep 1
xkey "enter"
xalt "s" 'bring up START BENCHMARK menu
xkey "c" ' do CAD segment
'sleep 1
xkey "enter"
xalt "s" 'bring up START BENCHMARK menu
xkey "s" ' do spreadsheet segment
'sleep 1
xkey "enter"
xalt "s" 'bring up START BENCHMARK menu
xkey "p" ' do paint segment
'sleep 1
xkey "enter"
xminwindow
success = 0
return
checkexitkey:
return
abortroutine:
if (abortcode=1) then
abortstring="INI file not found, demo will exit."
elseif (abortcode=2) then
abortstring="A problem occurred reading INI file, demo will exit."
elseif (abortcode=3) then
abortstring="You must restart windows, and re-start the demo."
elseif (abortcode=4) then
abortstring="An error occured trying to open the applications."
elseif (abortcode=5) then
abortstring=" "
else
abortstring="an unknown error occured"
end if
' put up appropriate abort message
pause abortstring
STOP
' *** display status box ***
'message$ = "Initializing Windows World 95 Presentation Script"
'font$ = "MS sans serif"
'STATUSBOX message$, 0, 0, 0, 0, 1, 1, font$, 24, 500
'sleep 1