/// <summary> /// Switch mode to disconnected /// </summary> public void SwitchToDisconnected() { IsModeConnected = false; SerialHandler.ClosePort(); SeriesCollection[0].Values.Clear(); SerialHandler.IncomingData.Clear(); Timestamp = ""; if (SeriesCollection.Count == 1) { SeriesCollection.Add( new LineSeries { Title = "Low", Values = new ChartValues <ObservablePoint>(), LineSmoothness = 0.1, StrokeThickness = 0.5 }); SeriesCollection.Add( new LineSeries { Title = "High", Values = new ChartValues <ObservablePoint>(), LineSmoothness = 0.1, StrokeThickness = 0.5 }); } dataX = 0; }