Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EmbedIO web server graphical track monitor #226

Merged
merged 8 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Source/RunActivity/RunActivity.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
<Compile Include="Viewer3D\Viewer.cs" />
<Compile Include="Viewer3D\Water.cs" />
<Compile Include="Viewer3D\Weather.cs" />
<Compile Include="Viewer3D\WebServices\TrackMonitorDisplay.cs" />
<Compile Include="Viewer3D\WebServices\WebServer.cs" />
<Compile Include="Viewer3D\Wire.cs" />
<Compile Include="Viewer3D\World.cs" />
Expand Down Expand Up @@ -344,6 +345,9 @@
<Content Include="Viewer3D\WebServices\Web\index.css" />
<Content Include="Viewer3D\WebServices\Web\index.html" />
<Content Include="Viewer3D\WebServices\Web\or_logo.png" />
<Content Include="Viewer3D\WebServices\Web\TrackMonitor\SignalAspects.png" />
<Content Include="Viewer3D\WebServices\Web\TrackMonitor\TrackMonitorImages.png" />
<Content Include="Viewer3D\WebServices\Web\TrackMonitor\index.css" />
<Content Include="Viewer3D\WebServices\Web\TrackMonitor\index.html" />
<Content Include="Viewer3D\WebServices\Web\TrackMonitor\index.js" />
</ItemGroup>
Expand Down
1,110 changes: 1,110 additions & 0 deletions Source/RunActivity/Viewer3D/WebServices/TrackMonitorDisplay.cs

Large diffs are not rendered by default.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions Source/RunActivity/Viewer3D/WebServices/Web/TrackMonitor/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#table {
/*border-collapse: collapse;*/
padding: 20px;
border: 2px;
border-spacing: 2px;
/*border-spacing: 0;*/
}

table td{
color : white;
}

/* Apply rounded border */
.border{
border-spacing: 0;
border: gray 2px solid;
border-radius: 20px;
}

.button{
border: gray 1px solid;
border-radius: 20px;
text-align: center;
width: 50px;
margin: 4px 2px;
}

/* Allows to apply image color */
img[ColorCode= "%%$"]{/*lightgreen*/
filter: brightness(0.5) sepia(1) hue-rotate(50deg) saturate(1000%);
}
img[ColorCode= "!!?"]{/*orange*/
filter: brightness(0.8) sepia(1) hue-rotate(300deg) saturate(1000%);
}
img[ColorCode= "!!?"]{/*orangered*/
filter: brightness(0.5) sepia(1) hue-rotate(0deg) saturate(10000%);
}
img[ColorCode= "!!?"]{/*yellow*/
filter: brightness(0.8) sepia(1) hue-rotate(0deg) saturate(1000%);
}

/* Allows to apply text color */
td[ColorCode= "???"]{
background-color:black;
color:yellow;
}
td[ColorCode= "??!"]{
background-color:black;
color:Green;
}
td[ColorCode= "?!?"]{
background-color:black;
color:Black;
}
td[ColorCode= "?!!"]{
background-color:black;
color:PaleGreen;
}
td[ColorCode= "!??"]{
background-color:black;
color:White;
}
td[ColorCode= "!!?"]{
background-color:black;
color:Orange;
}
td[ColorCode= "!!!"]{
background-color:black;
color:OrangeRed;
}
td[ColorCode= "%%%"]{
background-color:black;
color:Cyan;
}
td[ColorCode= "%$$"]{
background-color: black;
color:brown;
}
td[ColorCode= "%%$"]{
background-color: black;
color:lightgreen;
}
td[ColorCode= "$%$"]{
background-color: black;
color:blue;
}
td[ColorCode= "$$$"]{
background-color:black;
color:LightSkyBlue;
}

/* Separator between diferent info area*/
.separator{
border-bottom: 1px solid gray;
}
.separatorred{
border-bottom: 1px solid red;
}
.separatordarkgray{
border-bottom: 1px solid darkgray;
}

/* Developper: Used as help for cells alignement*/
td{
/*border: black 1px solid;*/
border-spacing: 0;
border-radius: 7px;
padding: 0;
}
33 changes: 13 additions & 20 deletions Source/RunActivity/Viewer3D/WebServices/Web/TrackMonitor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,23 @@
-->
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"><!-- adds zooming for mobiles -->
<title>OR: Track Monitor API</title>
<link rel="shortcut icon" type="image/png" href="/or_logo.png"><!-- This icon appears in the page's tab and its bookmark. -->
<link rel="stylesheet" type="text/css" href="/index.css"><!-- share styles with home page -->
<script src="index.js"></script>
</head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"><!-- adds zooming for mobiles -->
<title>OR: Track Monitor API</title>
<link rel="shortcut icon" type="image/png" href="/or_logo.png"><!-- This icon appears in the page's tab and its bookmark. -->
<link rel="stylesheet" type="text/css" href="/index.css"><!-- share styles with home page -->
<link rel="stylesheet" type="text/css" href="index.css">

<body onload="setInterval (ApiTrackMonitor, 500)">
</head>
<body id="body" onload="setInterval (ApiTrackMonitor, 500)">
<p id="demo"></p>
<div id=menu><a href="/">Back to Menu</a></div>
<h2>Open Rails - Track Monitor (F4)</h2>

<div>
<table style="padding-left: 50px;">
<tr><td>Speed: </td><td id=speedMpS> </td><td>mph</td></tr>
<tr><td>Projected: </td><td id=projectedSpeedMpS> </td><td>mph</td></tr>
<tr><td>Limit: </td><td id=allowedSpeedMpS> </td><td>mph</td></tr>
<tr><td>Mode: </td><td id=controlMode> </td><td> </td></tr>
<tr><td>Inclination: </td><td id=currentElevationPercent></td><td>% </td></tr>
<tr><td>Direction: </td><td id=direction> </td><td> </td></tr>
<tr><td>Cab Orientation:</td><td id=cabOrientation> </td><td> </td></tr>
<tr><td>On Path: </td><td id=isOnPath> </td><td> </td></tr>
<br/>
<button class="button" onclick="changePageColor()" id="buttonDN">Night</button>
<table class="border" style="background-color:black;" id="TrackMonitor">
</table>
</div>

<script src="index.js"></script>
</body>
</html>