public testSelect(pressController cbr_, testParams testParam_) { InitializeComponent(); cbr = cbr_; testParam = testParam_; checkLimitSwitch.Enabled = true; checkLimitSwitch.Start(); }
public debugWindow(pressController cbr_) { InitializeComponent(); cbr = cbr_; calibration_coffTableAdapter1.FillBykNSet(pressDataSet1.calibration_coff, 2); general_settingsTableAdapter1.Fill(pressDataSet1.general_settings); gsetRow = pressDataSet1.general_settings[0]; coffRow = pressDataSet1.calibration_coff[0]; aValue.Text = coffRow["A"].ToString(); bValue.Text = coffRow["B"].ToString(); cValue.Text = coffRow["C"].ToString(); dValue.Text = coffRow["D"].ToString(); comPort.Text = gsetRow["port"].ToString(); //readDevice.Enabled = true; //readDevice.Start(); //setDevice.Enabled = true; //setDevice.Start(); labelUpdater.Enabled = true; labelUpdater.Start(); }
private void mainMenu_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'pressDataSet_.displacement_channels' table. You can move, or remove it, as needed. motor_channelsTableAdapter_.Fill(pressDataSet_.motor_channels); limit_channelsTableAdapter_.Fill(pressDataSet_.limit_channels); direction_channelsTableAdapter_.Fill(pressDataSet_.direction_channels); force_channelsTableAdapter_.Fill(pressDataSet_.force_channels); displacement_channelsTableAdapter_.Fill(pressDataSet_.displacement_channels); general_settingsTableAdapter1.Fill(pressDataSet_.general_settings); testParam.forceChannel = Convert.ToInt32(pressDataSet_.force_channels[0]["inputChannel"]); //cbr.divider = Convert.ToInt32(pressDataSet_.force_channels[0]["avgNumPoints"]); // Console.WriteLine(cbr.divider.ToString()); string port = pressDataSet_.general_settings[0]["port"].ToString(); int baud = Convert.ToInt32(pressDataSet_.general_settings[0]["baudRate"]); testParam.pressType = pressDataSet_.general_settings[0]["machineType"].ToString(); testParam.testDirection = Convert.ToBoolean(pressDataSet_.general_settings[0]["testDirection"]); testParam.dispChannel = Convert.ToInt32(pressDataSet_.displacement_channels[0]["inputChannel"]); testParam.dispCoff[0] = Convert.ToDouble(pressDataSet_.displacement_channels[0]["A"]); testParam.dispCoff[1] = Convert.ToDouble(pressDataSet_.displacement_channels[0]["B"]); testParam.dispCoff[2] = Convert.ToDouble(pressDataSet_.displacement_channels[0]["C"]); testParam.dispCoff[3] = Convert.ToDouble(pressDataSet_.displacement_channels[0]["D"]); testParam.motorChannel[0] = Convert.ToInt32(pressDataSet_.motor_channels[0]["outputChannel"]); testParam.motorChannel[1] = Convert.ToInt32(pressDataSet_.motor_channels[0]["motorIdleSpeed"]); testParam.motorChannel[2] = Convert.ToInt32(pressDataSet_.motor_channels[0]["approachSpeed"]); testParam.motorChannel[3] = Convert.ToInt32(pressDataSet_.motor_channels[0]["manualSpeed"]); testParam.motorChannel[4] = Convert.ToInt32(pressDataSet_.motor_channels[0]["maxRawValue"]); testParam.limitChannel[0] = Convert.ToInt32(pressDataSet_.limit_channels[0]["input_channel"]); testParam.limitChannel[2] = Convert.ToInt32(pressDataSet_.limit_channels[0]["lower_limit"]); testParam.limitChannel[3] = Convert.ToInt32(pressDataSet_.limit_channels[0]["upper_limit"]); testParam.directionChannel0 = Convert.ToInt32(pressDataSet_.direction_channels[0]["outputChannel0"]); testParam.directionChannel1 = Convert.ToInt32(pressDataSet_.direction_channels[0]["outputChannel1"]); testParam.directionUpValues[0] = Convert.ToInt32(pressDataSet_.direction_channels[0]["upChannel0Value"]); testParam.directionUpValues[1] = Convert.ToInt32(pressDataSet_.direction_channels[0]["upChannel1Value"]); testParam.directionDownValues[0] = Convert.ToInt32(pressDataSet_.direction_channels[0]["downChannel0Value"]); testParam.directionDownValues[1] = Convert.ToInt32(pressDataSet_.direction_channels[0]["downChannel1Value"]); testParam.potMin = Convert.ToDouble(pressDataSet_.displacement_channels[0]["minRawValue"]); testParam.potMax = Convert.ToDouble(pressDataSet_.displacement_channels[0]["maxRawValue"]); testParam.potRange = Convert.ToDouble(pressDataSet_.displacement_channels[0]["C"]); testParam.potRangeMin = Convert.ToDouble(pressDataSet_.displacement_channels[0]["A"]); testParam.potRangeMax = Convert.ToDouble(pressDataSet_.displacement_channels[0]["B"]); //Console.WriteLine(testParam.potMin + " " + testParam.potMax + " " + testParam.potRange); try { cbr = new pressController(port, baud); }catch (Exception ex) { SetCommPort sc = new SetCommPort(); sc.ShowDialog(); Environment.Exit(0); } cbr.pressSerialPort.DiscardInBuffer(); cbr.pressSerialPort.DiscardOutBuffer(); cbr.writeReadDevice(); 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; }