revert Merge branch 'main' of https://git.skbkit.ru/CPL/Simulator
This commit is contained in:
2025-08-04 18:02:42 +00:00
parent a67275b402
commit 3565372ffc
4 changed files with 200 additions and 336 deletions

View File

@ -225,7 +225,7 @@ namespace DroneSimulator
public void Update(float value, uint time)
{
value = Pressure - value * 12.15f;
value = Pressure - value;
if (!Enable)
{
@ -273,6 +273,8 @@ namespace DroneSimulator
public static uint Freq;
public static float Noise;
public static float Lateness;
public static float Error;
public static uint Wait;
public static float Lens;
public static bool RealSimulation;
@ -288,21 +290,31 @@ namespace DroneSimulator
public uint timer = 0;
public Vector2 result;
public bool Update(Vector2 value, float Range, uint time)
public void Update(Vector2 value, float Range, uint time)
{
value *= Lens;
if (!Enable)
{
result = Vector2.NaN;
return true;
return;
}
if (!RealSimulation)
{
result = value;
timer = time;
return true;
return;
}
value *= Lens;
if (rand.Next(0, 1000) < (Error * 10))
{
value = Vector2.Zero;
delay = time + Wait;
}
else if (delay > time)
{
value = Vector2.Zero;
}
if (Range > MaxHeight) value = Vector2.Zero;
@ -332,10 +344,7 @@ namespace DroneSimulator
{
result = value;
timer = time;
return true;
}
return false;
}
}