gmt_dos_clients_io/
lib.rs

1//! # GMT DOS Clients IO
2//!
3//! Definitions of the types for the inputs and the ouputs of [gmt_dos-actors](https://crates.io/crates/gmt_dos-actors)
4//! clients used with the GMT Integrated Model
5
6use std::any::type_name;
7
8use interface::{UID, UniqueIdentifier};
9
10pub mod assembly;
11pub mod gmt_fem;
12pub mod gmt_m1;
13pub mod gmt_m2;
14
15pub use assembly::Assembly;
16
17/// M1 and M2 Rigid Body Motions
18#[derive(UID)]
19#[uid(port = 56_012)]
20pub enum M12RigidBodyMotions {}
21
22#[derive(UID)]
23#[uid(port = 56_666)]
24pub enum Estimate {}
25
26/// Mount
27pub mod mount {
28    use super::UID;
29    /// Mount Encoders
30    #[derive(UID)]
31    #[uid(port = 52_001)]
32    pub enum MountEncoders {}
33    #[derive(UID)]
34    #[uid(port = 52_011)]
35    pub enum AverageMountEncoders<const E: i32 = 0> {}
36    /// Mount Torques
37    #[derive(UID)]
38    #[uid(port = 52_002)]
39    pub enum MountTorques {}
40    /// Mount set point
41    #[derive(UID)]
42    #[uid(port = 52_003)]
43    pub enum MountSetPoint {}
44}
45/// CFD wind loads
46pub mod cfd_wind_loads {
47    use super::UID;
48    /// CFD Mount Wind Loads
49    #[derive(UID)]
50    #[uid(port = 53_001)]
51    pub enum CFDMountWindLoads {}
52    /// CFD M1 Loads
53    #[derive(UID)]
54    #[uid(port = 53_002)]
55    pub enum CFDM1WindLoads {}
56    /// CFD M2 Wind Loads
57    #[derive(UID)]
58    #[uid(port = 53_003)]
59    pub enum CFDM2WindLoads {}
60}
61
62pub mod optics;
63
64/// Dome seeing
65pub mod domeseeing {
66    use super::UID;
67    /// Dome seeing optical path difference in GMT exit pupil
68    #[derive(UID)]
69    #[uid(port = 54_001)]
70    pub enum DomeSeeingOpd {}
71}
72
73/// Returns the port #
74pub fn get_port<U: UniqueIdentifier>() -> u16 {
75    <U as UniqueIdentifier>::PORT
76}
77/// Returns the data type
78pub fn get_datatype<U: UniqueIdentifier>() -> &'static str {
79    type_name::<<U as UniqueIdentifier>::DataType>()
80}