lightspeed_astro/
lightspeed.devices.rs

1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct AstroSerialDevice {
4    #[prost(string, tag = "1")]
5    pub id: ::prost::alloc::string::String,
6    #[prost(string, tag = "2")]
7    pub name: ::prost::alloc::string::String,
8    #[prost(message, repeated, tag = "3")]
9    pub properties: ::prost::alloc::vec::Vec<super::props::Property>,
10    #[prost(string, tag = "4")]
11    pub address: ::prost::alloc::string::String,
12    #[prost(int32, tag = "5")]
13    pub baud: i32,
14    #[prost(enumeration = "Family", tag = "6")]
15    pub family: i32,
16}
17#[allow(clippy::derive_partial_eq_without_eq)]
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct AstroDevice {
20    #[prost(string, tag = "1")]
21    pub id: ::prost::alloc::string::String,
22    #[prost(string, tag = "2")]
23    pub name: ::prost::alloc::string::String,
24    #[prost(message, repeated, tag = "3")]
25    pub properties: ::prost::alloc::vec::Vec<super::props::Property>,
26    #[prost(enumeration = "Family", tag = "4")]
27    pub family: i32,
28}
29#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
30#[repr(i32)]
31pub enum Family {
32    Ccd = 0,
33    Mount = 1,
34    Focuser = 2,
35    FilterWheel = 3,
36    PowerBox = 4,
37}
38impl Family {
39    /// String value of the enum field names used in the ProtoBuf definition.
40    ///
41    /// The values are not transformed in any way and thus are considered stable
42    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
43    pub fn as_str_name(&self) -> &'static str {
44        match self {
45            Family::Ccd => "CCD",
46            Family::Mount => "MOUNT",
47            Family::Focuser => "FOCUSER",
48            Family::FilterWheel => "FILTER_WHEEL",
49            Family::PowerBox => "POWER_BOX",
50        }
51    }
52    /// Creates an enum from field names used in the ProtoBuf definition.
53    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
54        match value {
55            "CCD" => Some(Self::Ccd),
56            "MOUNT" => Some(Self::Mount),
57            "FOCUSER" => Some(Self::Focuser),
58            "FILTER_WHEEL" => Some(Self::FilterWheel),
59            "POWER_BOX" => Some(Self::PowerBox),
60            _ => None,
61        }
62    }
63}