Thank you for the support, adding the reading code was straightforward using the samples you provided.
I found the labels in the UI tree and judging by the sample “Measurement2.zip” (which does not show the timer on the screenshot) this information is also available when it is not on screen.
The release v16.03.04 adds support for reading the labels in this “InSpaceBracket” as it is called by CCP:
You can get the references to all brackets from the new “InflightBracket” property on the MemoryMeasurement. In the complex capture bracket in the samples, there are two labels, one containing the timer text and one containing the text “Minmatar Republic Capturing”.
I added the method “SecondCountFromBracketTimerText” to make parsing the timer text simple.
To extract the remaining capture time, I would try this:
bool IsCapture(IInSpaceBracket bracket) =>
bracket?.LabelText?.Any(label => label.Text?.RegexMatchSuccessIgnoreCase("capturing") ?? false) ?? false;
int? CaptureTimeRemaining(IInSpaceBracket bracket)
{
var secondCount = bracket?.LabelText?.Select(label => label.Text.SecondCountFromBracketTimerText())?.WhereNotDefault()?.FirstOrDefault();
if(secondCount.HasValue)
return secondCount;
if(bracket?.LabelText?.Any(label => label.Text?.RegexMatchSuccessIgnoreCase("Captured") ?? false) ?? false)
return 0;
return null;
}
int? captureTimeRemaining =>
CaptureTimeRemaining(Sanderling.MemoryMeasurementParsed.Value.InflightBracket?.FirstOrDefault(IsCapture));