{"action":"created","issue":{"url":"https://api.github.com/repos/debrief/debrief/issues/1808","repository_url":"https://api.github.com/repos/debrief/debrief","labels_url":"https://api.github.com/repos/debrief/debrief/issues/1808/labels{/name}","comments_url":"https://api.github.com/repos/debrief/debrief/issues/1808/comments","events_url":"https://api.github.com/repos/debrief/debrief/issues/1808/events","html_url":"https://github.com/debrief/debrief/issues/1808","id":161668459,"number":1808,"title":"Trouble working with large (2k points) sensor data in Rainbow Shading","user":{"login":"IanMayo","id":1108513,"avatar_url":"https://avatars.githubusercontent.com/u/1108513?v=3","gravatar_id":"","url":"https://api.github.com/users/IanMayo","html_url":"https://github.com/IanMayo","followers_url":"https://api.github.com/users/IanMayo/followers","following_url":"https://api.github.com/users/IanMayo/following{/other_user}","gists_url":"https://api.github.com/users/IanMayo/gists{/gist_id}","starred_url":"https://api.github.com/users/IanMayo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IanMayo/subscriptions","organizations_url":"https://api.github.com/users/IanMayo/orgs","repos_url":"https://api.github.com/users/IanMayo/repos","events_url":"https://api.github.com/users/IanMayo/events{/privacy}","received_events_url":"https://api.github.com/users/IanMayo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/debrief/debrief/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"theanuradha","id":535713,"avatar_url":"https://avatars.githubusercontent.com/u/535713?v=3","gravatar_id":"","url":"https://api.github.com/users/theanuradha","html_url":"https://github.com/theanuradha","followers_url":"https://api.github.com/users/theanuradha/followers","following_url":"https://api.github.com/users/theanuradha/following{/other_user}","gists_url":"https://api.github.com/users/theanuradha/gists{/gist_id}","starred_url":"https://api.github.com/users/theanuradha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theanuradha/subscriptions","organizations_url":"https://api.github.com/users/theanuradha/orgs","repos_url":"https://api.github.com/users/theanuradha/repos","events_url":"https://api.github.com/users/theanuradha/events{/privacy}","received_events_url":"https://api.github.com/users/theanuradha/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/debrief/debrief/milestones/2","html_url":"https://github.com/debrief/debrief/milestones/UW_Team","labels_url":"https://api.github.com/repos/debrief/debrief/milestones/2/labels","id":664165,"number":2,"title":"UW_Team","description":"Issues related to the UW analysis team","creator":{"login":"IanMayo","id":1108513,"avatar_url":"https://avatars.githubusercontent.com/u/1108513?v=3","gravatar_id":"","url":"https://api.github.com/users/IanMayo","html_url":"https://github.com/IanMayo","followers_url":"https://api.github.com/users/IanMayo/followers","following_url":"https://api.github.com/users/IanMayo/following{/other_user}","gists_url":"https://api.github.com/users/IanMayo/gists{/gist_id}","starred_url":"https://api.github.com/users/IanMayo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IanMayo/subscriptions","organizations_url":"https://api.github.com/users/IanMayo/orgs","repos_url":"https://api.github.com/users/IanMayo/repos","events_url":"https://api.github.com/users/IanMayo/events{/privacy}","received_events_url":"https://api.github.com/users/IanMayo/received_events","type":"User","site_admin":false},"open_issues":41,"closed_issues":113,"state":"open","created_at":"2014-05-20T08:28:12Z","updated_at":"2016-06-22T12:30:54Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-06-22T12:27:28Z","updated_at":"2016-06-23T10:56:53Z","closed_at":null,"body":"We allow an analyst to use rainbow shading to temporally navigate long blocks of sensor data.\r\n\r\nAn analyst had an ownship track plus a sensor with 1800 sensor cuts.  The sensor was rainbow-shaded.\r\n\r\nThe analyst selected some data, and created a new TMA leg from it.  Then he made that TMA leg the secondary track.\r\n\r\nThen the Outline view (and the rest of Debrief) started losing icons, with mouse movement acting like an \"eraser\".\r\n\r\nThe error log shows an error \"Graphic is disposed, being called from **Image.getImageData()**:\r\n````\r\npublic ImageData getImageData() {\r\n\tif (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);\r\n````\r\n\r\nMy first suspicion is that RCP is \"running out of handles\" when it tries to allocate memory for the 1800 uniquely colored sensor icons.\r\n\r\nIf this is the case, the fix is to not show all those unique shades, but to show at most 100 shades.  If there are less than 100 sensor cuts, show the unique colors.  If there are more than 1000 sensor cuts, re-use each icon 10 times before generating the next one.  So the colors for the icons in the Outline view will be in groups rather than continuously shaded along the data.\r\n\r\nI've had a look at the code. We use **CoreViewLabelProvider** to get images.  This does some processing, but significantly, the SWT color is retrieved from the **ColorHelper** class.  Hmm, I suggest that we create a Marker Interface for elements that should have \"chunked\" colors: IChunkedColors.  **SensorWrapper** would be given this marker interface.  Where the marker interface is found, we apply special formatting:\r\n* if the element has a color that is a default Debrief color, let it use it\r\n* if no, get the HSB value for the color (0..1).  Then chunk this to the 100 shades by multiplying by 100, taking the floor() value, then dividing by 100.  Then get this new color from the **ColorHelper**.\r\n\r\nNote: in order to check if something is a Debrief color, we should probably have them available in an array/list somewhere.  Is it possible to create a COLORS static array object in the **DebriefColors** class?\r\n\r\nThe problem can be reproduced as follows:\r\n* load **nonsuch.rep** - select **Dead Reckoning DR** as the import mode\r\n* load **sensor.dsf** from the same folder. Follow the wizard, leaving **visible** tick box un-clicked\r\n* open up the sensor data. \r\n* select all sensor cuts, right click and select **Keep starboard bearing**\r\n* Right-click on sensor, and select **Sensor A / Resample data at  / 1 second**\r\n* Right-click on sensor, and select **Shading / Shade in rainbow colors**\r\n* Right-click on sensor, and select **Generate TMA solution for all cuts**\r\n* Follow the wizard, put target at about 1nm range, speed at about 2 kts\r\n* New TMA solution will appear in Outline view. Mark it a secondary\r\n\r\nAround this point, the icons should start disappearing from the Outline View.  I can't reproduce this under Linux, the analyst experienced the problem under MS Windows.\r\n\r\n**Note:** I've just reproduced the problem using MS Windows, roughly following the above script:\r\n\r\n![rainbowicons](https://cloud.githubusercontent.com/assets/1108513/16268830/ce96f4e4-3887-11e6-8af2-0fdeae897144.PNG)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/debrief/debrief/issues/comments/228015865","html_url":"https://github.com/debrief/debrief/issues/1808#issuecomment-228015865","issue_url":"https://api.github.com/repos/debrief/debrief/issues/1808","id":228015865,"user":{"login":"theanuradha","id":535713,"avatar_url":"https://avatars.githubusercontent.com/u/535713?v=3","gravatar_id":"","url":"https://api.github.com/users/theanuradha","html_url":"https://github.com/theanuradha","followers_url":"https://api.github.com/users/theanuradha/followers","following_url":"https://api.github.com/users/theanuradha/following{/other_user}","gists_url":"https://api.github.com/users/theanuradha/gists{/gist_id}","starred_url":"https://api.github.com/users/theanuradha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theanuradha/subscriptions","organizations_url":"https://api.github.com/users/theanuradha/orgs","repos_url":"https://api.github.com/users/theanuradha/repos","events_url":"https://api.github.com/users/theanuradha/events{/privacy}","received_events_url":"https://api.github.com/users/theanuradha/received_events","type":"User","site_admin":false},"created_at":"2016-06-23T10:56:53Z","updated_at":"2016-06-23T10:56:53Z","body":"@IanMayo I do have windows vm will try it there. "}}
{"actor":{"display_login":"theanuradha"}}