Dynamic labels & Changed color to light green
- Filesystem size - Flexi version - Flexi Revision - MAC - Timestamp - Temperature - ZoomLock - Serial and model Number - Licenses - CPU usage
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
{
|
||||
VorI.Sort(); // Sort the list from lowest to highest to prepare for finding the median
|
||||
double medianVorI = (VorI[2] + VorI[3]) / 2.0; // Will always be even (6) number of channels therefore average the two middle elements
|
||||
lblVorI.Text += $"Median: {medianVorI}{VormA} "; // Display median value
|
||||
string medianText = $"Median: {medianVorI}{VormA}";
|
||||
|
||||
// Define the 20% threshold ranges
|
||||
double LowerThreshold = ExpVorI * 0.8;
|
||||
@@ -18,8 +18,12 @@
|
||||
// Check median is within 20% of the expected value
|
||||
if (medianVorI < LowerThreshold || medianVorI > UpperThreshold)
|
||||
{
|
||||
lblVorI.Text += $" Median away from excepted {ExpVorI}{VormA}";
|
||||
lblVorI.ForeColor = Color.Red;
|
||||
medianText += $" (away from expected {ExpVorI}{VormA})";
|
||||
lblVorI.Invoke(() =>
|
||||
{
|
||||
lblVorI.Text = lblVorI.Text.TrimEnd('=', ' ') + " = " + medianText;
|
||||
lblVorI.ForeColor = Color.Red;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,12 +39,20 @@
|
||||
// If there are no single channels outside the threshold then green, else red
|
||||
if (outOfRangeVoltageChannels.Count == 0)
|
||||
{
|
||||
lblVorI.ForeColor = Color.LightGreen;
|
||||
lblVorI.Invoke(() =>
|
||||
{
|
||||
lblVorI.Text = lblVorI.Text.TrimEnd('=', ' ') + " = " + medianText;
|
||||
lblVorI.ForeColor = Color.LimeGreen;
|
||||
});
|
||||
}
|
||||
else if (outOfRangeVoltageChannels.Count != 0)
|
||||
{
|
||||
lblVorI.Text += "error on " + string.Join(", ", outOfRangeVoltageChannels); // Join all problem channels together to present on form
|
||||
lblVorI.ForeColor = Color.Red;
|
||||
string errorText = medianText + " (error on " + string.Join(", ", outOfRangeVoltageChannels) + ")";
|
||||
lblVorI.Invoke(() =>
|
||||
{
|
||||
lblVorI.Text = lblVorI.Text.TrimEnd('=', ' ') + " = " + errorText;
|
||||
lblVorI.ForeColor = Color.Red;
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user