public void FilterDisplayedPlant(string plantName) { _dispatcherTimer.Stop(); Entries = new ObservableCollection <ProductionOrderViewModel>(AllEntries.Where(m => m.PlantName == plantName)); ShowChartAndEventsSection = Entries.Count > 0; LiveChartWidget.SetDataPointsByPlantInit(plantName, Entries.Count > 0 ? Entries.First().PlantIngotId : null); EventsWidget.SetDataByPlant(Entries.Count > 0 ? Entries.First().PlantIngotId : null); if (ShowChartAndEventsSection) { _dispatcherTimer.Start(); } RaisePropertyChanged("Entries"); RaisePropertyChanged("ShowChartAndEventsSection"); }
/// <summary> /// Event to update Trend Data & Events every X ms /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DispatcherTimer_Tick(object sender, EventArgs e) { LiveChartWidget.UpdateDataPoints(); EventsWidget.UpdateData(); }