Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-ACPackingStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d4450cba
由
LN
编写于
2019-11-07 15:53:56 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加料架位置配置
1 个父辈
c4b93ce1
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
199 行增加
和
514 行删除
source/ACPackingStore/App.config
source/ACPackingStore/FrmStore.cs
source/Common/Setting_Init.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
source/DeviceLibrary/ACPackingStore/StoreManager.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/StoreConfig/shelfPosition.csv
source/DeviceLibrary/store/StoreStep.cs
source/LoadCVSLibrary/LoadCSVLibrary.csproj
source/LoadCVSLibrary/position/ACBoxPosition.cs
source/LoadCVSLibrary/position/CSVPositionReader.cs
source/LoadCVSLibrary/position/StorePostionBase.cs → source/LoadCVSLibrary/position/PostionBase.cs
source/LoadCVSLibrary/position/ShelfPosition.cs
source/ACPackingStore/App.config
查看文件 @
d4450cb
...
...
@@ -17,6 +17,7 @@
<
add
key
=
"store_count"
value
=
"2"
/>
<
add
key
=
"Store_ConfigPath"
value
=
"\StoreConfig\StoreConfig.csv"
/>
<!--
start
one
store
config
-->
<
add
key
=
"Shelf_Position_Config"
value
=
"\StoreConfig\shelfPosition.csv"
/>
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\linePositions.csv"
/>
<
add
key
=
"BOX_ConfigPath"
value
=
"\StoreConfig\BoxConfig.csv"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_PA"
/>
...
...
source/ACPackingStore/FrmStore.cs
查看文件 @
d4450cb
...
...
@@ -41,6 +41,7 @@ namespace OnlineStore.ACPackingStore
if
(
store
==
null
)
{
this
.
Close
();
return
;
}
else
{
...
...
source/Common/Setting_Init.cs
查看文件 @
d4450cb
...
...
@@ -87,5 +87,6 @@ namespace OnlineStore.Common
public
static
string
Store_ConfigPath
=
"Store_ConfigPath"
;
public
static
string
UseBuzzer
=
"UseBuzzer"
;
public
static
string
Shelf_Position_Config
=
"Shelf_Position_Config"
;
}
}
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean.cs
查看文件 @
d4450cb
...
...
@@ -17,9 +17,7 @@ namespace OnlineStore.DeviceLibrary
public
partial
class
AC_BOX_Bean
:
KTK_Store
{
private
static
bool
IsIntSlvBlock
=
false
;
/// <summary>
/// 开始运行
/// </summary>
public
static
bool
IsRun
=
false
;
public
string
CID
=
""
;
public
AC_BOX_Config
Config
;
...
...
@@ -36,8 +34,13 @@ namespace OnlineStore.DeviceLibrary
/// 轴报警信息
/// </summary>
private
Dictionary
<
string
,
AxisAlarmInfo
>
AxisAlarmCodeMap
=
new
Dictionary
<
string
,
AxisAlarmInfo
>();
/// <summary>
/// 料仓内所有的位置列表
/// </summary>
public
List
<
string
>
PositionNumList
=
new
List
<
string
>();
public
List
<
string
>
ShelfPosList
=
new
List
<
string
>();
private
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
public
AC_BOX_Bean
(
AC_BOX_Config
config
)
...
...
@@ -73,6 +76,15 @@ namespace OnlineStore.DeviceLibrary
PositionNumList
.
Add
(
position
.
PositionNum
);
}
}
List
<
ShelfPosition
>
sPlist
=
CSVPositionReader
<
ShelfPosition
>.
getPositionList
();
ShelfPosList
=
new
List
<
string
>();
foreach
(
ShelfPosition
p
in
sPlist
)
{
if
(
p
.
StoreId
.
Equals
(
DeviceID
))
{
ShelfPosList
.
Add
(
p
.
PositionNum
);
}
}
mainTimer
.
Enabled
=
false
;
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
if
(
isAuto
==
1
)
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
查看文件 @
d4450cb
...
...
@@ -12,10 +12,8 @@ namespace OnlineStore.DeviceLibrary
{
#
region
自动出入库参数
/// <summary>
/// 料仓内所有的位置列表
/// </summary>
public
List
<
string
>
PositionNumList
=
new
List
<
string
>();
/// <summary>
/// 入库完成后自动出库,出库完成后自动入库
/// </summary>
...
...
source/DeviceLibrary/ACPackingStore/StoreManager.cs
查看文件 @
d4450cb
...
...
@@ -108,6 +108,13 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
LOGGER
,
"加载料仓完成!"
);
}
string
shelfConfig
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Shelf_Position_Config
);
if
(
File
.
Exists
(
shelfConfig
))
{
CSVPositionReader
<
ShelfPosition
>.
AddCSVFile
(
shelfConfig
);
}
Store
=
new
PackingStoreBean
(
Config
,
storeConfig
);
}
}
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
d4450cb
...
...
@@ -117,6 +117,9 @@
<None Include="StoreConfig\linePositions_1.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\shelfPosition.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\StoreConfig.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
...
...
source/DeviceLibrary/StoreConfig/shelfPosition.csv
0 → 100644
查看文件 @
d4450cb
位置,优先级,高度,宽度,料仓ID,旋转轴位置,升降轴低点,升降轴高点,进出轴位置
1#AC1_1_1_4,1,8,7,1,211783,51884,55245,81000
1#AC1_1_1_5,2,8,7,1,211783,67807,71168,81000
1#AC1_1_1_6,3,8,7,1,211783,83730,87091,81000
1#AC1_1_1_7,4,8,7,1,211783,99653,103014,81000
1#AC1_1_1_8,5,8,7,1,211783,115576,118937,81000
1#AC1_1_1_9,6,8,7,1,211783,131499,134860,81000
1#AC1_1_1_10,7,8,7,1,211783,147422,150783,81000
1#AC1_1_1_11,8,8,7,1,211783,163345,166706,81000
1#AC1_1_1_12,9,8,7,1,211783,179268,182629,81000
1#AC1_1_1_13,10,8,7,1,211783,195191,198552,81000
1#AC1_1_1_14,11,8,7,1,211783,211114,214475,81000
1#AC1_1_1_15,12,8,7,1,211783,227037,230398,81000
1#AC1_1_1_16,13,8,7,1,211783,242960,246321,81000
1#AC1_1_1_17,14,8,7,1,211783,258883,262244,81000
1#AC1_1_1_18,15,8,7,1,211783,274806,278167,81000
1#AC1_1_1_19,16,8,7,1,211783,289000,294090,81000
1#AC1_1_1_20,17,8,7,1,211783,304652,310013,81000
1#AC1_1_1_21,18,8,7,1,211783,320575,325936,81000
1#AC1_1_1_22,19,8,7,1,211783,336498,341859,81000
1#AC1_1_2_3,20,8,7,1,211783,385700,389433,81000
1#AC1_1_2_4,21,8,7,1,211783,403000,405356,81000
1#AC1_1_2_5,22,8,7,1,211783,418345,421279,81000
1#AC1_1_2_6,23,8,7,1,211783,434000,437202,81000
1#AC1_1_2_7,24,8,7,1,211783,450000,453125,81000
1#AC1_1_2_8,25,8,7,1,211783,465900,469048,81000
1#AC1_1_2_9,26,8,7,1,211783,481800,484971,81000
1#AC1_1_2_10,27,8,7,1,211783,497660,500894,81000
1#AC1_1_2_11,28,8,7,1,211783,513600,516817,81000
1#AC1_1_2_12,29,8,7,1,211783,529200,532740,81000
1#AC1_1_2_13,30,8,7,1,211783,545100,548663,81000
1#AC1_1_2_14,31,8,7,1,211783,560500,564586,81000
1#AC1_1_2_15,32,8,7,1,211783,575500,580509,81000
1#AC1_1_2_16,33,8,7,1,211783,591500,596432,81000
1#AC1_1_2_17,34,8,7,1,211783,606000,612355,81000
1#AC1_1_2_18,35,8,7,1,211783,621000,628278,81000
,,,,,,,,
2#AC1_1_1_4,1,8,7,2,211783,51884,55245,81000
2#AC1_1_1_5,2,8,7,2,211783,67807,71168,81000
2#AC1_1_1_6,3,8,7,2,211783,83730,87091,81000
2#AC1_1_1_7,4,8,7,2,211783,99653,103014,81000
2#AC1_1_1_8,5,8,7,2,211783,115576,118937,81000
2#AC1_1_1_9,6,8,7,2,211783,131499,134860,81000
2#AC1_1_1_10,7,8,7,2,211783,147422,150783,81000
2#AC1_1_1_11,8,8,7,2,211783,163345,166706,81000
2#AC1_1_1_12,9,8,7,2,211783,179268,182629,81000
2#AC1_1_1_13,10,8,7,2,211783,195191,198552,81000
2#AC1_1_1_14,11,8,7,2,211783,211114,214475,81000
2#AC1_1_1_15,12,8,7,2,211783,227037,230398,81000
2#AC1_1_1_16,13,8,7,2,211783,242960,246321,81000
2#AC1_1_1_17,14,8,7,2,211783,258883,262244,81000
2#AC1_1_1_18,15,8,7,2,211783,274806,278167,81000
2#AC1_1_1_19,16,8,7,2,211783,289000,294090,81000
2#AC1_1_1_20,17,8,7,2,211783,304652,310013,81000
2#AC1_1_1_21,18,8,7,2,211783,320575,325936,81000
2#AC1_1_1_22,19,8,7,2,211783,336498,341859,81000
2#AC1_1_2_3,20,8,7,2,211783,385700,389433,81000
2#AC1_1_2_4,21,8,7,2,211783,403000,405356,81000
2#AC1_1_2_5,22,8,7,2,211783,418345,421279,81000
2#AC1_1_2_6,23,8,7,2,211783,434000,437202,81000
2#AC1_1_2_7,24,8,7,2,211783,450000,453125,81000
2#AC1_1_2_8,25,8,7,2,211783,465900,469048,81000
2#AC1_1_2_9,26,8,7,2,211783,481800,484971,81000
2#AC1_1_2_10,27,8,7,2,211783,497660,500894,81000
2#AC1_1_2_11,28,8,7,2,211783,513600,516817,81000
2#AC1_1_2_12,29,8,7,2,211783,529200,532740,81000
2#AC1_1_2_13,30,8,7,2,211783,545100,548663,81000
2#AC1_1_2_14,31,8,7,2,211783,560500,564586,81000
2#AC1_1_2_15,32,8,7,2,211783,575500,580509,81000
2#AC1_1_2_16,33,8,7,2,211783,591500,596432,81000
2#AC1_1_2_17,34,8,7,2,211783,606000,612355,81000
2#AC1_1_2_18,35,8,7,2,211783,621000,628278,81000
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
d4450cb
...
...
@@ -311,457 +311,9 @@ namespace OnlineStore.DeviceLibrary
SI_14_GoBack
=
214
,
#
endregion
#
region
手动料仓出入库步骤
/// <summary>
/// 手动料仓,已经写入开门IO
/// </summary>
M_Begin_OpenDoor
=
1000
,
/// <summary>
/// 手动料仓,已经收到开门信号
/// </summary>
M_End_OpenDoor
=
1001
,
/// <summary>
/// 手动料仓,已经收到关门信号
/// </summary>
M_CloseDoor
=
1002
,
#
endregion
#
region
移栽装置原点返回和重置步骤
/// <summary>
/// 料仓移栽装置,,上下气缸上升端
/// </summary>
H_UpDownCylinder_Up
=
2001
,
/// <summary>
/// 料仓移载装置,其他气缸运行到初始状态( 顶升气缸下降端,前后气缸后退端,夹料气缸放松端,阻挡气缸输入=0 )
/// </summary>
H_OtherCylinder_Back
=
2002
,
#
endregion
#
region
流水线入仓操作
/// <summary>
/// 流水线入仓,开始扫码 扫描枪触发,数据处理
/// </summary>
LI_Scannering
=
10001
,
/// <summary>
/// 流水线入仓,料仓号及库位号发送, 夹具号编码记忆(X5,X6.X7)数据接收
/// </summary>
LI_WaitServerResult
=
10002
,
/// <summary>
/// 等待100毫秒后再放行
/// </summary>
LI_00_Wait100
=
10003
,
/// <summary>
/// 阻挡气缸0-2下降
/// </summary>
LI_01_StopCylinder2Down
=
10004
,
/// <summary>
/// 检测夹具检测1=0 ) 开始
/// </summary>
LI_02_FixtureCheck
=
10005
,
/// <summary>
/// 阻挡气缸0-2上升
/// </summary>
LI_03_StopCylinder2Up
=
10006
,
/// <summary>
/// 阻挡气缸0-1下降
/// </summary>
LI_04_StopCylinder1Down
=
10007
,
#
endregion
#
region
流水线出库操作
/// <summary>
/// 流水线出库,等待100毫秒之后在放行
/// </summary>
LO_00_Wait100
=
11000
,
/// <summary>
/// 流水线出库,阻挡气缸0-2下降
/// </summary>
LO_01_StopCylinder2Down
=
11001
,
/// <summary>
/// 流水线出库, 检测夹具检测1=0
/// </summary>
LO_02_FixtureCheck
=
11002
,
/// <summary>
/// 流水线出库,阻挡气缸0-2上升( Y13=0)
/// </summary>
LO_03_StopCylinder2Up
=
11003
,
/// <summary>
/// 阻挡气缸0-1下降(Y12=1)
/// </summary>
LO_04_StopCylinder1Up
=
11004
,
#
endregion
#
region
移栽装置出入库共同模块
/// <summary>
///移载(流水线)装置出入库处理,, 阻挡气缸1-1下降( Y14=1)
/// </summary>
MIO_01_StopCylinder1Down
=
3081
,
/// <summary>
///移载(流水线)装置出入库处理,,夹具检测1-4=1
/// </summary>
MIO_02_FixtureCheck
=
3082
,
/// <summary>
///移载(流水线)装置出入库处理,,阻挡气缸1-1上升( Y14=0)
/// </summary>
MIO_03_StopCylinder2Down
=
3083
,
/// <summary>
/// 检测夹具检测IO1=1
/// </summary>
MIO_04_Check1High
=
3084
,
/// <summary>
/// 等待一秒钟
/// </summary>
MIO_05_WaitTime
=
3085
,
/// <summary>
///移载(流水线)装置出入库处理,,顶 升 气缸 上 升 (Y17 =0/Y1 16 =1 )检测X17=0X16=1
/// </summary>
MIO_06_TopCylinderUp
=
3086
,
/// <summary>
/// 此处 顶升气缸上升时等待一秒钟,再下降,现在看起来没有升到位就下降
/// </summary>
MIO_07_TopCylinderUpWait
=
3087
,
/// <summary>
/// 等待StoreMove完成当前操作开始入库
/// </summary>
MIO_08_WaitInStore
=
3088
,
/// <summary>
/// 等待StoreMove移走料盘开始放托盘通过
/// </summary>
MIO_09_WaitLetFixtureGo
=
3089
,
#
endregion
#
region
移栽装置出库处理
/// <summary>
/// 移载(流水线)装置出库处理, 检测夹具编码并记忆,托盘 是空盘,并且BOX在出库等待中,开始移栽料盘
/// </summary>
MO_05_CodeRember
=
3105
,
/// <summary>
/// 移载(流水线)装置出库处理,, ,顶升气缸1下降(Y16=0/Y17=1)
/// </summary>
MO_09_TopCylinder_Down
=
3109
,
/// <summary>
/// 移载(流水线)装置出库处理,, 阻挡气缸1-2下降( Y15=1)
/// </summary>
MO_10_StopCylinder2_Down
=
3110
,
/// <summary>
/// 移载(流水线)装置出库处理,, 夹具检测1-4=0,
/// </summary>
MO_11_Tray_Check
=
3111
,
/// <summary>
/// 移载(流水线)装置出库处理,,阻挡气缸1-1下降( Y14=1)阻挡气缸1-2上升( Y15=0)
/// </summary>
MO_12_StopCylinder_Back
=
3112
,
/// <summary>
/// 移栽装置出库处理。。前后气缸1前进
/// </summary>
MO_51_BeforeAfterCylinderBefore
=
3151
,
/// <summary>
/// 移栽装置出库处理。。 上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MO_52_UpDownCylinderDown
=
3152
,
/// <summary>
/// 移栽装置出库处理。。 上下气缸1下降后,等待0.3秒再夹紧,防止没有下降到位就夹紧操作
/// </summary>
MO_53_UpDownCylinderDownWait
=
3153
,
/// <summary>
/// 移栽装置出库处理。 夹料气缸1夹紧( Y25=0/Y24=1)
/// </summary>
MO_54_ClampCylinderSlack
=
3154
,
/// <summary>
/// 移栽装置出库处理。。 上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MO_55_UpDownCylinderUp
=
3155
,
/// <summary>
/// 移栽装置出库处理。。 前后气缸1后退( Y20=0/Y21=1)
/// </summary>
MO_56_BeforeAfterCylinderAfter
=
3156
,
/// <summary>
/// 移载(流水线)装置出库处理,,, 上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MO_58_UpDownCylinderDown
=
3158
,
/// <summary>
/// 移载(流水线)装置出库处理,, 夹料气缸1放松( Y25=1/Y24=0)
/// </summary>
MO_59_ClampCylinderTighten
=
3159
,
/// <summary>
/// 移载(流水线)装置出库处理,, ,上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MO_60_UpDownCylinderUp
=
3160
,
#
endregion
#
region
移载装置入库处理
/// <summary>
///移载装置入库处理,,检测 夹具编码( X1 3,X14,X15)
/// </summary>
MI_05_CodeCheck
=
3005
,
/// <summary>
/// 移载装置入库处理,,等待box等待状态才能继续操作
/// </summary>
MI_10_WaitBox
=
3006
,
/// <summary>
///移载装置入库处理,,编码与仓位一致,,上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MI_07_UpDownCylinderDown
=
3007
,
/// <summary>
///移载装置入库处理,,编码与仓位一致,,上下气缸1下降后,等待0.3秒,防止没有 下降到位就夹紧
/// </summary>
MI_07_UpDownCylinderDownWait
=
3024
,
/// <summary>
///移载装置入库处理,, 夹料气缸1夹紧( Y25=0/Y24=1)
/// </summary>
MI_08_ClampCylinderSlack
=
3008
,
/// <summary>
///移载装置入库处理,, 上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MI_09_UpDownCylinderUp
=
3009
,
/// <summary>
///移载装置入库处理,, ,前后气缸1前进( Y20=1/Y21=0)
/// </summary>
MI_10_BeforeAfterCylinderBefore
=
3010
,
/// <summary>
///移载装置入库处理,, 上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MI_11_UpDownCylinderDown
=
3011
,
/// <summary>
///移载装置入库处理,, ,夹料气缸1放松( Y25=1/Y24=0)
/// </summary>
MI_12_ClampCylinderTighten
=
3012
,
/// <summary>
///移载装置入库处理,, 上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MI_13_UpdownCylinderUp
=
3013
,
/// <summary>
///移载装置入库处理,, ,前后气缸1后退( Y20=0/Y21=1)
/// </summary>
MI_14_BeforeAfterCylinderAfter
=
3014
,
/// <summary>
///移载装置入库处理,, 检测到X102-1=1送料流程完成
/// </summary>
MI_15_SendEnd
=
3015
,
/// <summary>
///移载装置入库处理,,编码不一致,,顶升气缸1下降(Y16=0/Y17=1)
/// </summary>
MI_20_TopCylinderDown
=
3020
,
/// <summary>
///移载装置入库处理,,阻挡气缸1-2下降( Y15=1),
/// </summary>
MI_21_StopCylinderDown
=
3021
,
/// <summary>
///移载装置入库处理,检测Check4=0,
/// </summary>
MI_22_FixtureCheck_Low
=
3022
,
/// <summary>
///移载装置入库处理,,,阻挡气缸1-2 上升( Y15=0),等待200毫秒
/// </summary>
MI_23_StopCylinderReset
=
3023
,
#
endregion
//后面的是双层料仓的类型 值从20000开始
#
region
双层流水线调宽和处理
/// <summary>
/// 双层料仓流水线模块 。检测到板子进入,打开流水线
/// </summary>
LINEIN_OpenLine
=
20000
,
/// <summary>
/// 双层料仓流水线模块 。等待下位机要料信号=High
/// </summary>
LINEIN_WaitOutSingle
=
20001
,
/// <summary>
/// 双层料仓流水线模块 。检测到出料口信号=Low
/// </summary>
LINEIN_WaitOutSingleLow
=
20002
,
/// <summary>
/// 关闭皮带
/// </summary>
LINEIN_CloseLine
=
20003
,
/// <summary>
/// 等待下位机要料信号
/// </summary>
LINEIN_WatiMachineSingle
=
20004
,
/// <summary>
/// 双层料仓流水线模块 。线体调宽回原点
/// </summary>
LINECW_LineReturnHome
=
20010
,
/// <summary>
/// 双层料仓流水线模块 。线体调宽回原点
/// </summary>
LINECW_LineChangeWidth
=
20011
,
/// <summary>
/// 流水线原点返回,设置速度
/// </summary>
LINEH_SetSpeed_001
=
20020
,
/// <summary>
/// 流水线原点返回,反反向走到20000
/// </summary>
LINEH_RevertMove_002
=
20021
,
/// <summary>
/// 流水线原点返回,开始原点返回
/// </summary>
LINEH_LineHome_003
=
20022
,
#
endregion
#
region
在线料仓入库处理
/// <summary>
///在线双层料仓:入仓: 等待料盘进入
/// </summary>
DB_SI_00_WaitIO
=
20100
,
/// <summary>
///在线双层料仓:入仓:扫描二维码中
/// </summary>
DB_SI_01_Scanning
=
20101
,
/// <summary>
/// 在线双层料仓:入仓:根据二维码从服务器获取仓位号
/// </summary>
DB_SI_02_GetBoxNum
=
20102
,
/// <summary>
///在线双层料仓: 同时动作
/// 电缸运行到入料口下方的位置 , 料仓旋转到对应的位置
/// </summary>
DB_SI_03_InStoreReadyMove
=
20103
,
/// <summary>
/// 在线双层料仓:入仓:(取料叉子进入料口)、
/// </summary>
DB_SI_04_TakeDeviceToDoor
=
20104
,
/// <summary>
/// 在线双层料仓:入仓:(电缸稍微移动到料口上端位置),
/// </summary>
DB_SI_05_ModbusUpToDoor
=
20105
,
/// <summary>
///在线双层料仓: 取出料盘
/// </summary>
DB_SI_06_TakeSITray
=
20106
,
/// <summary>
/// 在线双层料仓:入仓(电缸运行到对应仓位的下方,,旋转电机2正转)
/// </summary>
DB_SI_07_MoveToRoom
=
20107
,
/// <summary>
/// 在线双层料仓:入仓(取料叉子进入仓位)
/// </summary>
DB_SI_08_TakeDeviceToRoom
=
20108
,
/// <summary>
///在线双层料仓: 入仓(电缸微动至对应料仓的下端位置)
/// </summary>
DB_SI_09_PutToRoom
=
20109
,
/// <summary>
/// 在线双层料仓:从仓位出来
/// </summary>
DB_SI_10_SIFromRoom
=
20110
,
/// <summary>
///在线双层料仓: 旋转电机2反转,回到中间等待位置
/// </summary>
DB_SI_11_MoveSIFromRoom
=
20111
,
/// <summary>
/// 在线双层料仓:关闭仓门
/// </summary>
DB_SI_12_CloseDoor
=
20112
,
#
endregion
#
region
在线料仓出库处理
/// <summary>
///在线双层料仓:: 出库处理:等待执行出库
/// </summary>
DB_SO_00_WaitStart
=
20200
,
/// <summary>
///在线双层料仓:
/// </summary>
DB_SO_01_Scanning
=
20201
,
/// <summary>
/// 在线双层料仓:
/// </summary>
DB_SO_02_GetBoxNum
=
20202
,
/// <summary>
///在线双层料仓:出库执行 同时动作
/// 电缸运行到入料口下方的位置 ,料仓旋转到对应的位置,旋转电机2正传
/// </summary>
DB_SO_03_ReadyMove
=
20203
,
/// <summary>
/// 在线双层料仓: 出仓:(取料叉子进入料仓)叉子前进
/// </summary>
DB_SO_04_TakeDeviceToDoor
=
20204
,
/// <summary>
/// 在线双层料仓: 出仓:(电缸稍微移动到料仓上端位置)
/// </summary>
DB_SO_05_ModbusUpToDoor
=
20205
,
/// <summary>
///在线双层料仓: 取出料盘,叉子后退
/// </summary>
DB_SO_06_TakeOutTray
=
20206
,
/// <summary>
/// 在线双层料仓: 出库执行(电缸移动至入料口的上端位置 旋转电机2正转)
/// </summary>
DB_SO_07_MoveToRoom
=
20207
,
/// <summary>
/// 在线双层料仓:出库执行 (叉子前进)
/// </summary>
DB_SO_08_TakeDeviceToRoom
=
20208
,
/// <summary>
///在线双层料仓: 出库执行 (电缸微动至对应料口的下端位置)
/// </summary>
DB_SO_09_PutToRoom
=
20209
,
/// <summary>
/// 在线双层料仓:出库执行 叉子后退
/// </summary>
DB_SO_10_OutFromRoom
=
20210
,
/// <summary>
/// 在线双层料仓:等待物料到达
/// </summary>
DB_SO_11_WaitTrayToDoor
=
20211
,
/// <summary>
/// 在线双层料仓:等待拿走料盘
/// </summary>
DB_SO_12_WaitTrayLeave
=
20212
,
///// <summary>
/////在线双层料仓:出库执行 旋转电机2反转,回到中间等待位置
///// </summary>
//DB_SO_11_MoveOutFromRoom = 20211,
///// <summary>
///// 在线双层料仓:出库执行(关闭仓门
///// </summary>
//DB_SO_CloseDoor = 20213,
#
endregion
/// <summary>
/// 在线双层料仓:回原点:叉子退回
/// </summary>
DB_H_01_ForkBack
=
20301
,
/// <summary>
/// 在线双层料仓:回原点:同时动作:转盘低速旋转 , 电缸回到原位 ,( I/O点控制) 旋转气缸旋回
/// </summary>
DB_H_02_BackHome
=
20302
,
/// <summary>
/// 在线双层料仓:回原点:旋回完成
/// </summary>
DB_H_03_BackEnd
=
20303
,
/// <summary>
/// 在线双层料仓:回原点:原点开关点亮,原点开关点亮,旋回端开关点亮,,转盘停止 ,电缸停止, 清理电钢和转盘的位置信息
/// </summary>
DB_H_04_ClearPosition
=
20304
,
}
public
enum
StoreAlarmType
...
...
source/LoadCVSLibrary/LoadCSVLibrary.csproj
查看文件 @
d4450cb
...
...
@@ -48,6 +48,7 @@
<ItemGroup>
<Compile Include="CSVExection.cs" />
<Compile Include="position\ACBoxPosition.cs" />
<Compile Include="position\ShelfPosition.cs" />
<Compile Include="storeConfig\ConfigItemBase.cs" />
<Compile Include="storeConfig\ConfigProAttribute.cs" />
<Compile Include="storeConfig\config\Store_Config.cs" />
...
...
@@ -60,7 +61,7 @@
<Compile Include="CSVReaderBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="storeConfig\config\BaseConfig.cs" />
<Compile Include="position\
Store
PostionBase.cs" />
<Compile Include="position\PostionBase.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
...
...
source/LoadCVSLibrary/position/ACBoxPosition.cs
查看文件 @
d4450cb
...
...
@@ -10,7 +10,7 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// 松下伺服485控制,单台料仓
/// </summary>
public
class
ACBoxPosition
:
Store
PostionBase
public
class
ACBoxPosition
:
PostionBase
{
/// <summary>
/// 对应的料仓ID(流水线料仓需要用此字段区分哪个BOX)
/// </summary>
...
...
source/LoadCVSLibrary/position/CSVPositionReader.cs
查看文件 @
d4450cb
...
...
@@ -11,14 +11,16 @@ using System.Text;
namespace
OnlineStore.LoadCSVLibrary
{
public
class
CSVPositionReader
<
T
>
:
CSVReaderBase
where
T
:
Store
PostionBase
{
public
class
CSVPositionReader
<
T
>
:
CSVReaderBase
where
T
:
PostionBase
{
/// <summary>
/// 所有的位置集合,key=位置
/// </summary>
public
static
Dictionary
<
string
,
T
>
allPositionMap
=
new
Dictionary
<
string
,
T
>();
public
static
Dictionary
<
string
,
Dictionary
<
string
,
T
>>
AllPositionMap
=
new
Dictionary
<
string
,
Dictionary
<
string
,
T
>
>();
public
static
List
<
string
>
hasReadFileList
=
new
List
<
string
>();
private
static
List
<
string
>
hasReadFileList
=
new
List
<
string
>();
/// <summary>
/// 重新加载配置,会删除之前的所有信息,重新读取
...
...
@@ -27,19 +29,25 @@ namespace OnlineStore.LoadCSVLibrary
/// <returns></returns>
public
static
Dictionary
<
String
,
T
>
ReloadCSVFile
(
string
filePath
)
{
allPositionMap
=
new
Dictionary
<
string
,
T
>();
AllPositionMap
=
new
Dictionary
<
string
,
Dictionary
<
string
,
T
>
>();
hasReadFileList
=
new
List
<
string
>();
return
AddCSVFile
(
filePath
);
}
p
ublic
static
List
<
string
>
getPositionKeyList
()
p
rivate
static
string
GetTName
()
{
return
new
List
<
string
>(
allPositionMap
.
Keys
);
Type
type
=
typeof
(
T
);
return
type
.
Name
;
}
public
static
List
<
T
>
getPositionList
()
{
List
<
T
>
list
=
new
List
<
T
>(
allPositionMap
.
Values
);
return
list
;
{
string
name
=
GetTName
();
if
(
AllPositionMap
.
ContainsKey
(
name
))
{
List
<
T
>
list
=
new
List
<
T
>(
AllPositionMap
[
name
].
Values
);
return
list
;
}
return
new
List
<
T
>();
}
/// <summary>
/// 添加一个csv文件的数据到位置集合中
...
...
@@ -54,7 +62,7 @@ namespace OnlineStore.LoadCSVLibrary
return
null
;
}
Type
type
=
typeof
(
T
);
string
tname
=
GetTName
();
Dictionary
<
string
,
string
>
proTitleMap
=
getProAttributeMap
(
typeof
(
T
));
if
(
proTitleMap
.
Count
<=
4
)
{
...
...
@@ -94,7 +102,7 @@ namespace OnlineStore.LoadCSVLibrary
foreach
(
string
key
in
cvsTitleList
)
{
int
titIndex
=
titleIndex
[
key
];
string
value
=
array
[
titIndex
];
string
value
=
array
[
titIndex
]
.
Trim
()
;
string
proName
=
propertyList
[
listIndex
];
PropertyInfo
prop
=
props
.
First
(
c
=>
c
.
Name
==
proName
);
//获取同名属性
if
(
prop
!=
null
)
...
...
@@ -108,11 +116,16 @@ namespace OnlineStore.LoadCSVLibrary
listIndex
++;
}
result
.
Add
(
PositionNum
,
(
T
)
bllIns
);
if
(
allPositionMap
.
ContainsKey
(
PositionNum
))
if
(!
AllPositionMap
.
ContainsKey
(
tname
))
{
AllPositionMap
.
Add
(
tname
,
new
Dictionary
<
string
,
T
>());
}
if
(
AllPositionMap
[
tname
].
ContainsKey
(
PositionNum
))
{
throw
new
PositionAlreadyExistingExection
(
"仓位:"
+
PositionNum
+
"已存在!"
);
}
allPositionMap
.
Add
(
PositionNum
,
(
T
)
bllIns
);
AllPositionMap
[
tname
]
.
Add
(
PositionNum
,
(
T
)
bllIns
);
}
else
{
...
...
@@ -137,22 +150,25 @@ namespace OnlineStore.LoadCSVLibrary
{
return
null
;
}
StorePostionBase
result
=
null
;
if
(
allPositionMap
.
ContainsKey
(
positionNum
))
PostionBase
result
=
null
;
string
tname
=
GetTName
();
if
(
AllPositionMap
.
ContainsKey
(
tname
))
{
result
=
allPositionMap
[
positionNum
];
return
(
T
)
result
;
}
else
{
return
null
;
if
(
AllPositionMap
[
tname
].
ContainsKey
(
positionNum
))
{
result
=
AllPositionMap
[
tname
][
positionNum
];
return
(
T
)
result
;
}
}
return
null
;
}
public
static
bool
SavePostion
(
string
filePath
,
T
position
)
{
Type
type
=
typeof
(
T
);
string
tName
=
GetTName
();
Dictionary
<
string
,
string
>
proTitleMap
=
getProAttributeMap
(
typeof
(
T
));
if
(
proTitleMap
.
Count
<=
4
)
{
...
...
@@ -184,12 +200,16 @@ namespace OnlineStore.LoadCSVLibrary
string
value
=
array
[
csvIndex
];
if
(
value
.
Equals
(
position
.
PositionNum
))
{
//更新缓存
allPositionMap
.
Remove
(
position
.
PositionNum
);
allPositionMap
.
Add
(
position
.
PositionNum
,
position
);
string
newValue
=
PostionToString
(
position
,
titleIndex
,
proTitleMap
);
lines
[
index
]
=
newValue
;
return
WriteCSVFile
(
filePath
,
lines
);
if
(
AllPositionMap
.
ContainsKey
(
tName
))
{
//更新缓存
AllPositionMap
[
tName
].
Remove
(
position
.
PositionNum
);
AllPositionMap
[
tName
].
Add
(
position
.
PositionNum
,
position
);
string
newValue
=
PostionToString
(
position
,
titleIndex
,
proTitleMap
);
lines
[
index
]
=
newValue
;
return
WriteCSVFile
(
filePath
,
lines
);
}
}
}
}
...
...
@@ -198,7 +218,7 @@ namespace OnlineStore.LoadCSVLibrary
return
true
;
}
private
static
string
PostionToString
(
Store
PostionBase
position
,
Dictionary
<
string
,
int
>
titleIndex
,
Dictionary
<
string
,
string
>
proTitleMap
)
private
static
string
PostionToString
(
PostionBase
position
,
Dictionary
<
string
,
int
>
titleIndex
,
Dictionary
<
string
,
string
>
proTitleMap
)
{
//取得属性集合
PropertyInfo
[]
props
=
typeof
(
T
).
GetProperties
();
...
...
@@ -230,28 +250,7 @@ namespace OnlineStore.LoadCSVLibrary
}
return
newStr
;
}
//private void ReadTest( )
//{
// Dictionary<string, string> dic = new Dictionary<string, string>();
// string path = Application.StartupPath + @"\Test.csv";
// dic.Add("AxisPosition", "中轴位置");
// dic.Add("ModbusHighPosition", "电钢高位");
// dic.Add("ModbusLowPosition", "电钢低位");
// Dictionary<string, KTKStorePostion> ddd = LoadCVSLibrary.CSVReaderHelper<KTKStorePostion>.ReadCVS(path, dic, typeof(KTKStorePostion));
// if (ddd != null)
// {
// MessageBox.Show("读取成功!");
// }
// else
// {
// MessageBox.Show("读取失败,请检查数据格式!");
// }
//}
}
...
...
source/LoadCVSLibrary/position/
Store
PostionBase.cs
→
source/LoadCVSLibrary/position/PostionBase.cs
查看文件 @
d4450cb
...
...
@@ -6,7 +6,7 @@ using System.Text;
namespace
OnlineStore.LoadCSVLibrary
{
public
class
Store
PostionBase
public
class
PostionBase
{
/// <summary>
/// 位置
...
...
source/LoadCVSLibrary/position/ShelfPosition.cs
0 → 100644
查看文件 @
d4450cb
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
OnlineStore.LoadCSVLibrary
{
public
class
ShelfPosition
:
PostionBase
{
/// <summary>
/// 对应的料仓ID(流水线料仓需要用此字段区分哪个BOX)
/// </summary>
[
CSVAttribute
(
"料仓ID"
)]
public
int
StoreId
{
get
;
set
;
}
/// <summary>
/// 旋转轴位置
/// </summary>
[
CSVAttribute
(
"旋转轴位置"
)]
public
int
MiddleAxis_P100
{
get
;
set
;
}
/// <summary>
/// 升降轴高点
/// </summary>
[
CSVAttribute
(
"升降轴低点"
)]
public
int
UpDownAxis_HP100
{
get
;
set
;
}
/// <summary>
/// 升降轴高点
/// /// </summary>
[
CSVAttribute
(
"升降轴高点"
)]
public
int
UpDownAxis_LP100
{
get
;
set
;
}
/// <summary>
/// 进出轴位置
/// </summary>
[
CSVAttribute
(
"进出轴位置"
)]
public
int
UpDownAxis_P100
{
get
;
set
;
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论