protected override bool AnalysisInputParameters(TestModeEquipmentParameters[] InformationList) { lock (tempAtten) { Log.SaveLogToTxt("Step1...Check InputParameters"); if (InformationList.Length < inPutParametersNameArray.Count) { Log.SaveLogToTxt("InputParameters are not enough!"); return(false); } else { int index = -1; bool isParametersComplete = true; if (isParametersComplete) { //for (byte i = 0; i < InformationList.Length; i++) { if (Algorithm.FindFileName(InformationList, "RXPOWERARRLIST(DBM)", out index)) { char[] tempCharArray = new char[] { ',' }; ArrayList tempAR = Algorithm.StringtoArraylistDeletePunctuations(InformationList[index].DefaultValue, tempCharArray); if (tempAR == null) { Log.SaveLogToTxt(InformationList[index].FiledName + "is Null!"); return(false); } else { testRxPowerDmiStruct.ArrayListRxInputPower = tempAR; } for (byte j = 0; j < testRxPowerDmiStruct.ArrayListRxInputPower.Count; j++) { double temp = Convert.ToDouble(testRxPowerDmiStruct.ArrayListRxInputPower[j]); if (temp > 0) { temp = -temp; testRxPowerDmiStruct.ArrayListRxInputPower[j] = temp; } } } } } Log.SaveLogToTxt("OK!"); return(true); } } }
protected override bool AnalysisInputParameters(TestModeEquipmentParameters[] InformationList) { Log.SaveLogToTxt("Step1...Check InputParameters"); if (InformationList.Length < inPutParametersNameArray.Count) { Log.SaveLogToTxt("InputParameters are not enough!"); return(false); } else { int index = -1; bool isParametersComplete = true; if (isParametersComplete) { //for (byte i = 0; i < InformationList.Length; i++) { if (Algorithm.FindFileName(InformationList, "VCCARRAYLIST(V)", out index)) { char[] tempCharArray = new char[] { ',' }; ArrayList tempAR = Algorithm.StringtoArraylistDeletePunctuations(InformationList[index].DefaultValue, tempCharArray); if (tempAR == null) { Log.SaveLogToTxt(InformationList[index].FiledName + "is null!"); return(false); } else { calVccDmiStruct.ArrayListVcc = tempAR; } } } } Log.SaveLogToTxt("OK!"); return(true); } }
protected override bool AnalysisInputParameters(TestModeEquipmentParameters[] InformationList) { Log.SaveLogToTxt("Step1...Check InputParameters"); if (GlobalParameters.OpticalSourseERArray == null || GlobalParameters.OpticalSourseERArray == "") { return(false); } else { char[] tempCharArray = new char[] { ',' }; OSERValueArray = Algorithm.StringtoArraylistDeletePunctuations(GlobalParameters.OpticalSourseERArray, tempCharArray); } if (InformationList.Length < inPutParametersNameArray.Count) { Log.SaveLogToTxt("InputParameters are not enough!"); return(false); } else { int index = -1; bool isParametersComplete = true; if (isParametersComplete) { if (Algorithm.FindFileName(InformationList, "LoopTime", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); return(false); } else { testRxOverloadStruct.LoopTime = temp; } } if (Algorithm.FindFileName(InformationList, "AttStep", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); return(false); } else { testRxOverloadStruct.AttStep = temp; } } if (Algorithm.FindFileName(InformationList, "GatingTime", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); return(false); } else { testRxOverloadStruct.GatingTime = temp; } } //if (Algorithm.FindFileName(InformationList, "IsOptSourceUnitOMA", out index)) //{ // string temp = InformationList[index].DefaultValue; // if (temp.Trim().ToUpper() == "0" || temp.Trim().ToUpper() == "FALSE") // { // testRxOverloadStruct.IsOptSourceUnitOMA = false; // } // else // { // testRxOverloadStruct.IsOptSourceUnitOMA = true; // } //} //if (Algorithm.FindFileName(InformationList, "SpecDelta", out index)) //{ // double temp = Convert.ToDouble(InformationList[index].DefaultValue); // if (double.IsInfinity(temp) || double.IsNaN(temp)) // { // Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); // return false; // } // else // { // testRxOverloadStruct.SpecDelta = temp; // } //} if (Algorithm.FindFileName(InformationList, "CsenAlignRxPwr", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); return(false); } else { testRxOverloadStruct.CsenAlignRxPwr = temp; } } } Log.SaveLogToTxt("OK!"); return(true); } }
protected override bool AnalysisInputParameters(TestModeEquipmentParameters[] InformationList) { Log.SaveLogToTxt("Step1...Check InputParameters"); try { if (InformationList.Length < inPutParametersNameArray.Count) { Log.SaveLogToTxt("InputParameters are not enough!"); return(false); } else { int index = -1; bool isParametersComplete = true; if (isParametersComplete) { //for (byte i = 0; i < InformationList.Length; i++) { if (Algorithm.FindFileName(InformationList, "RxInputPower", out index)) { adjustAPDStruct.RxInputPower = Convert.ToDouble(InformationList[index].DefaultValue); } if (Algorithm.FindFileName(InformationList, "SETPOINTS", out index)) { char[] tempCharArray = new char[] { ',' }; ArrayList tempAL = Algorithm.StringtoArraylistDeletePunctuations(InformationList[index].DefaultValue, tempCharArray); if (tempAL == null) { Log.SaveLogToTxt(InformationList[index].FiledName + "is null"); return(false); } else { adjustAPDStruct.SetPoints = new Int32[tempAL.Count]; for (int i = 0; i < tempAL.Count; i++) { adjustAPDStruct.SetPoints[i] = Int32.Parse(tempAL[i].ToString()); } } } if (Algorithm.FindFileName(InformationList, "ScanCount", out index)) { adjustAPDStruct.ScanCount = Convert.ToByte(InformationList[index].DefaultValue); } if (Algorithm.FindFileName(InformationList, "Formula_X_Type", out index)) { adjustAPDStruct.Formula_X_Type = Convert.ToByte(InformationList[index].DefaultValue); } } } Log.SaveLogToTxt("OK!"); return(true); } } catch (InnoExCeption ex)//from driver { //Log.SaveLogToTxt(ex.ID + ": " + ex.Message + "\r\n" + ex.StackTrace); exceptionList.Add(ex); return(false); } catch (Exception error)//from itself { //one way: deal this exception itself InnoExCeption ex = new InnoExCeption(ExceptionDictionary.Code._0x02001, error.StackTrace); //Log.SaveLogToTxt(ex.ID + ": " + ex.Message + "\r\n" + ex.StackTrace); exceptionList.Add(ex); return(false); //the other way is: should throw exception, rather than the above three code. see below: //throw new InnoExCeption(ExceptionDictionary.Code._0x02001, error.StackTrace); } }
protected override bool AnalysisInputParameters(TestModeEquipmentParameters[] InformationList) { lock (tempAtten) { Log.SaveLogToTxt("Step1...Check InputParameters"); if (GlobalParameters.OpticalSourseERArray == null || GlobalParameters.OpticalSourseERArray == "") { return(false); } else { char[] tempCharArray = new char[] { ',' }; OSERValueArray = Algorithm.StringtoArraylistDeletePunctuations(GlobalParameters.OpticalSourseERArray, tempCharArray); } bool isParametersComplete = false; if (InformationList.Length < inPutParametersNameArray.Count) { isParametersComplete = false; Log.SaveLogToTxt("inputData is NotEnough!"); return(false); } else { isParametersComplete = true; } int index = -1; // isParametersComplete = true; if (isParametersComplete) { //for (byte i = 0; i < InformationList.Length; i++) { if (Algorithm.FindFileName(InformationList, "CsenAlignRxPwr", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); return(false); } else { if (temp > 0) { temp = -temp; } testBerStruct.CsenAlignRxPwr = temp; } } if (Algorithm.FindFileName(InformationList, "CsenStartingRxPwr", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); return(false); } else { if (temp > 0) { temp = -temp; } testBerStruct.CsenStartingRxPwr = temp; } } if (Algorithm.FindFileName(InformationList, "FirstPointErrorRateUL", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); return(false); } else { if (temp < 0) { temp = -temp; } testBerStruct.FirstPointErrorRateUL = temp; } } if (Algorithm.FindFileName(InformationList, "FirstPointErrorRateLL", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); return(false); } else { if (temp < 0) { temp = -temp; } testBerStruct.FirstPointErrorRateLL = temp; } } if (Algorithm.FindFileName(InformationList, "FirstPointRxPowerUL", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); return(false); } else { if (temp > 0) { temp = -temp; } testBerStruct.FirstPointRxPowerUL = temp; } } if (Algorithm.FindFileName(InformationList, "FirstPointRxPowerLL", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); return(false); } else { if (temp > 0) { temp = -temp; } testBerStruct.FirstPointRxPowerLL = temp; } } if (Algorithm.FindFileName(InformationList, "CoefCsenSubStep", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); testBerStruct.CoefCsenSubStep = 0.5; } else { if (temp < 0) { temp = -temp; } testBerStruct.CoefCsenSubStep = temp; } } if (Algorithm.FindFileName(InformationList, "CoefCsenAddStep", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); testBerStruct.CoefCsenAddStep = 0.5; } else { if (temp < 0) { temp = -temp; } testBerStruct.CoefCsenAddStep = temp; } } if (Algorithm.FindFileName(InformationList, "IsBerQuickTest", out index)) { string temp = InformationList[index].DefaultValue; if (temp.Trim().ToUpper() == "0" || temp.Trim().ToUpper() == "FALSE") { testBerStruct.IsBerQuickTest = false; } else { testBerStruct.IsBerQuickTest = true; } } if (Algorithm.FindFileName(InformationList, "IsOpticalSourceUnitOMA", out index)) { string temp = InformationList[index].DefaultValue; if (temp.Trim().ToUpper() == "0" || temp.Trim().ToUpper() == "FALSE") { testBerStruct.IsOpticalSourceUnitOMA = false; } else { testBerStruct.IsOpticalSourceUnitOMA = true; } } //SearchTargetBerStep if (Algorithm.FindFileName(InformationList, "FirstPointStep", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); testBerStruct.FirstPointStep = 0.5; } else { if (temp < 0) { testBerStruct.FirstPointStep = 0.5; } testBerStruct.FirstPointStep = temp; } } //testBerStruct.SearchTargetBerMethod if (Algorithm.FindFileName(InformationList, "SearchTargetBerMethod", out index)) { byte temp = Convert.ToByte(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); testBerStruct.SearchTargetBerMethod = 0; } else { testBerStruct.SearchTargetBerMethod = temp; } } //BER_ERP if (Algorithm.FindFileName(InformationList, "BER_ERP", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); testBerStruct.Ber_ERP = 1E-12; } else { testBerStruct.Ber_ERP = temp; } } if (Algorithm.FindFileName(InformationList, "CoefErrorRateUL", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); testBerStruct.CoefErrorRateUL = temp; } else { testBerStruct.CoefErrorRateUL = temp; } } if (Algorithm.FindFileName(InformationList, "CoefErrorRateLL", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); testBerStruct.Ber_ERP = 1E-11; } else { testBerStruct.CoefErrorRateLL = temp; } } } } if (testBerStruct.FirstPointErrorRateUL <= testBerStruct.FirstPointErrorRateLL || testBerStruct.FirstPointRxPowerUL <= testBerStruct.FirstPointRxPowerLL) { Log.SaveLogToTxt("inputData is wrong!"); return(false); } Log.SaveLogToTxt("OK!"); return(true); } }
protected override bool AnalysisInputParameters(TestModeEquipmentParameters[] infoList) { try { ArrayList inParaList = new ArrayList(); inParaList.Clear(); inParaList.Add("BiasDACArray"); inParaList.Add("ModDACArray"); inParaList.Add("AdjustMethod"); Log.SaveLogToTxt("Step1...Check InputParameters"); if (infoList.Length < inParaList.Count) { Log.SaveLogToTxt("InputParameters are not enough!"); return(false); } else { int index = -1; bool isParaCompleted = true; if (isParaCompleted) { if (Algorithm.FindFileName(infoList, "BIASDACARRAY", out index)) { char[] tempCharArray = new char[] { ',' }; ArrayList tempAR = Algorithm.StringtoArraylistDeletePunctuations(infoList[index].DefaultValue, tempCharArray); if (tempAR == null) { Log.SaveLogToTxt(infoList[index].FiledName + "is null!"); return(false); } else if (tempAR.Count > GlobalParameters.TotalChCount) { myStruct.BiasDACs = new ArrayList(); for (int i = 0; i < GlobalParameters.TotalChCount; i++) { myStruct.BiasDACs.Add(tempAR[i]); } } else { myStruct.BiasDACs = tempAR; } } if (Algorithm.FindFileName(infoList, "MODDACARRAY", out index)) { char[] tempCharArray = new char[] { ',' }; ArrayList tempAR = Algorithm.StringtoArraylistDeletePunctuations(infoList[index].DefaultValue, tempCharArray); if (tempAR == null) { Log.SaveLogToTxt(infoList[index].FiledName + "is null!"); return(false); } else if (tempAR.Count > GlobalParameters.TotalChCount) { myStruct.ModDACs = new ArrayList(); for (int i = 0; i < GlobalParameters.TotalChCount; i++) { myStruct.ModDACs.Add(tempAR[i]); } } else { myStruct.ModDACs = tempAR; } } if (Algorithm.FindFileName(infoList, "ADJUSTMETHOD", out index)) { double temp = Convert.ToDouble(infoList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(infoList[index].FiledName + "is wrong!"); return(false); } else { myStruct.MethodID = Convert.ToByte(temp); } } Log.SaveLogToTxt("OK!"); return(true); } } return(true); } catch (InnoExCeption ex)//from driver { //Log.SaveLogToTxt(ex.ID + ": " + ex.Message + "\r\n" + ex.StackTrace); exceptionList.Add(ex); return(false); } catch (Exception error)//from itself { //one way: deal this exception itself InnoExCeption ex = new InnoExCeption(ExceptionDictionary.Code._0x02001, error.StackTrace); //Log.SaveLogToTxt(ex.ID + ": " + ex.Message + "\r\n" + ex.StackTrace); exceptionList.Add(ex); return(false); //the other way is: should throw exception, rather than the above three code. see below: //throw new InnoExCeption(ExceptionDictionary.Code._0x02001, error.StackTrace); } }
protected override bool AnalysisInputParameters(TestModeEquipmentParameters[] InformationList) { lock (tempAtten) { Log.SaveLogToTxt("Step1...Check InputParameters"); if (GlobalParameters.OpticalSourseERArray == null || GlobalParameters.OpticalSourseERArray == "") { return(false); } else { char[] tempCharArray = new char[] { ',' }; OSERValueArray = Algorithm.StringtoArraylistDeletePunctuations(GlobalParameters.OpticalSourseERArray, tempCharArray); } if (InformationList.Length < inPutParametersNameArray.Count) { Log.SaveLogToTxt("InputParameters are not enough!"); return(false); } else { int index = -1; bool isParametersComplete = true; if (isParametersComplete) { //for (byte i = 0; i < InformationList.Length; i++) { if (Algorithm.FindFileName(InformationList, "LOSADTUNESTEP", out index)) { double temp = Convert.ToDouble(InformationList[index].DefaultValue); if (double.IsInfinity(temp) || double.IsNaN(temp)) { Log.SaveLogToTxt(InformationList[index].FiledName + "is wrong!"); testRXLosADStruct.LosADStep = 0.5; } else { if (temp < 0) { temp = -temp; } testRXLosADStruct.LosADStep = temp; } } if (Algorithm.FindFileName(InformationList, "ISLOSDETAIL", out index)) { string temp = InformationList[index].DefaultValue; if (temp.ToUpper().Trim() == "0" || temp.ToUpper().Trim() == "FALSE") { testRXLosADStruct.isLosDetail = false; } else { testRXLosADStruct.isLosDetail = true; } } } } Log.SaveLogToTxt("OK!"); return(true); } } }