~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Open Mash Cross Reference
mash/tcl/mgamon/ui-asmon.tcl

Component: ~ [ mash ] ~ [ apps ] ~ [ gsm ] ~ [ lib ] ~ [ otcl ] ~ [ srm ] ~ [ tcl8.3 ] ~ [ tclcl ] ~ [ tk8.3 ] ~ [ tutorials ] ~

  1 # ui-asmon.tcl --
  2 #
  3 #       FIXME: This file needs a description here.
  4 #
  5 # Copyright (c) 1998-2002 The Regents of the University of California.
  6 # All rights reserved.
  7 #
  8 # Redistribution and use in source and binary forms, with or without
  9 # modification, are permitted provided that the following conditions are met:
 10 #
 11 # A. Redistributions of source code must retain the above copyright notice,
 12 #    this list of conditions and the following disclaimer.
 13 # B. Redistributions in binary form must reproduce the above copyright notice,
 14 #    this list of conditions and the following disclaimer in the documentation
 15 #    and/or other materials provided with the distribution.
 16 # C. Neither the names of the copyright holders nor the names of its
 17 #    contributors may be used to endorse or promote products derived from this
 18 #    software without specific prior written permission.
 19 #
 20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
 21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 23 # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
 24 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 25 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 26 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 27 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 28 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 30 #
 31 #  @(#) $Header: /usr/mash/src/repository/mash/mash-1/tcl/mgamon/ui-asmon.tcl,v 1.9 2002/02/03 04:27:48 lim Exp $
 32 
 33 
 34 import WidgetClass Icons VcrIcons ScrolledListbox SDPParser PaneManager
 35 
 36 WidgetClass ASMonitorUI -default {
 37         { *ScrolledListbox*Canvas.relief sunken }
 38         { *ScrolledListbox*Canvas.borderWidth 1 }
 39         { *ScrolledListbox.scrollbar both }
 40         { *ScrolledListbox.bbox.highlightThickness 1 }
 41         { *ScrolledListbox.Scrollbar.borderWidth 1 }
 42         { *ScrolledListbox.Scrollbar.borderWidth 1 }
 43         { *ScrolledListbox.Scrollbar.highlightThickness 1 }
 44         { *ScrolledListbox.Scrollbar.width 10 }
 45         { *ScrolledListbox*Canvas.width 170 }
 46         { *ScrolledListbox*Canvas.height 140 }
 47         { *HierarchicalListboxItem.borderWidth 1 }
 48         { *HierarchicalListboxItem*font WidgetDefault(-boldfont) }
 49         { *Button.borderWidth 1 }
 50         { *Button.pady 0 }
 51 }
 52 
 53 
 54 ASMonitorUI proc.invoke {} {
 55         $self instvar atype_map_ atype_clr_
 56         set atype_map_(hm) "Host Managers"
 57         set atype_map_(srv) "Servents"
 58         set atype_map_(client) "Clients"
 59         set atype_map_(all) "All Agents"
 60 
 61         set atype_clr_(hm) blue
 62         set atype_clr_(srv) red
 63         set atype_clr_(client) darkgreen
 64         set atype_clr_(all) black
 65 }
 66 
 67 ASMonitorUI public destroy {} {
 68         $self instvar sdp_ agent_info_ agent_list_ paneMgr_
 69         delete $sdp_
 70 
 71         foreach name [array names agent_info_] {
 72                 delete $agent_info_($name)
 73         }
 74 
 75         foreach name [array names agent_list_] {
 76                 delete $agent_list_($name)
 77         }
 78 
 79         delete $paneMgr_(1)
 80         delete $paneMgr_(2)
 81         $self next
 82 }
 83 
 84 
 85 ASMonitorUI public build_widget {path} {
 86         $self instvar sdp_
 87         set sdp_ [new SDPParser]
 88 
 89         global mash
 90         set toplevel [winfo toplevel $path]
 91         wm title $toplevel "Active Service Monitor v$mash(version)"
 92         frame $path.bottom
 93         label $path.asctrl -text "Control Address: [$self get_option asCtrl]"\
 94                         -anchor w
 95         button $path.quit -text "Quit" -command "exit" -font \
 96                         [WidgetClass widget_default -boldfont]
 97         pack $path.asctrl -fill both -expand 1 -anchor w -side left \
 98                         -in $path.bottom
 99         pack $path.quit -fill y -anchor w -side left -in $path.bottom
100         pack $path.bottom -side bottom -fill x
101 
102         frame $path.encloser
103         frame $path.left_encloser
104         ASInfoWindow $path.default_info -relief sunken -borderwidth 1 \
105                         -width 200
106         pack $path.default_info -fill both -expand 1 -side right
107 
108         frame $path.lb_frame
109         ScrolledListbox $path.agenttypes -itemclass HierarchicalListboxItem \
110                         -browsecmd "$self select_agent_list"
111         #pack $path.agenttypes -fill both -expand 1 -side top \
112         #               -in $path.left_frame
113 
114         label $path.death_label -text "Send death packet to:" -anchor w
115         button $path.death -text "All Agents" -command \
116                         "$self send_death_pkt" -anchor w
117         pack $path.death_label -fill x -side top -anchor w -in $path.lb_frame
118         pack $path.death -fill x -side top -in $path.lb_frame
119 
120         frame $path.frame
121         pack $path.frame -fill both -expand 1 -side top -in $path.lb_frame
122 
123         $path.left_encloser configure -width 195 -height 320
124         $self set paneMgr_(1) [new PaneManager $path.agenttypes \
125                         $path.lb_frame -in $path.left_encloser \
126                         -orient vertical -percent 0.4]
127 
128         #set w [expr [winfo reqwidth $path.left_frame] + \
129         #               [winfo reqheight $path.default_info] + 4]
130         #set h [expr [winfo reqheight $path.left_frame]]
131         $path.encloser configure -width 400 -height 320
132 
133         pack $path.encloser -side top -fill both -expand 1
134         $self set paneMgr_(2) [new PaneManager $path.left_encloser \
135                         $path.default_info -in $path.encloser \
136                         -orient horizontal -percent 0.4]
137         $self agent_list hm ""
138         $self agent_list srv ""
139         $self agent_list client ""
140         $self agent_list all ""
141 
142         $self instvar agentlists_
143         $agentlists_(all) browse_me
144         $path.agenttypes selection set -id all
145 
146         set o [$self get_option doLog]
147         if { $o != "" } {
148                 $self instvar log_
149                 foreach a [split $o :] {
150                         set log_($a) 1
151                 }
152         }
153 }
154 
155 
156 ASMonitorUI public application {a} {
157         $self set appl_ $a
158 }
159 
160 
161 ASMonitorUI private send_death_pkt {} {
162         $self instvar appl_
163 
164         set l [$self info path].agenttypes
165         set sel [lindex [$l selection get] 0]
166         if {$sel != {}} {
167                 set sel [split $sel ,]
168                 set atype [lindex $sel 0]
169                 set srv_name [lindex $sel 1]
170 
171                 if { $atype != "client" } {
172                         if { [string match "MeGa*" $srv_name] } {
173                                 set srv_name [string range $srv_name 6 end]
174                                 $appl_ build_death $srv_name
175                         } elseif { $atype=="srv" } {
176                                 if { $srv_name!="" } {
177                                         $appl_ build_death srv
178                                 } else {
179                                         foreach m {audio video sdp mb srv} {
180                                                 $appl_ build_death $m
181                                         }
182                                 }
183                         } elseif { $atype=="hm" } {
184                                 $appl_ build_death hm
185                         } elseif { $atype=="all" } {
186                                 foreach m {audio video sdp mb hm srv} {
187                                         $appl_ build_death $m
188                                 }
189                         }
190                 }
191         }
192 }
193 
194 
195 ASMonitorUI private select_agent_list {id} {
196         $self instvar agentlists_
197         if [info exists agentlists_($id)] {
198                 $agentlists_($id) browse_me
199         }
200 
201         # update the death button
202         set button [$self subwidget death]
203         if [string match "client*" $id] {
204                 # disable the death button
205                 $button configure -state disabled -text "Client"
206         } else {
207                 switch -exact -- $id {
208                         hm { set text "All Host Managers" }
209                         srv { set text "All Servents" }
210                         all { set text "All Agents" }
211                         default {
212                                 if [string match "srv,MeGa: *" $id] {
213                                         set text [string tolower [string range\
214                                                         $id 10 end]]
215                                         set text "[string toupper [string \
216                                                         index $text 0]][string\
217                                                         range $text 1 end]\
218                                                         Agents"
219                                 } else {
220                                         set text "All Non-MeGa Agents"
221                                 }
222                         }
223                 }
224                 $button configure -state normal -text $text
225         }
226 }
227 
228 
229 ASMonitorUI public recv_msg {atype aspec addr srv_name srv_loc srv_inst \
230                 ssg_port agent_data delta} {
231         $self instvar sdp_
232         if {$srv_name=="MeGa"} {
233                 set sdp [$sdp_ parse $agent_data]
234                 set media [lindex [$sdp set allmedia_] 0]
235                 if { $media == "" } {return}
236                 set qualified_srv_name "$srv_name: [$media set mediatype_]"
237         } else {
238                 set qualified_srv_name $srv_name
239                 set sdp ""
240         }
241 
242         set a [$self agent_info $aspec $atype $qualified_srv_name]
243         $a update $atype $aspec $addr $qualified_srv_name $srv_loc $srv_inst \
244                         $ssg_port $agent_data $sdp $delta
245         if {$srv_name=="MeGa"} {
246                 delete $sdp
247         }
248 }
249 
250 
251 ASMonitorUI public register {atype aspec addr srv_name srv_inst agent_data} {
252         $self recv_msg $atype $aspec $addr $srv_name "" $srv_inst - \
253                         $agent_data ""
254         $self instvar log_
255         if [info exists log_($atype)] {
256                 puts "register: [gettimeofday] + $aspec $atype\
257                                 $qualified_srv_name $addr"
258         }
259 }
260 
261 
262 ASMonitorUI public unregister {atype aspec addr srv_name srv_inst agent_data} {
263         $self instvar sdp_
264         if {$srv_name=="MeGa"} {
265                 set agent_data [$sdp_ parse $agent_data]
266                 set media [lindex [$agent_data set allmedia_] 0]
267                 if { $media == "" } {
268                         delete $agent_data
269                         return
270                 }
271                 append srv_name ": [$media set mediatype_]"
272                 delete $agent_data
273         }
274 
275         set a [$self agent_info $aspec $atype $srv_name]
276         delete $a
277 
278         $self instvar log_
279         if [info exists log_($atype)] {
280                 puts "unregister: [gettimeofday] + $aspec $atype\
281                                 $srv_name $addr"
282         }
283 }
284 
285 
286 ASMonitorUI public agent_info {aspec atype srv_name} {
287         $self instvar agent_info_
288         if ![info exists agent_info_($aspec)] {
289                 set agent_info_($aspec) [new ASAgentInfo $self $aspec $atype \
290                                 $srv_name]
291         }
292         return $agent_info_($aspec)
293 }
294 
295 
296 ASMonitorUI public agent_list {atype srv_name} {
297         $self instvar agent_list_
298 
299         if ![info exists agent_list_($atype,$srv_name)] {
300                 set agent_list_($atype,$srv_name) [new ASAgentList $self \
301                                 $atype $srv_name]
302         }
303 
304         return $agent_list_($atype,$srv_name)
305 }
306 
307 
308 Class ASAgentInfo
309 
310 ASAgentInfo public init {ui aspec atype srv_name} {
311         $self next
312         $self instvar name_ ui_ windows_
313 
314         ASMonitorUI instvar atype_clr_
315         set windows_ {}
316         set ui_ $ui
317         set name_(aspec) $aspec
318         set name_(atype) $atype
319         set name_(srv_name) $srv_name
320         set list [$ui agent_list $atype $srv_name]
321         $list insert $self $aspec $atype_clr_($atype)
322 
323         set glist [$ui agent_list $atype ""]
324         if { $glist != $list } {
325                 $glist insert $self "$srv_name: $aspec" $atype_clr_($atype)
326         }
327 
328         set glist [$ui agent_list all ""]
329         if { $srv_name!={} } {
330                 set label "${srv_name}($atype): $aspec"
331         } else { set label "$atype: $aspec" }
332         $glist insert $self $label $atype_clr_($atype)
333 
334         # if no agent has been selected, select this one for detailed info
335         if { [$ui_ subwidget default_info current]=={} } {
336                 $glist browse_agent $self
337         }
338 }
339 
340 
341 ASAgentInfo public destroy {} {
342         $self instvar ui_ name_ windows_ name_
343 
344         if { [lsearch $windows_ [$ui_ subwidget default_info info self]]!=-1} {
345                 $ui_ subwidget default_info attach {}
346         }
347 
348         set list [$ui_ agent_list $name_(atype) $name_(srv_name)]
349         $list delete $self
350 
351         if { $name_(srv_name)!={} } {
352                 if [$list is_empty] {
353                         delete $list
354                 }
355         }
356 
357         set glist [$ui_ agent_list $name_(atype) ""]
358         if { $glist != $list } {
359                 $glist delete $self
360         }
361 
362         set glist [$ui_ agent_list all ""]
363         $glist delete $self
364 
365         $ui_ instvar agent_info_
366         unset agent_info_($name_(aspec))
367 
368         $self next
369 }
370 
371 
372 ASAgentInfo public attach {window} {
373         $self instvar windows_
374         lappend windows_ $window
375 }
376 
377 
378 ASAgentInfo public detach {window} {
379         $self instvar windows_
380         set idx [lsearch -exact $windows_ $window]
381         if { $idx!=-1 } { set windows_ [lreplace $windows_ $idx $idx] }
382 }
383 
384 
385 ASAgentInfo public update {atype aspec addr srv_name srv_loc srv_inst ssg_port\
386                 agent_data sdp delta} {
387         $self instvar fields_ prv_fields_
388 
389         # don't change atype aspec and srv_name
390         set fields_(srv_loc) $srv_loc
391         set fields_(srv_inst) $srv_inst
392         set fields_(ssg_port) $ssg_port
393         set fields_(agent_data) $agent_data
394         set fields_(delta) $delta
395         set fields_(last_heard) [gettimeofday ascii]
396         set fields_(heard_from) $addr
397 
398         if { $sdp=={} } {
399                 set fields_(sdp) 0
400         } else {
401                 set fields_(sdp) 1
402 
403                 if { $atype=="srv" } {
404                         set prv_fields_(o) [join [$sdp field_value o] :]
405                         set prv_fields_(s) [join [$sdp field_value s] :]
406                         set prv_fields_(toolname) [$sdp attr_value tool]
407 
408                         set prv_fields_(sessions) ""
409                         foreach media [$sdp set allmedia_] {
410                                 set tmp [split [$media set caddr_] /]
411                                 set caddr [lindex $tmp 0]/[$media set \
412                                                 port_]/[lindex $tmp 1]
413                                 append prv_fields_(sessions) "\n$caddr"
414                         }
415                         set prv_fields_(sessions) [string range \
416                                         $prv_fields_(sessions) 1 end]
417                 } elseif { $atype=="client" } {
418                         set prv_fields_(o) [join [$sdp field_value o] :]
419                         set prv_fields_(s) [join [$sdp field_value s] :]
420                         set prv_fields_(toolname) [$sdp attr_value tool]
421                         set prv_fields_(global) [$sdp set caddr_]
422                         set prv_fields_(local) [[$sdp set allmedia_] set \
423                                         caddr_]
424 
425                         set prv_fields_(bw) ""
426                         if [$sdp have_field b] {
427                                 set bwval [$sdp set bwval_]
428                                 set bwval [$self format_bps $bwval]
429                                 set prv_fields_(bw) $bwval
430                         }
431                 }
432         }
433 
434         $self instvar windows_
435         foreach w $windows_ {
436                 $w update
437         }
438 }
439 
440 
441 ASAgentInfo private format_bps b {
442         set bps $b
443         if { $bps < 1 } {
444                 set bps "0 bps"
445         } elseif { $bps < 1000 } {
446                 set bps [format "%3.0f bps" $bps]
447         } elseif { $bps < 1000000 } {
448                 set bps [format "%3.0f kb/s" [expr $bps / 1000.]]
449         } else {
450                 set bps [format "%.1f Mb/s" [expr $bps / 1000000.]]
451         }
452         return $bps
453 }
454 
455 
456 Class ASAgentList
457 ASAgentList public init {ui atype srv_name} {
458         $self next
459         $self instvar widget_ ui_ agentlists_id_
460         $ui instvar agentlists_
461 
462         set n [ASMonitorUI set atype_map_($atype)]
463         set clr [ASMonitorUI set atype_clr_($atype)]
464         if { $srv_name != "" } {
465                 append n "/$srv_name"
466                 $ui subwidget agenttypes insert after -id $atype \
467                                 [list -id $atype,$srv_name {} $n]
468                 set agentlists_($atype,$srv_name) $self
469                 set agentlists_id_ $atype,$srv_name
470         } else {
471                 $ui subwidget agenttypes insert end [list -id $atype \
472                                 Icons(minimize) $n]
473                 set agentlists_($atype) $self
474                 set agentlists_id_ $atype
475         }
476         set w [$ui subwidget agenttypes info widget -id $agentlists_id_]
477         $w configure -normalforeground $clr -selectforeground $clr
478 
479         set ui_ $ui
480         option add *agentlist$self*borderWidth 1
481         #option add *agentlist$self*font [WidgetClass widget_default -font]
482         set widget_ [ScrolledListbox [$ui info path].agentlist$self -options \
483                         { { bbox.height 140 } } \
484                         -browsecmd "$self browse_agent" \
485                         -command "$self browse_agent_new_window"]
486 }
487 
488 
489 ASAgentList public destroy {} {
490         $self instvar ui_ agentlists_id_
491         $ui_ instvar agent_list_
492         unset agent_list_($agentlists_id_)
493 
494         $ui_ subwidget agenttypes delete -id $agentlists_id_
495         $self next
496 }
497 
498 
499 ASAgentList public insert {info label clr} {
500         $self instvar widget_
501         $widget_ insert end "-id $info $label"
502         set w [$widget_ info widget -id $info]
503         $w configure -normalforeground $clr -selectforeground $clr
504 }
505 
506 
507 ASAgentList public delete {info} {
508         $self instvar widget_
509         $widget_ delete -id $info
510 }
511 
512 
513 ASAgentList public is_empty {} {
514         $self instvar widget_
515         if { [$widget_ info numelems] <= 0 } { return 1 } else { return 0 }
516 }
517 
518 
519 ASAgentList public browse_me { } {
520         $self instvar ui_ widget_
521         pack forget [pack slaves [$ui_ info path].frame]
522         pack $widget_ -in [$ui_ info path].frame -fill both -expand 1
523 
524         if { [$widget_ info numelems] > 0 } {
525                 $self browse_agent [$widget_ info id 0]
526         }
527 }
528 
529 
530 ASAgentList public browse_agent {id} {
531         $self instvar widget_ ui_
532         if { [lindex [$widget_ selection get] 0] != $id } {
533                 $widget_ selection set -id $id
534         }
535 
536         $ui_ subwidget default_info attach $id $self
537 }
538 
539 
540 ASAgentList public browse_agent_new_window {id} {
541         $self instvar widget_
542 
543         # create a new toplevel only if one doesn't already exist
544         set w .agent_info_$id
545         if [winfo exists $w] {
546                 wm deiconify $w
547                 return
548         }
549 
550         $id instvar name_
551         toplevel $w
552         wm title $w "Agent Info: $name_(aspec) ($name_(atype):\
553                         $name_(srv_name))"
554         ASInfoWindow $w.info
555         pack $w.info -side top -fill both -expand 1
556         button $w.dismiss -bd 1 -pady 0 -text "Dismiss" \
557                         -command "destroy $w"
558         pack $w.dismiss -side right
559         $w.info attach $id
560         after "2000" delete $id
561 }
562 
563 
564 WidgetClass ASInfoWindow -default {
565         { *ScrolledWindow*Canvas.width 200 }
566         { *ScrolledWindow.scrollbar both }
567         { *ScrolledWindow.bbox.highlightThickness 1 }
568         { *ScrolledWindow.Scrollbar.borderWidth 1 }
569         { *ScrolledWindow.Scrollbar.borderWidth 1 }
570         { *ScrolledWindow.Scrollbar.highlightThickness 1 }
571         { *ScrolledWindow.Scrollbar.width 10 }
572 }
573 
574 
575 ASInfoWindow proc.invoke {} {
576         $self instvar labels_
577         set labels_(srv_loc)      "Service location"
578         set labels_(srv_inst)     "Service instance"
579         set labels_(ssg_port)     "SSG port"
580         set labels_(last_heard)   "Last heard"
581         set labels_(heard_from)   "Heard from"
582         set labels_(delta)        "Delta"
583         set labels_(agent_data)   "Agent data"
584         set labels_(o)            "Agent ID"
585         set labels_(s)            "Session ID"
586         set labels_(toolname)     "Tool"
587         set labels_(sessions)     "Sessions"
588         set labels_(global)       "Global addr"
589         set labels_(local)        "Local addr"
590         set labels_(bw)           "Bandwidth"
591 }
592 
593 
594 ASInfoWindow public build_widget path {
595         ScrolledWindow $path.scroll
596         pack $path.scroll -fill both -expand 1
597 
598         set path [$path.scroll subwidget window]
599         label $path.name -bd 1 -relief sunken -anchor w -foreground \
600                         [WidgetClass widget_default -disabledforeground] \
601                         -text "No agent exists"
602         pack $path.name -fill x -side top
603         frame $path.labels
604         frame $path.values
605 
606         $self create_label srv_loc
607         $self create_label srv_inst
608         $self create_label ssg_port
609         $self create_label last_heard
610         $self create_label heard_from
611         $self create_label delta
612         $self create_label agent_data
613 
614         pack $path.labels -side left -anchor n
615         pack $path.values -fill x -expand 1 -side left -anchor n
616 }
617 
618 
619 ASInfoWindow public destroy {} {
620         $self instvar obj_
621         if {[info exists obj_] && [ASAgentInfo info instances $obj_]==$obj_} {
622                 $obj_ detach $self
623         }
624         $self next
625 }
626 
627 
628 ASInfoWindow public create_label { name {after_id {}} } {
629         ASInfoWindow instvar labels_
630         set path [[$self info path].scroll subwidget window]
631         label $path.labels.$name -text "$labels_($name):" -anchor w \
632                         -justify left -font [WidgetClass widget_default -font]
633         label $path.$name -anchor w -justify left \
634                         -font [WidgetClass widget_default -font]
635         if { $after_id=={} } {
636                 pack $path.labels.$name -fill x -anchor n -expand 1
637                 pack $path.$name -in $path.values -fill x -anchor n -expand 1
638         } else {
639                 pack $path.labels.$name -fill x -anchor n -expand 1 \
640                                 -before $path.labels.$after_id
641                 pack $path.$name -in $path.values -fill x -anchor n -expand 1\
642                                 -before $path.$after_id
643         }
644 }
645 
646 
647 ASInfoWindow public current {} {
648         $self instvar obj_
649         if [info exists obj_] { return $obj_ }  else { return {} }
650 }
651 
652 
653 ASInfoWindow public attach {obj {list {}}} {
654         $self instvar obj_ list_
655         if { [info exists list_] && $list_!={} && ($list_!=$list || \
656                         $obj_!=$obj) } {
657                 if { $list_!=$list } { [$list_ set widget_] selection clear }
658 
659                 $obj_ instvar prv_fields_
660                 set path [[$self info path].scroll subwidget window]
661                 foreach name [array names prv_fields_] {
662                         if [winfo exists $path.$name] {
663                                 destroy $path.labels.$name
664                                 destroy $path.$name
665                         }
666                 }
667         }
668         if [info exists obj_] { $obj_ detach $self }
669 
670         if { $obj=={} } {
671                 set path [[$self info path].scroll subwidget window]
672                 $path.name configure -text "No agent exists" -foreground \
673                                 [WidgetClass widget_default \
674                                 -disabledforeground]
675                 $obj_ instvar fields_
676                 foreach name  [array names fields_] {
677                         if [winfo exists $path.$name] {
678                                 $path.$name configure -text ""
679                         }
680                 }
681                 unset obj_
682                 unset list_
683         } else {
684                 $obj attach $self
685                 set obj_ $obj
686                 set list_ $list
687 
688                 $self update
689         }
690 }
691 
692 
693 ASInfoWindow public update {} {
694         $self instvar obj_
695         $obj_ instvar name_ fields_ prv_fields_
696 
697         set path [$self info path]
698         set path [$path.scroll subwidget window]
699         if { $name_(srv_name)!={} } {
700                 set text "$name_(srv_name)($name_(atype)): $name_(aspec)"
701         } else {
702                 set text "$name_(atype): $name_(aspec)"
703         }
704         $path.name configure -text $text -foreground \
705                         [ASMonitorUI set atype_clr_($name_(atype))]
706         foreach name [array names fields_] {
707                 if [winfo exists $path.$name] {
708                         $path.$name configure -text $fields_($name)
709                 }
710         }
711 
712         foreach name [array names prv_fields_] {
713                 if ![winfo exists $path.$name] {
714                         $self create_label $name delta
715                 }
716                 $path.$name configure -text $prv_fields_($name)
717         }
718 }
719 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.