{"action":"created","issue":{"url":"https://api.github.com/repos/JMRI/JMRI/issues/4873","repository_url":"https://api.github.com/repos/JMRI/JMRI","labels_url":"https://api.github.com/repos/JMRI/JMRI/issues/4873/labels{/name}","comments_url":"https://api.github.com/repos/JMRI/JMRI/issues/4873/comments","events_url":"https://api.github.com/repos/JMRI/JMRI/issues/4873/events","html_url":"https://github.com/JMRI/JMRI/issues/4873","id":295214008,"number":4873,"title":"Are throttles independent?","user":{"login":"bobjacobsen","id":2774117,"avatar_url":"https://avatars1.githubusercontent.com/u/2774117?v=4","gravatar_id":"","url":"https://api.github.com/users/bobjacobsen","html_url":"https://github.com/bobjacobsen","followers_url":"https://api.github.com/users/bobjacobsen/followers","following_url":"https://api.github.com/users/bobjacobsen/following{/other_user}","gists_url":"https://api.github.com/users/bobjacobsen/gists{/gist_id}","starred_url":"https://api.github.com/users/bobjacobsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobjacobsen/subscriptions","organizations_url":"https://api.github.com/users/bobjacobsen/orgs","repos_url":"https://api.github.com/users/bobjacobsen/repos","events_url":"https://api.github.com/users/bobjacobsen/events{/privacy}","received_events_url":"https://api.github.com/users/bobjacobsen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2018-02-07T16:56:31Z","updated_at":"2018-02-09T16:06:10Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"@devel-bobm raised points in the discussion for #4870:\r\n\r\n> For example, in my work with LocoNet throttles, I've found that, in the \"big scheme of things\", there can be more than one \"higher-level\" JMRI throttle controlling a single LocoNetThrottle object (i.e. a single LocoNet-controlled loco or consist). So, when a \"LocoNetThrottle\" object is \"released\", it can have an impact on more than just the JMRI \"higher-level\" throttle which issued the \"release\". If two JMRI GUI throttles have control of a given loco address, then ideally, releasing the loco from one of the JMRI GUI throttles does not \"release\" the loco from the other JMRI GUI throttle. In the LocoNet case, the GUI throttle \"release\" action will actually make a change to the associated \"slot\", but that change will not have any effect on the second GUI throttle's ability to control the loco.\r\n> \r\n> Bringing this back to your work: on a LocoNet-based JMRI install, will your \"release\" from GUI throttle #1 affect other GUI throttles which happen to have control of the same loco as was controlled by GUI throttle #1?\r\n> \r\n> (I don't have the foggiest idea, as I do not truly understand how the higher-level JMRI \"throttle\" implementations manage multiple throttles working with identical loco addresses.)\r\n\r\nWith reply from @SteveRawlinson:\r\n> I use Loconet too, and have seen the behaviour you describe, a release performed in once place causing another to lose control of the loco as well.\r\n> \r\n> ...\r\n>\r\n> However, if a GUI throttle window is operating a loco which is also being controlled by a script, and the script calls releaseThrottle() then it might blat the GUI throttle too. (I'll test that tomorrow.) I suspect the same would be true if the script called throttle.release() so this is not a new issue.\r\n> \r\n> Of course if you're trying to control a loco with a GUI throttle while it's also being controlled by a script you're likely to hit other issues too :)"},"comment":{"url":"https://api.github.com/repos/JMRI/JMRI/issues/comments/364476937","html_url":"https://github.com/JMRI/JMRI/issues/4873#issuecomment-364476937","issue_url":"https://api.github.com/repos/JMRI/JMRI/issues/4873","id":364476937,"user":{"login":"SteveRawlinson","id":964488,"avatar_url":"https://avatars2.githubusercontent.com/u/964488?v=4","gravatar_id":"","url":"https://api.github.com/users/SteveRawlinson","html_url":"https://github.com/SteveRawlinson","followers_url":"https://api.github.com/users/SteveRawlinson/followers","following_url":"https://api.github.com/users/SteveRawlinson/following{/other_user}","gists_url":"https://api.github.com/users/SteveRawlinson/gists{/gist_id}","starred_url":"https://api.github.com/users/SteveRawlinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteveRawlinson/subscriptions","organizations_url":"https://api.github.com/users/SteveRawlinson/orgs","repos_url":"https://api.github.com/users/SteveRawlinson/repos","events_url":"https://api.github.com/users/SteveRawlinson/events{/privacy}","received_events_url":"https://api.github.com/users/SteveRawlinson/received_events","type":"User","site_admin":false},"created_at":"2018-02-09T16:06:10Z","updated_at":"2018-02-09T16:06:10Z","author_association":"CONTRIBUTOR","body":"Since I seem to have got the right end of the stick w.r.t. withrottle I have another example of behaviour that might not be what we expect. \r\n\r\nIf a script obtains a throttle using AbstractAutomaton's getThrottle, and subsequently a GUI throttle asks for it, they both share it, with changes in state being made by the script being reflected on the GUI. However, if you press 'release' in the GUI the throttle object held by the script throws NPE if any changes are made,  and getLocoNetSlot() returns null.\r\n\r\nSo Im guessing that's also not intended?"}}
{"actor":{"display_login":"SteveRawlinson"}}