public override bool SelectEquipment(EquipmentList aEquipList) { selectedEquipList.Clear(); if (aEquipList.Count == 0) { selectedEquipList.Add("DUT", dut); return(false); } else { bool isOK = false; for (byte i = 0; i < aEquipList.Count; i++) { if (aEquipList.Keys[i].ToUpper().Contains("POWERSUPPLY")) { pPs = (Powersupply)aEquipList["POWERSUPPLY"]; isOK = true; } if (aEquipList.Keys[i].ToUpper().Contains("SPECTROGRAPH")) { pWavemeter = (Spectrograph)aEquipList["WAVEMETER"]; } if (aEquipList.Keys[i].ToUpper().Contains("NA_OPTICALSWITCH")) { aEquipList.Values[i].CheckEquipmentRole(1, GlobalParameters.CurrentChannel); } } if (pPs != null && pWavemeter != null) { isOK = true; } else { if (pPs == null) { Log.SaveLogToTxt("POWERSUPPLY =NULL"); } if (pWavemeter == null) { Log.SaveLogToTxt("pWavemeter =NULL"); } isOK = false; OutPutandFlushLog(); } if (isOK) { selectedEquipList.Add("DUT", dut); } return(isOK); } }
public override bool SelectEquipment(EquipmentList aEquipList) { pPS = null; selectedEquipList.Clear(); if (aEquipList.Count == 0) { selectedEquipList.Add("DUT", dut); return(false); } else { bool isOK = false; selectedEquipList.Clear(); IList <string> tempKeys = aEquipList.Keys; IList <EquipmentBase> tempValues = aEquipList.Values; for (byte i = 0; i < aEquipList.Count; i++) { if (tempKeys[i].ToUpper().Contains("POWERSUPPLY")) { selectedEquipList.Add("POWERSUPPLY", tempValues[i]); pPS = (Powersupply)tempValues[i]; } if (tempKeys[i].ToUpper().Contains("SPECTROGRAPH")) { selectedEquipList.Add("SPECTROGRAPH", tempValues[i]); pSpectrograph = (Spectrograph)tempValues[i]; } if (tempKeys[i].ToUpper().Contains("NA_OPTICALSWITCH")) { tempValues[i].CheckEquipmentRole(1, GlobalParameters.CurrentChannel); } } if (pPS != null && pSpectrograph != null) { isOK = true; } else { isOK = false; } if (isOK) { selectedEquipList.Add("DUT", dut); } else { isOK = false; } return(isOK); } }