public testSelect(pressController cbr_, testParams testParam_) { InitializeComponent(); cbr = cbr_; testParam = testParam_; checkLimitSwitch.Enabled = true; checkLimitSwitch.Start(); }
public testRun(pressController cbr_, testParams testParam_) { InitializeComponent(); cbr = cbr_; testParam = testParam_; testParam.testStopwatch.Reset(); nextSample_save = nextSample = testParam.sampleRate; Console.WriteLine(testParam.rateUnit); GraphPane myPane = testGraph.GraphPane; myPane.IsFontsScaled = false; RollingPointPairList list = new RollingPointPairList(72000); LineItem curve = myPane.AddCurve(testParam.YSeriesTitle, list, Color.Blue, SymbolType.None); Console.WriteLine("SetPointMultiplier:" + testParam.setPointTimeMultiplier + " RateValue:" + testParam.rateValue + " RateType:" + testParam.rateType + " SampleRate:" + testParam.sampleRate + " SampleUnit:" + testParam.sampleUnit); Console.WriteLine("EndCondition0:" + testParam.endCondition0 + " EndConditionValue0:" + testParam.endConditionValue0 + " EndCondition1:" + testParam.endCondition1 + " EndConditionValue1:" + testParam.endConditionValue1 ); if (testParam.xAxisUnit == "seconds") { curve.Label.Text = "Time vs. Load"; } else if (testParam.xAxisUnit == "mm") { curve.Label.Text = "Displacement vs. Load"; } curve.Line.Width = 1.5f; curve.Line.IsSmooth = true; curve.Line.IsAntiAlias = true; curve.Line.SmoothTension = 0.1f; myPane.XAxis.Scale.Min = 0; myPane.YAxis.Scale.Min = 0; myPane.Title.Text = testParam.GraphTitle; if (testParam.xAxisUnit == "mm") { testParam.XAxisTimeWindow = 12; myPane.XAxis.Scale.Max = testParam.XAxisTimeWindow; myPane.XAxis.Scale.MinorStep = testParam.XAxisTimeWindow / 100.0f; myPane.XAxis.Scale.MajorStep = testParam.XAxisTimeWindow / 10.0f; myPane.XAxis.Title.Text = "Displacement (mm)"; } else if (testParam.xAxisUnit == "seconds") { testParam.XAxisTimeWindow = 720; myPane.XAxis.Scale.Max = testParam.XAxisTimeWindow; myPane.XAxis.Scale.MinorStep = testParam.XAxisTimeWindow / 100.0f; myPane.XAxis.Scale.MajorStep = testParam.XAxisTimeWindow / 10.0f; myPane.XAxis.Title.Text = "Time (seconds)"; } if (testParam.yAxisUnit == "force") { float max_ = 250.0f; if (testParam.pressType == "CUBE") { max_ = 2000.0f; } else if (testParam.GraphTitle == "Running Test:UCS") { max_ = 200.0f; } else { max_ = 50.0f; } myPane.YAxis.Scale.Max = max_; myPane.YAxis.Scale.MinorStep = max_ / 100.0f; myPane.YAxis.Scale.MajorStep = max_ / 10.0f; myPane.YAxis.Title.Text = "Load (kN)"; } testGraph.AxisChange(); testParam.forceReadings[0] = 0; testParam.forceReadings[1] = 0; testParam.forceReadings[2] = 0; testParam.forceReadings[3] = 0; testParam.forceReadings[4] = 0; testParam.dispReadings[0] = 0; testParam.dispReadings[1] = 0; testParam.dispReadings[2] = 0; testParam.dispReadings[3] = 0; testParam.dispReadings[4] = 0; testParam.Adjust = 0; setForceZero(); setReadings(); //save_sample(); labelUpdater.Enabled = true; labelUpdater.Start(); checkLimitSwitch.Enabled = true; checkLimitSwitch.Start(); testOverChecker.Enabled = true; testOverChecker.Start(); approachTimer.Enabled = true; approachTimer.Interval = 5; approachTimer.Start(); testOverCounter = 0; }