-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 58-pod-improve-wheel-encoder-measurements
- Loading branch information
Showing
31 changed files
with
927 additions
and
275 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
.controlpanel { | ||
position: fixed; | ||
bottom: 0; | ||
width: 100%; | ||
background-color: black; | ||
height: 9%; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
control-station/src/components/StatusIndicator/StatusIndicator.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.status-indicator { | ||
background-color: lightgray; | ||
border-radius: 10px; | ||
padding: 1rem; | ||
margin: 2rem; | ||
} | ||
|
||
.group { | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.state-text { | ||
display: inline-block; | ||
vertical-align: middle; | ||
} | ||
|
||
.circle { | ||
width: 25px; | ||
height: 25px; | ||
border-radius: 50%; | ||
display: inline-block; | ||
vertical-align: middle; | ||
margin-right: 20px; | ||
background-color: gray; | ||
} | ||
|
||
.disconnected-state > .active { | ||
background-color: white; | ||
} | ||
|
||
.init-state > .active { | ||
background-color: pink; | ||
} | ||
|
||
.running-state > .active { | ||
background-color: green; | ||
} | ||
|
||
.stopped-state > .active { | ||
background-color: red; | ||
} | ||
|
||
.halted-state > .active { | ||
background-color: darkred; | ||
} | ||
|
||
.faulted-state > .active { | ||
background-color: darkred; | ||
} | ||
|
||
.load-state > .active { | ||
background-color: rgb(0, 100, 188); | ||
} |
26 changes: 26 additions & 0 deletions
26
control-station/src/components/StatusIndicator/StatusIndicator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useContext } from "react"; | ||
|
||
import PodContext from "@/services/PodContext"; | ||
import { State } from "@/services/PodSocketClient"; | ||
|
||
import "./StatusIndicator.css"; | ||
|
||
function StatusIndicator() { | ||
const { podData } = useContext(PodContext); | ||
const { state } = podData; | ||
|
||
return ( | ||
<div className="status-indicator"> | ||
{Object.values(State).map((s) => { | ||
return ( | ||
<div key={s} className={`group ${s.toLowerCase()}-state`}> | ||
<span className={`circle` + (s === state ? " active" : "")}></span> | ||
<div className="state-text">{s}</div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
} | ||
|
||
export default StatusIndicator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { createContext } from "react"; | ||
|
||
import PodSocketClient, { PodData } from "./PodSocketClient"; | ||
|
||
interface PodContext { | ||
podSocketClient: PodSocketClient; | ||
podData: Readonly<PodData>; | ||
} | ||
|
||
// Initialize with unusable object assuming proper values are always provided | ||
const PodContext = createContext<PodContext>({ | ||
podSocketClient: {} as PodSocketClient, | ||
podData: {} as PodData, | ||
}); | ||
|
||
export default PodContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.