History

GSF.PhasorProtocols.UI.WPF: Added validation for the chart refresh interval to ensure that the Manger doesn't crash when the value is misconfigured.

StephenCWills committed 8 years ago

Commit 1b53ab71 parent 1b5f8cc1 file · +9 −5Browse files

Unified · Split

Source/Libraries/GSF.PhasorProtocols/UI/WPF/UserControls/InputStatusMonitorUserControl.xaml.cs+9−5
@@ -90,7 +90,7 @@ namespace GSF.PhasorProtocols.UI.UserControls · 89 unmodified lines
90 private bool m_useLocalClockAsRealtime = true;90 private bool m_useLocalClockAsRealtime = true;
91 private bool m_ignoreBadTimestamps;91 private bool m_ignoreBadTimestamps;
92 private int m_chartRefreshInterval = 66;92 private int m_chartRefreshInterval = 66;
93 private int m_statisticsDataRefershInterval = 10;93 private int m_statisticsDataRefreshInterval = 10;
94 private int m_measurementsDataRefreshInterval = 10;94 private int m_measurementsDataRefreshInterval = 10;
95 private double m_frequencyRangeMin = 59.95;95 private double m_frequencyRangeMin = 59.95;
96 private double m_frequencyRangeMax = 60.05;96 private double m_frequencyRangeMax = 60.05;
@@ -264,7 +264,7 @@ namespace GSF.PhasorProtocols.UI.UserControls · 167 unmodified lines
264 m_xAxisDataCollection = new int[m_numberOfDataPointsToPlot];264 m_xAxisDataCollection = new int[m_numberOfDataPointsToPlot];
265 m_refreshRate = Ticks.FromMilliseconds(m_chartRefreshInterval);265 m_refreshRate = Ticks.FromMilliseconds(m_chartRefreshInterval);
266 TextBlockMeasurementRefreshInterval.Text = m_measurementsDataRefreshInterval.ToString();266 TextBlockMeasurementRefreshInterval.Text = m_measurementsDataRefreshInterval.ToString();
267 TextBlockStatisticsRefreshInterval.Text = m_statisticsDataRefershInterval.ToString();267 TextBlockStatisticsRefreshInterval.Text = m_statisticsDataRefreshInterval.ToString();
268 TextBoxProcessInterval.Text = "33";268 TextBoxProcessInterval.Text = "33";
269 }269 }
270 270
@@ -376,7 +376,7 @@ namespace GSF.PhasorProtocols.UI.UserControls · 105 unmodified lines
376 int.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("NumberOfDataPointsToPlot").ToString(), out m_numberOfDataPointsToPlot);376 int.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("NumberOfDataPointsToPlot").ToString(), out m_numberOfDataPointsToPlot);
377 int.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("DataResolution").ToString(), out m_framesPerSecond);377 int.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("DataResolution").ToString(), out m_framesPerSecond);
378 int.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("ChartRefreshInterval").ToString(), out m_chartRefreshInterval);378 int.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("ChartRefreshInterval").ToString(), out m_chartRefreshInterval);
379 int.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("StatisticsDataRefreshInterval").ToString(), out m_statisticsDataRefershInterval);379 int.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("StatisticsDataRefreshInterval").ToString(), out m_statisticsDataRefreshInterval);
380 int.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("MeasurementsDataRefreshInterval").ToString(), out m_measurementsDataRefreshInterval);380 int.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("MeasurementsDataRefreshInterval").ToString(), out m_measurementsDataRefreshInterval);
381 double.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("LagTime").ToString(), out m_lagTime);381 double.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("LagTime").ToString(), out m_lagTime);
382 double.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("LeadTime").ToString(), out m_leadTime);382 double.TryParse(IsolatedStorageManager.ReadFromIsolatedStorage("LeadTime").ToString(), out m_leadTime);
@@ -484,8 +484,12 @@ namespace GSF.PhasorProtocols.UI.UserControls · 101 unmodified lines
484 {484 {
485 if (m_refreshTimer == null)485 if (m_refreshTimer == null)
486 {486 {
487 double chartRefreshInterval = (m_chartRefreshInterval >= 0)
488 ? m_chartRefreshInterval
489 : 66;
490
487 m_refreshTimer = new DispatcherTimer();491 m_refreshTimer = new DispatcherTimer();
488 m_refreshTimer.Interval = TimeSpan.FromMilliseconds(m_chartRefreshInterval);492 m_refreshTimer.Interval = TimeSpan.FromMilliseconds(chartRefreshInterval);
489 m_refreshTimer.Tick += m_refreshTimer_Tick;493 m_refreshTimer.Tick += m_refreshTimer_Tick;
490 m_refreshTimer.Start();494 m_refreshTimer.Start();
491 }495 }
@@ -923,7 +927,7 @@ namespace GSF.PhasorProtocols.UI.UserControls · 431 unmodified lines
923 TextBoxNumberOFDataPointsToPlot.Text = m_numberOfDataPointsToPlot.ToString();927 TextBoxNumberOFDataPointsToPlot.Text = m_numberOfDataPointsToPlot.ToString();
924 TextBoxDataResolution.Text = m_framesPerSecond.ToString();928 TextBoxDataResolution.Text = m_framesPerSecond.ToString();
925 TextBoxChartRefreshInterval.Text = m_chartRefreshInterval.ToString();929 TextBoxChartRefreshInterval.Text = m_chartRefreshInterval.ToString();
926 TextBoxStatisticDataRefreshInterval.Text = m_statisticsDataRefershInterval.ToString();930 TextBoxStatisticDataRefreshInterval.Text = m_statisticsDataRefreshInterval.ToString();
927 TextBoxMeasurementDataRefreshInterval.Text = m_measurementsDataRefreshInterval.ToString();931 TextBoxMeasurementDataRefreshInterval.Text = m_measurementsDataRefreshInterval.ToString();
928 TextBoxLagTime.Text = m_lagTime.ToString();932 TextBoxLagTime.Text = m_lagTime.ToString();
929 TextBoxLeadTime.Text = m_leadTime.ToString();933 TextBoxLeadTime.Text = m_leadTime.ToString();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t