diff --git a/lib.intermediate/Sanderling.dll b/lib.intermediate/Sanderling.dll index 2ff4ac9e..f5b10e0c 100644 Binary files a/lib.intermediate/Sanderling.dll and b/lib.intermediate/Sanderling.dll differ diff --git a/src/Sanderling/Sanderling.Exe/App.Interface.cs b/src/Sanderling/Sanderling.Exe/App.Interface.cs index 43572286..9fc1b1e0 100644 --- a/src/Sanderling/Sanderling.Exe/App.Interface.cs +++ b/src/Sanderling/Sanderling.Exe/App.Interface.cs @@ -145,9 +145,11 @@ void InterfaceExchange() var EveOnlineClientProcessId = this.EveOnlineClientProcessId; + var RequestedMeasurementTime = this.RequestedMeasurementTime ?? 0; + if (EveOnlineClientProcessId.HasValue && !(MemoryMeasurementLastAge < 1000) && RequestedMeasurementTime <= Bib3.Glob.StopwatchZaitMiliSictInt()) - Task.Run(() => MeasurementMemoryTake(EveOnlineClientProcessId.Value)); + Task.Run(() => MeasurementMemoryTake(EveOnlineClientProcessId.Value, RequestedMeasurementTime)); } void LicenseClientExchange() @@ -199,13 +201,13 @@ void LicenseClientExchange() } } - void MeasurementMemoryTake(int processId) + void MeasurementMemoryTake(int processId, Int64 measurementBeginTimeMinMilli) { FromProcessMeasurement MeasurementRaw = null; try { - MeasurementRaw = SensorServerDispatcher.InterfaceAppManager.MeasurementTake(processId); + MeasurementRaw = SensorServerDispatcher.InterfaceAppManager.MeasurementTake(processId, measurementBeginTimeMinMilli); } finally { diff --git a/src/Sanderling/Sanderling/InterfaceAppManager.cs b/src/Sanderling/Sanderling/InterfaceAppManager.cs index 07a9703d..239a2825 100644 --- a/src/Sanderling/Sanderling/InterfaceAppManager.cs +++ b/src/Sanderling/Sanderling/InterfaceAppManager.cs @@ -1,5 +1,6 @@ using BotEngine.Interface; using Sanderling.Interface; +using System; using System.Threading; using MemoryStruct = Sanderling.Interface.MemoryStruct; @@ -18,10 +19,9 @@ static public FromInterfaceResponse ClientRequest( static public FromInterfaceResponse MeasurementTakeRequest( this InterfaceAppManager interfaceAppManager, - int processId) + int processId, + Int64 measurementBeginTimeMinMilli) { - var MeasurementBeginTimeMin = Bib3.Glob.StopwatchZaitMiliSictInt(); - while (interfaceAppManager?.MeasurementInProgress() ?? false) Thread.Sleep(11); @@ -43,7 +43,7 @@ static public FromInterfaceResponse MeasurementTakeRequest( MemoryMeasurementGetLast = true, }); - if (!(MeasurementBeginTimeMin <= Response?.MemoryMeasurement?.Begin)) + if (!(measurementBeginTimeMinMilli <= Response?.MemoryMeasurement?.Begin)) Response = interfaceAppManager?.ClientRequest(new ToInterfaceRequest { MemoryMeasurementTake = true, @@ -54,7 +54,8 @@ static public FromInterfaceResponse MeasurementTakeRequest( static public FromProcessMeasurement MeasurementTake( this InterfaceAppManager interfaceAppManager, - int processId) => - MeasurementTakeRequest(interfaceAppManager, processId)?.MemoryMeasurement; + int processId, + Int64 measurementBeginTimeMinMilli) => + MeasurementTakeRequest(interfaceAppManager, processId, measurementBeginTimeMinMilli)?.MemoryMeasurement; } } diff --git a/src/sample/Sanderling.Sample.Read/Program.cs b/src/sample/Sanderling.Sample.Read/Program.cs index 192273a3..e37bbb79 100644 --- a/src/sample/Sanderling.Sample.Read/Program.cs +++ b/src/sample/Sanderling.Sample.Read/Program.cs @@ -66,7 +66,9 @@ static void SampleRun() { SensorServerHub?.Exchange(); - var response = SensorServerHub?.InterfaceAppManager?.MeasurementTakeRequest(Config.EveOnlineClientProcessId); + var response = SensorServerHub?.InterfaceAppManager?.MeasurementTakeRequest( + Config.EveOnlineClientProcessId, + Bib3.Glob.StopwatchZaitMiliSictInt()); if (null == response) Console.WriteLine("Sensor Interface not yet ready.");