Skip to content

Commit

Permalink
Added simulation code for elevators.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaddox5 committed Oct 17, 2024
1 parent 8c89a6d commit ad774a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions assets/css/elevator_v2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@import "colors";
@import "v2/elevator/elevator_closures";
@import "v2/elevator/normal";
@import "v2/simulation_common";
@import "v2/lcd_common/simulation";

body {
margin: 0;
Expand Down
14 changes: 13 additions & 1 deletion assets/src/apps/v2/elevator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ScreenPage from "Components/v2/screen_page";
import { MappingContext } from "Components/v2/widget";
import MultiScreenPage from "Components/v2/multi_screen_page";
import ElevatorClosures from "Components/v2/elevator/elevator_closures";
import SimulationScreenPage from "Components/v2/simulation_screen_page";

const TYPE_TO_COMPONENT = {
normal: NormalScreen,
Expand All @@ -29,11 +30,22 @@ const App = (): JSX.Element => {
<Route exact path="/v2/screen/elevator_v2">
<MultiScreenPage components={TYPE_TO_COMPONENT} />
</Route>
<Route path="/v2/screen/:id">
<Route exact path="/v2/screen/:id">
<MappingContext.Provider value={TYPE_TO_COMPONENT}>
<ScreenPage />
</MappingContext.Provider>
</Route>
<Route
exact
path={[
"/v2/screen/:id/simulation",
"/v2/screen/pending/:id/simulation",
]}
>
<MappingContext.Provider value={TYPE_TO_COMPONENT}>
<SimulationScreenPage />
</MappingContext.Provider>
</Route>
</Switch>
</Router>
);
Expand Down

0 comments on commit ad774a0

Please sign in to comment.