linux - Updating a label from a thread in Perl -
I am using Perl on a Linux box, and I have 2 devices - a PC (Linux box) and a router.
/ dsl-thingy - on my local net at IP address 192.168.1.1 & amp; 192.168.1.2 and trying to show or show the progress of ping + The code below is not tested for any other 8 existing devices, but updating my stats, there is a problem with any help ...
For ($ i = 1; $ i & lt; = 10; ++ $ i) {# --- $ i & lt; $ VarClients --- 254 My $ thr_List = ("Ping $ i"); $ Thr_List = Thread-> Create (& amp; pingingthreads, "$ i"); } Sub Pingthreads {my @pingpong = ping ("$ localAddress $ i", '-c 1', '-i.2'); Can not count more for # -i? Print "Pinging: $ local address $ i \ n"; # Output Address 1 - Address 10 is OK $ Stat Lababel = "Pinging: $ Local Address $ i"; # Only the last responder (device) is showing in my statsbase?! $ Val = ($ val + 10); # 0.392156863 Print "$ val \% done ... \ n"; # Goes to 100% up to me OK # $ indicator bar- & gt; Value ($ val); # I have a progression and it stops at 20% even if ($ val == 100) {$ val = 0; } # After scanning # after resetting # after the last ping, update status: #my @ParamList = ('some', 'test', 7, 8, 9); # $ Thr5 = Threads-> Create (& amp; Update Status Controller, @Permlist); # Start a thread within a thread ??? #Ping Response for text ... (@IngPong) {# No need to respond to anyone; Client & amp; Any time lap / ping latency ..., or *** ??? $ Pong = $ _; Cutting ($ pong); # Get rid of trailing \ n ?? If ($ Pong = ~ 1/1 packet transmitted, 1 received, 0% packet loss /) {Push (@boxas, "$ local address $ i"); } And {# See other lines from the output of ping # print "$ pong \ n"; }}} $ Local $ $ i icmp_seq = 1 for destination host unknowable ??? --------------------- # Statusbar / Progress label & amp; Bar ---------------- My $ sb = $ main- & gt; Statusbar (); $ Sb- & gt; Ad Label (-activable = & gt; \ $ status label, -relue = & gt; 'flat', -font = & gt; $ font, -documentation = & gt; "$ statusbartextColour",); My $ indicatorbar = $ sb- & gt; Progress Bar (-PDX = & gt; 2, -pady = & gt; 2, -borderwidth = & gt; 2, -ru color = & gt; "$ COLOR2", -colors = & gt; [0, "$ index "], -long => 106, -relief => 'flat', -value = & gt;" $ val ",) - & gt; Pack; # $ Val = 0; # $ Indicator bar- & gt; Value ($ val); ===================================== My $ position label: share = (); My $ val: share = (0); For the progress bar value, # var I uploaded my full code here (http://cid-99cdb89630050fff.office.live.com/browse.aspx/.Public) if necessary If so, then its boxy.zip ...
You do not do that GUI structure is not ThreadSafe Are there. You communicate that information in that thread, which is run instead of the GUI.
Comments
Post a Comment