Commit 60d216c1 刘韬

备份当前代码

1 个父辈 bb5a8e0d
正在显示 34 个修改的文件 包含 1427 行增加539 行删除
......@@ -37,6 +37,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference>
<Reference Include="Neotel.Rmaxis">
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\Neotel.Rmaxis.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
......@@ -71,12 +74,6 @@
<Compile Include="IOControl.Designer.cs">
<DependentUpon>IOControl.cs</DependentUpon>
</Compile>
<Compile Include="MainControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="MainControl.Designer.cs">
<DependentUpon>MainControl.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="AxisControl.resx">
......@@ -89,9 +86,6 @@
<EmbeddedResource Include="IOControl.resx">
<DependentUpon>IOControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainControl.resx">
<DependentUpon>MainControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
......
......@@ -92,7 +92,6 @@ namespace AutoScanAndLabel
this.Font = new System.Drawing.Font("新宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "AxisControl";
this.Size = new System.Drawing.Size(1274, 602);
this.Load += new System.EventHandler(this.AxisControl_Load);
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);
......
......@@ -18,10 +18,13 @@ namespace AutoScanAndLabel
public AxisControl()
{
InitializeComponent();
RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
}
private void AxisControl_Load(object sender, EventArgs e)
private void RobotManage_LoadFinishEvent(bool state, string msg)
{
if (!state)
return;
axisMoveControl1.LoadData(RobotManage.mainMachine);
LoadPosList();
}
......
......@@ -37,13 +37,21 @@ namespace AutoScanAndLabel
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.停止ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.启用调试模式ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.listView1 = new System.Windows.Forms.ListView();
this.btn_stop = new System.Windows.Forms.Button();
this.btn_run = new System.Windows.Forms.Button();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.menuStrip1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
//
this.menuStrip1.BackColor = System.Drawing.Color.Transparent;
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.设备操作ToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
......@@ -62,6 +70,8 @@ namespace AutoScanAndLabel
this.toolStripSeparator2,
this.停止ToolStripMenuItem,
this.toolStripSeparator3,
this.启用调试模式ToolStripMenuItem,
this.toolStripSeparator4,
this.退出ToolStripMenuItem});
this.设备操作ToolStripMenuItem.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.设备操作ToolStripMenuItem.Name = "设备操作ToolStripMenuItem";
......@@ -71,58 +81,119 @@ namespace AutoScanAndLabel
// 启动ToolStripMenuItem
//
this.启动ToolStripMenuItem.Name = "启动ToolStripMenuItem";
this.启动ToolStripMenuItem.Size = new System.Drawing.Size(112, 26);
this.启动ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.启动ToolStripMenuItem.Text = "启动";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(109, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
//
// 复位ToolStripMenuItem
//
this.复位ToolStripMenuItem.Name = "复位ToolStripMenuItem";
this.复位ToolStripMenuItem.Size = new System.Drawing.Size(112, 26);
this.复位ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复位ToolStripMenuItem.Text = "复位";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(109, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
//
// 停止ToolStripMenuItem
//
this.停止ToolStripMenuItem.Name = "停止ToolStripMenuItem";
this.停止ToolStripMenuItem.Size = new System.Drawing.Size(112, 26);
this.停止ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.停止ToolStripMenuItem.Text = "停止";
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(109, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
//
// 启用调试模式ToolStripMenuItem
//
this.启用调试模式ToolStripMenuItem.Name = "启用调试模式ToolStripMenuItem";
this.启用调试模式ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.启用调试模式ToolStripMenuItem.Text = "启用调试模式";
this.启用调试模式ToolStripMenuItem.Click += new System.EventHandler(this.启用调试模式ToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(112, 26);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.退出ToolStripMenuItem.Text = "退出";
//
// tabControl1
//
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.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.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabControl1.Location = new System.Drawing.Point(0, 29);
this.tabControl1.Location = new System.Drawing.Point(0, 106);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1342, 695);
this.tabControl1.Size = new System.Drawing.Size(1342, 618);
this.tabControl1.TabIndex = 1;
//
// listView1
//
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.listView1.Location = new System.Drawing.Point(516, 0);
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.ShowGroups = false;
this.listView1.Size = new System.Drawing.Size(826, 134);
this.listView1.TabIndex = 2;
this.listView1.UseCompatibleStateImageBehavior = false;
//
// btn_stop
//
this.btn_stop.Location = new System.Drawing.Point(131, 57);
this.btn_stop.Name = "btn_stop";
this.btn_stop.Size = new System.Drawing.Size(75, 23);
this.btn_stop.TabIndex = 3;
this.btn_stop.Text = "停止";
this.btn_stop.UseVisualStyleBackColor = true;
this.btn_stop.Click += new System.EventHandler(this.btn_stop_Click);
//
// btn_run
//
this.btn_run.Location = new System.Drawing.Point(25, 57);
this.btn_run.Name = "btn_run";
this.btn_run.Size = new System.Drawing.Size(75, 23);
this.btn_run.TabIndex = 4;
this.btn_run.Text = "启动";
this.btn_run.UseVisualStyleBackColor = true;
this.btn_run.Click += new System.EventHandler(this.btn_run_Click);
//
// tabPage1
//
this.tabPage1.Location = new System.Drawing.Point(4, 30);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(1334, 584);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1342, 724);
this.Controls.Add(this.btn_stop);
this.Controls.Add(this.btn_run);
this.Controls.Add(this.listView1);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.menuStrip1);
this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -132,6 +203,7 @@ namespace AutoScanAndLabel
this.Load += new System.EventHandler(this.Form1_Load);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
......@@ -149,6 +221,12 @@ namespace AutoScanAndLabel
private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem 启用调试模式ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.Button btn_stop;
private System.Windows.Forms.Button btn_run;
private System.Windows.Forms.TabPage tabPage1;
}
}
......@@ -21,14 +21,29 @@ namespace AutoScanAndLabel
private void Form1_Load(object sender, EventArgs e)
{
btn_run.Enabled = false;
btn_stop.Enabled = false;
listView1.View = View.Details;
ColumnHeader msgcol = new ColumnHeader();
msgcol.Text = "信息";
msgcol.Width = 600;
ColumnHeader timecol = new ColumnHeader();
timecol.Text = "时间";
timecol.Width = 150;
listView1.Columns.Add(timecol);
listView1.Columns.Add(msgcol);
LogUtil.info("开始初始化");
MainControl mc = new MainControl();
AddForm("控制", mc);
//MainControl mc = new MainControl();
//AddForm("控制", mc);
IOControl ioc = new IOControl();
AddForm("IO调试", ioc);
AxisControl ac = new AxisControl();
AddForm("伺服调试", ac);
RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
RobotManage.Init();
}
private void AddForm(string text, UserControl form)
{
......@@ -50,5 +65,79 @@ namespace AutoScanAndLabel
//tabPageList.Add(lineTabPage);
tabControl1.Controls.Add(lineTabPage);
}
private void 启用调试模式ToolStripMenuItem_Click(object sender, EventArgs e)
{
RobotManage.IsDebug = RobotManage.IsDebug ? false : true;
(sender as ToolStripMenuItem).Text = !RobotManage.IsDebug ? "启用调试模式" : "停用调试模式";
RobotManage.Init();
}
public delegate void setmsgdelegate(List<Msg> msgs);
private void MainMachine_ProcessMsgEvent(List<Msg> msgs)
{
var d = new setmsgdelegate(SetMsg);
this.Invoke(d, msgs);
}
private void RobotManage_LoadFinishEvent(bool state, string msg)
{
if (state)
{
btn_run.Enabled = true;
btn_stop.Enabled = true;
RobotManage.mainMachine.ProcessMsgEvent += MainMachine_ProcessMsgEvent;
}
var m = new Msg();
m.datetime = DateTime.Now;
m.msgtxt = msg;
m.msgLevel = state ? MsgLevel.info : MsgLevel.warning;
SetMsg(new List<Msg> { m });
}
void SetMsg(List<Msg> msgs)
{
listView1.Items.Clear();
foreach (Msg msg in msgs)
{
ListViewItem lvi = new ListViewItem(new string[] { msg.datetime.ToString(), msg.msgtxt });
if (msg.msgLevel==MsgLevel.info)
lvi.ForeColor = Color.DarkGreen;
else
lvi.ForeColor = Color.Red;
listView1.Items.Add(lvi);
}
}
bool userpause = false;
private void btn_run_Click(object sender, EventArgs e)
{
if (!RobotManage.isRunning)
{
RobotManage.Start();
userpause = false;
(sender as Button).Text = "暂停运行";
}
else if (!userpause)
{
userpause = true;
RobotManage.UserPause(userpause);
(sender as Button).Text = "恢复运行";
}
else if (userpause)
{
userpause = false;
RobotManage.UserPause(userpause);
(sender as Button).Text = "暂停运行";
}
}
private void btn_stop_Click(object sender, EventArgs e)
{
btn_run.Text = "启动";
RobotManage.Stop();
}
}
}
......@@ -25,7 +25,13 @@ namespace AutoScanAndLabel
t1.Tick += T1_Tick;
GC.KeepAlive(t1);
LoadIOList();
RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
}
private void RobotManage_LoadFinishEvent(bool state, string msg)
{
if (state) { LoadIOList(); }
}
private void T1_Tick(object sender, EventArgs e)
......@@ -45,7 +51,11 @@ namespace AutoScanAndLabel
private void LoadIOList()
{
this.SuspendLayout();
DIControlList.Clear();
DOControlList.Clear();
int roleindex = 0;
this.tableLayoutPanel1.Controls.Clear();
this.tableLayoutPanel1.RowStyles.Clear();
this.tableLayoutPanel1.RowCount = RobotManage.Config.DIList.Count;
foreach (ConfigIO ioValue in RobotManage.Config.DIList.Values)
......@@ -60,8 +70,8 @@ namespace AutoScanAndLabel
DIControlList.Add(ioValue.ProName, control);
}
}
tableLayoutPanel2.RowStyles.Clear();
this.tableLayoutPanel2.Controls.Clear();
this.tableLayoutPanel2.RowStyles.Clear();
this.tableLayoutPanel2.RowCount = RobotManage.Config.DOList.Count;
roleindex = 0;
foreach (ConfigIO ioValue in RobotManage.Config.DOList.Values)
......@@ -76,12 +86,12 @@ namespace AutoScanAndLabel
DOControlList.Add(ioValue.ProName, control);
}
}
this.SuspendLayout(); //此处为不闪屏,一定要有的!
cmbWriteIO.DataSource = new List<ConfigIO>(RobotManage.Config.DOList.Values);
cmbWriteIO.ValueMember = "ProName";
cmbWriteIO.DisplayMember = "DisplayStr";
this.ResumeLayout(false);
t1.Start();
}
......

