Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8ad7ddd9
由
LN
编写于
2019-12-16 13:09:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加默认盘号配置
1 个父辈
2d691a7e
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
15 行增加
和
8 行删除
source/AssemblyLineClient/App.config
source/AssemblyLineClient/FrmLineStore.Designer.cs
source/Common/Setting_Init.cs
source/Common/util/TcpServer.cs
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
source/AssemblyLineClient/App.config
查看文件 @
8ad7ddd
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
<
add
key
=
"NeedScanCode"
value
=
"1"
/>
<
add
key
=
"NeedScanCode"
value
=
"1"
/>
<
add
key
=
"Server_Log_Open"
value
=
"0"
/>
<
add
key
=
"Server_Log_Open"
value
=
"0"
/>
<
add
key
=
"CodeCount"
value
=
"1"
/>
<
add
key
=
"CodeCount"
value
=
"1"
/>
<
add
key
=
"DefaultTrayNum"
value
=
"9"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
source/AssemblyLineClient/FrmLineStore.Designer.cs
查看文件 @
8ad7ddd
...
@@ -402,7 +402,6 @@
...
@@ -402,7 +402,6 @@
this
.
groupBox1
.
TabIndex
=
195
;
this
.
groupBox1
.
TabIndex
=
195
;
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
Text
=
"料仓通信测试"
;
this
.
groupBox1
.
Text
=
"料仓通信测试"
;
this
.
groupBox1
.
Visible
=
false
;
//
//
// lblPosId
// lblPosId
//
//
...
@@ -501,9 +500,9 @@
...
@@ -501,9 +500,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
(
460
,
85
);
this
.
logBox
.
Location
=
new
System
.
Drawing
.
Point
(
460
,
168
);
this
.
logBox
.
Name
=
"logBox"
;
this
.
logBox
.
Name
=
"logBox"
;
this
.
logBox
.
Size
=
new
System
.
Drawing
.
Size
(
860
,
445
);
this
.
logBox
.
Size
=
new
System
.
Drawing
.
Size
(
860
,
362
);
this
.
logBox
.
TabIndex
=
106
;
this
.
logBox
.
TabIndex
=
106
;
this
.
logBox
.
Text
=
""
;
this
.
logBox
.
Text
=
""
;
//
//
...
...
source/Common/Setting_Init.cs
查看文件 @
8ad7ddd
...
@@ -82,5 +82,6 @@ namespace OnlineStore.Common
...
@@ -82,5 +82,6 @@ namespace OnlineStore.Common
public
static
string
NeedScanCode
=
"NeedScanCode"
;
public
static
string
NeedScanCode
=
"NeedScanCode"
;
public
static
string
CodeCount
=
"CodeCount"
;
public
static
string
CodeCount
=
"CodeCount"
;
public
static
string
DefaultTrayNum
=
"DefaultTrayNum"
;
}
}
}
}
source/Common/util/TcpServer.cs
查看文件 @
8ad7ddd
...
@@ -6,7 +6,7 @@ using System.Net;
...
@@ -6,7 +6,7 @@ using System.Net;
using
System.Net.Sockets
;
using
System.Net.Sockets
;
using
System.Threading
;
using
System.Threading
;
using
log4net
;
using
log4net
;
using
System.Collections.Concurrent
;
namespace
OnlineStore.Common
namespace
OnlineStore.Common
{
{
...
@@ -120,13 +120,14 @@ namespace OnlineStore.Common
...
@@ -120,13 +120,14 @@ namespace OnlineStore.Common
}
}
}
}
}
}
private
StringBuilder
sb
=
new
StringBuilder
();
//这个是用来保存:接收到了的,但是还没有结束的消息
//
private StringBuilder sb = new StringBuilder(); //这个是用来保存:接收到了的,但是还没有结束的消息
private
int
receiveBufferSize
=
1024
;
private
int
receiveBufferSize
=
1024
;
private
string
terminateString
=
"\r"
;
private
string
terminateString
=
"\r"
;
public
void
ReceiveMessages
(
TcpClientBean
client
)
//这个函数会被以线程方式运行
public
void
ReceiveMessages
(
TcpClientBean
client
)
//这个函数会被以线程方式运行
{
{
try
try
{
{
StringBuilder
sb
=
new
StringBuilder
();
Socket
socket
=
(
Socket
)
client
.
ClientSocket
;
Socket
socket
=
(
Socket
)
client
.
ClientSocket
;
while
(
true
)
while
(
true
)
{
{
...
@@ -136,7 +137,7 @@ namespace OnlineStore.Common
...
@@ -136,7 +137,7 @@ namespace OnlineStore.Common
{
{
string
rawMsg
=
Encoding
.
ASCII
.
GetString
(
buffer
,
0
,
receivedSize
);
string
rawMsg
=
Encoding
.
ASCII
.
GetString
(
buffer
,
0
,
receivedSize
);
int
rnFixLength
=
terminateString
.
Length
;
//这个是指消息结束符的长度,此处为\r\n
int
rnFixLength
=
terminateString
.
Length
;
//这个是指消息结束符的长度,此处为\r\n
for
(
int
i
=
0
;
i
<
rawMsg
.
Length
;
)
//遍历接收到的整个buffer文本
for
(
int
i
=
0
;
i
<
rawMsg
.
Length
;)
//遍历接收到的整个buffer文本
{
{
if
(
i
<=
rawMsg
.
Length
-
rnFixLength
)
if
(
i
<=
rawMsg
.
Length
-
rnFixLength
)
{
{
...
@@ -165,11 +166,11 @@ namespace OnlineStore.Common
...
@@ -165,11 +166,11 @@ namespace OnlineStore.Common
}
}
catch
(
SocketException
e
)
catch
(
SocketException
e
)
{
{
LogUtil
.
error
(
e
.
ToString
(),
1006
);
LogUtil
.
error
(
e
.
ToString
(),
1006
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
ex
.
ToString
(),
1005
);
LogUtil
.
error
(
ex
.
ToString
(),
1005
);
}
}
}
}
//private void ReceiveMessages(Client client)
//private void ReceiveMessages(Client client)
...
...
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
查看文件 @
8ad7ddd
...
@@ -12,11 +12,16 @@ namespace OnlineStore.DeviceLibrary
...
@@ -12,11 +12,16 @@ namespace OnlineStore.DeviceLibrary
public
class
RFIDManager
public
class
RFIDManager
{
{
public
static
RFID
RfidReader
=
new
RFID
();
public
static
RFID
RfidReader
=
new
RFID
();
private
static
int
DefaultTrayNum
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DefaultTrayNum
);
/// <summary>
/// <summary>
/// 获取托盘编码
/// 获取托盘编码
/// </summary>
/// </summary>
public
static
int
GetTrayNum
(
int
subType
,
bool
isClear
=
false
)
public
static
int
GetTrayNum
(
int
subType
,
bool
isClear
=
false
)
{
{
if
(
DefaultTrayNum
>
0
)
{
return
DefaultTrayNum
;
}
// return 9;
// return 9;
if
(
subType
.
Equals
(
104
))
if
(
subType
.
Equals
(
104
))
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论