示例#1
0
 private void piston_stop()
 {
     cbr.setOutputChannel(testParam.motorChannel[0], 0);
     cbr.setOutputChannel(testParam.directionChannel0, 0);
     cbr.setOutputChannel(testParam.directionChannel1, 0);
 }
示例#2
0
 private void outputChannel0_Scroll(object sender, EventArgs e)
 {
     cbr.setOutputChannel(0, Convert.ToUInt32(outputChannel0.Value));
     pwm0Box.Text = outputChannel0.Value.ToString();
 }
示例#3
0
        private void approachTimer_Tick(object sender, EventArgs e)
        {
            if (testDirection)
            {
                cbr.setOutputChannel(testParam.directionChannel0, Convert.ToUInt32(testParam.directionDownValues[0]));
                cbr.setOutputChannel(testParam.directionChannel1, Convert.ToUInt32(testParam.directionDownValues[1]));
            }
            else
            {
                cbr.setOutputChannel(testParam.directionChannel0, Convert.ToUInt32(testParam.directionUpValues[0]));
                cbr.setOutputChannel(testParam.directionChannel1, Convert.ToUInt32(testParam.directionUpValues[1]));
            }

            if (testParam.pressType == "CBR")
            {
                cbr.setOutputChannel(testParam.motorChannel[0], Convert.ToUInt32(testParam.rushSpeed));
            }
            else
            {
                cbr.setOutputChannel(testParam.motorChannel[0], Convert.ToUInt32(testParam.motorChannel[3])); // Manual Speed
            }

            setReadings();
            if (testParam.pressType == "CBR")
            {
                if (testParam.forceReadings[3] > 0.04)
                {
                    cbr.setOutputChannel(testParam.motorChannel[0], 0);
                }
                else
                {
                }
            }

            if (testParam.forceReadings[3] > testParam.startForce)
            {
                if (testParam.pressType == "CBR")
                {
                    cbr.setOutputChannel(testParam.motorChannel[0], 0);
                    killTimers();
                    killMotor();
                    startTest();
                }
                else
                {
                    killTimers();
                    // OPEN VALVE
                    if (testDirection)
                    {
                        cbr.setOutputChannel(testParam.directionChannel0, Convert.ToUInt32(testParam.directionDownValues[0] > 0 ? 0 : 1));
                        cbr.setOutputChannel(testParam.directionChannel1, Convert.ToUInt32(testParam.directionDownValues[1] > 0 ? 0 : 1));
                    }
                    else
                    {
                        cbr.setOutputChannel(testParam.directionChannel0, Convert.ToUInt32(testParam.directionUpValues[0] > 0 ? 0 : 1));
                        cbr.setOutputChannel(testParam.directionChannel1, Convert.ToUInt32(testParam.directionUpValues[1] > 0 ? 0 : 1));
                    }
                    cbr.setOutputChannel(testParam.motorChannel[0], Convert.ToUInt32(testParam.rushSpeed));
                    this.cubePressOpenValveTimer.Enabled = true;
                    this.cubePressOpenValveTimer.Start();
                }
            }
        }