This commit is contained in:
2025-12-09 09:00:16 +00:00
parent 760987fa75
commit 03dfb3414b
10 changed files with 142 additions and 57 deletions

View File

@@ -323,7 +323,7 @@ namespace AiQ_GUI
if (checkDevice.Result.Trim() != "OK") // Device not found
{
MainForm.Instance.AddToActionsList($"Block device {device} not found. {Level.WARNING}");
MainForm.Instance.AddToActionsList($"Block device {device} not found.", Level.WARNING);
return false;
}
@@ -378,7 +378,7 @@ namespace AiQ_GUI
if (checkDevice.Result.Trim().Length > 1) // Device not found
{
MainForm.Instance.AddToActionsList($"Cannot sync files to disk. Replied: {checkDevice.Result}. DO NOT TURN OFF, GET SUPERVISOR {Level.ERROR}");
MainForm.Instance.AddToActionsList($"Cannot sync files to disk. Replied: {checkDevice.Result}. DO NOT TURN OFF, GET SUPERVISOR", Level.ERROR);
return;
}
@@ -387,7 +387,33 @@ namespace AiQ_GUI
}
catch (Exception ex)
{
MainForm.Instance.AddToActionsList($"Cannot sync becuase: {ex.Message}. DO NOT TURN OFF, GET SUPERVISOR {Level.ERROR}");
MainForm.Instance.AddToActionsList($"Cannot sync becuase: {ex.Message}. DO NOT TURN OFF, GET SUPERVISOR", Level.ERROR);
}
}
public static void SetTo115200(string IPAddress)
{
try
{
string Cmd = "sudo sh -c \"stty -F /dev/ttyInfrared 9600 cs8 -cstopb -parenb -ixon -ixoff -crtscts -icanon -echo -opost; echo '81 01 04 01 03 FF' | xxd -r -p > /dev/ttyInfrared\"";
SshClient client = SshConnect(IPAddress);
SshCommand checkDevice = client.RunCommand(Cmd);
if (!string.IsNullOrWhiteSpace(checkDevice.Error))
throw new Exception(checkDevice.Error);
Cmd = Cmd.Replace("Infrared", "Colour");
checkDevice = client.RunCommand(Cmd);
if (!string.IsNullOrWhiteSpace(checkDevice.Error))
throw new Exception(checkDevice.Error);
client.Disconnect();
client.Dispose();
}
catch (Exception ex)
{
MainForm.Instance.AddToActionsList($"Cannot set cameras to 115200 becuase: {ex.Message}", Level.ERROR);
}
}
}
@@ -399,4 +425,4 @@ namespace AiQ_GUI
public string FilesystemSize { get; set; } = string.Empty;
public bool tailscale { get; set; }
}
}
}