use crate::messages::primitive_aliases::Code1;
use std::fmt::{Debug, Formatter};
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct SpotBlankingStatus(Code1);
impl SpotBlankingStatus {
pub(crate) fn new(code: Code1) -> Self {
Self(code)
}
pub fn none(&self) -> bool {
self.0 == 0
}
pub fn radial(&self) -> bool {
self.0 & 0b0001 != 0
}
pub fn elevation(&self) -> bool {
self.0 & 0b0010 != 0
}
pub fn volume(&self) -> bool {
self.0 & 0b0100 != 0
}
}
impl Debug for SpotBlankingStatus {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("SpotBlankingStatus")
.field("none", &self.none())
.field("radial", &self.radial())
.field("elevation", &self.elevation())
.field("volume", &self.volume())
.finish()
}
}