-
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.
Display current FSM state in control panel (#61)
- Loading branch information
1 parent
242c454
commit e3a54fe
Showing
9 changed files
with
110 additions
and
12 deletions.
There are no files selected for viewing
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); | ||
} |
23 changes: 23 additions & 0 deletions
23
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,23 @@ | ||
import { State } from "@/services/PodSocketClient"; | ||
import "./StatusIndicator.css"; | ||
|
||
interface StatusIndicatorProps { | ||
state: State; | ||
} | ||
|
||
function StatusIndicator({ state }: StatusIndicatorProps) { | ||
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
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