home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / maths / plplot / plplot_2 / drivers / tk / plclient.t < prev    next >
Encoding:
Text File  |  1994-06-09  |  3.4 KB  |  112 lines

  1. # $Id: plclient.tcl,v 1.4 1994/06/09 20:07:54 mjl Exp $
  2. # $Log: plclient.tcl,v $
  3. # Revision 1.4  1994/06/09  20:07:54  mjl
  4. # Eliminated references to a plw_init_proc, now obsolete.
  5. #
  6. # Revision 1.3  1994/02/07  22:52:38  mjl
  7. # Removed references to plw_flash (no longer invoked from client side).
  8. #
  9. # Revision 1.2  1994/01/17  21:30:23  mjl
  10. # Improved security for Tcl-DP communication by disabling any further
  11. # connections after the initial client/server handshaking is finished.
  12. #
  13. # Revision 1.1  1994/01/15  17:36:03  mjl
  14. # Added to hold client side initialization procs.
  15. #
  16. #----------------------------------------------------------------------------
  17. # PLPLOT TK/TCL graphics client procs
  18. # Maurice LeBrun
  19. # 14-Jan-1994
  20. # IFS, University of Texas at Austin
  21. #
  22. # These are customizable (since autoloaded) initialization procs for the
  23. # TK driver.  At present you should be very careful what you change,
  24. # however, since this stuff is still evolving.
  25. #----------------------------------------------------------------------------
  26.  
  27. #----------------------------------------------------------------------------
  28. # plclient_init
  29. #
  30. # Initializes variables for plplot/TK/DP driver.
  31. # These variables determine what plserver procs are invoked by the driver
  32. # to do various jobs.  Specifically, they are:
  33. #
  34. # plserver_init_proc    proc to initialize plserver
  35. # plw_create_proc    proc to create the plframe widget
  36. # plw_start_proc    proc to manage the plframe widget
  37. # plw_flash_proc    proc to handle end of page condition
  38. # plw_end_proc        proc to detach the plframe widget from the client 
  39. #----------------------------------------------------------------------------
  40.  
  41. proc plclient_init {} {
  42.  
  43.     global plserver_init_proc plw_create_proc \
  44.     plw_start_proc plw_end_proc \
  45.     dp client_host client_port update_proc
  46.  
  47. # This initializes plserver
  48.  
  49.     set plserver_init_proc    plserver_init
  50.  
  51. # These govern the plframe and associated widgets
  52.  
  53.     set plw_create_proc        plw_create
  54.     set plw_start_proc        plw_start
  55.     set plw_end_proc         plw_end
  56.  
  57. # Set up communications port and other junk
  58.  
  59.     if { $dp } {
  60.     set client_host [host_id]
  61.     set client_port [dp_MakeRPCServer]
  62.     set update_proc dp_update
  63.  
  64.     } else {
  65.     set update_proc update
  66.     }
  67. }
  68.  
  69. #----------------------------------------------------------------------------
  70. # plclient_link_init
  71. #
  72. # Initializes link to plserver assuming plserver already exists.
  73. # Basically this means just sending info on the communications channel.
  74. #----------------------------------------------------------------------------
  75.  
  76. proc plclient_link_init {} {
  77.     global dp server client
  78.  
  79.     if { $dp } {
  80.     global client_host client_port
  81.  
  82.     dp_RDO $server set client_host $client_host
  83.     dp_RDO $server set client_port $client_port
  84.  
  85.     } else {
  86.     global client_name
  87.  
  88.     send [list $server] "after 1 set client_name [list $client_name]"
  89.     }
  90.  
  91.     wait_until {[info exists client]}
  92. }
  93.  
  94. #----------------------------------------------------------------------------
  95. # plclient_dp_init
  96. #
  97. # Initializes dp data link.
  98. # In addition, as this is the last client/server connection needed, I
  99. # disable further connections.
  100. #----------------------------------------------------------------------------
  101.  
  102. proc plclient_dp_init {} {
  103.     global server server_host plwindow client data_port data_sock 
  104.  
  105.     dp_RDO $server plw_dplink $plwindow $client
  106.  
  107.     wait_until {[info exists data_port]}
  108.     set data_sock [lindex [dp_connect $server_host $data_port] 0]
  109.  
  110.     dp_Host -
  111. }
  112.