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

A wrapper class for locations. More...

Inheritance diagram for GUI.Datatypes.LocationCB:

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< MachineCBgetMachines ()
 Grants access to the list of machines that belong to the location. More...
 
List< ToolkitgetToolkits ()
 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< MachineCBmachines
 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< Toolkittoolkits
 A list of toolkits that belong to this location. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

GUI.Datatypes.LocationCB.LocationCB ( String  name,
double  penalty 
)

The Constructor.

Parameters
nameA string that determines the location's name.
penaltyA 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.

Member Function Documentation

void GUI.Datatypes.LocationCB.addMachine ( MachineCB  m)

Add a machine to this location.

Parameters
mA 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.

Parameters
tA 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 if all machines are unchecked, 2 if all machines are checked, inbetween 0 and 2 else.

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.

Parameters
tAn 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.

Parameters
lThe list that should be extended.
Returns
The extended list.

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.

Returns
A list of all machines.
List<Toolkit> GUI.Datatypes.LocationCB.getToolkits ( )

Grants access to the list of toolkits that belong to the location.

Returns
A list of all the toolkits.
void GUI.Datatypes.LocationCB.setNumberOfTimeslots ( int  num)

Sets the number of timeslots to a certain amount.

Parameters
numAn 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.

Parameters
tAn integer that represents one timeslot.
Returns
True if location is available on timeslot t, false if not.

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.

Member Data Documentation

List<MachineCB> GUI.Datatypes.LocationCB.machines
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).

bool [] GUI.Datatypes.LocationCB.timeslots
private

An array that stores for each timeslot if the location is available on this time.

List<Toolkit> GUI.Datatypes.LocationCB.toolkits
private

A list of toolkits that belong to this location.


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