Commit 667e0e04 LN

二维码增加特殊字符过滤。http超时改为10秒

1 个父辈 ef93496b
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<add key="App_AutoRun" value="1" /> <add key="App_AutoRun" value="1" />
<add key="App_Title" value="流水线客户端" /> <add key="App_Title" value="流水线客户端" />
<!--Server address--> <!--Server address-->
<add key="http.server" value="http://localhost/myproject/"/>
<!--<add key="http.server" value="http://localhost/myproject/service/store/emptyPosForPutin"/>--> <!--<add key="http.server" value="http://localhost/myproject/service/store/emptyPosForPutin"/>-->
<add key="http.server" value="http://localhost/myproject/"/>
<!--storeType--> <!--storeType-->
<add key="Line_moveEquip_count" value="18" /> <add key="Line_moveEquip_count" value="18" />
<add key="Line_feedingEquip_count" value="4" /> <add key="Line_feedingEquip_count" value="4" />
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code--> <!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code-->
<add key="CodeType" value="QR Code#Data Matrix ECC 200" /> <add key="CodeType" value="QR Code#Data Matrix ECC 200" />
<!--<add key="CodeType" value="Data Matrix ECC 200"/>--> <!--<add key="CodeType" value="Data Matrix ECC 200"/>-->
<add key="ACBaudRate" value="19200" /> <add key="ACBaudRate" value="115200" />
<!--二维码参数文件所在路径,文件名与二维码类型名一样--> <!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" /> <add key="CodeParamPath" value="\CodeParam\" />
<add key="Config_Pwd" value="123456" /> <add key="Config_Pwd" value="123456" />
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<!--流水线监听端口--> <!--流水线监听端口-->
<add key="TCPServerPort" value="5246" /> <add key="TCPServerPort" value="5246" />
<!--AGV调度服务器地址--> <!--AGV调度服务器地址-->
<add key="AgvServerIp" value="10.80.160.20" /> <add key="AgvServerIp" value="192.168.103.22" />
<!--IO配置--> <!--IO配置-->
<add key ="DIMS" value ="60"/> <add key ="DIMS" value ="60"/>
<add key ="DOMS" value ="300"/> <add key ="DOMS" value ="300"/>
...@@ -50,13 +50,29 @@ ...@@ -50,13 +50,29 @@
<add key ="OpenRFIDWrite" value ="1"/> <add key ="OpenRFIDWrite" value ="1"/>
<add key="DefaultPWD" value ="123456"/> <add key="DefaultPWD" value ="123456"/>
<!--当前调试的设备ID,分号分割--> <!--当前调试的设备ID,分号分割-->
<add key ="DebugDeviceId" value ="301"/> <add key ="DebugDeviceId" value ="0"/>
<add key ="NeedScanCode" value ="1"/>
<add key ="Server_Log_Open" value ="0"/> <add key ="Server_Log_Open" value ="0"/>
<add key ="Agv_Log_Open" value ="1"/> <add key ="CodeCount" value ="3"/>
<add key ="CodeCount" value ="1"/> <add key ="DefaultTrayNum" value ="0"/>
<add key ="DefaultTrayNum" value ="9"/> <add key ="NeedScanCode" value ="1"/>
<add key ="Agv_Log_Open" value ="0"/>
</appSettings> </appSettings>
<!-- <log4net> -->
<!-- <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> -->
<!-- <file value="logs/Line-RC1250.log" /> -->
<!-- <param name="Encoding" value="UTF-8" /> -->
<!-- <appendToFile value="true" /> -->
<!-- <rollingStyle value="Date" /> -->
<!-- <datePattern value="yyyy-MM-dd" /> -->
<!-- <layout type="log4net.Layout.PatternLayout"> -->
<!-- <conversionPattern value="[%date][%t]%-5p %m%n" /> -->
<!-- </layout> -->
<!-- </appender> -->
<!-- <root> -->
<!-- <level value="Info" /> -->
<!-- <appender-ref ref="RollingLogFileAppender" /> -->
<!-- </root> -->
<!-- </log4net> -->
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/Line-RC1250.log" /> <file value="logs/Line-RC1250.log" />
...@@ -84,11 +100,9 @@ ...@@ -84,11 +100,9 @@
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
</logger> </logger>
<logger name="TheRFID"> <logger name="TheRFID">
<level value="Debug" /> <level value="Info" />
<appender-ref ref="TheRFID" /> <appender-ref ref="TheRFID" />
</logger> </logger>
<!--<root> <!--<root>
<level value="Info" /> <level value="Info" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
......
...@@ -64,6 +64,8 @@ ...@@ -64,6 +64,8 @@
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage3 = new System.Windows.Forms.TabPage();
this.groupBox6 = new System.Windows.Forms.GroupBox(); this.groupBox6 = new System.Windows.Forms.GroupBox();
this.btnUpdateShelf = new System.Windows.Forms.Button();
this.txtShelfID = new System.Windows.Forms.TextBox();
this.lblwidth = new System.Windows.Forms.Label(); this.lblwidth = new System.Windows.Forms.Label();
this.lblMoveInfo = new System.Windows.Forms.Label(); this.lblMoveInfo = new System.Windows.Forms.Label();
this.lblAgvInfo = new System.Windows.Forms.Label(); this.lblAgvInfo = new System.Windows.Forms.Label();
...@@ -730,6 +732,8 @@ ...@@ -730,6 +732,8 @@
this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.groupBox6.Controls.Add(this.btnUpdateShelf);
this.groupBox6.Controls.Add(this.txtShelfID);
this.groupBox6.Controls.Add(this.lblwidth); this.groupBox6.Controls.Add(this.lblwidth);
this.groupBox6.Controls.Add(this.lblMoveInfo); this.groupBox6.Controls.Add(this.lblMoveInfo);
this.groupBox6.Controls.Add(this.lblAgvInfo); this.groupBox6.Controls.Add(this.lblAgvInfo);
...@@ -742,6 +746,28 @@ ...@@ -742,6 +746,28 @@
this.groupBox6.TabStop = false; this.groupBox6.TabStop = false;
this.groupBox6.Text = "消息"; this.groupBox6.Text = "消息";
// //
// btnUpdateShelf
//
this.btnUpdateShelf.BackColor = System.Drawing.Color.White;
this.btnUpdateShelf.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdateShelf.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUpdateShelf.Location = new System.Drawing.Point(119, 435);
this.btnUpdateShelf.Name = "btnUpdateShelf";
this.btnUpdateShelf.Size = new System.Drawing.Size(110, 40);
this.btnUpdateShelf.TabIndex = 281;
this.btnUpdateShelf.Text = "更改料架号";
this.btnUpdateShelf.UseVisualStyleBackColor = false;
this.btnUpdateShelf.Click += new System.EventHandler(this.btnUpdateShelf_Click);
//
// txtShelfID
//
this.txtShelfID.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtShelfID.Location = new System.Drawing.Point(13, 444);
this.txtShelfID.MaxLength = 6;
this.txtShelfID.Name = "txtShelfID";
this.txtShelfID.Size = new System.Drawing.Size(100, 26);
this.txtShelfID.TabIndex = 280;
//
// lblwidth // lblwidth
// //
this.lblwidth.AutoSize = true; this.lblwidth.AutoSize = true;
...@@ -1328,6 +1354,8 @@ ...@@ -1328,6 +1354,8 @@
private System.Windows.Forms.CheckBox chbBoxSendShelf; private System.Windows.Forms.CheckBox chbBoxSendShelf;
private System.Windows.Forms.Button btnSwStop; private System.Windows.Forms.Button btnSwStop;
private System.Windows.Forms.Button btnOutStopDown; private System.Windows.Forms.Button btnOutStopDown;
private System.Windows.Forms.Button btnUpdateShelf;
private System.Windows.Forms.TextBox txtShelfID;
} }
} }
...@@ -618,6 +618,17 @@ namespace OnlineStore.AssemblyLine ...@@ -618,6 +618,17 @@ namespace OnlineStore.AssemblyLine
BtnMove(btnOutStopDown, "SL出料阻挡下降", "SL出料阻挡上升", IO_Type.SL_Out_StopDown); BtnMove(btnOutStopDown, "SL出料阻挡下降", "SL出料阻挡上升", IO_Type.SL_Out_StopDown);
} }
private void btnUpdateShelf_Click(object sender, EventArgs e)
{
string shel = txtShelfID.Text.Trim();
DialogResult result = MessageBox.Show("确定更改当前料架号为:" + shel + "?", "", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes))
{
LogUtil.info(equipBean.Name + "旧料架号【"+equipBean.CurrShelfId+"】手动更改料架号为【" + shel + "】");
equipBean.CurrShelfId = shel;
}
}
} }
} }
......
...@@ -9,6 +9,7 @@ using System.Linq; ...@@ -9,6 +9,7 @@ using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using OnlineStore.DeviceLibrary;
namespace OnlineStore.AssemblyLine namespace OnlineStore.AssemblyLine
{ {
...@@ -53,6 +54,10 @@ namespace OnlineStore.AssemblyLine ...@@ -53,6 +54,10 @@ namespace OnlineStore.AssemblyLine
[STAThread] [STAThread]
static void Main(string[] Args) static void Main(string[] Args)
{ {
//string code = " (X: 380,Y: 148) L00000000000WG9D19055;E20191230 0180;B7H.10618.5B1008082019123004000;R0080820191230E9600";
//string r = CodeManager.ReplaceCode(code);
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
......
...@@ -74,7 +74,7 @@ namespace OnlineStore.Common ...@@ -74,7 +74,7 @@ namespace OnlineStore.Common
try try
{ {
var wc = new MyWebClient(5000); var wc = new MyWebClient(10000);
if (string.IsNullOrEmpty(wc.Headers["Content-Type"])) if (string.IsNullOrEmpty(wc.Headers["Content-Type"]))
wc.Headers.Add("Content-Type", "application/json;charset=UTF-8"); wc.Headers.Add("Content-Type", "application/json;charset=UTF-8");
wc.Encoding = encoding; wc.Encoding = encoding;
...@@ -84,7 +84,7 @@ namespace OnlineStore.Common ...@@ -84,7 +84,7 @@ namespace OnlineStore.Common
} }
catch (Exception e) catch (Exception e)
{ {
LogUtil.error("POST ERROR:" + e.StackTrace, 1001); LogUtil.error("POST ERROR:" + e.ToString(), 1001);
} }
if (!result.Contains("null") && result.Length != 0) if (!result.Contains("null") && result.Length != 0)
{ {
......
...@@ -195,8 +195,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -195,8 +195,8 @@ namespace OnlineStore.DeviceLibrary
{ {
if (IOValue(IO_Type.DLine_SuddenStop).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.DLine_SuddenStop).Equals(IO_VALUE.LOW))
{ {
SetWarnMsg( Name + "收到急停信号"); SetWarnMsg(Name + "收到急停信号");
Alarm(LineAlarmType.SuddenStop); Alarm(LineAlarmType.SuddenStop);
return; return;
} }
...@@ -224,19 +224,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -224,19 +224,19 @@ namespace OnlineStore.DeviceLibrary
BusyMoveProcess(); BusyMoveProcess();
if(TrayLine1.MoveInfo.MoveType.Equals(LineMoveType.OutStore)) if (TrayLine1.MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{ {
TrayLine1.OutStoreProcess(); TrayLine1.OutStoreProcess();
} }
if (TrayLine2.MoveInfo.MoveType.Equals(LineMoveType.OutStore)) if (TrayLine2.MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{ {
TrayLine2.OutStoreProcess(); TrayLine2.OutStoreProcess();
} }
//判断流水线打开了才可以运行 //判断流水线打开了才可以运行
if (runStatus.Equals(LineRunStatus.Runing) && NoAlarm() && MoveInfo.MoveType.Equals(LineMoveType.None)) if (runStatus.Equals(LineRunStatus.Runing) && NoAlarm() && MoveInfo.MoveType.Equals(LineMoveType.None))
{ {
//皮带线3出口有料,分盘定位装置无料 //皮带线3出口有料,分盘定位装置无料
if (Line3TurnIsStop() && IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW)) if (Line3TurnIsStop() && IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW))
{ {
...@@ -247,10 +247,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -247,10 +247,10 @@ namespace OnlineStore.DeviceLibrary
//皮带线3转动,分料皮带转动, //皮带线3转动,分料皮带转动,
//等待料盘到达工位。 //等待料盘到达工位。
StartOutStoreMove(new InOutParam()); StartOutStoreMove(new InOutParam());
} }
} }
if ((runStatus .Equals(LineRunStatus.Runing)||runStatus.Equals(LineRunStatus.Busy))&& NoAlarm()) if ((runStatus.Equals(LineRunStatus.Runing) || runStatus.Equals(LineRunStatus.Busy)) && NoAlarm())
{ {
TrayLine1.TimerPro(); TrayLine1.TimerPro();
if (NgISBack()) if (NgISBack())
...@@ -258,6 +258,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -258,6 +258,15 @@ namespace OnlineStore.DeviceLibrary
TrayLine2.TimerPro(); TrayLine2.TimerPro();
} }
Line3TimerPro(); Line3TimerPro();
//小皮带线常转
if (runStatus >= LineRunStatus.HomeMoving)
{
if (IOValue(IO_Type.SeparateDevice_Run).Equals(IO_VALUE.LOW))
{
IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.HIGH);
}
}
} }
IOTimeOutProcess(); IOTimeOutProcess();
...@@ -270,6 +279,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -270,6 +279,7 @@ namespace OnlineStore.DeviceLibrary
{ {
IOMove(IO_Type.DLine_RunAlarm, IO_VALUE.HIGH); IOMove(IO_Type.DLine_RunAlarm, IO_VALUE.HIGH);
} }
} }
internal bool NgISBack() internal bool NgISBack()
{ {
......
...@@ -69,6 +69,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -69,6 +69,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return msg = deviceName + "未扫到条码"; return msg = deviceName + "未扫到条码";
} }
codeStr = CodeManager.ReplaceCode(codeStr);
//http://localhost/myproject/service/store/emptyPosForPutin //http://localhost/myproject/service/store/emptyPosForPutin
// 参数:cids: 多个 cid // 参数:cids: 多个 cid
//code: 条码内容 //code: 条码内容
...@@ -87,11 +88,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -87,11 +88,11 @@ namespace OnlineStore.DeviceLibrary
LineOperation serverResult = JsonHelper.DeserializeJsonToObject<LineOperation>(resultStr); LineOperation serverResult = JsonHelper.DeserializeJsonToObject<LineOperation>(resultStr);
if (serverResult == null) if (serverResult == null)
{ {
return msg = deviceName + " 条码【" + codeStr + "】没有收到服务器反馈"; return msg = deviceName + " 【" + codeStr + "】结果:没有收到服务器反馈";
} }
else if ((!string.IsNullOrEmpty(serverResult.msg)) || serverResult.result.Equals(0).Equals(false)) else if ((!string.IsNullOrEmpty(serverResult.msg)) || serverResult.result.Equals(0).Equals(false))
{ {
return msg = deviceName + " 条码【" + codeStr + "】 :" + serverResult.msg; return msg = deviceName + " 【" + codeStr + "】结果:" + serverResult.msg;
} }
if (!serverResult.pos.Equals("")) if (!serverResult.pos.Equals(""))
......
...@@ -255,7 +255,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -255,7 +255,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
/// <param name="message"></param> /// <param name="message"></param>
/// <returns></returns> /// <returns></returns>
private static string ReplaceCode(string message) public static string ReplaceCode(string message)
{ {
message = message.Trim(); message = message.Trim();
message = message.Replace("\r", ""); message = message.Replace("\r", "");
...@@ -268,10 +268,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -268,10 +268,15 @@ namespace OnlineStore.DeviceLibrary
List<byte> newBytes = new List<byte>(); List<byte> newBytes = new List<byte>();
foreach (byte by in bytes) foreach (byte by in bytes)
{ {
if (!by.Equals(24)) int value = (int)by;
if (value.Equals(24) || value.Equals(30) || value.Equals(29) || value.Equals(4))
{ {
newBytes.Add(by); continue;
} }
if (!value.Equals(24))
{
newBytes.Add(by);
}
} }
message = asciiEncoding.GetString(newBytes.ToArray()); message = asciiEncoding.GetString(newBytes.ToArray());
return message; return message;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!