| Dart Home | PowerTCP FTP for ActiveX | Custom Development | Reply | PowerTCP FTP for ActiveX Topics | Forums |
| Author | Forum: PowerTCP FTP for ActiveX Topic: Visual feedback to users |
| vulcanbomber miles@aykroyd.co.uk From: SCUNTHORPE, United Kingdom Posts: 14 Member Since: 08/03/04 |
posted November 10, 2004 11:37 AM I have integrated a VB app using the Dart FTP controls, and the app displays the upload situation on a progress bar, together with details of the time to go, and MB remaining. Unfortunately, the resulting calculations from GetRate (Count) function, that the time varies quite considerably. Is there any way of displaying a more stabilised result. I have used the following code: GetRate (Count) BytesRemaining = LocalFileSize - Count If Count > 0 Then cmdAbort.Visible = True If BytesRemaining < 1000000 Then DisplayBytes = Format(BytesRemaining / 1000, "0") & " KB remaining" ElseIf BytesRemaining > 999999 Then DisplayBytes = Format(BytesRemaining / 1000000, "0.00") & " MB remaining" End If If BitRate > 0 Then tTempTime = BytesRemaining / (BitRate * 1000) ' Calculates number of seconds End If If tTempTime > 3600 Then TimeHours = Int(tTempTime / 3600) tTimeSecs = tTempTime - TimeHours * 3600 TimeMins = Int(tTimeSecs / 60) TimeSecs = tTimeSecs - TimeMins * 60 sBitRate = ", time to go: " & TimeHours & " hrs " & TimeMins & " mins " & TimeSecs & " secs" ElseIf tTempTime < 3600 And tTempTime > 59 Then TimeHours = 0 TimeMins = Int(tTempTime / 60) TimeSecs = tTempTime - TimeMins * 60 sBitRate = " time to go: " & TimeMins & " mins " & TimeSecs & " secs" Else TimeHours = 0 TimeMins = 0 TimeSecs = tTempTime sBitRate = ", time to go: " & TimeSecs & " secs" End If lblInformation.Caption = " Transfer rate: " & GetRate(Count) & ", " & DisplayBytes & sBitRate End If Any help would be appreciated. Thanks |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted November 10, 2004 2:10 PM This is a very hard question to answer. I'm sure there are other ways to calculate it more accurately. The code you posted looks like the code from one of our samples, which is just meant as a starting point. Everything you need to calculate the rate is available to you in the progress event. It's really a matter of personal taste how you decide to do it. |
| Reply | PowerTCP FTP for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|