< Summary - ReFlex - Library

Information
Class: ReFlex.Core.Interactivity.Components.RemoteInteractionProcessor
Assembly: ReFlex.Core.Interactivity
File(s): D:\a\reflex\reflex\library\src\Core\Interactivity\Components\RemoteInteractionProcessor.cs
Line coverage
96%
Covered lines: 24
Uncovered lines: 1
Coverable lines: 25
Total lines: 47
Line coverage: 96%
Branch coverage
88%
Covered branches: 16
Total branches: 18
Branch coverage: 88.8%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Type()100%210%
get_PointCloud()100%11100%
get_VectorField()100%11100%
CheckInitialState()90%1010100%
Analyze()100%66100%
ReportPerformance(...)50%22100%

File(s)

D:\a\reflex\reflex\library\src\Core\Interactivity\Components\RemoteInteractionProcessor.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Diagnostics;
 4using System.Threading.Tasks;
 5using ReFlex.Core.Common.Components;
 6using ReFlex.Core.Common.Util;
 7using ReFlex.Core.Interactivity.Interfaces;
 8
 9namespace ReFlex.Core.Interactivity.Components;
 10
 11public class RemoteInteractionProcessor : InteractionObserverBase
 12{
 13    private readonly IRemoteInteractionProcessorService _service;
 14
 5215    public RemoteInteractionProcessor(IRemoteInteractionProcessorService service) => _service = service;
 16
 017    public override ObserverType Type => ObserverType.Remote;
 10018    public override PointCloud3 PointCloud { get; set; }
 419    public override VectorField2 VectorField { get; set; }
 20
 21    protected override async Task<ProcessingResult> CheckInitialState()
 2622    {
 2823        if (PointCloud == null) return new ProcessingResult(ProcessServiceStatus.Error);
 2624        if (_service.IsBusy) return new ProcessingResult(ProcessServiceStatus.Skipped);
 2225        if (!_service.IsConnected && !await _service.Connect())
 226            return new ProcessingResult(ProcessServiceStatus.Error);
 2027        return new ProcessingResult(_service.IsBusy ? ProcessServiceStatus.Skipped : ProcessServiceStatus.Available);
 2628    }
 29
 30    protected override async Task<Tuple<IEnumerable<Interaction>, ProcessPerformance>> Analyze(ProcessPerformance perfor
 2031    {
 2032        var timer = MeasurePerformance ? Stopwatch.StartNew() : null;
 2033        var result = await _service.Update(PointCloud, Distance, performance, MeasurePerformance);
 2034        if (timer != null && result.Item2.RemoteTimingsMs != null)
 235            result.Item2.RemoteTimingsMs["client_remote_total"] = timer.Elapsed.TotalMilliseconds;
 2036        return result;
 2037    }
 38
 39    protected override Task ReportPerformance(ProcessPerformance performance)
 240    {
 241        if (performance.RemoteTimingsMs == null) return Task.CompletedTask;
 242        performance.RemoteTimingsMs["client_depth_conversion"] = performance.ConvertDepthValue.TotalMilliseconds;
 243        performance.RemoteTimingsMs["client_extremum_classification"] = performance.ComputeExtremumType.TotalMillisecond
 244        performance.RemoteTimingsMs["client_smoothing"] = performance.Smoothing.TotalMilliseconds;
 245        return _service.ReportPerformance(performance);
 246    }
 47}