forked from selenur/OLD---CNC-controller-version-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditGkode.cs
73 lines (60 loc) · 2.21 KB
/
EditGkode.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
using System;
using System.Windows.Forms;
namespace CNC_App
{
public partial class EditGkode : Form
{
//Доступ к основной форме
private MainForm mf;
public EditGkode(MainForm _mf)
{
if (_mf == null) throw new ArgumentNullException(@"Ошибка инициализации формы 'Корректировка G-кода'");
InitializeComponent();
mf = _mf;
}
private void EditGkode_Load(object sender, EventArgs e)
{
cbCorrection.Checked = mf.Correction;
numPosX.Value = (decimal)mf.deltaX;
numPosY.Value = (decimal)mf.deltaY;
numPosZ.Value = (decimal)mf.deltaZ;
checkBox6.Checked = mf.deltaFeed;
numericUpDown1.Value = (decimal)mf.koeffSizeX;
numericUpDown2.Value = (decimal)mf.koeffSizeY;
groupBox1.Enabled = cbCorrection.Checked;
groupBox2.Enabled = cbCorrection.Checked;
checkBox6.Enabled = cbCorrection.Checked;
}
private void ccbCorrection_CheckedChanged(object sender, EventArgs e)
{
mf.Correction = cbCorrection.Checked;
groupBox1.Enabled = cbCorrection.Checked;
groupBox2.Enabled = cbCorrection.Checked;
checkBox6.Enabled = cbCorrection.Checked;
}
private void numPosX_ValueChanged(object sender, EventArgs e)
{
mf.deltaX = (double)numPosX.Value;
}
private void numPosY_ValueChanged(object sender, EventArgs e)
{
mf.deltaY = (double)numPosY.Value;
}
private void numPosZ_ValueChanged(object sender, EventArgs e)
{
mf.deltaZ = (double)numPosZ.Value;
}
private void checkBox6_CheckedChanged(object sender, EventArgs e)
{
mf.deltaFeed = checkBox6.Checked;
}
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
mf.koeffSizeX = (double)numericUpDown1.Value;
}
private void numericUpDown2_ValueChanged(object sender, EventArgs e)
{
mf.koeffSizeY = (double)numericUpDown2.Value;
}
}
}