mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-13 11:38:53 +00:00
feat!: refactor profile to modularize features
This commit is contained in:
parent
99e92709b1
commit
a58fb365c9
9 changed files with 213 additions and 102 deletions
|
@ -4,7 +4,7 @@ use crate::{constants::PKG_DATA_DIR, profile::Profile, runner::Runner};
|
||||||
pub fn get_build_basalt_runner(profile: Profile) -> Runner {
|
pub fn get_build_basalt_runner(profile: Profile) -> Runner {
|
||||||
let mut args = vec![
|
let mut args = vec![
|
||||||
profile
|
profile
|
||||||
.basalt_path
|
.features.basalt.path
|
||||||
.expect_dialog("Missing basalt path for given profile"),
|
.expect_dialog("Missing basalt path for given profile"),
|
||||||
profile.prefix,
|
profile.prefix,
|
||||||
match profile.pull_on_build {
|
match profile.pull_on_build {
|
||||||
|
@ -12,8 +12,8 @@ pub fn get_build_basalt_runner(profile: Profile) -> Runner {
|
||||||
false => "0".into(),
|
false => "0".into(),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if profile.basalt_repo.is_some() {
|
if profile.features.basalt.repo.is_some() {
|
||||||
args.push(profile.basalt_repo.unwrap());
|
args.push(profile.features.basalt.repo.unwrap());
|
||||||
}
|
}
|
||||||
let runner = Runner::new(
|
let runner = Runner::new(
|
||||||
None,
|
None,
|
||||||
|
|
|
@ -4,7 +4,7 @@ use expect_dialog::ExpectDialog;
|
||||||
pub fn get_build_libsurvive_runner(profile: Profile) -> Runner {
|
pub fn get_build_libsurvive_runner(profile: Profile) -> Runner {
|
||||||
let mut args = vec![
|
let mut args = vec![
|
||||||
profile
|
profile
|
||||||
.libsurvive_path
|
.features.libsurvive.path
|
||||||
.expect_dialog("Missing libsurvive path for given profile"),
|
.expect_dialog("Missing libsurvive path for given profile"),
|
||||||
profile.prefix,
|
profile.prefix,
|
||||||
match profile.pull_on_build {
|
match profile.pull_on_build {
|
||||||
|
@ -12,8 +12,8 @@ pub fn get_build_libsurvive_runner(profile: Profile) -> Runner {
|
||||||
false => "0".into(),
|
false => "0".into(),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if profile.libsurvive_repo.is_some() {
|
if profile.features.libsurvive.repo.is_some() {
|
||||||
args.push(profile.libsurvive_repo.unwrap());
|
args.push(profile.features.libsurvive.repo.unwrap());
|
||||||
}
|
}
|
||||||
let runner = Runner::new(
|
let runner = Runner::new(
|
||||||
None,
|
None,
|
||||||
|
|
170
src/profile.rs
170
src/profile.rs
|
@ -43,24 +43,93 @@ impl Display for XRServiceType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
pub enum ProfileFeatureType {
|
||||||
|
Libsurvive,
|
||||||
|
Basalt,
|
||||||
|
Mercury,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileFeatureType {
|
||||||
|
pub fn from_string(s: String) -> Self {
|
||||||
|
match s.trim().to_lowercase().as_str() {
|
||||||
|
"libsurvive" => Self::Libsurvive,
|
||||||
|
"basalt" => Self::Basalt,
|
||||||
|
"mercury" => Self::Mercury,
|
||||||
|
_ => panic!("Unknown profile feature type"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn iter() -> Iter<'static, ProfileFeatureType> {
|
||||||
|
[Self::Libsurvive, Self::Basalt, Self::Mercury].iter()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Display for ProfileFeatureType {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
f.write_str(match self {
|
||||||
|
Self::Libsurvive => "Libsurvive",
|
||||||
|
Self::Basalt => "Basalt",
|
||||||
|
Self::Mercury => "Mercury",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
pub struct ProfileFeature {
|
||||||
|
pub feature_type: ProfileFeatureType,
|
||||||
|
pub enabled: bool,
|
||||||
|
pub path: Option<String>,
|
||||||
|
pub repo: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for ProfileFeature {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
feature_type: ProfileFeatureType::Libsurvive,
|
||||||
|
enabled: false,
|
||||||
|
path: None,
|
||||||
|
repo: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
pub struct ProfileFeatures {
|
||||||
|
pub libsurvive: ProfileFeature,
|
||||||
|
pub basalt: ProfileFeature,
|
||||||
|
pub mercury: ProfileFeature,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for ProfileFeatures {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
libsurvive: ProfileFeature {
|
||||||
|
feature_type: ProfileFeatureType::Libsurvive,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
basalt: ProfileFeature {
|
||||||
|
feature_type: ProfileFeatureType::Basalt,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
mercury: ProfileFeature {
|
||||||
|
feature_type: ProfileFeatureType::Mercury,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct Profile {
|
pub struct Profile {
|
||||||
pub uuid: String,
|
pub uuid: String,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub xrservice_path: String,
|
|
||||||
pub xrservice_type: XRServiceType,
|
pub xrservice_type: XRServiceType,
|
||||||
pub opencomposite_path: String,
|
pub xrservice_path: String,
|
||||||
pub libsurvive_path: Option<String>,
|
|
||||||
pub basalt_path: Option<String>,
|
|
||||||
pub mercury_path: Option<String>,
|
|
||||||
pub libsurvive_enabled: bool,
|
|
||||||
pub basalt_enabled: bool,
|
|
||||||
pub mercury_enabled: bool,
|
|
||||||
pub xrservice_repo: Option<String>,
|
pub xrservice_repo: Option<String>,
|
||||||
|
pub opencomposite_path: String,
|
||||||
pub opencomposite_repo: Option<String>,
|
pub opencomposite_repo: Option<String>,
|
||||||
pub libsurvive_repo: Option<String>,
|
pub features: ProfileFeatures,
|
||||||
pub basalt_repo: Option<String>,
|
|
||||||
pub mercury_repo: Option<String>,
|
|
||||||
pub environment: HashMap<String, String>,
|
pub environment: HashMap<String, String>,
|
||||||
/** Install prefix */
|
/** Install prefix */
|
||||||
pub prefix: String,
|
pub prefix: String,
|
||||||
|
@ -83,12 +152,20 @@ impl Default for Profile {
|
||||||
xrservice_path: data_monado_path(),
|
xrservice_path: data_monado_path(),
|
||||||
xrservice_type: XRServiceType::Monado,
|
xrservice_type: XRServiceType::Monado,
|
||||||
opencomposite_path: data_opencomposite_path(),
|
opencomposite_path: data_opencomposite_path(),
|
||||||
basalt_path: None,
|
features: ProfileFeatures {
|
||||||
mercury_path: None,
|
libsurvive: ProfileFeature {
|
||||||
libsurvive_path: None,
|
feature_type: ProfileFeatureType::Libsurvive,
|
||||||
basalt_enabled: false,
|
..Default::default()
|
||||||
mercury_enabled: false,
|
},
|
||||||
libsurvive_enabled: false,
|
basalt: ProfileFeature {
|
||||||
|
feature_type: ProfileFeatureType::Basalt,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
mercury: ProfileFeature {
|
||||||
|
feature_type: ProfileFeatureType::Mercury,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
},
|
||||||
environment: HashMap::new(),
|
environment: HashMap::new(),
|
||||||
prefix: format!(
|
prefix: format!(
|
||||||
"{data}/prefixes/default_profile_prefix",
|
"{data}/prefixes/default_profile_prefix",
|
||||||
|
@ -98,9 +175,6 @@ impl Default for Profile {
|
||||||
pull_on_build: true,
|
pull_on_build: true,
|
||||||
xrservice_repo: None,
|
xrservice_repo: None,
|
||||||
opencomposite_repo: None,
|
opencomposite_repo: None,
|
||||||
libsurvive_repo: None,
|
|
||||||
basalt_repo: None,
|
|
||||||
mercury_repo: None,
|
|
||||||
editable: true,
|
editable: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,21 +230,27 @@ impl Profile {
|
||||||
&& !self.uuid.is_empty()
|
&& !self.uuid.is_empty()
|
||||||
&& !self.xrservice_path.is_empty()
|
&& !self.xrservice_path.is_empty()
|
||||||
&& !self.prefix.is_empty()
|
&& !self.prefix.is_empty()
|
||||||
&& (!self.libsurvive_enabled
|
&& (!self.features.libsurvive.enabled
|
||||||
|| !self
|
|| !self
|
||||||
.libsurvive_path
|
.features
|
||||||
|
.libsurvive
|
||||||
|
.path
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.unwrap_or(&"".to_string())
|
.unwrap_or(&"".to_string())
|
||||||
.is_empty())
|
.is_empty())
|
||||||
&& (!self.basalt_enabled
|
&& (!self.features.basalt.enabled
|
||||||
|| !self
|
|| !self
|
||||||
.basalt_path
|
.features
|
||||||
|
.basalt
|
||||||
|
.path
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.unwrap_or(&"".to_string())
|
.unwrap_or(&"".to_string())
|
||||||
.is_empty())
|
.is_empty())
|
||||||
&& (!self.mercury_enabled
|
&& (!self.features.mercury.enabled
|
||||||
|| !self
|
|| !self
|
||||||
.mercury_path
|
.features
|
||||||
|
.mercury
|
||||||
|
.path
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.unwrap_or(&"".to_string())
|
.unwrap_or(&"".to_string())
|
||||||
.is_empty())
|
.is_empty())
|
||||||
|
@ -181,7 +261,7 @@ impl Profile {
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use crate::profile::XRServiceType;
|
use crate::profile::{ProfileFeature, ProfileFeatureType, ProfileFeatures, XRServiceType};
|
||||||
|
|
||||||
use super::Profile;
|
use super::Profile;
|
||||||
|
|
||||||
|
@ -193,14 +273,14 @@ mod tests {
|
||||||
assert_eq!(profile.opencomposite_path, "/home/user/opencomposite");
|
assert_eq!(profile.opencomposite_path, "/home/user/opencomposite");
|
||||||
assert_eq!(profile.prefix, "/home/user/rex2prefix");
|
assert_eq!(profile.prefix, "/home/user/rex2prefix");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
profile.libsurvive_path.as_deref(),
|
profile.features.libsurvive.path.as_deref(),
|
||||||
Some("/home/user/libsurvive")
|
Some("/home/user/libsurvive")
|
||||||
);
|
);
|
||||||
assert_eq!(profile.mercury_path, None);
|
assert_eq!(profile.features.mercury.path, None);
|
||||||
assert_eq!(profile.basalt_path, None);
|
assert_eq!(profile.features.basalt.path, None);
|
||||||
assert_eq!(profile.libsurvive_enabled, true);
|
assert_eq!(profile.features.libsurvive.enabled, true);
|
||||||
assert_eq!(profile.basalt_enabled, false);
|
assert_eq!(profile.features.basalt.enabled, false);
|
||||||
assert_eq!(profile.mercury_enabled, false);
|
assert_eq!(profile.features.mercury.enabled, false);
|
||||||
assert!(profile
|
assert!(profile
|
||||||
.environment
|
.environment
|
||||||
.contains_key("XRT_COMPOSITOR_SCALE_PERCENTAGE"));
|
.contains_key("XRT_COMPOSITOR_SCALE_PERCENTAGE"));
|
||||||
|
@ -221,12 +301,22 @@ mod tests {
|
||||||
xrservice_path: String::from("/home/user/monado"),
|
xrservice_path: String::from("/home/user/monado"),
|
||||||
xrservice_type: XRServiceType::Monado,
|
xrservice_type: XRServiceType::Monado,
|
||||||
opencomposite_path: String::from("/home/user/opencomposite"),
|
opencomposite_path: String::from("/home/user/opencomposite"),
|
||||||
libsurvive_path: Some(String::from("/home/user/libsurvive")),
|
features: ProfileFeatures {
|
||||||
basalt_path: None,
|
libsurvive: ProfileFeature {
|
||||||
mercury_path: None,
|
feature_type: ProfileFeatureType::Libsurvive,
|
||||||
libsurvive_enabled: true,
|
enabled: true,
|
||||||
basalt_enabled: false,
|
path: Some(String::from("/home/user/libsurvive")),
|
||||||
mercury_enabled: false,
|
repo: None,
|
||||||
|
},
|
||||||
|
basalt: ProfileFeature {
|
||||||
|
feature_type: ProfileFeatureType::Basalt,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
mercury: ProfileFeature {
|
||||||
|
feature_type: ProfileFeatureType::Mercury,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
},
|
||||||
environment: env,
|
environment: env,
|
||||||
prefix: String::from("/home/user/rex2prefix"),
|
prefix: String::from("/home/user/rex2prefix"),
|
||||||
editable: true,
|
editable: true,
|
||||||
|
@ -237,7 +327,7 @@ mod tests {
|
||||||
let loaded = Profile::load_profile(&fpath);
|
let loaded = Profile::load_profile(&fpath);
|
||||||
assert_eq!(loaded.name, "Demo profile");
|
assert_eq!(loaded.name, "Demo profile");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
loaded.libsurvive_path,
|
loaded.features.libsurvive.path,
|
||||||
Some(String::from("/home/user/libsurvive"))
|
Some(String::from("/home/user/libsurvive"))
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
use crate::{constants::APP_NAME, paths::{data_opencomposite_path, SYSTEM_PREFIX}, profile::{Profile, XRServiceType}};
|
use crate::{
|
||||||
|
constants::APP_NAME,
|
||||||
|
paths::{data_opencomposite_path, SYSTEM_PREFIX},
|
||||||
|
profile::{Profile, ProfileFeatures, XRServiceType},
|
||||||
|
};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
pub fn system_valve_index_profile() -> Profile {
|
pub fn system_valve_index_profile() -> Profile {
|
||||||
|
@ -13,12 +17,9 @@ pub fn system_valve_index_profile() -> Profile {
|
||||||
opencomposite_path: data_opencomposite_path(),
|
opencomposite_path: data_opencomposite_path(),
|
||||||
xrservice_path: "".into(),
|
xrservice_path: "".into(),
|
||||||
xrservice_type: XRServiceType::Monado,
|
xrservice_type: XRServiceType::Monado,
|
||||||
libsurvive_path: None,
|
features: ProfileFeatures {
|
||||||
basalt_path: None,
|
..Default::default()
|
||||||
mercury_path: None,
|
},
|
||||||
libsurvive_enabled: false,
|
|
||||||
mercury_enabled: false,
|
|
||||||
basalt_enabled: false,
|
|
||||||
environment,
|
environment,
|
||||||
prefix: SYSTEM_PREFIX.into(),
|
prefix: SYSTEM_PREFIX.into(),
|
||||||
can_be_built: false,
|
can_be_built: false,
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
use crate::{constants::APP_NAME, file_utils::get_data_dir, profile::{Profile, XRServiceType}, paths::{data_monado_path, data_opencomposite_path, data_libsurvive_path}};
|
use crate::{
|
||||||
|
constants::APP_NAME,
|
||||||
|
file_utils::get_data_dir,
|
||||||
|
paths::{data_libsurvive_path, data_monado_path, data_opencomposite_path},
|
||||||
|
profile::{Profile, ProfileFeature, ProfileFeatureType, ProfileFeatures, XRServiceType},
|
||||||
|
};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
pub fn valve_index_profile() -> Profile {
|
pub fn valve_index_profile() -> Profile {
|
||||||
|
@ -16,12 +21,15 @@ pub fn valve_index_profile() -> Profile {
|
||||||
xrservice_path: data_monado_path(),
|
xrservice_path: data_monado_path(),
|
||||||
xrservice_type: XRServiceType::Monado,
|
xrservice_type: XRServiceType::Monado,
|
||||||
opencomposite_path: data_opencomposite_path(),
|
opencomposite_path: data_opencomposite_path(),
|
||||||
libsurvive_path: Some(data_libsurvive_path()),
|
features: ProfileFeatures {
|
||||||
basalt_path: None,
|
libsurvive: ProfileFeature {
|
||||||
mercury_path: None,
|
feature_type: ProfileFeatureType::Libsurvive,
|
||||||
libsurvive_enabled: true,
|
enabled: true,
|
||||||
basalt_enabled: false,
|
path: Some(data_libsurvive_path()),
|
||||||
mercury_enabled: false,
|
repo: None,
|
||||||
|
},
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
environment,
|
environment,
|
||||||
prefix,
|
prefix,
|
||||||
can_be_built: true,
|
can_be_built: true,
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
|
use crate::{
|
||||||
|
constants::APP_NAME,
|
||||||
|
file_utils::get_data_dir,
|
||||||
|
paths::{data_opencomposite_path, data_wivrn_path},
|
||||||
|
profile::{Profile, ProfileFeatures, XRServiceType},
|
||||||
|
};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use crate::{file_utils::get_data_dir, profile::{Profile, XRServiceType}, paths::{data_wivrn_path, data_opencomposite_path}, constants::APP_NAME};
|
|
||||||
|
|
||||||
pub fn wivrn_profile() -> Profile {
|
pub fn wivrn_profile() -> Profile {
|
||||||
let data_dir = get_data_dir();
|
let data_dir = get_data_dir();
|
||||||
let prefix = format!("{data}/prefixes/wivrn_default", data = data_dir);
|
let prefix = format!("{data}/prefixes/wivrn_default", data = data_dir);
|
||||||
|
@ -13,12 +17,9 @@ pub fn wivrn_profile() -> Profile {
|
||||||
xrservice_path: data_wivrn_path(),
|
xrservice_path: data_wivrn_path(),
|
||||||
xrservice_type: XRServiceType::Wivrn,
|
xrservice_type: XRServiceType::Wivrn,
|
||||||
opencomposite_path: data_opencomposite_path(),
|
opencomposite_path: data_opencomposite_path(),
|
||||||
libsurvive_path: None,
|
features: ProfileFeatures {
|
||||||
basalt_path: None,
|
..Default::default()
|
||||||
mercury_path: None,
|
},
|
||||||
libsurvive_enabled: false,
|
|
||||||
basalt_enabled: false,
|
|
||||||
mercury_enabled: false,
|
|
||||||
environment,
|
environment,
|
||||||
prefix,
|
prefix,
|
||||||
can_be_built: true,
|
can_be_built: true,
|
||||||
|
|
|
@ -285,15 +285,15 @@ impl SimpleComponent for App {
|
||||||
XRServiceType::Monado => get_missing_monado_deps(),
|
XRServiceType::Monado => get_missing_monado_deps(),
|
||||||
XRServiceType::Wivrn => get_missing_wivrn_deps(),
|
XRServiceType::Wivrn => get_missing_wivrn_deps(),
|
||||||
});
|
});
|
||||||
if profile.libsurvive_enabled {
|
if profile.features.libsurvive.enabled {
|
||||||
missing_deps.extend(get_missing_libsurvive_deps());
|
missing_deps.extend(get_missing_libsurvive_deps());
|
||||||
runners.push(get_build_libsurvive_runner(profile.clone()));
|
runners.push(get_build_libsurvive_runner(profile.clone()));
|
||||||
}
|
}
|
||||||
if profile.basalt_enabled {
|
if profile.features.basalt.enabled {
|
||||||
missing_deps.extend(get_missing_basalt_deps());
|
missing_deps.extend(get_missing_basalt_deps());
|
||||||
runners.push(get_build_basalt_runner(profile.clone()));
|
runners.push(get_build_basalt_runner(profile.clone()));
|
||||||
}
|
}
|
||||||
// if profile.mercury_enabled {
|
// if profile.features.mercury.enabled {
|
||||||
// missing_deps.extend(get_missing_mercury_deps());
|
// missing_deps.extend(get_missing_mercury_deps());
|
||||||
// runners.push(get_build_mercury_runner(profile.clone()));
|
// runners.push(get_build_mercury_runner(profile.clone()));
|
||||||
// }
|
// }
|
||||||
|
|
|
@ -148,19 +148,19 @@ impl SimpleComponent for ProfileEditor {
|
||||||
name: "Libsurvive".into(),
|
name: "Libsurvive".into(),
|
||||||
description: Some("Lighthouse based spacial tracking".into()),
|
description: Some("Lighthouse based spacial tracking".into()),
|
||||||
key: "libsurvive_enabled".into(),
|
key: "libsurvive_enabled".into(),
|
||||||
value: p.libsurvive_enabled,
|
value: p.features.libsurvive.enabled,
|
||||||
});
|
});
|
||||||
guard.push_back(SwitchModelInit {
|
guard.push_back(SwitchModelInit {
|
||||||
name: "Basalt".into(),
|
name: "Basalt".into(),
|
||||||
description: Some("Camera based SLAM tracking".into()),
|
description: Some("Camera based SLAM tracking".into()),
|
||||||
key: "basalt_enabled".into(),
|
key: "basalt_enabled".into(),
|
||||||
value: p.basalt_enabled,
|
value: p.features.basalt.enabled,
|
||||||
});
|
});
|
||||||
guard.push_back(SwitchModelInit {
|
guard.push_back(SwitchModelInit {
|
||||||
name: "Mercury".into(),
|
name: "Mercury".into(),
|
||||||
description: Some("Camera based hand tracking".into()),
|
description: Some("Camera based hand tracking".into()),
|
||||||
key: "mercury_enabled".into(),
|
key: "mercury_enabled".into(),
|
||||||
value: p.mercury_enabled,
|
value: p.features.mercury.enabled,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,17 +180,17 @@ impl SimpleComponent for ProfileEditor {
|
||||||
guard.push_back(PathModelInit {
|
guard.push_back(PathModelInit {
|
||||||
name: "Libsurvive Path".into(),
|
name: "Libsurvive Path".into(),
|
||||||
key: "libsurvive_path".into(),
|
key: "libsurvive_path".into(),
|
||||||
value: p.libsurvive_path,
|
value: p.features.libsurvive.path,
|
||||||
});
|
});
|
||||||
guard.push_back(PathModelInit {
|
guard.push_back(PathModelInit {
|
||||||
name: "Basalt Path".into(),
|
name: "Basalt Path".into(),
|
||||||
key: "basalt_path".into(),
|
key: "basalt_path".into(),
|
||||||
value: p.basalt_path,
|
value: p.features.basalt.path,
|
||||||
});
|
});
|
||||||
guard.push_back(PathModelInit {
|
guard.push_back(PathModelInit {
|
||||||
name: "Mercury Path".into(),
|
name: "Mercury Path".into(),
|
||||||
key: "mercury_path".into(),
|
key: "mercury_path".into(),
|
||||||
value: p.mercury_path,
|
value: p.features.mercury.path,
|
||||||
});
|
});
|
||||||
guard.push_back(PathModelInit {
|
guard.push_back(PathModelInit {
|
||||||
name: "Install Prefix".into(),
|
name: "Install Prefix".into(),
|
||||||
|
@ -215,17 +215,17 @@ impl SimpleComponent for ProfileEditor {
|
||||||
guard.push_back(EntryModelInit {
|
guard.push_back(EntryModelInit {
|
||||||
key: "libsurvive_repo".into(),
|
key: "libsurvive_repo".into(),
|
||||||
name: "Libsurvive Repo".into(),
|
name: "Libsurvive Repo".into(),
|
||||||
value: p.libsurvive_repo.unwrap_or("".into()),
|
value: p.features.libsurvive.repo.unwrap_or("".into()),
|
||||||
});
|
});
|
||||||
guard.push_back(EntryModelInit {
|
guard.push_back(EntryModelInit {
|
||||||
key: "basalt_repo".into(),
|
key: "basalt_repo".into(),
|
||||||
name: "Basalt Repo".into(),
|
name: "Basalt Repo".into(),
|
||||||
value: p.basalt_repo.unwrap_or("".into()),
|
value: p.features.basalt.repo.unwrap_or("".into()),
|
||||||
});
|
});
|
||||||
guard.push_back(EntryModelInit {
|
guard.push_back(EntryModelInit {
|
||||||
key: "mercury_repo".into(),
|
key: "mercury_repo".into(),
|
||||||
name: "Mercury Repo".into(),
|
name: "Mercury Repo".into(),
|
||||||
value: p.mercury_repo.unwrap_or("".into()),
|
value: p.features.mercury.repo.unwrap_or("".into()),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,9 +271,9 @@ impl SimpleComponent for ProfileEditor {
|
||||||
"opencomposite_path" => {
|
"opencomposite_path" => {
|
||||||
prof.opencomposite_path = value.unwrap_or("".to_string())
|
prof.opencomposite_path = value.unwrap_or("".to_string())
|
||||||
}
|
}
|
||||||
"libsurvive_path" => prof.libsurvive_path = value,
|
"libsurvive_path" => prof.features.libsurvive.path = value,
|
||||||
"basalt_path" => prof.basalt_path = value,
|
"basalt_path" => prof.features.basalt.path = value,
|
||||||
"mercury_path" => prof.mercury_path = value,
|
"mercury_path" => prof.features.mercury.path = value,
|
||||||
"prefix" => prof.prefix = value.unwrap_or("".to_string()),
|
"prefix" => prof.prefix = value.unwrap_or("".to_string()),
|
||||||
_ => panic!("Unknown profile path key"),
|
_ => panic!("Unknown profile path key"),
|
||||||
}
|
}
|
||||||
|
@ -281,9 +281,9 @@ impl SimpleComponent for ProfileEditor {
|
||||||
Self::Input::SwitchChanged(key, value) => {
|
Self::Input::SwitchChanged(key, value) => {
|
||||||
let prof = self.profile.as_mut().unwrap();
|
let prof = self.profile.as_mut().unwrap();
|
||||||
match key.as_str() {
|
match key.as_str() {
|
||||||
"libsurvive_enabled" => prof.libsurvive_enabled = value,
|
"libsurvive_enabled" => prof.features.libsurvive.enabled = value,
|
||||||
"basalt_enabled" => prof.basalt_enabled = value,
|
"basalt_enabled" => prof.features.basalt.enabled = value,
|
||||||
"mercury_enabled" => prof.mercury_enabled = value,
|
"mercury_enabled" => prof.features.mercury.enabled = value,
|
||||||
"pull_on_build" => prof.pull_on_build = value,
|
"pull_on_build" => prof.pull_on_build = value,
|
||||||
_ => panic!("Unknown profile switch key"),
|
_ => panic!("Unknown profile switch key"),
|
||||||
}
|
}
|
||||||
|
@ -305,19 +305,19 @@ impl SimpleComponent for ProfileEditor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"libsurvive_repo" => {
|
"libsurvive_repo" => {
|
||||||
prof.libsurvive_repo = match value.trim() {
|
prof.features.libsurvive.repo = match value.trim() {
|
||||||
"" => None,
|
"" => None,
|
||||||
s => Some(s.to_string()),
|
s => Some(s.to_string()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"basalt_repo" => {
|
"basalt_repo" => {
|
||||||
prof.basalt_repo = match value.trim() {
|
prof.features.basalt.repo = match value.trim() {
|
||||||
"" => None,
|
"" => None,
|
||||||
s => Some(s.to_string()),
|
s => Some(s.to_string()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"mercury_repo" => {
|
"mercury_repo" => {
|
||||||
prof.mercury_repo = match value.trim() {
|
prof.features.mercury.repo = match value.trim() {
|
||||||
"" => None,
|
"" => None,
|
||||||
s => Some(s.to_string()),
|
s => Some(s.to_string()),
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,31 @@
|
||||||
{
|
{
|
||||||
"uuid": "demo",
|
"uuid": "demo",
|
||||||
"name": "Demo profile",
|
"name": "Demo profile",
|
||||||
"xrservice_path": "/home/user/monado",
|
|
||||||
"xrservice_type": "Monado",
|
"xrservice_type": "Monado",
|
||||||
|
"xrservice_path": "/home/user/monado",
|
||||||
|
"xrservice_repo": null,
|
||||||
"opencomposite_path": "/home/user/opencomposite",
|
"opencomposite_path": "/home/user/opencomposite",
|
||||||
"libsurvive_path": "/home/user/libsurvive",
|
"opencomposite_repo": null,
|
||||||
"basalt_path": null,
|
"features": {
|
||||||
"mercury_path": null,
|
"libsurvive": {
|
||||||
"libsurvive_enabled": true,
|
"feature_type": "Libsurvive",
|
||||||
"basalt_enabled": false,
|
"enabled": true,
|
||||||
"mercury_enabled": false,
|
"path": "/home/user/libsurvive",
|
||||||
|
"repo": null
|
||||||
|
},
|
||||||
|
"basalt": {
|
||||||
|
"feature_type": "Basalt",
|
||||||
|
"enabled": false,
|
||||||
|
"path": null,
|
||||||
|
"repo": null
|
||||||
|
},
|
||||||
|
"mercury": {
|
||||||
|
"feature_type": "Mercury",
|
||||||
|
"enabled": false,
|
||||||
|
"path": null,
|
||||||
|
"repo": null
|
||||||
|
}
|
||||||
|
},
|
||||||
"environment": {
|
"environment": {
|
||||||
"XRT_COMPOSITOR_SCALE_PERCENTAGE": "140",
|
"XRT_COMPOSITOR_SCALE_PERCENTAGE": "140",
|
||||||
"XRT_COMPOSITOR_COMPUTE": "1",
|
"XRT_COMPOSITOR_COMPUTE": "1",
|
||||||
|
@ -18,10 +34,5 @@
|
||||||
"prefix": "/home/user/rex2prefix",
|
"prefix": "/home/user/rex2prefix",
|
||||||
"can_be_built": true,
|
"can_be_built": true,
|
||||||
"editable": true,
|
"editable": true,
|
||||||
"pull_on_build": true,
|
"pull_on_build": true
|
||||||
"xrservice_repo": null,
|
|
||||||
"opencomposite_repo": null,
|
|
||||||
"libsurvive_repo": null,
|
|
||||||
"basalt_repo": null,
|
|
||||||
"mercury_repo": null
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue