Skip to content

Commit

Permalink
Field Monitor Help File
Browse files Browse the repository at this point in the history
  • Loading branch information
cpapplefamily committed Nov 30, 2024
1 parent 8224cdc commit df01a85
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 0 deletions.
51 changes: 51 additions & 0 deletions static/css/Field_monitor_display_help.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* Global body styles */
body {
font-family: Arial, sans-serif;
margin: 20px;
padding: 0;
}

/* Header styling */
h1 {
text-align: center;
color: #ffffff;
}

/* Container for all status items */
.status-container {
margin-top: 20px;
}

/* Individual status item styling */
.team-id {
display: flex;
align-items: center;
margin: 10px 0;
padding: 10px;
border-radius: 5px;
color: #333;
}

/* Color box for each status */
.status-color-box {
width: 50px;
height: 50px;
margin-right: 20px;
border-radius: 5px;
}

/* Description area for each status */
.status-description {
font-size: 16px;
}

/* Name of the status (bold) */
.status-name {
font-weight: bold;
}

/* Color code (italic) */
.status-code {
font-style: italic;
margin-left: 10px;
}
60 changes: 60 additions & 0 deletions templates/Field_monitor_display_help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Team Status Color Legend</title>
<link rel="stylesheet" href="/static/css/Field_monitor_display.css" />
<link rel="stylesheet" href="/static/css/Field_monitor_display_help.css" />
</head>
<body>

<h1>Team Status Color Legend</h1>

<div class="status-container">
<div class="team-id" data-status="no-link" >
<div class="status-description">
<span class="status-name">No Link:</span>
<p>This status indicates that the team is not connected to the system.</p>
</div>
</div>

<div class="team-id" data-status="ds-linked">
<div class="status-description">
<span class="status-name">DS Linked:</span>
<p>This status indicates that the team is linked to the Driver Station (DS).</p>
</div>
</div>

<div class="team-id" data-status="robot-linked">

<div class="status-description">
<span class="status-name">Robot Linked:</span>
<p>This status indicates that the team's robot is linked and ready to operate.</p>
</div>
</div>

<div class="team-id" data-status="rio-linked">
<div class="status-description">
<span class="status-name">RIO Linked:</span>
<p>This status indicates that the team's Robot Interface (RIO) is linked.</p>
</div>
</div>

<div class="team-id" data-status="radio-linked">
<div class="status-description">
<span class="status-name">Radio Linked:</span>
<p>This status indicates that the team's robot is successfully linked to the radio.</p>
</div>
</div>

<div class="team-id" data-status="wrong-station">
<div class="status-description">
<span class="status-name">Wrong Station:</span>
<p>This status indicates that the team is in the wrong station.</p>
</div>
</div>
</div>

</body>
</html>
6 changes: 6 additions & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
<a class="dropdown-item" href="/displays/alliance_station?station=N1">Blue Score</a>
</div>
</li>
<li class="nav-item dropdown">
<a href="#" class="nav-link" data-bs-toggle="dropdown" role="button">Help</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="/field_monitor_help">Field Monitor Color Code</a>
</div>
</li>
</ul>
<ul class="navbar-nav ms-auto">
<li class="navbar-item">
Expand Down
Empty file.
33 changes: 33 additions & 0 deletions web/field_monitor_display_help.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2018 Team 254. All Rights Reserved.
// Author: [email protected] (Patrick Fairbank)
//
// Web handlers for the field monitor display showing robot connection status.

package web

import (
"github.com/Team254/cheesy-arena/game"
"github.com/Team254/cheesy-arena/model"
"net/http"
)

// Renders the field monitor display.
func (web *Web) fieldMonitorDisplayHelpHandler(w http.ResponseWriter, r *http.Request) {


template, err := web.parseFiles("templates/field_monitor_display_help.html")
if err != nil {
handleWebErr(w, err)
return
}
data := struct {
*model.EventSettings
MatchSounds []*game.MatchSound
}{web.arena.EventSettings, game.MatchSounds}
err = template.ExecuteTemplate(w, "field_monitor_display_help.html", data)
if err != nil {
handleWebErr(w, err)
return
}

}
1 change: 1 addition & 0 deletions web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func (web *Web) newHandler() http.Handler {
mux.HandleFunc("GET /api/sponsor_slides", web.sponsorSlidesApiHandler)
mux.HandleFunc("GET /api/teams/{teamId}/avatar", web.teamAvatarsApiHandler)
mux.HandleFunc("GET /display", web.placeholderDisplayHandler)
mux.HandleFunc("GET /field_monitor_help", web.fieldMonitorDisplayHelpHandler)
mux.HandleFunc("GET /display/websocket", web.placeholderDisplayWebsocketHandler)
mux.HandleFunc("GET /displays/alliance_station", web.allianceStationDisplayHandler)
mux.HandleFunc("GET /displays/alliance_station/websocket", web.allianceStationDisplayWebsocketHandler)
Expand Down

0 comments on commit df01a85

Please sign in to comment.