3,218 bytes added
, 21:23, 15 March 2022
{{Infobox software
| name = json2ttb
| logo =
| logo alt =
| logo caption =
| screenshot = <!-- Image name is enough. -->
| screenshot size =
| screenshot alt =
| caption =
| collapsible = <!-- Any text here will collapse the screenshot. -->
| author = [[User:Daniel|Daniel Gill]]
| developer =
| released = 2021
| discontinued = <!-- Set to yes if software is discontinued, otherwise omit. -->
| ver layout = <!-- simple (default) or stacked -->
| latest release version = [https://github.com/Railway-Op-Sim/json2ttb/releases/tag/1.3.4 1.3.4]
| latest release date = 2022-03-03
| latest preview version =
| latest preview date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} -->
| repo = https://github.com/Railway-Op-Sim/json2ttb
| programming language = Java
| operating system = Windows, Linux, Mac
| platform =
| included with =
| size =
| language = English
| language count = <!-- Number only -->
| language footnote =
| genre = Simulation
| license = GNU Public License v3
| alexa =
| website = https://railway-op-sim.github.io/json2ttb/
| standard =
| AsOf =
}}
{{For|the json2ttb tutorial|Json2ttb/Tutorial}}
'''json2ttb''' is a external tool for [[About|Railway Operation Simulator]] which allows the user to speed up the creation of complex [[TTB file|timetables]].
The program works by parsing a user-written json file, which is then converted to a [[TTB file]] which can be used in within ROS. The structure of the json file is in such a way that you define a service template, which can then be iterated upon and copied over several instances, which can have non-iterative references, descriptions, times and train data.
===Key Features===
*Allows for unusual repeats of services.
*Create templates of service data and use them for several services.
*Change the reference and description of single repeats.
*Allows for creating [[shuttles]] without using shuttle syntax.
*In most cases, quicker than writing timetables in ROS.
'''What json2ttb cannot do... (yet)'''
*Does not simplify writing individual services.
*No current support for the ROS repeats (e.g. R;30;2;2), repeats are done in a different way.
===JSON Example===
Below is a small excerpt of the json file which can be parsed by json2ttb. This example is taken from the timetable for [[Sheffield East]].
<pre>
{
"ref":"1R50",
"description":"SHFF AVOIDING",
"startSpeed":80,
"dataTemplate":"C222/0_5",
"increment":1,
"events": [
"23:46;Snt;55-73 55-72",
"00:04;Fer;28-24"
],
"times": [
{"time":"06:10","ref":"1R50","description":"Nottingham to Liverpool Lime Street","dataTemplate":"C158_2"},
{"time":"06:14","ref":"5C14","description":"Etches Park Sdgs to Sheffield"},
{"time":"07:00","ref":"1F00","description":"Kettering to Sheffield"},
{"time":"19:10","ref":"1F60","description":"St Pancras International to Sheffield"}
]
},
{
"ref":"1C23",
"description":"Sheffiled to St Pancras International",
"dataTemplate":"C222/0_5",
"startSpeed":80,
"increment":1,
"events": [
"07:53;Snt;28-23 29-23",
"08:11;Fer;56-73"
]
}
</pre>