Fix parameter type

This commit is contained in:
glax 2023-11-30 18:29:49 +01:00
parent 7142e57a4a
commit 595c8bf202

View File

@ -15,9 +15,9 @@ public class OSCCollar
string ip = jObject.GetValue("ip")?.ToObject<string>() ?? "127.0.0.1"; string ip = jObject.GetValue("ip")?.ToObject<string>() ?? "127.0.0.1";
int portReceive = jObject.GetValue("portReceive")?.ToObject<int>() ?? 9001; int portReceive = jObject.GetValue("portReceive")?.ToObject<int>() ?? 9001;
int portSend = jObject.GetValue("portReceive")?.ToObject<int>() ?? 9000; int portSend = jObject.GetValue("portReceive")?.ToObject<int>() ?? 9000;
double radius = jObject.GetValue("radius")?.ToObject<int>() ?? 100; double radius = jObject.GetValue("radius")?.ToObject<double>() ?? 100;
double calibrationX = jObject.GetValue("calibrationX")?.ToObject<int>() ?? 0; double calibrationX = jObject.GetValue("calibrationX")?.ToObject<double>() ?? 0;
double calibrationY = jObject.GetValue("calibrationY")?.ToObject<int>() ?? 0; double calibrationY = jObject.GetValue("calibrationY")?.ToObject<double>() ?? 0;
bool skipSetup = jObject.GetValue("skipSetup")?.ToObject<bool>() ?? true; bool skipSetup = jObject.GetValue("skipSetup")?.ToObject<bool>() ?? true;
var _ = new OSCCollar(ip, portReceive, portSend, radius, calibrationX, calibrationY, skipSetup); var _ = new OSCCollar(ip, portReceive, portSend, radius, calibrationX, calibrationY, skipSetup);
}else }else
@ -93,14 +93,14 @@ public class OSCCollar
Console.ForegroundColor = ConsoleColor.White; Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine($"OSC Collar - Status: {(_allowMoving ? "enabled" : "disabled")}"); Console.WriteLine($"OSC Collar - Status: {(_allowMoving ? "enabled" : "disabled")}");
Console.WriteLine("=============================="); Console.WriteLine("==============================");
Console.WriteLine($"GPS 1:................{GPS1.Distance:0.000000}"); Console.WriteLine($"GPS 1:................{GPS1.Distance:00.00000}");
Console.WriteLine($"GPS 2:................{GPS2.Distance:0.000000}"); Console.WriteLine($"GPS 2:................{GPS2.Distance:00.00000}");
Console.WriteLine($"GPS 3:................{GPS3.Distance:0.000000}"); Console.WriteLine($"GPS 3:................{GPS3.Distance:0.00000}");
Console.WriteLine($"Position X:.........{_posX:'.'0.00000;'-'0.00000}"); Console.WriteLine($"Position X:..........{_posX:'.'0.00000;'-'0.00000}");
Console.WriteLine($"Position Y:.........{_posY:'.'0.00000;'-'0.00000}"); Console.WriteLine($"Position Y:..........{_posY:'.'0.00000;'-'0.00000}");
Console.WriteLine($"Stretch:..............{_leashStretch:0.00000}"); Console.WriteLine($"Stretch:...............{_leashStretch:0.00000}");
Console.WriteLine($"Vertical Movement:..{verticalMovement:' '0.00000;'-'0.00000}"); Console.WriteLine($"Vertical Movement:...{verticalMovement:' '0.00000;'-'0.00000}");
Console.WriteLine($"Horizontal Movement:.{horizontalMovement:' '0.00000;'-'0.00000}"); Console.WriteLine($"Horizontal Movement:..{horizontalMovement:' '0.00000;'-'0.00000}");
string nilString = $"/input nil {_nilSent}"; string nilString = $"/input nil {_nilSent}";
Console.SetCursorPosition(Console.WindowWidth - nilString.Length - 1, 0); Console.SetCursorPosition(Console.WindowWidth - nilString.Length - 1, 0);
Console.Write(nilString); Console.Write(nilString);