Go Back   FlashFXP Forums > > > >

NeoXed's scripts nxAutoNuke, nxTools, etc.

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-10-2006, 10:10 AM   #1
snatsert
Member
ioFTPD Foundation User
 
Join Date: Mar 2003
Posts: 61
Default changing speeds output

is it possible to change the speedoutput in mbit/sec instead of mbyte/sec ?
snatsert is offline   Reply With Quote
Old 04-11-2006, 05:18 PM   #2
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

You would have to edit the FormatSpeed procedure in nxLib.tcl.

I will not add support for this because it is inconsistent with ioFTPD's behavior. ioFTPD displays all speeds in bytes per second (rather than bits), so it would be logical for all scripts to do the same.
neoxed is offline   Reply With Quote
Old 04-12-2006, 12:38 PM   #3
snatsert
Member
ioFTPD Foundation User
 
Join Date: Mar 2003
Posts: 61
Default

Quote:
Originally Posted by neoxed
You would have to edit the FormatSpeed procedure in nxLib.tcl.

I will not add support for this because it is inconsistent with ioFTPD's behavior. ioFTPD displays all speeds in bytes per second (rather than bits), so it would be logical for all scripts to do the same.

someting in this part ??

proc ::nxLib::FormatSpeed {speed {seconds 0}} {
if {$seconds > 0} {set speed [expr {double($speed) / $seconds}]}
foreach decimals {0 2 2} unit {KB/s MB/s GB/s} {
if {abs($speed) < 1024} {break}
set speed [expr {double($speed) / 1024.0}]
}
return [format "%.*f%s" $decimals $speed $unit]

can you tell me what I excactly should change ?

thnx
snatsert is offline   Reply With Quote
Old 04-12-2006, 02:54 PM   #4
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

By converting the speed value from bytes to bits (multiply by 8).

Code:
proc ::nxLib::FormatSpeed {speed {seconds 0}} {
    set speed [expr {double($speed) * 8}]
    if {$seconds > 0} {set speed [expr {double($speed) / $seconds}]}
    foreach decimals {0 2 2} unit {Kb/s Mb/s Gb/s} {
        if {abs($speed) < 1024} {break}
        set speed [expr {double($speed) / 1024.0}]
    }
    return [format "%.*f%s" $decimals $speed $unit]
}
neoxed is offline   Reply With Quote
Old 04-13-2006, 12:23 PM   #5
snatsert
Member
ioFTPD Foundation User
 
Join Date: Mar 2003
Posts: 61
Default

I have edited like what you replied .. but doen't work
snatsert is offline   Reply With Quote
Old 04-13-2006, 02:37 PM   #6
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

And what the hell does "doesn't work" mean?

ioFTPD caches nxLib.tcl in any existing interpreters, so you may have to restart ioFTPD.
neoxed is offline   Reply With Quote
Old 04-14-2006, 10:34 AM   #7
snatsert
Member
ioFTPD Foundation User
 
Join Date: Mar 2003
Posts: 61
Default

It still show the normal speeds outputs like MB/s , and I did restart ioFTPD
snatsert is offline   Reply With Quote
Old 04-14-2006, 02:22 PM   #8
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

Then you didn't replace the procedure in nxLib.tcl. It's simple cut&pasting...this couldn't be any simplier.
neoxed is offline   Reply With Quote
Old 04-15-2006, 06:42 AM   #9
snatsert
Member
ioFTPD Foundation User
 
Join Date: Mar 2003
Posts: 61
Default

I did that.....
snatsert is offline   Reply With Quote
Reply

Tags
change, mbit/sec, mbyte/sec, output, speedoutput


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:39 AM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)