FrmAxisDebug.cs
3.2 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
using DeviceLib;
using log4net;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Reflection;
namespace OnlineStore.TinPasteStore
{
public partial class FrmAxisDebug : FrmBase
{
private VerticalStoreBean store = null;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmAxisDebug(VerticalStoreBean boxBean)
{
InitializeComponent();
store = boxBean;
this.Text = boxBean.Name + "_轴点动调试";
}
private void AxisMove(ConfigMoveAxis axis, int speed)
{
LogUtil.debug(LOGGER, "点动:deviceName=" + axis.DeviceName + ",axis=" + axis.GetAxisValue() + ",speed=" + speed);
ACServerManager.SpeedMove(axis.DeviceName, axis.GetAxisValue(), speed);
}
private void FrmAxisDebug_Load(object sender, EventArgs e)
{
axisPointControl1.SetParam("(轴一)取料旋转轴", "旋转轴+(顺时针)", "旋转轴-(逆时针)", store.Config.Middle_Axis);
axisPointControl2.SetParam("(轴二)取料上下轴", "上下轴+(上升)", "上下轴-(下降)", store.Config.UpDown_Axis);
axisPointControl3.SetParam("(轴三)取料进出轴", "进出轴+(前进)", "进出轴-(后退)", store.Config.InOut_Axis);
axisPointControl4.SetParam("(轴四)回温区旋转轴", "回温区轴+(顺时针)", "回温区轴-(逆时针)", store.Config.Warming_Axis);
axisPointControl5.SetParam("(轴五)冷藏区旋转轴", "冷藏区轴+(顺时针)", "冷藏区轴-(逆时针)", store.Config.Colding_Axis);
axisPointControl6.SetParam("(轴六)搅拌区旋转轴", "搅拌区轴+(顺时针)", "搅拌区轴-(逆时针)", store.Config.Stir_Axis);
if (StoreManager.Store.StirAxisCanMove())
{
axisPointControl6.Enabled = true;
}
else
{
axisPointControl6.Enabled = false;
}
timer1.Start();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void FrmAxisDebug_Shown(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
if (this.Visible)
{
axisPointControl1.UpdatePosition();
axisPointControl2.UpdatePosition();
axisPointControl3.UpdatePosition();
axisPointControl4.UpdatePosition();
axisPointControl5.UpdatePosition();
axisPointControl6.UpdatePosition();
}
}
private void trackBar1_ValueChanged(object sender, EventArgs e)
{
int value = trackBar1.Value;
lblSpeed.Text = "点动速度=" + (value / 10f) + "倍目标速度";
axisPointControl1.SpeedValue = value;
axisPointControl2.SpeedValue = value;
axisPointControl3.SpeedValue = value;
axisPointControl4.SpeedValue = value;
axisPointControl5.SpeedValue = value;
axisPointControl6.SpeedValue = value;
}
}
}