{"action":"created","issue":{"url":"https://api.github.com/repos/ts2/ts2/issues/63","labels_url":"https://api.github.com/repos/ts2/ts2/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/ts2/ts2/issues/63/comments","events_url":"https://api.github.com/repos/ts2/ts2/issues/63/events","html_url":"https://github.com/ts2/ts2/issues/63","id":110742613,"number":63,"title":"Next arch = v0.7","user":{"login":"npiganeau","id":3935559,"avatar_url":"https://avatars.githubusercontent.com/u/3935559?v=3","gravatar_id":"","url":"https://api.github.com/users/npiganeau","html_url":"https://github.com/npiganeau","followers_url":"https://api.github.com/users/npiganeau/followers","following_url":"https://api.github.com/users/npiganeau/following{/other_user}","gists_url":"https://api.github.com/users/npiganeau/gists{/gist_id}","starred_url":"https://api.github.com/users/npiganeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npiganeau/subscriptions","organizations_url":"https://api.github.com/users/npiganeau/orgs","repos_url":"https://api.github.com/users/npiganeau/repos","events_url":"https://api.github.com/users/npiganeau/events{/privacy}","received_events_url":"https://api.github.com/users/npiganeau/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ts2/ts2/labels/%23ideas","name":"#ideas","color":"fad8c7"},{"url":"https://api.github.com/repos/ts2/ts2/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ts2/ts2/milestones/6","html_url":"https://github.com/ts2/ts2/milestones/v0.7","labels_url":"https://api.github.com/repos/ts2/ts2/milestones/6/labels","id":1337087,"number":6,"title":"v0.7","description":null,"creator":{"login":"pedromorgan","id":123932,"avatar_url":"https://avatars.githubusercontent.com/u/123932?v=3","gravatar_id":"","url":"https://api.github.com/users/pedromorgan","html_url":"https://github.com/pedromorgan","followers_url":"https://api.github.com/users/pedromorgan/followers","following_url":"https://api.github.com/users/pedromorgan/following{/other_user}","gists_url":"https://api.github.com/users/pedromorgan/gists{/gist_id}","starred_url":"https://api.github.com/users/pedromorgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedromorgan/subscriptions","organizations_url":"https://api.github.com/users/pedromorgan/orgs","repos_url":"https://api.github.com/users/pedromorgan/repos","events_url":"https://api.github.com/users/pedromorgan/events{/privacy}","received_events_url":"https://api.github.com/users/pedromorgan/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2015-10-04T21:12:41Z","updated_at":"2015-10-17T13:58:07Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-10-09T21:56:17Z","updated_at":"2015-10-17T13:58:07Z","closed_at":"2015-10-17T13:58:07Z","body":"Ok guys here's my plan for v0.7 taking into account several ideas you all had in #57 , #40 , #39 among others.\r\n\r\n# Current situation\r\n- GUI and simulation logic are mixed up (although I tried to separate them and make them talk through signal/slot mechanism, it is not always as clear). The monolithic construction of TS2 makes it hard for a newcomer to understand how it works.\r\n- Namespaces are just awful. Just don't ask me why a file is inside a folder and not another one. And we have circular references which have been worked around in a very ugly manner...\r\n- It's quite impossible to have several coders work at the same time on TS2 code.\r\n- We all see the interest of having a software with a lot of interfaces so that it can be used as it is now (a signalling simulation game), but there are ideas of interfacing it with real model trains for example.\r\n\r\n# New architecture\r\nSo after we have released v0.6, my idea is to split up the software following this arch:\r\n![arch](https://cloud.githubusercontent.com/assets/3935559/10406132/1a113a0c-6ede-11e5-8ee7-455e84426bfc.png)\r\n\r\n## TS2 sim server\r\nThis is the central piece of the software. It is shipped with the TS2 release.\r\n\r\nIt can be run:\r\n- Locally for a standalone game (as it is now)\r\n- Remotely on another PC or even on a cloud server for multi-player gaming\r\n\r\nThe TS2 sim server tasks are\r\n- To centralize the game data, that is:\r\n    - Scenery layout (The track items, and how they are connected to each other, their states, etc.)\r\n    - Possible and set routes\r\n    - Services and Trains\r\n- To enforce interlocking by calling in turn the appropriate inputs simulator on : \r\n    - Route setting/unsetting \r\n    - Change of points position\r\n    - Update of signals aspects\r\n- Make the clock tick\r\n\r\nThe TS2 sim server communicates with other TS2 components through websocket.\r\n\r\nInitial game data can be downloaded from TS2 data server (through standard http, like it works now) or uploaded from client (e.g. saved game), depending on user choice\r\n\r\nThe TS2 sim server has no UI and will not depend on Qt or any of its binding. Programming language to be defined.\r\n\r\n## TS2 clients\r\nTS2 clients will be in charge of user interface:\r\n\r\nThe reference client will be a PyQt client adapted from the current TS2 software.\r\n\r\nOther clients can be imagined :\r\n- Webclient (at least to display time tables or make presentations)\r\n- Android/iOS clients\r\n- \"Near reality\" clients in order to have the look&feel of real signalling centres, depending on countries/technologies\r\n\r\n## TS2 editor\r\nThe editor is not really a client since it does not need to communicate with the ts2 sim server. However, I will probably keep it inside the PyQt client since they share many classes.\r\n\r\n## TS2 Inputs simulators\r\nThese will be independent services that are in charge of simulating all the inputs that we have in real life and that are not in a simulation.\r\n\r\nThere are different input simulators, and each can have different implementations. The implementation to use will be defined in the simulation JSON definition.\r\n\r\nEach inputs simulator will be able to register to specific events at the TS2 sim server to be notified only when necessary.\r\n\r\nThe inputs simulators have no UI and will not depend on Qt or any of its binding. Programming language to be defined for each.\r\n\r\n### Trains inputs simulator\r\nThis inputs simulator is in charge of calculating the trains positions at each clock tick from data sent by the TS2 sim server and send the info back to the sim server.\r\n\r\nThe reference train inputs simulator will be derived from the current TS2 implementation.\r\n\r\nOther implementation may include getting the info of position from a model train set or even from real railway timetables.\r\n\r\n### Trackitems inputs simulator(s)\r\nThis inputs simulator's main task is to send back the status of a trackitem after a command. It is both : \r\n- an output interface through which every command to track items are sent\r\n- an input interface for the feedback, which enable simulating breakdowns\r\n\r\nEg. When the TS2 sim server will be requested to move points, it will send the command to the trackitems simulator. The latter will respond with the points position (potentially after a delay of a few seconds).\r\n\r\nEach type of track item can use a different implementation fo trackitems inputs simulator.\r\n\r\nThe reference implementations will be:\r\n- A signalItem inputs simulator derived from the current signalLibrary mechanism in TS2 for signals\r\n- An 'always return True' inputs simulator for other items (no breakdown) at first.\r\n\r\nOther implementations can include : \r\n- Sending the output to model railway through arduino \r\n- Responding with more or less breakdown probability\r\n\r\n### Routes inputs simulator\r\nThis inputs simulator's tasks are:\r\n- To enforce route interlocking by responding to the TS2 sim server whether the route can be set/unset or not after request.\r\n- To destroy the route after train passes if the route is not persistent\r\n\r\nThe reference implementation will be derived from the current TS2 software.\r\n\r\n### ARS inputs simulator\r\nThis is the 'Automatic Routing System' inputs simulator. It is a software by itself which looks up in the TS2 sim server for info and sets up routes according to its built-in rules.\r\n\r\nSeveral implementations of ARS can be imagined to reflect different countries/technologies.\r\n\r\n## TS2 data server\r\nThis is the server for storing/exchanging simulation files. It is the extension of ts2-data repository.\r\n\r\nThis part of the project is not impacted by the new architecture.\r\n\r\n# What's next ?\r\nWell, on my side, I will continue to work to make train splitting/joining work before we release v0.6 (sorry for the impatient, but I really want to achieve this before).\r\n\r\nThen I'll define precisely the protocol for websocket communication between the TS2 components so that if any of you is particularly interested in coding one of them, he can start doing so. "},"comment":{"url":"https://api.github.com/repos/ts2/ts2/issues/comments/148917568","html_url":"https://github.com/ts2/ts2/issues/63#issuecomment-148917568","issue_url":"https://api.github.com/repos/ts2/ts2/issues/63","id":148917568,"user":{"login":"npiganeau","id":3935559,"avatar_url":"https://avatars.githubusercontent.com/u/3935559?v=3","gravatar_id":"","url":"https://api.github.com/users/npiganeau","html_url":"https://github.com/npiganeau","followers_url":"https://api.github.com/users/npiganeau/followers","following_url":"https://api.github.com/users/npiganeau/following{/other_user}","gists_url":"https://api.github.com/users/npiganeau/gists{/gist_id}","starred_url":"https://api.github.com/users/npiganeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npiganeau/subscriptions","organizations_url":"https://api.github.com/users/npiganeau/orgs","repos_url":"https://api.github.com/users/npiganeau/repos","events_url":"https://api.github.com/users/npiganeau/events{/privacy}","received_events_url":"https://api.github.com/users/npiganeau/received_events","type":"User","site_admin":false},"created_at":"2015-10-17T13:58:07Z","updated_at":"2015-10-17T13:58:07Z","body":"@pedromorgan Yes, you've got the idea. \r\n\r\nI close the issue since I moved all the info on the wiki"}}