WordRider Home
stop button and scheduler 4 next release
July 07, 2012 10:38AM
This is a topic started by birchie, which Vity accidentally deleted... Luckily I still had it in my browser history. The smilies and attachments are gone though. sad smiley



Looking over some of the suggestions here, I thought that a button to stop downloading
without pausing or cancelling everything was a good idea.
I started by making some additions/changes in FRD to demonstrate this functionality.
--- Use or Ignore any suggestions and changes made ---

A stop button was added to the options menu and status bar that prevents any more downloads from starting automatically.
It does not change the status of any files, other than those currently downloading, and still allows the user to force downloads.
When pressing toe stop button, files currently downloading can:
All continue, All stop, or Stop only if they can be resumed (default), settings added in the connections tab of the preferences.

If the internet connection is lost, rather than every queued file going to an error status, I added a check that will automatically press the stop button if connection errors occur more than the given rate (default 3errors in <30sec)

Automatically pressing the stop button inspired me to create a simple download scheduler that can start and stop the download queue.
Scheduler settings added in the connections tab of the preferences.
This extension will manipulate the stop auto-download button at the times provided by the user.
The first time that will trigger the scheduler is the first time in the list.
eg. now=09:01, list="+09:00,-11:00" so the scheduler will trigger tomorrow and do nothing today
When the scheduler is triggered the time is moved to the end of the list
This allows flexibility for daily downloading timeframes to be set, or timeframes can be different every day
eg. list="+09:00,-11:00" so every day between 9AM and 11AM downloads can start automatically
eg. list="+09:00,-11:00,+10:00,-12:00,+11:00,-13:00" so downloads can auto start for 2 hours each day from 9AM on day1, 10AM on day2, and 11AM on day3
eg. list="+09:00,-11:00,+11:00" so every day auto-downloads start from 9AM, will stop for a moment start again at 11AM (a scheduled change takes less than a minute to execute)
eg. list="+09:00,-11:00,-9:01" so day1 downloads can start automatically between 9AM and 11AM, day2 no auto-downloading
The scheduler will disable itself when it finds the letter X in the schedule list, user action needed to restart the scheduler.
eg. list="+09:00,x,-11:00" so at 9AM auto-downloads can start and the scheduler will be disabled

The biggest issue I had with the scheduler was that Java does not always correctly read the operating system's timezone.
If needed the timezone can be manually corrected in the scheduler settings.


Also added a default setting for the number of parallel downloads, supporting development of XFileSharing plugins



Attached FRD_app_changes_birchie.rtf -- list of changes additions made to the source code
Attached src.zip -- changed source code files (I'm probably not correctly connected to the frd svn, won't risk direct update)

Link to demo app FreeRapid-0.86u1_birchie.zip 12.4 Mb
Note: Also changed version details to indicate it is a non-official release by me

