Commit 667e0e04 LN

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

1 个父辈 ef93496b
......@@ -8,8 +8,8 @@
<add key="App_AutoRun" value="1" />
<add key="App_Title" value="流水线客户端" />
<!--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/"/>
<!--storeType-->
<add key="Line_moveEquip_count" value="18" />
<add key="Line_feedingEquip_count" value="4" />
......@@ -29,7 +29,7 @@
<!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code-->
<add key="CodeType" value="QR Code#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="Config_Pwd" value="123456" />
......@@ -39,7 +39,7 @@
<!--流水线监听端口-->
<add key="TCPServerPort" value="5246" />
<!--AGV调度服务器地址-->
<add key="AgvServerIp" value="10.80.160.20" />
<add key="AgvServerIp" value="192.168.103.22" />
<!--IO配置-->
<add key ="DIMS" value ="60"/>
<add key ="DOMS" value ="300"/>
......@@ -50,13 +50,29 @@
<add key ="OpenRFIDWrite" value ="1"/>
<add key="DefaultPWD" value ="123456"/>
<!--当前调试的设备ID,分号分割-->
<add key ="DebugDeviceId" value ="301"/>
<add key ="NeedScanCode" value ="1"/>
<add key ="DebugDeviceId" value ="0"/>
<add key ="Server_Log_Open" value ="0"/>
<add key ="Agv_Log_Open" value ="1"/>
<add key ="CodeCount" value ="1"/>
<add key ="DefaultTrayNum" value ="9"/>
<add key ="CodeCount" value ="3"/>
<add key ="DefaultTrayNum" value ="0"/>
<add key ="NeedScanCode" value ="1"/>
<add key ="Agv_Log_Open" value ="0"/>
</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>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/Line-RC1250.log" />
......@@ -84,11 +100,9 @@
<appender-ref ref="RollingLogFileAppender" />
</logger>
<logger name="TheRFID">
<level value="Debug" />
<level value="Info" />
<appender-ref ref="TheRFID" />
</logger>
<!--<root>
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
......
......@@ -64,6 +64,8 @@
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage3 = new System.Windows.Forms.TabPage();
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.lblMoveInfo = new System.Windows.Forms.Label();
this.lblAgvInfo = new System.Windows.Forms.Label();
......@@ -730,6 +732,8 @@
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.Right)));
this.groupBox6.Controls.Add(this.btnUpdateShelf);
this.groupBox6.Controls.Add(this.txtShelfID);
this.groupBox6.Controls.Add(this.lblwidth);
this.groupBox6.Controls.Add(this.lblMoveInfo);
this.groupBox6.Controls.Add(this.lblAgvInfo);
......@@ -742,6 +746,28 @@
this.groupBox6.TabStop = false;
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
//
this.lblwidth.AutoSize = true;
......@@ -1328,6 +1354,8 @@
private System.Windows.Forms.CheckBox chbBoxSendShelf;
private System.Windows.Forms.Button btnSwStop;
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
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;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
using OnlineStore.DeviceLibrary;
namespace OnlineStore.AssemblyLine
{
......@@ -53,6 +54,10 @@ namespace OnlineStore.AssemblyLine
[STAThread]
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);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
......
......@@ -74,7 +74,7 @@ namespace OnlineStore.Common
try
{
var wc = new MyWebClient(5000);
var wc = new MyWebClient(10000);
if (string.IsNullOrEmpty(wc.Headers["Content-Type"]))
wc.Headers.Add("Content-Type", "application/json;charset=UTF-8");
wc.Encoding = encoding;
......@@ -84,7 +84,7 @@ namespace OnlineStore.Common
}
catch (Exception e)
{
LogUtil.error("POST ERROR:" + e.StackTrace, 1001);
LogUtil.error("POST ERROR:" + e.ToString(), 1001);
}
if (!result.Contains("null") && result.Length != 0)
{
......
......@@ -195,7 +195,7 @@ namespace OnlineStore.DeviceLibrary
{
if (IOValue(IO_Type.DLine_SuddenStop).Equals(IO_VALUE.LOW))
{
SetWarnMsg( Name + "收到急停信号");
SetWarnMsg(Name + "收到急停信号");
Alarm(LineAlarmType.SuddenStop);
return;
......@@ -224,7 +224,7 @@ namespace OnlineStore.DeviceLibrary
BusyMoveProcess();
if(TrayLine1.MoveInfo.MoveType.Equals(LineMoveType.OutStore))
if (TrayLine1.MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{
TrayLine1.OutStoreProcess();
}
......@@ -250,7 +250,7 @@ namespace OnlineStore.DeviceLibrary
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();
if (NgISBack())
......@@ -258,6 +258,15 @@ namespace OnlineStore.DeviceLibrary
TrayLine2.TimerPro();
}
Line3TimerPro();
//小皮带线常转
if (runStatus >= LineRunStatus.HomeMoving)
{
if (IOValue(IO_Type.SeparateDevice_Run).Equals(IO_VALUE.LOW))
{
IOMove(IO_Type.SeparateDevice_Run, IO_VALUE.HIGH);
}
}
}
IOTimeOutProcess();
......@@ -270,6 +279,7 @@ namespace OnlineStore.DeviceLibrary
{
IOMove(IO_Type.DLine_RunAlarm, IO_VALUE.HIGH);
}
}
internal bool NgISBack()
{
......
......@@ -69,6 +69,7 @@ namespace OnlineStore.DeviceLibrary
{
return msg = deviceName + "未扫到条码";
}
codeStr = CodeManager.ReplaceCode(codeStr);
//http://localhost/myproject/service/store/emptyPosForPutin
// 参数:cids: 多个 cid
//code: 条码内容
......@@ -87,11 +88,11 @@ namespace OnlineStore.DeviceLibrary
LineOperation serverResult = JsonHelper.DeserializeJsonToObject<LineOperation>(resultStr);
if (serverResult == null)
{
return msg = deviceName + " 条码【" + codeStr + "】没有收到服务器反馈";
return msg = deviceName + " 【" + codeStr + "】结果:没有收到服务器反馈";
}
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(""))
......
......@@ -255,7 +255,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
private static string ReplaceCode(string message)
public static string ReplaceCode(string message)
{
message = message.Trim();
message = message.Replace("\r", "");
......@@ -268,7 +268,12 @@ namespace OnlineStore.DeviceLibrary
List<byte> newBytes = new List<byte>();
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))
{
continue;
}
if (!value.Equals(24))
{
newBytes.Add(by);
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!