-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathManualDriving.cs
88 lines (70 loc) · 2 KB
/
ManualDriving.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ballcuber.Hardware;
using Ballcuber.Modele;
namespace Ballcuber
{
public partial class ManualDriving : UserControl, INavigableForm
{
public ManualDriving()
{
InitializeComponent();
cubeNets.PeriodicUpdate(new RevengeCube.ColorCube());
}
public string FormName
{
get
{
return "Pilotage manuel";
}
}
public Image Image
{
get
{
return Properties.Resources.ManualDriving;
}
}
public int Index
{
get
{
return 102;
}
}
private MotorMove _mvToAdd;
public void PeriodicUpdate(GlobalState formerState, GlobalState currentState)
{
lblMv.Text = _mvToAdd == null ? "..." : _mvToAdd.ToString();
resolutionSessionSupervisionControl.PeriodicUpdate(currentState);
}
private void cubeNets_MoveClick(object sender, MoveClickEventArgs e)
{
if (_mvToAdd == null || _mvToAdd.Axe != e.Axe) _mvToAdd = e.MotorMove;
else _mvToAdd.Add(e.Couronne, e.Sens);
if (_mvToAdd.QuarterNumber == 0) _mvToAdd = null;
}
private void btnAddMv_Click(object sender, EventArgs e)
{
if (_mvToAdd == null) return;
ResolutionSession.Add(_mvToAdd);
}
public void NavigueTo() { }
public void LeaveFrom() { }
private void btnInit_Click(object sender, EventArgs e)
{
ResolutionSession.AddInitBlock();
}
private void btnAlign_Click(object sender, EventArgs e)
{
ResolutionSession.AddAlignment();
}
}
}