open_protocol/messages/
user_interface.rs

1use open_protocol_codec_proc_macro::{OpenProtocolDecode, OpenProtocolEncode, OpenProtocolMessage};
2
3#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
4pub enum RemovalCondition {
5    #[default]
6    #[open_protocol_value(number = 0)]
7    AcknowledgeOrWait,
8    #[open_protocol_value(number = 1)]
9    Acknowledge
10}
11
12/// Display user text on compact display.
13/// The text must be maximum 4 bytes long.
14#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
15#[open_protocol_message(MID = 110, revision = 1)]
16pub struct MID0110rev1 {
17    /// The user text to be displayed (max 4 characters).
18    /// If less than 4 characters, right pad with spaces (0x20).
19    #[open_protocol_field(length = 4)]
20    pub user_text: String,
21}
22
23/// Display user text on a graphical display.
24/// Allows setting display duration and acknowledgment settings.
25#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
26#[open_protocol_message(MID = 111, revision = 1)]
27pub struct MID0111rev1 {
28    /// Time duration for the text display in seconds.
29    /// Four ASCII digits, range: 0000-9999.
30    #[open_protocol_field(length = 4)]
31    pub display_duration: u16,
32
33    /// Removal condition: 0 = acknowledge or wait expiration time, 1 = acknowledge required.
34    #[open_protocol_field(length = 1)]
35    pub removal_condition: RemovalCondition,
36
37    /// The first line (header) of the message (25 ASCII characters, right-padded with spaces).
38    #[open_protocol_field(list, length = 25, amount = 4)]
39    pub lines: Vec<String>,
40}
41
42/// Flash green light on tool.
43/// The tool’s green light will flash until the operator pushes the trigger.
44#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
45#[open_protocol_message(MID = 113, revision = 1)]
46pub struct MID0113rev1 {
47    // No additional fields for this MID.
48}