Digital Twin - GUI
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
GUI.MainWindow Class Reference

This is the main window, where the locations, machines and products are shown. More...

Inheritance diagram for GUI.MainWindow:

Public Member Functions

 MainWindow ()
 Constructor. More...
 
void clear ()
 Deletes every object on the interface. More...
 
void setup ()
 Reads in data from a user defined folder (or the standard one) and sets the interface up with all its components. If used without clear() beforehand, Content is added to the current interface. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 Verwendete Ressourcen bereinigen. More...
 

Private Member Functions

void button1_Click (object sender, EventArgs e)
 Eventhandler that is called when the "Durchsuchen..." button is clicked. More...
 
void button2_Click (object sender, EventArgs e)
 Function that is called when the "Compute" Button is clicked. Reads in the rest of the model data and calls Mosel Xpress. More...
 
void dateTimePicker1_ValueChanged (object sender, EventArgs e)
 Called whenever the user change the date for the startTime. More...
 
void dateTimePicker2_ValueChanged (object sender, EventArgs e)
 Called whenever the user change the date for the endTime. More...
 
void InitializeComponent ()
 Erforderliche Methode für die Designerunterstützung. Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. More...
 
void LocationCheckBoxChanged (object sender, EventArgs e)
 Eventhandler that is called when the Checkstate of a location has changed. More...
 
void LocationCheckBoxClicked (object sender, EventArgs e)
 Eventhandler that is called when the location checkbox has been clicked. More...
 
void MachineCheckBoxChanged (object sender, EventArgs e)
 Eventhandler that is called when the Checkstate of a machine has changed. More...
 
void MachineCheckBoxClicked (object sender, EventArgs e)
 Eventhandler that is called when the machine checkbox has been clicked. More...
 
void numericUpDown1_ValueChanged (object sender, EventArgs e)
 Called whenever the user change the hour for the startTime. More...
 
void numericUpDown2_ValueChanged (object sender, EventArgs e)
 Called whenever the user change the hour for the endTime. More...
 
void ProductCheckBoxChanged (object sender, EventArgs e)
 Eventhandler that is called when the Checkstate of a product has changed. More...
 
void UpdateEndtime ()
 Function which updates the endTime, provided that the end time is at least the startTime + 1 hour. Otherwise, the endTime is set to the startTime + 1 hour. More...
 
void UpdateNumberOfTimeslots ()
 Update number of timeslots for each machine and Location every time endTime or startTime change. More...
 
void UpdateStartTime ()
 Function which updates the startTime, and updates the endTime if necessary. More...
 

Private Attributes

System.Windows.Forms.Button button1
 
System.ComponentModel.IContainer components = null
 Erforderliche Designervariable. More...
 
System.Windows.Forms.Button ComputeButton
 
System.Windows.Forms.DateTimePicker dateTimePicker1
 
System.Windows.Forms.DateTimePicker dateTimePicker2
 
System.DirectoryServices.DirectorySearcher directorySearcher1
 
DateTime endTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 0, 0).AddHours(1)
 Endtime of planning horizon. More...
 
string excelFilePath = Directory.GetParent(Directory.GetParent(Directory.GetParent(Directory.GetCurrentDirectory()).ToString()).ToString()) + "\\Resources\\Dataset.xlsx"
 Folder directory where the Excel input file is located. More...
 
bool ExcelFileReadIn = false
 Check if Excel file has been read in before. More...
 
System.Windows.Forms.FlowLayoutPanel flowLayoutPanelLocations
 
System.Windows.Forms.FlowLayoutPanel flowLayoutPanelMachines
 
System.Windows.Forms.FlowLayoutPanel flowLayoutPanelProducts
 
System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1
 
System.Windows.Forms.GroupBox groupBox1
 
System.Windows.Forms.GroupBox groupBox2
 
System.Windows.Forms.GroupBox groupBox3
 
System.Windows.Forms.GroupBox groupBox4
 
System.Windows.Forms.GroupBox groupBox5
 
System.Windows.Forms.Label label1
 
System.Windows.Forms.Label label2
 
System.Windows.Forms.Label label3
 
System.Windows.Forms.Label label4
 
