Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-ACPackingStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit eddd82d2
由
LN
编写于
2020-04-10 11:11:06 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
日志修改
1 个父辈
13d111d8
显示空白字符变更
内嵌
并排
正在显示
29 个修改的文件
包含
168 行增加
和
214 行删除
source/ACPackingStore/FrmAxisDebug.cs
source/ACPackingStore/FrmBox.Designer.cs
source/ACPackingStore/FrmBox.cs
source/ACPackingStore/FrmIOStatus.cs
source/ACPackingStore/FrmStore.Designer.cs
source/ACPackingStore/FrmStore.cs
source/ACPackingStore/Program.cs
source/Common/Common.csproj
source/Common/util/AcSerialBean.cs
source/Common/util/ConfigAppSettings.cs
source/Common/util/HttpHelper.cs
source/Common/util/HumitureController.cs
source/Common/util/HumitureServer.cs
source/Common/util/LogUtil.cs
source/Common/util/NetTCPServer.cs
source/Common/util/ScanCodeManager.cs
source/Common/util/TcpClient.cs
source/Common/util/TcpServer.cs
source/Common/util/UdpServer.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Shelf.cs
source/DeviceLibrary/ACPackingStore/StoreManager.cs
source/DeviceLibrary/agvClient/AgvClient.cs
source/DeviceLibrary/device/IO/AIOBOX/AIOBOXManager.cs
source/DeviceLibrary/store/InOutParam.cs
source/LoadCVSLibrary/CSVReaderBase.cs
source/LoadCVSLibrary/position/CSVPositionReader.cs
source/LoadCVSLibrary/storeConfig/CSVConfigReader.cs
source/LoadCVSLibrary/storeConfig/ConfigItemBase.cs
source/ACPackingStore/FrmAxisDebug.cs
查看文件 @
eddd82d
...
@@ -26,7 +26,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -26,7 +26,7 @@ namespace OnlineStore.ACPackingStore
private
ConfigMoveAxis
comp
=
null
;
private
ConfigMoveAxis
comp
=
null
;
//private int compress_Slv = 0;
//private int compress_Slv = 0;
private
AC_BOX_Bean
boxBean
=
null
;
private
AC_BOX_Bean
boxBean
=
null
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public
FrmAxisDebug
(
AC_BOX_Bean
boxBean
)
public
FrmAxisDebug
(
AC_BOX_Bean
boxBean
)
{
{
middle
=
boxBean
.
Config
.
Middle_Axis
;
middle
=
boxBean
.
Config
.
Middle_Axis
;
...
@@ -43,7 +43,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -43,7 +43,7 @@ namespace OnlineStore.ACPackingStore
private
void
AxisMove
(
ConfigMoveAxis
axis
,
int
speed
)
private
void
AxisMove
(
ConfigMoveAxis
axis
,
int
speed
)
{
{
LogUtil
.
debug
(
LOGGER
,
"点动:deviceName="
+
axis
.
DeviceName
+
",axis="
+
axis
.
GetAxisValue
()
+
",speed="
+
speed
);
LogUtil
.
debug
(
"点动:deviceName="
+
axis
.
DeviceName
+
",axis="
+
axis
.
GetAxisValue
()
+
",speed="
+
speed
);
ACServerManager
.
SpeedMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
speed
);
ACServerManager
.
SpeedMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
speed
);
}
}
...
...
source/ACPackingStore/FrmBox.Designer.cs
查看文件 @
eddd82d
...
@@ -365,7 +365,7 @@
...
@@ -365,7 +365,7 @@
this
.
panel1
.
Controls
.
Add
(
this
.
btnSotreReset
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnSotreReset
);
this
.
panel1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
2
);
this
.
panel1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
2
);
this
.
panel1
.
Name
=
"panel1"
;
this
.
panel1
.
Name
=
"panel1"
;
this
.
panel1
.
Size
=
new
System
.
Drawing
.
Size
(
13
0
8
,
47
);
this
.
panel1
.
Size
=
new
System
.
Drawing
.
Size
(
13
1
8
,
47
);
this
.
panel1
.
TabIndex
=
273
;
this
.
panel1
.
TabIndex
=
273
;
//
//
// btnUpdown
// btnUpdown
...
@@ -488,7 +488,7 @@
...
@@ -488,7 +488,7 @@
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
52
);
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
52
);
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
SelectedIndex
=
0
;
this
.
tabControl1
.
SelectedIndex
=
0
;
this
.
tabControl1
.
Size
=
new
System
.
Drawing
.
Size
(
13
09
,
52
1
);
this
.
tabControl1
.
Size
=
new
System
.
Drawing
.
Size
(
13
19
,
57
1
);
this
.
tabControl1
.
TabIndex
=
272
;
this
.
tabControl1
.
TabIndex
=
272
;
//
//
// tabPage4
// tabPage4
...
@@ -497,7 +497,7 @@
...
@@ -497,7 +497,7 @@
this
.
tabPage4
.
Controls
.
Add
(
this
.
groupBox3
);
this
.
tabPage4
.
Controls
.
Add
(
this
.
groupBox3
);
this
.
tabPage4
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
29
);
this
.
tabPage4
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
29
);
this
.
tabPage4
.
Name
=
"tabPage4"
;
this
.
tabPage4
.
Name
=
"tabPage4"
;
this
.
tabPage4
.
Size
=
new
System
.
Drawing
.
Size
(
13
01
,
48
8
);
this
.
tabPage4
.
Size
=
new
System
.
Drawing
.
Size
(
13
11
,
53
8
);
this
.
tabPage4
.
TabIndex
=
3
;
this
.
tabPage4
.
TabIndex
=
3
;
this
.
tabPage4
.
Text
=
" 状态信息 "
;
this
.
tabPage4
.
Text
=
" 状态信息 "
;
this
.
tabPage4
.
UseVisualStyleBackColor
=
true
;
this
.
tabPage4
.
UseVisualStyleBackColor
=
true
;
...
@@ -552,9 +552,9 @@
...
@@ -552,9 +552,9 @@
this
.
groupInout
.
Controls
.
Add
(
this
.
btnUpDownP3
);
this
.
groupInout
.
Controls
.
Add
(
this
.
btnUpDownP3
);
this
.
groupInout
.
Controls
.
Add
(
this
.
btnUpDownP4
);
this
.
groupInout
.
Controls
.
Add
(
this
.
btnUpDownP4
);
this
.
groupInout
.
Enabled
=
false
;
this
.
groupInout
.
Enabled
=
false
;
this
.
groupInout
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
1
27
);
this
.
groupInout
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
1
64
);
this
.
groupInout
.
Name
=
"groupInout"
;
this
.
groupInout
.
Name
=
"groupInout"
;
this
.
groupInout
.
Size
=
new
System
.
Drawing
.
Size
(
1
291
,
353
);
this
.
groupInout
.
Size
=
new
System
.
Drawing
.
Size
(
1
304
,
362
);
this
.
groupInout
.
TabIndex
=
100
;
this
.
groupInout
.
TabIndex
=
100
;
this
.
groupInout
.
TabStop
=
false
;
this
.
groupInout
.
TabStop
=
false
;
this
.
groupInout
.
Text
=
"料仓操作"
;
this
.
groupInout
.
Text
=
"料仓操作"
;
...
@@ -1540,7 +1540,7 @@
...
@@ -1540,7 +1540,7 @@
this
.
groupBox3
.
Controls
.
Add
(
this
.
chbDebug
);
this
.
groupBox3
.
Controls
.
Add
(
this
.
chbDebug
);
this
.
groupBox3
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
groupBox3
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
groupBox3
.
Name
=
"groupBox3"
;
this
.
groupBox3
.
Name
=
"groupBox3"
;
this
.
groupBox3
.
Size
=
new
System
.
Drawing
.
Size
(
1
291
,
121
);
this
.
groupBox3
.
Size
=
new
System
.
Drawing
.
Size
(
1
304
,
154
);
this
.
groupBox3
.
TabIndex
=
268
;
this
.
groupBox3
.
TabIndex
=
268
;
this
.
groupBox3
.
TabStop
=
false
;
this
.
groupBox3
.
TabStop
=
false
;
this
.
groupBox3
.
Text
=
"设备状态"
;
this
.
groupBox3
.
Text
=
"设备状态"
;
...
@@ -1549,7 +1549,7 @@
...
@@ -1549,7 +1549,7 @@
//
//
this
.
lblMoveInfo
.
AutoSize
=
true
;
this
.
lblMoveInfo
.
AutoSize
=
true
;
this
.
lblMoveInfo
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblMoveInfo
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblMoveInfo
.
Location
=
new
System
.
Drawing
.
Point
(
9
65
,
13
);
this
.
lblMoveInfo
.
Location
=
new
System
.
Drawing
.
Point
(
9
92
,
60
);
this
.
lblMoveInfo
.
Name
=
"lblMoveInfo"
;
this
.
lblMoveInfo
.
Name
=
"lblMoveInfo"
;
this
.
lblMoveInfo
.
Size
=
new
System
.
Drawing
.
Size
(
56
,
17
);
this
.
lblMoveInfo
.
Size
=
new
System
.
Drawing
.
Size
(
56
,
17
);
this
.
lblMoveInfo
.
TabIndex
=
269
;
this
.
lblMoveInfo
.
TabIndex
=
269
;
...
@@ -1559,11 +1559,11 @@
...
@@ -1559,11 +1559,11 @@
//
//
this
.
lblTemp
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
lblTemp
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
lblTemp
.
AutoSize
=
true
;
this
.
lblTemp
.
AutoSize
=
true
;
this
.
lblTemp
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5
F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblTemp
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9
F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblTemp
.
ForeColor
=
System
.
Drawing
.
Color
.
Black
;
this
.
lblTemp
.
ForeColor
=
System
.
Drawing
.
Color
.
Black
;
this
.
lblTemp
.
Location
=
new
System
.
Drawing
.
Point
(
639
,
14
);
this
.
lblTemp
.
Location
=
new
System
.
Drawing
.
Point
(
375
,
16
);
this
.
lblTemp
.
Name
=
"lblTemp"
;
this
.
lblTemp
.
Name
=
"lblTemp"
;
this
.
lblTemp
.
Size
=
new
System
.
Drawing
.
Size
(
1
59
,
20
);
this
.
lblTemp
.
Size
=
new
System
.
Drawing
.
Size
(
1
36
,
17
);
this
.
lblTemp
.
TabIndex
=
270
;
this
.
lblTemp
.
TabIndex
=
270
;
this
.
lblTemp
.
Text
=
"当前温度--,当前湿度--"
;
this
.
lblTemp
.
Text
=
"当前温度--,当前湿度--"
;
//
//
...
@@ -1572,7 +1572,7 @@
...
@@ -1572,7 +1572,7 @@
this
.
lblMoveEquipInfo
.
AutoSize
=
true
;
this
.
lblMoveEquipInfo
.
AutoSize
=
true
;
this
.
lblMoveEquipInfo
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Bold
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblMoveEquipInfo
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Bold
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblMoveEquipInfo
.
ForeColor
=
System
.
Drawing
.
Color
.
Blue
;
this
.
lblMoveEquipInfo
.
ForeColor
=
System
.
Drawing
.
Color
.
Blue
;
this
.
lblMoveEquipInfo
.
Location
=
new
System
.
Drawing
.
Point
(
221
,
14
);
this
.
lblMoveEquipInfo
.
Location
=
new
System
.
Drawing
.
Point
(
13
,
39
);
this
.
lblMoveEquipInfo
.
Name
=
"lblMoveEquipInfo"
;
this
.
lblMoveEquipInfo
.
Name
=
"lblMoveEquipInfo"
;
this
.
lblMoveEquipInfo
.
Size
=
new
System
.
Drawing
.
Size
(
65
,
19
);
this
.
lblMoveEquipInfo
.
Size
=
new
System
.
Drawing
.
Size
(
65
,
19
);
this
.
lblMoveEquipInfo
.
TabIndex
=
272
;
this
.
lblMoveEquipInfo
.
TabIndex
=
272
;
...
@@ -1584,9 +1584,9 @@
...
@@ -1584,9 +1584,9 @@
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
lblWarnMsg
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblWarnMsg
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblWarnMsg
.
ForeColor
=
System
.
Drawing
.
Color
.
Red
;
this
.
lblWarnMsg
.
ForeColor
=
System
.
Drawing
.
Color
.
Red
;
this
.
lblWarnMsg
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
38
);
this
.
lblWarnMsg
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
75
);
this
.
lblWarnMsg
.
Name
=
"lblWarnMsg"
;
this
.
lblWarnMsg
.
Name
=
"lblWarnMsg"
;
this
.
lblWarnMsg
.
Size
=
new
System
.
Drawing
.
Size
(
9
39
,
77
);
this
.
lblWarnMsg
.
Size
=
new
System
.
Drawing
.
Size
(
9
52
,
74
);
this
.
lblWarnMsg
.
TabIndex
=
224
;
this
.
lblWarnMsg
.
TabIndex
=
224
;
this
.
lblWarnMsg
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
this
.
lblWarnMsg
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
//
...
@@ -1595,7 +1595,7 @@
...
@@ -1595,7 +1595,7 @@
this
.
lblThisSta
.
AutoSize
=
true
;
this
.
lblThisSta
.
AutoSize
=
true
;
this
.
lblThisSta
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Bold
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblThisSta
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Bold
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblThisSta
.
ForeColor
=
System
.
Drawing
.
Color
.
Green
;
this
.
lblThisSta
.
ForeColor
=
System
.
Drawing
.
Color
.
Green
;
this
.
lblThisSta
.
Location
=
new
System
.
Drawing
.
Point
(
1
4
,
14
);
this
.
lblThisSta
.
Location
=
new
System
.
Drawing
.
Point
(
1
3
,
15
);
this
.
lblThisSta
.
Name
=
"lblThisSta"
;
this
.
lblThisSta
.
Name
=
"lblThisSta"
;
this
.
lblThisSta
.
Size
=
new
System
.
Drawing
.
Size
(
65
,
19
);
this
.
lblThisSta
.
Size
=
new
System
.
Drawing
.
Size
(
65
,
19
);
this
.
lblThisSta
.
TabIndex
=
216
;
this
.
lblThisSta
.
TabIndex
=
216
;
...
@@ -1606,7 +1606,7 @@
...
@@ -1606,7 +1606,7 @@
this
.
chbDebug
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
chbDebug
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
chbDebug
.
AutoSize
=
true
;
this
.
chbDebug
.
AutoSize
=
true
;
this
.
chbDebug
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbDebug
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbDebug
.
Location
=
new
System
.
Drawing
.
Point
(
855
,
12
);
this
.
chbDebug
.
Location
=
new
System
.
Drawing
.
Point
(
1168
,
16
);
this
.
chbDebug
.
Name
=
"chbDebug"
;
this
.
chbDebug
.
Name
=
"chbDebug"
;
this
.
chbDebug
.
Size
=
new
System
.
Drawing
.
Size
(
93
,
25
);
this
.
chbDebug
.
Size
=
new
System
.
Drawing
.
Size
(
93
,
25
);
this
.
chbDebug
.
TabIndex
=
271
;
this
.
chbDebug
.
TabIndex
=
271
;
...
@@ -1622,7 +1622,7 @@
...
@@ -1622,7 +1622,7 @@
this
.
tabPage1
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
29
);
this
.
tabPage1
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
29
);
this
.
tabPage1
.
Name
=
"tabPage1"
;
this
.
tabPage1
.
Name
=
"tabPage1"
;
this
.
tabPage1
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage1
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage1
.
Size
=
new
System
.
Drawing
.
Size
(
13
01
,
48
8
);
this
.
tabPage1
.
Size
=
new
System
.
Drawing
.
Size
(
13
11
,
53
8
);
this
.
tabPage1
.
TabIndex
=
0
;
this
.
tabPage1
.
TabIndex
=
0
;
this
.
tabPage1
.
Text
=
" 伺服/温湿度 "
;
this
.
tabPage1
.
Text
=
" 伺服/温湿度 "
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
...
@@ -1844,7 +1844,7 @@
...
@@ -1844,7 +1844,7 @@
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Dpi
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Dpi
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
13
14
,
57
6
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
13
24
,
62
6
);
this
.
Controls
.
Add
(
this
.
panel1
);
this
.
Controls
.
Add
(
this
.
panel1
);
this
.
Controls
.
Add
(
this
.
tabControl1
);
this
.
Controls
.
Add
(
this
.
tabControl1
);
this
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
...
...
source/ACPackingStore/FrmBox.cs
查看文件 @
eddd82d
...
@@ -24,7 +24,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -24,7 +24,7 @@ namespace OnlineStore.ACPackingStore
{
{
public
AC_BOX_Bean
BoxBean
=
null
;
public
AC_BOX_Bean
BoxBean
=
null
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public
FrmBox
()
public
FrmBox
()
{
{
Control
.
CheckForIllegalCrossThreadCalls
=
false
;
Control
.
CheckForIllegalCrossThreadCalls
=
false
;
...
@@ -49,7 +49,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -49,7 +49,7 @@ namespace OnlineStore.ACPackingStore
{
{
if
(
BoxBean
==
null
)
if
(
BoxBean
==
null
)
{
{
LogUtil
.
error
(
LOGGER
,
"找不到对应的料仓"
);
LogUtil
.
error
(
"找不到对应的料仓"
);
this
.
Close
();
this
.
Close
();
return
;
return
;
}
}
...
@@ -611,7 +611,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -611,7 +611,7 @@ namespace OnlineStore.ACPackingStore
string
poText
=
cmbPosition
.
Text
;
string
poText
=
cmbPosition
.
Text
;
BoxBean
.
AutoInout
.
autoMsg
=
"自动出库:"
+
poText
;
BoxBean
.
AutoInout
.
autoMsg
=
"自动出库:"
+
poText
;
LogUtil
.
info
(
LOGGER
,
BoxBean
.
Name
+
"开启自动出入库模式,开始位置【"
+
poText
+
"】(索引="
+
currIndex
+
"),间隔="
+
jiange
+
",入库开始!"
);
LogUtil
.
info
(
BoxBean
.
Name
+
"开启自动出入库模式,开始位置【"
+
poText
+
"】(索引="
+
currIndex
+
"),间隔="
+
jiange
+
",入库开始!"
);
//BoxBean.StartOutStoreMove(new InOutStoreParam("", poText));
//BoxBean.StartOutStoreMove(new InOutStoreParam("", poText));
BoxBean
.
StartInStoreMove
(
new
InOutParam
(
""
,
poText
,
cmbShelfPosition
.
Text
));
BoxBean
.
StartInStoreMove
(
new
InOutParam
(
""
,
poText
,
cmbShelfPosition
.
Text
));
...
@@ -658,7 +658,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -658,7 +658,7 @@ namespace OnlineStore.ACPackingStore
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
"出错:"
+
ex
.
StackTrace
);
LogUtil
.
error
(
"出错:"
+
ex
.
StackTrace
);
}
}
}
}
...
...
source/ACPackingStore/FrmIOStatus.cs
查看文件 @
eddd82d
...
@@ -24,7 +24,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -24,7 +24,7 @@ namespace OnlineStore.ACPackingStore
{
{
private
int
StoreId
=
1
;
private
int
StoreId
=
1
;
private
AC_BOX_Bean
boxBean
;
private
AC_BOX_Bean
boxBean
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public
FrmIOStatus
()
public
FrmIOStatus
()
{
{
Control
.
CheckForIllegalCrossThreadCalls
=
false
;
Control
.
CheckForIllegalCrossThreadCalls
=
false
;
...
@@ -100,7 +100,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -100,7 +100,7 @@ namespace OnlineStore.ACPackingStore
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
MessageBox
.
Show
(
ex
.
StackTrace
,
"Exception(异常)"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
MessageBox
.
Show
(
ex
.
StackTrace
,
"Exception(异常)"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
LogUtil
.
error
(
LOGGER
,
ex
.
StackTrace
);
LogUtil
.
error
(
ex
.
StackTrace
);
}
}
}
}
...
...
source/ACPackingStore/FrmStore.Designer.cs
查看文件 @
eddd82d
...
@@ -32,6 +32,8 @@
...
@@ -32,6 +32,8 @@
System
.
ComponentModel
.
ComponentResourceManager
resources
=
new
System
.
ComponentModel
.
ComponentResourceManager
(
typeof
(
FrmStore
));
System
.
ComponentModel
.
ComponentResourceManager
resources
=
new
System
.
ComponentModel
.
ComponentResourceManager
(
typeof
(
FrmStore
));
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
lblServerMsg
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
chbAGV
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
groupBox4
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox4
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
tableLayoutPanel2
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
tableLayoutPanel2
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
groupBox3
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox3
=
new
System
.
Windows
.
Forms
.
GroupBox
();
...
@@ -70,7 +72,6 @@
...
@@ -70,7 +72,6 @@
this
.
toolStripSeparator8
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
toolStripSeparator8
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
toolStripMenuItem1
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripMenuItem1
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
chbAGV
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
...
@@ -98,6 +99,7 @@
...
@@ -98,6 +99,7 @@
//
//
// tabPage1
// tabPage1
//
//
this
.
tabPage1
.
Controls
.
Add
(
this
.
lblServerMsg
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
chbAGV
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
chbAGV
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
groupBox4
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
groupBox4
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
groupBox3
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
groupBox3
);
...
@@ -116,6 +118,29 @@
...
@@ -116,6 +118,29 @@
this
.
tabPage1
.
Text
=
" 日志信息 "
;
this
.
tabPage1
.
Text
=
" 日志信息 "
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
//
//
// lblServerMsg
//
this
.
lblServerMsg
.
AutoSize
=
true
;
this
.
lblServerMsg
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblServerMsg
.
Location
=
new
System
.
Drawing
.
Point
(
261
,
20
);
this
.
lblServerMsg
.
Name
=
"lblServerMsg"
;
this
.
lblServerMsg
.
Size
=
new
System
.
Drawing
.
Size
(
0
,
17
);
this
.
lblServerMsg
.
TabIndex
=
201
;
//
// chbAGV
//
this
.
chbAGV
.
AutoSize
=
true
;
this
.
chbAGV
.
Checked
=
true
;
this
.
chbAGV
.
CheckState
=
System
.
Windows
.
Forms
.
CheckState
.
Checked
;
this
.
chbAGV
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbAGV
.
Location
=
new
System
.
Drawing
.
Point
(
36
,
470
);
this
.
chbAGV
.
Name
=
"chbAGV"
;
this
.
chbAGV
.
Size
=
new
System
.
Drawing
.
Size
(
138
,
24
);
this
.
chbAGV
.
TabIndex
=
200
;
this
.
chbAGV
.
Text
=
"AGV cancelState"
;
this
.
chbAGV
.
UseVisualStyleBackColor
=
true
;
this
.
chbAGV
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
chbAGV_CheckedChanged
);
//
// groupBox4
// groupBox4
//
//
this
.
groupBox4
.
Controls
.
Add
(
this
.
tableLayoutPanel2
);
this
.
groupBox4
.
Controls
.
Add
(
this
.
tableLayoutPanel2
);
...
@@ -258,9 +283,9 @@
...
@@ -258,9 +283,9 @@
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
logBox
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
logBox
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
logBox
.
Location
=
new
System
.
Drawing
.
Point
(
241
,
3
);
this
.
logBox
.
Location
=
new
System
.
Drawing
.
Point
(
241
,
88
);
this
.
logBox
.
Name
=
"logBox"
;
this
.
logBox
.
Name
=
"logBox"
;
this
.
logBox
.
Size
=
new
System
.
Drawing
.
Size
(
1085
,
633
);
this
.
logBox
.
Size
=
new
System
.
Drawing
.
Size
(
1085
,
531
);
this
.
logBox
.
TabIndex
=
106
;
this
.
logBox
.
TabIndex
=
106
;
this
.
logBox
.
Text
=
""
;
this
.
logBox
.
Text
=
""
;
this
.
logBox
.
VisibleChanged
+=
new
System
.
EventHandler
(
this
.
logBox_VisibleChanged
);
this
.
logBox
.
VisibleChanged
+=
new
System
.
EventHandler
(
this
.
logBox_VisibleChanged
);
...
@@ -462,20 +487,6 @@
...
@@ -462,20 +487,6 @@
this
.
timer1
.
Interval
=
1000
;
this
.
timer1
.
Interval
=
1000
;
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
//
// chbAGV
//
this
.
chbAGV
.
AutoSize
=
true
;
this
.
chbAGV
.
Checked
=
true
;
this
.
chbAGV
.
CheckState
=
System
.
Windows
.
Forms
.
CheckState
.
Checked
;
this
.
chbAGV
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbAGV
.
Location
=
new
System
.
Drawing
.
Point
(
36
,
470
);
this
.
chbAGV
.
Name
=
"chbAGV"
;
this
.
chbAGV
.
Size
=
new
System
.
Drawing
.
Size
(
138
,
24
);
this
.
chbAGV
.
TabIndex
=
200
;
this
.
chbAGV
.
Text
=
"AGV cancelState"
;
this
.
chbAGV
.
UseVisualStyleBackColor
=
true
;
this
.
chbAGV
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
chbAGV_CheckedChanged
);
//
// FrmStore
// FrmStore
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
@@ -551,6 +562,7 @@
...
@@ -551,6 +562,7 @@
private
System
.
Windows
.
Forms
.
GroupBox
groupBox3
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox3
;
private
System
.
Windows
.
Forms
.
TableLayoutPanel
tableLayoutPanel1
;
private
System
.
Windows
.
Forms
.
TableLayoutPanel
tableLayoutPanel1
;
private
System
.
Windows
.
Forms
.
CheckBox
chbAGV
;
private
System
.
Windows
.
Forms
.
CheckBox
chbAGV
;
private
System
.
Windows
.
Forms
.
Label
lblServerMsg
;
}
}
}
}
source/ACPackingStore/FrmStore.cs
查看文件 @
eddd82d
...
@@ -21,7 +21,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -21,7 +21,7 @@ namespace OnlineStore.ACPackingStore
internal
partial
class
FrmStore
:
Form
internal
partial
class
FrmStore
:
Form
{
{
internal
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
internal static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public
static
PackingStoreBean
store
=
null
;
public
static
PackingStoreBean
store
=
null
;
private
List
<
TabPage
>
tabPageList
=
new
List
<
TabPage
>();
private
List
<
TabPage
>
tabPageList
=
new
List
<
TabPage
>();
private
bool
LoadOk
=
false
;
private
bool
LoadOk
=
false
;
...
@@ -182,7 +182,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -182,7 +182,7 @@ namespace OnlineStore.ACPackingStore
//如果料仓还在运行状态,先关闭料仓
//如果料仓还在运行状态,先关闭料仓
if
(!
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
if
(!
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
{
LogUtil
.
info
(
LOGGER
,
"ExitApp 停止"
+
store
.
Name
+
"运行 "
);
LogUtil
.
info
(
"ExitApp 停止"
+
store
.
Name
+
"运行 "
);
store
.
StopRun
();
store
.
StopRun
();
}
}
else
else
...
@@ -191,7 +191,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -191,7 +191,7 @@ namespace OnlineStore.ACPackingStore
{
{
if
(
bean
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
).
Equals
(
false
))
if
(
bean
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
).
Equals
(
false
))
{
{
LogUtil
.
info
(
LOGGER
,
"ExitApp 停止"
+
bean
.
Name
+
"运行 "
);
LogUtil
.
info
(
"ExitApp 停止"
+
bean
.
Name
+
"运行 "
);
bean
.
StopRun
();
bean
.
StopRun
();
}
}
}
}
...
@@ -240,7 +240,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -240,7 +240,7 @@ namespace OnlineStore.ACPackingStore
MessageBox
.
Show
(
store
.
Name
+
"当前状态:"
+
store
.
storeRunStatus
+
",不能启动!"
);
MessageBox
.
Show
(
store
.
Name
+
"当前状态:"
+
store
.
storeRunStatus
+
",不能启动!"
);
return
;
return
;
}
}
LogUtil
.
info
(
LOGGER
,
"开始启动"
);
LogUtil
.
info
(
"开始启动"
);
startTimer
.
Interval
=
300
;
startTimer
.
Interval
=
300
;
startTimer
.
Elapsed
+=
timer_Elapsed
;
startTimer
.
Elapsed
+=
timer_Elapsed
;
startTimer
.
AutoReset
=
false
;
startTimer
.
AutoReset
=
false
;
...
@@ -388,6 +388,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -388,6 +388,7 @@ namespace OnlineStore.ACPackingStore
{
{
return
;
return
;
}
}
lblServerMsg
.
Text
=
HttpHelper
.
LastServerMsg
;
ReadIOList
();
ReadIOList
();
string
msg
=
""
;
string
msg
=
""
;
foreach
(
AC_BOX_Bean
box
in
StoreManager
.
Store
.
BoxMap
.
Values
)
foreach
(
AC_BOX_Bean
box
in
StoreManager
.
Store
.
BoxMap
.
Values
)
...
...
source/ACPackingStore/Program.cs
查看文件 @
eddd82d
...
@@ -43,7 +43,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -43,7 +43,7 @@ namespace OnlineStore.ACPackingStore
public
static
extern
int
ShowWindow
(
IntPtr
hwnd
,
int
nCmdShow
);
public
static
extern
int
ShowWindow
(
IntPtr
hwnd
,
int
nCmdShow
);
public
const
int
SW_RESTORE
=
9
;
public
const
int
SW_RESTORE
=
9
;
public
static
IntPtr
formhwnd
;
public
static
IntPtr
formhwnd
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#
endregion
#
endregion
...
@@ -112,7 +112,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -112,7 +112,7 @@ namespace OnlineStore.ACPackingStore
static
void
LogUnhandledException
(
object
exceptionobj
)
static
void
LogUnhandledException
(
object
exceptionobj
)
{
{
//这里可以进一步地写日志
//这里可以进一步地写日志
LOGGER
.
E
rror
(
"LogUnhandledException:"
+
exceptionobj
.
ToString
());
LogUtil
.
e
rror
(
"LogUnhandledException:"
+
exceptionobj
.
ToString
());
}
}
}
}
}
}
source/Common/Common.csproj
查看文件 @
eddd82d
...
@@ -65,9 +65,6 @@
...
@@ -65,9 +65,6 @@
<Compile Include="util\MyWebClient.cs">
<Compile Include="util\MyWebClient.cs">
<SubType>Component</SubType>
<SubType>Component</SubType>
</Compile>
</Compile>
<Compile Include="util\NetTCPServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="util\ScanCodeManager.cs" />
<Compile Include="util\ScanCodeManager.cs" />
<Compile Include="util\TcpClient.cs" />
<Compile Include="util\TcpClient.cs" />
<Compile Include="util\TcpServer.cs" />
<Compile Include="util\TcpServer.cs" />
...
...
source/Common/util/AcSerialBean.cs
查看文件 @
eddd82d
...
@@ -12,7 +12,7 @@ namespace OnlineStore.Common
...
@@ -12,7 +12,7 @@ namespace OnlineStore.Common
public
class
AcSerialBean
public
class
AcSerialBean
{
{
#
region
全部变量
#
region
全部变量
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private
SerialPort
_serialPort
=
null
;
private
SerialPort
_serialPort
=
null
;
private
object
lockObj
=
new
object
();
private
object
lockObj
=
new
object
();
...
@@ -149,7 +149,7 @@ namespace OnlineStore.Common
...
@@ -149,7 +149,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
Ex
)
catch
(
Exception
Ex
)
{
{
LogUtil
.
error
(
LOGGER
,
Ex
.
ToString
());
LogUtil
.
error
(
Ex
.
ToString
());
//throw Ex;
//throw Ex;
}
}
return
ok
;
return
ok
;
...
...
source/Common/util/ConfigAppSettings.cs
查看文件 @
eddd82d
...
@@ -12,7 +12,7 @@ namespace OnlineStore.Common
...
@@ -12,7 +12,7 @@ namespace OnlineStore.Common
{
{
public
class
ConfigAppSettings
public
class
ConfigAppSettings
{
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private
static
int
seq
=
1
;
private
static
int
seq
=
1
;
...
@@ -20,7 +20,7 @@ namespace OnlineStore.Common
...
@@ -20,7 +20,7 @@ namespace OnlineStore.Common
{
{
if
(
seq
.
Equals
(
Int32
.
MaxValue
))
if
(
seq
.
Equals
(
Int32
.
MaxValue
))
{
{
L
OGGER
.
I
nfo
(
"seq当前值:"
+
seq
+
",重置seq=0"
);
L
ogUtil
.
i
nfo
(
"seq当前值:"
+
seq
+
",重置seq=0"
);
seq
=
0
;
seq
=
0
;
}
}
Interlocked
.
Increment
(
ref
seq
);
Interlocked
.
Increment
(
ref
seq
);
...
@@ -31,7 +31,7 @@ namespace OnlineStore.Common
...
@@ -31,7 +31,7 @@ namespace OnlineStore.Common
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
{
{
L
OGGER
.
E
rror
(
"未找到配置:"
+
key
+
",请检查配置是否完整!"
);
L
ogUtil
.
e
rror
(
"未找到配置:"
+
key
+
",请检查配置是否完整!"
);
return
""
;
return
""
;
}
}
else
else
...
@@ -46,7 +46,7 @@ namespace OnlineStore.Common
...
@@ -46,7 +46,7 @@ namespace OnlineStore.Common
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
{
{
L
OGGER
.
E
rror
(
"未找到配置:"
+
key
+
",请检查配置是否完整!"
);
L
ogUtil
.
e
rror
(
"未找到配置:"
+
key
+
",请检查配置是否完整!"
);
return
a
;
return
a
;
}
}
else
else
...
@@ -63,7 +63,7 @@ namespace OnlineStore.Common
...
@@ -63,7 +63,7 @@ namespace OnlineStore.Common
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
System
.
Configuration
.
Configuration
config
=
ConfigurationManager
.
OpenExeConfiguration
(
ConfigurationUserLevel
.
None
);
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
if
(
config
.
AppSettings
.
Settings
[
key
]
==
null
)
{
{
L
OGGER
.
E
rror
(
"未找到配置:"
+
key
+
",请检查配置是否完整!"
);
L
ogUtil
.
e
rror
(
"未找到配置:"
+
key
+
",请检查配置是否完整!"
);
return
a
;
return
a
;
}
}
else
else
...
@@ -98,7 +98,7 @@ namespace OnlineStore.Common
...
@@ -98,7 +98,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
"SaveValue保存配置出错:AppKey="
+
key
+
",AppValue="
+
value
+
","
+
ex
.
StackTrace
);
LogUtil
.
error
(
"SaveValue保存配置出错:AppKey="
+
key
+
",AppValue="
+
value
+
","
+
ex
.
StackTrace
);
}
}
}
}
...
@@ -120,7 +120,7 @@ namespace OnlineStore.Common
...
@@ -120,7 +120,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
"UpdateConfig保存配置出错:name="
+
name
+
",Xvalue="
+
Xvalue
+
","
+
ex
.
StackTrace
);
LogUtil
.
error
(
"UpdateConfig保存配置出错:name="
+
name
+
",Xvalue="
+
Xvalue
+
","
+
ex
.
StackTrace
);
}
}
}
}
///<summary>
///<summary>
...
@@ -152,7 +152,7 @@ namespace OnlineStore.Common
...
@@ -152,7 +152,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
"SetValue保存配置出错:AppKey="
+
AppKey
+
",AppValue="
+
AppValue
+
","
+
ex
.
StackTrace
);
LogUtil
.
error
(
"SetValue保存配置出错:AppKey="
+
AppKey
+
",AppValue="
+
AppValue
+
","
+
ex
.
StackTrace
);
}
}
}
}
}
}
...
...
source/Common/util/HttpHelper.cs
查看文件 @
eddd82d
...
@@ -18,7 +18,7 @@ namespace OnlineStore.Common
...
@@ -18,7 +18,7 @@ namespace OnlineStore.Common
{
{
public
class
HttpHelper
public
class
HttpHelper
{
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public
static
string
Post
(
string
url
,
string
paramData
)
public
static
string
Post
(
string
url
,
string
paramData
)
{
{
return
Post
(
url
,
paramData
,
Encoding
.
UTF8
);
return
Post
(
url
,
paramData
,
Encoding
.
UTF8
);
...
@@ -76,7 +76,7 @@ namespace OnlineStore.Common
...
@@ -76,7 +76,7 @@ namespace OnlineStore.Common
{
//入库或出库
{
//入库或出库
string
json
=
JsonHelper
.
SerializeObject
(
operation
);
string
json
=
JsonHelper
.
SerializeObject
(
operation
);
LogUtil
.
error
(
LOGGER
,
"模拟HTTP服务器返回出库入库信息:"
+
json
);
LogUtil
.
error
(
"模拟HTTP服务器返回出库入库信息:"
+
json
);
return
operation
;
return
operation
;
}
}
}
}
...
@@ -89,7 +89,7 @@ namespace OnlineStore.Common
...
@@ -89,7 +89,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
E
rror
(
"JsonHelper.SerializeObject(operation) 出错【operation.op="
+
operation
.
op
+
"】"
+
ex
);
L
ogUtil
.
e
rror
(
"JsonHelper.SerializeObject(operation) 出错【operation.op="
+
operation
.
op
+
"】"
+
ex
);
}
}
string
result
=
Post
(
url
,
json
);
string
result
=
Post
(
url
,
json
);
if
(!
string
.
IsNullOrEmpty
(
result
))
if
(!
string
.
IsNullOrEmpty
(
result
))
...
@@ -100,18 +100,19 @@ namespace OnlineStore.Common
...
@@ -100,18 +100,19 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
E
rror
(
"JsonHelper.DeserializeJsonToObject 出错【result="
+
result
+
"】"
+
ex
);
L
ogUtil
.
e
rror
(
"JsonHelper.DeserializeJsonToObject 出错【result="
+
result
+
"】"
+
ex
);
}
}
}
}
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
E
rror
(
"Post 出错【operation.op="
+
operation
.
op
+
"】:"
+
ex
);
L
ogUtil
.
e
rror
(
"Post 出错【operation.op="
+
operation
.
op
+
"】:"
+
ex
);
}
}
return
null
;
return
null
;
}
}
private
static
int
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Server_Log_Open
);
private
static
int
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Server_Log_Open
);
public
static
string
LastServerMsg
=
""
;
public
static
string
Post
(
string
url
,
string
paramData
,
Encoding
encoding
)
public
static
string
Post
(
string
url
,
string
paramData
,
Encoding
encoding
)
{
{
if
(
PingURLIP
(
url
,
100
).
Equals
(
false
))
if
(
PingURLIP
(
url
,
100
).
Equals
(
false
))
...
@@ -121,7 +122,7 @@ namespace OnlineStore.Common
...
@@ -121,7 +122,7 @@ namespace OnlineStore.Common
if
(
isLog
==
1
)
if
(
isLog
==
1
)
{
{
L
OGGER
.
I
nfo
(
"给服务器发送数据【"
+
paramData
+
"】 "
);
L
ogUtil
.
i
nfo
(
"给服务器发送数据【"
+
paramData
+
"】 "
);
}
}
if
(
paramData
!=
"null"
&&
paramData
!=
null
)
if
(
paramData
!=
"null"
&&
paramData
!=
null
)
{
{
...
@@ -155,8 +156,13 @@ namespace OnlineStore.Common
...
@@ -155,8 +156,13 @@ namespace OnlineStore.Common
}
}
if
(
isLog
==
1
)
if
(
isLog
==
1
)
{
{
L
OGGER
.
I
nfo
(
"收到服务器数据【"
+
result
+
"】"
);
L
ogUtil
.
i
nfo
(
"收到服务器数据【"
+
result
+
"】"
);
}
}
LastServerMsg
=
DateTime
.
Now
.
ToLongTimeString
()+
" URL:"
+
url
+
"\r\n"
+
"发送:"
+
paramData
+
"\r\n"
+
"接收:"
+
result
+
"\r\n"
;
return
result
;
return
result
;
}
}
...
@@ -169,13 +175,13 @@ namespace OnlineStore.Common
...
@@ -169,13 +175,13 @@ namespace OnlineStore.Common
{
{
try
try
{
{
LogUtil
.
info
(
LOGGER
,
"HTTP GET FROM: "
+
url
);
LogUtil
.
info
(
"HTTP GET FROM: "
+
url
);
var
wc
=
new
WebClient
{
Encoding
=
encoding
};
var
wc
=
new
WebClient
{
Encoding
=
encoding
};
var
readStream
=
wc
.
OpenRead
(
url
);
var
readStream
=
wc
.
OpenRead
(
url
);
using
(
var
sr
=
new
StreamReader
(
readStream
,
encoding
))
using
(
var
sr
=
new
StreamReader
(
readStream
,
encoding
))
{
{
var
result
=
sr
.
ReadToEnd
();
var
result
=
sr
.
ReadToEnd
();
LogUtil
.
info
(
LOGGER
,
"receive << "
+
result
);
LogUtil
.
info
(
"receive << "
+
result
);
return
result
;
return
result
;
}
}
}
}
...
...
source/Common/util/HumitureController.cs
查看文件 @
eddd82d
...
@@ -14,7 +14,7 @@ namespace OnlineStore.Common
...
@@ -14,7 +14,7 @@ namespace OnlineStore.Common
/// </summary>
/// </summary>
public
class
HumitureController
public
class
HumitureController
{
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private
static
int
bautRate
=
4800
;
//波特率
private
static
int
bautRate
=
4800
;
//波特率
...
@@ -48,7 +48,7 @@ namespace OnlineStore.Common
...
@@ -48,7 +48,7 @@ namespace OnlineStore.Common
}
}
else
else
{
{
LogUtil
.
error
(
LOGGER
,
LogName
+
"串口"
+
port
+
"打开失败!"
);
LogUtil
.
error
(
LogName
+
"串口"
+
port
+
"打开失败!"
);
return
false
;
return
false
;
}
}
}
}
...
@@ -257,7 +257,7 @@ namespace OnlineStore.Common
...
@@ -257,7 +257,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
I
nfo
(
LogName
+
"转换出错:"
+
ex
.
ToString
());
L
ogUtil
.
i
nfo
(
LogName
+
"转换出错:"
+
ex
.
ToString
());
}
}
return
list
;
return
list
;
}
}
...
@@ -301,7 +301,7 @@ namespace OnlineStore.Common
...
@@ -301,7 +301,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
I
nfo
(
LogName
+
"转换出错:"
+
ex
.
ToString
());
L
ogUtil
.
i
nfo
(
LogName
+
"转换出错:"
+
ex
.
ToString
());
}
}
return
-
1
;
return
-
1
;
}
}
...
@@ -328,7 +328,7 @@ namespace OnlineStore.Common
...
@@ -328,7 +328,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
I
nfo
(
LogName
+
"转换出错:"
+
ex
.
ToString
());
L
ogUtil
.
i
nfo
(
LogName
+
"转换出错:"
+
ex
.
ToString
());
}
}
return
list
;
return
list
;
}
}
...
...
source/Common/util/HumitureServer.cs
查看文件 @
eddd82d
...
@@ -15,7 +15,7 @@ namespace OnlineStore.Common
...
@@ -15,7 +15,7 @@ namespace OnlineStore.Common
/// </summary>
/// </summary>
public
class
HumitureServer
public
class
HumitureServer
{
{
private
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
private static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// <summary>
/// 最后一次接受到的温度信息,key=温湿度传感器IP地址
/// 最后一次接受到的温度信息,key=温湿度传感器IP地址
...
@@ -92,7 +92,7 @@ namespace OnlineStore.Common
...
@@ -92,7 +92,7 @@ namespace OnlineStore.Common
}
}
TemperateIsStart
=
true
;
TemperateIsStart
=
true
;
temperateTcpServer
.
Start
(
port
);
temperateTcpServer
.
Start
(
port
);
LogUtil
.
info
(
LOGGER
,
"温湿度已开始在端口["
+
port
+
"]监听!"
);
LogUtil
.
info
(
"温湿度已开始在端口["
+
port
+
"]监听!"
);
temperateTcpServer
.
ReviceMsgEvent
+=
tcp_ReviceMsgEvent
;
temperateTcpServer
.
ReviceMsgEvent
+=
tcp_ReviceMsgEvent
;
}
}
}
}
...
@@ -111,7 +111,7 @@ namespace OnlineStore.Common
...
@@ -111,7 +111,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
"关闭温湿度监听出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"关闭温湿度监听出错:"
+
ex
.
ToString
());
}
}
}
}
...
@@ -132,11 +132,11 @@ namespace OnlineStore.Common
...
@@ -132,11 +132,11 @@ namespace OnlineStore.Common
string
deviceId
=
strList
[
10
];
string
deviceId
=
strList
[
10
];
string
pwd
=
strList
[
11
];
string
pwd
=
strList
[
11
];
LogUtil
.
debug
(
LOGGER
,
"address="
+
add
+
",收到:温度="
+
wendu
+
",湿度="
+
shidu
+
",设备ID="
+
deviceId
+
",密码:"
+
pwd
);
LogUtil
.
debug
(
"address="
+
add
+
",收到:温度="
+
wendu
+
",湿度="
+
shidu
+
",设备ID="
+
deviceId
+
",密码:"
+
pwd
);
if
(
shidu
<=
0
)
if
(
shidu
<=
0
)
{
{
//湿度小于0不处理
//湿度小于0不处理
LogUtil
.
info
(
LOGGER
,
"address="
+
add
+
",收到:温度="
+
wendu
+
",湿度="
+
shidu
+
",设备ID="
+
deviceId
+
",密码:"
+
pwd
+
",湿度小于0不处理"
);
LogUtil
.
info
(
"address="
+
add
+
",收到:温度="
+
wendu
+
",湿度="
+
shidu
+
",设备ID="
+
deviceId
+
",密码:"
+
pwd
+
",湿度小于0不处理"
);
}
}
else
else
{
{
...
@@ -152,7 +152,7 @@ namespace OnlineStore.Common
...
@@ -152,7 +152,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
ex
.
ToString
());
LogUtil
.
error
(
ex
.
ToString
());
}
}
}
}
private
static
double
PreShiDu
=
7
;
private
static
double
PreShiDu
=
7
;
...
@@ -171,7 +171,7 @@ namespace OnlineStore.Common
...
@@ -171,7 +171,7 @@ namespace OnlineStore.Common
TemperateParamMap
.
Remove
(
IP
);
TemperateParamMap
.
Remove
(
IP
);
}
}
TemperateParamMap
.
Add
(
IP
,
ast
);
TemperateParamMap
.
Add
(
IP
,
ast
);
//LogUtil.info(
LOGGER,
"address=" + IP + ",收到:温度=" + newWenDu + ",湿度=" + newShiDu + " ");
//LogUtil.info( "address=" + IP + ",收到:温度=" + newWenDu + ",湿度=" + newShiDu + " ");
}
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
{
...
...
source/Common/util/LogUtil.cs
查看文件 @
eddd82d
...
@@ -181,10 +181,17 @@ namespace OnlineStore.Common
...
@@ -181,10 +181,17 @@ namespace OnlineStore.Common
{
{
debug
(
LOGGER
,
msg
);
debug
(
LOGGER
,
msg
);
}
}
public
static
void
error
(
string
errorMsg
)
public
static
void
error
(
string
errorMsg
,
Exception
ex
=
null
)
{
if
(
ex
==
null
)
{
{
error
(
LOGGER
,
errorMsg
);
error
(
LOGGER
,
errorMsg
);
}
}
else
{
error
(
LOGGER
,
errorMsg
+
ex
.
ToString
());
}
}
public
static
void
info
(
string
msg
)
public
static
void
info
(
string
msg
)
{
{
info
(
LOGGER
,
msg
);
info
(
LOGGER
,
msg
);
...
...
source/Common/util/NetTCPServer.cs
查看文件 @
eddd82d
...
@@ -6,12 +6,13 @@ using System.Net;
...
@@ -6,12 +6,13 @@ using System.Net;
using
System.IO
;
using
System.IO
;
using
log4net
;
using
log4net
;
using
System.Text
;
using
System.Text
;
using
OnlineStore.Common
;
namespace
OnlineStore
namespace
OnlineStore
{
{
public
class
NetTCPServer
public
class
NetTCPServer
{
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// <summary>
/// TCP服务端监听
/// TCP服务端监听
...
@@ -118,13 +119,13 @@ namespace OnlineStore
...
@@ -118,13 +119,13 @@ namespace OnlineStore
NetworkStream
ns
=
client
.
tcpClient
.
GetStream
();
NetworkStream
ns
=
client
.
tcpClient
.
GetStream
();
StreamReader
sr
=
new
StreamReader
(
ns
);
StreamReader
sr
=
new
StreamReader
(
ns
);
string
str
=
sr
.
ReadLine
();
string
str
=
sr
.
ReadLine
();
L
OGGER
.
I
nfo
(
"读取到数据:"
+
str
);
L
ogUtil
.
i
nfo
(
"读取到数据:"
+
str
);
byte
[]
recdata
=
new
byte
[
ns
.
EndRead
(
ar
)];
byte
[]
recdata
=
new
byte
[
ns
.
EndRead
(
ar
)];
if
(
recdata
.
Length
>
0
)
if
(
recdata
.
Length
>
0
)
{
{
//Array.Copy(client.Buffer, recdata, recdata.Length);
//Array.Copy(client.Buffer, recdata, recdata.Length);
L
OGGER
.
I
nfo
(
"读取到数据1111:"
+
Encoding
.
ASCII
.
GetString
(
recdata
));
L
ogUtil
.
i
nfo
(
"读取到数据1111:"
+
Encoding
.
ASCII
.
GetString
(
recdata
));
//ns.BeginRead(client.Buffer, 0, client.Buffer.Length, new AsyncCallback(TCPCallBack), client);
//ns.BeginRead(client.Buffer, 0, client.Buffer.Length, new AsyncCallback(TCPCallBack), client);
}
}
else
else
...
...
source/Common/util/ScanCodeManager.cs
查看文件 @
eddd82d
...
@@ -13,7 +13,7 @@ namespace OnlineStore.Common
...
@@ -13,7 +13,7 @@ namespace OnlineStore.Common
/// </summary>
/// </summary>
public
class
ScanCodeManager
public
class
ScanCodeManager
{
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// <summary>
/// 处理接收后的二维码
/// 处理接收后的二维码
/// </summary>
/// </summary>
...
...
source/Common/util/TcpClient.cs
查看文件 @
eddd82d
...
@@ -16,7 +16,7 @@ namespace OnlineStore.Common
...
@@ -16,7 +16,7 @@ namespace OnlineStore.Common
private
static
int
ServerPort
=
0
;
private
static
int
ServerPort
=
0
;
private
System
.
Timers
.
Timer
ReConnectTimer
=
null
;
private
System
.
Timers
.
Timer
ReConnectTimer
=
null
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public
delegate
void
HandleMessage
(
string
message
);
public
delegate
void
HandleMessage
(
string
message
);
private
Socket
m_clientSocket
;
private
Socket
m_clientSocket
;
...
@@ -154,7 +154,7 @@ namespace OnlineStore.Common
...
@@ -154,7 +154,7 @@ namespace OnlineStore.Common
if
(
m_clientSocket
!=
null
)
if
(
m_clientSocket
!=
null
)
{
{
m_clientSocket
.
Close
();
m_clientSocket
.
Close
();
LogUtil
.
debug
(
LOGGER
,
"Socket closed!"
);
LogUtil
.
debug
(
"Socket closed!"
);
}
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
{
...
@@ -168,7 +168,7 @@ namespace OnlineStore.Common
...
@@ -168,7 +168,7 @@ namespace OnlineStore.Common
{
{
m_clientSocket
.
BeginReceive
(
m_receiveBuffer
,
0
,
m_receiveBuffer
.
Length
,
0
,
new
AsyncCallback
(
ReceiveCallBack
),
null
);
m_clientSocket
.
BeginReceive
(
m_receiveBuffer
,
0
,
m_receiveBuffer
.
Length
,
0
,
new
AsyncCallback
(
ReceiveCallBack
),
null
);
LogUtil
.
info
(
LOGGER
,
"Connect to "
+
ServerIp
+
":"
+
ServerPort
+
" success!"
);
LogUtil
.
info
(
"Connect to "
+
ServerIp
+
":"
+
ServerPort
+
" success!"
);
}
}
isInProcess
=
false
;
isInProcess
=
false
;
...
@@ -189,11 +189,11 @@ namespace OnlineStore.Common
...
@@ -189,11 +189,11 @@ namespace OnlineStore.Common
if
(
m_clientSocket
!=
null
)
if
(
m_clientSocket
!=
null
)
{
{
m_clientSocket
.
Close
();
m_clientSocket
.
Close
();
LogUtil
.
info
(
LOGGER
,
"Socket closed!"
);
LogUtil
.
info
(
"Socket closed!"
);
}
}
else
else
{
{
LogUtil
.
error
(
LOGGER
,
"No socket is running!"
);
LogUtil
.
error
(
"No socket is running!"
);
}
}
}
}
...
@@ -209,7 +209,7 @@ namespace OnlineStore.Common
...
@@ -209,7 +209,7 @@ namespace OnlineStore.Common
{
{
m_clientSocket
.
Send
(
sendBuffer
);
m_clientSocket
.
Send
(
sendBuffer
);
LogUtil
.
debug
(
LOGGER
,
"Send >> "
+
strSendData
);
LogUtil
.
debug
(
"Send >> "
+
strSendData
);
}
}
}
}
...
...
source/Common/util/TcpServer.cs
查看文件 @
eddd82d
...
@@ -12,7 +12,7 @@ namespace OnlineStore.Common
...
@@ -12,7 +12,7 @@ namespace OnlineStore.Common
{
{
public
class
TcpServer
public
class
TcpServer
{
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private
Thread
m_serverThread
;
private
Thread
m_serverThread
;
private
Socket
m_serverSocket
;
private
Socket
m_serverSocket
;
...
@@ -39,7 +39,7 @@ namespace OnlineStore.Common
...
@@ -39,7 +39,7 @@ namespace OnlineStore.Common
}
}
}
}
}
}
LogUtil
.
info
(
LOGGER
,
iplist
+
"]"
);
LogUtil
.
info
(
iplist
+
"]"
);
}
}
/// <summary>
/// <summary>
...
@@ -59,7 +59,7 @@ namespace OnlineStore.Common
...
@@ -59,7 +59,7 @@ namespace OnlineStore.Common
m_serverThread
=
new
Thread
(
new
ThreadStart
(
ReceiveAccept
));
m_serverThread
=
new
Thread
(
new
ThreadStart
(
ReceiveAccept
));
m_serverThread
.
Start
();
m_serverThread
.
Start
();
LogUtil
.
info
(
LOGGER
,
" Server start listen : "
+
m_serverPort
);
LogUtil
.
info
(
" Server start listen : "
+
m_serverPort
);
logLocalIp
();
logLocalIp
();
//this.AddRunningInfo(">> " + DateTime.Now.ToString() + " Server started.");
//this.AddRunningInfo(">> " + DateTime.Now.ToString() + " Server started.");
...
@@ -101,14 +101,14 @@ namespace OnlineStore.Common
...
@@ -101,14 +101,14 @@ namespace OnlineStore.Common
client
.
ClientSocket
=
m_serverSocket
.
Accept
();
client
.
ClientSocket
=
m_serverSocket
.
Accept
();
IPEndPoint
clientipe
=
(
IPEndPoint
)
client
.
ClientSocket
.
RemoteEndPoint
;
IPEndPoint
clientipe
=
(
IPEndPoint
)
client
.
ClientSocket
.
RemoteEndPoint
;
client
.
ipAdd
=
clientipe
.
Address
;
client
.
ipAdd
=
clientipe
.
Address
;
LogUtil
.
info
(
LOGGER
,
"有新的客户端链接上:"
+
client
.
ipAdd
.
ToString
());
LogUtil
.
info
(
"有新的客户端链接上:"
+
client
.
ipAdd
.
ToString
());
receiveMessageDelegate
=
new
ReceiveMessageDelegate
(
ReceiveMessages
);
receiveMessageDelegate
=
new
ReceiveMessageDelegate
(
ReceiveMessages
);
receiveMessageDelegate
.
BeginInvoke
(
client
,
ReceiveMessagesCallback
,
""
);
receiveMessageDelegate
.
BeginInvoke
(
client
,
ReceiveMessagesCallback
,
""
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
ex
.
Message
);
LogUtil
.
error
(
ex
.
Message
);
//throw new Exception(ex.Message);
//throw new Exception(ex.Message);
}
}
}
}
...
@@ -198,7 +198,7 @@ namespace OnlineStore.Common
...
@@ -198,7 +198,7 @@ namespace OnlineStore.Common
// }
// }
// catch (Exception ex)
// catch (Exception ex)
// {
// {
// L
OGGER.E
rror(ex.ToString());
// L
ogUtil.e
rror(ex.ToString());
// }
// }
//}
//}
...
@@ -210,7 +210,7 @@ namespace OnlineStore.Common
...
@@ -210,7 +210,7 @@ namespace OnlineStore.Common
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
E
rror
(
ex
.
ToString
());
L
ogUtil
.
e
rror
(
ex
.
ToString
());
}
}
}
}
...
...
source/Common/util/UdpServer.cs
查看文件 @
eddd82d
...
@@ -12,7 +12,7 @@ namespace OnlineStore.Common
...
@@ -12,7 +12,7 @@ namespace OnlineStore.Common
public
class
UdpServer
public
class
UdpServer
{
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private
Thread
m_serverThread
;
private
Thread
m_serverThread
;
private
Socket
udpServer
;
private
Socket
udpServer
;
...
@@ -37,7 +37,7 @@ namespace OnlineStore.Common
...
@@ -37,7 +37,7 @@ namespace OnlineStore.Common
}
}
}
}
}
}
LogUtil
.
info
(
LOGGER
,
iplist
+
"]"
);
LogUtil
.
info
(
iplist
+
"]"
);
}
}
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
查看文件 @
eddd82d
...
@@ -849,7 +849,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -849,7 +849,7 @@ namespace OnlineStore.DeviceLibrary
//重新记录
//重新记录
LogInfo
(
" 执行出库【"
+
MoveInfo
.
MoveParam
.
ToStr
()
+
"】失败,料架号不一致,加入等待队列"
);
LogInfo
(
" 执行出库【"
+
MoveInfo
.
MoveParam
.
ToStr
()
+
"】失败,料架号不一致,加入等待队列"
);
waitOutStoreList
.
Enqueue
(
MoveInfo
.
MoveParam
);
waitOutStoreList
.
Enqueue
(
MoveInfo
.
MoveParam
);
LogUtil
.
error
(
Name
+
"出库 【"
+
LastRfidID
+
"】 【"
+
MoveInfo
.
MoveParam
.
rfid
+
","
+
MoveInfo
.
MoveParam
.
realRfid
+
"】不同料架,送出当前料架,稍后重新出库"
);
LogUtil
.
error
(
Name
+
"出库 【"
+
LastRfidID
+
"】 【"
+
MoveInfo
.
MoveParam
.
rfid
+
","
+
MoveInfo
.
MoveParam
.
realRfid
+
"】不同料架,送出当前料架,稍后重新出库"
);
// MoveInfo.MoveParam.rfid = LastRfidID;
// MoveInfo.MoveParam.rfid = LastRfidID;
MoveInfo
.
NewMove
(
StoreMoveType
.
OutStore
,
LastOutParam
);
MoveInfo
.
NewMove
(
StoreMoveType
.
OutStore
,
LastOutParam
);
...
@@ -1068,35 +1068,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1068,35 +1068,6 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
private
bool
IsRightShelfId
(
string
currShelfID
,
string
realRfid
)
{
if
(
String
.
IsNullOrEmpty
(
currShelfID
)
)
{
return
false
;
}
if
(
String
.
IsNullOrEmpty
(
realRfid
))
{
return
true
;
}
if
(
currShelfID
.
Equals
(
realRfid
))
{
return
true
;
}
//string theTarget = realRfid.Trim().PadLeft(3, '0');
//string num = theTarget.Substring(0, 2);
//string type = theTarget.Substring(2, 1);
//if (currShelfID.Equals(type + num))
//{
// return true;
//}
//else if (num.Equals("00"))
//{
// return true;
//}
return
false
;
}
#
endregion
#
endregion
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Shelf.cs
查看文件 @
eddd82d
...
@@ -608,34 +608,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -608,34 +608,6 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
error
(
Name
+
"验证出库【"
+
inoutParam
.
ToStr
()
+
"】是否重复出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
Name
+
"验证出库【"
+
inoutParam
.
ToStr
()
+
"】是否重复出错:"
+
ex
.
ToString
());
}
}
//判断出库指定的料架是否是当前料架,如果不是当前料架,需要将当前料架送出,然后进入新料架
//TODO
// string shelfPosID = "";
//if (inoutParam.rfidLoc > 0 && ShelfPosList.Count >= inoutParam.rfidLoc)
//{
// shelfPosID = ShelfPosList[inoutParam.rfidLoc - 1];
//inoutParam.NeedEnterShelf = false;
//inoutParam.NeedOutShelf = false;
//}
//else
//{
// bool hasShelf = EmprtShelfList.TryDequeue(out shelfPosID);
// if (hasShelf)
// {
// inoutParam.NeedEnterShelf = false;
// inoutParam.NeedOutShelf = false;
// inoutParam.ShelfPosID = shelfPosID;
// }
// else
// {
// inoutParam.NeedEnterShelf = true;
// inoutParam.NeedOutShelf = false;
// LogInfo(Name + "执行出库【" + inoutParam.ToStr() + "】,没有空料架,需要使用新料架");
// }
//}
StartExecuctOut
(
inoutParam
);
StartExecuctOut
(
inoutParam
);
}
}
...
...
source/DeviceLibrary/ACPackingStore/StoreManager.cs
查看文件 @
eddd82d
...
@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
public
static
int
CurrInOutType
=
0
;
public
static
int
CurrInOutType
=
0
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public
static
PackingStoreBean
Store
=
null
;
public
static
PackingStoreBean
Store
=
null
;
public
static
Store_Config
Config
=
null
;
public
static
Store_Config
Config
=
null
;
public
static
Dictionary
<
int
,
BaseConfig
>
AllConfigMap
=
null
;
public
static
Dictionary
<
int
,
BaseConfig
>
AllConfigMap
=
null
;
...
@@ -71,7 +71,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -71,7 +71,7 @@ namespace OnlineStore.DeviceLibrary
isInit
=
true
;
isInit
=
true
;
string
storeType
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_Type
);
string
storeType
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_Type
);
int
count
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
store_count
);
int
count
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
store_count
);
LogUtil
.
info
(
LOGGER
,
"配置的料仓 类型="
+
storeType
+
",开始加载料仓配置"
);
LogUtil
.
info
(
"配置的料仓 类型="
+
storeType
+
",开始加载料仓配置"
);
string
appPath
=
Application
.
StartupPath
;
string
appPath
=
Application
.
StartupPath
;
string
CID
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_CID
);
string
CID
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_CID
);
Dictionary
<
int
,
AC_BOX_Config
>
storeConfig
=
new
Dictionary
<
int
,
AC_BOX_Config
>();
Dictionary
<
int
,
AC_BOX_Config
>
storeConfig
=
new
Dictionary
<
int
,
AC_BOX_Config
>();
...
@@ -107,7 +107,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -107,7 +107,7 @@ namespace OnlineStore.DeviceLibrary
{
{
CSVPositionReader
<
ACBoxPosition
>.
AddCSVFile
(
positionConfigFile
);
CSVPositionReader
<
ACBoxPosition
>.
AddCSVFile
(
positionConfigFile
);
}
}
LogUtil
.
info
(
LOGGER
,
"加载料仓完成!"
);
LogUtil
.
info
(
"加载料仓完成!"
);
}
}
...
@@ -134,7 +134,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -134,7 +134,7 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
Error
(
"出错:"
,
ex
);
L
ogUtil
.
error
(
"出错:"
+
ex
.
ToString
()
);
MessageBox
.
Show
(
ex
.
ToString
(),
"加载配置错误(请检查配置)"
);
MessageBox
.
Show
(
ex
.
ToString
(),
"加载配置错误(请检查配置)"
);
Application
.
Exit
();
Application
.
Exit
();
}
}
...
@@ -160,7 +160,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -160,7 +160,7 @@ namespace OnlineStore.DeviceLibrary
if
(!
result
)
if
(!
result
)
{
{
L
OGGER
.
E
rror
(
"保存配置文件失败:"
+
configFile
);
L
ogUtil
.
e
rror
(
"保存配置文件失败:"
+
configFile
);
}
}
AllConfigMap
[
storeConfig
.
DeviceID
]
=
storeConfig
;
AllConfigMap
[
storeConfig
.
DeviceID
]
=
storeConfig
;
Store
.
BoxConfigMap
[
storeConfig
.
DeviceID
]
=
storeConfig
;
Store
.
BoxConfigMap
[
storeConfig
.
DeviceID
]
=
storeConfig
;
...
@@ -170,7 +170,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -170,7 +170,7 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
Error
(
"出错:"
,
ex
);
L
ogUtil
.
error
(
"出错:"
+
ex
.
ToString
()
);
}
}
return
false
;
return
false
;
}
}
...
@@ -431,22 +431,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -431,22 +431,6 @@ namespace OnlineStore.DeviceLibrary
internal
static
string
GetShelfIDByLoc
(
int
rfidLoc
,
List
<
string
>
shelfPosList
)
internal
static
string
GetShelfIDByLoc
(
int
rfidLoc
,
List
<
string
>
shelfPosList
)
{
{
string
shelfId
=
""
;
string
shelfId
=
""
;
//try
//{
// foreach (string id in shelfPosList)
// {
// if (id.Length == 3 && id.Substring(2, 1).Equals(rfidLoc.ToString()))
// {
// shelfId = id;
// break;
// }
// }
//}
//catch (Exception ex)
//{
//}
if
(
rfidLoc
.
Equals
(-
1
))
if
(
rfidLoc
.
Equals
(-
1
))
{
{
shelfId
=
shelfPosList
[
0
];
shelfId
=
shelfPosList
[
0
];
...
...
source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
eddd82d
...
@@ -13,7 +13,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -13,7 +13,7 @@ namespace OnlineStore.DeviceLibrary
public
class
AgvClient
public
class
AgvClient
{
{
public
static
bool
CurrCancelState
=
true
;
public
static
bool
CurrCancelState
=
true
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private
static
string
ServerIp
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
AgvServerIp
);
private
static
string
ServerIp
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
AgvServerIp
);
private
static
Asa
.
AgvClient
agvClient
;
private
static
Asa
.
AgvClient
agvClient
;
private
static
Dictionary
<
string
,
Asa
.
ClientAction
>
actionMap
=
new
Dictionary
<
string
,
Asa
.
ClientAction
>();
private
static
Dictionary
<
string
,
Asa
.
ClientAction
>
actionMap
=
new
Dictionary
<
string
,
Asa
.
ClientAction
>();
...
@@ -180,7 +180,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -180,7 +180,7 @@ namespace OnlineStore.DeviceLibrary
bool
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Agv_Log_Open
).
Equals
(
1
);
bool
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Agv_Log_Open
).
Equals
(
1
);
if
(
isLog
)
if
(
isLog
)
{
{
L
OGGER
.
Info
(
" AGV "
+
ServerIp
+
" Log : "
+
s
);
L
ogUtil
.
debug
(
" AGV "
+
ServerIp
+
" Log : "
+
s
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
...
source/DeviceLibrary/device/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
eddd82d
...
@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
//public static uint DefaultDICount = 16;
//public static uint DefaultDICount = 16;
//public static uint DefaultDOCount = 16;
//public static uint DefaultDOCount = 16;
public
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public
Dictionary
<
string
,
AIOBOX
>
AIOMap
=
new
Dictionary
<
string
,
AIOBOX
>();
public
Dictionary
<
string
,
AIOBOX
>
AIOMap
=
new
Dictionary
<
string
,
AIOBOX
>();
public
Dictionary
<
string
,
List
<
Box_Sta
>>
DIValueMap
=
new
Dictionary
<
string
,
List
<
Box_Sta
>>();
public
Dictionary
<
string
,
List
<
Box_Sta
>>
DIValueMap
=
new
Dictionary
<
string
,
List
<
Box_Sta
>>();
...
@@ -201,7 +201,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -201,7 +201,7 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
Exception
error
)
catch
(
Exception
error
)
{
{
LogUtil
.
error
(
LOGGER
,
"连接IO模块 "
+
logName
+
" 出错:"
+
error
.
ToString
());
LogUtil
.
error
(
"连接IO模块 "
+
logName
+
" 出错:"
+
error
.
ToString
());
}
}
}
}
...
@@ -398,12 +398,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -398,12 +398,12 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
LogUtil
.
error
(
LOGGER
,
"WriteSingleDO出错 没有连接IO模块:"
+
ioIp
);
LogUtil
.
error
(
"WriteSingleDO出错 没有连接IO模块:"
+
ioIp
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
E
rror
(
"AIO WriteSingleDO ["
+
ioIp
+
"] ["
+
StartAddress
+
"] 出错啦:"
+
ex
.
ToString
());
L
ogUtil
.
e
rror
(
"AIO WriteSingleDO ["
+
ioIp
+
"] ["
+
StartAddress
+
"] 出错啦:"
+
ex
.
ToString
());
}
}
}
}
public
override
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
,
int
mSeconds
)
public
override
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
,
int
mSeconds
)
...
@@ -423,11 +423,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -423,11 +423,11 @@ namespace OnlineStore.DeviceLibrary
try
try
{
{
aioBox
.
WriteDO
(
StartAddress
,
aioBox
.
ReverseStatus
(
currBox_Sta
));
aioBox
.
WriteDO
(
StartAddress
,
aioBox
.
ReverseStatus
(
currBox_Sta
));
LogUtil
.
debug
(
LOGGER
,
"**********定时回写入 IO ["
+
ioIp
+
"] ["
+
StartAddress
+
"]值"
+
aioBox
.
ReverseStatus
(
currBox_Sta
)
+
"】:"
);
LogUtil
.
debug
(
"**********定时回写入 IO ["
+
ioIp
+
"] ["
+
StartAddress
+
"]值"
+
aioBox
.
ReverseStatus
(
currBox_Sta
)
+
"】:"
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
"**********定时回写入 出错:"
+
ex
.
StackTrace
);
LogUtil
.
error
(
"**********定时回写入 出错:"
+
ex
.
StackTrace
);
}
}
};
};
mytimer
.
AutoReset
=
false
;
//设置是否自动重启,即自动执行多次;
mytimer
.
AutoReset
=
false
;
//设置是否自动重启,即自动执行多次;
...
@@ -436,7 +436,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -436,7 +436,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
LogUtil
.
error
(
LOGGER
,
"AIO WriteSingleDO ["
+
ioIp
+
"] ["
+
StartAddress
+
"] 出错 没有连接IO模块:"
+
ioIp
);
LogUtil
.
error
(
"AIO WriteSingleDO ["
+
ioIp
+
"] ["
+
StartAddress
+
"] 出错 没有连接IO模块:"
+
ioIp
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -552,7 +552,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -552,7 +552,7 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
" GetIOValue ["
+
configIO
.
IO_IP
+
"] ["
+
configIO
.
GetIOAddr
()
+
"] 获取数据出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
" GetIOValue ["
+
configIO
.
IO_IP
+
"] ["
+
configIO
.
GetIOAddr
()
+
"] 获取数据出错:"
+
ex
.
ToString
());
}
}
return
value
;
return
value
;
}
}
...
...
source/DeviceLibrary/store/InOutParam.cs
查看文件 @
eddd82d
...
@@ -15,7 +15,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -15,7 +15,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
public
class
InOutParam
public
class
InOutParam
{
{
public
static
readonly
ILog
log
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//public InOutParam()
//public InOutParam()
//{
//{
// this.WareCode = "";
// this.WareCode = "";
...
@@ -161,7 +161,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -161,7 +161,7 @@ namespace OnlineStore.DeviceLibrary
}
}
public
string
ToShortStr
()
public
string
ToShortStr
()
{
{
return
" ["
+
PosID
+
"]
["
+
ShelfPosID
+
"] ["
+
WareCode
+
"], ["
+
PlateW
+
"x"
+
PlateH
+
"]"
;
return
" ["
+
PosID
+
"]
["
+
ShelfPosID
+
"]["
+
PlateW
+
"x"
+
PlateH
+
"]["
+
WareCode
+
"]"
;
}
}
internal
void
UpdateShelfPosId
(
string
pId
)
internal
void
UpdateShelfPosId
(
string
pId
)
...
...
source/LoadCVSLibrary/CSVReaderBase.cs
查看文件 @
eddd82d
using
log4net
;
using
log4net
;
using
OnlineStore.Common
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
...
@@ -12,7 +13,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -12,7 +13,7 @@ namespace OnlineStore.LoadCSVLibrary
public
class
CSVReaderBase
public
class
CSVReaderBase
{
{
public
static
char
Spilt_Char
=
','
;
public
static
char
Spilt_Char
=
','
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// <summary>
/// 获取一个类所有的《字段,AttributeName列名》集合
/// 获取一个类所有的《字段,AttributeName列名》集合
/// </summary>
/// </summary>
...
@@ -104,7 +105,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -104,7 +105,7 @@ namespace OnlineStore.LoadCSVLibrary
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
L
OGGER
.
Error
(
"出错:"
,
e
);
L
ogUtil
.
error
(
"出错:"
,
e
);
}
}
if
(
File
.
Exists
(
filePath
))
if
(
File
.
Exists
(
filePath
))
{
{
...
@@ -114,7 +115,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -114,7 +115,7 @@ namespace OnlineStore.LoadCSVLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
E
rror
(
ex
.
ToString
());
L
ogUtil
.
e
rror
(
ex
.
ToString
());
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
@@ -151,7 +152,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -151,7 +152,7 @@ namespace OnlineStore.LoadCSVLibrary
{
{
if
(!
titleIndex
.
ContainsKey
(
str
))
if
(!
titleIndex
.
ContainsKey
(
str
))
{
{
L
OGGER
.
E
rror
(
filename
+
":未找到必须列:"
+
str
+
",加载数据失败!"
);
L
ogUtil
.
e
rror
(
filename
+
":未找到必须列:"
+
str
+
",加载数据失败!"
);
throw
new
CVSFieldNotMatchingExection
(
filename
+
":未找到必须列:"
+
str
+
",加载数据失败!"
);
throw
new
CVSFieldNotMatchingExection
(
filename
+
":未找到必须列:"
+
str
+
",加载数据失败!"
);
}
}
}
}
...
...
source/LoadCVSLibrary/position/CSVPositionReader.cs
查看文件 @
eddd82d
...
@@ -59,7 +59,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -59,7 +59,7 @@ namespace OnlineStore.LoadCSVLibrary
{
{
if
(
hasReadFileList
.
Contains
(
filePath
))
if
(
hasReadFileList
.
Contains
(
filePath
))
{
{
L
OGGER
.
E
rror
(
"文件"
+
filePath
+
"已经加载过,直接返回null"
);
L
ogUtil
.
e
rror
(
"文件"
+
filePath
+
"已经加载过,直接返回null"
);
return
null
;
return
null
;
}
}
Type
type
=
typeof
(
T
);
Type
type
=
typeof
(
T
);
...
@@ -67,7 +67,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -67,7 +67,7 @@ namespace OnlineStore.LoadCSVLibrary
Dictionary
<
string
,
string
>
proTitleMap
=
getProAttributeMap
(
typeof
(
T
));
Dictionary
<
string
,
string
>
proTitleMap
=
getProAttributeMap
(
typeof
(
T
));
if
(
proTitleMap
.
Count
<=
4
)
if
(
proTitleMap
.
Count
<=
4
)
{
{
L
OGGER
.
E
rror
(
typeof
(
T
).
ToString
()
+
"只读取到"
+
proTitleMap
.
Count
+
"个属性"
);
L
ogUtil
.
e
rror
(
typeof
(
T
).
ToString
()
+
"只读取到"
+
proTitleMap
.
Count
+
"个属性"
);
}
}
List
<
string
>
cvsTitleList
=
new
List
<
string
>(
proTitleMap
.
Values
);
List
<
string
>
cvsTitleList
=
new
List
<
string
>(
proTitleMap
.
Values
);
List
<
string
>
propertyList
=
new
List
<
string
>(
proTitleMap
.
Keys
);
List
<
string
>
propertyList
=
new
List
<
string
>(
proTitleMap
.
Keys
);
...
@@ -134,12 +134,12 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -134,12 +134,12 @@ namespace OnlineStore.LoadCSVLibrary
}
}
else
else
{
{
L
OGGER
.
E
rror
(
"读取csv,index="
+
index
+
",数据格式不匹配!,line="
+
line
);
L
ogUtil
.
e
rror
(
"读取csv,index="
+
index
+
",数据格式不匹配!,line="
+
line
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
Debug
(
"CSV 读取行【"
+
line
+
"】行转换失败"
);
L
ogUtil
.
debug
(
"CSV 读取行【"
+
line
+
"】行转换失败"
);
}
}
}
}
index
++;
index
++;
...
@@ -177,7 +177,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -177,7 +177,7 @@ namespace OnlineStore.LoadCSVLibrary
Dictionary
<
string
,
string
>
proTitleMap
=
getProAttributeMap
(
typeof
(
T
));
Dictionary
<
string
,
string
>
proTitleMap
=
getProAttributeMap
(
typeof
(
T
));
if
(
proTitleMap
.
Count
<=
4
)
if
(
proTitleMap
.
Count
<=
4
)
{
{
L
OGGER
.
E
rror
(
typeof
(
T
).
ToString
()
+
"只读取到"
+
proTitleMap
.
Count
+
"个属性"
);
L
ogUtil
.
e
rror
(
typeof
(
T
).
ToString
()
+
"只读取到"
+
proTitleMap
.
Count
+
"个属性"
);
}
}
List
<
string
>
cvsTitleList
=
new
List
<
string
>(
proTitleMap
.
Values
);
List
<
string
>
cvsTitleList
=
new
List
<
string
>(
proTitleMap
.
Values
);
List
<
string
>
propertyList
=
new
List
<
string
>(
proTitleMap
.
Keys
);
List
<
string
>
propertyList
=
new
List
<
string
>(
proTitleMap
.
Keys
);
...
@@ -262,7 +262,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -262,7 +262,7 @@ namespace OnlineStore.LoadCSVLibrary
Dictionary
<
string
,
string
>
proTitleMap
=
getProAttributeMap
(
typeof
(
T
));
Dictionary
<
string
,
string
>
proTitleMap
=
getProAttributeMap
(
typeof
(
T
));
if
(
proTitleMap
.
Count
<=
4
)
if
(
proTitleMap
.
Count
<=
4
)
{
{
L
OGGER
.
E
rror
(
typeof
(
T
).
ToString
()
+
"只读取到"
+
proTitleMap
.
Count
+
"个属性"
);
L
ogUtil
.
e
rror
(
typeof
(
T
).
ToString
()
+
"只读取到"
+
proTitleMap
.
Count
+
"个属性"
);
}
}
List
<
string
>
cvsTitleList
=
new
List
<
string
>(
proTitleMap
.
Values
);
List
<
string
>
cvsTitleList
=
new
List
<
string
>(
proTitleMap
.
Values
);
List
<
string
>
propertyList
=
new
List
<
string
>(
proTitleMap
.
Keys
);
List
<
string
>
propertyList
=
new
List
<
string
>(
proTitleMap
.
Keys
);
...
...
source/LoadCVSLibrary/storeConfig/CSVConfigReader.cs
查看文件 @
eddd82d
using
System
;
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Reflection
;
using
System.Reflection
;
...
@@ -45,7 +46,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -45,7 +46,7 @@ namespace OnlineStore.LoadCSVLibrary
//必须有列【类型】
//必须有列【类型】
if
(
allTitleIndex
.
Count
<
0
||
!
allTitleIndex
.
ContainsKey
(
"类型"
))
if
(
allTitleIndex
.
Count
<
0
||
!
allTitleIndex
.
ContainsKey
(
"类型"
))
{
{
L
OGGER
.
E
rror
(
"未找到必须列:类型,加载数据失败!"
);
L
ogUtil
.
e
rror
(
"未找到必须列:类型,加载数据失败!"
);
throw
new
CVSFieldNotMatchingExection
(
"未找到必须列:类型,加载数据失败!"
);
throw
new
CVSFieldNotMatchingExection
(
"未找到必须列:类型,加载数据失败!"
);
}
}
typeIndex
=
allTitleIndex
[
"类型"
];
typeIndex
=
allTitleIndex
[
"类型"
];
...
@@ -116,14 +117,14 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -116,14 +117,14 @@ namespace OnlineStore.LoadCSVLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
E
rror
(
"filepath="
+
filePath
+
",index="
+
index
+
",key="
+
key
+
"出错:"
+
ex
.
ToString
());
L
ogUtil
.
e
rror
(
"filepath="
+
filePath
+
",index="
+
index
+
",key="
+
key
+
"出错:"
+
ex
.
ToString
());
}
}
listIndex
++;
listIndex
++;
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
E
rror
(
"filepath="
+
filePath
+
",index="
+
index
+
",key="
+
key
+
"出错:"
+
ex
.
ToString
());
L
ogUtil
.
e
rror
(
"filepath="
+
filePath
+
",index="
+
index
+
",key="
+
key
+
"出错:"
+
ex
.
ToString
());
}
}
}
}
bllIns
.
CheckField
();
bllIns
.
CheckField
();
...
@@ -157,14 +158,14 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -157,14 +158,14 @@ namespace OnlineStore.LoadCSVLibrary
}
}
else
else
{
{
L
OGGER
.
E
rror
(
"配置的料仓类型="
+
storeType
+
"未找到处理方法!"
);
L
ogUtil
.
e
rror
(
"配置的料仓类型="
+
storeType
+
"未找到处理方法!"
);
}
}
return
LoadConfig
(
config
);
return
LoadConfig
(
config
);
}
}
public
static
BaseConfig
LoadConfig
(
BaseConfig
config
)
public
static
BaseConfig
LoadConfig
(
BaseConfig
config
)
{
{
L
OGGER
.
I
nfo
(
"开始读取文件:"
+
config
.
ConfigFilePath
);
L
ogUtil
.
i
nfo
(
"开始读取文件:"
+
config
.
ConfigFilePath
);
if
(
config
==
null
||
config
.
ConfigFilePath
.
Equals
(
""
))
if
(
config
==
null
||
config
.
ConfigFilePath
.
Equals
(
""
))
{
{
return
null
;
return
null
;
...
@@ -219,7 +220,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -219,7 +220,7 @@ namespace OnlineStore.LoadCSVLibrary
}
}
}
}
catch
(
Exception
e
)
{
catch
(
Exception
e
)
{
L
OGGER
.
E
rror
(
"出错:"
+
e
.
ToString
());
L
ogUtil
.
e
rror
(
"出错:"
+
e
.
ToString
());
}
}
string
newLine
=
""
;
string
newLine
=
""
;
foreach
(
string
s
in
newArray
)
foreach
(
string
s
in
newArray
)
...
...
source/LoadCVSLibrary/storeConfig/ConfigItemBase.cs
查看文件 @
eddd82d
using
log4net
;
using
log4net
;
using
OnlineStore.Common
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
...
@@ -12,7 +13,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -12,7 +13,7 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
/// </summary>
public
class
ConfigBase
public
class
ConfigBase
{
{
protected
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
//
protected static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// <summary>
/// DI=输入IO,DO=输出IO,PRO=属性,AXIS=轴
/// DI=输入IO,DO=输出IO,PRO=属性,AXIS=轴
/// </summary>
/// </summary>
...
@@ -43,7 +44,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -43,7 +44,7 @@ namespace OnlineStore.LoadCSVLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
Error
(
"出错:"
,
ex
);
L
ogUtil
.
error
(
"出错:"
,
ex
);
}
}
return
value
;
return
value
;
}
}
...
@@ -295,7 +296,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -295,7 +296,7 @@ namespace OnlineStore.LoadCSVLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
L
OGGER
.
E
rror
(
ToString
()+
"出错了:"
,
ex
);
L
ogUtil
.
e
rror
(
ToString
()+
"出错了:"
,
ex
);
return
-
1
;
return
-
1
;
}
}
return
IoValue
;
return
IoValue
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论