Commit 9ecc8e31 刘韬

合并LN_07 Jan, 2021 1 次提交

1 个父辈 b35ac40c
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
this.groupBox1.Size = new System.Drawing.Size(456, 608); this.groupBox1.Size = new System.Drawing.Size(456, 608);
this.groupBox1.TabIndex = 105; this.groupBox1.TabIndex = 105;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "DO写入"; this.groupBox1.Text = "IO状态修改";
// //
// btnCloseDeviceLed // btnCloseDeviceLed
// //
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
this.btnDisDoorClose.Name = "btnDisDoorClose"; this.btnDisDoorClose.Name = "btnDisDoorClose";
this.btnDisDoorClose.Size = new System.Drawing.Size(135, 52); this.btnDisDoorClose.Size = new System.Drawing.Size(135, 52);
this.btnDisDoorClose.TabIndex = 268; this.btnDisDoorClose.TabIndex = 268;
this.btnDisDoorClose.Text = "激活电气维护门警报"; this.btnDisDoorClose.Text = "激活维护门警报";
this.btnDisDoorClose.UseVisualStyleBackColor = true; this.btnDisDoorClose.UseVisualStyleBackColor = true;
this.btnDisDoorClose.Click += new System.EventHandler(this.btnDisDoorClose_Click); this.btnDisDoorClose.Click += new System.EventHandler(this.btnDisDoorClose_Click);
// //
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
this.btnDisDoorOpen.Name = "btnDisDoorOpen"; this.btnDisDoorOpen.Name = "btnDisDoorOpen";
this.btnDisDoorOpen.Size = new System.Drawing.Size(135, 52); this.btnDisDoorOpen.Size = new System.Drawing.Size(135, 52);
this.btnDisDoorOpen.TabIndex = 267; this.btnDisDoorOpen.TabIndex = 267;
this.btnDisDoorOpen.Text = "关闭电气维护门警报"; this.btnDisDoorOpen.Text = "关闭维护门警报";
this.btnDisDoorOpen.UseVisualStyleBackColor = true; this.btnDisDoorOpen.UseVisualStyleBackColor = true;
this.btnDisDoorOpen.Click += new System.EventHandler(this.btnDisDoorOpen_Click); this.btnDisDoorOpen.Click += new System.EventHandler(this.btnDisDoorOpen_Click);
// //
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
this.button5.Name = "button5"; this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(135, 52); this.button5.Size = new System.Drawing.Size(135, 52);
this.button5.TabIndex = 265; this.button5.TabIndex = 265;
this.button5.Text = "打开进气口"; this.button5.Text = "开启进气口";
this.button5.UseVisualStyleBackColor = true; this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click); this.button5.Click += new System.EventHandler(this.button5_Click);
// //
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(104, 32); this.label3.Size = new System.Drawing.Size(104, 32);
this.label3.TabIndex = 247; this.label3.TabIndex = 247;
this.label3.Text = "选择:"; this.label3.Text = "端口:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
// //
// btnOpenLed // btnOpenLed
...@@ -384,7 +384,7 @@ ...@@ -384,7 +384,7 @@
this.label5.Name = "label5"; this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(103, 30); this.label5.Size = new System.Drawing.Size(103, 30);
this.label5.TabIndex = 237; this.label5.TabIndex = 237;
this.label5.Text = "保持(ms):"; this.label5.Text = "保持时间(ms):";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
// //
// cmbWriteIO // cmbWriteIO
...@@ -555,4 +555,3 @@ ...@@ -555,4 +555,3 @@
private System.Windows.Forms.Button btnOpenDeviceLed; private System.Windows.Forms.Button btnOpenDeviceLed;
} }
} }
...@@ -1574,6 +1574,8 @@ namespace OnlineStore.AutoInOutStore ...@@ -1574,6 +1574,8 @@ namespace OnlineStore.AutoInOutStore
LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ""); LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + "");
btnStart.Text = StopAuto; btnStart.Text = StopAuto;
DebugStatus(false); DebugStatus(false);
string msg = AutomaticBaiting.doStartBatchIn();
LogUtil.info("自动出入库: 开始自动入库:库位号【" + poText + "】,开始入库,结果:" + msg);
} }
} }
} }
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
this.groupBox6 = new System.Windows.Forms.GroupBox(); this.groupBox6 = new System.Windows.Forms.GroupBox();
this.picAxis2 = new System.Windows.Forms.PictureBox(); this.picAxis2 = new System.Windows.Forms.PictureBox();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.ioSingle = new UserFromControl.IOTextControl();
this.txtP4Offset = new System.Windows.Forms.TextBox(); this.txtP4Offset = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label();
this.txtP3Offset = new System.Windows.Forms.TextBox(); this.txtP3Offset = new System.Windows.Forms.TextBox();
...@@ -72,6 +71,7 @@ ...@@ -72,6 +71,7 @@
this.btnClear = new System.Windows.Forms.Button(); this.btnClear = new System.Windows.Forms.Button();
this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.ioSingle = new UserFromControl.IOTextControl();
this.groupBox6.SuspendLayout(); this.groupBox6.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picAxis2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picAxis2)).BeginInit();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
this.picAxis2.Image = ((System.Drawing.Image)(resources.GetObject("picAxis2.Image"))); this.picAxis2.Image = ((System.Drawing.Image)(resources.GetObject("picAxis2.Image")));
this.picAxis2.Location = new System.Drawing.Point(453, 13); this.picAxis2.Location = new System.Drawing.Point(453, 13);
this.picAxis2.Name = "picAxis2"; this.picAxis2.Name = "picAxis2";
this.picAxis2.Size = new System.Drawing.Size(551, 542); this.picAxis2.Size = new System.Drawing.Size(551, 502);
this.picAxis2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.picAxis2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picAxis2.TabIndex = 285; this.picAxis2.TabIndex = 285;
this.picAxis2.TabStop = false; this.picAxis2.TabStop = false;
...@@ -140,17 +140,6 @@ ...@@ -140,17 +140,6 @@
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
this.groupBox2.Text = "位置信息"; this.groupBox2.Text = "位置信息";
// //
// ioSingle
//
this.ioSingle.BackColor = System.Drawing.Color.White;
this.ioSingle.IOName = "检测信号";
this.ioSingle.IOValue = 0;
this.ioSingle.isCanClick = false;
this.ioSingle.Location = new System.Drawing.Point(46, 425);
this.ioSingle.Name = "ioSingle";
this.ioSingle.Size = new System.Drawing.Size(202, 28);
this.ioSingle.TabIndex = 289;
//
// txtP4Offset // txtP4Offset
// //
this.txtP4Offset.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.txtP4Offset.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
...@@ -540,9 +529,9 @@ ...@@ -540,9 +529,9 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.richTextBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.richTextBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.richTextBox1.Location = new System.Drawing.Point(454, 576); this.richTextBox1.Location = new System.Drawing.Point(454, 521);
this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(549, 88); this.richTextBox1.Size = new System.Drawing.Size(549, 143);
this.richTextBox1.TabIndex = 105; this.richTextBox1.TabIndex = 105;
this.richTextBox1.Text = ""; this.richTextBox1.Text = "";
// //
...@@ -551,6 +540,17 @@ ...@@ -551,6 +540,17 @@
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);
// //
// ioSingle
//
this.ioSingle.BackColor = System.Drawing.Color.White;
this.ioSingle.IOName = "检测信号";
this.ioSingle.IOValue = 0;
this.ioSingle.isCanClick = false;
this.ioSingle.Location = new System.Drawing.Point(46, 425);
this.ioSingle.Name = "ioSingle";
this.ioSingle.Size = new System.Drawing.Size(202, 28);
this.ioSingle.TabIndex = 289;
//
// FrmPositionTool // FrmPositionTool
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......
...@@ -12,76 +12,53 @@ using System.Security.Cryptography; ...@@ -12,76 +12,53 @@ using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Reflection; using System.Reflection;
using log4net; using log4net;
using System.Threading;
namespace OnlineStore.Common namespace OnlineStore.Common
{ {
public class HttpHelper public class HttpHelper
{ {
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static int isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open);
public static string Post(string url, string paramData) private static object lockObj = "";
public static Operation PostOP(string url, Operation operation, int lockTime = 0)
{ {
return Post(url, paramData, Encoding.UTF8); if (Monitor.TryEnter(lockObj, lockTime))
}
/// <summary>
///
/// </summary>
/// <param name="url"></param>
/// <param name="operation"></param>
/// <param name="simulate">是否模拟服务器返回结果</param>
/// <returns></returns>
public static Operation Post(string url, Operation operation, bool simulate)
{ {
try try
{ {
if (simulate)
{//模拟服务器返回
operation.status = 200;
operation.data.Clear();
operation.data.Add("posId", "A001");
string pos = "D100-111#D102-222#D104-333";
operation.data.Add("pos", pos);
if (operation.op == 1 || operation.op == 2)
{//入库或出库
string json = JsonHelper.SerializeObject(operation); string json = JsonHelper.SerializeObject(operation);
LogUtil.error(LOGGER, "模拟HTTP服务器返回出库入库信息:" + json); string result = PostJson(url, json, Encoding.UTF8);
return operation; if (operation.op > 0)
}
}
else
{
string json = "";
try
{ {
json = JsonHelper.SerializeObject(operation); LogUtil.info("send 【" + url + "】【" + json + "】 " + ",receive 【 " + result + "】");
} }
catch (Exception ex)
{
LOGGER.Error("JsonHelper.SerializeObject(operation) 出错【operation.op=" + operation.op + "】" + ex);
}
string result = Post(url, json);
if (!string.IsNullOrEmpty(result)) if (!string.IsNullOrEmpty(result))
{ {
try Operation resultOP = JsonHelper.DeserializeJsonToObject<Operation>(result);
if (resultOP != null && (!operation.seq.Equals(resultOP.seq)))
{ {
return JsonHelper.DeserializeJsonToObject<Operation>(result); LogUtil.error(" seq error : send 【" + json + "】 " + ",receive 【 " + result + "】");
}
return resultOP;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
LOGGER.Error("JsonHelper.DeserializeJsonToObject 出错【result=" + result + "】" + ex); LogUtil.error("PostOP error【operation.op=" + operation.op + "】:" + ex);
}
} }
finally
{
Monitor.Exit(lockObj);
} }
} }
catch (Exception ex) else if (lockTime > 10)
{ {
LOGGER.Error("Post 出错【operation.op=" + operation.op + "】:" + ex); string json = JsonHelper.SerializeObject(operation);
LogUtil.error(" PostOP " + lockTime + " send " + json + " TryEnter fail ");
} }
return null; return null;
} }
public static int isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open); public static string PostJson(string url, string paramData = "", Encoding encoding = null)
public static string Post(string url, string paramData="", Encoding encoding=null)
{ {
if (encoding == null) if (encoding == null)
{ {
...@@ -89,12 +66,9 @@ namespace OnlineStore.Common ...@@ -89,12 +66,9 @@ namespace OnlineStore.Common
} }
if (isLog == 1) if (isLog == 1)
{ {
LOGGER.Info("给服务器发送数据【" + paramData + "】 "); LogUtil.info("PostJson Send【" + paramData + "】 ");
}
if (paramData != "null" && paramData != null)
{
// LogUtil.debug(LOGGER, "HTTP POST to " + url + " \n\t >> " + paramData);
} }
string result = ""; string result = "";
if (url.ToLower().IndexOf("https", System.StringComparison.Ordinal) > -1) if (url.ToLower().IndexOf("https", System.StringComparison.Ordinal) > -1)
...@@ -112,19 +86,15 @@ namespace OnlineStore.Common ...@@ -112,19 +86,15 @@ namespace OnlineStore.Common
//paramData = Uri.EscapeDataString(paramData); //paramData = Uri.EscapeDataString(paramData);
result = wc.UploadString(url, "POST", paramData); result = wc.UploadString(url, "POST", paramData);
//LogUtil.info(result);
} }
catch (Exception e) catch (Exception e)
{ {
LogUtil.error( "POST【"+ paramData + "】 ERROR:" + e.StackTrace, 1); LogUtil.error("PostJson【" + paramData + "】 ERROR:" + e.StackTrace, 1);
}
if (!result.Contains("null") && result.Length != 0)
{
//LogUtil.debug(LOGGER,"receive << " + result);
} }
if (isLog == 1) if (isLog == 1)
{ {
LOGGER.Info("收到服务器数据【" + result + "】"); LogUtil.info("PostJson Revice【" + result + "】");
} }
return result; return result;
} }
...@@ -138,21 +108,81 @@ namespace OnlineStore.Common ...@@ -138,21 +108,81 @@ namespace OnlineStore.Common
{ {
try try
{ {
LogUtil.debug(LOGGER, "HTTP GET FROM: " + url); LogUtil.debug("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.debug(LOGGER, "receive << " + result); LogUtil.debug("receive << " + result);
return result; return result;
} }
} }
catch (Exception e) catch (Exception e)
{ {
LogUtil.error( "HTTP GET ERROR:" + e.Message, 2); LogUtil.error("HTTP GET ERROR:" + e.Message, 2);
} }
return ""; return "";
} }
public static string Post(string url, string paramData = "", int timeOut = 5000)
{
bool IsTimeOut = false;
return Post(url, paramData, Encoding.UTF8, timeOut, out IsTimeOut);
}
public static string Post(string url, string paramData, Encoding encoding, int timeOut, out bool IsTimeOut)
{
if (paramData.Equals(""))
{
int index = url.IndexOf("?");
if (index > 0)
{
paramData = url.Substring(index + 1, url.Length - index - 1);
url = url.Substring(0, index);
}
}
IsTimeOut = false;
if (isLog == 1)
{
LogUtil.info("Send【" + url + "】【" + paramData + "】 ");
}
string result = "";
if (url.ToLower().IndexOf("https", System.StringComparison.Ordinal) > -1)
{
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback((sender, certificate, chain, errors) => { return true; });
}
try
{
var wc = new MyWebClient(timeOut);
if (string.IsNullOrEmpty(wc.Headers["Content-Type"]))
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
wc.Encoding = encoding;
result = wc.UploadString(url, "POST", paramData);
//LogUtil.info(result);
}
catch (WebException ex)
{
IsTimeOut = true;
LogUtil.error("POST [" + url + "] WebException :" + ex.ToString());
}
catch (Exception e)
{
LogUtil.error("POST [" + url + "] ERROR:" + e.ToString());
}
if (isLog == 1)
{
LogUtil.info("Revice【" + result + "】");
}
return result;
}
} }
} }
\ No newline at end of file \ No newline at end of file
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using Newtonsoft.Json; using Newtonsoft.Json;
...@@ -16,9 +17,17 @@ namespace OnlineStore.Common ...@@ -16,9 +17,17 @@ namespace OnlineStore.Common
/// <returns>json字符串</returns> /// <returns>json字符串</returns>
public static string SerializeObject(object o) public static string SerializeObject(object o)
{ {
try
{
string json = JsonConvert.SerializeObject(o); string json = JsonConvert.SerializeObject(o);
return json; return json;
} }
catch (Exception ex)
{
LogUtil.error("JsonHelper.SerializeObject error【" + o.ToString() + "】" + ex);
}
return "";
}
/// <summary> /// <summary>
/// 解析JSON字符串生成对象实体 /// 解析JSON字符串生成对象实体
...@@ -28,12 +37,20 @@ namespace OnlineStore.Common ...@@ -28,12 +37,20 @@ namespace OnlineStore.Common
/// <returns>对象实体</returns> /// <returns>对象实体</returns>
public static T DeserializeJsonToObject<T>(string json) where T : class public static T DeserializeJsonToObject<T>(string json) where T : class
{ {
try
{
JsonSerializer serializer = new JsonSerializer(); JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json); StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(T)); object o = serializer.Deserialize(new JsonTextReader(sr), typeof(T));
T t = o as T; T t = o as T;
return t; return t;
} }
catch (Exception ex)
{
LogUtil.error(" JsonHelper.DeserializeJsonToObject error【" + json + "】" + ex);
}
return null;
}
/// <summary> /// <summary>
/// 解析JSON数组生成对象实体集合 /// 解析JSON数组生成对象实体集合
......
...@@ -135,6 +135,7 @@ namespace OnlineStore.Common ...@@ -135,6 +135,7 @@ namespace OnlineStore.Common
//logBox.SelectionColor = color; //logBox.SelectionColor = color;
System.DateTime now = System.DateTime.Now; System.DateTime now = System.DateTime.Now;
logBox.AppendText(now.ToLongTimeString() + " " + msg + Environment.NewLine); logBox.AppendText(now.ToLongTimeString() + " " + msg + Environment.NewLine);
logBox.ScrollToCaret();
count++; count++;
} }
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
......
...@@ -173,7 +173,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -173,7 +173,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
cc = HDCodeHelper.DecodeCode(ho_Image, codeCount, GetCodeParamFilePath(codeType), codeType); cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, 2000);
} }
foreach (CodeInfo c in cc) foreach (CodeInfo c in cc)
{ {
...@@ -189,7 +189,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -189,7 +189,7 @@ namespace OnlineStore.DeviceLibrary
{ {
// SaveImageToFile(deviceName, cameraName, bit); // SaveImageToFile(deviceName, cameraName, bit);
} }
LogUtil.info( " 【" + cameraName + "】扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】 :" + r); LogUtil.info(" 【" + cameraName + "】" + " 扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】 :" + r);
} }
catch (AccessViolationException e) catch (AccessViolationException e)
{ {
...@@ -294,18 +294,5 @@ namespace OnlineStore.DeviceLibrary ...@@ -294,18 +294,5 @@ namespace OnlineStore.DeviceLibrary
{ {
return Regex.IsMatch(str, @"[\u4e00-\u9fa5]"); return Regex.IsMatch(str, @"[\u4e00-\u9fa5]");
} }
public static string ProcessCode(List<string> codeList)
{
string code = "";
foreach (string cc in codeList)
{
if (string.IsNullOrEmpty(cc))
{
continue;
}
code += cc + "##";
}
return ReplaceCode(code);
}
} }
} }
...@@ -50,15 +50,15 @@ AXIS,(轴四)压紧轴,Comp_Axis,3,HC,0,,,,, ...@@ -50,15 +50,15 @@ AXIS,(轴四)压紧轴,Comp_Axis,3,HC,0,,,,,
AXIS,(轴五)批量上下料轴,Batch_Axis,4,HC,0,,,,, AXIS,(轴五)批量上下料轴,Batch_Axis,4,HC,0,,,,,
,,,,,,,,,, ,,,,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,升降轴 仓门位置P7(人工拿走盘的位置),UpDownAxis_Door_P7,343100,,,,,,, PRO,升降轴 仓门位置P7(人工拿走盘的位置),UpDownAxis_Door_P7,3473,,,,,,,
PRO,升降轴 出库高点P2,UpDownAxis_OutHigh_P2,231250,,,,,,, PRO,升降轴 出库高点P2,UpDownAxis_OutHigh_P2,2276,,,,,,,
PRO,升降轴 出库低点P8,UpDownAxis_OutLow_P8,214900,,,,,,, PRO,升降轴 出库低点P8,UpDownAxis_OutLow_P8,2113,,,,,,,
PRO,升降轴从吸盘下方接料后下降的高度,UpDownAxis_DownValue,10000,,,,,,, PRO,升降轴从吸盘下方接料后下降的高度,UpDownAxis_DownValue,100,,,,,,,
PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,8#393356;12#387000;16#387700;20#385000;24#381620;28#381620;32#381620;36#375200;40#375200;48#375200;52#375200;75#375200;,,,,,,, PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,8#3926;12#3884;16#3840;20#3800;24#3759;,,,,,,,
PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,245700,,,,,,, PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,3060,,,,,,,
PRO,进出轴(轴三)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,, PRO,进出轴(轴三)P1待机原位点,InOutAxis_P1_Position,100,,,,,,,
PRO,压紧轴(轴四)P1待机原位点,CompressAxis_P1_Position,24900,,,,,,, PRO,压紧轴(轴四)P1待机原位点,CompressAxis_P1_Position,7000,,,,,,,
PRO,压紧轴(轴四)P2压紧点集合,CompressAxis_P2_List,8#417100;12#380400;16#370000;20#330000;24#319450;28#300000;32#200000;36#200000;40#200000;44#200000;48#196500;52#24900;75#24900;81#314421;,,,,,,, PRO,压紧轴(轴四)P2压紧点集合,CompressAxis_P2_List,8#42835;12#38557;16#34550;20#30540;24#26030;,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,, PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,, PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,,,, PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,,,,
...@@ -68,25 +68,24 @@ PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,180,,,,,,, ...@@ -68,25 +68,24 @@ PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,180,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,, PRO,预警温度,WarnTemperate,80,,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,, PRO,预警湿度,WarnHumidity,80,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,500,,,,,,, PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,100,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,1000,,,,,,, PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,400,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,1000,,,,,,, PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,400,,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,30,,,,,,, PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,90,,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,250,,,,,,, PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,100,,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,3000,,,,,,, PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,500,,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,200,,,,,,, PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,400,,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,800,,,,,,, PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,1200,,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,800,,,,,,, PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,1200,,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,20,,,,,,, PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,250,,,,,,, PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,250,,,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,3000,,,,,,, PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,3000,,,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,5000,,,,,,, PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,1000,,,,,,,
PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,5000,,,,,,, PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,5000,,,,,,,
PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,5000,,,,,,, PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,5000,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,200,,,,,,, PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,80,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,800,,,,,,, PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,200,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,5000,,,,,,, PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,3000,,,,,,,
PRO,升降轴(轴二)到仓门速度,UpDownAxis_Door_Speed,500,,,,,,,
PRO,升降轴(轴二)P1速度,UpDownAxis_P1_Speed,2000,,,,,,, PRO,升降轴(轴二)P1速度,UpDownAxis_P1_Speed,2000,,,,,,,
PRO,升降轴(轴二)P2速度,UpDownAxis_P2_Speed,2000,,,,,,, PRO,升降轴(轴二)P2速度,UpDownAxis_P2_Speed,2000,,,,,,,
PRO,升降轴(轴二)P3速度,UpDownAxis_P3_Speed,2000,,,,,,, PRO,升降轴(轴二)P3速度,UpDownAxis_P3_Speed,2000,,,,,,,
...@@ -97,15 +96,15 @@ PRO,升降轴(轴二)到仓门P7速度,UpDownAxis_P7_Speed,2000,,,,,,, ...@@ -97,15 +96,15 @@ PRO,升降轴(轴二)到仓门P7速度,UpDownAxis_P7_Speed,2000,,,,,,,
PRO,升降轴(轴二)P8速度,UpDownAxis_P8_Speed,100,,,,,,, PRO,升降轴(轴二)P8速度,UpDownAxis_P8_Speed,100,,,,,,,
PRO,旋转轴(轴一)P1速度,MiddleAxis_P1_Speed,800,,,,,,, PRO,旋转轴(轴一)P1速度,MiddleAxis_P1_Speed,800,,,,,,,
PRO,旋转轴(轴一)P2速度,MiddleAxis_P2_Speed,800,,,,,,, PRO,旋转轴(轴一)P2速度,MiddleAxis_P2_Speed,800,,,,,,,
PRO,进出轴(轴三)P1速度,InOutAxis_P1_Speed,600,,,,,,, PRO,进出轴(轴三)P1速度,InOutAxis_P1_Speed,1200,,,,,,,
PRO,进出轴(轴三)P2速度,InOutAxis_P2_Speed,300,,,,,,, PRO,进出轴(轴三)P2速度,InOutAxis_P2_Speed,1600,,,,,,,
PRO,进出轴(轴三)P3速度,InOutAxis_P3_Speed,300,,,,,, , PRO,进出轴(轴三)P3速度,InOutAxis_P3_Speed,1600,,,,,, ,
PRO,(轴一)旋转轴最小误差脉冲值,MiddleAxis_ErrorCountMin,10,,,,,,, PRO,(轴一)旋转轴最小误差脉冲值,MiddleAxis_ErrorCountMin,5,,,,,,,
PRO,(轴二)升降轴轴最小误差脉冲值,UpdownAxis_ErrorCountMin,10,,,,,,, PRO,(轴二)升降轴轴最小误差脉冲值,UpdownAxis_ErrorCountMin,5,,,,,,,
PRO,(轴三)进出轴最小误差脉冲值,InoutAxis_ErrorCountMin,10,,,,,,, PRO,(轴三)进出轴最小误差脉冲值,InoutAxis_ErrorCountMin,5,,,,,,,
PRO,(轴一)旋转轴最大误差脉冲值,MiddleAxis_ErrorCountMax,1000,,,,,,, PRO,(轴一)旋转轴最大误差脉冲值,MiddleAxis_ErrorCountMax,20,,,,,,,
PRO,(轴二)升降轴轴最大误差脉冲值,UpdownAxis_ErrorCountMax,1000,,,,,,, PRO,(轴二)升降轴轴最大误差脉冲值,UpdownAxis_ErrorCountMax,20,,,,,,,
PRO,(轴三)进出轴最大误差脉冲值,InoutAxis_ErrorCountMax,1000,,,,,,, PRO,(轴三)进出轴最大误差脉冲值,InoutAxis_ErrorCountMax,20,,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,, PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,, , PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,, ,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,, PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
...@@ -124,37 +123,37 @@ PRO,温湿度端口号,Humiture_Port,COM5,,,,,,, ...@@ -124,37 +123,37 @@ PRO,温湿度端口号,Humiture_Port,COM5,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,200,,,,,,, PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,20000,,,,,,,
PRO,(轴五)上料轴慢速匀速上升速度,BatchAxis_SlowSpeed,200,,,,,,, PRO,(轴五)上料轴慢速匀速上升速度,BatchAxis_SlowSpeed,10000,,,,,,,
PRO,(轴五)上料轴加速度,BatchAxis_AddSpeed,4000,,,,,,, PRO,(轴五)上料轴加速度,BatchAxis_AddSpeed,60000,,,,,,,
PRO,(轴五)上料轴减速度,BatchAxis_DelSpeed,4000,,,,,,, PRO,(轴五)上料轴减速度,BatchAxis_DelSpeed,60000,,,,,,,
PRO,(轴五)上料轴原点低速,BatchAxis_HomeLowSpeed,20,,,,,,, PRO,(轴五)上料轴原点低速,BatchAxis_HomeLowSpeed,20000,,,,,,,
PRO,(轴五)上料轴原点高速,BatchAxis_HomeHighSpeed,80,,,,,,, PRO,(轴五)上料轴原点高速,BatchAxis_HomeHighSpeed,30000,,,,,,,
PRO,(轴五)上料轴原点加速度,BatchAxis_HomeAddSpeed,2000,,,,,, , PRO,(轴五)上料轴原点加速度,BatchAxis_HomeAddSpeed,90000,,,,,, ,
PRO,(轴五)上料轴P1点(出库时接料盘的位置),BatchAxis_P1,1610000,,,,,, , PRO,(轴五)上料轴P1点(出库时接料盘的位置),BatchAxis_P1,290669,,,,,, ,
PRO,(轴五)上料轴P2点(待机点),BatchAxis_P2,10000,,,,,,, PRO,(轴五)上料轴P2点(待机点),BatchAxis_P2,3000,,,,,,,
PRO,(轴五)上料轴P2速度,BatchAxis_P2_Speed,1000,,,,,,, PRO,(轴五)上料轴P2速度,BatchAxis_P2_Speed,15000,,,,,,,
PRO,(轴五)上料轴最小误差脉冲值,BatchAxis_ErrorCountMin,10,,,,,,, PRO,(轴五)上料轴最小误差脉冲值,BatchAxis_ErrorCountMin,100,,,,,,,
PRO,(轴五)上料轴最大误差脉冲值,BatchAxis_ErrorCountMax,1000,,,,,,, PRO,(轴五)上料轴最大误差脉冲值,BatchAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴五)上料轴最小限位,BatchAxis_PositionMin,0,,,,,,, PRO,(轴五)上料轴最小限位,BatchAxis_PositionMin,0,,,,,,,
PRO,(轴五)上料轴最大限位,BatchAxis_PositionMax,0,,,,,,, PRO,(轴五)上料轴最大限位,BatchAxis_PositionMax,0,,,,,,,
PRO,(轴五)上料轴出料时距离检测信号需要下降的高度,BatchAxis_OutDownPosition,30000,,,,,,, PRO,(轴五)上料轴出料时距离检测信号需要下降的高度,BatchAxis_OutDownPosition,10,,,,,,,
PRO,(轴五)上料轴出料时检测到料盘需要下降的高度,BatchAxis_DownPosition2,150000,,,,,,, PRO,(轴五)上料轴出料时检测到料盘需要下降的高度,BatchAxis_DownPosition2,3000,,,,,,,
PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,2000,,,,,,, PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,20000,,,,,,,
PRO,(轴五)上料轴最最大料盘高度,到达后无法批量出库,BatchAxis_MaxHeight,250,,,,,,, PRO,(轴五)上料轴最最大料盘高度,到达后无法批量出库,BatchAxis_MaxHeight,250,,,,,,,
PRO,最后一盘料需要补充的高度,LastTrayAddHeight,7,,,,,,, PRO,最后一盘料需要补充的高度,LastTrayAddHeight,7,,,,,,,
PRO,(轴五)上料轴P3点(上料目标位置),BatchAxis_P3,1724717,,,,,,, PRO,(轴五)上料轴P3点(上料目标位置),BatchAxis_P3,362062,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,(轴二)升降轴单盘入库抬升料盘的高度,UpdownAxis_UpPosition,1000,,,,,,, PRO,(轴二)升降轴单盘入库抬升料盘的高度,UpdownAxis_UpPosition,100,,,,,,,
PRO,(轴五)上料轴出库上升最大高度,BatchAxis_OutMaxValue,1491390,,,,,,, PRO,(轴五)上料轴出库上升最大高度,BatchAxis_OutMaxValue,100,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,(轴四)压紧轴目标速度,CompAxis_TargetSpeed,30000,,,,,,, PRO,(轴四)压紧轴目标速度,CompAxis_TargetSpeed,10000,,,,,,,
PRO,(轴四)压紧轴加速度,CompAxis_AddSpeed,15000,,,,,,, PRO,(轴四)压紧轴加速度,CompAxis_AddSpeed,25000,,,,,,,
PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,15000,,,,,,, PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,25000,,,,,,,
PRO,(轴四)压紧轴原点低速,CompAxis_HomeLowSpeed,3000,,,,,,, PRO,(轴四)压紧轴原点低速,CompAxis_HomeLowSpeed,3000,,,,,,,
PRO,(轴四)压紧轴原点高速,CompAxis_HomeHighSpeed,5000,,,,,,, PRO,(轴四)压紧轴原点高速,CompAxis_HomeHighSpeed,5000,,,,,,,
PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,10000,,,,,,, PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,10000,,,,,,,
PRO,(轴四)压紧轴P1速度,CompAxis_P1_Speed,1100,,,,,,, PRO,(轴四)压紧轴P1速度,CompAxis_P1_Speed,3000,,,,,,,
PRO,(轴四)压紧轴P2速度,CompAxis_P2_Speed,1100,,,,,,, PRO,(轴四)压紧轴P2速度,CompAxis_P2_Speed,7500,,,,,,,
PRO,(轴四)压紧轴P3速度,CompAxis_P3_Speed,1100,,,,,,, PRO,(轴四)压紧轴P3速度,CompAxis_P3_Speed,7500,,,,,,,
PRO,特殊二维码尺寸配置,CodeSizeConfig,T;PartNum;1=330x81,,,,,,, PRO,特殊二维码尺寸配置,CodeSizeConfig,T;PartNum;1=330x81,,,,,,,
...@@ -113,7 +113,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -113,7 +113,7 @@ namespace OnlineStore.DeviceLibrary
return true; return true;
} }
} }
private DateTime preRWTime = DateTime.Now;
private void CheckWait() private void CheckWait()
{ {
List<WaitResultInfo> list = StoreMove.WaitList; List<WaitResultInfo> list = StoreMove.WaitList;
...@@ -169,16 +169,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -169,16 +169,29 @@ namespace OnlineStore.DeviceLibrary
{ {
timeOutMs = 650000; timeOutMs = 650000;
} }
//if (!wait.IsEnd && span.TotalSeconds > 2 && wait.IoType.Equals(IO_Type.SuckingDisc_Air)) TimeSpan rwSpan = DateTime.Now - preRWTime;
//{ if (wait.IsEnd.Equals(false) && rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < 30 && Config.DOList.ContainsKey(wait.IoType))
// string ioType = IO_Type.SuckingDisc_Work; {
// IO_VALUE doValue = IOManager.DOValue(ioType); preRWTime = DateTime.Now;
// if (!doValue.Equals(wait.IoValue)) string msg = " [" + StoreMove.MoveType + "][" + StoreMove.MoveStep + "] " + NotOkMsg + "已等待 " + Math.Round(span.TotalSeconds, 1) + "秒,重写DO:";
// { bool isLog = false;
// LogUtil.error("等待[" + NotOkMsg + "],重写DO(" + ioType + "=" + wait.IoValue + ")"); foreach (WaitResultInfo ww in list)
// IOManager.IOMove(ioType, wait.IoValue); {
// } if (ww != null && ww.WaitType.Equals(2) && Config.DOList.ContainsKey(ww.IoType))
//} {
if (IOManager.DOValue(ww.IoType).Equals(ww.IoValue).Equals(false))
{
isLog = true;
IOManager.IOMove(ww.IoType, ww.IoValue);
msg += ww.ToStr() + ",";
}
}
}
if (isLog)
{
LogUtil.error(StoreName + msg);
}
}
if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs) if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
{ {
ConfigIO io = Config.getWaitIO(wait.IoType); ConfigIO io = Config.getWaitIO(wait.IoType);
...@@ -253,12 +266,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -253,12 +266,12 @@ namespace OnlineStore.DeviceLibrary
} }
else if (span.TotalSeconds > StoreMove.TimeOutSeconds) else if (span.TotalSeconds > StoreMove.TimeOutSeconds)
{ {
//string msg = string.Format(ResourceControl.GetString(ResourceControl.MoveTimeOut), "[" + StoreMove.MoveStep + "]" , string p1 = "[" + StoreMove.MoveStep + "]";
// "[" + NotOkMsg + "]","[" + Math.Round(span.TotalSeconds, 1) + "]"); string p2 = "[" + NotOkMsg + "]";
string msg = ResourceControl.MoveTimeOut+ "[" + StoreMove.MoveStep + "]"+ $"[{((Wait_Type)waitType).ToString()}]"+ string p3 = "[" + Math.Round(span.TotalSeconds, 1) + "]";
"[" + NotOkMsg + "]"+ "[" + Math.Round(span.TotalSeconds, 1) + "]"; string msg = ResourceControl.GetString(ResourceControl.MoveTimeOut, p1 + ResourceControl.GetString(ResourceControl.TimeOut, "超时") + p2 + p3, p1, p2, p3);
string newType = ResourceControl.MoveTimeOut; string newType = ResourceControl.MoveTimeOut;
SetWaitWarnMsg(msg, newType, StoreMove.MoveStep + "", Math.Round(span.TotalSeconds, 1) + ""); SetWaitWarnMsg(msg, newType, p1, p2, p3);
LogUtil.error(WarnObj.WarnMsg, 15); LogUtil.error(WarnObj.WarnMsg, 15);
Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnObj.WarnMsg, StoreMove.MoveType); Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnObj.WarnMsg, StoreMove.MoveType);
} }
...@@ -558,7 +571,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -558,7 +571,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_14_GoBack) else if (StoreMove.MoveStep == StoreMoveStep.SI_14_GoBack)
{ {
preProTime = DateTime.Now.AddSeconds(-5);
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
LogUtil.info(LOGGER, " 【" + posId + "】 入库结束,耗时【" + FormUtil.GetSpanStr(InOutWatch.Elapsed) + "】!"); LogUtil.info(LOGGER, " 【" + posId + "】 入库结束,耗时【" + FormUtil.GetSpanStr(InOutWatch.Elapsed) + "】!");
StoreMove.EndMove(); StoreMove.EndMove();
...@@ -696,9 +709,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -696,9 +709,9 @@ namespace OnlineStore.DeviceLibrary
InStoreLog("入库:SIS_38 ,清理扫码信息,开始扫码,最多等待6000 "); InStoreLog("入库:SIS_38 ,清理扫码信息,开始扫码,最多等待6000 ");
AutomaticBaiting.ClearInStoreInfo(); AutomaticBaiting.ClearInStoreInfo();
StoreMove.NextMoveStep(StoreMoveStep.SIS_38_ScanCode); StoreMove.NextMoveStep(StoreMoveStep.SIS_38_ScanCode);
StoreMove.OneWaitCanEndStep = true;
StoreMove.WaitList.Add(WaitResultInfo.WaitCodeOK()); StoreMove.WaitList.Add(WaitResultInfo.WaitCodeOK());
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(6000)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(9000));
StoreMove.OneWaitCanEndStep = true;
AutomaticBaiting.GetCameraCode(); AutomaticBaiting.GetCameraCode();
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_38_ScanCode)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_38_ScanCode))
......
...@@ -376,8 +376,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -376,8 +376,9 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_SuckingDisc_Up); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_SuckingDisc_Up);
InStoreLog(" 吸盘上升"); InStoreLog(" 吸盘上升");
CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, false); //CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, false);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampingDisc_Down, IO_VALUE.LOW)); //StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampingDisc_Down, IO_VALUE.LOW));
CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, true);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1500)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1500));
} }
...@@ -479,7 +480,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -479,7 +480,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.debug(Name + StoreMove.MoveStep + "入料: 从服务器获取入库PosId,尺寸:【" + LastWidth + "*" + LastHeight + "】二维码【" + LastCode + "】"); LogUtil.debug(Name + StoreMove.MoveStep + "入料: 从服务器获取入库PosId,尺寸:【" + LastWidth + "*" + LastHeight + "】二维码【" + LastCode + "】");
GetInStorePosId(ProcessMsg()); GetInStorePosId(ProcessMsg());
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(3000)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(5000));
} }
} }
else if (span.TotalSeconds > 60) else if (span.TotalSeconds > 60)
...@@ -514,6 +515,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -514,6 +515,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
InStoreLog(" 入库失败,尺寸:【" + LastWidth + "*" + LastHeight + "】将料盘送出,等待料盘拿走"); InStoreLog(" 入库失败,尺寸:【" + LastWidth + "*" + LastHeight + "】将料盘送出,等待料盘拿走");
StoreManager.cancelPutInTask(LastSendCode);
SendTrayOut(); SendTrayOut();
} }
} }
...@@ -637,8 +639,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -637,8 +639,8 @@ namespace OnlineStore.DeviceLibrary
if (IOManager.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.HIGH))
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I03_ScanCode); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I03_ScanCode);
InStoreLog(" 开始扫码,最多等待10000 "); InStoreLog(" 开始扫码,最多等待9000 ");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(10000)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(9000));
StoreMove.WaitList.Add(WaitResultInfo.WaitCodeOK()); StoreMove.WaitList.Add(WaitResultInfo.WaitCodeOK());
StoreMove.OneWaitCanEndStep = true; StoreMove.OneWaitCanEndStep = true;
GetCameraCode(); GetCameraCode();
......
...@@ -77,6 +77,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -77,6 +77,7 @@ namespace OnlineStore.DeviceLibrary
}*/ }*/
return false; return false;
} }
protected static DateTime preRWTime = DateTime.Now;
private static void CheckWait() private static void CheckWait()
{ {
List<WaitResultInfo> list = StoreMove.WaitList; List<WaitResultInfo> list = StoreMove.WaitList;
...@@ -112,43 +113,45 @@ namespace OnlineStore.DeviceLibrary ...@@ -112,43 +113,45 @@ namespace OnlineStore.DeviceLibrary
else if (wait.WaitType == (int)Wait_Type.IOMove_2) else if (wait.WaitType == (int)Wait_Type.IOMove_2)
{ {
wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue); wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue);
//int timeOutMs = StoreManager.Config.IOSingle_TimerOut; //如果是气缸动作,若Do未输出,重新写一遍
//timeOutMs = 20; //if ((!wait.IsEnd )&& span.TotalSeconds > 2)
//if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
//{ //{
// ConfigIO io = StoreManager.Config.getWaitIO(wait.IoType); // if (wait.IoType.Equals(IO_Type.ClampingDisc_Down) || wait.IoType.Equals(IO_Type.ClampingDisc_Up))
// WarnMsg = "[" + StoreMove.MoveStep + "] 等待[" + io.ElectricalDefinition + "_" + io.Explain + "=" + wait.IoValue + "]超时"; // {
// StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType); // IO_VALUE doValue = IOManager.DOValue(wait.IoType);
// LogUtil.error(WarnMsg, 101); // if (!doValue.Equals(wait.IoValue))
// isOk = false; // {
// break; // LogUtil.error("等待[" + NotOkMsg + "],重写DO(" + wait.IoType + "=" + wait.IoValue + ")");
// IOManager.IOMove(wait.IoType, wait.IoValue);
// string ioType = wait.IoType.Equals(IO_Type.ClampingDisc_Down) ? IO_Type.ClampingDisc_Up : IO_Type.ClampingDisc_Down;
// IO_VALUE ioValue = wait.IoValue.Equals(IO_VALUE.LOW) ? IO_VALUE.HIGH : IO_VALUE.LOW;
// LogUtil.error("等待[" + wait.ToStr() + "],重写气缸DO(" + ioType + "=" + ioValue + ")");
// IOManager.IOMove(ioType, ioValue);
// }
// }
//} //}
//如果是气缸动作,若Do未输出,重新写一遍 TimeSpan rwSpan = DateTime.Now - preRWTime;
if (!wait.IsEnd && span.TotalSeconds > 2) if (wait.IsEnd.Equals(false) && rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < 30 && StoreManager.Store.Config.DOList.ContainsKey(wait.IoType))
{
preRWTime = DateTime.Now;
string msg = " [" + StoreMove.MoveType + "][" + StoreMove.MoveStep + "] " + NotOkMsg + "已等待 " + Math.Round(span.TotalSeconds, 1) + "秒,重写DO:";
bool isLog = false;
foreach (WaitResultInfo ww in list)
{ {
if (wait.IoType.Equals(IO_Type.ClampingDisc_Down) || wait.IoType.Equals(IO_Type.ClampingDisc_Up)) if (ww != null && ww.WaitType.Equals(2) && StoreManager.Store.Config.DOList.ContainsKey(ww.IoType))
{ {
IO_VALUE doValue = IOManager.DOValue(wait.IoType); if (IOManager.DOValue(ww.IoType).Equals(ww.IoValue).Equals(false))
if (!doValue.Equals(wait.IoValue))
{ {
LogUtil.error("等待[" + NotOkMsg + "],重写DO(" + wait.IoType + "=" + wait.IoValue + ")"); isLog = true;
IOManager.IOMove(wait.IoType, wait.IoValue); IOManager.IOMove(ww.IoType, ww.IoValue);
string ioType = wait.IoType.Equals(IO_Type.ClampingDisc_Down) ? IO_Type.ClampingDisc_Up : IO_Type.ClampingDisc_Down; msg += ww.ToStr() + ",";
IO_VALUE ioValue = wait.IoValue.Equals(IO_VALUE.LOW) ? IO_VALUE.HIGH : IO_VALUE.LOW;
LogUtil.error("等待[" + wait.ToStr() + "],重写气缸DO(" + ioType + "=" + ioValue + ")");
IOManager.IOMove(ioType, ioValue);
} }
} }
//else if (wait.IoType.Equals(IO_Type.SuckingDisc_Air)) }
//{ if (isLog)
// string ioType = IO_Type.SuckingDisc_Work; {
// IO_VALUE doValue = IOManager.DOValue(ioType); LogUtil.error(Name + msg);
// if (!doValue.Equals(wait.IoValue)) }
// {
// LogUtil.error("等待[" + NotOkMsg + "],重写DO(" + ioType + "=" + wait.IoValue + ")");
// IOManager.IOMove(ioType, wait.IoValue);
// }
//}
} }
} }
else if (wait.WaitType == (int)Wait_Type.Time_3) else if (wait.WaitType == (int)Wait_Type.Time_3)
...@@ -163,10 +166,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -163,10 +166,9 @@ namespace OnlineStore.DeviceLibrary
IO_VALUE value = (IO_VALUE)ACServerManager.GetHomeSingle(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()); IO_VALUE value = (IO_VALUE)ACServerManager.GetHomeSingle(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
wait.IsEnd = wait.IoValue.Equals(value); wait.IsEnd = wait.IoValue.Equals(value);
} }
else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10) else if (wait.WaitType == (int)Wait_Type.BatchAxisMove_10)
{ {
wait.IsEnd = BatchAxisIsEnd(wait,span); wait.IsEnd = BatchAxisIsEnd(wait, span);
if (wait.IsEnd) if (wait.IsEnd)
{ {
BatchAxisController.StopCheck(); BatchAxisController.StopCheck();
...@@ -205,7 +207,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -205,7 +207,7 @@ namespace OnlineStore.DeviceLibrary
{ {
string msg = "[" + StoreMove.MoveStep + "]" + ResourceControl.GetString(ResourceControl.TimeOut, "超时") + " [" + NotOkMsg + "][" + Math.Round(span.TotalSeconds, 0) + "秒]"; string msg = "[" + StoreMove.MoveStep + "]" + ResourceControl.GetString(ResourceControl.TimeOut, "超时") + " [" + NotOkMsg + "][" + Math.Round(span.TotalSeconds, 0) + "秒]";
string newType = ResourceControl.MoveTimeOut + "_" + waitType.ToString().PadLeft(2, '0'); string newType = ResourceControl.MoveTimeOut + "_" + waitType.ToString().PadLeft(2, '0');
SetWaitWarnMsg(msg, newType,StoreMove.MoveStep+"", Math.Round(span.TotalSeconds, 0) + ""); SetWaitWarnMsg(msg, newType, StoreMove.MoveStep + "", Math.Round(span.TotalSeconds, 0) + "");
LogUtil.error(msg, 102); LogUtil.error(msg, 102);
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", msg, StoreMove.MoveType); StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, "", msg, StoreMove.MoveType);
} }
...@@ -395,7 +397,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -395,7 +397,7 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(lowType, IO_VALUE.LOW); IOManager.IOMove(lowType, IO_VALUE.LOW);
IOManager.IOMove(highType, IO_VALUE.HIGH); IOManager.IOMove(highType, IO_VALUE.HIGH);
} }
private static string LastSendCode = "";
public static string ProcessMsg() public static string ProcessMsg()
{ {
string msg = ""; string msg = "";
...@@ -423,6 +425,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -423,6 +425,8 @@ namespace OnlineStore.DeviceLibrary
{ {
msg = msg + "=1+0x0-" + LastWidth + "x" + LastHeight + "=" + LastCode + spiltStr; msg = msg + "=1+0x0-" + LastWidth + "x" + LastHeight + "=" + LastCode + spiltStr;
} }
msg = CodeManager.ReplaceCode(msg);
LastSendCode = msg;
return msg; return msg;
} }
//=1+0x0-13x24=201810220856;025;5N02018101;121;700012865;92498;1800;## //=1+0x0-13x24=201810220856;025;5N02018101;121;700012865;92498;1800;##
...@@ -486,10 +490,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -486,10 +490,10 @@ namespace OnlineStore.DeviceLibrary
public static InOutStoreParam GetInStoreParam(string LogName, string message) public static InOutStoreParam GetInStoreParam(string LogName, string message)
{ {
message = CodeManager.ReplaceCode(message); //message = CodeManager.ReplaceCode(message);
if (message.Equals("") || string.IsNullOrEmpty(message)) if (message.Equals("") || string.IsNullOrEmpty(message))
{ {
CodeMsg =ResourceControl.GetString(ResourceControl.NoCodeMsg, "没有收到二维码信息,请重新放入料盘"); CodeMsg = ResourceControl.GetString(ResourceControl.NoCodeMsg, "没有收到二维码信息,请重新放入料盘");
LogUtil.info(LogName + "没有收到二维码信息,请重新放入料盘"); LogUtil.info(LogName + "没有收到二维码信息,请重新放入料盘");
return null; return null;
} }
...@@ -522,11 +526,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -522,11 +526,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil.debug("添加自动入库库位号:" + autoposId); LogUtil.debug("添加自动入库库位号:" + autoposId);
} }
string server = ConfigAppSettings.GetValue(Setting_Init.http_server); string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false); Operation resultOperation = HttpHelper.PostOP(StoreManager.GetPostApi(server), operation, 2000);
if (resultOperation == null) if (resultOperation == null)
{ {
LogUtil.info(LogName + "二维码【" + message + "】没有收到服务器反馈"); LogUtil.info(LogName + "二维码【" + message + "】没有收到服务器反馈");
return null; return null;
} }
else if (!string.IsNullOrEmpty(resultOperation.msg)) else if (!string.IsNullOrEmpty(resultOperation.msg))
...@@ -571,7 +575,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -571,7 +575,12 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error(LogName + "解析服务发送的入库【" + posId + "】出错" + ex.StackTrace); LogUtil.error(LogName + "解析服务发送的入库【" + posId + "】出错" + ex.StackTrace);
} }
}return null; }
else
{
LogUtil.error(LogName + "二维码【" + message + "】获取入库库位失败 ");
}
return null;
} }
public static Dictionary<string, string> GetBtnStatus() public static Dictionary<string, string> GetBtnStatus()
......
...@@ -21,12 +21,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -21,12 +21,14 @@ namespace OnlineStore.DeviceLibrary
public static string api_inventory = "rest/api/v2/mes/inventory";//获取单个或全总SMD-BOX 中的实时库存信息 public static string api_inventory = "rest/api/v2/mes/inventory";//获取单个或全总SMD-BOX 中的实时库存信息
public static string api_stackOut = "rest/api/v2/mes/stackOut";//本接⼜提供物料出库功能,可⼀次性出单/多盘物料 public static string api_stackOut = "rest/api/v2/mes/stackOut";//本接⼜提供物料出库功能,可⼀次性出单/多盘物料
// 取消任务地址: /cancelPutInTask //参数: barcode
private static string Addr_cancelPutInTask = "service/store/cancelPutInTask";
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 AC_SA_BoxBean Store = null; public static AC_SA_BoxBean Store = null;
public static AUTO_SA_Config Config = null; public static AUTO_SA_Config Config = null;
private static bool isInit = false; private static bool isInit = false;
public static bool IsConnectServer=!ConfigAppSettings.GetValue(Setting_Init.http_server).Equals(""); public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
public StoreManager() public StoreManager()
{ {
} }
...@@ -99,10 +101,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -99,10 +101,6 @@ namespace OnlineStore.DeviceLibrary
} }
return Store; return Store;
} }
/// <summary>
/// 修改了料仓配置,更新缓存,更新配置文件(只能更新PRO的配置)
/// </summary>
/// <param name="kTK_LA_Store_Config"></param>
public static void UpdateBoxConfig(AUTO_SA_Config storeConfig) public static void UpdateBoxConfig(AUTO_SA_Config storeConfig)
{ {
try try
...@@ -130,11 +128,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -130,11 +128,22 @@ namespace OnlineStore.DeviceLibrary
return host + api_communication; return host + api_communication;
} }
public static string GetAPI(string host, string api) public static string GetAPI(string api, Dictionary<string, string> paramsMap = null)
{
string host = GetHostUrl("");
if (paramsMap == null || paramsMap.Count <= 0)
{ {
host = GetHostUrl(host);
return host + api; return host + api;
} }
string path = host + api.Trim() + "?";
foreach (string paramName in paramsMap.Keys)
{
string par = System.Web.HttpUtility.UrlEncode(paramsMap[paramName], System.Text.Encoding.UTF8);
path += paramName + "=" + par + "&";
}
path = path.Substring(0, path.Length - 1);
return path;
}
private static string GetHostUrl(string host) private static string GetHostUrl(string host)
{ {
...@@ -152,7 +161,51 @@ namespace OnlineStore.DeviceLibrary ...@@ -152,7 +161,51 @@ namespace OnlineStore.DeviceLibrary
} }
return host; return host;
} }
public static string GetAllAxisPos() {
public static string cancelPutInTask(string barcode)
{
string msg = "";
try
{
string serverAddr = ConfigAppSettings.GetValue(Setting_Init.http_server);
if (string.IsNullOrEmpty(serverAddr))
{
LogUtil.error("cancelPutInTask [" + barcode + "] :未找到服务器地址");
return msg;
}
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("barcode", barcode);
string server = GetAPI(Addr_cancelPutInTask, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("cancelPutInTask " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
//【http://192.168.21.62/myproject/service/store/cancelPutInTask?barcode=%3d1%2b0x0-7x8%3dIAC%3b6010A0243701%3b2031%3bNA%3b4000%3bVBR20BP02341%3b%23%23】
//【{"code":0,"msg":"ok","data":true}】
ReviceData data = JsonHelper.DeserializeJsonToObject<ReviceData>(resultStr);
if (data == null)
{
return msg = " cancelPutInTask【 " + barcode + "】 没有收到服务器反馈";
}
else if (data.code.Equals(0).Equals(false))
{
return msg = " cancelPutInTask【 " + barcode + "】 :" + data.msg;
}
return "";
}
catch (Exception ex)
{
LogUtil.error(" " + ex.ToString());
}
return msg;
}
public static string GetAllAxisPos()
{
int UpDown_AxisP = AxisManager.instance.GetActualtPosition(Config.UpDown_Axis); int UpDown_AxisP = AxisManager.instance.GetActualtPosition(Config.UpDown_Axis);
int Batch_AxisP = AxisManager.instance.GetActualtPosition(Config.Batch_Axis); int Batch_AxisP = AxisManager.instance.GetActualtPosition(Config.Batch_Axis);
int Comp_AxisP = AxisManager.instance.GetActualtPosition(Config.Comp_Axis); int Comp_AxisP = AxisManager.instance.GetActualtPosition(Config.Comp_Axis);
...@@ -162,11 +215,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -162,11 +215,20 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public class ReviceData
{
//{"code":0,"msg":"ok","data":"7"}
public int code { get; set; }
public string msg { get; set; }
public object data { get; set; }
}
public class APIInfo public class APIInfo
{ {
//[{"LOC":"1","RI":"A100007","QTY":1000,"PN":"pn"},{"LOC":"2","RI":"A100015","QTY":1000,"PN":"pn"}] //[{"LOC":"1","RI":"A100007","QTY":1000,"PN":"pn"},{"LOC":"2","RI":"A100015","QTY":1000,"PN":"pn"}]
public int LOC=1; public int LOC = 1;
public string RI = ""; public string RI = "";
public string QTY = ""; public string QTY = "";
public string PN = ""; public string PN = "";
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!