Closed pedromorgan closed 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
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.
The sim in ts2-data/UK didn't load
Version float <> "version": "2.3"
Version string <> "version": 2.3
//version could be "0.9.2-alpha"
TrackCircuitBased bool <> "trackCircuitBased": 0
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"..
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
Static and hot reload tempaltes
I dont want to many dependancies.. indeed not static assets .
Amazing.. in last 30 mins....
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
Quickly several things:
Splitting sims: to be discussed. Facts:
So even if it's less 'cool' on the paper, I think I prefer the first option that is:
Ok. I've done the review and imported some of them.
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).
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..
moot
Lets go.. @npiganeau is sleping
mainly docs