
Rebuilding the Demo Host Software
A-10
print;" and print() is a built-in function, the message appears. If
"var debugFxn = function() {}", all calls to debugFxn() are silent.
The global variables "rpc" and "fileio" are for target
communication. The global variables "display" and "shell" refer to
the system screen and the application's window. These are set
to null and will be initialized in main().
The variable "myWidgets" is a hash-table—an array whose
elements are accessed by name instead of by index—that is
initially empty. It is later filled with references to various screen
controls. For example, we will read what the user types in the
"txtIP1" box—the box with the first part of the target IP address—
by calling "myWidgets["txtIP1"].getText();". Or, we can find out
whether the user selected the "Encode" video mode with "if
(myWidgets["radioEncode"].getSelection() == true)".
3) The final outside-any-function statement executed by the Main.js
script is main(), which calls the function main() defined below. In
JavaScript, a variable or function is in scope if it is defined anywhere
in the scope; it does not have to be defined before it is referenced.
The main() function first creates an Rpc object from the Rpc.js
module. After the "rpc" variable is initialized, any function in the
script can connect or send a message to the target, like
"rpc.connect( "168.123.012.99" )" or "rpc.controlPlay()".
The main() function creates a similar "fileio" variable for a fileio
object from the Fileio.js module. For details about the Rpc and
Fileio APIs, refer to their scripts.
The main() function next creates a "display" and a "shell",
initializing these global variables. The "display" is the whole
screen; the "shell" is where buttons and other widgets are drawn.
The main() function then calls the layoutWidgets() function to
draws the widgets.
The main() function then calls the setEventListeners() function to
assign "event listener" functions to be called when a button is
pressed.
The main() function calls a function to gray out everything except
the "connect" button's area, because the application has just
started and is not yet connected.
The main() function then runs a standard loop for SWT GUI
programs that refreshes the screen and calls event functions
when a button click (or some other widget event) occurs, leaving
the loop only when the user closes the main window.
Содержание TMS320DM6437
Страница 1: ...TMS320DM6437 DVDP Getting Started Guide Literature Number SPRUEV6 July 2007 ...
Страница 20: ...2 8 ...
Страница 34: ...3 14 ...
Страница 40: ...4 6 ...
Страница 63: ......
Страница 64: ...Spectrum Digital Inc 509108 0001B ...