コード例 #1
0
ファイル: Form1.cs プロジェクト: solomondg/synthesis
 public void BumperPneumaticChosen()
 {
     twoChoices = false;
     grpChooseDriver.Hide();
     tabsMeta.Visible = true;
     tabsMeta.TabPages.Clear();
     tabsMeta.TabPages.Add(metaJointFriction);
     tabsMeta.TabPages.Add(metaPneumatic);
     rbPWM.Hide();
     chkBoxDriveWheel.Hide();
     btnSave.Show();
     grpDriveOptions.Location = new System.Drawing.Point(10, 10);
     tabsMeta.Location        = new System.Drawing.Point(10, 95);
     btnSave.Location         = new System.Drawing.Point(9, 190);
     ClientSize = new System.Drawing.Size(340, 225);
     rbCAN.Hide();
     rbPWM.Hide();
     RelaytxtPort.Hide();
     Solenoid1txtPort.Show();
     Solenoid2txtPort.Show();
     CANtxtPort1.Hide();
     CANtxtPort2.Hide();
     PWM1txtPort.Hide();
     PWM2txtPort.Hide();
     lblPort.Text = "Solenoid Port";
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: solomondg/synthesis
 public void WormScrewChosen()
 {
     twoChoices = false;
     Solenoid1txtPort.Hide();
     Solenoid2txtPort.Hide();
     RelaytxtPort.Hide();
     if (rbPWM.Checked)
     {
         lblPort.Text = "PWM Port";
         CANtxtPort1.Hide();
         CANtxtPort2.Hide();
         PWM1txtPort.Show();
         PWM2txtPort.Hide();
     }
     else
     {
         CANtxtPort1.Show();
         CANtxtPort2.Hide();
         PWM1txtPort.Hide();
         PWM2txtPort.Hide();
         lblPort.Text = "CAN Port";
     }
     grpChooseDriver.Hide();
     tabsMeta.TabPages.Clear();
     tabsMeta.Visible = true;
     tabsMeta.TabPages.Add(metaJointFriction);
     rbPWM.Show();
     rbCAN.Show();
     chkBoxDriveWheel.Hide();
     btnSave.Show();
     grpDriveOptions.Location = new System.Drawing.Point(10, 10);
     tabsMeta.Location        = new System.Drawing.Point(10, 95);
     btnSave.Location         = new System.Drawing.Point(9, 190);
     ClientSize = new System.Drawing.Size(340, 225);
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: solomondg/synthesis
 public void DualMotorChosen()
 {
     twoChoices = true;
     Solenoid1txtPort.Hide();
     Solenoid2txtPort.Hide();
     RelaytxtPort.Hide();
     if (rbPWM.Checked)
     {
         lblPort.Text = "PWM Port";
         CANtxtPort1.Hide();
         CANtxtPort2.Hide();
         PWM1txtPort.Show();
         PWM2txtPort.Show();
     }
     else
     {
         CANtxtPort1.Show();
         CANtxtPort2.Show();
         PWM1txtPort.Hide();
         PWM2txtPort.Hide();
         lblPort.Text = "CAN Port";
     }
     grpChooseDriver.Hide();
     tabsMeta.TabPages.Clear();
     tabsMeta.TabPages.Add(metaJointFriction);
     tabsMeta.TabPages.Add(metaWheel);
     tabsMeta.TabPages.Add(metaGearing);
     chkBoxDriveWheel.Show();
     btnSave.Show();
     rbCAN.Show();
     rbPWM.Show();
     if (joint.Wheel != WheelType.NotAWheel)
     {
         cmbFrictionLevel.Show();
     }
     else
     {
         cmbFrictionLevel.Hide();
     }
     grpDriveOptions.Location = new System.Drawing.Point(10, 10);
     tabsMeta.Location        = new System.Drawing.Point(10, 95);
     btnSave.Location         = new System.Drawing.Point(9, 190);
     ClientSize = new System.Drawing.Size(340, 225);
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: solomondg/synthesis
 public void btnCAN_Click(object sender, EventArgs e)
 {
     lblPort.Text = "CAN Port";
     joint.PWM    = false;
     if (!twoChoices)
     {
         CANtxtPort1.Show();
         CANtxtPort2.Hide();
         PWM1txtPort.Hide();
         PWM2txtPort.Hide();
     }
     else
     {
         CANtxtPort1.Show();
         CANtxtPort2.Show();
         PWM1txtPort.Hide();
         PWM2txtPort.Hide();
     }
 }
コード例 #5
0
ファイル: Form1.cs プロジェクト: solomondg/synthesis
        public void ElevatorChosen()
        {
            twoChoices = false;
            Solenoid1txtPort.Hide();
            Solenoid2txtPort.Hide();
            RelaytxtPort.Hide();
            if (rbPWM.Checked)
            {
                lblPort.Text = "PWM Port";
                CANtxtPort1.Hide();
                CANtxtPort2.Hide();
                PWM1txtPort.Show();
                PWM2txtPort.Hide();
            }
            else
            {
                CANtxtPort1.Show();
                CANtxtPort2.Hide();
                PWM1txtPort.Hide();
                PWM2txtPort.Hide();
                lblPort.Text = "CAN Port";
            }
            lblBrakePort.Enabled = false;
            rbCAN.Show();
            chkBoxDriveWheel.Hide();
            rbPWM.Show();

            brakePortA.Enabled = chkBoxHasBrake.Checked;
            brakePortB.Enabled = chkBoxHasBrake.Checked;
            tabsMeta.TabPages.Clear();
            tabsMeta.Visible = true;
            tabsMeta.TabPages.Add(metaJointFriction);
            chkBoxHasBrake.Show();
            tabsMeta.TabPages.Add(metaElevatorBrake);
            tabsMeta.TabPages.Add(metaElevatorStages);
            tabsMeta.TabPages.Add(metaGearing);
            btnSave.Show();
            grpDriveOptions.Location = new System.Drawing.Point(10, 10);
            tabsMeta.Location        = new System.Drawing.Point(10, 95);
            btnSave.Location         = new System.Drawing.Point(9, 190);
            ClientSize = new System.Drawing.Size(340, 225);
        }
コード例 #6
0
ファイル: Form1.cs プロジェクト: solomondg/synthesis
        public void readFromData(JointData j)
        {
            try {
                joint = j;
                if (j.Wheel == WheelType.Normal)
                {
                    this.cmbWheelType.SelectedIndex = 1;
                    cmbFrictionLevel.Show();
                }
                else if (j.Wheel == WheelType.Omni)
                {
                    this.cmbWheelType.SelectedIndex = 2;
                    cmbFrictionLevel.Show();
                }
                else if (j.Wheel == WheelType.Mecanum)
                {
                    this.cmbWheelType.SelectedIndex = 3;
                    cmbFrictionLevel.Show();
                }
                else
                {
                    this.cmbWheelType.SelectedIndex = 0;
                    cmbFrictionLevel.Hide();
                }

                if (j.Friction == FrictionLevel.Low)
                {
                    this.cmbFrictionLevel.SelectedIndex = 0;
                }
                else if (j.Friction == FrictionLevel.High)
                {
                    this.cmbFrictionLevel.SelectedIndex = 2;
                }
                else
                {
                    this.cmbFrictionLevel.SelectedIndex = 1;
                }
                if (j.Diameter == InternalDiameter.One)
                {
                    this.cmbPneumaticDiameter.SelectedItem = "1 in";
                }
                else if (j.Diameter == InternalDiameter.PointTwoFive)
                {
                    this.cmbPneumaticDiameter.SelectedItem = ".25 in";
                }
                else
                {
                    this.cmbPneumaticDiameter.SelectedItem = ".5 in";
                }

                if (j.Pressure == Pressure.psi10)
                {
                    this.cmbPneumaticPressure.SelectedItem = "10 psi";
                }
                else if (j.Pressure == Pressure.psi20)
                {
                    this.cmbPneumaticPressure.SelectedItem = "20 psi";
                }
                else
                {
                    this.cmbPneumaticPressure.SelectedItem = "60 psi";
                }

                if (j.Stages == Stages.CascadingStageOne)
                {
                    this.cmbStages.SelectedIndex = 1;
                }
                else if (j.Stages == Stages.CascadingStageTwo)
                {
                    this.cmbStages.SelectedIndex = 2;
                }
                else if (j.Stages == Stages.ContinuousStage1)
                {
                    this.cmbStages.SelectedIndex = 3;
                }
                else if (j.Stages == Stages.ContinuousStage2)
                {
                    this.cmbStages.SelectedIndex = 4;
                }
                else
                {
                    this.cmbStages.SelectedIndex = 0;
                }

                this.PWM1txtPort.Value = (decimal)j.PWMport;

                this.PWM2txtPort.Value = (decimal)j.PWMport2;

                this.CANtxtPort1.Value = (decimal)j.CANport;

                this.CANtxtPort2.Value = (decimal)j.CANport2;

                chkBoxDriveWheel.Checked = j.DriveWheel;

                rbPWM.Checked = j.PWM;
                rbCAN.Checked = !j.PWM;
                if (j.PWM)
                {
                    lblPort.Text = "PWM Port";
                    CANtxtPort1.Hide();
                    CANtxtPort2.Hide();
                    PWM1txtPort.Show();
                    PWM2txtPort.Hide();
                }
                else
                {
                    lblPort.Text = "CAN Port";
                    CANtxtPort1.Show();
                    CANtxtPort2.Hide();
                    PWM1txtPort.Hide();
                    PWM2txtPort.Hide();
                }
                txtGearRationNum.Text = j.InputGear.ToString();

                txtGearRationDenom.Text = j.OutputGear.ToString();

                Solenoid1txtPort.Value = (decimal)j.SolenoidPortA;

                Solenoid2txtPort.Value = (decimal)j.SolenoidPortB;

                RelaytxtPort.Value = (decimal)j.RelayPort;

                chkBoxHasBrake.Checked = j.HasBrake;

                brakePortA.Value = (decimal)j.BrakePortA;

                brakePortB.Value = (decimal)j.BrakePortB;

                JointFrictionLevel.Value = (decimal)j.JointFrictionLevel;

                chkBoxHasJointFriction.Checked = j.HasJointFriction;
                if (j.HasJointFriction)
                {
                    JointFrictionLevel.Enabled = true;
                }
                else
                {
                    JointFrictionLevel.Enabled = false;
                }
            }
            catch (Exception e) {
                MessageBox.Show(e.ToString());
            }
        }