Dictionary< String, int > locationDictionary = new Dictionary<String, int>()
 Dictionary that maps a location's name to its position in the locations array. More...
 
FlowLayoutPanel[] LocationFlowLayouts
 Each Location is wrapped by a Location FlowLayout. More...
 
String[] locationNames
 Array that contains all of the locations' names. More...
 
LocationCB[] locations
 Array that stores all locations. More...
 
FlowLayoutPanel[] MachineFlowLayouts
 Each block of machines is wrapped by a Location FlowLayout. More...
 
List< MachineCB >[] machinesAtLocation
 All machines at a specific location. Indexed by location's indexed, so that they can be aligned vertically. More...
 
ModelData md
 Object that contains additional model data. More...
 
System.Windows.Forms.NumericUpDown numericUpDown1
 
System.Windows.Forms.NumericUpDown numericUpDown2
 
FlowLayoutPanel[] ProductFlowLayouts
 Each block of products is wrapped by a Location FlowLayout. More...
 
List< ProductCB >[] productsAtMachine
 All products at a specific location. Indexed by location's indexed, so that they can be aligned vertically. More...
 
string resourcesFolder = Directory.GetParent(Directory.GetParent(Directory.GetParent(Directory.GetCurrentDirectory()).ToString()).ToString()) + "\\Resources"
 Folder directory where the model related files are located. More...
 
DateTime startTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 0, 0)
 Starttime of planning horizon. More...
 
System.Windows.Forms.TextBox textBox1
 
int width = 145
 Number to easily adjust width of all elements. More...
 

Detailed Description

This is the main window, where the locations, machines and products are shown.

Constructor & Destructor Documentation

GUI.MainWindow.MainWindow ( )

Constructor.

Member Function Documentation

void GUI.MainWindow.button1_Click ( object  sender,
EventArgs  e 
)
private

Eventhandler that is called when the "Durchsuchen..." button is clicked.

Parameters
senderDetermines which object called the eventhandler.
eEvent data.

Opens a folderBrowserDialog that lets the user browse for a folder that contains "Dataset.xlsx"

void GUI.MainWindow.button2_Click ( object  sender,
EventArgs  e 
)
private

Function that is called when the "Compute" Button is clicked. Reads in the rest of the model data and calls Mosel Xpress.

Parameters
senderDetermines which object called the eventhandler.
eEvent data.
void GUI.MainWindow.clear ( )

Deletes every object on the interface.

void GUI.MainWindow.dateTimePicker1_ValueChanged ( object  sender,
EventArgs  e 
)
private

Called whenever the user change the date for the startTime.

Parameters
senderDetermines which object called the eventhandler.
eEvent data.
void GUI.MainWindow.dateTimePicker2_ValueChanged ( object  sender,
EventArgs  e 
)
private

Called whenever the user change the date for the endTime.

Parameters
senderDetermines which object called the eventhandler.
eEvent data.
override void GUI.MainWindow.Dispose ( bool  disposing)
protected

Verwendete Ressourcen bereinigen.

Parameters
disposingTrue, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.
void GUI.MainWindow.InitializeComponent ( )
private

Erforderliche Methode für die Designerunterstützung. Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.

void GUI.MainWindow.LocationCheckBoxChanged ( object  sender,
EventArgs  e 
)
private

Eventhandler that is called when the Checkstate of a location has changed.

Parameters
senderDetermines which object called the eventhandler.
eEvent data.

Should be called everytime a Checkstate of a location has changed. Takes care, that a user cannot assign Indeterminate as a CheckState, marks all the machines (and their products) if a location is checked and unmarks them if unchecked.

void GUI.MainWindow.LocationCheckBoxClicked ( object  sender,
EventArgs  e 
)
private

Eventhandler that is called when the location checkbox has been clicked.

Parameters
senderDetermines which object called the eventhandler.
eEvent data.

Should be called everytime a location checkbox has been clicked. Opens the TimeSlotDialog to make adjustments when the location is available in our model.

void GUI.MainWindow.MachineCheckBoxChanged ( object  sender,
EventArgs  e 
)
private

Eventhandler that is called when the Checkstate of a machine has changed.

Parameters
senderDetermines which object called the eventhandler.
eEvent data.

