Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-ACPackingStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0fbcb89e
由
LN
编写于
2019-11-02 14:42:37 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
03e70b29
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
26 个修改的文件
包含
160 行增加
和
125 行删除
source/ACPackingStore/App.config
source/ACPackingStore/FrmBox.Designer.cs
source/ACPackingStore/FrmBox.cs
source/ACPackingStore/FrmBox.resx
source/ACPackingStore/FrmStore.Designer.cs
source/ACPackingStore/FrmStore.cs
source/ACPackingStore/useControl/AxisMoveControl.Designer.cs
source/ACPackingStore/useControl/AxisMoveControl.cs
source/Common/Setting_Init.cs
source/Common/util/ConfigAppSettings.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
source/DeviceLibrary/ACPackingStore/PackingStoreBean.cs
source/DeviceLibrary/ACPackingStore/StoreManager.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/StoreConfig/BoxConfig_1.csv
source/DeviceLibrary/StoreConfig/BoxConfig_2.csv
source/DeviceLibrary/StoreConfig/linePositions.csv
source/DeviceLibrary/StoreConfig/linePositions_1.csv
source/DeviceLibrary/StoreConfig/linePositions_2.csv
source/DeviceLibrary/store/InOrOutStoreParam.cs
source/DeviceLibrary/store/KTK_Store.cs
source/LoadCVSLibrary/LoadCSVLibrary.csproj
source/LoadCVSLibrary/position/ACSAStorePosition.cs → source/LoadCVSLibrary/position/ACBoxPosition.cs
source/LoadCVSLibrary/storeConfig/config/AC_Box_Config.cs
source/LoadCVSLibrary/storeConfig/config/BaseConfig.cs
source/ACPackingStore/App.config
查看文件 @
0fbcb89
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<
appSettings
>
<
appSettings
>
<!--是否开机自动启动料仓-->
<!--是否开机自动启动料仓-->
<
add
key
=
"App_AutoRun"
value
=
"1"
/>
<
add
key
=
"App_AutoRun"
value
=
"1"
/>
<
add
key
=
"App_Title"
value
=
"
AC_SA_料仓_1
"
/>
<
add
key
=
"App_Title"
value
=
"
包装料料仓
"
/>
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<
add
key
=
"StartBlowValue"
value
=
"4"
/>
<
add
key
=
"StartBlowValue"
value
=
"4"
/>
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
...
@@ -20,8 +20,9 @@
...
@@ -20,8 +20,9 @@
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\linePositions.csv"
/>
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\linePositions.csv"
/>
<
add
key
=
"BOX_ConfigPath"
value
=
"\StoreConfig\BoxConfig.csv"
/>
<
add
key
=
"BOX_ConfigPath"
value
=
"\StoreConfig\BoxConfig.csv"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_PA"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_PA"
/>
<
add
key
=
"Store_CID"
value
=
"line-ac1"
/>
<
add
key
=
"Store_CID"
value
=
"line-ac"
/>
<
add
key
=
"Store_ID"
value
=
"1"
/>
<
add
key
=
"Store_CID_1"
value
=
"line-ac1"
/>
<
add
key
=
"Store_CID_2"
value
=
"line-ac2"
/>
<!--
end
one
store
config
-->
<!--
end
one
store
config
-->
<
add
key
=
"ACBaudRate"
value
=
"115200"
/>
<
add
key
=
"ACBaudRate"
value
=
"115200"
/>
<
add
key
=
"InOutDefaultPosition"
value
=
"8000"
/>
<
add
key
=
"InOutDefaultPosition"
value
=
"8000"
/>
...
...
source/ACPackingStore/FrmBox.Designer.cs
查看文件 @
0fbcb89
此文件的差异被折叠,
点击展开。
source/ACPackingStore/FrmBox.cs
查看文件 @
0fbcb89
此文件的差异被折叠,
点击展开。
source/ACPackingStore/FrmBox.resx
查看文件 @
0fbcb89
此文件的差异被折叠,
点击展开。
source/ACPackingStore/FrmStore.Designer.cs
查看文件 @
0fbcb89
此文件的差异被折叠,
点击展开。
source/ACPackingStore/FrmStore.cs
查看文件 @
0fbcb89
...
@@ -46,12 +46,15 @@ namespace OnlineStore.ACPackingStore
...
@@ -46,12 +46,15 @@ namespace OnlineStore.ACPackingStore
{
{
foreach
(
AC_BOX_Bean
box
in
store
.
BoxMap
.
Values
)
foreach
(
AC_BOX_Bean
box
in
store
.
BoxMap
.
Values
)
{
{
FrmBox
frm
=
new
FrmBox
();
FrmBox
frm
=
new
FrmBox
();
frm
.
BoxBean
=
box
;
frm
.
BoxBean
=
box
;
AddForm
(
box
.
Name
,
frm
);
AddForm
(
box
.
Name
,
frm
);
}
}
}
}
this
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
App_Title
);
chbAutoRun
.
Checked
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
App_AutoRun
).
Equals
(
1
);
HideForm
();
HideForm
();
LoadOk
=
true
;
}
}
...
@@ -318,19 +321,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -318,19 +321,7 @@ namespace OnlineStore.ACPackingStore
FrmAbout
about
=
new
FrmAbout
();
FrmAbout
about
=
new
FrmAbout
();
about
.
ShowDialog
();
about
.
ShowDialog
();
}
}
private
void
扫码测试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
//store. GetCameraCode();
List
<
string
>
codes
=
CodeManager
.
CameraScan
();
string
result
=
""
;
foreach
(
string
s
in
codes
)
{
result
+=
s
+
"\r\n"
;
}
LogUtil
.
info
(
"扫到二维码:"
+
result
);
}
private
void
二维码学习
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
二维码学习
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
CodeLibrary
.
FrmCodeDecode
frm
=
new
CodeLibrary
.
FrmCodeDecode
();
CodeLibrary
.
FrmCodeDecode
frm
=
new
CodeLibrary
.
FrmCodeDecode
();
...
@@ -350,7 +341,50 @@ namespace OnlineStore.ACPackingStore
...
@@ -350,7 +341,50 @@ namespace OnlineStore.ACPackingStore
private
void
toolStripMenuItem2_Click
(
object
sender
,
EventArgs
e
)
private
void
toolStripMenuItem2_Click
(
object
sender
,
EventArgs
e
)
{
{
if
(
toolStripMenuItem2
.
Text
.
Equals
(
"启用调试"
))
{
DebugOpen
(
true
);
}
else
{
DebugOpen
(
false
);
}
}
private
void
DebugOpen
(
bool
isopen
)
{
foreach
(
TabPage
tab
in
tabPageList
)
{
bool
find
=
false
;
foreach
(
Control
control
in
tab
.
Controls
)
{
if
(
control
is
Panel
)
{
foreach
(
Control
con
in
control
.
Controls
)
{
if
(
con
is
FrmBox
)
{
FrmBox
frm
=
(
FrmBox
)
con
;
frm
.
DebugStatus
(
isopen
);
find
=
true
;
break
;
}
}
}
if
(
find
)
{
break
;
}
}
}
if
(
isopen
)
{
toolStripMenuItem2
.
Text
=
"禁用调试"
;
}
else
{
toolStripMenuItem2
.
Text
=
"启用调试"
;
}
}
}
}
}
}
}
source/ACPackingStore/useControl/AxisMoveControl.Designer.cs
查看文件 @
0fbcb89
namespace
OnlineStore.A
ssemblyLin
e
namespace
OnlineStore.A
CPackingStor
e
{
{
partial
class
AxisMoveControl
partial
class
AxisMoveControl
{
{
...
@@ -74,6 +74,9 @@
...
@@ -74,6 +74,9 @@
//
//
// groupAxis
// groupAxis
//
//
this
.
groupAxis
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
groupAxis
.
Controls
.
Add
(
this
.
comboBox1
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
comboBox1
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
label6
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
label6
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
label1
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
label1
);
...
@@ -115,9 +118,9 @@
...
@@ -115,9 +118,9 @@
this
.
groupAxis
.
Controls
.
Add
(
this
.
label46
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
label46
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
label49
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
label49
);
this
.
groupAxis
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupAxis
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupAxis
.
Location
=
new
System
.
Drawing
.
Point
(
9
,
4
);
this
.
groupAxis
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
2
);
this
.
groupAxis
.
Name
=
"groupAxis"
;
this
.
groupAxis
.
Name
=
"groupAxis"
;
this
.
groupAxis
.
Size
=
new
System
.
Drawing
.
Size
(
6
48
,
367
);
this
.
groupAxis
.
Size
=
new
System
.
Drawing
.
Size
(
6
04
,
367
);
this
.
groupAxis
.
TabIndex
=
218
;
this
.
groupAxis
.
TabIndex
=
218
;
this
.
groupAxis
.
TabStop
=
false
;
this
.
groupAxis
.
TabStop
=
false
;
this
.
groupAxis
.
Text
=
"伺服运动"
;
this
.
groupAxis
.
Text
=
"伺服运动"
;
...
@@ -585,7 +588,7 @@
...
@@ -585,7 +588,7 @@
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
Controls
.
Add
(
this
.
groupAxis
);
this
.
Controls
.
Add
(
this
.
groupAxis
);
this
.
Name
=
"AxisMoveControl"
;
this
.
Name
=
"AxisMoveControl"
;
this
.
Size
=
new
System
.
Drawing
.
Size
(
6
78
,
388
);
this
.
Size
=
new
System
.
Drawing
.
Size
(
6
12
,
374
);
this
.
groupAxis
.
ResumeLayout
(
false
);
this
.
groupAxis
.
ResumeLayout
(
false
);
this
.
groupAxis
.
PerformLayout
();
this
.
groupAxis
.
PerformLayout
();
this
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
...
...
source/ACPackingStore/useControl/AxisMoveControl.cs
查看文件 @
0fbcb89
...
@@ -12,7 +12,7 @@ using OnlineStore.Common;
...
@@ -12,7 +12,7 @@ using OnlineStore.Common;
using
System.Threading
;
using
System.Threading
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
namespace
OnlineStore.A
ssemblyLin
e
namespace
OnlineStore.A
CPackingStor
e
{
{
public
partial
class
AxisMoveControl
:
UserControl
public
partial
class
AxisMoveControl
:
UserControl
{
{
...
@@ -153,5 +153,6 @@ namespace OnlineStore.AssemblyLine
...
@@ -153,5 +153,6 @@ namespace OnlineStore.AssemblyLine
}
}
}
}
}
}
}
}
source/Common/Setting_Init.cs
查看文件 @
0fbcb89
...
@@ -23,8 +23,7 @@ namespace OnlineStore.Common
...
@@ -23,8 +23,7 @@ namespace OnlineStore.Common
public
static
string
http_server
=
"http.server"
;
public
static
string
http_server
=
"http.server"
;
public
static
string
Store_CID
=
"Store_CID"
;
public
static
string
Store_CID
=
"Store_CID"
;
public
static
string
Store_ID
=
"Store_ID"
;
/// <summary>
/// <summary>
/// 料仓数量
/// 料仓数量
...
@@ -59,10 +58,7 @@ namespace OnlineStore.Common
...
@@ -59,10 +58,7 @@ namespace OnlineStore.Common
/// 配置文件路径 Data Matrix ECC 200.dcm
/// 配置文件路径 Data Matrix ECC 200.dcm
/// </summary>
/// </summary>
public
static
string
CodeParamPath
=
"CodeParamPath"
;
public
static
string
CodeParamPath
=
"CodeParamPath"
;
/// <summary>
/// 高度传感器转换系数
/// </summary>
public
static
string
AI_ConvertPosition
=
"AI_ConvertPosition"
;
/// <summary>
/// <summary>
/// 进出轴最大待机点,需要小于3000
/// 进出轴最大待机点,需要小于3000
/// </summary>
/// </summary>
...
@@ -84,10 +80,7 @@ namespace OnlineStore.Common
...
@@ -84,10 +80,7 @@ namespace OnlineStore.Common
public
static
string
LineServerIp
=
"LineServerIp"
;
public
static
string
LineServerIp
=
"LineServerIp"
;
public
static
string
LineServerPort
=
"LineServerPort"
;
public
static
string
LineServerPort
=
"LineServerPort"
;
/// <summary>
/// 是否调试状态
/// </summary>
public
static
string
IsInDebug
=
"IsInDebug"
;
public
static
string
ACBaudRate
=
"ACBaudRate"
;
public
static
string
ACBaudRate
=
"ACBaudRate"
;
...
...
source/Common/util/ConfigAppSettings.cs
查看文件 @
0fbcb89
...
@@ -25,54 +25,7 @@ namespace OnlineStore.Common
...
@@ -25,54 +25,7 @@ namespace OnlineStore.Common
}
}
Interlocked
.
Increment
(
ref
seq
);
Interlocked
.
Increment
(
ref
seq
);
return
seq
;
return
seq
;
}
}
public
static
string
GetValue
(
string
keyStr
,
string
storeStr
)
{
string
key
=
keyStr
+
storeStr
;
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
{
return
GetValue
(
keyStr
);
}
else
{
return
config
.
AppSettings
.
Settings
[
key
].
Value
;
}
}
public
static
decimal
GetNumValue
(
string
keyStr
,
string
storeStr
)
{
string
key
=
keyStr
+
storeStr
;
decimal
a
=
0
;
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
{
return
GetNumValue
(
keyStr
);
}
else
{
{
Decimal
.
TryParse
(
config
.
AppSettings
.
Settings
[
key
].
Value
,
out
a
);
}
}
return
a
;
}
public
static
int
GetIntValue
(
string
keyStr
,
string
storeStr
)
{
string
key
=
keyStr
+
storeStr
;
int
a
=
0
;
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
{
return
GetIntValue
(
keyStr
);
}
else
{
{
Int32
.
TryParse
(
config
.
AppSettings
.
Settings
[
key
].
Value
,
out
a
);
}
}
return
a
;
}
public
static
string
GetValue
(
string
key
)
public
static
string
GetValue
(
string
key
)
{
{
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean.cs
查看文件 @
0fbcb89
...
@@ -44,6 +44,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -44,6 +44,7 @@ namespace OnlineStore.DeviceLibrary
{
{
Init
();
Init
();
baseConfig
=
config
;
baseConfig
=
config
;
CID
=
config
.
CID
;
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
serverConnectTimer
.
Interval
=
1000
;
serverConnectTimer
.
Interval
=
1000
;
serverConnectTimer
.
AutoReset
=
true
;
serverConnectTimer
.
AutoReset
=
true
;
...
@@ -56,42 +57,32 @@ namespace OnlineStore.DeviceLibrary
...
@@ -56,42 +57,32 @@ namespace OnlineStore.DeviceLibrary
IoCheckTimer
.
Elapsed
+=
IoCheckTimer_Elapsed
;
IoCheckTimer
.
Elapsed
+=
IoCheckTimer_Elapsed
;
//添加调试
//添加调试
IsDebug
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
IsInDebug
)
.
Equals
(
1
);
IsDebug
=
config
.
IsInDebug
.
Equals
(
1
);
Name
=
(
"料仓BOX_"
+
config
.
Id
+
" "
).
ToUpper
();
Name
=
(
"料仓BOX_"
+
config
.
DeviceID
+
" "
).
ToUpper
();
this
.
DeviceID
=
config
.
Id
;
this
.
DeviceID
=
config
.
DeviceID
;
this
.
Config
=
config
;
this
.
Config
=
config
;
moveAxisList
=
new
List
<
ConfigMoveAxis
>();
moveAxisList
=
new
List
<
ConfigMoveAxis
>();
MoveAxisConfig
();
MoveAxisConfig
();
List
<
AC
StorePosition
>
positionList
=
CSVPositionReader
<
ACStore
Position
>.
getPositionList
();
List
<
AC
BoxPosition
>
positionList
=
CSVPositionReader
<
ACBox
Position
>.
getPositionList
();
PositionNumList
=
new
List
<
string
>();
PositionNumList
=
new
List
<
string
>();
foreach
(
AC
Store
Position
position
in
positionList
)
foreach
(
AC
Box
Position
position
in
positionList
)
{
{
if
(
position
.
StoreId
.
Equals
(
DeviceID
))
if
(
position
.
StoreId
.
Equals
(
DeviceID
))
{
{
bool
result
=
AC
Store
Position
.
CheckPosition
(
position
,
Config
);
bool
result
=
AC
Box
Position
.
CheckPosition
(
position
,
Config
);
if
(
result
)
if
(
result
)
{
{
PositionNumList
.
Add
(
position
.
PositionNum
);
PositionNumList
.
Add
(
position
.
PositionNum
);
}
}
}
}
}
}
IOManager
.
Init
();
IOManager
.
instance
.
ConnectionIOList
(
Config
.
DIODeviceNameList
);
mainTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
if
(
isAuto
==
1
)
if
(
isAuto
==
1
)
{
{
mainTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
}
}
Thread
.
Sleep
(
300
);
//默认三个灯都亮
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
}
}
private
void
IoCheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
private
void
IoCheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
...
@@ -1152,7 +1143,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1152,7 +1143,7 @@ namespace OnlineStore.DeviceLibrary
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
//根据发送的posId获取位置列表
//根据发送的posId获取位置列表
AC
StorePosition
position
=
CSVPositionReader
<
ACStore
Position
>.
GetPositon
(
posId
);
AC
BoxPosition
position
=
CSVPositionReader
<
ACBox
Position
>.
GetPositon
(
posId
);
if
(
position
==
null
)
if
(
position
==
null
)
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg
=
"入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】 "
;
WarnMsg
=
"入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】 "
;
...
@@ -1238,7 +1229,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1238,7 +1229,7 @@ namespace OnlineStore.DeviceLibrary
// //LineConnect.WaitInStoreList.Remove(posId);
// //LineConnect.WaitInStoreList.Remove(posId);
//}
//}
//根据发送的posId获取位置列表
//根据发送的posId获取位置列表
AC
StorePosition
position
=
CSVPositionReader
<
ACStore
Position
>.
GetPositon
(
posId
);
AC
BoxPosition
position
=
CSVPositionReader
<
ACBox
Position
>.
GetPositon
(
posId
);
if
(
position
==
null
)
if
(
position
==
null
)
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg
=
"入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】 "
;
WarnMsg
=
"入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】 "
;
...
@@ -1627,7 +1618,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1627,7 +1618,7 @@ namespace OnlineStore.DeviceLibrary
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
//根据发送的posId获取位置列表
//根据发送的posId获取位置列表
AC
StorePosition
position
=
CSVPositionReader
<
ACStore
Position
>.
GetPositon
(
posId
);
AC
BoxPosition
position
=
CSVPositionReader
<
ACBox
Position
>.
GetPositon
(
posId
);
if
(
position
==
null
)
if
(
position
==
null
)
{
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
查看文件 @
0fbcb89
...
@@ -46,7 +46,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -46,7 +46,7 @@ namespace OnlineStore.DeviceLibrary
if
(
param
.
MoveP
==
null
)
if
(
param
.
MoveP
==
null
)
{
{
LineMoveP
p
=
new
LineMoveP
();
LineMoveP
p
=
new
LineMoveP
();
AC
Store
Position
position
=
param
.
GetACPosition
();
AC
Box
Position
position
=
param
.
GetACPosition
();
if
(
position
==
null
)
if
(
position
==
null
)
{
{
LogUtil
.
error
(
LOGGER
,
Name
+
"出入库时发现param中取到的Position=null,没有库位不能执行出入库"
);
LogUtil
.
error
(
LOGGER
,
Name
+
"出入库时发现param中取到的Position=null,没有库位不能执行出入库"
);
...
...
source/DeviceLibrary/ACPackingStore/PackingStoreBean.cs
查看文件 @
0fbcb89
...
@@ -48,8 +48,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -48,8 +48,8 @@ namespace OnlineStore.DeviceLibrary
InitTimer
();
InitTimer
();
baseConfig
=
lineConfig
;
baseConfig
=
lineConfig
;
this
.
Config
=
lineConfig
;
this
.
Config
=
lineConfig
;
this
.
DeviceID
=
lineConfig
.
Id
;
this
.
DeviceID
=
lineConfig
.
DeviceID
;
MoveInfo
=
new
StoreMoveInfo
(
DeviceID
);
MoveInfo
=
new
StoreMoveInfo
(
DeviceID
);
Name
=
(
" Store_"
+
Config
.
CID
+
" "
).
ToUpper
();
Name
=
(
" Store_"
+
Config
.
CID
+
" "
).
ToUpper
();
List
<
string
>
ioList
=
new
List
<
string
>();
List
<
string
>
ioList
=
new
List
<
string
>();
...
@@ -60,8 +60,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -60,8 +60,8 @@ namespace OnlineStore.DeviceLibrary
AC_BOX_Bean
equip
=
new
AC_BOX_Bean
(
config
);
AC_BOX_Bean
equip
=
new
AC_BOX_Bean
(
config
);
AddDeviceName
(
ioList
,
config
.
DIODeviceNameList
);
AddDeviceName
(
ioList
,
config
.
DIODeviceNameList
);
BoxMap
.
Add
(
config
.
Id
,
equip
);
BoxMap
.
Add
(
config
.
DeviceID
,
equip
);
BoxConfigMap
.
Add
(
config
.
Id
,
config
);
BoxConfigMap
.
Add
(
config
.
DeviceID
,
config
);
}
}
IOManager
.
Init
();
IOManager
.
Init
();
...
@@ -76,10 +76,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -76,10 +76,13 @@ namespace OnlineStore.DeviceLibrary
addLastDI
(
IO_Type
.
Airpressure_Check
,
IOValue
(
IO_Type
.
Airpressure_Check
));
addLastDI
(
IO_Type
.
Airpressure_Check
,
IOValue
(
IO_Type
.
Airpressure_Check
));
addLastDI
(
IO_Type
.
SuddenStop_BTN
,
IOValue
(
IO_Type
.
SuddenStop_BTN
));
addLastDI
(
IO_Type
.
SuddenStop_BTN
,
IOValue
(
IO_Type
.
SuddenStop_BTN
));
addLastDI
(
IO_Type
.
Reset_BTN
,
IOValue
(
IO_Type
.
Reset_BTN
));
addLastDI
(
IO_Type
.
Reset_BTN
,
IOValue
(
IO_Type
.
Reset_BTN
));
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
mainTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
IoCheckTimer
.
Enabled
=
true
;
IoCheckTimer
.
Enabled
=
true
;
canStart
=
true
;
canStart
=
true
;
});
});
}
}
...
...
source/DeviceLibrary/ACPackingStore/StoreManager.cs
查看文件 @
0fbcb89
...
@@ -85,10 +85,26 @@ namespace OnlineStore.DeviceLibrary
...
@@ -85,10 +85,26 @@ namespace OnlineStore.DeviceLibrary
{
{
string
nameStr
=
i
.
ToString
().
PadLeft
(
1
,
'0'
);
string
nameStr
=
i
.
ToString
().
PadLeft
(
1
,
'0'
);
string
config
=
appPath
+
moveEquipConfig
.
Replace
(
".csv"
,
"_"
+
nameStr
+
".csv"
);
string
config
=
appPath
+
moveEquipConfig
.
Replace
(
".csv"
,
"_"
+
nameStr
+
".csv"
);
AC_BOX_Config
moveConfig
=
CSVConfigReader
.
LoadBoxConfig
(
i
,
CID
+
"_"
+
i
,
"BOX"
,
config
);
string
storeIdConfig
=
Setting_Init
.
Store_CID
+
"_"
+
i
;
string
boxCid
=
ConfigAppSettings
.
GetValue
(
storeIdConfig
);
AC_BOX_Config
moveConfig
=
CSVConfigReader
.
LoadBoxConfig
(
i
,
boxCid
,
"BOX"
,
config
);
AllConfigMap
.
Add
(
i
,
moveConfig
);
AllConfigMap
.
Add
(
i
,
moveConfig
);
storeConfig
.
Add
(
i
,
moveConfig
);
storeConfig
.
Add
(
i
,
moveConfig
);
}
}
string
positionConfigFile
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_Position_Config
);
if
(
count
>
1
||
(!
File
.
Exists
(
positionConfigFile
)))
{
for
(
int
i
=
1
;
i
<=
count
;
i
++)
{
string
nameStr
=
i
.
ToString
().
PadLeft
(
1
,
'0'
);
string
fileN
=
positionConfigFile
.
Replace
(
".csv"
,
"_"
+
nameStr
+
".csv"
);
CSVPositionReader
<
ACBoxPosition
>.
AddCSVFile
(
fileN
);
}
}
else
{
CSVPositionReader
<
ACBoxPosition
>.
AddCSVFile
(
positionConfigFile
);
}
LogUtil
.
info
(
LOGGER
,
"加载料仓完成!"
);
LogUtil
.
info
(
LOGGER
,
"加载料仓完成!"
);
}
}
...
@@ -112,16 +128,18 @@ namespace OnlineStore.DeviceLibrary
...
@@ -112,16 +128,18 @@ namespace OnlineStore.DeviceLibrary
try
try
{
{
//位置配置到文件中
//位置配置到文件中
string
appPath
=
Application
.
StartupPath
;
string
appPath
=
Application
.
StartupPath
;
string
configFile
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
BOX_ConfigPath
);
string
configFile
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
BOX_ConfigPath
);
bool
result
=
CSVConfigReader
.
SaveBoxPosition
(
configFile
,
storeConfig
);
bool
result
=
CSVConfigReader
.
SaveBoxPosition
(
configFile
,
storeConfig
);
if
(!
result
)
if
(!
result
)
{
{
LOGGER
.
Error
(
"保存配置文件失败:"
+
configFile
);
LOGGER
.
Error
(
"保存配置文件失败:"
+
configFile
);
}
}
//Store.Config = storeConfig;
AllConfigMap
[
storeConfig
.
DeviceID
]
=
storeConfig
;
//Store.MoveAxisConfig();
Store
.
BoxConfigMap
[
storeConfig
.
DeviceID
]
=
storeConfig
;
Store
.
BoxMap
[
storeConfig
.
DeviceID
].
Config
=
storeConfig
;
Store
.
BoxMap
[
storeConfig
.
DeviceID
].
MoveAxisConfig
();
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
0fbcb89
...
@@ -107,7 +107,10 @@
...
@@ -107,7 +107,10 @@
</ItemGroup>
</ItemGroup>
<ItemGroup />
<ItemGroup />
<ItemGroup>
<ItemGroup>
<None Include="StoreConfig\linePositions.csv">
<None Include="StoreConfig\linePositions_2.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\linePositions_1.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</None>
<None Include="StoreConfig\StoreConfig.csv">
<None Include="StoreConfig\StoreConfig.csv">
...
...
source/DeviceLibrary/StoreConfig/BoxConfig_1.csv
查看文件 @
0fbcb89
...
@@ -119,3 +119,5 @@ PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
...
@@ -119,3 +119,5 @@ PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
PRO,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
PRO,是否是调试状态,IsInDebug,1,,,,,,,
source/DeviceLibrary/StoreConfig/BoxConfig_2.csv
查看文件 @
0fbcb89
...
@@ -121,3 +121,6 @@ PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
...
@@ -121,3 +121,6 @@ PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
PRO,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
PRO,是否是调试状态,IsInDebug,1,,,,,,,
source/DeviceLibrary/StoreConfig/linePositions.csv
deleted
100644 → 0
查看文件 @
03e70b2
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/StoreConfig/linePositions_1.csv
0 → 100644
查看文件 @
0fbcb89
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/StoreConfig/linePositions_2.csv
0 → 100644
查看文件 @
0fbcb89
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/store/InOrOutStoreParam.cs
查看文件 @
0fbcb89
...
@@ -64,15 +64,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -64,15 +64,15 @@ namespace OnlineStore.DeviceLibrary
// IsSolderPaste = false;
// IsSolderPaste = false;
//}
//}
private
AC
Store
Position
ACStoreP
=
null
;
private
AC
Box
Position
ACStoreP
=
null
;
public
AC
Store
Position
GetACPosition
()
public
AC
Box
Position
GetACPosition
()
{
{
try
try
{
{
if
(
ACStoreP
==
null
)
if
(
ACStoreP
==
null
)
{
{
ACStoreP
=
CSVPositionReader
<
AC
Store
Position
>.
GetPositon
(
PositionNum
);
ACStoreP
=
CSVPositionReader
<
AC
Box
Position
>.
GetPositon
(
PositionNum
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
...
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
0fbcb89
...
@@ -466,11 +466,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -466,11 +466,11 @@ namespace OnlineStore.DeviceLibrary
}
}
public
void
IOMove
(
string
IoType
,
IO_VALUE
value
)
public
void
IOMove
(
string
IoType
,
IO_VALUE
value
)
{
{
IOManager
.
IOMove
(
IoType
,
value
,
baseConfig
.
Id
);
IOManager
.
IOMove
(
IoType
,
value
,
baseConfig
.
DeviceID
);
}
}
public
IO_VALUE
IOValue
(
string
IoType
)
public
IO_VALUE
IOValue
(
string
IoType
)
{
{
return
IOManager
.
IOValue
(
IoType
,
baseConfig
.
Id
);
return
IOManager
.
IOValue
(
IoType
,
baseConfig
.
DeviceID
);
}
}
public
void
LogInfo
(
string
logInfo
)
public
void
LogInfo
(
string
logInfo
)
...
...
source/LoadCVSLibrary/LoadCSVLibrary.csproj
查看文件 @
0fbcb89
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile Include="CSVExection.cs" />
<Compile Include="CSVExection.cs" />
<Compile Include="position\AC
SAStore
Position.cs" />
<Compile Include="position\AC
Box
Position.cs" />
<Compile Include="storeConfig\ConfigItemBase.cs" />
<Compile Include="storeConfig\ConfigItemBase.cs" />
<Compile Include="storeConfig\ConfigProAttribute.cs" />
<Compile Include="storeConfig\ConfigProAttribute.cs" />
<Compile Include="storeConfig\config\Store_Config.cs" />
<Compile Include="storeConfig\config\Store_Config.cs" />
...
...
source/LoadCVSLibrary/position/AC
SAStore
Position.cs
→
source/LoadCVSLibrary/position/AC
Box
Position.cs
查看文件 @
0fbcb89
...
@@ -10,7 +10,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -10,7 +10,7 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// <summary>
/// 松下伺服485控制,单台料仓
/// 松下伺服485控制,单台料仓
/// </summary>
/// </summary>
public
class
AC
Store
Position
:
StorePostionBase
public
class
AC
Box
Position
:
StorePostionBase
{
/// <summary>
{
/// <summary>
/// 对应的料仓ID(流水线料仓需要用此字段区分哪个BOX)
/// 对应的料仓ID(流水线料仓需要用此字段区分哪个BOX)
/// </summary>
/// </summary>
...
@@ -67,7 +67,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -67,7 +67,7 @@ namespace OnlineStore.LoadCSVLibrary
[
CSVAttribute
(
"进出轴进料口取料点P2"
)]
[
CSVAttribute
(
"进出轴进料口取料点P2"
)]
public
int
InOutAxis_DoorPosition_P2
{
get
;
set
;
}
public
int
InOutAxis_DoorPosition_P2
{
get
;
set
;
}
public
static
bool
CheckPosition
(
AC
Store
Position
position
,
AC_BOX_Config
Config
)
public
static
bool
CheckPosition
(
AC
Box
Position
position
,
AC_BOX_Config
Config
)
{
{
try
try
{
{
...
...
source/LoadCVSLibrary/storeConfig/config/AC_Box_Config.cs
查看文件 @
0fbcb89
...
@@ -435,7 +435,37 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -435,7 +435,37 @@ namespace OnlineStore.LoadCSVLibrary
[
ConfigProAttribute
(
"Humiture_Port"
,
true
)]
[
ConfigProAttribute
(
"Humiture_Port"
,
true
)]
public
string
Humiture_Port
{
get
;
set
;
}
public
string
Humiture_Port
{
get
;
set
;
}
/// <summary>
/// PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
/// </summary>
[
ConfigProAttribute
(
"CameraNameList"
)]
public
string
CameraNameList
{
get
;
set
;
}
/// <summary>
/// PRO,是否是调试状态,IsInDebug,1,,,,,,,
/// </summary>
[
ConfigProAttribute
(
"IsInDebug"
)]
public
int
IsInDebug
{
get
;
set
;
}
private
List
<
string
>
CameraList
=
null
;
public
List
<
string
>
GetCameraList
()
{
if
(
CameraList
==
null
)
{
CameraList
=
new
List
<
string
>();
string
[]
arrayList
=
CameraNameList
.
Split
(
'#'
);
foreach
(
string
str
in
arrayList
)
{
string
camera
=
str
.
Trim
();
if
(
string
.
IsNullOrEmpty
(
camera
).
Equals
(
false
))
{
CameraList
.
Add
(
camera
);
}
}
}
return
CameraList
;
}
protected
override
void
initMustHavePro
()
protected
override
void
initMustHavePro
()
{
{
//MustHaveDIList = new List<string>();
//MustHaveDIList = new List<string>();
...
...
source/LoadCVSLibrary/storeConfig/config/BaseConfig.cs
查看文件 @
0fbcb89
...
@@ -16,7 +16,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -16,7 +16,7 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// <summary>
/// ID
/// ID
/// </summary>
/// </summary>
public
int
Id
{
get
;
set
;
}
public
int
DeviceID
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 编号,与服务器通信的唯一标识
/// 编号,与服务器通信的唯一标识
/// </summary>
/// </summary>
...
@@ -72,7 +72,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -72,7 +72,7 @@ namespace OnlineStore.LoadCSVLibrary
initMustHavePro
();
initMustHavePro
();
MustHaveDIList
=
new
List
<
string
>();
MustHaveDIList
=
new
List
<
string
>();
MustHaveDOList
=
new
List
<
string
>();
MustHaveDOList
=
new
List
<
string
>();
this
.
Id
=
id
;
this
.
DeviceID
=
id
;
this
.
CID
=
cid
;
this
.
CID
=
cid
;
this
.
StoreType
=
type
;
this
.
StoreType
=
type
;
this
.
ConfigFilePath
=
filepath
;
this
.
ConfigFilePath
=
filepath
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论