Commit 8ad7ddd9 LN

增加默认盘号配置

1 个父辈 2d691a7e
...@@ -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">
......
...@@ -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 = "";
// //
......
...@@ -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";
} }
} }
...@@ -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)
......
...@@ -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!