From f68041b75f4f763a13e782e44773bae1cf7ae10f Mon Sep 17 00:00:00 2001 From: Luca Della Vedova Date: Fri, 7 Jul 2023 10:08:07 +0800 Subject: [PATCH 1/2] Use stable toolchain for style CI checks (#144) Signed-off-by: Luca Della Vedova --- .github/workflows/style.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index 4896f6cf..8bf804c2 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -20,8 +20,6 @@ jobs: - name: rustfmt run: | - rustup toolchain install nightly - rustup default nightly rustup component add rustfmt - name: style From b5b5ab6eb0ffac158cd505b130c0353f8be9d083 Mon Sep 17 00:00:00 2001 From: Luca Della Vedova Date: Fri, 7 Jul 2023 12:52:44 +0800 Subject: [PATCH 2/2] Fix panic with new workspaces (#131) Signed-off-by: Luca Della Vedova Co-authored-by: Grey --- rmf_site_editor/src/workspace.rs | 10 ++++++++-- rmf_site_format/src/level.rs | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/rmf_site_editor/src/workspace.rs b/rmf_site_editor/src/workspace.rs index 96a923cc..ef7ec73f 100644 --- a/rmf_site_editor/src/workspace.rs +++ b/rmf_site_editor/src/workspace.rs @@ -17,6 +17,7 @@ use bevy::{prelude::*, tasks::AsyncComputeTaskPool}; use rfd::AsyncFileDialog; +use std::collections::BTreeMap; use std::path::PathBuf; use crate::interaction::InteractionState; @@ -24,7 +25,7 @@ use crate::site::LoadSite; use crate::workcell::LoadWorkcell; use crate::AppState; use rmf_site_format::legacy::building_map::BuildingMap; -use rmf_site_format::{Site, SiteProperties, Workcell}; +use rmf_site_format::{Level, Site, SiteProperties, Workcell}; use crossbeam_channel::{Receiver, Sender}; @@ -137,8 +138,13 @@ pub fn dispatch_new_workspace_events( println!("DEV ERROR: Sent generic change workspace while in main menu"); } AppState::SiteEditor => { + let mut levels = BTreeMap::new(); + levels.insert(0, Level::default()); load_site.send(LoadSite { - site: Site::default(), + site: Site { + levels, + ..default() + }, focus: true, default_file: None, }); diff --git a/rmf_site_format/src/level.rs b/rmf_site_format/src/level.rs index 39de1b5f..f6322384 100644 --- a/rmf_site_format/src/level.rs +++ b/rmf_site_format/src/level.rs @@ -38,7 +38,7 @@ impl Default for LevelProperties { } } -#[derive(Serialize, Deserialize, Debug, Clone)] +#[derive(Serialize, Deserialize, Debug, Clone, Default)] pub struct Level { pub properties: LevelProperties, pub anchors: BTreeMap,