public override void RunTest() { Quasi97.ResultNet Rslt = default(Quasi97.ResultNet); System.Diagnostics.Stopwatch sWatch = new System.Diagnostics.Stopwatch(); float[,,] pdBuffer = null; double[] fieldbuf = new double[mvarDataPoints - 1 + 1]; short Chan = modMain.QST.QSTHardware.MRChannel; double[] vBuff = null; try { sWatch.Restart(); if (modMain.QST.OptionsParameters.AutoClearResults) { ClearResults(false); //the menu is going to refresh anyway when we add new results } Rslt = new Quasi97.ResultNet(); colResults.Insert(0, Rslt); Rslt.Data.Columns.Clear(); Rslt.Data.Columns.Add("Sample #", typeof(short)); Rslt.Data.Columns.Add("Resistance (Ohm)", typeof(Single)); Rslt.Data.Columns.Add("Random", typeof(Single)); //measuring //set 156KHz sampling rate modMain.QST.PatGenBoardParameters.DelayCounter = (byte) 0; modMain.QST.PatGenBoardParameters.SampleCounter = (byte) 0; //set dc level modMain.QST.QSTHardware.GenerateLevel(ref fieldbuf, mvarDataPoints, 0, (short) 0); //select low gain modMain.QST.QSTHardware.TCSplitSelectInput(false); pdBuffer = new float[2, (fieldbuf.Length - 1) + 1, 2]; //number of cycles, number of data points, 2 channels modMain.QST.QSTHardware.TCSplitCaptureWaveform(ref pdBuffer, (short) 1, (short) 1); modMain.QST.QSTHardware.TCSplitScaleWaveform2(ref pdBuffer, 0,false); modMain.QST.QSTHardware.ExtractPulseByChannel(ref vBuff, (short) 0, ref pdBuffer, modMain.QST.QSTHardware.MRChannel); //storing in the data for (var i = 0; i <= (vBuff.Length - 1); i++) { Rslt.Data.Rows.Add(1 + i, vBuff[(int) i], 100 * VBMath.Rnd(1)); } base.RaiseNewDataAvailable(colResults.Count, 1, -1, -1); base.RaiseNewDataAvailable(colResults.Count, 2, -1, -1); //report results Rslt.AddParameters(this.colParameters); Rslt.AddResult2("Resistance (Ohm)", 0, 1, true); //let next statement calculate statistics Rslt.CalcStats2(true, 1); //grade results Quasi97.clsQSTTestNET temp_test = this; modMain.QST.GradingParameters.GradeTestNet(ref temp_test, (short) 0); //add information about run Quasi97.clsQSTTestNET temp_test2 = this; Rslt.AddInfo(ref temp_test2, sWatch.ElapsedMilliseconds, ref modMain.QST.QuasiParameters.CurInfo); //notify the form that new results are available base.RaiseNewInfoAvailable(); base.RaiseNewResultsAvailable(new int[] {0}); } catch (Exception ex) { MessageBox.Show(ThisTestID + " RunTest " + ex.Message); } }
public override void RunTest() { Quasi97.ResultNet Rslt = default(Quasi97.ResultNet); double MeasuredVal = 0; float ib = 0; Quasi97.TestShell ts = default(Quasi97.TestShell); try { //measuring MeasuredVal = modMain.QST.ChannelManager.DCChannel.MeasureR(modMain.QST.QSTHardware.MRChannel, (short) 10); ib = modMain.QST.QSTHardware.GetReadBias(modMain.QST.QSTHardware.MRChannel); //report results Rslt = new Quasi97.ResultNet(); colResults.Insert(0, Rslt); //example of scanning test collection var tKey = ""; foreach (var t in modMain.QST.QuasiParameters.TestListLegacy) { if (t.Value.TestID == "Transverse") { tKey = t.Key; } } if (tKey != "") { ts = modMain.QST.QuasiParameters.TestListLegacy[tKey]; } //getting result from another test string temp_TestID = "Transverse"; short temp_Setup = 1; ts = modMain.QST.QuasiParameters.TestObj(ref temp_TestID, ref temp_Setup); Quasi97.clsQSTTestNET tnet = (Quasi97.clsQSTTestNET) ts.TestPtr; if (tnet.colResults.Count == 0) { ts.RunTest(); } Quasi97.clsQSTTestNET tobj = (Quasi97.clsQSTTestNET)ts.TestPtr; MeasuredVal = System.Convert.ToSingle(tobj.colResults[0].GetResult("Resistance (Ohm)")); ib = System.Convert.ToSingle(tobj.colResults[0].GetResult("Bias Current (mA)")); //adding results short temp_cycle = 1; Rslt.AddResult(objNativeRes.res, MeasuredVal.ToString("F2"), ref temp_cycle, false); Rslt.AddResult(objNativeRes.bv, (ib * MeasuredVal).ToString("F2"), ref temp_cycle, false); int startcol=1; Rslt.CalcStats("RESULT", ref startcol); //grade results Quasi97.clsQSTTestNET temp_test = this; modMain.QST.GradingParameters.GradeTestNet(ref temp_test, (short) 0); //add information about run Quasi97.clsQSTTestNET temp_test2 = this; Rslt.AddInfo(ref temp_test2, 0, ref modMain.QST.QuasiParameters.CurInfo); //notify the form that new results are available base.RaiseNewInfoAvailable(); base.RaiseNewResultsAvailable(new int[] {0}); } catch (Exception ex) { MessageBox.Show("clsTest2:RunTest " + ex.Message); } }
public override void RunTest() { Quasi97.ResultNet Rslt = default(Quasi97.ResultNet); double MeasuredVal = 0; float ib = 0; try { string temp_TestID = TestID; modMain.QST.Normalization.InitTest(ref temp_TestID, ref Setup); string temp_TestID2 = TestID; string temp_paramName = ""; object temp_OriginalValue = 0; modMain.QST.Normalization.GetAdaptParam(ref temp_TestID2, ref Setup, ref temp_paramName, ref temp_OriginalValue); //measuring MeasuredVal = modMain.QST.ChannelManager.DCChannel.MeasureR(modMain.QST.QSTHardware.MRChannel, (short) 10,0); ib = modMain.QST.QSTHardware.GetReadBias(modMain.QST.QSTHardware.MRChannel); //report results Rslt = new Quasi97.ResultNet(); Rslt.AddParameters(this.colParameters); colResults.Insert(0, Rslt); short temp_cycle = 1; Rslt.AddResult("Resistance (Ohm)", MeasuredVal.ToString("F2"), ref temp_cycle, false); Rslt.AddResult(objNativeRes.bv, (ib * MeasuredVal).ToString("F2"), ref temp_cycle, false); int strtcol = 1; Rslt.CalcStats("RESULT", ref strtcol); string temp_TestID3 = TestID; string temp_paramName2 = ""; modMain.QST.Normalization.AddResultforRecordNET(ref temp_TestID3, ref Setup, ref temp_paramName2, ref Rslt); //get all parameters, because we are not sweeping anything //grade results Quasi97.clsQSTTestNET temp_test = this; modMain.QST.GradingParameters.GradeTestNet(ref temp_test, (short) 0); //add information about run Quasi97.clsQSTTestNET temp_test2 = this; Rslt.AddInfo(ref temp_test2, 0, ref modMain.QST.QuasiParameters.CurInfo); //notify the form that new results are available base.RaiseNewInfoAvailable(); base.RaiseNewResultsAvailable(new int[] {0}); } catch (Exception ex) { MessageBox.Show("clsTest1:RunTest " + ex.Message); } }
public override void RunTest() { Quasi97.ResultNet Rslt = default(Quasi97.ResultNet); double MeasuredVal = 0; float ib = 0; try { if (modMain.QST.OptionsParameters.AutoClearResults) { ClearResults(false); //the menu is going to refresh anyway when we add new results } //measuring for (var i = 1; i <= mvarAverages; i++) { MeasuredVal += modMain.QST.ChannelManager.DCChannel.MeasureR(modMain.QST.QSTHardware.MRChannel, (short) 10, 0); ib += modMain.QST.QSTHardware.GetReadBias(modMain.QST.QSTHardware.MRChannel); } ib /= mvarAverages; MeasuredVal /= mvarAverages; //report results Rslt = new Quasi97.ResultNet(); Rslt.AddParameters(this.colParameters); colResults.Insert(0, Rslt); Rslt.AddResult2(objNativeRes.res, MeasuredVal.ToString("F2"), 1, true); Rslt.AddResult2(objNativeRes.bv, (ib * MeasuredVal).ToString("F2"), 1, true); Rslt.CalcStats2(false, 1); //grade results Quasi97.clsQSTTestNET temp_test = this; modMain.QST.GradingParameters.GradeTestNet(ref temp_test, (short) 0); //add information about run Quasi97.clsQSTTestNET temp_test2 = this; Rslt.AddInfo(ref temp_test2, 0, ref modMain.QST.QuasiParameters.CurInfo); //notify the form that new results are available base.RaiseNewInfoAvailable(); base.RaiseNewResultsAvailable(new int[] {0}); } catch (Exception ex) { MessageBox.Show("clsTest1:RunTest " + ex.Message); } }