FrmNeighboor.cs
1.3 KB
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
using CtuDeviceLib;
using System;
using System.Windows.Forms;
namespace ConveyorLine
{
public partial class FrmNeighboor : Form
{
public FrmNeighboor(int angle)
{
InitializeComponent();
numAngle.Value = angle;
}
public LandmarkNeighboor LandmarkNeighboor
{
get { return landmarkNeighboor; }
set
{
landmarkNeighboor = value;
updateInfo();
}
}
LandmarkNeighboor landmarkNeighboor;
void updateInfo()
{
if (landmarkNeighboor == null) return;
numPointCode.Value = landmarkNeighboor.Id;
numAngle.Value = landmarkNeighboor.Andle;
numDis.Value = landmarkNeighboor.Distance;
}
private void button1_Click(object sender, EventArgs e)
{
if (landmarkNeighboor == null)
landmarkNeighboor = new LandmarkNeighboor();
landmarkNeighboor.Id = (uint)numPointCode.Value;
landmarkNeighboor.Andle = (short)numAngle.Value;
landmarkNeighboor.Distance = (short)numDis.Value;
this.Close();
}
private void button2_Click(object sender, EventArgs e)
{
landmarkNeighboor = null;
this.Close();
}
}
}