コード例 #1
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);
 }
コード例 #2
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();
     }
 }