Modify

Opened 9 years ago

Closed 8 years ago

Last modified 4 years ago

#6629 closed enhancement (fixed)

GPX tracks color customization menu + color by timestamp

Reported by: akks Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: Cc:

Description

After discussion on Russian forum I tried to make some improvements in GPXLayer.
Currently, I have added color mode menu for track layer (mostly based on CustomizeLineDrawing code) and new coloring mode - by timestamp (if no timestamp, default color is used).

I also started separate plugin InfoMode for displaying trackpoint info, hiding individual tracks* and filtering* (* - not yet implemented) #5662, #4133 .

Please have a look at the patch. Do we need to rework settings code (like #5105 says) ?
Should something be added - maybe filtering like 'hide trackss older than <date>'?

Attachments (5)

coloring.patch (15.5 KB) - added by akks 9 years ago.
customize gpx track coloring
coloring2.patch (49.3 KB) - added by akks 9 years ago.
coloringpatch2patch.patch (2.3 KB) - added by akks 8 years ago.
coloringpatch2patch2.patch (10.8 KB) - added by akks 8 years ago.
coloringPrefsAndLocal.patch (7.0 KB) - added by akks 8 years ago.

Download all attachments as: .zip

Change History (25)

Changed 9 years ago by akks

Attachment: coloring.patch added

customize gpx track coloring

comment:1 Changed 9 years ago by stoecker

Summary: [PATCH] GPX tracks color customization menu + color by timestamp[PATCH need rework] GPX tracks color customization menu + color by timestamp

I don't like the implementation of this. The Preferences for individual track settings and generic track settings should be unified and all settings should be changeable. I already introduced the settings usage accordingly, so currently only the user interface is missing.

Also I see no sense in "draw.rawgps.colors.local". The special local file handling for the segment length is due to the server clipping. For color mode not such special handling is required.

comment:2 Changed 9 years ago by akks

I just made additional item in the same code/gui structure.

Removing local is simple. But what to do with settings? Do we need GpxDisplaySettings class? Will you refactor it yourself?

Separate menu items looks logical... How to make the same user interface for global and local settings then? Hide part of the panels?

Last edited 9 years ago by akks (previous) (diff)

comment:3 in reply to:  2 Changed 9 years ago by stoecker

Replying to akks:

I just made additional item in the same code/gui structure.

But existing structure is not really good ... It is from the time, where GPX drawing had not so many options.

Removing local is simple. But what to do with settings? Do we need GpxDisplaySettings class?

Probably. I thought of maybe simply adding a parameter to the preferences class which the changes layout to a "this layer" method. But I'm not sure if this will work as I thought. Probably a own class is cleaner design.

Will you refactor it yourself?

I wanted to do so, but currently lack the time.

Separate menu items looks logical... How to make the same user interface for global and local settings then? Hide part of the panels?

Something like this. Yes.

comment:4 Changed 9 years ago by akks

OK, I will try to implement it, but some help will be needed. I will post the code and questions here, when it is ready.

After looking at the code more thoroghly, I agree that reading preferences is acceptable now (and GpxLayer need huge refactoring to introduce GpxDisplaySettings class). So I will only change GUI of GPX preference-editing part (make it customizable by adding optional layer name and mode, separate reading pereferences function).

Last edited 9 years ago by akks (previous) (diff)

comment:5 Changed 9 years ago by akks

Here is the result of preferences unification. I decided to leave only one menu item for track customization - it seems to be quite usable.

I do not know how to add global settings option for "Draw larger dots" and "HDOP" - there will be too many checkboxes.

Please tell me, what to do with this patch. (I am including Filter Tracks menu item meanwhile :) )

comment:6 Changed 9 years ago by akks

Type: defectenhancement

Changed 9 years ago by akks

Attachment: coloring2.patch added

comment:7 Changed 9 years ago by akks

Summary: [PATCH need rework] GPX tracks color customization menu + color by timestamp[PATCH need review] GPX tracks color customization menu + color by timestamp

comment:8 Changed 9 years ago by stoecker

Looks good on first check, I still need to apply and test. I have holidays soon and thus are a bit overloaded to get everything done at work until it begins :-)

comment:9 Changed 8 years ago by stoecker

Resolution: fixed
Status: newclosed

In [4270/josm]:

fix #6629 - patch by akks fixed by me - improve settings handling for individual GPX tracks

comment:10 Changed 8 years ago by stoecker

I'm not totally happy, as the local/server changes for individual tracks are not really required - josm should know whether a track is server or local based, thus this should be handled automatically. Better better than before it is in any case.

comment:11 Changed 8 years ago by akks

Thank you for applying and editing!

There s one problem - it does not save custom track preferences at all now due to specSp variable problem.
Here is a patch for the patch. It also contains line 83 to make you happier before holidays :)

Last edited 8 years ago by akks (previous) (diff)

Changed 8 years ago by akks

Attachment: coloringpatch2patch.patch added

comment:12 Changed 8 years ago by akks

Resolution: fixed
Status: closedreopened
Summary: [PATCH need review] GPX tracks color customization menu + color by timestamp[PATCH 2 PATCH] GPX tracks color customization menu + color by timestamp

comment:13 Changed 8 years ago by stoecker

In [4273/josm]:

see #6629 - fix layer setting save for multiple layers

comment:14 Changed 8 years ago by stoecker

Summary: [PATCH 2 PATCH] GPX tracks color customization menu + color by timestampGPX tracks color customization menu + color by timestamp

No this patch does not work.

There is a reason, why I did not use "spec", but specSP in getting the value. When ",spec," is used, the default-value handling is wrong.

Also simply disabling local is also wrong. A track may be global or local, so the correct one must be deactivated.

comment:15 Changed 8 years ago by akks

Ok, I tried to deactivate correct button (rather sophisticated bahaviour based on level) and use specSP only (no ",spec" at all - why do not you improve defult value handling?)

I hope this patch will fit (it seems to work for me, I checked local tracks,global configs, multiple layers).

Changed 8 years ago by akks

Attachment: coloringpatch2patch2.patch added

comment:16 Changed 8 years ago by stoecker

You overlooked the changes done in 4273. Your patch wont apply.

The issue with the default only applies to the case where "5" is passed as default, as this can not be the default value for the original non-layer setting. For the other cases the default values match and everything is fine.

comment:17 in reply to:  16 Changed 8 years ago by akks

Err, 4273 tries to store global preferences to "draw.rawgps.colors.layer null" and so on! I am preparing new patch..

Replying to stoecker:

You overlooked the changes done in 4273. Your patch wont apply.

Yes. Strange... I am removing already implemented part.

Last edited 8 years ago by akks (previous) (diff)

Changed 8 years ago by akks

Attachment: coloringPrefsAndLocal.patch added

comment:18 Changed 8 years ago by akks

Here is the patch. It fixes global preferences bug and tries to deal with local/global settings: if we edit local file layer settings, we do not see "All" radiobutton, if multiple layer settings are edited, all needed radiobuttons are showed, but preferences are saved only as local/nonlocal for each layer.

comment:19 Changed 8 years ago by stoecker

Resolution: fixed
Status: reopenedclosed

In [4276/josm]:

fix #6629 - patch by akks - fix gpx layer settings changes

comment:20 Changed 4 years ago by stoecker

Ticket #2346 has been marked as a duplicate of this ticket.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.