Skip to content

Commit a0ce789

Browse files
committed
Digital Twin Graph
1 parent ca47575 commit a0ce789

File tree

7 files changed

+122
-105
lines changed

7 files changed

+122
-105
lines changed

digital-twin-model/src/sdv_v1.rs

+76-43
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub mod airbag_seat_massager {
3131
#[derive(derivative::Derivative)]
3232
#[derivative(Default)]
3333
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
34-
pub struct TYPE {
34+
pub struct PAYLOAD_TYPE {
3535
#[serde(rename = "@context")]
3636
#[derivative(Default(value = "crate::sdv_v1::context()"))]
3737
pub context: Vec<String>,
@@ -53,7 +53,7 @@ pub mod airbag_seat_massager {
5353
#[derive(derivative::Derivative)]
5454
#[derivative(Default)]
5555
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
56-
pub struct TYPE {
56+
pub struct PAYLOAD_TYPE {
5757
#[serde(rename = "@context")]
5858
#[derivative(Default(value = "crate::sdv_v1::context()"))]
5959
pub context: Vec<String>,
@@ -80,7 +80,7 @@ pub mod airbag_seat_massager {
8080
#[derive(derivative::Derivative)]
8181
#[derivative(Default)]
8282
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
83-
pub struct TYPE {
83+
pub struct PAYLOAD_TYPE {
8484
#[serde(rename = "@context")]
8585
#[derivative(Default(value = "crate::sdv_v1::context()"))]
8686
pub context: Vec<String>,
@@ -101,7 +101,7 @@ pub mod airbag_seat_massager {
101101
#[derive(derivative::Derivative)]
102102
#[derivative(Default)]
103103
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
104-
pub struct TYPE {
104+
pub struct PAYLOAD_TYPE {
105105
#[serde(rename = "@context")]
106106
#[derivative(Default(value = "crate::sdv_v1::context()"))]
107107
pub context: Vec<String>,
@@ -156,7 +156,7 @@ pub mod basic_airbag_seat_massager {
156156
#[derive(derivative::Derivative)]
157157
#[derivative(Default)]
158158
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
159-
pub struct TYPE {
159+
pub struct ENTITY_TYPE {
160160
#[serde(rename = "@context")]
161161
#[derivative(Default(value = "crate::sdv_v1::context()"))]
162162
pub context: Vec<String>,
@@ -242,7 +242,7 @@ pub mod cabin {
242242
#[derive(derivative::Derivative)]
243243
#[derivative(Default)]
244244
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
245-
pub struct TYPE {
245+
pub struct ENTITY_TYPE {
246246
#[serde(rename = "@context")]
247247
#[derivative(Default(value = "crate::sdv_v1::context()"))]
248248
pub context: Vec<String>,
@@ -281,6 +281,20 @@ pub mod camera {
281281
pub media_content: Vec<u8>,
282282
}
283283
}
284+
285+
#[derive(derivative::Derivative)]
286+
#[derivative(Default)]
287+
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
288+
pub struct ENTITY_TYPE {
289+
#[serde(rename = "@context")]
290+
#[derivative(Default(value = "crate::sdv_v1::context()"))]
291+
pub context: Vec<String>,
292+
#[serde(rename = "@id")]
293+
pub instance_id: String,
294+
#[serde(rename = "@type")]
295+
#[derivative(Default(value = "crate::sdv_v1::camera::ID.to_string()"))]
296+
pub model_id: String,
297+
}
284298
}
285299

286300
pub mod hmi {
@@ -300,7 +314,7 @@ pub mod hmi {
300314
#[derive(derivative::Derivative)]
301315
#[derivative(Default)]
302316
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
303-
pub struct TYPE {
317+
pub struct PAYLOAD_TYPE {
304318
#[serde(rename = "@context")]
305319
#[derivative(Default(value = "crate::sdv_v1::context()"))]
306320
pub context: Vec<String>,
@@ -335,6 +349,20 @@ pub mod hmi {
335349
}
336350
}
337351

352+
#[derive(derivative::Derivative)]
353+
#[derivative(Default)]
354+
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
355+
pub struct ENTITY_TYPE {
356+
#[serde(rename = "@context")]
357+
#[derivative(Default(value = "crate::sdv_v1::context()"))]
358+
pub context: Vec<String>,
359+
#[serde(rename = "@id")]
360+
pub instance_id: String,
361+
#[serde(rename = "@type")]
362+
#[derivative(Default(value = "crate::sdv_v1::hmi::ID.to_string()"))]
363+
pub model_id: String,
364+
}
365+
338366
pub mod status {
339367
pub const ID: &str = "dtmi:sdv:hmi:status;1";
340368
pub const NAME: &str = "status";
@@ -367,6 +395,20 @@ pub mod hvac {
367395

368396
pub type TYPE = bool;
369397
}
398+
399+
#[derive(derivative::Derivative)]
400+
#[derivative(Default)]
401+
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
402+
pub struct ENTITY_TYPE {
403+
#[serde(rename = "@context")]
404+
#[derivative(Default(value = "crate::sdv_v1::context()"))]
405+
pub context: Vec<String>,
406+
#[serde(rename = "@id")]
407+
pub instance_id: String,
408+
#[serde(rename = "@type")]
409+
#[derivative(Default(value = "crate::sdv_v1::hvac::ID.to_string()"))]
410+
pub model_id: String,
411+
}
370412
}
371413

372414
pub mod obd {
@@ -380,6 +422,20 @@ pub mod obd {
380422

381423
pub type TYPE = i32;
382424
}
425+
426+
#[derive(derivative::Derivative)]
427+
#[derivative(Default)]
428+
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
429+
pub struct ENTITY_TYPE {
430+
#[serde(rename = "@context")]
431+
#[derivative(Default(value = "crate::sdv_v1::context()"))]
432+
pub context: Vec<String>,
433+
#[serde(rename = "@id")]
434+
pub instance_id: String,
435+
#[serde(rename = "@type")]
436+
#[derivative(Default(value = "crate::sdv_v1::obd::ID.to_string()"))]
437+
pub model_id: String,
438+
}
383439
}
384440

385441
pub mod premium_airbag_seat_massager {
@@ -389,7 +445,7 @@ pub mod premium_airbag_seat_massager {
389445
#[derive(derivative::Derivative)]
390446
#[derivative(Default)]
391447
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
392-
pub struct TYPE {
448+
pub struct ENTITY_TYPE {
393449
#[serde(rename = "@context")]
394450
#[derivative(Default(value = "crate::sdv_v1::context()"))]
395451
pub context: Vec<String>,
@@ -427,7 +483,7 @@ pub mod seat {
427483
#[derive(derivative::Derivative)]
428484
#[derivative(Default)]
429485
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
430-
pub struct TYPE {
486+
pub struct ENTITY_TYPE {
431487
#[serde(rename = "@context")]
432488
#[derivative(Default(value = "crate::sdv_v1::context()"))]
433489
pub context: Vec<String>,
@@ -449,20 +505,7 @@ pub mod seat_massager {
449505
pub const NAME: &str = "sequence_names";
450506
pub const DESCRIPTION: &str = "The name of each of the stored sequences.";
451507

452-
#[derive(derivative::Derivative)]
453-
#[derivative(Default)]
454-
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
455-
pub struct TYPE {
456-
#[serde(rename = "@context")]
457-
#[derivative(Default(value = "crate::sdv_v1::context()"))]
458-
pub context: Vec<String>,
459-
#[serde(rename = "@type")]
460-
#[derivative(Default(
461-
value = "crate::sdv_v1::seat_massager::sequence_names::ID.to_string()"
462-
))]
463-
pub model_id: String,
464-
pub value: Vec<String>,
465-
}
508+
pub type TYPE = Vec<String>;
466509
}
467510

468511
pub mod load_sequence {
@@ -478,7 +521,7 @@ pub mod seat_massager {
478521
#[derive(derivative::Derivative)]
479522
#[derivative(Default)]
480523
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
481-
pub struct TYPE {
524+
pub struct PAYLOAD_TYPE {
482525
#[serde(rename = "@context")]
483526
#[derivative(Default(value = "crate::sdv_v1::context()"))]
484527
pub context: Vec<String>,
@@ -499,7 +542,7 @@ pub mod seat_massager {
499542
#[derive(derivative::Derivative)]
500543
#[derivative(Default)]
501544
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
502-
pub struct TYPE {
545+
pub struct PAYLOAD_TYPE {
503546
#[serde(rename = "@context")]
504547
#[derivative(Default(value = "crate::sdv_v1::context()"))]
505548
pub context: Vec<String>,
@@ -526,7 +569,7 @@ pub mod seat_massager {
526569
#[derive(derivative::Derivative)]
527570
#[derivative(Default)]
528571
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
529-
pub struct TYPE {
572+
pub struct PAYLOAD_TYPE {
530573
#[serde(rename = "@context")]
531574
#[derivative(Default(value = "crate::sdv_v1::context()"))]
532575
pub context: Vec<String>,
@@ -546,7 +589,7 @@ pub mod seat_massager {
546589
#[derive(derivative::Derivative)]
547590
#[derivative(Default)]
548591
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
549-
pub struct TYPE {
592+
pub struct PAYLOAD_TYPE {
550593
#[serde(rename = "@context")]
551594
#[derivative(Default(value = "crate::sdv_v1::context()"))]
552595
pub context: Vec<String>,
@@ -573,7 +616,7 @@ pub mod seat_massager {
573616
#[derive(derivative::Derivative)]
574617
#[derivative(Default)]
575618
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
576-
pub struct TYPE {
619+
pub struct PAYLOAD_TYPE {
577620
#[serde(rename = "@context")]
578621
#[derivative(Default(value = "crate::sdv_v1::context()"))]
579622
pub context: Vec<String>,
@@ -593,7 +636,7 @@ pub mod seat_massager {
593636
#[derive(derivative::Derivative)]
594637
#[derivative(Default)]
595638
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
596-
pub struct TYPE {
639+
pub struct PAYLOAD_TYPE {
597640
#[serde(rename = "@context")]
598641
#[derivative(Default(value = "crate::sdv_v1::context()"))]
599642
pub context: Vec<String>,
@@ -620,7 +663,7 @@ pub mod seat_massager {
620663
#[derive(derivative::Derivative)]
621664
#[derivative(Default)]
622665
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
623-
pub struct TYPE {
666+
pub struct PAYLOAD_TYPE {
624667
#[serde(rename = "@context")]
625668
#[derivative(Default(value = "crate::sdv_v1::context()"))]
626669
pub context: Vec<String>,
@@ -640,7 +683,7 @@ pub mod seat_massager {
640683
#[derive(derivative::Derivative)]
641684
#[derivative(Default)]
642685
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
643-
pub struct TYPE {
686+
pub struct PAYLOAD_TYPE {
644687
#[serde(rename = "@context")]
645688
#[derivative(Default(value = "crate::sdv_v1::context()"))]
646689
pub context: Vec<String>,
@@ -684,18 +727,8 @@ pub mod vehicle {
684727
pub type TYPE = String;
685728
}
686729

687-
#[derive(derivative::Derivative)]
688-
#[derivative(Default)]
689-
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
730+
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug, Default)]
690731
pub struct TYPE {
691-
#[serde(rename = "@context")]
692-
#[derivative(Default(value = "crate::sdv_v1::context()"))]
693-
pub context: Vec<String>,
694-
#[serde(rename = "@type")]
695-
#[derivative(Default(
696-
value = "crate::sdv_v1::vehicle::vehicle_identification::ID.to_string()"
697-
))]
698-
pub model_id: String,
699732
pub vin: crate::sdv_v1::vehicle::vehicle_identification::vin::TYPE,
700733
}
701734
}
@@ -719,7 +752,7 @@ pub mod vehicle {
719752
#[derive(derivative::Derivative)]
720753
#[derivative(Default)]
721754
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug)]
722-
pub struct TYPE {
755+
pub struct ENTITY_TYPE {
723756
#[serde(rename = "@context")]
724757
#[derivative(Default(value = "crate::sdv_v1::context()"))]
725758
pub context: Vec<String>,

0 commit comments

Comments
 (0)