Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
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.
}
}
}