Skip to content

Commit c16d0d2

Browse files
committed
[choreo] Add button to generate all trajectories
Signed-off-by: Jade Turner <[email protected]>
1 parent 1e3e2a9 commit c16d0d2

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

src/components/sidebar/Sidebar.tsx

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ import { Divider, IconButton, Tooltip } from "@mui/material";
66
import WaypointList from "./WaypointList";
77
import PathSelector from "./PathSelector";
88
import MenuIcon from "@mui/icons-material/Menu";
9-
import { ContentCopy, Redo, ShapeLine, Undo } from "@mui/icons-material";
9+
import {
10+
ContentCopy,
11+
Redo,
12+
ShapeLine,
13+
Polyline,
14+
Undo
15+
} from "@mui/icons-material";
1016
import Add from "@mui/icons-material/Add";
1117
import SidebarConstraint from "./SidebarConstraint";
1218
import SidebarEventMarker from "./SidebarEventMarker";
@@ -86,9 +92,24 @@ class Sidebar extends Component<Props, State> {
8692
</div>
8793
<div
8894
className={styles.SidebarHeading}
89-
style={{ gridTemplateColumns: "auto 33.6px 33.6px 33.6px" }}
95+
style={{ gridTemplateColumns: "auto 33.6px 33.6px 33.6px 33.6px" }}
9096
>
9197
PATHS
98+
<Tooltip disableInteractive title="Generate All">
99+
<span>
100+
<IconButton
101+
size="small"
102+
color="default"
103+
style={{
104+
float: "right"
105+
}}
106+
disabled={Object.keys(doc.pathlist.paths).length == 0}
107+
onClick={() => doc.generateAll()}
108+
>
109+
<Polyline fontSize="small"></Polyline>
110+
</IconButton>
111+
</span>
112+
</Tooltip>
92113
<Tooltip disableInteractive title="Generate All Outdated">
93114
<span>
94115
<IconButton

src/document/DocumentModel.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ export const DocumentStore = types
160160
self.history.redo();
161161
}
162162
},
163+
async generateAll() {
164+
const uuidsToGenerate: string[] = [];
165+
self.pathlist.paths.forEach((pathStore) => {
166+
uuidsToGenerate.push(pathStore.uuid);
167+
});
168+
await Promise.allSettled(uuidsToGenerate.map(this.generatePath));
169+
},
163170
async generateAllOutdated() {
164171
const uuidsToGenerate: string[] = [];
165172
self.pathlist.paths.forEach((pathStore) => {

0 commit comments

Comments
 (0)