Skip to content

Commit

Permalink
Digital Twin Graph
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbeitz committed May 9, 2024
1 parent ca47575 commit a0ce789
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 105 deletions.
119 changes: 76 additions & 43 deletions digital-twin-model/src/sdv_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub mod airbag_seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand All @@ -53,7 +53,7 @@ pub mod airbag_seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand All @@ -80,7 +80,7 @@ pub mod airbag_seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand All @@ -101,7 +101,7 @@ pub mod airbag_seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand Down Expand Up @@ -156,7 +156,7 @@ pub mod basic_airbag_seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct ENTITY_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand Down Expand Up @@ -242,7 +242,7 @@ pub mod cabin {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct ENTITY_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand Down Expand Up @@ -281,6 +281,20 @@ pub mod camera {
pub media_content: Vec<u8>,
}
}

#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct ENTITY_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
#[serde(rename = "@id")]
pub instance_id: String,
#[serde(rename = "@type")]
#[derivative(Default(value = "crate::sdv_v1::camera::ID.to_string()"))]
pub model_id: String,
}
}

pub mod hmi {
Expand All @@ -300,7 +314,7 @@ pub mod hmi {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand Down Expand Up @@ -335,6 +349,20 @@ pub mod hmi {
}
}

#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct ENTITY_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
#[serde(rename = "@id")]
pub instance_id: String,
#[serde(rename = "@type")]
#[derivative(Default(value = "crate::sdv_v1::hmi::ID.to_string()"))]
pub model_id: String,
}

pub mod status {
pub const ID: &str = "dtmi:sdv:hmi:status;1";
pub const NAME: &str = "status";
Expand Down Expand Up @@ -367,6 +395,20 @@ pub mod hvac {

pub type TYPE = bool;
}

#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct ENTITY_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
#[serde(rename = "@id")]
pub instance_id: String,
#[serde(rename = "@type")]
#[derivative(Default(value = "crate::sdv_v1::hvac::ID.to_string()"))]
pub model_id: String,
}
}

pub mod obd {
Expand All @@ -380,6 +422,20 @@ pub mod obd {

pub type TYPE = i32;
}

#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct ENTITY_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
#[serde(rename = "@id")]
pub instance_id: String,
#[serde(rename = "@type")]
#[derivative(Default(value = "crate::sdv_v1::obd::ID.to_string()"))]
pub model_id: String,
}
}

pub mod premium_airbag_seat_massager {
Expand All @@ -389,7 +445,7 @@ pub mod premium_airbag_seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct ENTITY_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand Down Expand Up @@ -427,7 +483,7 @@ pub mod seat {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct ENTITY_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand All @@ -449,20 +505,7 @@ pub mod seat_massager {
pub const NAME: &str = "sequence_names";
pub const DESCRIPTION: &str = "The name of each of the stored sequences.";

#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
#[serde(rename = "@type")]
#[derivative(Default(
value = "crate::sdv_v1::seat_massager::sequence_names::ID.to_string()"
))]
pub model_id: String,
pub value: Vec<String>,
}
pub type TYPE = Vec<String>;
}

pub mod load_sequence {
Expand All @@ -478,7 +521,7 @@ pub mod seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand All @@ -499,7 +542,7 @@ pub mod seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand All @@ -526,7 +569,7 @@ pub mod seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand All @@ -546,7 +589,7 @@ pub mod seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand All @@ -573,7 +616,7 @@ pub mod seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand All @@ -593,7 +636,7 @@ pub mod seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand All @@ -620,7 +663,7 @@ pub mod seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand All @@ -640,7 +683,7 @@ pub mod seat_massager {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct PAYLOAD_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand Down Expand Up @@ -684,18 +727,8 @@ pub mod vehicle {
pub type TYPE = String;
}

#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug, Default)]
pub struct TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
#[serde(rename = "@type")]
#[derivative(Default(
value = "crate::sdv_v1::vehicle::vehicle_identification::ID.to_string()"
))]
pub model_id: String,
pub vin: crate::sdv_v1::vehicle::vehicle_identification::vin::TYPE,
}
}
Expand All @@ -719,7 +752,7 @@ pub mod vehicle {
#[derive(derivative::Derivative)]
#[derivative(Default)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
pub struct TYPE {
pub struct ENTITY_TYPE {
#[serde(rename = "@context")]
#[derivative(Default(value = "crate::sdv_v1::context()"))]
pub context: Vec<String>,
Expand Down
Loading

0 comments on commit a0ce789

Please sign in to comment.