Ejemplo n.º 1
0
        public override bool SelectEquipment(EquipmentList aEquipList)
        {
            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("TX_ATTEN"))
                    {
                        selectedEquipList.Add("ATTEN_TX", tempValues[i]);
                        isOK = true;
                    }

                    if (tempKeys[i].ToUpper().Contains("POWERMETER"))
                    {
                        selectedEquipList.Add("POWERMETER", tempValues[i]);
                        isOK = true;
                    }
                    if (tempKeys[i].ToUpper().Contains("SCOPE"))
                    {
                        selectedEquipList.Add("SCOPE", tempValues[i]);
                        isOK = true;
                    }
                    if (tempKeys[i].ToUpper().Contains("TX_PPG"))
                    {
                        selectedEquipList.Add("PPG", tempValues[i]);
                        isOK = true;
                    }
                    if (tempKeys[i].ToUpper().Contains("NA_OPTICALSWITCH"))
                    {
                        tempValues[i].CheckEquipmentRole(2, GlobalParameters.CurrentChannel);
                        pOpticalSwitch = (OpticalSwitch)selectedEquipList["NA_OPTICALSWITCH"];
                    }
                }
                // tempps = (Powersupply)selectedEquipList["POWERSUPPLY"];
                pAtt        = (Attennuator)selectedEquipList["ATTEN_TX"];
                pPowerMeter = (PowerMeter)selectedEquipList["POWERMETER"];
                pPPG        = (PPG)selectedEquipList["PPG"];
                pScope      = (Scope)selectedEquipList["SCOPE"];

                // pOpticalSwitch = (OpticalSwitch)selectedEquipList["NA_OPTICALSWITCH"];

                if (pAtt != null && pPowerMeter != null && pPPG != null && pScope != null)
                {
                    isOK = true;
                }
                else
                {
                    if (pAtt == null)
                    {
                        Log.SaveLogToTxt("ATTEN =NULL");
                    }
                    if (pPowerMeter == null)
                    {
                        Log.SaveLogToTxt("pPowerMeter =NULL");
                    }
                    if (pPPG == null)
                    {
                        Log.SaveLogToTxt("pPPG =NULL");
                    }
                    if (pScope == null)
                    {
                        Log.SaveLogToTxt("pScope =NULL");
                    }



                    OutPutandFlushLog();
                    isOK = false;
                }
                if (isOK)
                {
                    selectedEquipList.Add("DUT", dut);
                    return(isOK);
                }
                return(isOK);
            }
        }
Ejemplo n.º 2
0
        public override bool SelectEquipment(EquipmentList aEquipList)
        {
            selectedEquipList.Clear();
            if (aEquipList.Count == 0)
            {
                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("PPG"))
                    {
                        selectedEquipList.Add("PPG", tempValues[i]);
                    }
                    if (tempKeys[i].ToUpper().Contains("ERRORDETE"))
                    {
                        selectedEquipList.Add("ERRORDETE", tempValues[i]);
                    }
                    if (tempKeys[i].ToUpper().Contains("ATTEN_RX"))
                    {
                        selectedEquipList.Add("ATTEN_RX", tempValues[i]);
                    }
                    if (tempKeys[i].ToUpper().Contains("ATTEN_TX"))
                    {
                        selectedEquipList.Add("ATTEN_TX", tempValues[i]);
                    }
                    if (tempKeys[i].ToUpper().Contains("POWERMETER"))
                    {
                        selectedEquipList.Add("POWERMETER", tempValues[i]);
                    }
                    if (tempKeys[i].ToUpper().Contains("POWERSUPPLY"))
                    {
                        selectedEquipList.Add("POWERSUPPLY", tempValues[i]);
                    }
                    if (tempKeys[i].ToUpper().Contains("NA_OPTICALSWITCH"))
                    {
                        tempValues[i].CheckEquipmentRole(2, GlobalParameters.CurrentChannel);
                    }
                }

                tempPPG        = (PPG)selectedEquipList["PPG"];
                tempED         = (ErrorDetector)selectedEquipList["ERRORDETE"];
                tempAttenRX    = (Attennuator)selectedEquipList["ATTEN_RX"];
                tempAttenTX    = (Attennuator)selectedEquipList["ATTEN_TX"];
                tempPowerMeter = (PowerMeter)selectedEquipList["POWERMETER"];
                tempps         = (Powersupply)selectedEquipList["POWERSUPPLY"];
                if (tempPPG != null && tempED != null && tempAttenRX != null && tempAttenTX != null && tempPowerMeter != null && tempps != null)
                {
                    isOK = true;
                }
                else
                {
                    if (tempPPG == null)
                    {
                        Log.SaveLogToTxt("PPG =NULL");
                    }
                    if (tempED == null)
                    {
                        Log.SaveLogToTxt("ERRORDETE =NULL");
                    }
                    if (tempAttenRX == null)
                    {
                        Log.SaveLogToTxt("ATTEN_RX =NULL");
                    }
                    if (tempAttenTX == null)
                    {
                        Log.SaveLogToTxt("ATTEN_TX =NULL");
                    }
                    if (tempPowerMeter == null)
                    {
                        Log.SaveLogToTxt("POWERMETER =NULL");
                    }
                    if (tempps == null)
                    {
                        Log.SaveLogToTxt("POWERSUPPLY =NULL");
                    }
                    isOK = false;
                    OutPutandFlushLog();
                    isOK = false;
                }
                if (isOK)
                {
                    selectedEquipList.Add("DUT", dut);
                }
                else
                {
                    isOK = false;
                }
                return(isOK);
            }
        }