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

A wrapper class for machines. More...

Inheritance diagram for GUI.Datatypes.MachineCB:

Public Member Functions

 MachineCB (String name, LocationCB loc)
 The Constructor. More...
 
void addProduct (ProductCB prod)
 Add a product to this machine. More...
 
double allChildrenChecked ()
 Check if every procuct belonging to the machine is checked. More...
 
void changeStateOfTimeslot (int t)
 Change the availability of this machine at timeslot t. More...
 
void changeStateOfTimeslot (int t, bool b)
 Change the availability of this machine at timeslot t to a ceratin value. More...
 
void checkAllProducts ()
 Check all the product Checkboxes that belong to this machine. More...
 
List< String > extendProductList (List< String > l)
 Extends the List of products that can be produced. More...
 
LocationCB getLocation ()
 Grants access to the location where the machine is located. More...
 
List< ProductCBgetProducts ()
 Grants access to the list of products that belong to the machine. More...
 
void setNumberOfTimeslots (int num)
 Sets the number of timeslots to a certain amount. More...
 
bool stateOfTimeslot (int t)
 Get the availability of this machine at timeslot t. More...
 
void uncheckAllProducts ()
 Uncheck all the product Checkboxes that belong to this machine. More...
 

Public Attributes

double Bauteilwechselphase
 A number that describes the time needed to change toolkits on this machine (in minutes). More...
 

Private Attributes

LocationCB location
 Location this machine belongs to. More...
 
List< ProductCBproducts
 List of products this machine can produce. More...
 
bool[] timeslots
 An array that stores for each timeslot if the machine is available on this time. More...
 

Detailed Description

A wrapper class for machines.

This class stores all the information that is needed to describe a pressing machine. 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.MachineCB.MachineCB ( String  name,
LocationCB  loc 
)

The Constructor.

Parameters
nameA string that determines the machine's name.
locThe location the machine is at.

Constructs a machine simply by its name and the location that the machine is meant to be at. Machines are initialized with full availability.

Member Function Documentation

void GUI.Datatypes.MachineCB.addProduct ( ProductCB  prod)

Add a product to this machine.

Parameters
prodA product this machine can produce.

This function allows one to add a product (type: ProductCB) to the list of products, that can be produced on this machine. Checks that products are not in the list twice.

double GUI.Datatypes.MachineCB.allChildrenChecked ( )

Check if every procuct belonging to the machine is checked.

Returns
0 if all machines are unchecked, 2 if all machines are checked, inbetween 0 and 2 else.

Returns 0 iff all products are unchecked, 2 iff all products are checked and a value inbetween iff the Checkboxes are partly checked, unchecked and/or indeterminate.

void GUI.Datatypes.MachineCB.changeStateOfTimeslot ( int  t)

Change the availability of this machine at timeslot t.

Parameters
tAn integer that represents timeslot number t.

Availability of machine 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.

void GUI.Datatypes.MachineCB.changeStateOfTimeslot ( int  t,
bool  b 
)

Change the availability of this machine at timeslot t to a ceratin value.

Parameters
tAn integer that represents timeslot number t.
bValue timeslot t should be assigned.

Availability of machine is stored as an array of bools internally. This function assigns a given value b to that array on position t if t is a valid timeslot.

void GUI.Datatypes.MachineCB.checkAllProducts ( )

Check all the product Checkboxes that belong to this machine.

If the user checks a machine, all of its products are taken into account for the model, i.e. all of the Checkboxes that belong to the products are checked as well.

List<String> GUI.Datatypes.MachineCB.extendProductList ( 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) that can be produced on this machine whose Checkboxes are marked as checked. Checks that a product is not listed twice.

LocationCB GUI.Datatypes.MachineCB.getLocation ( )

Grants access to the location where the machine is located.

Returns
Machine's location.
List<ProductCB> GUI.Datatypes.MachineCB.getProducts ( )

Grants access to the list of products that belong to the machine.

Returns
A list of products.
void GUI.Datatypes.MachineCB.setNumberOfTimeslots ( int  num)

Sets the number of timeslots to a certain amount.

Parameters
numValue that represents the number of timeslots we want to look at.

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 machine is fully available.

bool GUI.Datatypes.MachineCB.stateOfTimeslot ( int  t)

Get the availability of this machine at timeslot t.

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

Availability of machines 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.

void GUI.Datatypes.MachineCB.uncheckAllProducts ( )

Uncheck all the product Checkboxes that belong to this machine.

If the user checks a machine, none of its products are taken into account for the model, i.e. all of the Checkboxes that belong to the products are unchecked as well.

Member Data Documentation

double GUI.Datatypes.MachineCB.Bauteilwechselphase

A number that describes the time needed to change toolkits on this machine (in minutes).

LocationCB GUI.Datatypes.MachineCB.location
private

Location this machine belongs to.

List<ProductCB> GUI.Datatypes.MachineCB.products
private

List of products this machine can produce.

bool [] GUI.Datatypes.MachineCB.timeslots
private

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


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