DEMO VERSION ONLY -- USE AT YOUR OWN RISK -- NOT AN OFFICIAL RELEASE
Attachments:
open | download - FRD_app_changes_birchie.rtf (31.4 KB)
Re: stop button and scheduler 4 next release
July 07, 2012 10:39AM
You can right click your changes in the Changes tab in IntelliJ IDEA (the same place where you'd commit them) and choose "Create Patch". That way you don't have to make a change list manually, it's easier to review, and the patch can be applied easily. smiling smiley
Re: stop button and scheduler 4 next release
July 07, 2012 10:39AM
Sorry, the previous thread was deleted by accident...

From my point of view - the stop button is useless - ESC key works fine, there would be too many buttons too. Maybe we can add it using some internal property?

Do you detect specific kind of errors or just all errors? Since inserting 10 invalid links cause many errors...
I think it's difficult to detect and recognize correct "stop" state.

This kind of scheduler looks very unintuitive and very complex and I don't see any typical usecase for using it.
Maybe we can look for an inspiration in uTorrent?
Also, I don't understand your problem with a timezone. Calendar.getInstance() works always fine.

Generating patches is much easier than marking colors .

-------------------------------------





Edited 1 time(s). Last edit at 07/07/2012 10:57AM by Vity.
Re: stop button and scheduler 4 next release
July 08, 2012 06:19AM
Vity Wrote:
-------------------------------------------------------
> From my point of view - the stop button is useless
> - ESC key works fine, there would be too many
> buttons too. Maybe we can add it using some
> internal property?

With potentially 100s or 1000s of links in the download queue (may not be intended for that number of files, but it is used that way),
many copies like of the same files from different servers. some complete, partially downloaded, queued, paused, etc....
Changing them all to Paused or Cancelled then changing them all back to their previous state is very annoying!.
If not connected to the internet downloads are impossible, but within the program there is no way to stop it attempting to download
- even internet explorer has a work offline option
Exiting the program is currently the only way to stop all downloads without changing the status of the queued files.

> Do you detect specific kind of errors or just all
> errors? Since inserting 10 invalid links cause
> many errors...
> I think it's difficult to detect and recognize
> correct "stop" state.

There is already a connectError variable indicating connection related errors based on the exceptions thrown - I just used that
Customizing the number of errors and time frame within settings is unnecessary ... just done to try display & edit abilities

> This kind of scheduler looks very unintuitive and
> very complex and I don't see any typical usecase
> for using it.
> Maybe we can look for an inspiration in uTorrent?

Maybe, this scheduler was easy to implement and is very flexible
...This was almost a direct copy-paste from something very similar I had programmed years ago

> Also, I don't understand your problem with a
> timezone. Calendar.getInstance() works always
> fine.

Calendar.getInstance() or System.currentTimeMillis() both provide the same time and they work fine if Java correctly reads
your locations timezone information from your OS
Java tells me my current time as 90 minutes behind the actual time.
1000s of google results from others with the same issue of wrong timezone
without hard-coding my timezone I came up with an adjustable solution, not needed by everyone, but needed by some

> Generating patches is much easier than marking
> colors .

Now that I know about patches, I've attached the patch

And to see how they work here is the demo link again FreeRapid-0.86u1_birchie.zip 12.4 Mb
DEMO VERSION ONLY -- USE AT YOUR OWN RISK -- NOT AN OFFICIAL RELEASE

Update: FreeRapid-0.9_birchie.zip --> 0.9 release + Stop Button



Edited 1 time(s). Last edit at 11/04/2012 10:56PM by birchie.
Attachments:
open | download - src.zip (56.8 KB)
open | download - frd_app_birchie.patch (40.6 KB)
Re: stop button and scheduler 4 next release
July 08, 2012 06:52AM
So let's add the stop function into menu only and the toolbar button optionable.

90% of users are beginners and lamers. They don't want to study complicated examples of the scheduler. They just want to select files and start it on a planned date (or to do some planned action, but it's much more complicated to implement well). Nothing else.

Is it this bug? [bugs.sun.com] -Duser.Timezone in startup.properties will solve your problem.
What's your OS and location?

-------------------------------------

Re: stop button and scheduler 4 next release
July 08, 2012 08:47AM
I hid the stop button down on the status bar, with a better image it would barely be noticed
and the 2 check boxes in settings for how to stop current downloads
(magenta & green lines of code in my manually created change list) - lol

The time discrepancy issue I spent ages trying to find why it was giving me the wrong time
Google responses all pointed to java timezone issues and manually programming in the timezone
I calculated the time using System.currentTimeMillis() and as the difference in time was a fixed
amount every time of 90 minutes, I assumed the error related to the java timezone issues.
The bug report is specific to Linux variants, I have Windows Vista, this prompted me to stop assuming
and actually check what timezone details java was giving me. . . . .
sad smiley It is the correct timezone "Eastern Standard Time(Brisbane)". . . . . looking at my code I see the error
was just something stupidly done without thinking and I only just noticed the mistake. . . . .
I lost time when I converted a long into an int sad smiley LOL
Sorry, only registered users may post in this forum.

Click here to login