main: full redraw on initial connection

This seems to help if rotint is started before rotctld (which just
crashes on mac).
This commit is contained in:
torque 2024-08-14 15:26:06 -07:00
parent 7bdea9644c
commit 1a541c71ea
Signed by: torque
SSH Key Fingerprint: SHA256:nCrXefBNo6EbjNSQhv0nXmEg/VuNq3sMF5b8zETw3Tk
2 changed files with 5 additions and 1 deletions

View File

@ -121,6 +121,8 @@ pub const RotInt = struct {
self.warn("rotator connected", .{}); self.warn("rotator connected", .{});
self.sendRotatorCommand(.get_position); self.sendRotatorCommand(.get_position);
self.state = .rotator_connected; self.state = .rotator_connected;
self.vx.queueRefresh();
self.draw() catch {};
}, },
.rotator_ready => if (self.state == .rotator_connected) { .rotator_ready => if (self.state == .rotator_connected) {
self.warn("rotator ready", .{}); self.warn("rotator ready", .{});

View File

@ -218,7 +218,9 @@ pub const Client = struct {
_ = result catch |err| { _ = result catch |err| {
self.rotint.warn("connect failed {}", .{err}); self.rotint.warn("connect failed {}", .{err});
// retry bayeb // Note: this loops instantaneously if the target address is on localhost
// and is not being listened on. Actually just straight up crashes on macOS.
// Probably need to use a timer to handle this better
return .rearm; return .rearm;
}; };