Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ECE-Senior-Design/DataScraperGUI/MainWindow.xaml.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
59 lines (51 sloc)
1.94 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; | |
using System.Windows.Input; | |
using System.Windows.Media; | |
using System.Windows.Media.Imaging; | |
using System.Windows.Navigation; | |
using System.Windows.Shapes; | |
using DataScraperGUI.Infrastructure; | |
using DataScraperGUI.Programs; | |
namespace DataScraperGUI { | |
/// <summary> | |
/// Interaction logic for MainWindow.xaml | |
/// </summary> | |
public partial class MainWindow : Window { | |
private Logger logger = null; | |
public MainWindow() { | |
InitializeComponent(); | |
logger = new Logger(logBox); | |
logger.LogMessage("Successfully started application."); | |
} | |
private void runButton_Click (object sender, RoutedEventArgs e) { | |
cancelButton.IsEnabled = true; // Enable the cancel button. | |
logger.LogWarning("Run button pressed!"); | |
// 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. | |
} | |
} | |
} |