Menu

#45 Measurement tool

Enhancement
accepted
r_x
None
1
2019-10-10
2019-10-08
Reinert
No

Initial patch for the ruler.
Hope it does work.

1 Attachments

Discussion

  • r_x

    r_x - 2019-10-08

    I think I get the idea of the ruler, however it does not seem to work properly:

    1. When I enable the ruler mode the common red selection rectangle is no longer displayed but the tiles are still count. Therefore the selection is just invisible. Also the selection menu is still usable.
    2. How is the ruler supposed to work: When I click left in ruler mode some times a line is added but mostly not. By wild clicking I managed to let the ruler draw some red lines and increase the ruler counter but that was more or less accidential. Also some of the line points were placed in regions far outside of the visible area.
      May be you should add a tooltip on the ruler button explaining the basic usage of this tool. Otherwise nobody will be able to use it.

    Furthermore I have some comments on the code:

    1. The Ruler.java misses the MOBAC header
    2. in Java variable names don't start with an undercores, especially if in the same method the variable name without underscore is already used. Please correct that.
    3. In Java method names always start lower case
    4. Please only include modifications in your patch file that are relevant.
    5. For starting development please check out the ful project from SVN, otherwise the paths names in the diff file don't match. This also simplified the diff file creation and teh comparion what have been changed.
    6. I encountered an java.lang.ArrayIndexOutOfBoundsException: -1 in mobac.gui.mapview.Ruler.Remove. Please always write safe code, e.g. check the segments list length before performing any actions on it.
     
  • Reinert

    Reinert - 2019-10-08

    Thanks for your fast feedback.
    Just rollback the patch and dump it, i will make a new initial patch within the next hours with improvements.
    Current behavior is the following:
    . Selection disabled on purpose during measure.
    . Right click erase the last inserted point.
    . Press Backspace or Suppr once to clear points, twice to exit the ruler mode -> Selection comes back.

    Did experienced a couple of off-screen segments too. I believe i have to disable double-click zoom in order to prevent points to be added at erroneous coordinates.

     
  • r_x

    r_x - 2019-10-08

    Just rollback the patch and dump it
    That is the advantage of using SVN (or any other version control system), you can simply revert all local changes. No need to rolback anything. You shoud really try it.

     
  • Reinert

    Reinert - 2019-10-08

    Ok this one is better.
    . Fixed the poor mouse behavior, off screen points.
    . New buttons on top. Way more intuitive.
    https://i.ibb.co/6yGf30p/2.png
    . Selection panels hidden while doing the measure

    Have to upgrade the keyboard behavior. Stick to buttons from now.
    Features i'de like to add:
    . Export the segments as .gpx
    . Auto select the tiles intersected by the path

     

    Last edit: Reinert 2019-10-08
  • r_x

    r_x - 2019-10-09

    The patch is invalid. Just look at it in an editor, the ruler lines are marked for deletion. Therefore I assume you have compared the wrong versions.
    Again my advice: Checkout MOBAC from SVN and make your changes.
    Afterwards use svn diff to create the patch file.

     
  • Reinert

    Reinert - 2019-10-09

     

    Last edit: Reinert 2019-10-09
  • Reinert

    Reinert - 2019-10-09

    Did it the right way on this one.
    svn checkout of 2.1.2 2422 (2415 in title).

     

    Last edit: Reinert 2019-10-09
  • r_x

    r_x - 2019-10-10

    I made some improvents to your patch (externalization of Strings, auto-formatting, code improvements) also the ruler button is now a checkbox like the wgsgrid checkbox.

    Committed in SVN rev 2424

     
  • r_x

    r_x - 2019-10-10
    • status: open --> accepted
    • assigned_to: r_x
     
  • Reinert

    Reinert - 2019-10-10

    Excellent. I'm now working from the latest svn.
    Please accept this minor patch. Thanks.

     

Log in to post a comment.