| | | 1 | | using System; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using System.Threading.Tasks; |
| | | 4 | | using ReFlex.Core.Common.Components; |
| | | 5 | | using ReFlex.Core.Common.Util; |
| | | 6 | | using ReFlex.Core.Interactivity.Interfaces; |
| | | 7 | | |
| | | 8 | | namespace ReFlex.Core.Interactivity.Util; |
| | | 9 | | |
| | | 10 | | public class MockRemoteInteractionProcessorService : IRemoteInteractionProcessorService |
| | | 11 | | { |
| | 0 | 12 | | public bool IsConnected { get; private set; } |
| | 0 | 13 | | public bool IsBusy { get; } |
| | | 14 | | |
| | 0 | 15 | | public bool SendCompleteDataset { get; set; } |
| | | 16 | | public async Task<bool> Connect() |
| | 0 | 17 | | { |
| | 0 | 18 | | await Task.Run(() => IsConnected = true); |
| | 0 | 19 | | return IsConnected; |
| | 0 | 20 | | } |
| | | 21 | | |
| | | 22 | | public async Task<bool> Disconnect() |
| | 0 | 23 | | { |
| | 0 | 24 | | await Task.Run(() => IsConnected = false); |
| | 0 | 25 | | return IsConnected; |
| | 0 | 26 | | } |
| | | 27 | | |
| | | 28 | | public async Task<Tuple<IList<Interaction>, ProcessPerformance>> Update(PointCloud3 pointCloud, ProcessPerformance m |
| | 0 | 29 | | { |
| | 0 | 30 | | var result = new List<Interaction>(); |
| | | 31 | | |
| | 0 | 32 | | await Task.Run(() => |
| | 0 | 33 | | { |
| | 0 | 34 | | var rX = new Random().Next(pointCloud.SizeX) / pointCloud.SizeX; |
| | 0 | 35 | | var rY = new Random().Next(pointCloud.SizeY) / pointCloud.SizeY; |
| | 0 | 36 | | |
| | 0 | 37 | | measurement.Smoothing = TimeSpan.Zero; |
| | 0 | 38 | | measurement.Preparation = TimeSpan.Zero; |
| | 0 | 39 | | measurement.Update = TimeSpan.Zero; |
| | 0 | 40 | | measurement.ComputeExtremumType = TimeSpan.Zero; |
| | 0 | 41 | | measurement.ConvertDepthValue = TimeSpan.Zero; |
| | 0 | 42 | | |
| | 0 | 43 | | var interaction = new Interaction(new Point3(rX, rY, 0.1f), InteractionType.Push, 20); |
| | 0 | 44 | | result.Add(interaction); |
| | 0 | 45 | | }); |
| | | 46 | | |
| | 0 | 47 | | return new Tuple<IList<Interaction>, ProcessPerformance>(result, measurement); |
| | 0 | 48 | | } |
| | | 49 | | } |