Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Minor tweaks to GUI. Added program selection in code.
  • Loading branch information
ejr06006 committed Apr 18, 2012
1 parent 49515ad commit 87ae42c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
11 changes: 6 additions & 5 deletions DataScraperGUI/MainWindow.xaml
@@ -1,13 +1,14 @@
<Window x:Class="DataScraperGUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="UConn ECE Senior Design - Group 155 - DataScraper" Height="400" Width="525">
Title="UConn ECE Senior Design - Group 155 - HVAC Tester" Height="400" Width="525">
<Grid>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="12,46,0,0" Name="programComboBox" VerticalAlignment="Top" Width="479">
<ComboBoxItem Content="Normal program. (Minor variations, no major events.)" IsSelected="True" />
<ComboBoxItem Content="Temperature too cold in office." />
<ComboBoxItem Content="Humidity too high in office." />
<ComboBoxItem Content="VAV is not responding." />
<ComboBoxItem Content="Normal" IsSelected="True" />
<ComboBoxItem Content="Temperature too COLD" />
<ComboBoxItem Content="Temperature too HOT" />
<ComboBoxItem Content="No air flow" />
<ComboBoxItem Content="Air too dry" />
</ComboBox>
<Label Content="Step 1: Choose a program." Height="28" HorizontalAlignment="Left" Margin="12,12,0,0" Name="label1" VerticalAlignment="Top" />
<Label Content="Step 2: Choose a run-time duration." Height="28" HorizontalAlignment="Left" Margin="12,75,0,0" Name="label2" VerticalAlignment="Top" />
Expand Down
24 changes: 22 additions & 2 deletions DataScraperGUI/MainWindow.xaml.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows;
Expand Down Expand Up @@ -30,10 +31,29 @@ namespace DataScraperGUI {
}

private void runButton_Click (object sender, RoutedEventArgs e) {
cancelButton.IsEnabled = true; // Enable the cancel button.
logger.LogWarning("Run button pressed!");

var p = new NormalProgram(logger, progressBar);
p.Execute();
// Grab the selected program
var pText = programComboBox.SelectionBoxItem;

if (pText.Equals("Normal")) {
// Run normal program
var p = new NormalProgram(logger, progressBar);
p.Execute();
} else if (pText.Equals("Temperature too COLD")) {
// Run temp too cold program
} else if (pText.Equals("Temperature too HOT")) {
// Run temp too hot program
} else if (pText.Equals("No air flow")) {
// Run no air flow program
} else if (pText.Equals("Air too dry")) {
// Run air too dry program
} else {
logger.LogError("Program not selected or system fault.");
}

cancelButton.IsEnabled = false; // Disable the cancel button.
}
}
}
5 changes: 4 additions & 1 deletion DataScraperGUI/Programs/NormalProgram.cs
Expand Up @@ -14,17 +14,20 @@ namespace DataScraperGUI.Programs {
public NormalProgram (Logger l, ProgressBar p) : base(l, p) { }

public override void Execute() {
logger.LogMessage("Starting the 'Normal' program.");
// Setup Simulation
sb = new StringBuilder();

GenerateHeader(); // Write the CSV header

logger.LogError("This program has not yet been implemented.");

logger.LogMessage("Ending the 'Normal' program.");
progressBar.Value = 100;
}

private void GenerateHeader () {

sb.AppendLine();
}
}
}

0 comments on commit 87ae42c

Please sign in to comment.