Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSquareStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3e9b197e
由
LN
编写于
2023-04-17 11:09:50 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
bug修改
1 个父辈
e8b2b136
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
96 行增加
和
14 行删除
source/ACSquareStore/FrmStoreBox.Designer.cs
source/ACSquareStore/FrmStoreBox.cs
source/ACSquareStore/useControl/AxisMoveControl.cs
source/ACSquareStore/FrmStoreBox.Designer.cs
查看文件 @
3e9b197
...
@@ -1333,6 +1333,7 @@
...
@@ -1333,6 +1333,7 @@
this
.
dataGridView1
.
RowTemplate
.
Height
=
23
;
this
.
dataGridView1
.
RowTemplate
.
Height
=
23
;
this
.
dataGridView1
.
Size
=
new
System
.
Drawing
.
Size
(
1326
,
170
);
this
.
dataGridView1
.
Size
=
new
System
.
Drawing
.
Size
(
1326
,
170
);
this
.
dataGridView1
.
TabIndex
=
0
;
this
.
dataGridView1
.
TabIndex
=
0
;
this
.
dataGridView1
.
CellClick
+=
new
System
.
Windows
.
Forms
.
DataGridViewCellEventHandler
(
this
.
dataGridView1_CellClick
);
//
//
// tabPage9
// tabPage9
//
//
...
@@ -1340,7 +1341,7 @@
...
@@ -1340,7 +1341,7 @@
this
.
tabPage9
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
29
);
this
.
tabPage9
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
29
);
this
.
tabPage9
.
Name
=
"tabPage9"
;
this
.
tabPage9
.
Name
=
"tabPage9"
;
this
.
tabPage9
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage9
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage9
.
Size
=
new
System
.
Drawing
.
Size
(
1332
,
1
81
);
this
.
tabPage9
.
Size
=
new
System
.
Drawing
.
Size
(
1332
,
1
76
);
this
.
tabPage9
.
TabIndex
=
1
;
this
.
tabPage9
.
TabIndex
=
1
;
this
.
tabPage9
.
Text
=
"右侧"
;
this
.
tabPage9
.
Text
=
"右侧"
;
this
.
tabPage9
.
UseVisualStyleBackColor
=
true
;
this
.
tabPage9
.
UseVisualStyleBackColor
=
true
;
...
@@ -1352,8 +1353,9 @@
...
@@ -1352,8 +1353,9 @@
this
.
dataGridView2
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
dataGridView2
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
dataGridView2
.
Name
=
"dataGridView2"
;
this
.
dataGridView2
.
Name
=
"dataGridView2"
;
this
.
dataGridView2
.
RowTemplate
.
Height
=
23
;
this
.
dataGridView2
.
RowTemplate
.
Height
=
23
;
this
.
dataGridView2
.
Size
=
new
System
.
Drawing
.
Size
(
1326
,
17
5
);
this
.
dataGridView2
.
Size
=
new
System
.
Drawing
.
Size
(
1326
,
17
0
);
this
.
dataGridView2
.
TabIndex
=
1
;
this
.
dataGridView2
.
TabIndex
=
1
;
this
.
dataGridView2
.
CellClick
+=
new
System
.
Windows
.
Forms
.
DataGridViewCellEventHandler
(
this
.
dataGridView2_CellClick
);
//
//
// groupInout
// groupInout
//
//
...
...
source/ACSquareStore/FrmStoreBox.cs
查看文件 @
3e9b197
...
@@ -97,6 +97,11 @@ namespace OnlineStore.ACSquareStore
...
@@ -97,6 +97,11 @@ namespace OnlineStore.ACSquareStore
}
}
foreach
(
var
item
in
store
.
posDebug
.
LPos
)
foreach
(
var
item
in
store
.
posDebug
.
LPos
)
{
{
string
[]
arrays
=
item
.
PosName
.
Split
(
'_'
);
if
(
arrays
.
Length
>=
2
)
{
dataGridView1
.
Columns
[
item
.
Col
-
1
].
HeaderText
=
arrays
[
0
];
}
dataGridView1
.
Rows
[
item
.
Row
-
1
].
Cells
[
item
.
Col
-
1
].
Value
=
item
.
PosName
;
dataGridView1
.
Rows
[
item
.
Row
-
1
].
Cells
[
item
.
Col
-
1
].
Value
=
item
.
PosName
;
dataGridView1
.
Rows
[
item
.
Row
-
1
].
Cells
[
item
.
Col
-
1
].
Tag
=
item
.
PosId
;
dataGridView1
.
Rows
[
item
.
Row
-
1
].
Cells
[
item
.
Col
-
1
].
Tag
=
item
.
PosId
;
dataGridView1
.
Rows
[
item
.
Row
-
1
].
Cells
[
item
.
Col
-
1
].
Style
=
GetStyle
(
item
.
PosId
);
dataGridView1
.
Rows
[
item
.
Row
-
1
].
Cells
[
item
.
Col
-
1
].
Style
=
GetStyle
(
item
.
PosId
);
...
@@ -324,11 +329,11 @@ namespace OnlineStore.ACSquareStore
...
@@ -324,11 +329,11 @@ namespace OnlineStore.ACSquareStore
{
{
msg
=
msg
.
Replace
(
"自动出库:"
,
""
);
msg
=
msg
.
Replace
(
"自动出库:"
,
""
);
msg
=
msg
.
Replace
(
"自动入库:"
,
""
);
msg
=
msg
.
Replace
(
"自动入库:"
,
""
);
int
index
=
store
.
PositionNumList
.
IndexOf
(
msg
);
//
int index = store.PositionNumList.IndexOf(msg);
if
(
index
>=
0
&&
(!
msg
.
Equals
(
""
)))
//
if (index >= 0 && (!msg.Equals("")))
{
//
{
cmbPosition
.
SelectedIndex
=
index
;
//
cmbPosition.SelectedIndex = index;
}
//
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
}
}
}
...
@@ -1419,8 +1424,9 @@ namespace OnlineStore.ACSquareStore
...
@@ -1419,8 +1424,9 @@ namespace OnlineStore.ACSquareStore
txtUpDownP4
.
Text
=
ktkPosition
.
UpDownAxis_IL_P4
.
ToString
();
txtUpDownP4
.
Text
=
ktkPosition
.
UpDownAxis_IL_P4
.
ToString
();
txtUpDownP5
.
Text
=
ktkPosition
.
UpDownAxis_OH_P5
.
ToString
();
txtUpDownP5
.
Text
=
ktkPosition
.
UpDownAxis_OH_P5
.
ToString
();
txtUpDownP6
.
Text
=
ktkPosition
.
UpDownAxis_OL_P6
.
ToString
();
txtUpDownP6
.
Text
=
ktkPosition
.
UpDownAxis_OL_P6
.
ToString
();
txtInOutP4
.
Text
=
ktkPosition
.
InOutAxis_P4
.
ToString
();
txtInOutP4
.
Text
=
ktkPosition
.
InOutAxis_P4
.
ToString
();
}
}
}
}
static
Font
font
=
new
Font
(
"宋体"
,
10
);
static
Font
font
=
new
Font
(
"宋体"
,
10
);
DataGridViewCellStyle
dgv_ok
=
new
DataGridViewCellStyle
()
{
BackColor
=
Color
.
LightGreen
,
Font
=
font
};
DataGridViewCellStyle
dgv_ok
=
new
DataGridViewCellStyle
()
{
BackColor
=
Color
.
LightGreen
,
Font
=
font
};
...
@@ -1441,5 +1447,30 @@ namespace OnlineStore.ACSquareStore
...
@@ -1441,5 +1447,30 @@ namespace OnlineStore.ACSquareStore
return
dgv_none
;
return
dgv_none
;
}
}
#
endregion
#
endregion
private
void
dataGridView1_CellClick
(
object
sender
,
DataGridViewCellEventArgs
e
)
{
if
(
e
.
RowIndex
<
0
||
dataGridView1
.
Rows
[
e
.
RowIndex
].
Cells
[
e
.
ColumnIndex
].
Tag
==
null
)
return
;
string
posid
=
dataGridView1
.
Rows
[
e
.
RowIndex
].
Cells
[
e
.
ColumnIndex
].
Tag
.
ToString
();
int
index
=
store
.
PositionNumList
.
IndexOf
(
posid
);
if
(
index
>=
0
&&
(!
posid
.
Equals
(
""
)))
{
cmbPosition
.
SelectedIndex
=
index
;
}
//SetData(posid);
}
private
void
dataGridView2_CellClick
(
object
sender
,
DataGridViewCellEventArgs
e
)
{
if
(
e
.
RowIndex
<
0
||
dataGridView2
.
Rows
[
e
.
RowIndex
].
Cells
[
e
.
ColumnIndex
].
Tag
==
null
)
return
;
string
posid
=
dataGridView2
.
Rows
[
e
.
RowIndex
].
Cells
[
e
.
ColumnIndex
].
Tag
.
ToString
();
int
index
=
store
.
PositionNumList
.
IndexOf
(
posid
);
if
(
index
>=
0
&&
(!
posid
.
Equals
(
""
)))
{
cmbPosition
.
SelectedIndex
=
index
;
}
}
}
}
}
}
source/ACSquareStore/useControl/AxisMoveControl.cs
查看文件 @
3e9b197
...
@@ -59,9 +59,29 @@ namespace OnlineStore.AssemblyLine
...
@@ -59,9 +59,29 @@ namespace OnlineStore.AssemblyLine
// ACServerManager.ServoOff(PortName, SlvAddr);
// ACServerManager.ServoOff(PortName, SlvAddr);
ACServerManager
.
ServoOff
(
PortName
,
SlvAddr
);
ACServerManager
.
ServoOff
(
PortName
,
SlvAddr
);
}
}
/// <summary>
/// 判断进出轴是否在P1点
/// </summary>
private
bool
InOutIsIsP1
()
{
int
InOutDefaultPosition
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
InOutDefaultPosition
);
int
currValue
=
ACServerManager
.
GetActualtPosition
(
StoreManager
.
Config
.
InOut_Axis
.
DeviceName
,
StoreManager
.
Config
.
InOut_Axis
.
GetAxisValue
());
if
(
currValue
<=
InOutDefaultPosition
)
{
return
true
;
}
MessageBox
.
Show
(
"叉子不在待机位,请先将叉子退回待机位("
+
InOutDefaultPosition
+
")"
,
"警告(叉子在待机位时,才能移动升降轴和前后轴) "
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Exclamation
);
return
false
;
}
private
void
btnAxisAMove_Click
(
object
sender
,
EventArgs
e
)
private
void
btnAxisAMove_Click
(
object
sender
,
EventArgs
e
)
{
{
//判断进出轴是否在待机点
if
(!
StoreManager
.
Config
.
InOut_Axis
.
IsSameAxis
(
PortName
,
SlvAddr
)
&&
(!
InOutIsIsP1
()))
{
return
;
}
int
position
=
FormUtil
.
GetIntValue
(
txtAPosition
);
int
position
=
FormUtil
.
GetIntValue
(
txtAPosition
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【绝对运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
LogUtil
.
info
(
"点击【绝对运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
...
@@ -69,7 +89,13 @@ namespace OnlineStore.AssemblyLine
...
@@ -69,7 +89,13 @@ namespace OnlineStore.AssemblyLine
}
}
private
void
btnAxisRMove_Click
(
object
sender
,
EventArgs
e
)
private
void
btnAxisRMove_Click
(
object
sender
,
EventArgs
e
)
{
{
//判断进出轴是否在待机点
if
(!
StoreManager
.
Config
.
InOut_Axis
.
IsSameAxis
(
PortName
,
SlvAddr
)
&&
(!
InOutIsIsP1
()))
{
return
;
}
int
position
=
FormUtil
.
GetIntValue
(
txtAPosition
);
int
position
=
FormUtil
.
GetIntValue
(
txtAPosition
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【相对运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
LogUtil
.
info
(
"点击【相对运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
...
@@ -78,6 +104,13 @@ namespace OnlineStore.AssemblyLine
...
@@ -78,6 +104,13 @@ namespace OnlineStore.AssemblyLine
private
void
btnAxisVMove_Click
(
object
sender
,
EventArgs
e
)
private
void
btnAxisVMove_Click
(
object
sender
,
EventArgs
e
)
{
{
//判断进出轴是否在待机点
if
(!
StoreManager
.
Config
.
InOut_Axis
.
IsSameAxis
(
PortName
,
SlvAddr
)
&&
(!
InOutIsIsP1
()))
{
return
;
}
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【匀速运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】 速度【"
+
speed
+
"】"
);
LogUtil
.
info
(
"点击【匀速运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】 速度【"
+
speed
+
"】"
);
ACServerManager
.
SpeedMove
(
PortName
,
SlvAddr
,
speed
);
ACServerManager
.
SpeedMove
(
PortName
,
SlvAddr
,
speed
);
...
@@ -108,7 +141,13 @@ namespace OnlineStore.AssemblyLine
...
@@ -108,7 +141,13 @@ namespace OnlineStore.AssemblyLine
}
}
private
void
btnAxisReturnHome_Click
(
object
sender
,
EventArgs
e
)
private
void
btnAxisReturnHome_Click
(
object
sender
,
EventArgs
e
)
{
{
//判断进出轴是否在待机点
if
(!
StoreManager
.
Config
.
InOut_Axis
.
IsSameAxis
(
PortName
,
SlvAddr
)
&&
(!
InOutIsIsP1
()))
{
return
;
}
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【原点返回】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】 速度【"
+
speed
+
"】"
);
LogUtil
.
info
(
"点击【原点返回】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】 速度【"
+
speed
+
"】"
);
ACServerManager
.
HomeMove
(
PortName
,
SlvAddr
,
speed
);
ACServerManager
.
HomeMove
(
PortName
,
SlvAddr
,
speed
);
...
@@ -123,7 +162,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -123,7 +162,7 @@ namespace OnlineStore.AssemblyLine
this
.
txtHomeSingle
.
Text
=
ACServerManager
.
GetHomeSingle
(
PortName
,
SlvAddr
).
ToString
();
this
.
txtHomeSingle
.
Text
=
ACServerManager
.
GetHomeSingle
(
PortName
,
SlvAddr
).
ToString
();
this
.
txtLimit1
.
Text
=
ACServerManager
.
GetLimitPositiveSingle
(
PortName
,
SlvAddr
).
ToString
();
this
.
txtLimit1
.
Text
=
ACServerManager
.
GetLimitPositiveSingle
(
PortName
,
SlvAddr
).
ToString
();
this
.
txtLimit2
.
Text
=
ACServerManager
.
GetLimitNegativeSingle
(
PortName
,
SlvAddr
).
ToString
();
this
.
txtLimit2
.
Text
=
ACServerManager
.
GetLimitNegativeSingle
(
PortName
,
SlvAddr
).
ToString
();
t
xtServoStatue
.
Text
=
ACServerManager
.
ServerOnStatus
(
PortName
,
SlvAddr
)
?
"✔"
:
"✘"
;
t
extBoxON
.
Text
=
ACServerManager
.
ServerOnStatus
(
PortName
,
SlvAddr
)
?
"✔"
:
"✘"
;
}
}
...
@@ -193,6 +232,11 @@ namespace OnlineStore.AssemblyLine
...
@@ -193,6 +232,11 @@ namespace OnlineStore.AssemblyLine
{
{
if
(
btnAddMove
.
BackColor
.
Equals
(
System
.
Drawing
.
SystemColors
.
Control
))
if
(
btnAddMove
.
BackColor
.
Equals
(
System
.
Drawing
.
SystemColors
.
Control
))
{
{
//判断进出轴是否在待机点
if
(!
StoreManager
.
Config
.
InOut_Axis
.
IsSameAxis
(
PortName
,
SlvAddr
)
&&
(!
InOutIsIsP1
()))
{
return
;
}
int
speed
=
FormUtil
.
GetIntValue
(
txtMiddleSpeed
);
int
speed
=
FormUtil
.
GetIntValue
(
txtMiddleSpeed
);
if
(
speed
<=
0
)
if
(
speed
<=
0
)
{
{
...
@@ -207,7 +251,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -207,7 +251,7 @@ namespace OnlineStore.AssemblyLine
private
void
btnAddMove_MouseUp
(
object
sender
,
MouseEventArgs
e
)
private
void
btnAddMove_MouseUp
(
object
sender
,
MouseEventArgs
e
)
{
{
if
(
btnAddMove
.
BackColor
==
Color
.
Green
)
if
(
btnAddMove
.
BackColor
==
Color
.
Green
)
{
{
btnAddMove
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
btnAddMove
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
ACServerManager
.
SuddenStop
(
PortName
,
SlvAddr
);
ACServerManager
.
SuddenStop
(
PortName
,
SlvAddr
);
btnReadPosition_Click
(
null
,
null
);
btnReadPosition_Click
(
null
,
null
);
...
@@ -218,6 +262,11 @@ namespace OnlineStore.AssemblyLine
...
@@ -218,6 +262,11 @@ namespace OnlineStore.AssemblyLine
{
{
if
(
btnDelMove
.
BackColor
.
Equals
(
System
.
Drawing
.
SystemColors
.
Control
))
if
(
btnDelMove
.
BackColor
.
Equals
(
System
.
Drawing
.
SystemColors
.
Control
))
{
{
//判断进出轴是否在待机点
if
(!
StoreManager
.
Config
.
InOut_Axis
.
IsSameAxis
(
PortName
,
SlvAddr
)
&&
(!
InOutIsIsP1
()))
{
return
;
}
int
speed
=
FormUtil
.
GetIntValue
(
txtMiddleSpeed
);
int
speed
=
FormUtil
.
GetIntValue
(
txtMiddleSpeed
);
if
(
speed
<=
0
)
if
(
speed
<=
0
)
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论