* And Generate the Working list in the same time
*/
public void actionPerformed(ActionEvent arg0) {
// FIRST we check if all went OK
if (parentRobotDriver.thePlate().targetHolder().name().equals("")) {
SimpleErrorDialog dialog = new SimpleErrorDialog(parentRobotDriver,"Robot Driver Message",
true, "Target Holder must be Set !");
dialog.pack();
dialog.setLocationRelativeTo(parentRobotDriver);
dialog.setVisible(true);
return;
}
for ( Ingredient aIngredient : parentRobotDriver.usedIngredients() ) {
if (aIngredient.chemical().pipettingInfo().liquidClass().name().equals("NONE")) {
SimpleErrorDialog dialog = new SimpleErrorDialog(parentRobotDriver,"Robot Driver Message",
true, "All The Liquid Classes must be defined !");
dialog.pack();
dialog.setLocationRelativeTo(parentRobotDriver);
dialog.setVisible(true);
return;
}
}
// The input is OK
// order the used Ingredients by LiquidClass priority then LiquidClass name
Collections.sort(parentRobotDriver.usedIngredients(),parentRobotDriver.usedIngredients());
// Make the Working List that means do 2 things
// write the Aspirate and Dispense commands
// And give to each used ingredient a Holder and a position in Holder
PipetIngredientList thePipetIngredientList = parentRobotDriver.usedIngredients().prepareAndBuildPipetIngredientList();
try {
thePipetIngredientList.generateWorkingList(parentRobotDriver.tecanSettings(), parentRobotDriver.thePlate(), parentRobotDriver.tecanHolders(), parentRobotDriver.wasteHolder());
} catch (RobotDriverException rbde) {
SimpleErrorDialog simpleDialog = new SimpleErrorDialog(parentRobotDriver, "Robot Driver ERROR",
true, "This Error occurred:\n" + rbde.getMessage() + " -The Working List Can Not be Generated!");
simpleDialog.pack();
simpleDialog.setLocationRelativeTo(parentRobotDriver);
simpleDialog.setVisible(true);
return;
}
// build the screen
parentRobotDriver.getContentPane().removeAll();