Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4e0a0248
由
LN
编写于
2019-11-14 11:40:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
1d5d2575
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
55 行增加
和
59 行删除
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
4e0a024
此文件的差异被折叠,
点击展开。
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
4e0a024
...
@@ -17,6 +17,7 @@ using OnlineStore.DeviceLibrary;
...
@@ -17,6 +17,7 @@ using OnlineStore.DeviceLibrary;
using
System.IO.Ports
;
using
System.IO.Ports
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
CodeLibrary
;
using
CodeLibrary
;
using
UserFromControl
;
namespace
OnlineStore.ACSingleStore
namespace
OnlineStore.ACSingleStore
{
{
...
@@ -193,9 +194,9 @@ namespace OnlineStore.ACSingleStore
...
@@ -193,9 +194,9 @@ namespace OnlineStore.ACSingleStore
// {
// {
// lblServerOn.Text = "伺服ON";
// lblServerOn.Text = "伺服ON";
// int lOutPulse = ACServerManager.GetTargetPosition(portName, SlvAddr);
// int lOutPulse = ACServerManager.GetTargetPosition(portName, SlvAddr);
// lbl
OutPulse
.Text = string.Format("{0:d}", lOutPulse);
// lbl
Actual
.Text = string.Format("{0:d}", lOutPulse);
// int lCountPulse = ACServerManager.GetActualtPosition(portName, SlvAddr);
// int lCountPulse = ACServerManager.GetActualtPosition(portName, SlvAddr);
// lbl
CountPulse
.Text = string.Format("{0:d}", lCountPulse);
// lbl
TargetP
.Text = string.Format("{0:d}", lCountPulse);
// }
// }
// else
// else
// {
// {
...
@@ -326,50 +327,30 @@ namespace OnlineStore.ACSingleStore
...
@@ -326,50 +327,30 @@ namespace OnlineStore.ACSingleStore
{
{
txtServoStatue
.
Text
=
"✘"
;
txtServoStatue
.
Text
=
"✘"
;
}
}
string
deviceName
=
GetPortName
();
ReadA
(
store
.
Config
.
Middle_Axis
,
lblActual1
,
lblTargetP1
,
txtMiddleTarget
,
axis_1_Alarm
);
if
(
ACServerManager
.
ServerOnStatus
(
store
.
Config
.
Middle_Axis
.
DeviceName
,
store
.
Config
.
Middle_Axis
.
GetAxisValue
()))
ReadA
(
store
.
Config
.
UpDown_Axis
,
lblActual2
,
lblTargetP2
,
txtUpdownTarget
,
axis_2_Alarm
);
{
ReadA
(
store
.
Config
.
InOut_Axis
,
lblActual3
,
lblTargetP3
,
txtInoutTarget
,
axis_3_Alarm
);
axis_1_Alarm
.
IOValue
=
ACServerManager
.
GetAlarmStatus
(
store
.
Config
.
Middle_Axis
.
DeviceName
,
store
.
Config
.
Middle_Axis
.
GetAxisValue
());
ReadA
(
store
.
Config
.
Comp_Axis
,
lblActual4
,
lblTargetP4
,
txt4Target
,
axis_4_Alarm
);
axis_1_Alarm
.
ShowData
();
int
lOutPulse1
=
ACServerManager
.
GetTargetPosition
(
store
.
Config
.
Middle_Axis
.
DeviceName
,
store
.
Config
.
Middle_Axis
.
GetAxisValue
());
}
lblOutPulse1
.
Text
=
string
.
Format
(
"{0:d}"
,
lOutPulse1
);
private
void
ReadA
(
ConfigMoveAxis
axis
,
TextBox
lblActual
,
TextBox
lblTarget
,
TextBox
lblT
,
IOStatusControl
sta
)
int
lCountPulse1
=
ACServerManager
.
GetActualtPosition
(
store
.
Config
.
Middle_Axis
.
DeviceName
,
store
.
Config
.
Middle_Axis
.
GetAxisValue
());
{
lblCountPulse1
.
Text
=
string
.
Format
(
"{0:d}"
,
lCountPulse1
);
string
portName
=
GetPortName
();
txtMiddleTarget
.
Text
=
store
.
Config
.
Middle_Axis
.
TargetPosition
.
ToString
();
int
SlvAddr
=
GetSlaveAddr
();
if
(
store
.
Config
.
Middle_Axis
.
IsSameAxis
(
portName
,
SlvAddr
))
if
(
ACServerManager
.
ServerOnStatus
(
axis
.
DeviceName
,
axis
.
GetAxisValue
()))
{
{
lblCountPulse
.
Text
=
lblCountPulse1
.
Text
;
sta
.
IOValue
=
ACServerManager
.
GetAlarmStatus
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
}
int
tP
=
ACServerManager
.
GetTargetPosition
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
}
lblTarget
.
Text
=
string
.
Format
(
"{0:d}"
,
tP
);
if
(
ACServerManager
.
ServerOnStatus
(
store
.
Config
.
UpDown_Axis
.
DeviceName
,
store
.
Config
.
UpDown_Axis
.
GetAxisValue
()))
int
aP
=
ACServerManager
.
GetActualtPosition
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
{
lblActual
.
Text
=
string
.
Format
(
"{0:d}"
,
aP
);
axis_2_Alarm
.
IOValue
=
ACServerManager
.
GetAlarmStatus
(
store
.
Config
.
UpDown_Axis
.
DeviceName
,
store
.
Config
.
UpDown_Axis
.
GetAxisValue
());
lblT
.
Text
=
axis
.
TargetPosition
.
ToString
();
axis_2_Alarm
.
ShowData
();
if
(
axis
.
IsSameAxis
(
portName
,
SlvAddr
))
int
lOutPulse2
=
ACServerManager
.
GetTargetPosition
(
store
.
Config
.
UpDown_Axis
.
DeviceName
,
store
.
Config
.
UpDown_Axis
.
GetAxisValue
());
{
lblOutPulse2
.
Text
=
string
.
Format
(
"{0:d}"
,
lOutPulse2
);
txtP
.
Text
=
lblActual
.
Text
;
int
lCountPulse2
=
ACServerManager
.
GetActualtPosition
(
store
.
Config
.
UpDown_Axis
.
DeviceName
,
store
.
Config
.
UpDown_Axis
.
GetAxisValue
());
lblCountPulse2
.
Text
=
string
.
Format
(
"{0:d}"
,
lCountPulse2
);
txtInoutTarget
.
Text
=
store
.
Config
.
InOut_Axis
.
TargetPosition
.
ToString
();
if
(
store
.
Config
.
UpDown_Axis
.
IsSameAxis
(
portName
,
SlvAddr
))
{
lblCountPulse
.
Text
=
lblCountPulse2
.
Text
;
}
}
if
(
ACServerManager
.
ServerOnStatus
(
store
.
Config
.
InOut_Axis
.
DeviceName
,
store
.
Config
.
InOut_Axis
.
GetAxisValue
()))
{
axis_3_Alarm
.
IOValue
=
ACServerManager
.
GetAlarmStatus
(
store
.
Config
.
InOut_Axis
.
DeviceName
,
store
.
Config
.
InOut_Axis
.
GetAxisValue
());
int
lOutPulse3
=
ACServerManager
.
GetTargetPosition
(
store
.
Config
.
InOut_Axis
.
DeviceName
,
store
.
Config
.
InOut_Axis
.
GetAxisValue
());
lblOutPulse3
.
Text
=
string
.
Format
(
"{0:d}"
,
lOutPulse3
);
int
lCountPulse3
=
ACServerManager
.
GetActualtPosition
(
store
.
Config
.
InOut_Axis
.
DeviceName
,
store
.
Config
.
InOut_Axis
.
GetAxisValue
());
lblCountPulse3
.
Text
=
string
.
Format
(
"{0:d}"
,
lCountPulse3
);
txtUpdownTarget
.
Text
=
store
.
Config
.
UpDown_Axis
.
TargetPosition
.
ToString
();
if
(
store
.
Config
.
InOut_Axis
.
IsSameAxis
(
portName
,
SlvAddr
))
{
lblCountPulse
.
Text
=
lblCountPulse3
.
Text
;
}
}
}
}
}
}
private
void
Bt_ClearCounter_Click
(
object
sender
,
EventArgs
e
)
private
void
Bt_ClearCounter_Click
(
object
sender
,
EventArgs
e
)
{
{
string
portName
=
txtAxisDeviceName
.
Text
;
string
portName
=
txtAxisDeviceName
.
Text
;
...
@@ -495,22 +476,37 @@ namespace OnlineStore.ACSingleStore
...
@@ -495,22 +476,37 @@ namespace OnlineStore.ACSingleStore
{
{
if
(
this
.
cmbAxisList
.
SelectedIndex
>=
0
)
if
(
this
.
cmbAxisList
.
SelectedIndex
>=
0
)
{
{
ConfigMoveAxis
SlvAddr
=
store
.
moveAxisList
[
cmbAxisList
.
SelectedIndex
];
ConfigMoveAxis
axis
=
store
.
moveAxisList
[
cmbAxisList
.
SelectedIndex
];
txtAxisDeviceName
.
Text
=
SlvAddr
.
DeviceName
;
txtAxisDeviceName
.
Text
=
axis
.
DeviceName
;
txtAxisValue
.
Text
=
SlvAddr
.
GetAxisValue
().
ToString
();
txtAxisValue
.
Text
=
axis
.
GetAxisValue
().
ToString
();
txtASpeed
.
Text
=
SlvAddr
.
TargetSpeed
.
ToString
();
txtASpeed
.
Text
=
axis
.
TargetSpeed
.
ToString
();
//if (SlvAddr.Equals(store.Config.InOut_Axis))
Color
color
=
Color
.
Black
;
//{
if
(
store
.
Config
.
Middle_Axis
.
IsSameAxis
(
axis
.
DeviceName
,
axis
.
GetAxisValue
()))
// txtASpeed.Text = store.Config.InOutAxis_P1_Speed.ToString();
{
//}
color
=
Color
.
Red
;
//else if (SlvAddr.Equals(store.Config.Middle_Axis))
}
//{
else
if
(
store
.
Config
.
UpDown_Axis
.
IsSameAxis
(
axis
.
DeviceName
,
axis
.
GetAxisValue
()))
// txtASpeed.Text = store.Config.MiddleAxis_P1_Speed.ToString();
{
//}
color
=
Color
.
Blue
;
//else if (SlvAddr.Equals(store.Config.UpDown_Axis))
}
//{
else
if
(
store
.
Config
.
InOut_Axis
.
IsSameAxis
(
axis
.
DeviceName
,
axis
.
GetAxisValue
()))
// txtASpeed.Text = store.Config.UpDownAxis_P1_Speed.ToString();
{
//}
color
=
Color
.
Green
;
}
else
if
(
store
.
Config
.
Comp_Axis
.
IsSameAxis
(
axis
.
DeviceName
,
axis
.
GetAxisValue
()))
{
color
=
Color
.
Purple
;
}
btnOpenAxis
.
ForeColor
=
color
;
btnCloseAxis
.
ForeColor
=
color
;
btnAxisAMove
.
ForeColor
=
color
;
btnAxisRMove
.
ForeColor
=
color
;
btnAxisVMove
.
ForeColor
=
color
;
btnAxisReturnHome
.
ForeColor
=
color
;
btnAxisStop
.
ForeColor
=
color
;
btnComAlarmClear
.
ForeColor
=
color
;
btnReadPosition
.
ForeColor
=
color
;
btnGetAlarm
.
ForeColor
=
color
;
}
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论