Commit d3b449ba 顾剑亮
2 个父辈 ac77009b d043310a
正在显示 24 个修改的文件 包含 298 行增加68 行删除
<?xml version="1.0"?>
<doc>
<assembly>
<name>X-Ray</name>
</assembly>
<members>
<member name="T:Asa.XRay">
<summary>
X-ray Source (AVJ Technologies Company)
</summary>
</member>
<member name="T:Asa.XRay.WarmUpEvent">
<summary>
预热事件委托
</summary>
<param name="state">预热完成的状态</param>
<param name="text">文本</param>
</member>
<member name="E:Asa.XRay.WarmUp">
<summary>
预热事件
</summary>
</member>
<member name="M:Asa.XRay.#ctor(System.String)">
<summary>
X-ray Source
</summary>
<param name="logName"></param>
</member>
<member name="P:Asa.XRay.IsPortOpen">
<summary>
串口打开或关闭状态
</summary>
</member>
<member name="P:Asa.XRay.IsRayOpen">
<summary>
X射线打开或关闭状态
</summary>
</member>
<member name="M:Asa.XRay.Open(System.String,System.String)">
<summary>
打开设备
</summary>
<param name="portName">串口名称</param>
<param name="lastDate">最后使用日期</param>
<returns></returns>
</member>
<member name="M:Asa.XRay.Close">
<summary>
关闭设备
</summary>
</member>
<member name="M:Asa.XRay.SetVC(System.String,System.String)">
<summary>
设置电压电流
</summary>
<param name="voltage">电压kV(除小数点外必须4位数,不够的补0,小数必须1位)</param>
<param name="current">电流uA(必须4位数,没有小数,不够的补0)</param>
</member>
<member name="M:Asa.XRay.Stop">
<summary>
停止
</summary>
<returns></returns>
</member>
<member name="M:Asa.XRay.Start">
<summary>
启动
</summary>
<returns></returns>
</member>
<member name="M:Asa.XRay.WatchDog">
<summary>
看门狗时间,(多线程)
</summary>
</member>
<member name="M:Asa.XRay.WarmUpProcess(System.Object)">
<summary>
预热处理,(多线程)
</summary>
<param name="obj">天数</param>
</member>
</members>
</doc>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<add key="App_AutoRun" value="1" /> <add key="App_AutoRun" value="1" />
<add key="App_Title" value="自动点料机" /> <add key="App_Title" value="自动点料机" />
<!--<add key="ServerAddr" value="http://10.85.17.233"/>--> <add key="ServerAddr" value="http://10.85.17.233"/>
<add key="ConfigPath_Robot" value="\RobotConfig\Config_Robot.csv" /> <add key="ConfigPath_Robot" value="\RobotConfig\Config_Robot.csv" />
<add key="ConfigPath_XRay" value="\RobotConfig\Config_XRay.csv" /> <add key="ConfigPath_XRay" value="\RobotConfig\Config_XRay.csv" />
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
<add key ="PrinterName" value ="ZDesigner GT800-300dpi EPL"/> <add key ="PrinterName" value ="ZDesigner GT800-300dpi EPL"/>
<!--是否启用打印标签--> <!--是否启用打印标签-->
<add key ="NeedPrintLabel" value ="0"/> <add key ="NeedPrintLabel" value ="0"/>
<!--XRay射线最后一次使用时间-->
<add key ="XRay_Data" value =""/>
</appSettings> </appSettings>
<log4net> <log4net>
...@@ -70,6 +72,16 @@ ...@@ -70,6 +72,16 @@
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n" />
</layout> </layout>
</appender> </appender>
<appender name="XRay" type="log4net.Appender.RollingFileAppender">
<file value="logs/XRay.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>
<logger name="RollingLogFileAppender"> <logger name="RollingLogFileAppender">
<level value="Info" /> <level value="Info" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
...@@ -78,6 +90,10 @@ ...@@ -78,6 +90,10 @@
<level value="Info" /> <level value="Info" />
<appender-ref ref="TheRFID" /> <appender-ref ref="TheRFID" />
</logger> </logger>
<logger name="XRay">
<level value="Info" />
<appender-ref ref="XRay" />
</logger>
<!--<root> <!--<root>
<level value="Info" /> <level value="Info" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
......
...@@ -748,6 +748,23 @@ namespace OnlineStore.AutoCountClient ...@@ -748,6 +748,23 @@ namespace OnlineStore.AutoCountClient
{ {
equipBean.DefautTargetP = comTP.SelectedIndex + 1; equipBean.DefautTargetP = comTP.SelectedIndex + 1;
} }
private void btnCheck_Click(object sender, EventArgs e)
{
string reelId = txtReelId.Text;
string pn = txtPN.Text;
int p = 0;
SServerManager.Get_VMICheckRLC("测试按钮", pn + ";" + reelId, out p);
}
private void btnReturn_Click(object sender, EventArgs e)
{
int qty = FormUtil.GetIntValue(txtQty ) ;
string reelId = txtReelId.Text;
string pn = txtPN.Text;
int p = 0;
SServerManager.Return_Material ("测试按钮", pn + ";" + reelId, qty);
}
} }
} }
......
...@@ -142,6 +142,7 @@ ...@@ -142,6 +142,7 @@
this.lblName = new System.Windows.Forms.Label(); this.lblName = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.chbMoveStop = new System.Windows.Forms.CheckBox(); this.chbMoveStop = new System.Windows.Forms.CheckBox();
this.chbPrint = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
...@@ -779,6 +780,7 @@ ...@@ -779,6 +780,7 @@
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.chbPrint);
this.groupBox6.Controls.Add(this.btnPrint); this.groupBox6.Controls.Add(this.btnPrint);
this.groupBox6.Controls.Add(this.label6); this.groupBox6.Controls.Add(this.label6);
this.groupBox6.Controls.Add(this.txtPringNum); this.groupBox6.Controls.Add(this.txtPringNum);
...@@ -1923,6 +1925,18 @@ ...@@ -1923,6 +1925,18 @@
this.chbMoveStop.UseVisualStyleBackColor = true; this.chbMoveStop.UseVisualStyleBackColor = true;
this.chbMoveStop.CheckedChanged += new System.EventHandler(this.chbMoveStop_CheckedChanged); this.chbMoveStop.CheckedChanged += new System.EventHandler(this.chbMoveStop_CheckedChanged);
// //
// chbPrint
//
this.chbPrint.AutoSize = true;
this.chbPrint.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbPrint.Location = new System.Drawing.Point(1062, 25);
this.chbPrint.Name = "chbPrint";
this.chbPrint.Size = new System.Drawing.Size(112, 24);
this.chbPrint.TabIndex = 299;
this.chbPrint.Text = "启用标签打印";
this.chbPrint.UseVisualStyleBackColor = true;
this.chbPrint.CheckedChanged += new System.EventHandler(this.chbPrint_CheckedChanged);
//
// FrmOutputEquip // FrmOutputEquip
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -2089,6 +2103,7 @@ ...@@ -2089,6 +2103,7 @@
private System.Windows.Forms.TextBox txtPringNum; private System.Windows.Forms.TextBox txtPringNum;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtPrintCode; private System.Windows.Forms.TextBox txtPrintCode;
private System.Windows.Forms.CheckBox chbPrint;
} }
} }
...@@ -39,7 +39,7 @@ namespace OnlineStore.AutoCountClient ...@@ -39,7 +39,7 @@ namespace OnlineStore.AutoCountClient
chbDebug.Checked = equipBean.IsDebug; chbDebug.Checked = equipBean.IsDebug;
chbPrint.Checked = ConfigAppSettings.GetIntValue(Setting_Init.NeedPrintLabel).Equals(1);
lblStoreStatus.Text = RobotBase.GetRunStr(equipBean.runStatus); lblStoreStatus.Text = RobotBase.GetRunStr(equipBean.runStatus);
lblThisSta.Text = equipBean.WarnMsg; lblThisSta.Text = equipBean.WarnMsg;
lblName.Text = equipBean.Name; lblName.Text = equipBean.Name;
...@@ -751,6 +751,20 @@ namespace OnlineStore.AutoCountClient ...@@ -751,6 +751,20 @@ namespace OnlineStore.AutoCountClient
LogUtil.error("打印标签错误:" + ex.ToString()); LogUtil.error("打印标签错误:" + ex.ToString());
} }
} }
private void chbPrint_CheckedChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
if (!chbPrint.Checked.Equals(equipBean.AutoSendShelfOut))
{
bool isCheck = chbPrint.Checked;
ConfigAppSettings.SaveValue(Setting_Init.NeedPrintLabel,( isCheck ? 1 : 0));
LogUtil.info(equipBean.Name + "用户切换 启用标签打印 =" + isCheck);
}
}
} }
} }
......
...@@ -364,7 +364,7 @@ namespace OnlineStore.AutoCountClient ...@@ -364,7 +364,7 @@ namespace OnlineStore.AutoCountClient
StringBuilder sbResult = new StringBuilder(); StringBuilder sbResult = new StringBuilder();
PerformanceCounter pf1 = new PerformanceCounter("Process", "Working Set - Private", process.ProcessName); PerformanceCounter pf1 = new PerformanceCounter("Process", "Working Set - Private", process.ProcessName);
sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存:{1}M ", process.ProcessName, Math.Round(pf1.NextValue() / 1024 / 1024F, 2)); sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存:{1}M ", process.ProcessName, Math.Round(pf1.NextValue() / 1024 / 1024F, 2));
sbResult.AppendFormat(", CPU : {0} %", curtime.NextValue()); sbResult.AppendFormat(", CPU : {0} %", curtime.NextValue() / Environment.ProcessorCount);
LogUtil.info(sbResult.ToString()); LogUtil.info(sbResult.ToString());
} }
} }
......
...@@ -37,7 +37,11 @@ namespace OnlineStore.AutoCountClient ...@@ -37,7 +37,11 @@ namespace OnlineStore.AutoCountClient
{ {
chbDebug.Checked = equipBean.IsDebug; chbDebug.Checked = equipBean.IsDebug;
lblCom.Text = "X射线端口号:" + equipBean.Config.XRay_Port;
lblDianl.Text = "电流值:" + equipBean.Config.XRay_Electricity;
lblDiany.Text = "电压值:" + equipBean.Config.XRay_Voltage;
lblData.Text = "最后使用时间:" + ConfigAppSettings.GetValue(Setting_Init.XRay_Data);
lblData.Text = equipBean.LastXRayState;
lblName.Text = equipBean.Name; lblName.Text = equipBean.Name;
IsLoad = true; IsLoad = true;
} }
...@@ -97,7 +101,7 @@ namespace OnlineStore.AutoCountClient ...@@ -97,7 +101,7 @@ namespace OnlineStore.AutoCountClient
} }
ReadIOList(); ReadIOList();
ReadBtnDO(); ReadBtnDO();
lblData.Text = equipBean.LastXRayState;
if (equipBean.runStatus > RobotRunStatus.Wait) if (equipBean.runStatus > RobotRunStatus.Wait)
{ {
lblName.BackColor = Color.Green; lblName.BackColor = Color.Green;
...@@ -361,6 +365,11 @@ namespace OnlineStore.AutoCountClient ...@@ -361,6 +365,11 @@ namespace OnlineStore.AutoCountClient
equipBean.MoveStop = chbMoveStop.Checked; equipBean.MoveStop = chbMoveStop.Checked;
LogUtil.info(equipBean.Name + "用户切换是否暂停: " + equipBean.MoveStop); LogUtil.info(equipBean.Name + "用户切换是否暂停: " + equipBean.MoveStop);
} }
private void groupBox2_Enter(object sender, EventArgs e)
{
}
} }
} }
......
...@@ -25,5 +25,32 @@ IO模块更新。 ...@@ -25,5 +25,32 @@ IO模块更新。
尺寸信息传到出口 尺寸信息传到出口
复位是Xray入口若有料,入口皮带线不转。 复位是Xray入口若有料,入口皮带线不转。
出料料串最后一个料盘,没有贴标就把料串送出了。 出料料串最后一个料盘,没有贴标就把料串送出了。
20200529
X射线模块:
增加配置:
电流
电压
X射线COM口:COM6
上次打开的日期
调用步骤:
软件启动Open
接收事件,等待可以start后,设置电压电流
每次需要点料的时候
Start
调用取图片方法
Stop
获取点料结果
软件退出时调用Close
...@@ -79,5 +79,7 @@ namespace OnlineStore.Common ...@@ -79,5 +79,7 @@ namespace OnlineStore.Common
public static string LabelName = "LabelName"; public static string LabelName = "LabelName";
public static string PrinterName = "PrinterName"; public static string PrinterName = "PrinterName";
public static string NeedPrintLabel = "NeedPrintLabel"; public static string NeedPrintLabel = "NeedPrintLabel";
public static string XRay_Data = "XRay_Data";
} }
} }
...@@ -6,6 +6,7 @@ using log4net; ...@@ -6,6 +6,7 @@ using log4net;
using System.Reflection; using System.Reflection;
using System.Drawing; using System.Drawing;
using System.Runtime.ExceptionServices; using System.Runtime.ExceptionServices;
using System.Collections.Concurrent;
namespace OnlineStore.Common namespace OnlineStore.Common
{ {
...@@ -16,7 +17,7 @@ namespace OnlineStore.Common ...@@ -16,7 +17,7 @@ namespace OnlineStore.Common
public delegate void ShowLog(string msg, Color color); public delegate void ShowLog(string msg, Color color);
public static readonly ILog LOGGER = LogManager.GetLogger("RollingLogFileAppender"); public static readonly ILog LOGGER = LogManager.GetLogger("RollingLogFileAppender");
public static readonly ILog rfidLog = LogManager.GetLogger("RfidLog"); public static readonly ILog rfidLog = LogManager.GetLogger("RfidLog");
public static Dictionary<int, DateTime> lastErrorLogTime = new Dictionary<int, DateTime>(); public static ConcurrentDictionary<int, DateTime> lastErrorLogTime = new ConcurrentDictionary<int, DateTime>();
public static System.Windows.Forms.RichTextBox logBox = null; public static System.Windows.Forms.RichTextBox logBox = null;
...@@ -61,6 +62,7 @@ namespace OnlineStore.Common ...@@ -61,6 +62,7 @@ namespace OnlineStore.Common
{ {
rfidLog.Debug(msg); rfidLog.Debug(msg);
} }
public static void error(string errorMsg, int type, int seconds = 10) public static void error(string errorMsg, int type, int seconds = 10)
{ {
try try
...@@ -70,14 +72,13 @@ namespace OnlineStore.Common ...@@ -70,14 +72,13 @@ namespace OnlineStore.Common
TimeSpan span = DateTime.Now - lastErrorLogTime[type]; TimeSpan span = DateTime.Now - lastErrorLogTime[type];
if (span.TotalSeconds > seconds) if (span.TotalSeconds > seconds)
{ {
lastErrorLogTime.Remove(type); lastErrorLogTime[type] = DateTime.Now;
lastErrorLogTime.Add(type, DateTime.Now);
error(LOGGER, errorMsg); error(LOGGER, errorMsg);
} }
} }
else else
{ {
lastErrorLogTime.Add(type, DateTime.Now); lastErrorLogTime.TryAdd(type, DateTime.Now);
error(LOGGER, errorMsg); error(LOGGER, errorMsg);
} }
} }
......
...@@ -42,7 +42,7 @@ namespace OnlineStore.Common ...@@ -42,7 +42,7 @@ namespace OnlineStore.Common
protected override WebRequest GetWebRequest(Uri address) protected override WebRequest GetWebRequest(Uri address)
{ {
var result = base.GetWebRequest(address); HttpWebRequest result = (HttpWebRequest)base.GetWebRequest(address);
result.Timeout = this._timeout; result.Timeout = this._timeout;
return result; return result;
} }
...@@ -76,17 +76,10 @@ namespace OnlineStore.Common ...@@ -76,17 +76,10 @@ namespace OnlineStore.Common
{ {
return Post(url, paramData, Encoding.UTF8, timeOut); return Post(url, paramData, Encoding.UTF8, timeOut);
} }
private static int isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open);
public static string Post(string url, string paramData, Encoding encoding, int timeOut = 10000) public static string Post(string url, string paramData, Encoding encoding, int timeOut = 10000)
{ {
if (isLog == 1)
{
LogUtil.info("给服务器发送数据【" + 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)
...@@ -99,7 +92,10 @@ namespace OnlineStore.Common ...@@ -99,7 +92,10 @@ namespace OnlineStore.Common
{ {
var wc = new MyWebClient(10000); 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.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
wc.Encoding = encoding; wc.Encoding = encoding;
result = wc.UploadString(url, "POST", paramData); result = wc.UploadString(url, "POST", paramData);
...@@ -109,14 +105,7 @@ namespace OnlineStore.Common ...@@ -109,14 +105,7 @@ namespace OnlineStore.Common
{ {
LogUtil.error("POST ERROR:" + e.ToString(), 101); LogUtil.error("POST ERROR:" + e.ToString(), 101);
} }
if (!result.Contains("null") && result.Length != 0)
{
//LogUtil.debug(LOGGER,"receive << " + result);
}
if (isLog == 1)
{
LogUtil.info("收到服务器数据【" + result + "】");
}
return result; return result;
} }
...@@ -124,18 +113,17 @@ namespace OnlineStore.Common ...@@ -124,18 +113,17 @@ namespace OnlineStore.Common
{ {
return Get(url, Encoding.UTF8); return Get(url, Encoding.UTF8);
} }
public static string Get(string url, Encoding encoding, int timeOut = 10000)
public static string Get(string url, Encoding encoding)
{ {
try try
{ {
LogUtil.info( "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.info( "receive << " + result); LogUtil.debug("receive << " + result);
return result; return result;
} }
} }
......
...@@ -77,6 +77,9 @@ ...@@ -77,6 +77,9 @@
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="X-Ray">
<HintPath>..\..\..\X-Ray Controller\X-Ray Controller\bin\Debug\X-Ray.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="agvClient\AgvClient.cs" /> <Compile Include="agvClient\AgvClient.cs" />
......
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义 类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,0,,,,, PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,左入料线体相机名称,LeftCamera,GigE:MV-CE200-10GC (00E02588201),,,,, PRO,0,左入料线体相机名称,LeftCamera,GigE:MV-CE200-10GC (00E02588201),,,,,
PRO,0,右入料线体相机名称,RightCamera,GigE:MV-CE200-10GC (00E02588199),,,,, PRO,0,右入料线体相机名称,RightCamera,GigE:MV-CE200-10GC (00E02588199),,,,,
PRO,0,移栽上下运动是否使用伺服,UpDownUseAxis,1,,,,, PRO,0,移栽上下运动是否使用伺服,UpDownUseAxis,1,,,,,
......
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义 类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,0,,,,, PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
,,,,,,,,, ,,,,,,,,,
PRO,0,空料串入口AGV站号名称,AgvInName,D1,,,,, PRO,0,空料串入口AGV站号名称,AgvInName,D1,,,,,
PRO,0,料串出口AGV站号名称,AgvOutName,D2,,,,, PRO,0,料串出口AGV站号名称,AgvOutName,D2,,,,,
...@@ -16,8 +16,8 @@ PRO,0,出料提升轴P3速度,BatchAxis_P3Speed,1500,,,,, ...@@ -16,8 +16,8 @@ PRO,0,出料提升轴P3速度,BatchAxis_P3Speed,1500,,,,,
PRO,0,出料提升轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,10446,,,,, PRO,0,出料提升轴高度转换系数(1mm对应的脉冲),Height_ChangeValue,10446,,,,,
,,,,,,,,, ,,,,,,,,,
PRO,0,取料X轴待机点-P1,MoveX_P1,2001,,,,, PRO,0,取料X轴待机点-P1,MoveX_P1,2001,,,,,
PRO,0,取料X轴-取料点-P2集合,MoveX_P2List,0=15900;8=150000;12=150000;16=150000;24=150000;32=140000;44=120000;56=100000;13=4710;15=1350;11=10120;7=15900,,,,, PRO,0,取料X轴-取料点-P2集合,MoveX_P2List,0=15950;8=150000;12=150000;16=150000;24=150000;32=140000;44=120000;56=100000;13=4710;15=1350;11=10120;7=15950,,,,,
PRO,0,取料X轴-放料点-P3,MoveX_P3,77100,,,,, PRO,0,取料X轴-放料点-P3,MoveX_P3,77200,,,,,
PRO,0,取料X轴P1速度,MoveX_P1Speed,500,,,,, PRO,0,取料X轴P1速度,MoveX_P1Speed,500,,,,,
PRO,0,取料X轴P2速度,MoveX_P2Speed,500,,,,, PRO,0,取料X轴P2速度,MoveX_P2Speed,500,,,,,
PRO,0,取料X轴P3速度,MoveX_P3Speed,500,,,,, PRO,0,取料X轴P3速度,MoveX_P3Speed,500,,,,,
......
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义 类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,0,,,,, PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
PRO,0,XRay端口号,XRay_Port,COM6,,,,,
PRO,0,XRay射线设置电流值,XRay_Electricity,0.87,,,,,
PRO,0,XRay射线设置电压值,XRay_Voltage,567,,,,,
...@@ -209,6 +209,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -209,6 +209,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StepEnum.IB22_LocationDown)) else if (MoveInfo.IsStep(StepEnum.IB22_LocationDown))
{ {
MoveInfo.NextMoveStep(StepEnum.IB23_ShelfOut); MoveInfo.NextMoveStep(StepEnum.IB23_ShelfOut);
MoveInfo.TimeOutSeconds = 30;
WorkLog("上料完成 :通知agv来取料串,等待料串离开"); WorkLog("上料完成 :通知agv来取料串,等待料串离开");
AgvClient.NeedLeave(AgvName, CurrShelfId, ClientLevel.High); AgvClient.NeedLeave(AgvName, CurrShelfId, ClientLevel.High);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_LineIn_Check, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_LineIn_Check, IO_VALUE.LOW));
......
...@@ -56,7 +56,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -56,7 +56,17 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
//如果料架在准备状态或送出过程中,不能开始取料 if(ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro)&&ShelfMoveInfo.MoveStep>= StepEnum.OS_31_ShendShelfOut)
{
LogUtil.error(MoveInfo.Name + "StartWorking 失败 , ShelfMoveInfo 正在送出料架 " + ShelfMoveInfo.MoveType+"_"+ ShelfMoveInfo.MoveStep);
return false;
}
if(SecMoveInfo.MoveType.Equals(RobotMoveType.Labelling)&&SecMoveInfo.MoveStep<= StepEnum.OL12_XYToP3)
{
LogUtil.error(MoveInfo.Name + "StartWorking 失败 , SecMoveInfo 上个贴标还在等待中 " + SecMoveInfo.MoveType + "_" + SecMoveInfo.MoveStep);
return false;
}
if (IOValue(IO_Type.Out_TrayCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.X_OLine_Run).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.Out_TrayCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.X_OLine_Run).Equals(IO_VALUE.LOW))
{ {
...@@ -189,6 +199,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -189,6 +199,7 @@ namespace OnlineStore.DeviceLibrary
{ {
bool shelfOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro) && ShelfMoveInfo.IsStep(StepEnum.OS_18_ShelfReady); bool shelfOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro) && ShelfMoveInfo.IsStep(StepEnum.OS_18_ShelfReady);
bool debugOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.None) && MoveInfo.MoveParam.IsTest; bool debugOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.None) && MoveInfo.MoveParam.IsTest;
if (shelfOk || debugOk) if (shelfOk || debugOk)
{ {
MoveInfo.NextMoveStep(StepEnum.OT12_MoveXToP3); MoveInfo.NextMoveStep(StepEnum.OT12_MoveXToP3);
...@@ -439,11 +450,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -439,11 +450,11 @@ namespace OnlineStore.DeviceLibrary
} }
else if (SecMoveInfo.IsStep(StepEnum.OL11_WaitCanLabel)) else if (SecMoveInfo.IsStep(StepEnum.OL11_WaitCanLabel))
{ {
bool canLabel = (MoveInfo.MoveType.Equals(RobotMoveType.None)||(MoveInfo.MoveType.Equals(RobotMoveType.Working)&& MoveInfo.MoveStep<=(StepEnum.OT11_WaitShelfOk))) bool canLabel = MoveInfo.MoveType.Equals(RobotMoveType.None) ||
&& ShelfMoveInfo.IsStep(StepEnum.OS_25_WaitLabel ); ; ((MoveInfo.MoveType.Equals(RobotMoveType.Working) && MoveInfo.MoveStep <= StepEnum.OT05_GetImage));
bool isTest = ShelfMoveInfo.MoveType.Equals(RobotMoveType.None) && MoveInfo.MoveType.Equals(RobotMoveType.None) && SecMoveInfo.MoveParam.IsTest; bool isTest = ShelfMoveInfo.MoveType.Equals(RobotMoveType.None) && MoveInfo.MoveType.Equals(RobotMoveType.None) && SecMoveInfo.MoveParam.IsTest;
if (canLabel || isTest) if (canLabel && ShelfMoveInfo.IsStep(StepEnum.OS_25_WaitLabel))
{ {
SecMoveInfo.NextMoveStep(StepEnum.OL12_XYToP3); SecMoveInfo.NextMoveStep(StepEnum.OL12_XYToP3);
SecWorkLog("贴标: XY轴移动到P3点"); SecWorkLog("贴标: XY轴移动到P3点");
...@@ -506,7 +517,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -506,7 +517,7 @@ namespace OnlineStore.DeviceLibrary
SecWorkLog("贴标: 贴标气缸后退"); SecWorkLog("贴标: 贴标气缸后退");
CylinderMove(SecMoveInfo, IO_Type.LablePaste_Forward, IO_Type.PasteCode_Back); CylinderMove(SecMoveInfo, IO_Type.LablePaste_Forward, IO_Type.PasteCode_Back);
bool canLabel = MoveInfo.MoveType.Equals(RobotMoveType.None) && ShelfMoveInfo.IsStep(StepEnum.OS_25_WaitLabel); bool canLabel = ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro) && ShelfMoveInfo.IsStep(StepEnum.OS_25_WaitLabel);
if (canLabel) if (canLabel)
{ {
ShelfMoveInfo.NextMoveStep(StepEnum.OS_26_LabelOk); ShelfMoveInfo.NextMoveStep(StepEnum.OS_26_LabelOk);
......
using OnlineStore.Common; using Asa;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
...@@ -18,6 +19,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -18,6 +19,11 @@ namespace OnlineStore.DeviceLibrary
public XRay_Config Config; public XRay_Config Config;
private XRay xRay = new XRay("XRay");
private bool xRayCanStart = false;
public string LastXRayState = "";
public X_RAY_Equip(string cid, XRay_Config config) public X_RAY_Equip(string cid, XRay_Config config)
{ {
this.DeviceID = config.Id; this.DeviceID = config.Id;
...@@ -25,7 +31,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -25,7 +31,7 @@ namespace OnlineStore.DeviceLibrary
baseConfig = config; baseConfig = config;
IsDebug = config.IsDebug.Equals(1); IsDebug = config.IsDebug.Equals(1);
Name = (" " + "XRay" + " ").ToUpper(); Name = (" " + "XRay" + " ").ToUpper();
xRay.WarmUp += XRay_WarmUp;
Init(); Init();
ledProcessTimer.Elapsed += LedProcess; ledProcessTimer.Elapsed += LedProcess;
IoCheckTimer.Elapsed += IoCheckTimerProcess; IoCheckTimer.Elapsed += IoCheckTimerProcess;
...@@ -33,6 +39,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -33,6 +39,16 @@ namespace OnlineStore.DeviceLibrary
SecMoveInfo = new RobotMoveInfo( Name.Trim() + "-SMove"); SecMoveInfo = new RobotMoveInfo( Name.Trim() + "-SMove");
} }
private void XRay_WarmUp(bool state, string text)
{
LastXRayState =state+ ":" + text;
LogUtil.info(Name + "XRay_WarmUp [" + state + "] [" + text + "]");
if (state)
{
xRayCanStart = true;
}
}
public override bool StartRun() public override bool StartRun()
{ {
if (CanStartRun().Equals(false)) if (CanStartRun().Equals(false))
......
using OnlineStore.Common; using Asa;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -166,8 +167,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -166,8 +167,12 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.X_Lock_On, IO_VALUE.LOW); IOMove(IO_Type.X_Lock_On, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
Task.Factory.StartNew(delegate { Task.Factory.StartNew(delegate {
string msg= SServerManager.Return_Material(Name, MoveInfo.MoveParam.WareCode, Work_ReelInfo.WareCount); string msg = "暂不上传";
LogUtil.error(Name + "上传【"+MoveInfo.MoveParam.OutStr()+"】点料结果失败:" + msg); // string msg= SServerManager.Return_Material(Name, MoveInfo.MoveParam.WareCode, Work_ReelInfo.WareCount);
if (!String.IsNullOrEmpty(msg))
{
LogUtil.error(Name + "上传【" + MoveInfo.MoveParam.OutStr() + "】点料结果失败:" + msg);
}
}); });
} }
#endregion #endregion
......
...@@ -16,16 +16,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,16 +16,16 @@ namespace OnlineStore.DeviceLibrary
//结果上传: //结果上传:
//http://10.85.17.233/ReturnOne/WebServiceF.asmx?op=Return_Material //http://10.85.17.233/ReturnOne/WebServiceF.asmx?op=Return_Material
// http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMICheckRLC?reelID=R014212020051100876&partNum=6C.R0034.1D1
private static string Addr_VMICheckRLC = "/ESMTCommonInterface/CommonService.asmx?op=VMICheckRLC"; private static string Addr_VMICheckRLC = "/ESMTCommonInterface/CommonService.asmx/VMICheckRLC";
private static string Addr_Return_Material = "/ReturnOne/WebServiceF.asmx?op=Return_Material"; private static string Addr_Return_Material = "/ReturnOne/WebServiceF.asmx/Return_Material";
public static string Get_VMICheckRLC(string deviceName, string codeStr, out int targetP) public static string Get_VMICheckRLC(string deviceName, string codeStr, out int targetP)
{ {
//reelID: //reelID:
//partNum: //partNum:
//{"data":{"IFneed":"不需要","iftest":"","component":"","msg":"不需要测量RLC","status":1}} //{"data":{"IFneed":"不需要","iftest":"","component":"","msg":"不需要测量RLC","status":1}}
targetP=0; targetP = 0;
string msg = ""; string msg = "";
try try
{ {
...@@ -44,24 +44,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -44,24 +44,21 @@ namespace OnlineStore.DeviceLibrary
return "获取是否测值失败"; return "获取是否测值失败";
} }
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, ""); string resultStr = HttpHelper.Get(server);
LogUtil.info("Get_VMICheckRLC " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】"); LogUtil.info(deviceName + "Get_VMICheckRLC " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
//{"data":{"IFneed":"不需要","iftest":"","component":"","msg":"不需要测量RLC","status":1}} //{"data":{"IFneed":"不需要","iftest":"","component":"","msg":"不需要测量RLC","status":1}}
CheckData dataResult = JsonHelper.DeserializeJsonToObject<CheckData>(resultStr); ResultData strData = JsonHelper.DeserializeJsonToObject<ResultData>(resultStr);
if (strData != null && strData.data != null)
if (dataResult == null)
{ {
return "获取是否测值失败"; if (strData.data.status.Equals(1) && strData.data.IFneed.Equals("不需要"))
}
else if (dataResult.status.Equals(1) && dataResult.IFneed.Equals("不需要"))
{ {
targetP=1; targetP = 1;
return ""; return "";
} }
else if (dataResult.status.Equals(1) && dataResult.IFneed.Equals("需要")) else if (strData.data.status.Equals(1) && strData.data.IFneed.Equals("需要"))
{ {
//需要时,component是电容 或者电阻 //需要时,component是电容 或者电阻
if (dataResult.component.Equals("电容")) if (strData.data.component.Equals("电容"))
{ {
targetP = 2; targetP = 2;
} }
...@@ -71,10 +68,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -71,10 +68,10 @@ namespace OnlineStore.DeviceLibrary
} }
return ""; return "";
} }
}
else else
{ {
targetP = 0; return "获取是否测值失败";
return msg;
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -82,6 +79,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -82,6 +79,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(deviceName + " ", ex); LogUtil.error(deviceName + " ", ex);
return ex.ToString(); return ex.ToString();
} }
return msg;
} }
...@@ -108,8 +106,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -108,8 +106,8 @@ namespace OnlineStore.DeviceLibrary
return ""; return "";
} }
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, ""); string resultStr = HttpHelper.Get(server);
LogUtil.info("Return_Material " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】"); LogUtil.info(deviceName+ "Return_Material " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -145,11 +143,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -145,11 +143,16 @@ namespace OnlineStore.DeviceLibrary
return !String.IsNullOrEmpty(server); return !String.IsNullOrEmpty(server);
} }
} }
// http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMICheckRLC?reelID=R014212020051100876&partNum=6C.R0034.1D1
// {"data":{"IFneed":"需要","iftest":"未测值","component":"","msg":"未获取到测量RLC时间","status":1}}
public class ResultData
{
public CheckData data { get; set; }
}
public class CheckData public class CheckData
{ {
//{"data":{"IFneed":"不需要","iftest":"","component":"","msg":"不需要测量RLC","status":1}} //{"data":{"IFneed":"不需要","iftest":"","component":"","msg":"不需要测量RLC","status":1}}
public int IFneed { get; set; } public string IFneed { get; set; }
public string iftest { get; set; } public string iftest { get; set; }
public string component { get; set; } public string component { get; set; }
public string msg { get; set; } public string msg { get; set; }
......
...@@ -27,6 +27,21 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -27,6 +27,21 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("IsDebug")] [ConfigProAttribute("IsDebug")]
public int IsDebug { get; set; } public int IsDebug { get; set; }
/// <summary>
/// PRO,0,XRay端口号,XRay_Port,COM6,,,,,
/// </summary>
[ConfigProAttribute("XRay_Port")]
public string XRay_Port { get; set; }
/// <summary>
/// PRO,0,XRay射线设置电流值,XRay_Electricity,1,,,,,
/// </summary>
[ConfigProAttribute("XRay_Electricity")]
public string XRay_Electricity { get; set; }
/// <summary>
/// PRO,0,XRay射线设置电压值,XRay_Voltage,1,,,,,
/// </summary>
[ConfigProAttribute("XRay_Voltage")]
public string XRay_Voltage { get; set; }
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!