private void UpdateTagsList() { LabelsCollection.Clear(); foreach (string CurrentTag in _LabelsList) { LabelsCollection.Add(new StringObject { Value = CurrentTag }); } }
/// <summary> /// If chart is running and no data received, last value is copied /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _oneSecondTimer_Tick(object sender, EventArgs e) { if (SamplesCollection[0].Values.Count > 0) { SamplesCollection[0].Values.Add(SamplesCollection[0].Values[SamplesCollection[0].Values.Count - 1]); } else { SamplesCollection[0].Values.Add(0.0); } LabelsCollection.Add(DateTime.Now.ToString()); }
/// <summary> /// Main point of collection data, all class from ISamples send dataReceived event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _data_DataReceived(object sender, List <double> e) { _oneSecondTimer.Stop(); var newSamples = new ObservableCollection <double>(e); foreach (var item in newSamples) { SamplesCollection[0].Values.Add(item); LabelsCollection.Add(DateTime.Now.ToString()); } _oneSecondTimer.Start(); }
private static void ExtractLabel(ref string line, int number) { var match = Regex.Match(line, @"\b([\w]*)\s*\:"); if (match.Success) { var gp = match.Groups[1].Value.ToUpper(); line = line.Replace(match.Groups[0].Value, string.Empty); if (!LabelsCollection.ContainsKey(gp)) { LabelsCollection.Add(gp, number); } } }