App

Struct App 

Source
pub(crate) struct App {
Show 34 fields pub connected: bool, pub port_path: String, pub state: RadioState, pub focus: Pane, pub main_view: MainView, pub input_mode: InputMode, pub mcp: McpState, pub should_quit: bool, pub quit_pending: bool, pub status_message: Option<String>, pub show_help: bool, pub channel_list_index: usize, pub settings_cat_index: usize, pub settings_mcp_index: usize, pub search_filter: String, pub target_band: Band, pub cmd_tx: Option<UnboundedSender<RadioCommand>>, pub aprs_mode: AprsMode, pub aprs_stations: Vec<AprsStationCache>, pub aprs_messages: Vec<AprsMessageStatus>, pub aprs_station_index: usize, pub aprs_compose: Option<String>, pub dstar_mode: DStarMode, pub dstar_last_heard: Vec<LastHeardEntry>, pub dstar_last_heard_index: usize, pub dstar_text_message: Option<String>, pub dstar_rx_header: Option<DStarHeader>, pub dstar_rx_active: bool, pub dstar_urcall_input: Option<String>, pub dstar_reflector_input: Option<String>, pub channel_edit_mode: bool, pub channel_edit_field: ChannelEditField, pub channel_edit_buffer: String, pub fm_radio_on: bool,
}
Expand description

Central application state.

Fields§

§connected: bool§port_path: String§state: RadioState§focus: Pane§main_view: MainView§input_mode: InputMode§mcp: McpState§should_quit: bool§quit_pending: bool§status_message: Option<String>§show_help: bool§channel_list_index: usize§settings_cat_index: usize

Selected row in the CAT settings viewer.

§settings_mcp_index: usize

Selected row in the MCP settings viewer.

§search_filter: String

Active search filter for channel list (empty = show all).

§target_band: Band

Which band channel-tune and freq-input target (last focused band pane).

§cmd_tx: Option<UnboundedSender<RadioCommand>>

Sender for commands to the radio background task.

§aprs_mode: AprsMode

APRS mode state.

§aprs_stations: Vec<AprsStationCache>

Cached APRS stations, sorted by last heard (most recent first).

§aprs_messages: Vec<AprsMessageStatus>

Tracked sent APRS messages.

§aprs_station_index: usize

Selected station index in the APRS station list.

§aprs_compose: Option<String>

When set, the APRS message compose prompt is active.

§dstar_mode: DStarMode

D-STAR mode state.

§dstar_last_heard: Vec<LastHeardEntry>

D-STAR last heard entries (gateway mode).

§dstar_last_heard_index: usize

Selected index in the D-STAR last heard list.

§dstar_text_message: Option<String>

Current D-STAR text message (from slow data).

§dstar_rx_header: Option<DStarHeader>

Current D-STAR RX header (gateway mode).

§dstar_rx_active: bool

Whether a D-STAR voice transmission is active.

§dstar_urcall_input: Option<String>

D-STAR URCALL input buffer (when prompting).

§dstar_reflector_input: Option<String>

D-STAR reflector input buffer (when prompting).

§channel_edit_mode: bool

Channel edit mode is active.

§channel_edit_field: ChannelEditField

Which field is selected in channel edit mode.

§channel_edit_buffer: String

Text buffer for the currently edited field.

§fm_radio_on: bool

FM radio status (true = on). Tracked locally since FR is write-only.

Implementations§

Source§

impl App

Source

pub(crate) fn filtered_channels(&self) -> Vec<u16>

Returns the list of used channel numbers, filtered by search_filter.

Source

fn used_channel_count(&self) -> usize

Source

pub(crate) fn new(port_path: String) -> Self

Create a new app instance, loading MCP cache from disk if available.

Source

pub(crate) fn update(&mut self, msg: Message) -> bool

Process a message and update state. Returns true if a render is needed.

Source

fn handle_key(&mut self, key: KeyEvent) -> bool

Source

fn toggle_setting(&mut self)

Toggle a boolean setting or show hint for numeric ones.

Source

fn adjust_setting(&mut self, delta: i8)

Adjust a numeric setting by delta with +/-.

Source

fn handle_aprs_event(&mut self, event: AprsEvent)

Process an incoming APRS event from the radio task.

Source

fn update_station_cache(&mut self, entry: &StationEntry)

Update the station cache from a StationEntry.

Source

fn sort_aprs_stations(&mut self)

Sort stations by most recently heard.

Source

fn handle_dstar_event(&mut self, event: DStarEvent)

Toggle APRS mode on or off.

Source

fn toggle_gps(&mut self)

Source

fn toggle_gps_pc_output(&mut self)

Source

fn toggle_dstar_mode(&mut self)

Source

fn toggle_fm_radio(&mut self)

Source

fn apply_channel_edit(&mut self, field: ChannelEditField, buf: &str)

Apply a channel edit from the edit buffer.

Uses ME (memory channel) write via CAT. This tunes the radio’s live channel, not permanent memory storage (which would require MCP).

Source

fn toggle_aprs_mode(&mut self)

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnwindSafe for App

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more