namespace AutoScanAndLabel
{
partial class MainControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.btn_run = new System.Windows.Forms.Button();
this.btn_stop = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btn_run
//
this.btn_run.Location = new System.Drawing.Point(57, 46);
this.btn_run.Name = "btn_run";
this.btn_run.Size = new System.Drawing.Size(75, 23);
this.btn_run.TabIndex = 0;
this.btn_run.Text = "启动";
this.btn_run.UseVisualStyleBackColor = true;
//
// btn_stop
//
this.btn_stop.Location = new System.Drawing.Point(153, 46);
this.btn_stop.Name = "btn_stop";
this.btn_stop.Size = new System.Drawing.Size(75, 23);
this.btn_stop.TabIndex = 0;
this.btn_stop.Text = "停止";
this.btn_stop.UseVisualStyleBackColor = true;
//
// MainControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btn_stop);
this.Controls.Add(this.btn_run);
this.Name = "MainControl";
this.Size = new System.Drawing.Size(1001, 470);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btn_run;
private System.Windows.Forms.Button btn_stop;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AutoScanAndLabel
{
public partial class MainControl : UserControl
{
public MainControl()
{
InitializeComponent();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
......@@ -35,7 +35,7 @@ namespace DeviceLibrary
Thread.Sleep(50);
AxisManager.ServoOn(portName, slvAddr);
Thread.Sleep(1000);
Thread.Sleep(500);
//打开所有轴
if (isCheck)
{
......@@ -146,7 +146,7 @@ namespace DeviceLibrary
AxisManager.AlarmClear(deviceName, axisNo);
Thread.Sleep(200);
AxisManager.ServoOn(deviceName, axisNo);
Thread.Sleep(500);
Thread.Sleep(200);
}
}
if (String.IsNullOrEmpty(clearMsg))
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
class Common
{
}
public class Msg
{
public static List<Msg> msg = new List<Msg>();
public string msgtxt;
public MsgLevel msgLevel;
public DateTime datetime;
public static List<Msg> get() {
return msg;
}
public static void add(string m, MsgLevel ml)
{
msg.Add(new Msg { msgtxt = m, msgLevel = ml, datetime=DateTime.Now });
}
public static void clear()
{
msg.Clear();
}
}
public enum MsgLevel {
warning,
info
}
}
......@@ -10,7 +10,7 @@ namespace DeviceLibrary
public interface IRobot
{
//List<ConfigMoveAxis> moveAxisList { get; set; }
Robot_Config config { get; set; }
Robot_Config Config { get; set; }
string Name { get; set; }
bool canRunning { get; set; }
......
using System;
using CodeLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
......@@ -34,6 +35,7 @@ namespace DeviceLibrary
/// </summary>
public string WareCode { get; set; }
public List<CodeInfo> codeInfos { get; set; }
/// <summary>
/// 料盘高度
/// </summary>
......
......@@ -11,25 +11,19 @@ namespace DeviceLibrary
{
partial class MainMachine
{
void MoveEndProcess()
{
MoveInfo.EndMove();
runStatus = RunStatus.Running;
if (alarmType.Equals(AlarmType.None))
{
WarnMsg = "";
}
}
public void StopMove(bool ServoOff=false)
{
MoveInfo.EndMove();
ResetMoveInfo.EndMove();
RightMoveInfo.EndMove();
LeftMoveInfo.EndMove();
LabelMoveInfo.EndMove();
MiddleMoveInfo.EndMove();
AxisBean.CloseMultiAxis(new AxisBean[] { Take_Middle_Axis, Take_UpDown_Axis, Left_Batch_Axis, Right_Batch_Axis, Label_X_Axis, Label_Y_Axis, Label_Z_Axis, Label_R_Axis });
if (!ServoOff)
return;
foreach (ConfigMoveAxis configMoveAxis in config.moveAxisList)
foreach (ConfigMoveAxis configMoveAxis in Config.moveAxisList)
AxisManager.ServoOff("", configMoveAxis.GetAxisValue());
}
public void OpenAllServo()
......@@ -37,13 +31,9 @@ namespace DeviceLibrary
AxisBean.RunMultiAxis(true, out _, new AxisBean[] { Take_Middle_Axis, Take_UpDown_Axis, Left_Batch_Axis, Right_Batch_Axis, Label_X_Axis, Label_Y_Axis, Label_Z_Axis, Label_R_Axis });
}
void LogInfo(string logInfo)
{
LogUtil.info(Name + logInfo);
}
int logType = 1000;
string WarnMsg = "";
bool CheckWait()
bool CheckWait(MoveInfo MoveInfo)
{
List<WaitResultInfo> list = MoveInfo.WaitList;
//当等待超过一分钟时,需要打印提示
......@@ -119,6 +109,37 @@ namespace DeviceLibrary
wait.IsEnd = wait.Action.Invoke(wait);
LogUtil.info($"{Name} 自定义等待 IsEnd={wait.IsEnd},Type={wait.Action.GetType()}");
}
else if (wait.WaitType.Equals(WaitEnum.W008_BatchAxis))
{
AxisBean axisBean;
if (wait.AxisInfo.ProName == "Right_Batch_Axis")
axisBean = Right_Batch_Axis;
else
axisBean = Left_Batch_Axis;
//等待信号亮或者走到绝对位置才停止
if (IOValue(axisBean.TargetIoType).Equals(axisBean.TargetIoValue))
{
LogUtil.debug(Name + "CheckWaitResult 检测到" + axisBean.TargetIoType + "=" + axisBean.TargetIoValue + ",停止运行");
axisBean.StopAxisCheckMove();
if (AxisManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(1))
{
axisBean.SuddenStop();
}
wait.IsEnd=true;
}
else
{
bool _isOk = AxisManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(0);
if (_isOk)
{
//TODO 判断是否达到高度,如果未达到,继续上升
axisBean.StopAxisCheckMove();
wait.IsEnd= true;
}
}
}
if (wait.IsEnd)
{
if (MoveInfo.OneWaitCanEndStep)
......@@ -262,7 +283,7 @@ namespace DeviceLibrary
}
else
{
Task.Factory.StartNew(delegate
Task.Run(()=>
{
IOManager.IOMove(IoType, value);
Thread.Sleep(msTime);
......@@ -275,5 +296,7 @@ namespace DeviceLibrary
}
}
}
}
using CodeLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
partial class MainMachine
{
void LabelProcess()
{
if (CheckWait(LabelMoveInfo))
return;
switch (LabelMoveInfo.MoveStep)
{
case MoveStep.Lbl01:
Label_X_Axis.AbsMove(LabelMoveInfo, Config.Label_X_P2, Config.Label_X_P2_speed);
Label_Y_Axis.AbsMove(LabelMoveInfo, Config.Label_Y_P2, Config.Label_Y_P2_speed);
Label_Z_Axis.AbsMove(LabelMoveInfo, Config.Label_Z_P2, Config.Label_Z_P2_speed);
LabelMoveInfo.NextMoveStep(MoveStep.Lbl_WaitPrint);
LabelMoveInfo.log("Label_XYZ转到取标点,等待标签打印完毕");
break;
case MoveStep.Lbl_Printted:
LabelMoveInfo.NextMoveStep(MoveStep.Lbl02);
CylinderMove(LabelMoveInfo, IO_Type.LabelCylinder_Bck, IO_Type.LabelCylinder_Fwd);
IOMove(IO_Type.LabelCylinder_Work, IO_VALUE.HIGH);
LabelMoveInfo.log("标签打印完毕,取标气缸下降,开始吸气.");
break;
case MoveStep.Lbl02:
CylinderMove(LabelMoveInfo, IO_Type.LabelCylinder_Fwd, IO_Type.LabelCylinder_Bck);
LabelMoveInfo.NextMoveStep(MoveStep.Lbl03);
LabelMoveInfo.log("标签打印完毕,取标气缸上升,取起标签.");
break;
case MoveStep.Lbl03:
if (LeftMoveInfo.MoveStep == MoveStep.L20_WaitLabel)
{
LabelMoveInfo.NextMoveStep(MoveStep.Lbl10);
}
else if (LabelMoveInfo.IsTimeOut(60)) {
LabelMoveInfo.log("等待左侧料窜可贴标.");
}
break;
case MoveStep.Lbl10:
Label_X_Axis.AbsMove(LabelMoveInfo, Config.Label_X_P3, Config.Label_X_P3_speed);
Label_Y_Axis.AbsMove(LabelMoveInfo, Config.Label_Y_P3, Config.Label_Y_P3_speed);
Label_Z_Axis.AbsMove(LabelMoveInfo, Config.Label_Z_P3, Config.Label_Z_P3_speed);
LabelMoveInfo.NextMoveStep(MoveStep.Lbl11);
LabelMoveInfo.log("Label_XYZ转到贴标点.");
break;
case MoveStep.Lbl11:
LabelMoveInfo.NextMoveStep(MoveStep.Lbl12);
CylinderMove(LabelMoveInfo, IO_Type.LabelCylinder_Bck, IO_Type.LabelCylinder_Fwd);
IOMove(IO_Type.LabelCylinder_Work, IO_VALUE.LOW);
LabelMoveInfo.log("取标气缸下降,关闭吸气.");
break;
case MoveStep.Lbl12:
CylinderMove(LabelMoveInfo, IO_Type.LabelCylinder_Fwd, IO_Type.LabelCylinder_Bck);
LabelMoveInfo.NextMoveStep(MoveStep.Lbl13);
LabelMoveInfo.log("取标气缸上升.");
break;
case MoveStep.Lbl13:
LeftMoveInfo.NextMoveStep(MoveStep.L30_LabelFinish);
LabelMoveInfo.NextMoveStep(MoveStep.Lbl01);
LabelMoveInfo.log("完成贴标.");
break;
}
}
}
}
using CodeLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
partial class MainMachine
{
bool LeftShelfNoTray = false;
void LeftProcess()
{
if (CheckWait(LeftMoveInfo))
return;
switch (LeftMoveInfo.MoveStep)
{
case MoveStep.L01:
LeftMoveInfo.NextMoveStep(MoveStep.L03);
LeftBatchAxisToP2(true);
LeftMoveInfo.log($"批量轴上升到P2位置,第一次提升,LeftStartMovePosition={LeftStartMovePosition}");
break;
case MoveStep.L02:
LeftMoveInfo.NextMoveStep(MoveStep.L03);
LeftBatchAxisToP2(false);
LeftMoveInfo.log($"批量轴上升到P2位置,二次提升,LeftStartMovePosition={LeftStartMovePosition}");
break;
case MoveStep.L03:
if (IOValue(IO_Type.LeftOverHead_Check).Equals(IO_VALUE.HIGH))
{
LeftMoveInfo.NextMoveStep(MoveStep.L02);
Left_Batch_Axis.AbsMove(LeftMoveInfo, LeftStartMovePosition, Config.Left_Batch_P2_speed);
LeftMoveInfo.log($"批量轴上升过头,下降到:LeftStartMovePosition={LeftStartMovePosition}");
}
else {
LeftMoveInfo.NextMoveStep(MoveStep.L04);
}
break;
case MoveStep.L04:
var currpos = Left_Batch_Axis.GetAclPosition()-Config.Left_Batch_ChangeValue*80;
if (currpos < Config.Left_Batch_P1)
{
LeftMoveInfo.NextMoveStep(MoveStep.L40_ShelfFull);
LeftMoveInfo.log($"批量轴已下降到底,料串已满,Left_Batch_P1={Config.Left_Batch_P1},needpos={currpos}");
}
else
{
LeftMoveInfo.NextMoveStep(MoveStep.L10_WaitReelPut);
Left_Batch_Axis.AbsMove(LeftMoveInfo, currpos, Config.Left_Batch_P1_speed);
LeftMoveInfo.log($"批量轴已下降一张料盘位置,等待料盘放入,needpos={currpos}");
}
break;
case MoveStep.L10_WaitReelPut:
break;
case MoveStep.L11_ReelPutted:
LeftMoveInfo.NextMoveStep(MoveStep.L12);
LeftBatchAxisToP2(false);
LeftMoveInfo.log($"料盘已放入,批量轴上升,LeftStartMovePosition={LeftStartMovePosition}");
break;
case MoveStep.L12:
if (IOValue(IO_Type.LeftOverHead_Check).Equals(IO_VALUE.HIGH))
{
LeftMoveInfo.NextMoveStep(MoveStep.L11_ReelPutted);
Left_Batch_Axis.AbsMove(LeftMoveInfo, LeftStartMovePosition, Config.Left_Batch_P2_speed);
LeftMoveInfo.log($"批量轴上升过头,下降到:LeftStartMovePosition={LeftStartMovePosition}");
}
else
{
LeftMoveInfo.NextMoveStep(MoveStep.L20_WaitLabel);
LeftMoveInfo.log($"批量轴完成上升,等待贴标");
}
break;
case MoveStep.L20_WaitLabel:
break;
case MoveStep.L30_LabelFinish:
LeftMoveInfo.NextMoveStep(MoveStep.L04);
LeftMoveInfo.log($"贴标完成,准备下一盘料");
break;
case MoveStep.L40_ShelfFull:
LeftMoveInfo.NextMoveStep(MoveStep.LEND);
Left_Batch_Axis.AbsMove(LeftMoveInfo, Config.Left_Batch_P1, Config.Left_Batch_P1_speed);
LeftMoveInfo.log($"料串已满,批量轴下降到P1位置");
break;
case MoveStep.LEND:
LeftMoveInfo.EndMove();
break;
}
}
int LeftStartMovePosition = 0;
void LeftBatchAxisToP2(bool isFirstMove = true)
{
int targetP2 = Config.Left_Batch_P2;
int targetSpeed = Config.Left_Batch_P2_speed;
if (!isFirstMove)
{
int currPosition = Left_Batch_Axis.GetAclPosition();
if (currPosition != -1)
{
//targetP2 = currPosition + Config.Left_Batch_ChangeValue * 80;
if (targetP2 > Config.Left_Batch_P2)
{
targetP2 = Config.Left_Batch_P2;
}
LeftMoveInfo.log("BatchAxisToP2 目标P2: " + targetP2 + "(" + currPosition + ")");
}
//targetSpeed = Config.BatchAxis_P3Speed / 2;
}
LeftMoveInfo.TimeOutSeconds = 200;
LeftMoveInfo.CanWhileCount = 0;
// 需要增加定时器,获取验证信号并停止伺服
LeftStartMovePosition = Left_Batch_Axis.GetAclPosition();
LeftMoveInfo.WaitList.Add(WaitResultInfo.WaitBatchAxisMove(Config.Left_Batch_Axis, targetP2, targetSpeed));
Config.Left_Batch_Axis.TargetPosition = targetP2;
Left_Batch_Axis.AbsMove(null, targetP2, targetSpeed);
//开始检测信号
Left_Batch_Axis.BatchAxisStartCheck(IO_Type.LeftTop_Check, IO_VALUE.LOW);
}
}
}
using CodeLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
partial class MainMachine
{
void MiddleProcess()
{
if (CheckWait(MiddleMoveInfo))
return;
switch (MiddleMoveInfo.MoveStep)
{
case MoveStep.M01:
if (RightMoveInfo.MoveStep == MoveStep.R10_WaitReelLeave)
{
MiddleMoveInfo.NextMoveStep(MoveStep.M02);
Take_Middle_Axis.AbsMove(MiddleMoveInfo, Config.Take_Middle_P2, Config.Take_Middle_P2_speed);
Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P2, Config.Take_UpDown_P2_speed);
electricClamp.Release();
MiddleMoveInfo.log("右侧可以取料,旋转轴/上下轴转到P2点");
}
else if (MiddleMoveInfo.IsTimeOut(60)) {
MiddleMoveInfo.log("等待右侧可以取料");
}
break;
case MoveStep.M02:
MiddleMoveInfo.NextMoveStep(MoveStep.M03);
Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P3, Config.Take_UpDown_P3_speed);
MiddleMoveInfo.log("右侧可以取料,上下轴转到P3点,开始取料");
break;
case MoveStep.M03:
if (electricClamp.Clamp())
{
MiddleMoveInfo.NextMoveStep(MoveStep.M04);
MiddleMoveInfo.log("取料气缸夹紧");
}
break;
case MoveStep.M04:
Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P2, Config.Take_UpDown_P2_speed);
MiddleMoveInfo.NextMoveStep(MoveStep.M05);
MiddleMoveInfo.log("上下轴返回P2点");
break;
case MoveStep.M05:
MiddleMoveInfo.NextMoveStep(MoveStep.M06);
RightMoveInfo.NextMoveStep(MoveStep.R11_NextReel);
MiddleMoveInfo.log("通知右侧料串,料已取走");
break;
case MoveStep.M06:
if (MiddleMoveInfo.MoveParam.IsNg)
{
MiddleMoveInfo.NextMoveStep(MoveStep.M20_ToNgBox);
MiddleMoveInfo.log("判断为NG料");
}
//等待计算盘高
else if (RightMoveInfo.MoveStep >= MoveStep.R06 && RightMoveInfo.MoveStep <= MoveStep.R10_WaitReelLeave)
{
MiddleMoveInfo.NextMoveStep(MoveStep.M07);
MiddleMoveInfo.MoveParam.IsNg = RightMoveInfo.MoveParam.IsNg;
MiddleMoveInfo.MoveParam.WareCode = RightMoveInfo.MoveParam.WareCode;
MiddleMoveInfo.MoveParam.codeInfos = RightMoveInfo.MoveParam.codeInfos;
MiddleMoveInfo.MoveParam.PlateW = MiddleMoveInfo.MoveParam.PlateW;
MiddleMoveInfo.MoveParam.PlateH = LastHeight;
MiddleMoveInfo.NextMoveStep(MoveStep.M07);
MiddleMoveInfo.log($"已获取盘高,开始往左侧料窜移栽,{MiddleMoveInfo.MoveParam.ToStr()}");
}
else if (MiddleMoveInfo.IsTimeOut(60))
{
MiddleMoveInfo.log("等待计算盘高");
}
break;
case MoveStep.M07:
if (LeftMoveInfo.MoveStep == MoveStep.L10_WaitReelPut)
{
MiddleMoveInfo.NextMoveStep(MoveStep.M08);
Take_Middle_Axis.AbsMove(MiddleMoveInfo, Config.Take_Middle_P3, Config.Take_Middle_P3_speed);
Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P4, Config.Take_UpDown_P4_speed);
MiddleMoveInfo.log("左侧允许放料,旋转轴/上下周到P3/P4");
}
else if (MiddleMoveInfo.IsTimeOut(60))
{
MiddleMoveInfo.log("等待左侧允许放料");
}
break;
case MoveStep.M08:
MiddleMoveInfo.NextMoveStep(MoveStep.M_ReturnToP1);
electricClamp.Release();
LeftMoveInfo.NextMoveStep(MoveStep.L11_ReelPutted);
MiddleMoveInfo.log("取料夹爪放松,通知左侧料窜已放入,左侧等待3秒");
LeftMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
break;
case MoveStep.M_ReturnToP1:
MiddleMoveInfo.NextMoveStep(MoveStep.M01);
Take_Middle_Axis.AbsMove(MiddleMoveInfo, Config.Take_Middle_P1, Config.Take_Middle_P1_speed);
Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P1, Config.Take_UpDown_P1_speed);
MiddleMoveInfo.log("放料完成,旋转轴/上下轴返回待机点");
break;
case MoveStep.M20_ToNgBox:
MiddleMoveInfo.NextMoveStep(MoveStep.M21);
Take_Middle_Axis.AbsMove(MiddleMoveInfo, Config.Take_Middle_P5, Config.Take_Middle_P5_speed);
Take_UpDown_Axis.AbsMove(MiddleMoveInfo, Config.Take_UpDown_P5, Config.Take_UpDown_P5_speed);
MiddleMoveInfo.log("旋转轴/上下轴转到P5 NG位置");
break;
case MoveStep.M21:
MiddleMoveInfo.NextMoveStep(MoveStep.M_ReturnToP1);
electricClamp.Release();
MiddleMoveInfo.log("取料夹爪放松,放料入NG位置.");
break;
}
}
}
}
using CodeLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DeviceLibrary
{
partial class MainMachine
{
string PrintName = ConfigAppSettings.GetValue(Setting_Init.PrinterName);
Asa.PrintLabel PrintBean = null;
public void InitPrint()
{
PrintBean = new Asa.PrintLabel(Application.StartupPath + "\\Label");
PrintBean.PrintStatusChanged += Print_PrintStatusChanged;
string labelName = ConfigAppSettings.GetValue(Setting_Init.LabelName);
PrintBean.LoadLabel(labelName);
PrintBean.Printer(PrintName, false);
LogUtil.info("PrintLabel 打印机初始化完成【" + labelName + "】【" + PrintName + "】");
System.Drawing.Printing.PrintDocument print = new System.Drawing.Printing.PrintDocument();
string sDefault = print.PrinterSettings.PrinterName;//默认打印机名
LogUtil.info("PrintLabel 本机默认打印机:" + sDefault);
int index = 1;
foreach (string sPrint in System.Drawing.Printing.PrinterSettings.InstalledPrinters)//获取所有打印机名称
{
LogUtil.info("PrintLabel 打印机_" + index + "_名称:" + sPrint);
index++;
}
}
Asa.PrintLabel.PrinterStatus LastPrintStatus = Asa.PrintLabel.PrinterStatus.Unknown;
void Print_PrintStatusChanged(Asa.PrintLabel.PrinterStatus sta, string msg)
{
if (sta.Equals(LastPrintStatus).Equals(false))
{
LogUtil.info("PrintLabel 收到打印机新状态:【" + sta + "】【" + msg + "】,替换原来的状态【" + LastPrintStatus + "】 ");
}
else
{
if (sta == Asa.PrintLabel.PrinterStatus.Idle) {
}
LogUtil.info(" PrintLabel 收到打印机新状态:【" + sta + "】【" + msg + "】,与之前状态一样 ");
}
LastPrintStatus = sta;
}
void StartPrintLabel(string wareCode, string wareCount, string FactoryCode = "")
{
try
{
LastPrintStatus= Asa.PrintLabel.PrinterStatus.Unknown;
LogUtil.info("调用 PrintLabel 打印标签 StartPrintLabel ,[" + wareCode + "] [" + wareCount + "] 开始");
Dictionary<string, string> text = new Dictionary<string, string>();
text.Add("Code", wareCode);
text.Add("Count", wareCount);
text.Add("DateTime", System.DateTime.Now.ToString("F"));
text.Add("FactoryCode", FactoryCode);
PrintBean.Print(text);
LogUtil.info("PrintLabel 打印标签 StartPrintLabel 结束 ");
}
catch (Exception ex)
{
LogUtil.error("PrintLabel 打印标签 StartPrintLabel 错误:" + ex.ToString());
}
}
public Task DoPrint(string aaa) {
return Task.Run((aaa)=> {
StartPrintLabel(aaa, aaa, aaa);
while()
if (LabelMoveInfo.IsStep(MoveStep.Lbl_WaitPrint))
{
}
});
}
}
}
using CodeLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
partial class MainMachine
{
bool RightShelfNoTray = false;
void RightProcess()
{
if (CheckWait(RightMoveInfo))
return;
switch (RightMoveInfo.MoveStep)
{
case MoveStep.R01:
RightMoveInfo.NextMoveStep(MoveStep.R03);
RightBatchAxisToP2(true);
RightMoveInfo.log($"批量轴上升到P2位置,第一次提升,RightStartMovePosition={RightStartMovePosition}");
break;
case MoveStep.R02:
RightMoveInfo.NextMoveStep(MoveStep.R03);
RightBatchAxisToP2(false);
RightMoveInfo.log($"批量轴上升到P2位置,二次提升,RightStartMovePosition={RightStartMovePosition}");
break;
case MoveStep.R03:
if (IOValue(IO_Type.RightOverHead_Check).Equals(IO_VALUE.HIGH))
{
RightMoveInfo.NextMoveStep(MoveStep.R02);
Right_Batch_Axis.AbsMove(RightMoveInfo, RightStartMovePosition, Config.Right_Batch_P2_speed);
RightMoveInfo.log($"批量轴上升过头,下降到:RightStartMovePosition={RightStartMovePosition}");
}
else {
RightMoveInfo.NextMoveStep(MoveStep.R04);
}
break;
case MoveStep.R04:
if (IOValue(IO_Type.RightTop_Check).Equals(IO_VALUE.LOW) && RightShelfNoTray.Equals(false))
{
RightMoveInfo.NextMoveStep(MoveStep.R06);
GetHeight();
ScanCode();
RightMoveInfo.log($"开始扫码,并获取上一盘料高度,LastHeight={LastHeight}");
}
else
{
if (RightShelfNoTray.Equals(false))
{
//判断当前位置是否在指定的位置
int currP = Right_Batch_Axis.GetAclPosition();
int chaz = Math.Abs(currP - Config.Right_Batch_P2);
if (chaz > Right_Batch_Axis.Config.CanErrorCountMax)
{
//RightMoveInfo.NextMoveStep(MoveStep.R02);
RightMoveInfo.log("CheckHasTray:上料轴开始慢速上升到P2[" + Config.Right_Batch_P2 + "],等待检测到料盘");
RightShelfNoTray = false;
RightBatchAxisToP2(false);
return;
}
}
//无料盘
RightShelfNoTray = true;
RightMoveInfo.NextMoveStep(MoveStep.R12_ShelfNoTray);
RightMoveInfo.log($"批量轴已上升到顶,料串已满.");
}
break;
case MoveStep.R06:
if (RightScanTask.IsCompleted)
{
RightMoveInfo.NextMoveStep(MoveStep.R10_WaitReelLeave);
var x = RightScanTask.Result;
if (x.Count == 0)
{
RightMoveInfo.log($"未识别到有效二维码,转入NG箱");
RightMoveInfo.MoveParam.IsNg = true;
}
else
{
RightMoveInfo.MoveParam.codeInfos = x;
DoPrint("123");
RightMoveInfo.log($"已完成扫码,等待料盘被取走 Count={x.Count}");
}
}
else if (RightMoveInfo.IsTimeOut(10)) {
RightMoveInfo.log($"等待扫码超时");
}
break;
case MoveStep.R10_WaitReelLeave:
break;
case MoveStep.R11_NextReel:
RightMoveInfo.NextMoveStep(MoveStep.R02);
RightMoveInfo.log($"料盘已取走,开始准备下一盘料");
break;
case MoveStep.R12_ShelfNoTray:
RightMoveInfo.NextMoveStep(MoveStep.R20);
Right_Batch_Axis.AbsMove(RightMoveInfo, Config.Right_Batch_P1, Config.Right_Batch_P1_speed);
RightMoveInfo.log($"料窜已取完, 批量轴下降到P1");
break;
case MoveStep.R20:
RightMoveInfo.EndMove();
break;
case MoveStep.REND:
break;
}
}
/// <summary>
/// 扫码线程
/// </summary>
Task<List<CodeInfo>> RightScanTask;
void ScanCode() {
RightMoveInfo.log("开始扫码");
//RightMoveInfo.OneWaitCanEndStep = true;
//RightMoveInfo.WaitList.Add(WaitResultInfo.WaitScanCode());
//RightMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
try
{
RightScanTask = Task.Run(new Func<List<CodeInfo>>(()=>
{
IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
Task.Delay(10).Wait();
List<CodeInfo> LastCodeList = CodeManager.CameraScan(new List<string> { Config.RightCameraName });
if (LastCodeList.Count <= 0)
{
Task.Delay(500).Wait();
LastCodeList = CodeManager.CameraScan(new List<string> { Config.RightCameraName });
}
IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
return LastCodeList;
}));
}
catch (Exception ex)
{
LogUtil.error("FI_13_ScanCode扫码出错:", ex);
}
}
int RightStartMovePosition = 0;
void RightBatchAxisToP2(bool isFirstMove = true)
{
int targetP2 = Config.Right_Batch_P2;
int targetSpeed = Config.Right_Batch_P2_speed;
if (!isFirstMove)
{
int currPosition = Right_Batch_Axis.GetAclPosition();
if (currPosition != -1)
{
//targetP2 = currPosition + Config.Right_Batch_ChangeValue * 80;
if (targetP2 > Config.Right_Batch_P2)
{
targetP2 = Config.Right_Batch_P2;
}
RightMoveInfo.log("BatchAxisToP2 目标P2: " + targetP2 + "(" + currPosition + ")");
}
//targetSpeed = Config.BatchAxis_P3Speed / 2;
}
RightMoveInfo.TimeOutSeconds = 200;
RightMoveInfo.CanWhileCount = 0;
// 需要增加定时器,获取验证信号并停止伺服
RightStartMovePosition = Right_Batch_Axis.GetAclPosition();
RightMoveInfo.WaitList.Add(WaitResultInfo.WaitBatchAxisMove(Config.Right_Batch_Axis, targetP2, targetSpeed));
Config.Right_Batch_Axis.TargetPosition = targetP2;
Right_Batch_Axis.AbsMove(null, targetP2, targetSpeed);
//开始检测信号
Right_Batch_Axis.BatchAxisStartCheck(IO_Type.RightTop_Check, IO_VALUE.LOW);
}
int RightEndMovePosition = 0;
int LastHeight = 0;
private int GetHeight()
{
LastHeight = 0;
int AxisChangeValue = Config.Right_Batch_ChangeValue;
//计算高度
RightEndMovePosition = Right_Batch_Axis.GetAclPosition();
bool isLast = false;
int chaz = Math.Abs(RightEndMovePosition - Config.Right_Batch_P2);
if (chaz < Right_Batch_Axis.Config.CanErrorCountMax)
{
isLast = true;
}
float height = (float)Math.Ceiling(1F * Math.Abs(RightEndMovePosition - RightStartMovePosition) / AxisChangeValue);
string buchongStr = "";
if (isLast)
{
buchongStr = "(最后一盘料已补充5)";
height += 5;
}
//如果检测出<=15,都按照8计算
if (height <= 15)
{
LastHeight = 8;
}
else
{
List<int> heightList = new List<int> { 8, 12, 16, 20 };
heightList = (from m in heightList orderby m descending select m).ToList<int>();
float minCha = height;
foreach (int h in heightList)
{
//取差值最小的接近值
float cha = Math.Abs(h - (height - 4));
if (cha < minCha)
{
LastHeight = h;
minCha = cha;
}
}
}
if (LastHeight <= 8) { LastHeight = 8; }
string msg = Name + " 计算盘高:上升前 [" + RightStartMovePosition + "]实时[ " + RightEndMovePosition + "]差值[" + (RightEndMovePosition - RightStartMovePosition) + "]系数[" + AxisChangeValue + "] 计算后" + buchongStr + "[" + height + "]" + ",归类为【" + LastHeight + "mm】";
LogUtil.info(msg);
return LastHeight;
}
}
}
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
partial class MainMachine
{
void WorkProcess() {
}
}
}
......@@ -6,6 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DeviceLibrary
{
......@@ -16,19 +17,30 @@ namespace DeviceLibrary
public bool isBusy { get; set; } = false;
public bool isAlarm { get; set; } = false;
public RunStatus runStatus { get; set; } = RunStatus.Stop;
public Robot_Config config { get; set; }
public MoveInfo MoveInfo;
public Robot_Config Config { get; set; }
public bool UserPause { get; set; } = false;
MoveInfo ResetMoveInfo;
/// <summary>
/// 右侧移动信息
/// </summary>
MoveInfo RightMoveInfo;
MoveInfo LeftMoveInfo;
MoveInfo LabelMoveInfo;
MoveInfo MiddleMoveInfo;
public AxisBean Take_Middle_Axis;
public AxisBean Take_UpDown_Axis;
public AxisBean Left_Batch_Axis;
public AxisBean Right_Batch_Axis;
public AxisBean Label_X_Axis;
public AxisBean Label_Y_Axis;
public AxisBean Label_Z_Axis;
public AxisBean Label_R_Axis;
public delegate void ProcessMsg(List<Msg> msg);
public event ProcessMsg ProcessMsgEvent;
AxisBean Take_Middle_Axis;
AxisBean Take_UpDown_Axis;
AxisBean Left_Batch_Axis;
AxisBean Right_Batch_Axis;
AxisBean Label_X_Axis;
AxisBean Label_Y_Axis;
AxisBean Label_Z_Axis;
AxisBean Label_R_Axis;
ElectricGripper electricClamp;
/// <summary>
/// 开始运行的时间
/// </summary>
......@@ -42,140 +54,194 @@ namespace DeviceLibrary
public MainMachine(Robot_Config _config) {
config = _config;
Take_Middle_Axis = new AxisBean(config.Take_Middle_Axis, Name);
Take_UpDown_Axis = new AxisBean(config.Take_UpDown_Axis, Name);
Left_Batch_Axis = new AxisBean(config.Left_Batch_Axis, Name);
Right_Batch_Axis = new AxisBean(config.Right_Batch_Axis, Name);
Label_X_Axis = new AxisBean(config.Label_X_Axis, Name);
Label_Y_Axis = new AxisBean(config.Label_Y_Axis, Name);
Label_Z_Axis = new AxisBean(config.Label_Z_Axis, Name);
Label_R_Axis = new AxisBean(config.Label_R_Axis, Name);
}
Config = _config;
ResetMoveInfo = new MoveInfo("重置");
RightMoveInfo = new MoveInfo("右侧取料");
LeftMoveInfo = new MoveInfo("左侧收料");
LabelMoveInfo = new MoveInfo("贴标");
MiddleMoveInfo = new MoveInfo("移栽");
MiddleMoveInfo.NextMoveStep(MoveStep.M01);
LabelMoveInfo.NextMoveStep(MoveStep.Lbl01);
Take_Middle_Axis = new AxisBean(Config.Take_Middle_Axis, Name);
Take_UpDown_Axis = new AxisBean(Config.Take_UpDown_Axis, Name);
Left_Batch_Axis = new AxisBean(Config.Left_Batch_Axis, Name);
Right_Batch_Axis = new AxisBean(Config.Right_Batch_Axis, Name);
Label_X_Axis = new AxisBean(Config.Label_X_Axis, Name);
Label_Y_Axis = new AxisBean(Config.Label_Y_Axis, Name);
Label_Z_Axis = new AxisBean(Config.Label_Z_Axis, Name);
Label_R_Axis = new AxisBean(Config.Label_R_Axis, Name);
electricClamp = new ElectricGripper();
electricClamp.OpenPort("");
InitPrint();
}
/// <summary>
/// 整机启动变量
/// </summary>
bool mstart=true;
public void Run() {
while (true) {
canRunning = DeviceCheck();
if (canRunning)
canRunning = SafeCheck();
Thread.Sleep(50);
if (!canRunning)
continue;
if (runStatus == RunStatus.Running)
mstart = true;
while (mstart) {
try
{
WorkProcess();
canRunning = DeviceCheck();
if (canRunning)
{
canRunning = SafeCheck();
}
Thread.Sleep(50);
if (!canRunning || !mstart)
continue;
if (runStatus == RunStatus.Running)
{
RightProcess();
MiddleProcess();
LeftProcess();
LabelProcess();
}
else if (runStatus == RunStatus.HomeReset)
{
HomeReset();
}
}
else if (runStatus == RunStatus.HomeReset)
{
HomeReset();
}
catch (Exception ex){
Msg.add(ex.Message, MsgLevel.warning);
}
finally {
ProcessMsgEvent?.Invoke(Msg.get());
Msg.clear();
}
}
}
public void BeginHomeReset() {
StopMove();
Thread.Sleep(500);
public void Stop() {
mstart = false;
StopMove(true);
}
public void BeginHomeReset(bool firstRun=false) {
if (!firstRun)
{
StopMove();
Thread.Sleep(500);
}
OpenAllServo();
alarmType = AlarmType.None;
runStatus = RunStatus.HomeReset;
MoveInfo.NextMoveStep(MoveStep.H01_HomeReset);
LogInfo(MoveInfo.MoveType + ": 开始回原 ");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
ResetMoveInfo.NextMoveStep(MoveStep.H01_HomeReset);
RightMoveInfo.log("开始回原");
ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
void HomeReset()
{
if (CheckWait())
if (CheckWait(ResetMoveInfo))
return;
switch (MoveInfo.MoveStep)
switch (ResetMoveInfo.MoveStep)
{
case MoveStep.H01_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
ResetMoveInfo.NextMoveStep(MoveStep.H02_HomeReset);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
LogInfo(MoveInfo.MoveType + ":正在回原");
Take_Middle_Axis.HomeMove(MoveInfo);
Take_UpDown_Axis.HomeMove(MoveInfo);
Left_Batch_Axis.HomeMove(MoveInfo);
Right_Batch_Axis.HomeMove(MoveInfo);
ResetMoveInfo.log("正在回原");
Take_Middle_Axis.HomeMove(ResetMoveInfo);
Take_UpDown_Axis.HomeMove(ResetMoveInfo);
Left_Batch_Axis.HomeMove(ResetMoveInfo);
Right_Batch_Axis.HomeMove(ResetMoveInfo);
electricClamp.HomeReset();
break;
case MoveStep.H02_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
LogInfo(MoveInfo.moveStep + ":正在回原");
Label_Z_Axis.HomeMove(MoveInfo);
Take_Middle_Axis.AbsMove(MoveInfo, config.Take_Middle_P1, config.Take_Middle_P1_speed);
Take_UpDown_Axis.AbsMove(MoveInfo, config.Take_UpDown_P1, config.Take_UpDown_P1_speed);
Right_Batch_Axis.AbsMove(MoveInfo, config.Right_Batch_P1, config.Right_Batch_P1_speed);
Left_Batch_Axis.AbsMove(MoveInfo, config.Left_Batch_P1, config.Left_Batch_P1_speed);
ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
ResetMoveInfo.log("正在回原");
Label_Z_Axis.HomeMove(ResetMoveInfo);
Take_Middle_Axis.AbsMove(ResetMoveInfo, Config.Take_Middle_P1, Config.Take_Middle_P1_speed);
Take_UpDown_Axis.AbsMove(ResetMoveInfo, Config.Take_UpDown_P1, Config.Take_UpDown_P1_speed);
Right_Batch_Axis.AbsMove(ResetMoveInfo, Config.Right_Batch_P1, Config.Right_Batch_P1_speed);
Left_Batch_Axis.AbsMove(ResetMoveInfo, Config.Left_Batch_P1, Config.Left_Batch_P1_speed);
break;
case MoveStep.H03_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
LogInfo(MoveInfo.moveStep + ":正在回原");
Label_Z_Axis.HomeMove(MoveInfo);
Label_X_Axis.HomeMove(MoveInfo);
Label_Y_Axis.HomeMove(MoveInfo);
Label_R_Axis.HomeMove(MoveInfo);
ResetMoveInfo.NextMoveStep(MoveStep.H04_HomeReset);
ResetMoveInfo.log("正在回原");
Label_Z_Axis.HomeMove(ResetMoveInfo);
Label_X_Axis.HomeMove(ResetMoveInfo);
Label_Y_Axis.HomeMove(ResetMoveInfo);
Label_R_Axis.HomeMove(ResetMoveInfo);
break;
case MoveStep.H04_HomeReset:
MoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
LogInfo(MoveInfo.moveStep + ":正在回原");
Label_Z_Axis.AbsMove(MoveInfo, config.Label_Z_P1, config.Label_Z_P1_speed);
Label_X_Axis.AbsMove(MoveInfo, config.Label_X_P1, config.Label_X_P1_speed);
Label_Y_Axis.AbsMove(MoveInfo, config.Label_Y_P1, config.Label_Y_P1_speed);
Label_R_Axis.AbsMove(MoveInfo, config.Label_R_P1, config.Label_R_P1_speed);
ResetMoveInfo.NextMoveStep(MoveStep.H05_HomeReset);
ResetMoveInfo.log("正在回原");
Label_Z_Axis.AbsMove(ResetMoveInfo, Config.Label_Z_P1, Config.Label_Z_P1_speed);
Label_X_Axis.AbsMove(ResetMoveInfo, Config.Label_X_P1, Config.Label_X_P1_speed);
Label_Y_Axis.AbsMove(ResetMoveInfo, Config.Label_Y_P1, Config.Label_Y_P1_speed);
Label_R_Axis.AbsMove(ResetMoveInfo, Config.Label_R_P1, Config.Label_R_P1_speed);
break;
case MoveStep.H05_HomeReset:
MoveInfo.NextMoveStep(MoveStep.HEND_HomeReset);
LogInfo(MoveInfo.moveStep + ":正在回原 阻挡气缸判断");
ResetMoveInfo.NextMoveStep(MoveStep.HEND_HomeReset);
ResetMoveInfo.log("正在回原 阻挡气缸判断");
if (IOManager.IOValue(IO_Type.LeftEnd_Check) == IO_VALUE.LOW)
{
CylinderMove(MoveInfo, IO_Type.LeftStopUP, IO_Type.LeftStopDown);
CylinderMove(ResetMoveInfo, IO_Type.LeftStopUP, IO_Type.LeftStopDown);
}
if (IOManager.IOValue(IO_Type.RightEnd_Check) == IO_VALUE.LOW)
{
CylinderMove(MoveInfo, IO_Type.RightStopUP, IO_Type.RightStopDown);
CylinderMove(ResetMoveInfo, IO_Type.RightStopUP, IO_Type.RightStopDown);
}
break;
case MoveStep.HEND_HomeReset:
LogInfo(MoveInfo.moveStep + ": 完成");
MoveEndProcess();
ResetMoveInfo.log("回源完成");
ResetMoveInfo.EndMove();
break;
}
}
bool SafeCheck() {
List<string> msglist = new List<string>();
bool ok = true;
if (UserPause)
{
Msg.add("用户暂停", MsgLevel.warning);
ok = false;
}
if (IOValue(IO_Type.GratingSignal_Check).Equals(IO_VALUE.LOW))
{
msglist.Add("安全光栅被遮挡");
Msg.add("安全光栅被遮挡", MsgLevel.warning);
ok = false;
}
if (IOValue(IO_Type.HasNgBox).Equals(IO_VALUE.LOW))
{
msglist.Add("没有检测到NG料箱");
Msg.add("没有检测到NG料箱", MsgLevel.warning);
ok = false;
}
if (IOValue(IO_Type.HasPrinter).Equals(IO_VALUE.LOW))
{
msglist.Add("没有检测到NG料箱");
Msg.add("没有检测到NG料箱", MsgLevel.warning);
ok = false;
}
if (IOValue(IO_Type.LeftBackDoor_Check).Equals(IO_VALUE.LOW))
{
msglist.Add("左后门没有关闭");
Msg.add("左后门没有关闭", MsgLevel.warning);
ok = false;
}
if (IOValue(IO_Type.RightBackDoor_Check).Equals(IO_VALUE.LOW))
{
msglist.Add("右后门没有关闭");
Msg.add("右后门没有关闭", MsgLevel.warning);
ok = false;
}
return (msglist.Count == 0);
return ok;
}
/// <summary>
/// 最后一次气压检测变为0的时间
/// </summary>
DateTime lastAirCloseTime = DateTime.MinValue;
bool DeviceCheck() {
List<string> msglist = new List<string>();
bool ok = true;
bool SuddenStop = false;
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
msglist.Add("急停中");
Msg.add("急停中",MsgLevel.warning);
ok = false;
SuddenStop = true;
}
if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW))
{
......@@ -185,14 +251,28 @@ namespace DeviceLibrary
TimeSpan span = DateTime.Now - lastAirCloseTime;
if (span.TotalSeconds > RobotManage.Config.AirCheckSeconds)
{
msglist.Add("急停中");
ok = false;
Msg.add("气压不足", MsgLevel.warning);
}
}
else {
lastAirCloseTime = DateTime.MinValue;
}
return (msglist.Count == 0);
if (!SuddenStop)
{
foreach (ConfigMoveAxis configMoveAxis in Config.moveAxisList)
{
if (AxisManager.GetAlarmStatus("", configMoveAxis.GetAxisValue) == 1)
{
Msg.add($"{configMoveAxis.DeviceName}:运动报警", MsgLevel.warning);
ok = false;
}
}
}
return ok;
}
}
}
using OnlineStore.LoadCSVLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -10,12 +11,11 @@ namespace DeviceLibrary
public class MoveInfo
{
public int TimeOutSeconds = 60;
public MoveInfo(int storeId, string name)
public MoveInfo(string name)
{
moveType = MoveType.None;
MoveParam = new LabelParam(MoveType.None);
this.storeId = storeId;
this.moveStep = MoveStep.Wait;
IsInWait = false;
this.Name = name;
......@@ -41,13 +41,10 @@ namespace DeviceLibrary
public LabelParam MoveParam { get; set; }
public int storeId { get; set; }
public bool IsInWait { get; set; }
public MoveStep moveStep;
MoveStep moveStep;
public int CanWhileCount = 0;
......@@ -76,7 +73,7 @@ namespace DeviceLibrary
IsInWait = false;
WaitList = new List<WaitResultInfo>();
}
public void NewMove(MoveType type, LabelParam param = null)
void NewMove(MoveType type, LabelParam param = null)
{
moveStep = MoveStep.Wait;
this.moveType = type;
......@@ -91,7 +88,7 @@ namespace DeviceLibrary
public void EndMove()
{
this.moveType = MoveType.None;
this.MoveParam = null;
this.MoveParam = new LabelParam(moveType);
moveStep = MoveStep.Wait;
LastSetpTime = DateTime.Now;
IsInWait = false;
......@@ -124,6 +121,16 @@ namespace DeviceLibrary
TimeSpan span = DateTime.Now - LastSetpTime;
return span;
}
string lastmsg = "";
public void log(string msg) {
msg = $"[{Name}][{moveStep}][{MoveParam.WareCode}]{msg}";
if (String.Compare(lastmsg,msg, StringComparison.Ordinal)!=0)
{
lastmsg = msg;
LogUtil.info(msg);
}
}
}
public class WaitResultInfo
......
......@@ -18,6 +18,69 @@ namespace DeviceLibrary
H06_HomeReset,
H07_HomeReset,
HEND_HomeReset,
R01,
R02,
R03,
R04,
R05,
R06,
R07,
R08,
R10_WaitReelLeave,
R11_NextReel,
R12_ShelfNoTray,
R20,
R21,
REND,
L01,
L02,
L03,
L04,
L10_WaitReelPut,
L11_ReelPutted,
L12,
L13,
L20_WaitLabel,
L21,
L30_LabelFinish,
L40_ShelfFull,
LEND,
M01,
M02,
M03,
M04,
M05,
M06,
M07,
M_ReturnToP1,
M08,
M20_ToNgBox,
M21,
M22,
M23,
M24,
MEND,
Lbl_StartPrint,
Lbl_WaitPrint,
Lbl_Printted,
Lbl01,
Lbl02,
Lbl03,
Lbl04,
Lbl05,
Lbl10,
Lbl11,
Lbl12,
Lbl13,
Lbl14,
}
......@@ -50,3 +113,4 @@ namespace DeviceLibrary
}
}
using OnlineStore.LoadCSVLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.IO;
......@@ -15,30 +16,65 @@ namespace DeviceLibrary
public static MainMachine mainMachine;
public static Robot_Config Config;
public static bool IsLoadOk = false;
public static bool IsDebug = false;
public delegate void LoadFinish(bool state,string msg);
public static event LoadFinish LoadFinishEvent;
public static bool isRunning = false;
static string baseDir = Application.StartupPath;
static Thread mainThread;
static RobotManage() {
CodeManager.LoadConfig();
string configFile = Path.Combine(baseDir, "config\\Config.csv");
Config = new Robot_Config(0, "", configFile);
Config = (Robot_Config)CSVConfigReader.LoadConfig(Config);
mainMachine = new MainMachine(RobotManage.Config);
if (!IOManager.ConnectionIOList(new List<string>())) {
IsLoadOk = false;
return;
}
public static void Init() {
try
{
CodeManager.LoadConfig();
string msg = "";
string configFile = Path.Combine(baseDir, "config\\Config.csv");
Config = new Robot_Config(0, "", configFile);
Config = (Robot_Config)CSVConfigReader.LoadConfig(Config);
mainMachine = new MainMachine(RobotManage.Config);
if (!IOManager.ConnectionIOList(new List<string>()))
{
IsLoadOk = false;
msg = "IO板卡初始化失败,无法启动.";
}
else
{
IsLoadOk = true;
}
LoadFinishEvent?.Invoke(IsDebug?IsDebug:IsLoadOk, msg);
IsLoadOk = true;
}
catch (Exception ex) {
LoadFinishEvent?.Invoke(false, ex.Message);
}
}
static void Start() {
public static void Start() {
if (!IsLoadOk)
{
LogUtil.info("系统还未加载完毕,无法启动");
}
mainThread = new Thread(new ThreadStart(mainMachine.Run));
mainThread.Start();
isRunning = true;
GC.KeepAlive(mainThread);
Task.Run(()=> {
Task.Delay(1000).Wait();
mainMachine.BeginHomeReset(true);
});
}
public static void Stop()
{
isRunning = false;
mainMachine.Stop();
}
public static void UserPause(bool userpause) {
mainMachine.UserPause = userpause;
}
}
}
类型,分类编号,说明,名称,属性值,设备名称,电器定义,目标速度,加速时间,减速时间,原点低速度,原点高速,原点加速度,脉冲最小误差,脉冲最大误差,脉冲最小限位,脉冲最大限位
AXIS,,取料机构旋转轴_SVD01,Take_Middle_Axis,0,HC,,500,1000,1000,100,200,1000,10,1000,0,0
AXIS,,取料机构上下轴_SVD02,Take_UpDown_Axis,1,HC,,1000,1000,1000,200,500,500,10,1000,0,0
AXIS,,左轨道提升轴_SVD04,Left_Batch_Axis,2,HC,,3000,1000,1000,200,1000,200,10,1000,0,0
AXIS,,右轨道提升轴_SVD05,Right_Batch_Axis,3,HC,,3000,1000,1000,200,1000,200,10,1000,0,0
AXIS,,贴标移栽机构X轴_SVD08,Label_X_Axis,4,HC,,100,700,700,50,250,500,10,1000,0,0
AXIS,,贴标移栽机构Y轴_SVD09,Label_Y_Axis,5,HC,,100,700,700,50,150,500,10,1000,0,0
AXIS,,贴标移栽机构Z轴_SVD10,Label_Z_Axis,6,HC,,100,800,800,50,150,500,10,1000,0,0
AXIS,,贴标移栽机构R轴_SVD11,Label_R_Axis,7,HC,,10,2000,2000,1,5,200,500,1000,0,0
,,,,,,,,,,,,,,,,
PRO,0,IO信号超时时间(秒),IOSingle_TimerOut,15,,,,,,,,,,,,
PRO,10,取料旋转轴待机点P1,Take_Middle_P1,1,,,,,,,,,,,,
PRO,10,取料旋转轴右取料点P2,Take_Middle_P2,2,,,,,,,,,,,,
PRO,10,取料旋转轴左取料点P3,Take_Middle_P3,3,,,,,,,,,,,,
PRO,10,取料旋转轴NG放料点P5,Take_Middle_P5,4,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,11,取料上下轴待机点P1,Take_UpDown_P1,6,,,,,,,,,,,,
PRO,11,取料上下轴取料高点P2,Take_UpDown_P2,7,,,,,,,,,,,,
PRO,11,取料上下轴取右料低点P3,Take_UpDown_P3,8,,,,,,,,,,,,
PRO,11,取料上下轴取左料低点P4,Take_UpDown_P4,9,,,,,,,,,,,,
PRO,11,取料上下轴NG放料点P5,Take_UpDown_P5,10,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,12,右提升轴低点P1,Right_Batch_P1,12,,,,,,,,,,,,
PRO,12,右提升轴高点P2,Right_Batch_P2,13,,,,,,,,,,,,
PRO,12,左提升轴低点P1,Left_Batch_P1,14,,,,,,,,,,,,
PRO,12,左提升轴高点P2,Left_Batch_P2,15,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,13,贴标X轴待机点P1,Label_X_P1,17,,,,,,,,,,,,
PRO,13,贴标X轴取标点P2,Label_X_P2,18,,,,,,,,,,,,
PRO,13,贴标X轴贴标点P3,Label_X_P3,19,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,14,贴标Y轴待机点P1,Label_Y_P1,21,,,,,,,,,,,,
PRO,14,贴标Y轴取标点P2,Label_Y_P2,22,,,,,,,,,,,,
PRO,14,贴标Y轴贴标点P3,Label_Y_P3,23,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,15,贴标Z轴待机点P1,Label_Z_P1,25,,,,,,,,,,,,
PRO,15,贴标Z轴取标点P2,Label_Z_P2,26,,,,,,,,,,,,
PRO,15,贴标Z轴贴标点P3,Label_Z_P3,27,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,16,贴标R轴待机点P1,Label_R_P1,29,,,,,,,,,,,,
PRO,16,贴标R轴取标点P2,Label_R_P2,30,,,,,,,,,,,,
PRO,16,贴标R轴360度脉冲,Label_R_P3,31,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
DI,0,急停,SuddenStop_BTN,0,HC,X00,,,,,,,,,,
DI,0,进料口确认按钮,Reset_BTN,1,HC,X01,,,,,,,,,,
DI,0,出料口确认按钮,Start_BTN,2,HC,X02,,,,,,,,,,
DI,0,后门左门禁,LeftBackDoor_Check,3,HC,X03,,,,,,,,,,
DI,0,后门右门禁,RightBackDoor_Check,4,HC,X04,,,,,,,,,,
DI,0,气压检测,Airpressure_Check,5,HC,X05,,,,,,,,,,
DI,0,光栅信号,GratingSignal_Check,6,HC,X06,,,,,,,,,,
DI,0,NG料箱检测,HasNgBox,7,HC,X07,,,,,,,,,,
DI,0,打印机到位检测,HasPrinter,8,HC,X08,,,,,,,,,,
DI,0,旋转臂进料侧检测,RightArm_Check,9,HC,X09,,,,,,,,,,
DI,0,旋转臂出料侧检测,LeftArm_Check,10,HC,X10,,,,,,,,,,
DI,0,进料口料车检测,RightCar_Check,11,HC,X11,,,,,,,,,,
DI,0,进料口前端料串检测,RightFornt_Check,12,HC,X12,,,,,,,,,,
DI,0,进料口料串到位检测,RightEnd_Check,13,HC,X13,,,,,,,,,,
DI,0,进料口阻挡气缸上升端,RightStopUP,14,HC,X14,,,,,,,,,,
DI,0,进料口阻挡气缸下降端,RightStopDown,15,HC,X15,,,,,,,,,,
DI,0,出料口料车检测,LeftCar_Check,16,HC,X16,,,,,,,,,,
DI,0,出料口前端料串检测,LeftFornt_Check,17,HC,X17,,,,,,,,,,
DI,0,出料口料串到位检测,LeftEnd_Check,18,HC,X18,,,,,,,,,,
DI,0,出料口阻挡气缸上升端,LeftStopUP,19,HC,X19,,,,,,,,,,
DI,0,出料口阻挡气缸下降端,LeftStopDown,20,HC,X20,,,,,,,,,,
DI,0,进料定位料盘检测,RightTop_Check,21,HC,X21,,,,,,,,,,
DI,0,进料定位料盘超限检测,RightOverHead_Check,22,HC,X22,,,,,,,,,,
DI,0,出料定位料盘检测,LeftTop_Check,23,HC,X23,,,,,,,,,,
DI,0,出料定位料盘超限检测,LeftOverHead_Check,24,HC,X24,,,,,,,,,,
DI,0,吸嘴气缸前进端,LabelCylinder_Fwd,25,HC,X25,,,,,,,,,,
DI,0,吸嘴气缸后退端,LabelCylinder_Bck,26,HC,X26,,,,,,,,,,
,,,,,,,,,,,,,,,,
DO,0,自动指示灯,AutoRun_HddLed,0,HC,Y00,,,,,,,,,,
DO,0,故障指示灯,Alarm_HddLed,1,HC,Y01,,,,,,,,,,
DO,0,待机指示灯,RunSign_HddLed,2,HC,Y02,,,,,,,,,,
DO,0,报警蜂鸣器,Alarm_Buzzer,3,HC,Y03,,,,,,,,,,
DO,0,进料口状态指示灯,RightState_Led,4,HC,Y04,,,,,,,,,,
DO,0,出料口状态指示灯,LeftState_Led,5,HC,Y05,,,,,,,,,,
DO,0,设备照明,Device_Led,6,HC,Y06,,,,,,,,,,
DO,0,相机照明,Camera_Led,7,HC,Y07,,,,,,,,,,
DO,0,进料口电机启动,RightMoto_Run,8,HC,Y08,,,,,,,,,,
DO,0,进料口电机反转指令,RightMoto_Reverse,9,HC,Y09,,,,,,,,,,
DO,0,出料口电机启动,LeftMoto_Run,10,HC,Y10,,,,,,,,,,
DO,0,出料口电机反转指令,LeftMoto_Reverse,11,HC,Y11,,,,,,,,,,
DO,0,进料口阻挡气缸上升,RightStopUP,12,HC,Y12,,,,,,,,,,
DO,0,进料口阻挡气缸下降,RightStopDown,13,HC,Y13,,,,,,,,,,
DO,0,出料口阻挡气缸上升,LeftStopUP,14,HC,Y14,,,,,,,,,,
DO,0,出料口阻挡气缸下降,LeftStopDown,15,HC,Y15,,,,,,,,,,
DO,0,吸嘴气缸前进,LabelCylinder_Fwd,16,HC,Y16,,,,,,,,,,
DO,0,吸嘴气缸后退,LabelCylinder_Bck,17,HC,Y17,,,,,,,,,,
DO,0,吸嘴取标,LabelCylinder_Work,18,HC,Y18,,,,,,,,,,
,,,,,,,,,,,,,,,,
类型,分类编号,说明,名称,属性值,设备名称,电器定义,目标速度,加速时间,减速时间,原点低速度,原点高速,原点加速度,脉冲最小误差,脉冲最大误差,脉冲最小限位,脉冲最大限位
AXIS,,取料机构旋转轴_SVD01,Take_Middle_Axis,0,HC,,500,1000,1000,100,200,1000,10,1000,0,0
AXIS,,取料机构上下轴_SVD02,Take_UpDown_Axis,1,HC,,1000,1000,1000,200,500,500,10,1000,0,0
AXIS,,左轨道提升轴_SVD04,Left_Batch_Axis,2,HC,,3000,1000,1000,200,1000,200,10,1000,0,0
AXIS,,右轨道提升轴_SVD05,Right_Batch_Axis,3,HC,,3000,1000,1000,200,1000,200,10,1000,0,0
AXIS,,贴标移栽机构X轴_SVD08,Label_X_Axis,4,HC,,100,700,700,50,250,500,10,1000,0,0
AXIS,,贴标移栽机构Y轴_SVD09,Label_Y_Axis,5,HC,,100,700,700,50,150,500,10,1000,0,0
AXIS,,贴标移栽机构Z轴_SVD10,Label_Z_Axis,6,HC,,100,800,800,50,150,500,10,1000,0,0
AXIS,,贴标移栽机构R轴_SVD11,Label_R_Axis,7,HC,,10,2000,2000,1,5,200,500,1000,0,0
AXIS,,取料机构旋转轴,Take_Middle_Axis,0,HC,,500,1000,1000,100,200,1000,10,100,0,0
AXIS,,取料机构上下轴,Take_UpDown_Axis,1,HC,,1000,1000,1000,200,500,500,10,100,0,0
AXIS,,左轨道提升轴,Left_Batch_Axis,2,HC,,3000,1000,1000,200,1000,200,10,100,0,0
AXIS,,右轨道提升轴,Right_Batch_Axis,3,HC,,3000,1000,1000,200,1000,200,10,100,0,0
AXIS,,贴标移栽机构X轴,Label_X_Axis,4,HC,,100,700,700,50,250,500,10,100,0,0
AXIS,,贴标移栽机构Y轴,Label_Y_Axis,5,HC,,100,700,700,50,150,500,10,100,0,0
AXIS,,贴标移栽机构Z轴,Label_Z_Axis,6,HC,,100,800,800,50,150,500,10,100,0,0
AXIS,,贴标移栽机构R轴,Label_R_Axis,7,HC,,10,2000,2000,1,5,200,500,100,0,0
,,,,,,,,,,,,,,,,
PRO,0,IO信号超时时间(秒),IOSingle_TimerOut,15,,,,,,,,,,,,
PRO,0,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,,
PRO,0,右侧提升轴每毫米脉冲,Right_Batch_ChangeValue,5555,,,,,,,,,,,,
PRO,0,左侧提升轴每毫米脉冲,Left_Batch_ChangeValue,5555,,,,,,,,,,,,
PRO,0,右侧相机,RightCameraName,123123,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,10,取料旋转轴待机点P1,Take_Middle_P1,1,,,99,,,,,,,,,
PRO,10,取料旋转轴右取料点P2,Take_Middle_P2,2,,,99,,,,,,,,,
PRO,10,取料旋转轴左取料点P3,Take_Middle_P3,3,,,99,,,,,,,,,
......@@ -43,8 +47,8 @@ PRO,16,贴标R轴取标点P2,Label_R_P2,30,,,22,,,,,,,,,
PRO,16,贴标R轴360度脉冲,Label_R_P3,31,,,22,,,,,,,,,
,,,,,,,,,,,,,,,,
DI,0,急停,SuddenStop_BTN,0,HC,X00,,,,,,,,,,
DI,0,进料口确认按钮,Reset_BTN,1,HC,X01,,,,,,,,,,
DI,0,出料口确认按钮,Start_BTN,2,HC,X02,,,,,,,,,,
DI,0,进料口确认按钮,Right_BTN,1,HC,X01,,,,,,,,,,
DI,0,出料口确认按钮,Left_BTN,2,HC,X02,,,,,,,,,,
DI,0,后门左门禁,LeftBackDoor_Check,3,HC,X03,,,,,,,,,,
DI,0,后门右门禁,RightBackDoor_Check,4,HC,X04,,,,,,,,,,
DI,0,气压检测,Airpressure_Check,5,HC,X05,,,,,,,,,,
......
......@@ -31,6 +31,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.PrintLabel">
<HintPath>..\..\PrintLabel\PrintLabel\bin\Debug\Asa.PrintLabel.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<HintPath>..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
</Reference>
......@@ -43,6 +46,9 @@
<Reference Include="log4net">
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference>
<Reference Include="Neotel.Rmaxis">
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\Neotel.Rmaxis.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
......@@ -56,16 +62,22 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AutoScanAndLabel\AxisBean.cs" />
<Compile Include="AutoScanAndLabel\Common.cs" />
<Compile Include="AutoScanAndLabel\LabelParam.cs" />
<Compile Include="AutoScanAndLabel\MainMachine _Printer.cs" />
<Compile Include="AutoScanAndLabel\MainMachine _LabelProcess.cs" />
<Compile Include="AutoScanAndLabel\MainMachine _MiddleProcess.cs" />
<Compile Include="AutoScanAndLabel\MainMachine _LeftProcess.cs" />
<Compile Include="AutoScanAndLabel\MoveInfo.cs" />
<Compile Include="AutoScanAndLabel\MoveStep.cs" />
<Compile Include="AutoScanAndLabel\MainMachine _Common.cs" />
<Compile Include="AutoScanAndLabel\MainMachine _WorkProcess.cs" />
<Compile Include="AutoScanAndLabel\MainMachine _RightProcess.cs" />
<Compile Include="DeviceLibrary\CodeManager.cs" />
<Compile Include="AutoScanAndLabel\RobotManage.cs" />
<Compile Include="AutoScanAndLabel\IRobot.cs" />
<Compile Include="AutoScanAndLabel\MainMachine.cs" />
<Compile Include="Class1.cs" />
<Compile Include="DeviceLibrary\ElectricGripper.cs" />
<Compile Include="DeviceLibrary\IAxisManager.cs" />
<Compile Include="DeviceLibrary\AxisManager.cs" />
<Compile Include="DeviceLibrary\HC\HCAxisManager.cs" />
......@@ -100,10 +112,5 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Config\Config - 复制.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
......@@ -115,18 +115,15 @@ namespace DeviceLibrary
[HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan( )
public static List<CodeInfo> CameraScan(List<string> cameraNameList)
{
int codeCount = 1;
List<string> codeList = new List<string>();
List<CodeInfo> codeList = new List<CodeInfo>();
if (cameraNameList == null || cameraNameList.Count <= 0)
{
return codeList;
}
throw new Exception("CameraScan方法没有传入相机名称.");
}
try
{
//Task[] cameraTask = new Task[cameraNameList.Count()];
for(int i= 0;i < cameraNameList.Count();i++)
{
......@@ -160,44 +157,17 @@ namespace DeviceLibrary
foreach (CodeInfo code in tlci)
{
LogUtil.info(" 【" + cameraName + "】[eyemDecode]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr);
string str = CodeManager.ReplaceCode(code.CodeStr);
//string str = CodeManager.ReplaceCode(code.CodeStr);
lock (codeList)
{
if (!codeList.Contains(str))
if (!codeList.Contains(code))
{
codeList.Add(str);
r = r + "##" + str;
codeList.Add(code);
r = r + "##" + code.CodeStr;
}
}
}
/*
* List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
{
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
{
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
{
cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, 2000);
}
foreach (CodeInfo c in cc)
{
string str = CodeManager.ReplaceCode(c.CodeStr);
lock (codeList)
{
if (!codeList.Contains(str))
{
codeList.Add(str);
r = r + "##" + str;
}
}
}
}
*/
if (codeList.Count()==0)
{
SaveImageToFile("mimo", cameraName, bmp);
......@@ -232,11 +202,13 @@ namespace DeviceLibrary
catch (AccessViolationException e)
{
LogUtil.error( " 扫码出现AccessViolationException异常:" + e.ToString());
//throw new Exception("扫码出现AccessViolationException异常");
// GC.Collect();
}
catch (Exception ex)
{
LogUtil.error( " 扫码出错:" + ex.ToString());
//throw new Exception("扫码出错");
}
return codeList;
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
public class ElectricGripper
{
private int subType = 0;
private Neotel.Rmaxis axis;
public Enum GripperType = GripperTypeE.None;
int clampTimes = 0;
public bool OpenPort(string port)
{
axis = new Neotel.Rmaxis();
bool rtn = axis.OpenPort(port);
//var s = "版本号\r\n" + axis.GetVersion();
return rtn;
}
public void ClosePort()
{
axis.ClosePort();
}
public bool Clamp(MoveInfo moveInfo = null)
{
GripperType = GripperTypeE.Gripper;
if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitAction)));
if (!IsBusy)
{
axis.Push(30, 7, 500);
clampTimes++;
if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
return true;
}
else {
return false;
}
}
public bool Release(MoveInfo moveInfo = null)
{
GripperType = GripperTypeE.Release;
if (!IsBusy)
{
axis.GoHome();
clampTimes = 0;
if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
return true;
}
else
{
if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitAction)));
return false;
}
}
public void HomeReset(MoveInfo moveInfo = null)
{
GripperType = GripperTypeE.Reset;
//if (!IsBusy)
//{
axis.ResetError();
axis.GoHome();
clampTimes = 0;
// }
//if (moveInfo != null)
// moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitAction)));
}
public bool IsBusy
{
get
{
return !axis.IsReached;
}
}
public bool IsClamp
{
get
{
return !axis.IsPushEmpty;
}
}
bool WaitAction(WaitResultInfo w)
{
if (this.IsBusy)
return false;
if (this.GripperType.Equals(ElectricGripper.GripperTypeE.Gripper))
{
if (this.IsClamp)
return true;
else
{
if (clampTimes<=2)
this.Clamp();
return false; ;
}
}
else if (this.GripperType.Equals(ElectricGripper.GripperTypeE.Release))
{
return this.Release();
}
else if (this.GripperType.Equals(ElectricGripper.GripperTypeE.Reset))
{
return this.IsBusy;
}
else
{
return true;
}
}
public enum GripperTypeE
{
Gripper,
Release,
Reset,
None
}
}
}
......@@ -29,7 +29,7 @@ namespace DeviceLibrary
public void LoadData(IRobot equipBase, bool isHc = true)
{
this.boxBean = equipBase;
axisList = new List<ConfigMoveAxis>(equipBase.config.moveAxisList);
axisList = new List<ConfigMoveAxis>(equipBase.Config.moveAxisList);
if (axisList.Count > 0)
{
......
......@@ -141,6 +141,7 @@ namespace OnlineStore.LoadCSVLibrary
LogUtil.info("开始读取文件:" + config.ConfigFilePath);
if (config == null || config.ConfigFilePath.Equals(""))
{
throw new Exception("没有配置配置文件路径");
return null;
}
List<ConfigBase> configBasesList = ReadConfig(config.ConfigFilePath);
......
......@@ -149,6 +149,7 @@ namespace OnlineStore.LoadCSVLibrary
}catch(Exception ex)
{
LogUtil.error("解析配置【"+con.ConfigStr+"】出错:" + ex.ToString());
throw new Exception("解析配置【" + con.ConfigStr + "】出错");
}
}
if (String.IsNullOrEmpty(proBuilder.ToString()).Equals(false) && proBuilder.ToString().Equals("\r\n").Equals(false))
......
......@@ -8,7 +8,6 @@ using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
public class IO_Type
{
private static List<string> TypeList = null;
......@@ -33,13 +32,13 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
public static string SuddenStop_BTN = "SuddenStop_BTN";
/// <summary>
/// DI,0,进料口确认按钮,Reset_BTN,1,HC,X01,,,,,,,,,,
/// DI,0,进料口确认按钮,Right_BTN,1,HC,X01,,,,,,,,,,
/// </summary>
public static string Reset_BTN = "Reset_BTN";
public static string Right_BTN = "Right_BTN";
/// <summary>
/// DI,0,出料口确认按钮,Start_BTN,2,HC,X02,,,,,,,,,,
/// DI,0,出料口确认按钮,Left_BTN,2,HC,X02,,,,,,,,,,
/// </summary>
public static string Start_BTN = "Start_BTN";
public static string Left_BTN = "Left_BTN";
/// <summary>
/// DI,0,后门左门禁,LeftBackDoor_Check,3,HC,X03,,,,,,,,,,
/// </summary>
......
......@@ -19,6 +19,7 @@ namespace OnlineStore.LoadCSVLibrary
: base(id, type, filepath)
{
}
/// <summary>
/// AXIS,,取料机构旋转轴_SVD01,Take_Middle_Axis,0,HC,,500,1000,1000,100,200,1000,10,1000,0,0
/// </summary>
......@@ -61,6 +62,23 @@ namespace OnlineStore.LoadCSVLibrary
public ConfigMoveAxis Label_R_Axis { get; set; }
/// <summary>
/// PRO,0,右侧相机,RightCameraName,324234234,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("RightCameraName")]
public string RightCameraName { get; set; }
/// <summary>
/// PRO,0,右侧提升轴每毫米脉冲,Right_Batch_ChangeValue,5555,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("Right_Batch_ChangeValue")]
public int Right_Batch_ChangeValue { get; set; }
/// <summary>
/// PRO,0,左侧提升轴每毫米脉冲,Left_Batch_ChangeValue,5555,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("Left_Batch_ChangeValue")]
public int Left_Batch_ChangeValue { get; set; }
/// <summary>
/// PRO,0,IO信号超时时间(秒),IOSingle_TimerOut,15,,,,,,,,,,,,
......@@ -326,5 +344,12 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[ConfigProAttribute("Label_R_P3_speed")]
public int Label_R_P3_speed { get; set; }
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!