- Timestamp:
- Mar 6, 2008 2:23:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/visviewer.tcl
r924 r925 39 39 } 40 40 # Used internally only. 41 private method _CheckNameList {namelist}42 41 private method _Shuffle { hostlist } 43 42 private method _ReceiveHelper {} … … 45 44 private method _SendHelper {} 46 45 47 protected method SendEcho { channel {data ""}}48 protected method ReceiveEcho { channel {data ""}}46 protected method SendEcho { channel {data ""} } 47 protected method ReceiveEcho { channel {data ""} } 49 48 protected method Connect { hostlist } 50 49 protected method Disconnect {} … … 53 52 protected method ReceiveBytes { nbytes } 54 53 protected method Flush {} 55 protected method Color2RGB {color} 56 protected method Euler2XYZ {theta phi psi} 57 58 public proc SetPymolServerList {namelist} { 59 _CheckNameList $namelist 60 set _servers(pymol) $namelist 61 } 62 public proc SetNanovisServerList {namelist} { 63 _CheckNameList $namelist 64 set _servers(nanovis) $namelist 65 } 66 public proc SetServerList {tag namelist} { 54 protected method Color2RGB { color } 55 protected method Euler2XYZ { theta phi psi } 56 57 private proc _CheckNameList { namelist } { 58 set pattern {^[a-zA-Z0-9\.]+:[0-9]+(,[a-zA-Z0-9\.]+:[0-9]+)*$} 59 if { ![regexp $pattern $namelist match] } { 60 error "bad visualization server address \"$namelist\": should be host:port,host:port,..." 61 } 62 } 63 public proc GetServerList { tag } { 64 return $_servers($tag) 65 } 66 public proc SetServerList { tag namelist } { 67 67 _CheckNameList $namelist 68 68 set _servers($tag) $namelist 69 69 } 70 public proc GetServerList { tag } { 71 return $_servers($tag) 70 public proc SetPymolServerList { namelist } { 71 SetServerList "pymol" $namelist 72 } 73 public proc SetNanovisServerList { namelist } { 74 SetServerList "nanovis" $namelist 72 75 } 73 76 } … … 154 157 } 155 158 return $random_hosts 156 }157 158 #159 # _CheckNameList --160 #161 # Used within the class to check if provide list of hostname:port are162 # correct. Return an error if the list is invalid.163 #164 itcl::body Rappture::VisViewer::_CheckNameList { namelist } {165 set pattern {^[a-zA-Z0-9\.]+:[0-9]+(,[a-zA-Z0-9\.]+:[0-9]+)*$}166 if { ![regexp $pattern $namelist match] } {167 error "bad visualization server address \"$namelist\": should be host:port,host:port,..."168 }169 159 } 170 160
Note: See TracChangeset
for help on using the changeset viewer.