Digital Twin - GUI
|
A wrapper class for locations. More...
Public Member Functions | |
LocationCB (String name, double penalty) | |
The Constructor. More... | |
void | addMachine (MachineCB m) |
Add a machine to this location. More... | |
void | addToolkit (Toolkit t) |
Add a toolkit to this location. More... | |
double | allChildrenChecked () |
Check if every machine belonging to the location is checked. More... | |
void | changeStateOfTimeslot (int t) |
Change the availability of this location at timeslot t. More... | |
void | checkAllMachines () |
Check all the machine Checkboxes that belong to this location. More... | |
List< String > | extendProducableProducts (List< String > l) |
Extends the List of products that can be produced. More... | |
List< MachineCB > | getMachines () |
Grants access to the list of machines that belong to the location. More... | |
List< Toolkit > | getToolkits () |
Grants access to the list of toolkits that belong to the location. More... | |
void | setNumberOfTimeslots (int num) |
Sets the number of timeslots to a certain amount. More... | |
bool | stateOfTimeslot (int t) |
Get the availability of this location at timeslot t. More... | |
void | uncheckAllMachines () |
Uncheck all the machine Checkboxes that belong to this location. More... | |
Public Attributes | |
double | Penalty |
A number that describes the estimated penalty for the dalayed production of one product (in Euro). More... | |
Private Attributes | |
List< MachineCB > | machines |
A list of machines that belong to this location. More... | |
bool[] | timeslots |
An array that stores for each timeslot if the location is available on this time. More... | |
List< Toolkit > | toolkits |
A list of toolkits that belong to this location. More... | |
A wrapper class for locations.
This class stores all the information that is needed to describe a facility (location). Plus it contains all the members and functions of a System.Windows.Forms.CheckBox class, so that we have a Checkbox attached to it and can easily check at all times if we want to use if for the model.
GUI.Datatypes.LocationCB.LocationCB | ( | String | name, |
double | penalty | ||
) |
The Constructor.
name | A string that determines the location's name. |
penalty | A penalty value for unproduced products. |
Constructs a location simply by its name and a penalty value for unproduced products. Locations are initialized with full availability.
void GUI.Datatypes.LocationCB.addMachine | ( | MachineCB | m | ) |
Add a machine to this location.
m | A machine that should be added. |
This function allows one to add a machine (type: MachineCB) to the list of machines, that belong to the location. Checks that machines are not in the list twice.
void GUI.Datatypes.LocationCB.addToolkit | ( | Toolkit | t | ) |
Add a toolkit to this location.
t | A toolkit that should be added. |
This function allows one to add a toolkit (type: Toolkit) to the list of toolkits, that belong to the location. Checks that machines are not in the list twice.
double GUI.Datatypes.LocationCB.allChildrenChecked | ( | ) |
Check if every machine belonging to the location is checked.
Returns 0 iff all machines are unchecked, 2 iff all machines are checked and a value inbetween iff the Checkboxes are partly checked, unchecked and/or indeterminate.
void GUI.Datatypes.LocationCB.changeStateOfTimeslot | ( | int | t | ) |
Change the availability of this location at timeslot t.
t | An integer that represents one timeslot. |
Availability of locations is stored as an array of bools internally. This function flips the value of that array on position t if t is a valid timeslot. Additionally, if a location is un-/available for production at timeslot t, all of its machines are of the same state, too. This function takes care, that all machines have the same state at timeslot t.
void GUI.Datatypes.LocationCB.checkAllMachines | ( | ) |
Check all the machine Checkboxes that belong to this location.
If the user checks a location, all of its machines are taken into account for the model, i.e. all of the Checkboxes that belong to the machines are checked as well.
List<String> GUI.Datatypes.LocationCB.extendProducableProducts | ( | List< String > | l | ) |
Extends the List of products that can be produced.
l | The list that should be extended. |
Given a List of strings, this function extends that list with all the products (i.e. productnames) at this location for which their Checkboxes are marked as checked.
List<MachineCB> GUI.Datatypes.LocationCB.getMachines | ( | ) |
Grants access to the list of machines that belong to the location.
List<Toolkit> GUI.Datatypes.LocationCB.getToolkits | ( | ) |
Grants access to the list of toolkits that belong to the location.
void GUI.Datatypes.LocationCB.setNumberOfTimeslots | ( | int | num | ) |
Sets the number of timeslots to a certain amount.
num | An integer that represents the amount of timeslots we want to use. |
If the user changes start or end time for which the model should run, the amounts of timeslots (in hours) adapt these changes. All new timeslots are initialized as true, so the location is fully available.
bool GUI.Datatypes.LocationCB.stateOfTimeslot | ( | int | t | ) |
Get the availability of this location at timeslot t.
t | An integer that represents one timeslot. |
Availability of locations is stored as an array of bools internally. This function returns the value of that array on position t if t is a valid timeslot. Returns true if location is available on timeslot t, false if not.
void GUI.Datatypes.LocationCB.uncheckAllMachines | ( | ) |
Uncheck all the machine Checkboxes that belong to this location.
If the user unchecks a location, none of its machines are taken into account for the model, i.e. all of the Checkboxes that belong to the machines are unchecked as well.
|
private |
A list of machines that belong to this location.
double GUI.Datatypes.LocationCB.Penalty |
A number that describes the estimated penalty for the dalayed production of one product (in Euro).
|
private |
An array that stores for each timeslot if the location is available on this time.
|
private |
A list of toolkits that belong to this location.