Elvas Tower: Web Server - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Web Server Making progress Rate Topic: -----

#1 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,866
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 25 May 2020 - 10:50 AM

Hi everyone,

Development on the WebServer has rather stalled, so I am wondering whether to pull together a small project for people interested in improving it.

I was thinking of:

Mauricio (mbm_OR)
Bill (BillC)
Ryan (YoRyan)
Bob (Rj Zondervan)

I thought it might be worth adding a bit of context.

The idea of a "secondary screen" has been around a while. James Ross described it 5 years ago. Dan Reynolds (HighAspect) was the first to pick it up offering code for a minimal webserver and some basic JavaScript to implement the Head Up Display. (Of course, you can't call it a HUD if it's on a separate screen, but that's another story.)

Bill Currey refined the code to make it compatible with the watchdog timer, tidy up cleanly after a disconnection and let the user choose port number or disabled.

Mauricio made the HUD code look better and also provided a Training Driving page.

Bob offered his services as an designer of APIs.

Ryan has offered code which embeds an open-source server EmbedIO as a more advanced alternative to Dan's original.

(Dan Reynolds last visited ET in Jan 2020, so maybe we can tempt him back.)

I've stuck my oar in as well and we now have code somewhat scattered all around which needs to be pulled together, organised, documented and published.

If I have got any of this story wrong, then do jump in and correct it.


The Web Server has the potential to satisfy multiple aims:

  • Bill would like to control Open Rails from a tablet instead of RailDriver.
  • Several people have been in touch asking for this and also for train location data to display on a moving map.
  • Mauricio wants to refine his current pages. It would be great to have the full set of Open Rails Pop-up Windows available off-screen.
  • Rick Loader would like to provide timetable and other context-sensitive information to make Open Rails more interesting.

So I'm proposing to invite these 4 people with a PM to join a little project group. Is there anyone else whom I should ask?

#2 User is offline   YoRyan 

  • Conductor
  • Group: Status: Active Member
  • Posts: 391
  • Joined: 19-February 20
  • Gender:Male
  • Location:California, United States
  • Simulator:Open Rails/unstable
  • Country:

Posted 04 July 2020 - 02:39 PM

After much work, I have gotten Mauricio's track monitor and train driving screens to work without their original popup code. The canvas drawing bug has also been fixed - all track features now render correctly.

These changes have been submitted as separate pull requests for the track monitor and train driving screens.

The last feature I'd like to add is a way to set the listening address(es) for the web server, like "all addresses on port 8080" or "192.168.1.10 port 2150". At the moment, the custom web server listens on all IPv4 addresses, while the EmbedIO port listens on localhost only.

Attached thumbnail(s)

  • Attached Image: mbm-trackmonitorport.jpg
  • Attached Image: mbm-traindrivingport.JPG


#3 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,866
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 05 July 2020 - 05:11 AM

Hi Ryan,

 YoRyan, on 04 July 2020 - 02:39 PM, said:

After much work, I have gotten Mauricio's track monitor and train driving screens to work without their original popup code. The canvas drawing bug has also been fixed - all track features now render correctly.
These changes have been submitted as separate pull requests for the track monitor and train driving screens.

I found that these Pull Requests are not being included in the Unstable merge. It looks as though the Jenkins build has not run since Thursday (2nd July).

I was pleased to hear that you were separating out the code that delivers the data from the code that presents it. Much tidier.

I tried Train Monitor and Train Driver on Firefox and Chrome. Both looked really good for white-on-black, so well done to you both:

Attached Image: 2020-07-05 11_36_32-Open Rails.jpg

Unfortunately, they both looked rubbish for black-on-white - see below.

I also note that there is a redundant folder Source\RunActivity\Content\Web\ (all the web source is in Source\RunActivity\Viewer3D\WebServices\Web). If you change the PR, would you remove this redundant folder, please?


Attached Image: 2020-07-05 11_29_41-OR_ Track Monitor API.jpg

Attached Image: 2020-07-05 13_52_14-ORTS (Running) - Microsoft Visual Studio.jpg

#4 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,866
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 05 July 2020 - 05:21 AM

Also on the Web Server, I am currently looking at ways to take the location of trains (latitude and longitude) and perhaps their compass direction and speed to show on a moving map.

This one is from Thunder Forest and seems to give an appropriate presentation.

Attached Image: 2020-07-05 14_17_14-Transport - Thunderforest.jpg

#5 User is offline   YoRyan 

  • Conductor
  • Group: Status: Active Member
  • Posts: 391
  • Joined: 19-February 20
  • Gender:Male
  • Location:California, United States
  • Simulator:Open Rails/unstable
  • Country:

Posted 05 July 2020 - 11:09 AM

Hi Chris,

I noticed the duplicate Web folder too. I have removed it across all of the PR's.

 cjakeman, on 05 July 2020 - 05:21 AM, said:

Also on the Web Server, I am currently looking at ways to take the location of trains (latitude and longitude) and perhaps their compass direction and speed to show on a moving map.


This would certainly be possible. Just add an API call (or several) to obtain the locations of trains, and then have a client-side web app to display them on a map.

I was holding off on adding additional API calls until the merge was approved, but perhaps I could open a separate PR just for them, if you'd like to get started on this right away.

#6 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,866
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 06 July 2020 - 08:25 AM

 YoRyan, on 05 July 2020 - 11:09 AM, said:

Hi Chris,This would certainly be possible. Just add an API call (or several) to obtain the locations of trains, and then have a client-side web app to display them on a map.

I was holding off on adding additional API calls until the merge was approved, but perhaps I could open a separate PR just for them, if you'd like to get started on this right away.

No need for any action just yet. The API should not be problem for me, so I'm focussing on the client-side web pages at present. There's a lot of pitfalls along the way but it's interesting.

One issue with digital maps is that they try hard to be up to date. For content creators, it would be helpful to also have digital maps for specific years.

#7 User is offline   BillC 

  • Conductor
  • Group: Private - Open Rails Developer
  • Posts: 322
  • Joined: 31-May 11
  • Gender:Male
  • Country:

Posted 23 July 2020 - 06:54 PM

 cjakeman, on 05 July 2020 - 05:21 AM, said:

Also on the Web Server, I am currently looking at ways to take the location of trains (latitude and longitude) and perhaps their compass direction and speed to show on a moving map.

This one is from Thunder Forest and seems to give an appropriate presentation.

2020-07-05 14_17_14-Transport - Thunderforest.jpg


 cjakeman, on 06 July 2020 - 08:25 AM, said:

No need for any action just yet. The API should not be problem for me, so I'm focussing on the client-side web pages at present. There's a lot of pitfalls along the way but it's interesting.

One issue with digital maps is that they try hard to be up to date. For content creators, it would be helpful to also have digital maps for specific years.


Chris,
I'm sure you remember the many discussions about GH and it's horrors. Both TrainSim and TZ use square tiles for there mapping, and not a trapezoid like GH. Historical maps and current map's depending on the source need to be converted to a common denominator using a GIS system. Then re-projected to a square system. For example USGS use's UTM for it's DEM data, when used with GH results in horrible skewing as Dave has noted.

Given that most current routes for OR, use MSTS, therefore are a GH projection, can be close or horrible. Thuderforst use's Web Mercator tile format, which the key-point being the map is conformal. The free QGIS system, or the internal parts like GDAL can be used for conversion. Goko with his world editor had a flag or parameter forget which to use square tiles. Then modified OR to use them. Rambling around here, I have a link here, or may have published it on the forms for conversions and accuracy using the British Ordinance System. Will look it up and post it in the next day or two.

Bill

#8 User is offline   BillC 

  • Conductor
  • Group: Private - Open Rails Developer
  • Posts: 322
  • Joined: 31-May 11
  • Gender:Male
  • Country:

Posted 24 July 2020 - 02:38 PM

 BillC, on 23 July 2020 - 06:54 PM, said:

Chris,
Rambling around here, I have a link here, or may have published it on the forms for conversions and accuracy using the British Ordinance System. Will look it up and post it in the next day or two.

Bill


Chris,
Here is the info I mentioned.
Coordinate tools Scroll half way down the page for this link Which is a PDF document, A few myths about coordinate systems , on P.6 might be entertaining . Section 7 has information on TM and UTM.

I hijacked this thread so will stop posting about this.

#9 User is offline   Howky 

  • Fireman
  • Group: Status: Active Member
  • Posts: 247
  • Joined: 14-February 13
  • Gender:Male
  • Location:Czech Republic
  • Simulator:Open Rails
  • Country:

Posted 11 August 2020 - 08:40 AM

Ts2020 use ThirdRails Map Tool
Link:
https://www.thirdrai...rails-map-tool/

Video:
ThirdRails Map Tool

#10 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,866
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 11 August 2020 - 10:06 AM

Thanks, Howky.

This might be a viable alternative to ThunderForest. It also shows some of the possibilities that a mapping feature can lead to.

You've given me some valuable encouragement - thanks.

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users