Skip to content

Commit

Permalink
Add empty site button
Browse files Browse the repository at this point in the history
Signed-off-by: Audrow Nash <[email protected]>
  • Loading branch information
audrow committed Jul 6, 2023
1 parent f796e44 commit 8d226c3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
15 changes: 15 additions & 0 deletions assets/empty.site.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(
format_version: "0.1",
properties: (
name: "new_site",
),
levels: {
1: (
properties: (
name: "<unnamed level>",
elevation: 0.0,
),
anchors: {},
),
},
)
6 changes: 6 additions & 0 deletions rmf_site_editor/src/demo_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ pub fn demo_workcell() -> Vec<u8> {
.as_bytes()
.to_vec();
}

pub fn empty_site() -> Vec<u8> {
return include_str!("../../assets/empty.site.ron")
.as_bytes()
.to_vec();
}
12 changes: 8 additions & 4 deletions rmf_site_editor/src/main_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,20 @@ fn egui_ui(
ui.add_space(10.);

ui.horizontal(|ui| {
if ui.button("View demo map").clicked() {
_load_workspace.send(LoadWorkspace::Data(WorkspaceData::LegacyBuilding(
demo_office(),
)));
if ui.button("New site").clicked() {
_load_workspace.send(LoadWorkspace::Data(WorkspaceData::Site(empty_site())));
}

if ui.button("Open a file").clicked() {
_load_workspace.send(LoadWorkspace::Dialog);
}

if ui.button("View demo map").clicked() {
_load_workspace.send(LoadWorkspace::Data(WorkspaceData::LegacyBuilding(
demo_office(),
)));
}

// TODO(@mxgrey): Bring this back when we have finished developing
// the key features for workcell editing.
// if ui.button("Workcell Editor").clicked() {
Expand Down

0 comments on commit 8d226c3

Please sign in to comment.