DKP Log Parser Forum Index
 Forum FAQ   Search   Register   Log in 
 About   Download   Forum   Wiki   Development
Changes to the participation intervals GUI

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DKP Log Parser Forum Index -> Suggestions - Completed

Author

Message

Lokorin
Site Admin


Joined: 03 Apr 2006
Posts: 697

PostPosted: Mon Jul 17, 2006 2:18 pm    Post subject: Changes to the participation intervals GUI

Reply with quote


Status: Included in version 1.4.0

Currently the participation intervals are displayed in a tab. In the tab there's a table and a tab group. The table has one row for each participation interval and the tab group contains tabs with the details of each participation intervals. The table rows act as shortcuts to the tabs, selecting a table row automatically switches to that tab.

Having every tab displayed when there's already a table feels like overkill. Maybe it would be better to remove the tabs and instead just display the participation based on the row selected in the table? The following would be in the participation tab:

The participation table to the left, then a composite with the buttons used for manipulating intervals, then a list of all the participants and furthest to the right a composite with the buttons for altering the participation.

What would be even better is that selecting multiple rows could show the intersection of the intervals, and allow removing and adding people to multiple participation intervals at the same time (i.e. one less thing to do Smile). It would also allow joining intervals by selecting them and then clicking a join button (I think impishfae suggested something like that). Splitting would only be allowed when exactly one interval is selected.

While doing this the buttons and functionality for creating new participation intervals could be added. It would also make sense to gray out the buttons that can not be used (e.g. gray out the split button if multiple intervals are selected).

By the way, graying out buttons that can not be used is something that the program lacks in general.


Last edited by Lokorin on Wed Aug 23, 2006 3:50 pm; edited 2 times in total

Back to top

impishfae



Joined: 19 Jun 2006
Posts: 125
Location: Australia

PostPosted: Mon Jul 17, 2006 10:06 pm    Post subject:

Reply with quote


This sounds awesome. I like your style.

Back to top

Lightning



Joined: 14 May 2006
Posts: 28

PostPosted: Sat Jul 22, 2006 10:46 am    Post subject:

Reply with quote


sounds good...
2 points to this:

1. I found out, that especially deleting some of these taps couses programm-crashes. Hopefully the re-designing will solve this problem.
2. As far as this "manipulating" is working also on the points, it would be great. If i atm. add someone to 1 of these tabs, he doesnt gain points in the zero-sum-system.
E.g. due to some lightning someone has no internet for 15 minutes. In this time he doesnt gain points. But for the the hour before and after he does. Due to the point, that he is offline not by his own fault it would be nice, if he would gain points for these 15 minutes.

Back to top

Lokorin
Site Admin


Joined: 03 Apr 2006
Posts: 697

PostPosted: Sat Jul 22, 2006 5:33 pm    Post subject:

Reply with quote


The changes have now been committed. A word of warning though: removing multiple people from multiple intervals is currently very slow. This is because almost everything in the GUI is dependent on the participation, causing almost everything to be updated upon participation changes.

The real problem is that there's currently no functionality for locking updates so that e.g. no updating is done until the whole batch of removals are done. The lack means that removing 5 persons from 5 intervals will cause almost 25 resynchronizations of almost every table in the GUI, which takes time. So some kind of lock has to be added.

It shouldn't be hard to implement as every update is triggered by the update() method, the question is how. I see two important questions:

Q1. Should the lock be global or should it be possible to for instance just lock updates to table x?
Q2. If one locks, performs the removals and then just unlocks one will have an out of date GUI as none of the update requests caused by the removals will have gone through. How should the GUI be kept current after unlocking?


My thoughts about possible answers:
A1
The update code is currently fairly well structured, so local locks are not a whole lot of more work than a global lock. Whether or not a single global lock should be used depends on how question two is solved. If a global lock requires that the entire GUI is updated upon unlocking then it could cause situations when locking and then unlocking would be worse for performance than just skipping locks. I'd rather have a situation where one can always lock updates without worrying about performance.

A2
This depends on how question one is solved. If a global lock is used then performing an automatic update whenever unlocking will be negative for performance. If local locks are used then doing an automatic update would be reasonable as one would hopefully not be locking things that were not going to receive update requests.

A slightly more sophisticated solution would be to queue updates when a lock is active. Duplicates (same observable object and argument) could be removed from the queue, meaning that only unique update requests would be processed upon unlocking.

More things to consider
Updates can currently overlap. If for instance one changes the participation then the DKP will also be recalculated, causing two separate update requests that will both update the global statistics table (as it tracks both participation and DKP). Possibly one could queue things on based on the component that should be updated rather than depending on what was changed.

Back to top

Lokorin
Site Admin


Joined: 03 Apr 2006
Posts: 697

PostPosted: Sun Jul 23, 2006 9:30 am    Post subject:

Reply with quote


