tangled
alpha
login
or
join now
sachy.dev
/
striker
0
fork
atom
Bevy+Ratutui powered Monitoring of Pico-Strike devices
0
fork
atom
overview
issues
pulls
pipelines
Update detector info proto details
sachy.dev
1 week ago
c4fbeb50
15d1ae0b
-11
3 changed files
expand all
collapse all
unified
split
src
device.rs
views
monitoring.rs
striker-proto
src
lib.rs
-4
src/device.rs
···
40
40
pub struct DeviceDetector {
41
41
pub blip_threshold: u16,
42
42
pub blip_size: usize,
43
43
-
pub max_duty: u16,
44
44
-
pub duty: u16,
45
43
}
46
44
47
45
impl Widget for DeviceDetector {
···
52
50
let detector_lines = [
53
51
Line::from_iter([Span::raw("Threshold: "), self.blip_threshold.to_span()]),
54
52
Line::from_iter([Span::raw("Blip Size: "), self.blip_size.to_span()]),
55
55
-
Line::from_iter([Span::raw("Max Duty: "), self.max_duty.to_span()]),
56
56
-
Line::from_iter([Span::raw("Current Duty: "), self.duty.to_span()]),
57
53
];
58
54
59
55
let detector_info = Paragraph::new(Text::from_iter(detector_lines))
-4
src/views/monitoring.rs
···
128
128
StrikerResponse::Response(Response::DetectorInfo {
129
129
blip_threshold,
130
130
blip_size,
131
131
-
max_duty,
132
132
-
duty,
133
131
}) => {
134
132
entity.insert(DeviceDetector {
135
133
blip_threshold,
136
134
blip_size,
137
137
-
max_duty,
138
138
-
duty,
139
135
});
140
136
}
141
137
StrikerResponse::Update(Update::Warning { timestamp, level }) => {
-3
striker-proto/src/lib.rs
···
16
16
SetDetectorConfig {
17
17
blip_threshold: Option<u16>,
18
18
blip_size: Option<usize>,
19
19
-
duty: Option<u16>,
20
19
},
21
20
}
22
21
···
32
31
DetectorInfo {
33
32
blip_threshold: u16,
34
33
blip_size: usize,
35
35
-
max_duty: u16,
36
36
-
duty: u16,
37
34
},
38
35
SetDetectorConfig {
39
36
success: bool,