1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
private void run(int choice)
{
switch (choice) {
case 0:
opcClient.WriteItem(".INIT", true);
opcClient.WriteItem(".HANDOFF_AVAIL", true);
opcClient.WriteItem(".I_GO", true);
carrierDetectUndetect = new CarrierDetectUndetect();
carrierDetectUndetect.CarrierIs += new CarrierDetectUndetect.ChoiceCarrierIsEventHandler(carrierDetectUndetect_CarrierIs);
carrierDetectUndetect.Show();
break;
case 1:
loadPortChoice = new LoadPortChoice();
loadPortChoice.LPAdded += new LoadPortChoice.AddLPEventHandler(loadPortChoice_LPAdded);
loadPortChoice.Show();
break;
case 4:
opcClient.WriteItem(".I_VALID", true);
Choice = 5;
run(Choice);
break;
case 5:
opcClient.ReadItem(".O_L_REQ", out objectLoadValue);
opcClient.ReadItem(".O_U_REQ", out objectUnloadValue);
if((bool)objectLoadValue == true)
{
flagL_REQ = true;
Choice = 6;
}
if((bool)objectUnloadValue == true)
{
flagU_REQ = true;
Choice = 6;
}
run(Choice);
break;
case 6:
opcClient.WriteItem(".I_TR_REQ", true);
break;
case 7:
opcClient.WriteItem(".I_BUSY", true);
Choice = 2;
run(2);
break;
case 2:
//
//C'est ici que cela ce passe
//
if(!carrierDetectUndetect.Created)
carrierDetectUndetect = new CarrierDetectUndetect();
carrierDetectUndetect.Show();
break;
case 8:
opcClient.WriteItem(".I_BUSY", false);
opcClient.WriteItem(".I_TR_REQ", false);
opcClient.WriteItem(".I_COMPT", true);
break;
case 9:
opcClient.WriteItem(".I_COMPT", false);
Choice = 10;
run(Choice);
break;
case 10:
opcClient.WriteItem(".I_VALID", false);
break;
}
} |
Partager