private void CollectionStarted(object sender, DelsysAPI.Events.CollectionStartedEvent e) { var comps = PipelineController.Instance.PipelineIds[0].TrignoBtManager.Components; // Refresh the counters for display. TotalDataPoints = 0; TotalLostPackets = 0; // Recreate the list of data channels for recording int totalChannels = 0; for (int i = 0; i < comps.Count; i++) { for (int j = 0; j < comps[i].BtChannels.Count; j++) { if (Data.Count <= totalChannels) { Data.Add(new List <double>()); } else { Data[totalChannels] = new List <double>(); } totalChannels++; } } }
private void CollectionStarted(object sender, DelsysAPI.Events.CollectionStartedEvent e) { var comps = PipelineController.Instance.PipelineIds[0].TrignoBtManager.Components; txt_SensorsStreaming.Text = comps.Count.ToString(); // Refresh the counters for display. TotalDataPoints = 0; TotalLostPackets = 0; // Recreate the list of data channels for recording int totalChannels = 0; for (int i = 0; i < comps.Count; i++) { for (int j = 0; j < comps[i].BtChannels.Count; j++) { if (Data.Count <= totalChannels) { Data.Add(new List <double>()); } else { Data[totalChannels] = new List <double>(); } totalChannels++; } } Task.Factory.StartNew(() => { Stopwatch batteryUpdateTimer = new Stopwatch(); batteryUpdateTimer.Start(); while (BTPipeline.CurrentState == Pipeline.ProcessState.Running) { if (batteryUpdateTimer.ElapsedMilliseconds >= 500) { foreach (var comp in BTPipeline.TrignoBtManager.Components) { if (comp == null) { continue; } Console.WriteLine("Sensor {0}: {1}% Charge", comp.Properties.SerialNumber, BTPipeline.TrignoBtManager.QueryBatteryComponentAsync(comp).Result); } batteryUpdateTimer.Restart(); } } }); }
private void CollectionStarted(object sender, DelsysAPI.Events.CollectionStartedEvent e) { Console.WriteLine("CollectionStarted"); //var comps = PipelineController.Instance.PipelineIds[0].TrignoBtManager.Components; }