ts2 / ts2-sim-server

TS2 SimServer, the core of the TS2 Simulator
https://ts2.github.io
GNU General Public License v2.0
5 stars 9 forks source link

pedro stufff ! #1

Closed pedromorgan closed 8 years ago

pedromorgan commented 8 years ago

mainly docs

pedromorgan commented 8 years ago

Bumping into interesting errors..

Had to fix the json data with "dealyGenerator" - https://github.com/ts2/ts2-sim-server/blob/pedro-dev/simulation/time_stuff.go#L49

and ROutes.initialize crashed() as BeginSignal() returns nil

pedromorgan commented 8 years ago

Ok have had a good look and hacked parts of the sim-server...

Mainly cos I'm trying to have a full understanding of whats happening, learning go, but things are clearer now (kinda ;-)).. but here and some Questions and Comments.

Sim Json/Loading Issues

Invalid Json for DelayGenerator

The sim in ts2-data/UK didn't load

options load from ts2-data

Version float <> "version": "2.3"
Version string <> "version": 2.3
//version could be "0.9.2-alpha"
TrackCircuitBased bool <> "trackCircuitBased": 0

problems...

This leads to a few issues, and indeed and suprised how "stubborn" golang is, after years of python, but its an issue that aint gonna go away.

But root issue is probably the simple_json() which was "designed" for serialising objects in py.. so not 100% conform, convenience hack. We are not in py land anymore.. :confused:

I prefer to go with a pathched up ts2-data, even if its manual.. at least we know "that right"...

And that leads to another issue of "test_data/demo.json"..

pedromorgan commented 8 years ago

The Fun parts

Sorry @npiganeau and I hope u dont get "pissed off" with me.. but I like to rename things sometimes, and move things in files so its a nice target.. so apologies... but golang is no nice.. one can git mv any.go things.go

I'm just trying to make it obvious to a new dev, where things are likely to be..

So I prefer to have a "known Intentin".. and some handt shortcults we can discuss

So As a server, I really really dont want nothing in there apart from code.. But at the end of the day its not php, or python so that means we need to embed assets in code.. or use a technichque to embed data.. anyway for now templates are in there.. and need as build.. with go-bindata

Point, Switch, XOver

pedromorgan commented 8 years ago

Static and hot reload tempaltes

I dont want to many dependancies.. indeed not static assets .

pedromorgan commented 8 years ago

LIVE TV:

Amazing.. in last 30 mins....

pedro-view on rats+fox+badgers+moles+snails+spiders

pedromorgan commented 8 years ago
Once upon a time, on a cutting,
the young rail rabbits found their own ground,
they could chew thei little nibbles and get between the rails..
and as the train went pass they duck down.. and job done..
https://www.youtube.com/watch?v=fi-VH6mksEM
npiganeau commented 8 years ago

Quickly several things:

npiganeau commented 8 years ago

Ok. I've done the review and imported some of them.

npiganeau commented 8 years ago

Also, I did not import the Debug feature because the next step I want is to change logging library to use https://github.com/inconshreveable/log15 instead of log.

log15 enables to have context loggers and log levels (including debug level).

pedromorgan commented 8 years ago

I stuck the AJAX in to mainly debug loading etc... dont see any harm in having it as a down/dirty way to "look" at sim state..but anyway.. later..

pedromorgan commented 8 years ago

moot

pedromorgan commented 7 years ago

Lets go.. @npiganeau is sleping