forked from ArduPilot/MissionPlanner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJoy_Do_Repeat_Servo.cs
36 lines (28 loc) · 1.08 KB
/
Joy_Do_Repeat_Servo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Windows.Forms;
namespace MissionPlanner.Joystick
{
public partial class Joy_Do_Repeat_Servo : Form
{
public Joy_Do_Repeat_Servo(string name)
{
InitializeComponent();
Utilities.ThemeManager.ApplyThemeTo(this);
this.Tag = name;
var config = MainV2.joystick.getButton(int.Parse(name));
numericUpDown1.Text = config.p1.ToString();
numericUpDown2.Text = config.p2.ToString();
numericUpDown3.Text = config.p3.ToString();
numericUpDown4.Text = config.p4.ToString();
}
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
var config = MainV2.joystick.getButton(int.Parse(this.Tag.ToString()));
config.p1 = (float)numericUpDown1.Value;
config.p2 = (float)numericUpDown2.Value;
config.p3 = (float)numericUpDown3.Value;
config.p4 = (float)numericUpDown4.Value;
MainV2.joystick.setButton(int.Parse(this.Tag.ToString()), config);
}
}
}