protected bool WriteFixedLosValue(DUT dut) { bool isWriteOk = dut.WriteLOSDac(adjustLosStruct.LosAVoltageStartValue); bool isStoreOk = dut.StoreLOSDac(adjustLosStruct.LosAVoltageStartValue); bool isWriteOk1 = dut.WriteLOSDDac(adjustLosStruct.LosAVoltageStartValue); bool isStoreOk1 = dut.StoreLOSDDac(adjustLosStruct.LosAVoltageStartValue); Thread.Sleep(100); targetLosADac = adjustLosStruct.LosAVoltageStartValue; targetLosDDac = adjustLosStruct.LosDVoltageStartValue; return(isWriteOk && isStoreOk && isWriteOk1 && isStoreOk1); }
protected bool OneSectionMethodLosDAdjust(double startValue, byte step, double uperLimit, double lowLimit, DUT dut, out double targetLosDac) { byte adjustCount = 0; bool isLos = false; byte totalExponentiationCount = Convert.ToByte(Math.Floor(Math.Log(Convert.ToDouble(step), 2))); do { if (startValue > uperLimit) { startValue = uperLimit; } else if (startValue < lowLimit) { startValue = lowLimit; } dut.WriteLOSDDac(startValue); dut.StoreLOSDDac(startValue); Thread.Sleep(100); isLos = dut.ChkRxLos(); Thread.Sleep(50); isLos = dut.ChkRxLos(); if ((isLos == true)) { UInt32 tempValue = (UInt32)(startValue - (UInt32)Math.Pow(2, totalExponentiationCount) <= lowLimit ? lowLimit : startValue - (UInt32)Math.Pow(2, totalExponentiationCount)); startValue = (UInt32)tempValue; } if (isLos == true) { adjustCount++; } } while (adjustCount <= 30 && (isLos == true)); targetLosDac = startValue; return(isLos == false); }