After thinking a bit about it I think that it should be implemented as a queue of updateXyz() method calls where duplicates are removed. The lock should be global (as it would not make a lot of difference). Such a system would ensure that an GUI area that became out of date while the lock was active will only be updated once when the lock is released.

To give an idea of how updates currently work: The GUI is an Observer and the DayBlock is an Observable, the following is the GUI's update() method (which is in the Observer interface).
Code:

   /**
    * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
    */
   public void update(final Observable o, final Object arg) {
      shell.getDisplay().syncExec(new Runnable() {
         public void run() {
            if(o == activeDay) {
               if(arg == DayBlock.ObservableUpdates.DKP_CHANGED) {
                  updateTblIntervalContents();
                  updateTblEventContents();
                  updateTblGlobalRewards();
                  updateGrpGlobalSpinners();
                  updateStatusBar();
               } else if(arg == DayBlock.ObservableUpdates.ERRORS_CHANGED) {
                  updateLstErrors();
                  updateStatusBar();
               } else if(arg == DayBlock.ObservableUpdates.PARTICIPATION_CHANGED) {
                  updateTblParticipationOverview();
                  updateTblIntervalParticipation();
                  updateTblEventParticipation();
                  updateTblGlobalRewards();
                  updateTblParticipation();
                  updateLstParticipants();
               } else if(arg == DayBlock.ObservableUpdates.PARTICIPATION_INTERVALS_CHANGED) {
                  updateTblParticipation();
                  updateTblParticipationOverview();
               } else if(arg == DayBlock.ObservableUpdates.LOOT_CHANGED) {
                  updateTblLoot();
                  updateStatusBar();
               } else if(arg == DayBlock.ObservableUpdates.LOOT_ITEM_MODIFIED) {
                  updateTblLoot();
               } else if(arg == DayBlock.ObservableUpdates.REWARD_INTERVALS_CHANGED) {
                  updateTblIntervals();
                  updateTblIntervalParticipation();
                  updateStatusBar();
               } else if(arg == DayBlock.ObservableUpdates.NOTE_FORMAT_CHANGED) {
                  updateTblIntervalContents();
               } else if(arg == DayBlock.ObservableUpdates.REWARD_INTERVAL_ZONE_CHANGED) {
                  updateTblIntervalContents();
               } else if(arg == DayBlock.ObservableUpdates.HIGH_PARTICIPATION_DISPLAY_CHANGED) {
                  updateTblGlobalRewards();
               } else if(arg == DayBlock.ObservableUpdates.EVENT_CHANGED) {
                  updateTblEvents();
                  updateTblEventParticipation();
                  updateStatusBar();
               }
            }
         }
      });
   }


So this method is called whenever something that the GUI observes is altered (and it only observes DayBlock at the moment). The argument is an element in the DayBlock's ObservableUpdates enumeration and it identifies what was changed. The GUI then maps that element to the parts of the GUI that will have to be updated as a result. Each GUI part that can be updated has an updateXyz method (which are disjunct). So it would not be especially hard to instead map the elements to some kind of identifiers which are then put in a queue and then mapped to the corresponding updateXyz method upon processing the queue.

Back to top

impishfae



Joined: 19 Jun 2006
Posts: 125
Location: Australia

PostPosted: Mon Jul 24, 2006 8:47 am    Post subject:

Reply with quote


Found a bug. Sad

Using the 'extend beginning' button, I selected a time before the start of the first participation interval. I think it's a refresh issue of some kind?

So I initially had:
1 20:02 to 22:28
2 22:28 to 22:39
3 22:39 to 22:39

Extended beginning and entered 20:00
This produced in the GUI
1 20:02 to 22:28
2 22:28 to 22:39
3 22:39 to 22:39
1 20:00 to 20:28

Clicking on the top entry made poor DKPLP fall over and the following NPE appear in the log

Code:

java.lang.IllegalArgumentException: The specified time interval (20:02 to 22:28) does not exist.
   at com.lokorin.dkplp.DayParticipation.viewParticipation(DayParticipation.java:374)
   at com.lokorin.dkplp.gui.GUI.updateLstParticipants(GUI.java:2238)
   at com.lokorin.dkplp.gui.GUI.access$20(GUI.java:2217)
   at com.lokorin.dkplp.gui.GUI$10.widgetSelected(GUI.java:2028)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758)
   at com.lokorin.dkplp.gui.GUI.open(GUI.java:425)
   at com.lokorin.dkplp.gui.GUI.main(GUI.java:328)

Back to top

Lokorin
Site Admin


Joined: 03 Apr 2006
Posts: 697

PostPosted: Mon Jul 24, 2006 9:28 am    Post subject:

Reply with quote


I was poking around in the code that updates that table yesterday, so that's probably when I broke something.

*edit*

It has been fixed.

Back to top

Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DKP Log Parser Forum Index -> Suggestions - Completed All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
SoftGreen 1.1 phpBB theme © DaTutorials.com 2005