gmt_dos_clients_io/
gmt_m1.rs

1//! GMT primary mirror
2
3use interface::UID;
4
5// M1 Rigid Body Motions
6// #[derive(UID)]
7// #[uid(port = 56_001)]
8// pub enum M1RigidBodyMotions {}
9pub type M1RigidBodyMotions = assembly::M1RigidBodyMotions;
10// M1 Mode Shapes
11// #[derive(UID)]
12// #[uid(port = 56_002)]
13// pub enum M1ModeShapes {}
14pub type M1ModeShapes = assembly::M1ModeShapes;
15/// M1 edge sensors
16#[derive(UID, Debug)]
17#[uid(port = 56_003)]
18pub enum M1EdgeSensors {}
19
20/// Mirror IO
21pub mod assembly {
22    use interface::UniqueIdentifier;
23    use std::sync::Arc;
24
25    use crate::Assembly;
26
27    /// Rigid body motion (Tx,Ty,Tz,Rx,Ry,Rz)
28    pub enum M1RigidBodyMotions {}
29    impl Assembly for M1RigidBodyMotions {}
30    impl UniqueIdentifier for M1RigidBodyMotions {
31        type DataType = Vec<f64>;
32        const PORT: u16 = 50_006;
33    }
34
35    /// Hardpoints displacements `[cell,mirror]`
36    pub enum M1HardpointsMotion {}
37    impl Assembly for M1HardpointsMotion {}
38    impl UniqueIdentifier for M1HardpointsMotion {
39        type DataType = Vec<Arc<Vec<f64>>>;
40        const PORT: u16 = 50_007;
41    }
42
43    /// Hardpoints forces
44    pub enum M1HardpointsForces {}
45    impl Assembly for M1HardpointsForces {}
46    impl UniqueIdentifier for M1HardpointsForces {
47        type DataType = Vec<Arc<Vec<f64>>>;
48        const PORT: u16 = 50_007;
49    }
50
51    /// Actuators command forces
52    pub enum M1ActuatorCommandForces {}
53    impl Assembly for M1ActuatorCommandForces {}
54    impl UniqueIdentifier for M1ActuatorCommandForces {
55        type DataType = Vec<f64>;
56        const PORT: u16 = 50_008;
57    }
58
59    /// Actuators applied forces
60    pub enum M1ActuatorAppliedForces {}
61    impl Assembly for M1ActuatorAppliedForces {}
62    impl UniqueIdentifier for M1ActuatorAppliedForces {
63        type DataType = Vec<Arc<Vec<f64>>>;
64        const PORT: u16 = 50_008;
65    }
66    /// M1 Mode Shapes
67    pub enum M1ModeShapes {}
68    impl Assembly for M1ModeShapes {}
69    impl UniqueIdentifier for M1ModeShapes {
70        type DataType = Vec<f64>;
71        const PORT: u16 = 50_008;
72    }
73    /// M1 Mode Coefficients
74    pub enum M1ModeCoefficients {}
75    impl Assembly for M1ModeCoefficients {}
76    impl UniqueIdentifier for M1ModeCoefficients {
77        type DataType = Vec<f64>;
78        const PORT: u16 = 50_009;
79    }
80}
81
82/// Segment IO
83pub mod segment {
84    use interface::UniqueIdentifier;
85    /// Force and moment at center of gravity
86    pub enum BarycentricForce<const ID: u8> {}
87    impl<const ID: u8> UniqueIdentifier for BarycentricForce<ID> {
88        const PORT: u16 = 56_001 + 100 * ID as u16;
89        type DataType = Vec<f64>;
90    }
91    /// Rigid body motion (Tx,Ty,Tz,Rx,Ry,Rz)
92    pub enum RBM<const ID: u8> {}
93    impl<const ID: u8> UniqueIdentifier for RBM<ID> {
94        const PORT: u16 = 56_002 + 100 * ID as u16;
95        type DataType = Vec<f64>;
96    }
97    /// Hardpoints displacements `[cell,mirror]`
98    pub enum HardpointsMotion<const ID: u8> {}
99    impl<const ID: u8> UniqueIdentifier for HardpointsMotion<ID> {
100        const PORT: u16 = 56_003 + 100 * ID as u16;
101        type DataType = Vec<f64>;
102    }
103    /// Hardpoints forces
104    pub enum HardpointsForces<const ID: u8> {}
105    impl<const ID: u8> UniqueIdentifier for HardpointsForces<ID> {
106        const PORT: u16 = 56_004 + 100 * ID as u16;
107        type DataType = Vec<f64>;
108    }
109    /// Actuators applied forces
110    pub enum ActuatorAppliedForces<const ID: u8> {}
111    impl<const ID: u8> UniqueIdentifier for ActuatorAppliedForces<ID> {
112        const PORT: u16 = 56_005 + 100 * ID as u16;
113        type DataType = Vec<f64>;
114    }
115    /// Actuators command forces
116    pub enum ActuatorCommandForces<const ID: u8> {}
117    impl<const ID: u8> UniqueIdentifier for ActuatorCommandForces<ID> {
118        const PORT: u16 = 56_006 + 100 * ID as u16;
119        type DataType = Vec<f64>;
120    }
121    /// SEGMENT RBM DOF selector (`[0,...,6]->[Tx,Ty,Tz,Rx,Ry,Rz]`)
122    pub enum M1S<const ID: u8, const DOF: u8> {}
123    impl<const ID: u8, const DOF: u8> UniqueIdentifier for M1S<ID, DOF> {
124        const PORT: u16 = 56_001 + 10 * (1 + DOF) as u16 + 100 * ID as u16;
125        type DataType = Vec<f64>;
126    }
127    #[deprecated = r#"Deprecated UID in favor of "ModesShape""#]
128    /// BendingModes
129    pub enum BendingModes<const ID: u8> {}
130    #[allow(deprecated)]
131    impl<const ID: u8> UniqueIdentifier for BendingModes<ID> {
132        const PORT: u16 = 56_007 + 100 * ID as u16;
133        type DataType = Vec<f64>;
134    }
135    /// Mode shapes
136    pub enum ModeShapes<const ID: u8> {}
137    impl<const ID: u8> UniqueIdentifier for ModeShapes<ID> {
138        const PORT: u16 = 56_007 + 100 * ID as u16;
139        type DataType = Vec<f64>;
140    }
141}