FrmIO.cs
1.9 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AIOBOX_Debug
{
public partial class FrmIO : Form
{
public FrmIO()
{
InitializeComponent();
}
private void FrmIO_Load(object sender, EventArgs e)
{
numericUpDown1.Value = Asa.Common.inputCount;
numericUpDown2.Value = Asa.Common.outputCount;
numericUpDown3.Value = Asa.Common.inputSleep;
numericUpDown4.Value = Asa.Common.outputSleep;
checkBox1.Checked = Asa.Common.autoUpload;
checkBox2.Checked = Asa.Common.autoRead;
}
private void BtnOK_Click(object sender, EventArgs e)
{
int n;
n = Convert.ToInt32(numericUpDown1.Value);
Asa.Common.box.SetInput(Asa.IOModule.Box_Type.DI, n);
Asa.Common.inputCount = n;
n = Convert.ToInt32(numericUpDown2.Value);
Asa.Common.box.SetOutput(Asa.IOModule.Box_Type.DO, n);
Asa.Common.outputCount = n;
n = Convert.ToInt32(numericUpDown3.Value);
Asa.Common.inputSleep = n;
if (checkBox1.Checked)
Asa.Common.box.AutoReadInput(true);
else
Asa.Common.box.AutoReadInput(true, n);
n = Convert.ToInt32(numericUpDown4.Value);
Asa.Common.box.AutoReadOutput(checkBox2.Checked, n);
Asa.Common.outputSleep = n;
Asa.Common.autoUpload = checkBox1.Checked;
Asa.Common.autoRead = checkBox2.Checked;
DialogResult = DialogResult.OK;
}
private void BtnCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
}
}