Commit 24d76270 LN

增加X射线点料功能

1 个父辈 2badfdcf
......@@ -38,7 +38,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
......@@ -54,6 +54,9 @@
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.PrintLabel">
<HintPath>..\..\dll\label\Asa.PrintLabel.dll</HintPath>
......
......@@ -71,6 +71,7 @@
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
this.版本号ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.lblXrayWork = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox2.SuspendLayout();
......@@ -227,7 +228,7 @@
this.lblStatus.AutoSize = true;
this.lblStatus.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblStatus.ForeColor = System.Drawing.Color.Green;
this.lblStatus.Location = new System.Drawing.Point(29, 46);
this.lblStatus.Location = new System.Drawing.Point(94, 46);
this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new System.Drawing.Size(65, 20);
this.lblStatus.TabIndex = 92;
......@@ -367,31 +368,31 @@
// 二维码学习ToolStripMenuItem
//
this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem";
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.二维码学习ToolStripMenuItem.Text = "二维码学习";
this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(157, 6);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem2.Size = new System.Drawing.Size(160, 26);
this.toolStripMenuItem2.Text = "AGV调试";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(157, 6);
//
// 标签编辑ToolStripMenuItem
//
this.标签编辑ToolStripMenuItem.Name = "标签编辑ToolStripMenuItem";
this.标签编辑ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.标签编辑ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.标签编辑ToolStripMenuItem.Text = "标签编辑";
this.标签编辑ToolStripMenuItem.Click += new System.EventHandler(this.标签编辑ToolStripMenuItem_Click);
//
......@@ -452,11 +453,24 @@
this.menuStrip1.TabIndex = 4;
this.menuStrip1.Text = "menuStrip1";
//
// lblXrayWork
//
this.lblXrayWork.AutoSize = true;
this.lblXrayWork.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblXrayWork.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.lblXrayWork.Location = new System.Drawing.Point(17, 44);
this.lblXrayWork.Name = "lblXrayWork";
this.lblXrayWork.Size = new System.Drawing.Size(58, 22);
this.lblXrayWork.TabIndex = 97;
this.lblXrayWork.Text = "点料中";
this.lblXrayWork.Visible = false;
//
// FrmRobotMain
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1350, 729);
this.Controls.Add(this.lblXrayWork);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.lblStatus);
this.Controls.Add(this.lblWarnMsg);
......@@ -526,6 +540,7 @@
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ToolStripMenuItem 标签编辑ToolStripMenuItem;
private System.Windows.Forms.Label lblXrayWork;
}
}
......@@ -77,6 +77,7 @@ namespace OnlineStore.AutoCountClient
}
private void FrmMain_Load(object sender, EventArgs e)
{
string fileP = Application.StartupPath + @"\XRAY\tif\" + DateTime.Now.ToString("HHmmss") + ".png";
FrmBase.GetVersion(true);
if (!RobotManager.Init())
{
......@@ -187,6 +188,7 @@ namespace OnlineStore.AutoCountClient
}
IOManager.instance.CloseAllConnection();
ACServerManager.CloseAllPort();
RobotManager.robot.XrayBean.XRayDispose();
if (Camera._cam != null)
{
Camera._cam.CloseAll();
......@@ -396,6 +398,7 @@ namespace OnlineStore.AutoCountClient
{
return;
}
lblXrayWork.Visible = robot.XrayBean.InXWork;
string canScanCode = "";
lblStatus.Text = robot.GetRunStr() + canScanCode;
string warnMsg = robot.WarnMsg;
......
......@@ -28,14 +28,15 @@
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.lblLastS = new System.Windows.Forms.Label();
this.lblData = new System.Windows.Forms.Label();
this.lblCom = new System.Windows.Forms.Label();
this.lblDiany = new System.Windows.Forms.Label();
this.lblDianl = new System.Windows.Forms.Label();
this.lblInoutInfo = new System.Windows.Forms.Label();
this.lblMoveInfo = new System.Windows.Forms.Label();
this.lblInstoreList = new System.Windows.Forms.Label();
this.lblThisSta = new System.Windows.Forms.Label();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox3 = new System.Windows.Forms.GroupBox();
......@@ -65,11 +66,11 @@
this.txtSlaveId = new System.Windows.Forms.TextBox();
this.cmbWriteIO = new System.Windows.Forms.ComboBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.lblLastS = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage3.SuspendLayout();
this.groupBox6.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.groupBox2.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -202,10 +203,10 @@
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.pictureBox1);
this.groupBox6.Controls.Add(this.groupBox2);
this.groupBox6.Controls.Add(this.lblInoutInfo);
this.groupBox6.Controls.Add(this.lblMoveInfo);
this.groupBox6.Controls.Add(this.lblInstoreList);
this.groupBox6.Controls.Add(this.lblThisSta);
this.groupBox6.Location = new System.Drawing.Point(3, 3);
this.groupBox6.Name = "groupBox6";
......@@ -214,6 +215,14 @@
this.groupBox6.TabStop = false;
this.groupBox6.Text = "消息";
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(327, 115);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(975, 359);
this.pictureBox1.TabIndex = 283;
this.pictureBox1.TabStop = false;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.lblLastS);
......@@ -223,12 +232,22 @@
this.groupBox2.Controls.Add(this.lblDianl);
this.groupBox2.Location = new System.Drawing.Point(12, 41);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(309, 149);
this.groupBox2.Size = new System.Drawing.Size(276, 149);
this.groupBox2.TabIndex = 282;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "X射线信息";
this.groupBox2.Enter += new System.EventHandler(this.groupBox2_Enter);
//
// lblLastS
//
this.lblLastS.AutoSize = true;
this.lblLastS.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblLastS.Location = new System.Drawing.Point(12, 124);
this.lblLastS.Name = "lblLastS";
this.lblLastS.Size = new System.Drawing.Size(68, 17);
this.lblLastS.TabIndex = 4;
this.lblLastS.Text = "点料机状态";
//
// lblData
//
this.lblData.AutoSize = true;
......@@ -289,18 +308,6 @@
this.lblMoveInfo.TabIndex = 280;
this.lblMoveInfo.Text = "运动信息:";
//
// lblInstoreList
//
this.lblInstoreList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblInstoreList.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblInstoreList.ForeColor = System.Drawing.Color.Green;
this.lblInstoreList.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblInstoreList.Location = new System.Drawing.Point(331, 185);
this.lblInstoreList.Name = "lblInstoreList";
this.lblInstoreList.Size = new System.Drawing.Size(971, 115);
this.lblInstoreList.TabIndex = 277;
//
// lblThisSta
//
this.lblThisSta.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
......@@ -310,7 +317,7 @@
this.lblThisSta.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblThisSta.Location = new System.Drawing.Point(327, 41);
this.lblThisSta.Name = "lblThisSta";
this.lblThisSta.Size = new System.Drawing.Size(975, 149);
this.lblThisSta.Size = new System.Drawing.Size(975, 66);
this.lblThisSta.TabIndex = 246;
this.lblThisSta.Text = "等待启动";
this.lblThisSta.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
......@@ -686,16 +693,6 @@
this.tabPage2.Text = " X光射线 ";
this.tabPage2.UseVisualStyleBackColor = true;
//
// lblLastS
//
this.lblLastS.AutoSize = true;
this.lblLastS.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblLastS.Location = new System.Drawing.Point(12, 124);
this.lblLastS.Name = "lblLastS";
this.lblLastS.Size = new System.Drawing.Size(68, 17);
this.lblLastS.TabIndex = 4;
this.lblLastS.Text = "点料机状态";
//
// FrmXRay
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......@@ -717,6 +714,7 @@
this.tabPage3.ResumeLayout(false);
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.tabPage1.ResumeLayout(false);
......@@ -764,7 +762,6 @@
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.Label lblInoutInfo;
private System.Windows.Forms.Label lblMoveInfo;
private System.Windows.Forms.Label lblInstoreList;
private System.Windows.Forms.Label lblThisSta;
private System.Windows.Forms.Button X_OutDoor_Down;
private System.Windows.Forms.Button X_OutDoor_Up;
......@@ -780,6 +777,7 @@
private System.Windows.Forms.Label lblDiany;
private System.Windows.Forms.Label lblDianl;
private System.Windows.Forms.Label lblLastS;
private System.Windows.Forms.PictureBox pictureBox1;
}
}
......@@ -43,9 +43,22 @@ namespace OnlineStore.AutoCountClient
lblData.Text = "最后使用时间:" + ConfigAppSettings.GetValue(Setting_Init.XRay_Data);
lblLastS.Text = equipBean.LastXRayState;
lblName.Text = equipBean.Name;
equipBean.GetImageEvent += EquipBean_GetImageEvent;
IsLoad = true;
}
private void EquipBean_GetImageEvent(Bitmap bitmap)
{
try
{
this.pictureBox1.Image = bitmap;
}
catch (Exception ex)
{
LogUtil.error(" EquipBean_GetImageEvent 出错:" + ex.ToString());
}
}
private void LoadIOList()
{
int roleindex = 0;
......@@ -101,7 +114,7 @@ namespace OnlineStore.AutoCountClient
}
ReadIOList();
ReadBtnDO();
lblData.Text = equipBean.LastXRayState;
lblLastS.Text = equipBean.LastXRayState;
if (equipBean.runStatus > RobotRunStatus.Wait)
{
lblName.BackColor = Color.Green;
......
......@@ -8,7 +8,7 @@
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>Common</AssemblyName>
<AssemblyName>MyCommon</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
......
......@@ -21,7 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7.3</LangVersion>
......@@ -37,7 +37,13 @@
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.CarerayImage">
<HintPath>..\..\dll\X-Ray\Asa.CarerayImage.dll</HintPath>
</Reference>
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
......@@ -54,6 +60,9 @@
<Reference Include="CodeLibrary">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
<Reference Include="CountImage">
<HintPath>..\..\dll\X-Ray\CountImage.dll</HintPath>
</Reference>
<Reference Include="DeviceLib">
<HintPath>..\..\dll\DeviceLib.dll</HintPath>
</Reference>
......@@ -130,6 +139,15 @@
<Content Include="Label\20200520172352.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="XRAY\out\out.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="XRAY\png\png.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="XRAY\tif\tif.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
......
......@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary
{
public string Name = "入料";
public AxisBean BatchAxis = null;
public int EquipType = 1;
public int EquipType = 1;//1=左侧,2=右侧
public RobotMoveInfo MoveInfo;
public string WarnMsg = "";
private string CameraName = "";
......
......@@ -67,6 +67,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.info(Name + "开始连接IO模块 ");
IOManager.instance.ConnectionIOList(ioList);
Thread.Sleep(3000);
mainTimer.Enabled = true;
canStart = true;
AgvClient.Init();
......
......@@ -8,6 +8,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary
{
......@@ -20,10 +21,13 @@ namespace OnlineStore.DeviceLibrary
public XRay_Config Config;
private XRay xRay = new XRay("XRay");
private XRay xRay = null;
private CountImage countImage = null;
private CarerayImage carerayImage = null;
private bool xRayCanStart = false;
public string LastXRayState = "";
public bool InXWork = false;
public X_RAY_Equip(string cid, XRay_Config config)
{
this.DeviceID = config.Id;
......@@ -31,20 +35,68 @@ namespace OnlineStore.DeviceLibrary
baseConfig = config;
IsDebug = config.IsDebug.Equals(1);
Name = (" " + "XRay" + " ").ToUpper();
xRay.WarmUp += XRay_WarmUp;
Init();
ledProcessTimer.Elapsed += LedProcess;
IoCheckTimer.Elapsed += IoCheckTimerProcess;
MoveInfo = new RobotMoveInfo(Name);
SecMoveInfo = new RobotMoveInfo( Name.Trim() + "-SMove");
XRayLoad();
}
private void XRayLoad()
{
try
{
xRay = new XRay("XRay");
string lastData = ConfigAppSettings.GetValue(Setting_Init.XRay_Data);
bool xresult = xRay.Open(Config.XRay_Port, lastData);
if (!xresult)
{
LogUtil.info(Name + "第一次 xRay.Open(" + Config.XRay_Port + "," + lastData + ")=" + xresult+", 再打开一次 ");
xresult = xRay.Open(Config.XRay_Port, lastData);
}
LogUtil.info(Name + "xRay.Open(" + Config.XRay_Port + "," + lastData + ")=" + xresult);
xRay.WarmUp += XRay_WarmUp;
carerayImage = new CarerayImage("XRay");
bool cResult = carerayImage.Open();
LogUtil.info(Name + "carerayImage.Open()=" + cResult);
countImage = new CountImage("XRay");
string path1 = Application.StartupPath + @"\XRAY\tif";
string path2 = Application.StartupPath + @"\XRAY\png";
string path3 = Application.StartupPath + @"\XRAY\out";
countImage.SetDirectory(path1, path2, path3);
LogUtil.info(Name + "SetDirectory: path1【" + path1 + "】path2【" + path2 + "】path3【" + path3 + "】" + cResult);
}
catch (Exception ex)
{
LogUtil.error("XRayLoad 出错:" + ex.ToString());
}
}
public void XRayDispose()
{
try
{
xRay.Close();
carerayImage.Close();
}
catch (Exception ex)
{
LogUtil.error("XRayDispose 出错:" + ex.ToString());
}
}
private void XRay_WarmUp(bool state, string text)
{
LastXRayState =state+ ":" + text;
LastXRayState = state + ":" + text;
LogUtil.info(Name + "XRay_WarmUp [" + state + "] [" + text + "]");
if (state)
{
xRay.SetVC(Config.XRay_Voltage, Config.XRay_Electricity);
LogUtil.info(Name + "收到state= [" + state + "],设置电流 [" + Config.XRay_Electricity + "]电压[" + Config.XRay_Voltage + "]");
xRayCanStart = true;
}
}
......@@ -88,7 +140,7 @@ namespace OnlineStore.DeviceLibrary
isNoAirCheck = false;
isInPro = false;
MoveInfo.NextMoveStep(StepEnum.XR01_CloseXLock);
WorkLog( "XRay复位 :关闭X光");
WorkLog( "XRay复位 :关闭X光互锁信号");
IOMove(IO_Type.X_Lock_On, IO_VALUE.LOW);
}
......@@ -164,16 +216,22 @@ namespace OnlineStore.DeviceLibrary
{
SecMoveInfo.EndMove();
MoveInfo.EndMove();
InXWork = false;
if (xRay.IsRayOpen)
{
xRay.Stop();
}
IOMove(IO_Type.X_Lock_On, IO_VALUE.LOW);
IOMove(IO_Type.X_InLine_Run, IO_VALUE.LOW);
IOMove(IO_Type.X_MLine_Run, IO_VALUE.LOW);
IOMove(IO_Type.X_InDoor_Up, IO_VALUE.LOW);
IOMove(IO_Type.X_InDoor_Down, IO_VALUE.LOW);
IOMove(IO_Type.X_OutDoor_Up, IO_VALUE.LOW);
IOMove(IO_Type.X_OutDoor_Down, IO_VALUE.LOW);
IOMove(IO_Type.X_StopCylinder_Up, IO_VALUE.LOW);
IOMove(IO_Type.X_StopCylinder_Down, IO_VALUE.LOW);
IOMove(IO_Type.X_OLine_Run, IO_VALUE.LOW);
//IOMove(IO_Type.X_InDoor_Up, IO_VALUE.LOW);
//IOMove(IO_Type.X_InDoor_Down, IO_VALUE.LOW);
//IOMove(IO_Type.X_OutDoor_Up, IO_VALUE.LOW);
//IOMove(IO_Type.X_OutDoor_Down, IO_VALUE.LOW);
//IOMove(IO_Type.X_StopCylinder_Up, IO_VALUE.LOW);
//IOMove(IO_Type.X_StopCylinder_Down, IO_VALUE.LOW);
}
......
......@@ -4,17 +4,22 @@ using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary
{
partial class X_RAY_Equip
{
public delegate void GetImage(Bitmap bitmap);
public event GetImage GetImageEvent;
#region Label
public override bool StartLabelling(WorkParam param)
{
......@@ -151,22 +156,88 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StepEnum.XW08_DoorClose))
{
if (IOValue(IO_Type.X_Lock_On).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(StepEnum.XW11_StartCount);
WorkLog("料盘处理:开始点料");
WorkLog("料盘处理:开始点料,等待X射线可以启动");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
InXWork = true;
}
else if (MoveInfo.IsTimeOut(120))
{
WarnMsg = MoveInfo.Name +"["+MoveInfo.MoveStep+"]"+ "等待 X互锁信号打开 超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, SecMoveInfo.ErrorLogType);
Alarm(AlarmType.IoSingleTimeOut);
}
}
else if (MoveInfo.IsStep(StepEnum.XW11_StartCount))
{
MoveInfo.NextMoveStep(StepEnum.XW12_EndCount);
if (xRayCanStart)
{
MoveInfo.NextMoveStep(StepEnum.XW12_XRayStart);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
bool result = xRay.Start();
WorkLog("料盘处理:启动X射线["+result+"],等待1秒");
}
else if (MoveInfo.IsTimeOut(120))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "]" + "等待 可以打开X射线 超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, SecMoveInfo.ErrorLogType);
Alarm(AlarmType.IoSingleTimeOut);
}
}
else if (MoveInfo.IsStep(StepEnum.XW12_XRayStart))
{
MoveInfo.NextMoveStep(StepEnum.XW13_GetXRayImage);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(8000));
WorkLog("料盘处理:开始获取X射线图形 ");
string lastData = DateTime.Now.ToString("yyyy-MM-dd");
ConfigAppSettings.SaveValue(Setting_Init.XRay_Data, lastData);
carerayImage.GetImage();
carerayImage.WindowWidth = Config.WindowWidth;
carerayImage.WindowLevel = Config.WindowLevel;
Bitmap bmp = carerayImage.Get48bImage();
string fileP = Application.StartupPath + @"\XRAY\tif\" + DateTime.Now.ToString("HHmmss") + ".png";
bmp.Save(fileP, System.Drawing.Imaging.ImageFormat.Png);
WorkLog("料盘处理:获取X射线图形,并保存到: " + fileP + ",记录时间"+ lastData + ",停止X射线");
GetImageEvent?.Invoke(bmp);
bool result = xRay.Stop();
if (!result)
{
LogUtil.error(" xRay.Stop()失败:" + result);
}
MoveInfo.EndMove();
}
else if (MoveInfo.IsStep(StepEnum.XW13_GetXRayImage))
{
// MoveInfo.NextMoveStep(StepEnum.XW14_XRayStop);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
// WorkLog("料盘处理:停止X射线");
// xRay.Stop();
//}
//else if (MoveInfo.IsStep(StepEnum.XW14_XRayStop))
//{
MoveInfo.NextMoveStep(StepEnum.XW15_GetResult);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
if (xRay.IsRayOpen)
{
xRay.Stop();
}
int count = 99999;
countImage.GetCount(out count);
InXWork = false;
WorkLog("料盘处理:获取点料结果,【" + count + "】,保存并上传结果");
if (Work_ReelInfo.WareCount <= 0)
{
MoveInfo.MoveParam.WareCount = 99999;
Work_ReelInfo.WareCount = 99999;
MoveInfo.MoveParam.WareCount = count;
Work_ReelInfo.WareCount = count;
}
WorkLog("料盘处理:点料结束,关闭X关机互锁信号,上传点料结果");
IOMove(IO_Type.X_Lock_On, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
Task.Factory.StartNew(delegate {
Task.Factory.StartNew(delegate
{
string msg = "暂不上传";
// string msg= SServerManager.Return_Material(Name, MoveInfo.MoveParam.WareCode, Work_ReelInfo.WareCount);
if (!String.IsNullOrEmpty(msg))
......@@ -175,8 +246,14 @@ namespace OnlineStore.DeviceLibrary
}
});
}
else if (MoveInfo.IsStep(StepEnum.XW15_GetResult))
{
MoveInfo.NextMoveStep(StepEnum.XW16_EndCount);
WorkLog("料盘处理:点料结束,关闭X关机互锁信号");
IOMove(IO_Type.X_Lock_On, IO_VALUE.LOW);
}
#endregion
else if (MoveInfo.IsStep(StepEnum.XW12_EndCount))
else if (MoveInfo.IsStep(StepEnum.XW16_EndCount))
{
MoveInfo.NextMoveStep(StepEnum.XW21_WaitOutNoReel);
MoveInfo.TimeOutSeconds = 120;
......@@ -210,7 +287,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.XW25_WaitTime);
Out_ReelInfo = Work_ReelInfo.GetReelInfo();
Work_ReelInfo = new ReelInfo();
WorkLog("料盘处理:清空 Work_ReelInfo,更新Out_ReelInfo【"+ Out_ReelInfo .ToStr()+ "】 再转动3秒");
WorkLog("料盘处理:清空 Work_ReelInfo,更新Out_ReelInfo【" + Out_ReelInfo.ToStr() + "】 再转动3秒");
IOMove(IO_Type.X_MLine_Run, IO_VALUE.HIGH);
IOMove(IO_Type.X_OLine_Run, IO_VALUE.HIGH);
......
......@@ -202,7 +202,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 入料模块复位:
/// </summary>
IBR01_LocationDown= 1501,
IBR01_LocationDown = 1501,
/// <summary>
/// 入料模块复位:若前段末端信号不一致,转动链条3秒
/// </summary>
......@@ -305,7 +305,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// XRay复位: 左侧们打开,右侧门打开,挡停不动作
/// </summary>
XR02_DoorOpen ,
XR02_DoorOpen,
/// <summary>
/// XRay复位: 皮带转动3秒
/// </summary>
......@@ -358,13 +358,31 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// XRay点料:开始点料
/// XRay点料:开始点料,等待可以打开X射线
/// </summary>
XW11_StartCount,
/// <summary>
/// XRay点料:StartX射线
/// </summary>
XW12_XRayStart,
/// <summary>
/// XRay点料:获取X射线 图片
/// </summary>
XW13_GetXRayImage,
/// <summary>
/// XRay点料:StopX射线
/// </summary>
XW14_XRayStop,
/// <summary>
/// XRay点料:获取点料结果
/// </summary>
XW15_GetResult,
/// <summary>
/// XRay点料:点料结束
/// </summary>
XW12_EndCount,
XW16_EndCount,
......
......@@ -153,7 +153,7 @@ namespace OnlineStore.LoadCSVLibrary
}
if (DOList.ContainsKey(io.ProName))
{
LogUtil.error("配置DO:[" + io.ToString() + "] ProName重复 ");
LogUtil.debug("配置DO:[" + io.ToString() + "] ProName重复 ");
}
else
{
......@@ -166,7 +166,7 @@ namespace OnlineStore.LoadCSVLibrary
}
if (SubDOList[io.SubType].ContainsKey(io.ProName))
{
LogUtil.error("配置DO:[" + io.ToString() + "] ProName重复 ");
LogUtil.debug("配置DO:[" + io.ToString() + "] ProName重复 ");
}
else
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!