{"action":"created","issue":{"url":"https://api.github.com/repos/dmolin/flightSimPanels/issues/3","labels_url":"https://api.github.com/repos/dmolin/flightSimPanels/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/dmolin/flightSimPanels/issues/3/comments","events_url":"https://api.github.com/repos/dmolin/flightSimPanels/issues/3/events","html_url":"https://github.com/dmolin/flightSimPanels/issues/3","id":54608886,"number":3,"title":"Send same data source to two measure routes","user":{"login":"mcongrove","id":442433,"avatar_url":"https://avatars.githubusercontent.com/u/442433?v=3","gravatar_id":"","url":"https://api.github.com/users/mcongrove","html_url":"https://github.com/mcongrove","followers_url":"https://api.github.com/users/mcongrove/followers","following_url":"https://api.github.com/users/mcongrove/following{/other_user}","gists_url":"https://api.github.com/users/mcongrove/gists{/gist_id}","starred_url":"https://api.github.com/users/mcongrove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcongrove/subscriptions","organizations_url":"https://api.github.com/users/mcongrove/orgs","repos_url":"https://api.github.com/users/mcongrove/repos","events_url":"https://api.github.com/users/mcongrove/events{/privacy}","received_events_url":"https://api.github.com/users/mcongrove/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-01-16T18:35:08Z","updated_at":"2015-01-18T00:24:18Z","closed_at":"2015-01-16T19:06:45Z","body":"Looking through the code, I'm not seeing a way to send the same data source to two different routes. For instance, the `attitude.roll` is used by the Attitude Indicator as well as the Turn-and-Slip Indicator.\r\n\r\nAm I missing something, or is this not supported because of the `measure.xtype` handler registration?"},"comment":{"url":"https://api.github.com/repos/dmolin/flightSimPanels/issues/comments/70390938","html_url":"https://github.com/dmolin/flightSimPanels/issues/3#issuecomment-70390938","issue_url":"https://api.github.com/repos/dmolin/flightSimPanels/issues/3","id":70390938,"user":{"login":"dmolin","id":861513,"avatar_url":"https://avatars.githubusercontent.com/u/861513?v=3","gravatar_id":"","url":"https://api.github.com/users/dmolin","html_url":"https://github.com/dmolin","followers_url":"https://api.github.com/users/dmolin/followers","following_url":"https://api.github.com/users/dmolin/following{/other_user}","gists_url":"https://api.github.com/users/dmolin/gists{/gist_id}","starred_url":"https://api.github.com/users/dmolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmolin/subscriptions","organizations_url":"https://api.github.com/users/dmolin/orgs","repos_url":"https://api.github.com/users/dmolin/repos","events_url":"https://api.github.com/users/dmolin/events{/privacy}","received_events_url":"https://api.github.com/users/dmolin/received_events","type":"User","site_admin":false},"created_at":"2015-01-18T00:24:18Z","updated_at":"2015-01-18T00:24:18Z","body":"Ok, work done :)\r\n\r\nThis is what is changed:\r\nNow we have 2 set of decoders/mappers:\r\n\r\n- dataref processors:\r\n   functions responsible for transforming the binary representation of a\r\nX-Plane dataref type into a human readable JSON object (this is the work\r\nthat I was previously doing in each measure module index.js..)\r\n\r\n- measure processors\r\n   functions responsible for returning the complete JSON representation of\r\nan instrument. it can be corresponding to one of the dataref JSON object\r\n(in that case the measure processor acts simply as a proxy to a dataref\r\nprocessor decoded object) or a complex object assembled using multiple\r\ndataref decoded objects...\r\n\r\nYou can also see that now under the \"services/\" folder we have 2\r\nsub-folders:\r\n- datarefs/\r\n     contains a list of commonjs modules, one for each xtype that we want\r\nto be able to decode.\r\n     each module's index.js is just a decoding function (the dataref\r\nprocessor function) that return the JSON representation of the binary\r\npayload for that xtype\r\n\r\n- measures/\r\n     contains a list of commonjs modules, one for each instrument. The\r\nindex.js is the \"processor\" function responsible for returning the JSON\r\nobject representing that instrument. most of the time the function can act\r\nsimply as a proxy and return the same exact JSON object decoded by the\r\ndataref processor; other times (like for the turn coordinator, I guess, it\r\ncan return a complex object resulting from the composition of multiple\r\ndataref decoded objects..). Each measure processor function received in\r\ninput a configuration object containing the hashtable with the decoded\r\nxtypes and a Helper function.\r\n\r\nThis should give us the maximum flexibility in assembling each instrument\r\nwith as many xtype we need.\r\n\r\nBest\r\nDavide\r\n\r\n\r\nsend replies to:\r\nDavide Alberto Molin\r\ndavide.molin@gmail.com\r\n\r\nfind me on:\r\nLinkedIn: http://www.linkedin.com/in/davidemolin\r\nMy Homepage: http://www.davidemolin.com\r\nMy Online Courses: http://fedtraining.usefedora.com\r\nMy GitHub: http://github.com/dmolin\r\nMy Blog: http://developme.wordpress.com\r\nMy Tweets: http://www.twitter.com/davidemolin\r\nMy Vimeo: http://vimeo.com/davidemolin\r\n\r\nOn Sat, Jan 17, 2015 at 5:41 PM, Davide Alberto Molin <\r\ndavide.molin@gmail.com> wrote:\r\n\r\n> Wow that's cool. really beautiful work mate!\r\n>\r\n> You can bet I want those :D\r\n>\r\n> I've almost done with the refactor. Now the new factory is complete and\r\n> I've already converted the speed and enginerpm indicators;\r\n>\r\n> Now I need to go to a party (damn social activities.. LOL)\r\n> When I come back I think I should be able to finish and commit.\r\n> Expect a few changes:\r\n> Under the \"services\" folder you'll have now:\r\n>   datarefs/\r\n>       3/\r\n>      18/\r\n>      37/\r\n>\r\n>   measures/\r\n>      speed/\r\n>      enginerpm/\r\n>\r\n>\r\n> datarefs/ is a folder containing a commonjs module for each xtype sent out\r\n> by the simulator\r\n> measures/ contains the code to build each Measure object sent to the\r\n> client (and the usual clientside code)\r\n>\r\n> Basically, the index.js that you have now under each measure is going to\r\n> be moved under the datarefs/ folder, because over there is the logic to\r\n> translate a UDP packet into the correspondig json model.\r\n> The \"measures/xxx\" module instead will just assemble the measure object\r\n> having access to all the datarefs decoded from the message sent by the\r\n> server; this way each measure(instrument panel) can be obtained composing\r\n> any (or all) of the datarefs available..\r\n>\r\n>\r\n> Best\r\n> Davide\r\n>\r\n>\r\n> send replies to:\r\n> Davide Alberto Molin\r\n> davide.molin@gmail.com\r\n>\r\n> find me on:\r\n> LinkedIn: http://www.linkedin.com/in/davidemolin\r\n> My Homepage: http://www.davidemolin.com\r\n> My Online Courses: http://fedtraining.usefedora.com\r\n> My GitHub: http://github.com/dmolin\r\n> My Blog: http://developme.wordpress.com\r\n> My Tweets: http://www.twitter.com/davidemolin\r\n> My Vimeo: http://vimeo.com/davidemolin\r\n>\r\n> On Sat, Jan 17, 2015 at 5:32 PM, Matthew Congrove <\r\n> notifications@github.com> wrote:\r\n>\r\n>> Thanks for working on this so fast :) After you've got the re-factor done\r\n>> I'll update my code and submit PRs. I've added landing gear, flaps,\r\n>> turn-and-slip, and the heading indicators:\r\n>>\r\n>> [image: flightSimPanels]\r\n>> <https://camo.githubusercontent.com/c5358a88647963153845d4b06b3d8bc09adec583/68747470733a2f2f7261772e6769746875622e636f6d2f6d636f6e67726f76652f666c6967687453696d50616e656c732f6d61737465722f6173736574732f666c6967687473696d70616e656c732e706e67>\r\n>>\r\n>> I also updated all the instrument designs so they're more uniform,\r\n>> completely layered, and don't include things that aren't implemented (e.g.\r\n>> air temp in the airspeed indicator). If you want those, let me know and\r\n>> I'll also include them in a PR.\r\n>>\r\n>> —\r\n>> Reply to this email directly or view it on GitHub\r\n>> <https://github.com/dmolin/flightSimPanels/issues/3#issuecomment-70375574>\r\n>> .\r\n>>\r\n>\r\n>"}}