Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC30-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b16c6142
由
几米阳光
编写于
2018-12-09 11:14:34 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
0fdd68d1
全部展开
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
258 行增加
和
56 行删除
doc/设备IP地址分配.xlsx
source/ACServoDriveTest/FrmACTest.cs
source/ACSingleStore/FrmIOStatus.Designer.cs
source/ACSingleStore/FrmIOStatus.cs
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/KangNaiDe/MasterTcpClient.cs
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/DeviceLibrary/store/IOUtil.cs
source/DeviceLibrary/store/model/StoreMoveInfo.cs
source/LoadCVSLibrary/storeConfig/config/Store_IO_Type.cs
doc/设备IP地址分配.xlsx
查看文件 @
b16c614
此文件类型无法预览
source/ACServoDriveTest/FrmACTest.cs
查看文件 @
b16c614
source/ACSingleStore/FrmIOStatus.Designer.cs
查看文件 @
b16c614
此文件的差异被折叠,
点击展开。
source/ACSingleStore/FrmIOStatus.cs
查看文件 @
b16c614
...
...
@@ -318,5 +318,25 @@ namespace OnlineStore.AutoInOutStore
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
}
private
void
button3_Click
(
object
sender
,
EventArgs
e
)
{
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
}
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
{
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
}
private
void
button5_Click
(
object
sender
,
EventArgs
e
)
{
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
HIGH
);
}
private
void
button4_Click
(
object
sender
,
EventArgs
e
)
{
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
}
}
}
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
b16c614
...
...
@@ -223,6 +223,10 @@
this
.
btnGetOutTray
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblDoorStatus
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnBatchInStore
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
批量上下轴
ONToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
批量上下轴
OFFToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator13
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
toolStripSeparator14
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
groupBox5
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
...
...
@@ -1894,55 +1898,55 @@
// 启动ToolStripMenuItem
//
this
.
启动
ToolStripMenuItem
.
Name
=
"启动ToolStripMenuItem"
;
this
.
启动
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
启动
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
启动
ToolStripMenuItem
.
Text
=
"启动"
;
this
.
启动
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
启动
ToolStripMenuItem_Click
);
//
// toolStripSeparator1
//
this
.
toolStripSeparator1
.
Name
=
"toolStripSeparator1"
;
this
.
toolStripSeparator1
.
Size
=
new
System
.
Drawing
.
Size
(
1
77
,
6
);
this
.
toolStripSeparator1
.
Size
=
new
System
.
Drawing
.
Size
(
1
41
,
6
);
//
// 停止ToolStripMenuItem
//
this
.
停止
ToolStripMenuItem
.
Name
=
"停止ToolStripMenuItem"
;
this
.
停止
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
停止
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
停止
ToolStripMenuItem
.
Text
=
"停止"
;
this
.
停止
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
停止
ToolStripMenuItem_Click
);
//
// toolStripSeparator2
//
this
.
toolStripSeparator2
.
Name
=
"toolStripSeparator2"
;
this
.
toolStripSeparator2
.
Size
=
new
System
.
Drawing
.
Size
(
1
77
,
6
);
this
.
toolStripSeparator2
.
Size
=
new
System
.
Drawing
.
Size
(
1
41
,
6
);
//
// 复位ToolStripMenuItem
//
this
.
复位
ToolStripMenuItem
.
Name
=
"复位ToolStripMenuItem"
;
this
.
复位
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
复位
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
复位
ToolStripMenuItem
.
Text
=
"复位"
;
this
.
复位
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
复位
ToolStripMenuItem_Click
);
//
// toolStripSeparator3
//
this
.
toolStripSeparator3
.
Name
=
"toolStripSeparator3"
;
this
.
toolStripSeparator3
.
Size
=
new
System
.
Drawing
.
Size
(
1
77
,
6
);
this
.
toolStripSeparator3
.
Size
=
new
System
.
Drawing
.
Size
(
1
41
,
6
);
//
// 回待机点ToolStripMenuItem
//
this
.
回待机点
ToolStripMenuItem
.
Name
=
"回待机点ToolStripMenuItem"
;
this
.
回待机点
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
回待机点
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
回待机点
ToolStripMenuItem
.
Text
=
"回待机点"
;
this
.
回待机点
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
回待机点
ToolStripMenuItem_Click
);
//
// toolStripSeparator4
//
this
.
toolStripSeparator4
.
Name
=
"toolStripSeparator4"
;
this
.
toolStripSeparator4
.
Size
=
new
System
.
Drawing
.
Size
(
1
77
,
6
);
this
.
toolStripSeparator4
.
Size
=
new
System
.
Drawing
.
Size
(
1
41
,
6
);
//
// 退出ToolStripMenuItem
//
this
.
退出
ToolStripMenuItem
.
Name
=
"退出ToolStripMenuItem"
;
this
.
退出
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
退出
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
退出
ToolStripMenuItem
.
Text
=
"退出系统"
;
this
.
退出
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
退出
ToolStripMenuItem_Click
);
//
...
...
@@ -1956,8 +1960,12 @@
this
.
料仓运转
OFFToolStripMenuItem
,
this
.
toolStripSeparator7
,
this
.
打开舱门
ToolStripMenuItem
,
this
.
toolStripSeparator14
,
this
.
关闭仓门
ToolStripMenuItem
,
this
.
toolStripSeparator8
,
this
.
关闭仓门
ToolStripMenuItem
});
this
.
批量上下轴
ONToolStripMenuItem
,
this
.
toolStripSeparator13
,
this
.
批量上下轴
OFFToolStripMenuItem
});
this
.
iO
状态查看
ToolStripMenuItem
.
Name
=
"iO状态查看ToolStripMenuItem"
;
this
.
iO
状态查看
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
104
,
25
);
this
.
iO
状态查看
ToolStripMenuItem
.
Text
=
"IO状态查看"
;
...
...
@@ -2528,6 +2536,30 @@
this
.
btnBatchInStore
.
UseVisualStyleBackColor
=
true
;
this
.
btnBatchInStore
.
Click
+=
new
System
.
EventHandler
(
this
.
btnBatchInStore_Click
);
//
// 批量上下轴ONToolStripMenuItem
//
this
.
批量上下轴
ONToolStripMenuItem
.
Name
=
"批量上下轴ONToolStripMenuItem"
;
this
.
批量上下轴
ONToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
192
,
26
);
this
.
批量上下轴
ONToolStripMenuItem
.
Text
=
"批量上下轴ON"
;
this
.
批量上下轴
ONToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
批量上下轴
ONToolStripMenuItem_Click
);
//
// 批量上下轴OFFToolStripMenuItem
//
this
.
批量上下轴
OFFToolStripMenuItem
.
Name
=
"批量上下轴OFFToolStripMenuItem"
;
this
.
批量上下轴
OFFToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
192
,
26
);
this
.
批量上下轴
OFFToolStripMenuItem
.
Text
=
"批量上下轴OFF"
;
this
.
批量上下轴
OFFToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
批量上下轴
OFFToolStripMenuItem_Click
);
//
// toolStripSeparator13
//
this
.
toolStripSeparator13
.
Name
=
"toolStripSeparator13"
;
this
.
toolStripSeparator13
.
Size
=
new
System
.
Drawing
.
Size
(
189
,
6
);
//
// toolStripSeparator14
//
this
.
toolStripSeparator14
.
Name
=
"toolStripSeparator14"
;
this
.
toolStripSeparator14
.
Size
=
new
System
.
Drawing
.
Size
(
189
,
6
);
//
// FrmStoreBox
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
...
...
@@ -2773,6 +2805,10 @@
private
System
.
Windows
.
Forms
.
Button
btnReadLimit1
;
private
System
.
Windows
.
Forms
.
TextBox
txtLimit1
;
public
System
.
Windows
.
Forms
.
Button
btnUpdateStatus
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
批量上下轴
ONToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
批量上下轴
OFFToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator14
;
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator13
;
}
}
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
b16c614
...
...
@@ -1524,5 +1524,32 @@ namespace OnlineStore.AutoInOutStore
btnReadLimit1_Click
(
null
,
null
);
btnReadLimit2_Click
(
null
,
null
);
}
private
void
批量上下轴
ONToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
Thread
.
Sleep
(
1000
);
string
portName
=
store
.
Config
.
Batch_Axis
.
DeviceName
;
int
slvAddr
=
store
.
Config
.
Batch_Axis
.
GetAxisValue
();
ACServerManager
.
OpenPort
(
portName
);
Thread
.
Sleep
(
50
);
ACServerManager
.
InitSlvAddr
(
portName
,
slvAddr
,
store
.
Config
.
Batch_Axis
.
TargetSpeed
,
store
.
Config
.
Batch_Axis
.
AddSpeed
,
store
.
Config
.
Batch_Axis
.
DelSpeed
);
Thread
.
Sleep
(
100
);
ACServerManager
.
AlarmClear
(
portName
,
slvAddr
);
Thread
.
Sleep
(
50
);
ACServerManager
.
ServoOn
(
portName
,
slvAddr
);
}
private
void
批量上下轴
OFFToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
ACServerManager
.
ServoOff
(
store
.
Config
.
Batch_Axis
.
DeviceName
,
store
.
Config
.
Batch_Axis
.
GetAxisValue
());
//关闭串口,等下次重新打开
ACServerManager
.
ColsePort
(
store
.
Config
.
Batch_Axis
.
DeviceName
);
Thread
.
Sleep
(
100
);
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
}
}
}
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
b16c614
...
...
@@ -71,9 +71,6 @@
<Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="store\IOUtil.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ShuoKe\ShuoKeControls.cs" />
<Compile Include="store\model\AxisAlarmInfo.cs" />
...
...
source/DeviceLibrary/KangNaiDe/MasterTcpClient.cs
查看文件 @
b16c614
...
...
@@ -9,6 +9,7 @@ using System.Diagnostics;
using
log4net
;
using
System.Reflection
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
namespace
OnlineStore.DeviceLibrary
{
...
...
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
b16c614
...
...
@@ -42,7 +42,7 @@ DI,左侧门关闭,DoorColse_Single,203,192.168.200.11,0,左侧门关闭,X20,DI-24,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM4,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,1,COM5,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,1,COM6,0,,,,,
AXIS,(轴五)批量上下料轴,Batch_Axis,1,COM
7
,0,,,,,
AXIS,(轴五)批量上下料轴,Batch_Axis,1,COM
3
,0,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,403000,,,,,,,
...
...
@@ -114,7 +114,7 @@ PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
,,,,,,,,,,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM
3
,,,,,,,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM
2
,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
b16c614
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
查看文件 @
b16c614
...
...
@@ -13,13 +13,14 @@ namespace OnlineStore.DeviceLibrary
/// 0=未知。1=门打开,2=门关闭
/// </summary>
public
static
int
DoorStatus
=
2
;
p
ublic
static
int
LastHeight
=
0
;
p
ublic
static
int
LastSize
=
0
;
p
ublic
static
string
LastCode
=
""
;
p
ublic
static
string
LastPosId
=
""
;
p
rivate
static
int
LastHeight
=
0
;
p
rivate
static
int
LastSize
=
0
;
p
rivate
static
string
LastCode
=
""
;
p
rivate
static
string
LastPosId
=
""
;
public
static
int
AxisChangeValue
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
AxisChangeValue
);
public
static
string
WarnMsg
=
""
;
public
static
string
Name
=
"自动上下料"
;
public
static
string
CodeMsg
=
""
;
public
static
string
Name
=
"批量上下料 "
;
public
static
StoreMoveInfo
StoreMove
=
null
;
public
static
StoreRunStatus
AutoBaitingStatus
=
StoreRunStatus
.
Wait
;
...
...
@@ -90,7 +91,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
EndMove
();
ClearInOutInfo
();
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
CylinderMove
(
IO_Type
.
SuckingDisc_Up
,
IO_Type
.
SuckingDisc_Down
,
false
);
CylinderMove
(
IO_Type
.
SuckingDisc_Up
,
IO_Type
.
SuckingDisc_Down
,
false
);
BatchDoorClose
(
false
);
}
public
static
bool
Reset
()
...
...
@@ -98,7 +99,7 @@ namespace OnlineStore.DeviceLibrary
string
msg
=
CanStart
();
if
(!
String
.
IsNullOrEmpty
(
msg
))
{
LogUtil
.
info
(
Name
+
"复位失败:"
+
msg
);
LogUtil
.
info
(
Name
+
"复位失败:"
+
msg
);
return
false
;
}
ClearInOutInfo
();
...
...
@@ -129,7 +130,7 @@ namespace OnlineStore.DeviceLibrary
{
case
StoreMoveStep
.
AUTO_R01_CloseDoor
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_R02_AutoAxisHome
);
LogUtil
.
info
(
Name
+
"复位中:
自动
轴原点返回"
);
LogUtil
.
info
(
Name
+
"复位中:
批量上下料
轴原点返回"
);
ACAxisHomeMove
(
StoreManager
.
Config
.
Batch_Axis
);
break
;
case
StoreMoveStep
.
AUTO_R02_AutoAxisHome
:
...
...
@@ -166,7 +167,7 @@ namespace OnlineStore.DeviceLibrary
public
static
bool
StartInOut
()
{
if
((!
StoreManager
.
Store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
))
||
if
((!
StoreManager
.
Store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
))
||
(!
StoreManager
.
Store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
None
)))
{
LogUtil
.
error
(
Name
+
" 启动入料失败,料仓不在待机状态"
+
StoreManager
.
Store
.
storeRunStatus
+
",MoveType"
+
StoreManager
.
Store
.
StoreMove
.
MoveType
);
...
...
@@ -190,7 +191,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil
.
error
(
Name
+
" 启动入料失败, Status="
+
AutoBaitingStatus
+
",MoveType="
+
StoreMove
.
MoveType
);
LogUtil
.
error
(
Name
+
" 启动入料失败, Status="
+
AutoBaitingStatus
+
",MoveType="
+
StoreMove
.
MoveType
);
return
false
;
}
}
...
...
@@ -253,11 +254,11 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I05_GetPosId
);
//计算高度
EndMovePosition
=
ACServerManager
.
GetActualtPosition
(
StoreManager
.
Config
.
Batch_Axis
.
DeviceName
,
StoreManager
.
Config
.
Batch_Axis
.
GetAxisValue
());
int
h
eight
=
Math
.
Abs
(
EndMovePosition
-
StartMovePosition
)
/
AxisChangeValue
;
int
s
ize
=
GetSize
();
LogUtil
.
info
(
Name
+
"入料: 从服务器获取入库PosId,尺寸:【"
+
size
+
"*"
+
h
eight
+
"】二维码【"
+
LastCode
+
"】"
);
LastHeight
=
height
;
LastSize
=
size
;
LastH
eight
=
Math
.
Abs
(
EndMovePosition
-
StartMovePosition
)
/
AxisChangeValue
;
LastS
ize
=
GetSize
();
LogUtil
.
info
(
Name
+
"入料: 从服务器获取入库PosId,尺寸:【"
+
LastSize
+
"*"
+
LastH
eight
+
"】二维码【"
+
LastCode
+
"】"
);
GetInStorePosId
(
ProcessMsg
())
;
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
StoreMove
.
OneWaitCanEndStep
=
true
;
}
...
...
@@ -266,7 +267,7 @@ namespace OnlineStore.DeviceLibrary
{
//判断是否开始入库
if
(
StoreManager
.
Store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
))
if
(
StoreManager
.
Store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I06_WaitTrayLeave
);
LogUtil
.
info
(
Name
+
"入料: 开始入料,等待料盘拿走"
);
...
...
@@ -322,7 +323,7 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I03_SuckingDisc_Work
);
SuckingDisc_WorkCount
++;
LogUtil
.
info
(
Name
+
"入料: 吸盘开始第"
+
SuckingDisc_WorkCount
+
"次工作"
);
LogUtil
.
info
(
Name
+
"入料: 吸盘开始第"
+
SuckingDisc_WorkCount
+
"次工作"
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
HIGH
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Air
,
IO_VALUE
.
HIGH
));
...
...
@@ -475,7 +476,6 @@ namespace OnlineStore.DeviceLibrary
}
}
public
static
void
BatchDoorClose
(
bool
isWait
)
{
ClearInOutInfo
();
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
b16c614
...
...
@@ -17,7 +17,7 @@ namespace OnlineStore.DeviceLibrary
private
static
void
ACAxisSpeedMove
(
ConfigMoveAxis
moveAxis
,
int
targetSpeed
)
{
AutoAxisIsMove
=
1
;
StartMovePosition
=
ACServerManager
.
GetActualtPosition
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
());
StartMovePosition
=
ACServerManager
.
GetActualtPosition
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
());
EndMovePosition
=
StartMovePosition
;
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAutoAxisStop
(
moveAxis
));
ACServerManager
.
SpeedMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetSpeed
);
...
...
@@ -56,7 +56,7 @@ namespace OnlineStore.DeviceLibrary
//else
//{
msg
=
Name
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],误差过大,需要报警"
;
LogUtil
.
error
(
msg
);
LogUtil
.
error
(
msg
);
return
false
;
//}
}
...
...
@@ -213,7 +213,8 @@ namespace OnlineStore.DeviceLibrary
if
(
wait
.
IsHomeMove
)
{
wait
.
IsEnd
=
ACHomeMoveIsEnd
(
wait
.
AxisInfo
,
out
msg
);
}
else
}
else
{
wait
.
IsEnd
=
ACAxisMoveIsEnd
(
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
}
...
...
@@ -276,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
#
region
Halcon
扫码枪代码
public
bool
IsTestCamera
=
false
;
private
static
string
spiltStr
=
"##"
;
private
static
char
spiltStr
=
'#'
;
public
static
void
GetCameraCode
()
{
Task
.
Factory
.
StartNew
(
delegate
()
...
...
@@ -290,7 +291,7 @@ namespace OnlineStore.DeviceLibrary
}
foreach
(
string
str
in
codeList
)
{
message
=
message
+
spiltStr
+
str
;
message
=
message
+
spiltStr
+
str
;
//message = message + "=1+0x0-" + LastSize + "x" + LastHeight + " =" + str + spiltStr;
}
LastCode
=
message
;
...
...
@@ -315,5 +316,118 @@ namespace OnlineStore.DeviceLibrary
KND
.
IOMove
(
lowType
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
highType
,
IO_VALUE
.
HIGH
);
}
private
static
string
ProcessMsg
()
{
string
msg
=
""
;
string
[]
codeArray
=
LastCode
.
Split
(
spiltStr
);
foreach
(
string
code
in
codeArray
)
{
if
(!
code
.
Equals
(
""
))
{
msg
=
msg
+
"=1+0x0-"
+
LastSize
+
"x"
+
LastHeight
+
" ="
+
code
+
spiltStr
+
spiltStr
;
}
}
return
msg
;
}
private
static
bool
IsNotScanCode
=
false
;
private
static
bool
IsScanCode
=
false
;
/// <summary>
/// 发送二维码到服务器获取PosID
/// </summary>
private
static
void
GetInStorePosId
(
string
message
)
{
try
{
message
=
ScanCodeManager
.
ReplaceCode
(
message
);
if
(
message
.
Equals
(
""
)
||
string
.
IsNullOrEmpty
(
message
))
{
IsNotScanCode
=
true
;
IsScanCode
=
false
;
CodeMsg
=
"没有收到二维码信息,请重新放入料盘"
;
LogUtil
.
info
(
Name
+
"没有收到二维码信息,请重新放入料盘"
);
return
;
}
IsNotScanCode
=
false
;
if
(
StoreManager
.
Store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
LogUtil
.
info
(
Name
+
"收到二维码【 "
+
message
+
"】,设备未启动,不需要发送服务器"
);
IsScanCode
=
false
;
return
;
}
// CodeMsg = "收到二维码【 " + message + "】,发送给服务器获取入库PosID";
LogUtil
.
info
(
Name
+
"收到二维码【 "
+
message
+
"】,发送给服务器获取入库PosID"
);
//发送扫码内容到服务器进行入库操作
Operation
operation
=
StoreManager
.
Store
.
getLineBoxStatus
();
operation
.
op
=
1
;
operation
.
data
=
new
Dictionary
<
string
,
string
>()
{
{
"code"
,
message
},
{
"boxId"
,
StoreManager
.
Store
.
StoreID
.
ToString
()
}
};
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
operation
,
false
);
if
(
resultOperation
==
null
)
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil
.
info
(
Name
+
"二维码【"
+
message
+
"】没有收到服务器反馈!"
);
IsScanCode
=
false
;
return
;
}
else
if
(!
string
.
IsNullOrEmpty
(
resultOperation
.
msg
))
{
//如果有提示消息,直接显示提示
LogUtil
.
info
(
Name
+
"服务器反馈 二维码【"
+
message
+
"】 :"
+
resultOperation
.
msg
);
IsScanCode
=
false
;
return
;
}
IsScanCode
=
false
;
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
if
(
data
!=
null
&&
data
.
ContainsKey
(
ParamDefine
.
posId
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateH
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateW
))
{
//服务器返回时有:posId库位编号,plateW:料盘宽度,plateH:料盘高度,
//postId格式BoxId#位置
string
posId
=
data
[
ParamDefine
.
posId
];
string
plateW
=
data
[
ParamDefine
.
plateW
];
string
plateH
=
data
[
ParamDefine
.
plateH
];
string
[]
posArray
=
posId
.
Split
(
'#'
);
if
(!(
posArray
.
Length
==
2
))
{
WarnMsg
=
Name
+
"入库库位格式错误:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
;
LogUtil
.
error
(
"服务器反馈 入库库位格式错误:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
LogUtil
.
info
(
"服务器反馈 入库库位格式错误:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
return
;
}
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
//根据发送的posId获取位置列表
AutoStorePosition
position
=
CSVPositionReader
<
AutoStorePosition
>.
GetPositon
(
posId
);
if
(
position
==
null
)
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg
=
"入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】 "
;
LogUtil
.
error
(
"收到服务器入库命令:入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
return
;
}
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if
(
StoreManager
.
Store
.
CanStarInOut
())
{
LastPosId
=
posId
;
IsScanCode
=
false
;
InOutStoreParam
param
=
new
InOutStoreParam
(
message
,
posId
,
plateH
,
plateW
,
0
);
StoreManager
.
Store
.
StartInStoreMove
(
param
,
true
);
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil
.
info
(
Name
+
" 收到服务器入库命令:库位号【"
+
posId
+
"】二维码【"
+
message
+
"】 开始入库!"
);
}
else
{
LogUtil
.
info
(
Name
+
" 收到服务器入库命令:库位号【"
+
posId
+
"】二维码【"
+
message
+
"】 正在忙碌中,无法入库!"
);
IsScanCode
=
false
;
}
}
}
catch
(
Exception
ex
)
{
IsScanCode
=
false
;
LogUtil
.
error
(
Name
+
ex
.
StackTrace
);
}
}
}
}
source/DeviceLibrary/store/IOUtil.cs
查看文件 @
b16c614
...
...
@@ -17,8 +17,6 @@ namespace OnlineStore.DeviceLibrary
/// 高位
/// </summary>
HIGH
=
1
,
}
}
source/DeviceLibrary/store/model/StoreMoveInfo.cs
查看文件 @
b16c614
...
...
@@ -130,19 +130,6 @@ namespace OnlineStore.DeviceLibrary
WaitList
=
new
List
<
WaitResultInfo
>();
CanWhileCount
=
0
;
}
//public StoreMoveInfo clone()
//{
// return (StoreMoveInfo)this.MemberwiseClone();
//}
///// <summary>
///// 重置之后继续出入库时,退回上一个步骤执行
///// </summary>
//public void BackStep()
//{
// moveStep = PreMoveStep;
// IsInWait = false;
//}
}
public
class
WaitResultInfo
...
...
@@ -227,6 +214,12 @@ namespace OnlineStore.DeviceLibrary
wait
.
IsEnd
=
false
;
return
wait
;
}
/// <summary>
/// 6=等待轴原点信号亮
/// </summary>
/// <param name="axis"></param>
/// <param name="value"></param>
/// <returns></returns>
public
static
WaitResultInfo
WaitAxisOrg
(
ConfigMoveAxis
axis
,
IO_VALUE
value
)
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
...
...
@@ -248,7 +241,7 @@ namespace OnlineStore.DeviceLibrary
// return wait;
//}
/// <summary>
/// 等待轴的反限位为指定值
///
8=
等待轴的反限位为指定值
/// </summary>
public
static
WaitResultInfo
WaitAxistNegativeLimit
(
ConfigMoveAxis
moveAxis
,
IO_VALUE
ioValue
)
{
...
...
@@ -262,7 +255,7 @@ namespace OnlineStore.DeviceLibrary
return
wait
;
}
/// <summary>
/// 等待轴的正限位为指定值
///
9=
等待轴的正限位为指定值
/// </summary>
public
static
WaitResultInfo
WaitAxistPositiveLimit
(
ConfigMoveAxis
moveAxis
,
IO_VALUE
ioValue
)
{
...
...
@@ -278,7 +271,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 等待上料轴运动 停止
///
10=
等待上料轴运动 停止
/// </summary>
/// <returns></returns>
public
static
WaitResultInfo
WaitAutoAxisStop
(
ConfigMoveAxis
moveAxis
)
...
...
@@ -291,6 +284,10 @@ namespace OnlineStore.DeviceLibrary
wait
.
IsEnd
=
false
;
return
wait
;
}
/// <summary>
/// 11=扫码OK
/// </summary>
/// <returns></returns>
public
static
WaitResultInfo
WaitCodeOK
()
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
...
...
source/LoadCVSLibrary/storeConfig/config/Store_IO_Type.cs
查看文件 @
b16c614
...
...
@@ -7,6 +7,18 @@ using System.Text;
namespace
OnlineStore.LoadCSVLibrary
{
public
enum
IO_VALUE
{
/// <summary>
/// 低位
/// </summary>
LOW
=
0
,
/// <summary>
/// 高位
/// </summary>
HIGH
=
1
,
}
public
class
IO_Type
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论