private void InsertBvtConditions(Types.BVT.TestParameters profile, long testTypeId, long profileId) { InsertCondition(testTypeId, profileId, "BVT_En", profile.IsEnabled); InsertCondition(testTypeId, profileId, "BVT_Type", profile.TestType); InsertCondition(testTypeId, profileId, "BVT_I", profile.CurrentLimit); InsertCondition(testTypeId, profileId, "BVT_RumpUp", profile.RampUpVoltage); InsertCondition(testTypeId, profileId, "BVT_StartV", profile.StartVoltage); InsertCondition(testTypeId, profileId, "BVT_F", profile.VoltageFrequency); InsertCondition(testTypeId, profileId, "BVT_FD", profile.FrequencyDivisor); InsertCondition(testTypeId, profileId, "BVT_Mode", profile.MeasurementMode); InsertCondition(testTypeId, profileId, "BVT_PlateTime", profile.PlateTime); switch (profile.TestType) { case BVTTestType.Both: InsertCondition(testTypeId, profileId, "BVT_VD", profile.VoltageLimitD); InsertCondition(testTypeId, profileId, "BVT_VR", profile.VoltageLimitR); break; case BVTTestType.Direct: InsertCondition(testTypeId, profileId, "BVT_VD", profile.VoltageLimitD); break; case BVTTestType.Reverse: InsertCondition(testTypeId, profileId, "BVT_VR", profile.VoltageLimitR); break; } }
private void InsertBvtParameters(Types.BVT.TestParameters bvtTestParameters, long testTypeId, long profileId) { if (bvtTestParameters.MeasurementMode == BVTMeasurementMode.ModeV) { InsertParameter(testTypeId, profileId, "VRRM", bvtTestParameters.VRRM, DBNull.Value); if (bvtTestParameters.TestType != BVTTestType.Reverse) { InsertParameter(testTypeId, profileId, "VDRM", bvtTestParameters.VDRM, DBNull.Value); } } else { InsertParameter(testTypeId, profileId, "IRRM", DBNull.Value, bvtTestParameters.IRRM); if (bvtTestParameters.TestType != BVTTestType.Reverse) { InsertParameter(testTypeId, profileId, "IDRM", DBNull.Value, bvtTestParameters.IDRM); } } }
private void FillBvtParameters(Types.BVT.TestParameters parameters, long testTypeId) { var results = new List <Tuple <string, float?, float?> >(); FillParametersResults(testTypeId, results); foreach (var result in results) { switch (result.Item1) { case "VRRM": if (result.Item2.HasValue) { parameters.VRRM = Convert.ToUInt16(result.Item2.Value); } break; case "VDRM": if (result.Item2.HasValue) { parameters.VDRM = Convert.ToUInt16(result.Item2.Value); } break; case "IRRM": if (result.Item3.HasValue) { parameters.IRRM = Convert.ToUInt16(result.Item3.Value); } break; case "IDRM": if (result.Item3.HasValue) { parameters.IDRM = Convert.ToUInt16(result.Item3.Value); } break; } } }
private Types.BVT.TestParameters FillBvtConditions(long testTypeId) { var results = new Dictionary <string, object>(9); var testParams = new Types.BVT.TestParameters() { IsEnabled = true, TestTypeId = testTypeId }; FillOrder(testTypeId, testParams); FillConditionsResults(testTypeId, results); foreach (var result in results) { switch (result.Key) { case "BVT_Type": testParams.TestType = (BVTTestType)(Enum.Parse(typeof(BVTTestType), result.Value.ToString())); break; case "BVT_I": testParams.CurrentLimit = float.Parse(result.Value.ToString()); break; case "BVT_RumpUp": testParams.RampUpVoltage = float.Parse(result.Value.ToString()); break; case "BVT_StartV": testParams.StartVoltage = UInt16.Parse(result.Value.ToString()); break; case "BVT_F": testParams.VoltageFrequency = UInt16.Parse(result.Value.ToString()); break; case "BVT_FD": testParams.FrequencyDivisor = UInt16.Parse(result.Value.ToString()); break; case "BVT_Mode": testParams.MeasurementMode = (BVTMeasurementMode)(Enum.Parse(typeof(BVTMeasurementMode), result.Value.ToString())); break; case "BVT_VR": switch (testParams.TestType) { case BVTTestType.Both: case BVTTestType.Reverse: testParams.VoltageLimitR = UInt16.Parse(result.Value.ToString()); break; } break; case "BVT_VD": switch (testParams.TestType) { case BVTTestType.Both: case BVTTestType.Direct: testParams.VoltageLimitD = UInt16.Parse(result.Value.ToString()); break; } break; case "BVT_PlateTime": testParams.PlateTime = UInt16.Parse(result.Value.ToString()); break; } } return(testParams); }