< 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
100%
Covered lines: 25
Uncovered lines: 0
Coverable lines: 25
Total lines: 47
Line coverage: 100%
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%11100%
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
 16015    public RemoteInteractionProcessor(IRemoteInteractionProcessorService service) => _service = service;
 16
 1217    public override ObserverType Type => ObserverType.Remote;
 65818    public override PointCloud3 PointCloud { get; set; }
 13819    public override VectorField2 VectorField { get; set; }
 20
 21    protected override async Task<ProcessingResult> CheckInitialState()
 12822    {
 13023        if (PointCloud == null) return new ProcessingResult(ProcessServiceStatus.Error);
 13024        if (_service.IsBusy) return new ProcessingResult(ProcessServiceStatus.Skipped);
 12225        if (!_service.IsConnected && !await _service.Connect())
 226            return new ProcessingResult(ProcessServiceStatus.Error);
 12027        return new ProcessingResult(_service.IsBusy ? ProcessServiceStatus.Skipped : ProcessServiceStatus.Available);
 12828    }
 29
 30    protected override async Task<Tuple<IEnumerable<Interaction>, ProcessPerformance>> Analyze(ProcessPerformance perfor
 12031    {
 12032        var timer = MeasurePerformance ? Stopwatch.StartNew() : null;
 12033        var result = await _service.Update(PointCloud, Distance, performance, MeasurePerformance);
 11834        if (timer != null && result.Item2.RemoteTimingsMs != null)
 235            result.Item2.RemoteTimingsMs["client_remote_total"] = timer.Elapsed.TotalMilliseconds;
 11836        return result;
 11837    }
 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}