Should be called everytime a Checkstate of a machine has changed. Takes care, that a user cannot assign Indeterminate as a CheckState, marks all the products if a location is checked and unmarks them if unchecked. If all machines are checked, also check the location, etc.

void GUI.MainWindow.MachineCheckBoxClicked ( object  sender,
EventArgs  e 
)
private

Eventhandler that is called when the machine checkbox has been clicked.

Parameters
senderDetermines which object called the eventhandler.
eEvent data.

Should be called everytime a machine checkbox has been clicked. Opens the TimeSlotDialog to make adjustments when the machine is available in our model.

void GUI.MainWindow.numericUpDown1_ValueChanged ( object  sender,
EventArgs  e 
)
private

Called whenever the user change the hour for the startTime.

Parameters
senderDetermines which object called the eventhandler.
eEvent data.
void GUI.MainWindow.numericUpDown2_ValueChanged ( object  sender,
EventArgs  e 
)
private

Called whenever the user change the hour for the endTime.

Parameters
senderDetermines which object called the eventhandler.
eEvent data.
void GUI.MainWindow.ProductCheckBoxChanged ( object  sender,
EventArgs  e 
)
private

Eventhandler that is called when the Checkstate of a product has changed.

Parameters
senderDetermines which object called the eventhandler.
eEvent data.

Should be called everytime a Checkstate of a product has changed. If all products are checked, also check the machine, etc.

void GUI.MainWindow.setup ( )

Reads in data from a user defined folder (or the standard one) and sets the interface up with all its components. If used without clear() beforehand, Content is added to the current interface.

void GUI.MainWindow.UpdateEndtime ( )
private

Function which updates the endTime, provided that the end time is at least the startTime + 1 hour. Otherwise, the endTime is set to the startTime + 1 hour.

void GUI.MainWindow.UpdateNumberOfTimeslots ( )
private

Update number of timeslots for each machine and Location every time endTime or startTime change.

void GUI.MainWindow.UpdateStartTime ( )
private

Function which updates the startTime, and updates the endTime if necessary.

Member Data Documentation

System.ComponentModel.IContainer GUI.MainWindow.components = null
private

Erforderliche Designervariable.

DateTime GUI.MainWindow.endTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 0, 0).AddHours(1)
private

Endtime of planning horizon.

string GUI.MainWindow.excelFilePath = Directory.GetParent(Directory.GetParent(Directory.GetParent(Directory.GetCurrentDirectory()).ToString()).ToString()) + "\\Resources\\Dataset.xlsx"
private

Folder directory where the Excel input file is located.

bool GUI.MainWindow.ExcelFileReadIn = false
private

Check if Excel file has been read in before.

Dictionary<String, int> GUI.MainWindow.locationDictionary = new Dictionary<String, int>()
private

Dictionary that maps a location's name to its position in the locations array.

FlowLayoutPanel [] GUI.MainWindow.LocationFlowLayouts
private

Each Location is wrapped by a Location FlowLayout.

String [] GUI.MainWindow.locationNames
private

Array that contains all of the locations' names.

LocationCB [] GUI.MainWindow.locations
private

Array that stores all locations.

FlowLayoutPanel [] GUI.MainWindow.MachineFlowLayouts
private

Each block of machines is wrapped by a Location FlowLayout.

List<MachineCB> [] GUI.MainWindow.machinesAtLocation
private

All machines at a specific location. Indexed by location's indexed, so that they can be aligned vertically.

ModelData GUI.MainWindow.md
private

Object that contains additional model data.

FlowLayoutPanel [] GUI.MainWindow.ProductFlowLayouts
private

Each block of products is wrapped by a Location FlowLayout.

List<ProductCB> [] GUI.MainWindow.productsAtMachine
private

All products at a specific location. Indexed by location's indexed, so that they can be aligned vertically.

string GUI.MainWindow.resourcesFolder = Directory.GetParent(Directory.GetParent(Directory.GetParent(Directory.GetCurrentDirectory()).ToString()).ToString()) + "\\Resources"
private

Folder directory where the model related files are located.

DateTime GUI.MainWindow.startTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 0, 0)
private

Starttime of planning horizon.

int GUI.MainWindow.width = 145
private

Number to easily adjust width of all elements.


The documentation for this class was generated from the following files: