From 6e62ab44ef90b57a612c5a5ca0d6df8075d63e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D1=8B=D1=82=D0=BA=D0=BE=D0=B2=20=D0=A0=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D0=BD?= Date: Fri, 19 Sep 2025 23:20:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BF=D1=80=D0=B5=D0=B4=D1=81=D0=BA=D0=B0=D0=B7?= =?UTF-8?q?=D1=83=D0=B5=D0=BC=D1=8B=D1=85=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20=D0=B2=D0=B7=D1=8F=D1=82=D1=8B=20=D0=BC=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B0=20=D0=BD=D0=B0=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B8=D0=B7=20=D0=B4=D0=B8=D0=B7=D0=B0=D0=B9=D0=BD?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Domain/OverlayPoints.cs | 4 ++-- Server/DataGenerator/PredictableDataGenerator.cs | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Domain/OverlayPoints.cs b/Domain/OverlayPoints.cs index 96a0c65..320bf53 100644 --- a/Domain/OverlayPoints.cs +++ b/Domain/OverlayPoints.cs @@ -7,8 +7,8 @@ public static class OverlayPoints /// Список всех точек наложения по схеме 10-20 /// public static readonly string[] Points = { - "Fp1", "Fp2", "F3", "F4", "Fz", "C3", "C4", "Cz", - "P3", "P4", "Pz", "F7", "F8", "T3", "T4", "T5", "T6", "O1", "O2" + "Fp1", "Fp2", "F3", "F4", "FZ", "C3", "C4", "CZ", + "P3", "P4", "PZ", "F7", "F8", "T3", "T4", "T5", "T6", "O1", "O2" }; /// diff --git a/Server/DataGenerator/PredictableDataGenerator.cs b/Server/DataGenerator/PredictableDataGenerator.cs index b0836b4..76e36b4 100644 --- a/Server/DataGenerator/PredictableDataGenerator.cs +++ b/Server/DataGenerator/PredictableDataGenerator.cs @@ -7,6 +7,7 @@ namespace Server.DataGenerator; public class PredictableDataGenerator : IDataGenerator { + private static readonly string[] _overlayPoints = [ "F3", "F4", "C3", "CZ", "C4", "PZ", "O1", "O2", "ALL" ]; private long _currentFrameIndex = 0; private Data[] _currentFrame; private int _currentPackageInFrame = 0; @@ -16,17 +17,16 @@ public class PredictableDataGenerator : IDataGenerator public PredictableDataGenerator(int frameDelay = 0) { - _delay = frameDelay; + _delay = 0; _lastFrameTime = DateTime.Now; - _currentFrame = GenerateFrame(0, _lastFrameTime, _frameArtifact); - _currentFrameIndex = 1; + _currentFrame = GenerateFrame(_currentFrameIndex++, _lastFrameTime, _frameArtifact); + _delay = frameDelay; } private Data[] GenerateFrame(long frameIndex, DateTime frameTime, bool artifact) { Thread.Sleep(_delay); - var overlayPoints = OverlayPoints.Points.Take(8).Append(OverlayPoints.All).ToArray(); - return overlayPoints.Select((op, idx) => GeneratePredictableData(frameIndex, op, idx, frameTime, artifact)).ToArray(); + return _overlayPoints.Select((op, idx) => GeneratePredictableData(frameIndex, op, idx, frameTime, artifact)).ToArray(); } private Data GeneratePredictableData(long frameIndex, string overlayPoint, int index, DateTime frameTime, bool artifact) @@ -65,7 +65,7 @@ public class PredictableDataGenerator : IDataGenerator { _frameArtifact = !_frameArtifact; _lastFrameTime = _lastFrameTime.AddSeconds(1); - _currentFrame = GenerateFrame(Interlocked.Increment(ref _currentFrameIndex), _lastFrameTime, _frameArtifact); + _currentFrame = GenerateFrame(_currentFrameIndex++, _lastFrameTime, _frameArtifact); _currentPackageInFrame = 0; } return _currentFrame[_currentPackageInFrame++]; @@ -75,6 +75,6 @@ public class PredictableDataGenerator : IDataGenerator { _frameArtifact = !_frameArtifact; _lastFrameTime = _lastFrameTime.AddSeconds(1); - return GenerateFrame(Interlocked.Increment(ref _currentFrameIndex), _lastFrameTime, _frameArtifact); + return GenerateFrame(_currentFrameIndex++, _lastFrameTime, _frameArtifact); } } \ No newline at end of file