-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathConnection.cs
49 lines (42 loc) · 1.22 KB
/
Connection.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
37
38
39
40
41
42
43
44
45
46
47
48
49
using RASDK.Basic;
using System;
namespace MainForm
{
public partial class MainForm
{
/// <summary>
/// 進行連線。
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button_connect_Click(object sender, EventArgs e)
{
MessageHandler.Log("Connect click", LoggingLevel.Trace);
for (var i = 0; i < Devices.Count; i++)
{
Devices[i].Connect();
}
if (Arm.Connected)
{
Arm.Speed = GetUiSpeed();
Arm.Acceleration = GetUiAcceleration();
UpdateNowPosition();
SetButtonsState(true);
}
}
/// <summary>
/// 進行斷線。
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button_disconnect_Click(object sender, EventArgs e)
{
MessageHandler.Log("Disconnect click", LoggingLevel.Trace);
for (var i = 0; i < Devices.Count; i++)
{
Devices[i].Disconnect();
}
SetButtonsState(false);
}
}
}