Commit ac73409c LN

1

1 个父辈 1da51b27
正在显示 51 个修改的文件 包含 2278 行增加1302 行删除
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<ProjectGuid>{0D2542F5-DD62-4352-82D0-383D9A045E74}</ProjectGuid> <ProjectGuid>{0D2542F5-DD62-4352-82D0-383D9A045E74}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.ACSingleStore</RootNamespace> <RootNamespace>OnlineStore.ACPackingStore</RootNamespace>
<AssemblyName>ACSingleStore</AssemblyName> <AssemblyName>ACPackingStore</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
...@@ -85,6 +85,12 @@ ...@@ -85,6 +85,12 @@
<Compile Include="FrmAbout.Designer.cs"> <Compile Include="FrmAbout.Designer.cs">
<DependentUpon>FrmAbout.cs</DependentUpon> <DependentUpon>FrmAbout.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FrmMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmMain.Designer.cs">
<DependentUpon>FrmMain.cs</DependentUpon>
</Compile>
<Compile Include="FrmPwd.cs"> <Compile Include="FrmPwd.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -112,6 +118,9 @@ ...@@ -112,6 +118,9 @@
<EmbeddedResource Include="FrmAbout.resx"> <EmbeddedResource Include="FrmAbout.resx">
<DependentUpon>FrmAbout.cs</DependentUpon> <DependentUpon>FrmAbout.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmMain.resx">
<DependentUpon>FrmMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmPwd.resx"> <EmbeddedResource Include="FrmPwd.resx">
<DependentUpon>FrmPwd.cs</DependentUpon> <DependentUpon>FrmPwd.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -14,11 +14,12 @@ ...@@ -14,11 +14,12 @@
<!--Server address--> <!--Server address-->
<add key="http.server" value="http://192.168.101.11/myproject/" /> <add key="http.server" value="http://192.168.101.11/myproject/" />
<!--storeType--> <!--storeType-->
<add key="store_count" value="1"/> <add key="store_count" value="2"/>
<add key="Store_ConfigPath" value="\StoreConfig\StoreConfig.csv"/>
<!--start one store config--> <!--start one store config-->
<add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv"/> <add key="Store_Position_Config" value="\StoreConfig\linePositions.csv"/>
<add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv"/> <add key="BOX_ConfigPath" value="\StoreConfig\BoxConfig.csv"/>
<add key="Store_Type" value="RC_AC_SA"/> <add key="Store_Type" value="RC_AC_PA"/>
<add key="Store_CID" value="line-ac1"/> <add key="Store_CID" value="line-ac1"/>
<add key ="Store_ID" value ="1"/> <add key ="Store_ID" value ="1"/>
<!--end one store config--> <!--end one store config-->
......
...@@ -11,65 +11,10 @@ using System.Windows.Forms; ...@@ -11,65 +11,10 @@ using System.Windows.Forms;
namespace OnlineStore.ACPackingStore namespace OnlineStore.ACPackingStore
{ {
public class FormManager public class FormManager
{ {
//#03A9F4
//public static Color buttonColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
//public static Color buttonColor = System.Drawing.SystemColors.ActiveCaption;
//public static Color buttonColor = System.Drawing.Color.FromArgb(((int)((0x00))), ((int)((0x66))), ((int)(0xFF)));
//private static string skinFileName = Application.StartupPath + @"\Skins\Wave.ssk";
//private static string skinFileName = Application.StartupPath + @"\Skins\DiamondBlue.ssk";
//public static string SkinFileName
//{
// set
// {
// }
// get
// {
// if (SkinsList.Count <= 0)
// {
// SkinsList = GetSkinList();
// }
// if (SkinsList.Count > 0 && index >= 0)
// {
// return SkinsList[index];
// }
// return skinFileName;
// }
//}
//private static int index = -1;
//public static void DefaultSkin()
//{
// index = -1;
//}
//public static void NextSkin()
//{
// index++;
// if (index >= SkinsList.Count)
// {
// index = 0;
// }
//}
//public static List<string> SkinsList = new List<string>();
//private static List<string> GetSkinList()
//{
// List<string> returnList = new System.Collections.Generic.List<string>();
// string[] fileList = Directory.GetFiles(Application.StartupPath + @"\Skins");
// foreach (string sr in fileList)
// {
// if (sr.Contains(".ssk"))
// {
// returnList.Add(sr);
// }
// }
// return returnList;
//}
private static FrmAxisDebug debug = null; private static FrmAxisDebug debug = null;
public static void ShowAxisDebug(AC_SA_BoxBean store) public static void ShowAxisDebug(AC_BOX_Bean store)
{ {
if (debug == null) if (debug == null)
{ {
...@@ -90,7 +35,7 @@ namespace OnlineStore.ACPackingStore ...@@ -90,7 +35,7 @@ namespace OnlineStore.ACPackingStore
} }
} }
private static FrmIOStatus frmIo = null; private static FrmIOStatus frmIo = null;
public static void ShowIOShow(AC_SA_BoxBean store) public static void ShowIOShow(AC_BOX_Bean store)
{ {
if (frmIo == null) if (frmIo == null)
{ {
......
...@@ -25,18 +25,20 @@ namespace OnlineStore.ACPackingStore ...@@ -25,18 +25,20 @@ namespace OnlineStore.ACPackingStore
private ConfigMoveAxis inout = null; private ConfigMoveAxis inout = null;
private ConfigMoveAxis comp = null; private ConfigMoveAxis comp = null;
//private int compress_Slv = 0; //private int compress_Slv = 0;
private AC_BOX_Bean boxBean = null;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmAxisDebug(AC_SA_BoxBean boxBean) public FrmAxisDebug(AC_BOX_Bean boxBean)
{ {
middle = boxBean.Config.Middle_Axis; middle = boxBean.Config.Middle_Axis;
updown = boxBean.Config.UpDown_Axis; updown = boxBean.Config.UpDown_Axis;
//compress_Slv = boxBean.Config.CompressAxis_Slv; //compress_Slv = boxBean.Config.CompressAxis_Slv;
comp = boxBean.Config.Comp_Axis; comp = boxBean.Config.Comp_Axis;
inout = boxBean.Config.InOut_Axis; inout = boxBean.Config.InOut_Axis;
this. boxBean = boxBean;
InitializeComponent(); InitializeComponent();
this.Text = boxBean.StoreName + "_轴点动调试"; this.Text = boxBean.Name + "_轴点动调试";
} }
private void AxisMove(ConfigMoveAxis axis, int speed) private void AxisMove(ConfigMoveAxis axis, int speed)
...@@ -135,7 +137,7 @@ namespace OnlineStore.ACPackingStore ...@@ -135,7 +137,7 @@ namespace OnlineStore.ACPackingStore
{ {
if (this.btnInOutMove.BackColor .Equals(System.Drawing.SystemColors.Control)) if (this.btnInOutMove.BackColor .Equals(System.Drawing.SystemColors.Control))
{ {
if (StoreManager.Store.InOutAxisCanMove().Equals(false)) if (boxBean.InOutAxisCanMove().Equals(false))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
...@@ -222,7 +224,7 @@ namespace OnlineStore.ACPackingStore ...@@ -222,7 +224,7 @@ namespace OnlineStore.ACPackingStore
{ {
if (btnInOutMovej.BackColor.Equals(System.Drawing.SystemColors.Control)) if (btnInOutMovej.BackColor.Equals(System.Drawing.SystemColors.Control))
{ {
if (StoreManager.Store.InOutAxisCanMove().Equals(false)) if (boxBean.InOutAxisCanMove().Equals(false))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
......
...@@ -23,20 +23,20 @@ namespace OnlineStore.ACPackingStore ...@@ -23,20 +23,20 @@ namespace OnlineStore.ACPackingStore
public partial class FrmIOStatus : FrmBase public partial class FrmIOStatus : FrmBase
{ {
private int StoreId = 1; private int StoreId = 1;
private AC_SA_BoxBean boxBean; private AC_BOX_Bean boxBean;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmIOStatus() public FrmIOStatus()
{ {
Control.CheckForIllegalCrossThreadCalls = false; Control.CheckForIllegalCrossThreadCalls = false;
InitializeComponent(); InitializeComponent();
} }
public FrmIOStatus(AC_SA_BoxBean store) public FrmIOStatus(AC_BOX_Bean store)
{ {
Control.CheckForIllegalCrossThreadCalls = false; Control.CheckForIllegalCrossThreadCalls = false;
InitializeComponent(); InitializeComponent();
this.boxBean = store; this.boxBean = store;
this.StoreId = store.StoreID; this.StoreId = store.DeviceID;
LoadIOList(); LoadIOList();
} }
...@@ -46,8 +46,8 @@ namespace OnlineStore.ACPackingStore ...@@ -46,8 +46,8 @@ namespace OnlineStore.ACPackingStore
{ {
int roleindex = 0; int roleindex = 0;
this.tableLayoutPanel1.RowStyles.Clear(); this.tableLayoutPanel1.RowStyles.Clear();
this.tableLayoutPanel1.RowCount = boxBean.Config.StoreDIList.Count; this.tableLayoutPanel1.RowCount = boxBean.Config.DIList.Count;
foreach (ConfigIO ioValue in boxBean.Config.StoreDIList.Values) foreach (ConfigIO ioValue in boxBean.Config.DIList.Values)
{ {
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName); IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
...@@ -57,9 +57,9 @@ namespace OnlineStore.ACPackingStore ...@@ -57,9 +57,9 @@ namespace OnlineStore.ACPackingStore
} }
tableLayoutPanel2.RowStyles.Clear(); tableLayoutPanel2.RowStyles.Clear();
this.tableLayoutPanel2.RowCount = boxBean.Config.StoreDOList.Count; this.tableLayoutPanel2.RowCount = boxBean.Config.DOList.Count;
roleindex = 0; roleindex = 0;
foreach (ConfigIO ioValue in boxBean.Config.StoreDOList.Values) foreach (ConfigIO ioValue in boxBean.Config.DOList.Values)
{ {
this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28)); this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName); IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
...@@ -69,7 +69,7 @@ namespace OnlineStore.ACPackingStore ...@@ -69,7 +69,7 @@ namespace OnlineStore.ACPackingStore
} }
this.SuspendLayout(); //此处为不闪屏,一定要有的! this.SuspendLayout(); //此处为不闪屏,一定要有的!
cmbWriteIO.DataSource = new List<ConfigIO>(boxBean.Config.StoreDOList.Values); cmbWriteIO.DataSource = new List<ConfigIO>(boxBean.Config.DOList.Values);
cmbWriteIO.ValueMember = "ProName"; cmbWriteIO.ValueMember = "ProName";
cmbWriteIO.DisplayMember = "DisplayStr"; cmbWriteIO.DisplayMember = "DisplayStr";
cmbWriteValue.SelectedIndex = 0; cmbWriteValue.SelectedIndex = 0;
...@@ -119,9 +119,9 @@ namespace OnlineStore.ACPackingStore ...@@ -119,9 +119,9 @@ namespace OnlineStore.ACPackingStore
private ConfigIO GetSelectDO() private ConfigIO GetSelectDO()
{ {
string text = cmbWriteIO.SelectedValue.ToString(); string text = cmbWriteIO.SelectedValue.ToString();
if (boxBean.Config.StoreDOList.ContainsKey(text)) if (boxBean.Config.DOList.ContainsKey(text))
{ {
ConfigIO io = boxBean.Config.StoreDOList[text]; ConfigIO io = boxBean.Config.DOList[text];
return io; return io;
} }
return null; return null;
...@@ -188,7 +188,7 @@ namespace OnlineStore.ACPackingStore ...@@ -188,7 +188,7 @@ namespace OnlineStore.ACPackingStore
foreach (string key in DIControlList.Keys) foreach (string key in DIControlList.Keys)
{ {
IOTextControl control = DIControlList[key]; IOTextControl control = DIControlList[key];
int iov = (int)IOManager.IOValue(key); int iov = (int)boxBean.IOValue(key);
if (iov != control.IOValue) if (iov != control.IOValue)
{ {
control.IOValue = iov; control.IOValue = iov;
...@@ -225,16 +225,10 @@ namespace OnlineStore.ACPackingStore ...@@ -225,16 +225,10 @@ namespace OnlineStore.ACPackingStore
IOManager.instance.ReadAllDO(deviceName, (byte)slaveId ); IOManager.instance.ReadAllDO(deviceName, (byte)slaveId );
} }
private void btnOpenDoor_Click(object sender, EventArgs e) private void btnOpenDoor_Click(object sender, EventArgs e)
{ {
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
StoreManager.Store.OpenDoor(false);
} }
private void btnCloseDoor_Click(object sender, EventArgs e) private void btnCloseDoor_Click(object sender, EventArgs e)
{ {
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
StoreManager.Store.CloseDoor(false);
} }
private void btnLocationUp_Click(object sender, EventArgs e) private void btnLocationUp_Click(object sender, EventArgs e)
......
namespace OnlineStore.ACPackingStore
{
partial class FrmMain
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tabPageList = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPageList.SuspendLayout();
this.SuspendLayout();
//
// tabPageList
//
this.tabPageList.Controls.Add(this.tabPage1);
this.tabPageList.Controls.Add(this.tabPage2);
this.tabPageList.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabPageList.Location = new System.Drawing.Point(0, 0);
this.tabPageList.Name = "tabPageList";
this.tabPageList.SelectedIndex = 0;
this.tabPageList.Size = new System.Drawing.Size(1110, 660);
this.tabPageList.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1102, 634);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "tabPage1";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1102, 634);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "tabPage2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1110, 660);
this.Controls.Add(this.tabPageList);
this.Name = "FrmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FrmMain";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.FrmMain_Load);
this.tabPageList.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabPageList;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
}
}
\ No newline at end of file \ No newline at end of file
using OnlineStore.DeviceLibrary;
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 OnlineStore.ACPackingStore
{
public partial class FrmMain : Form
{
public FrmMain()
{
InitializeComponent();
}
private void FrmMain_Load(object sender, EventArgs e)
{
PackingStoreBean store = StoreManager.InitStore();
if (store == null)
{
this.Close();
}
else
{
foreach (AC_BOX_Bean box in store.BoxMap.Values)
{
FrmStoreBox frm = new FrmStoreBox();
frm.BoxBean = box;
AddForm(box.Name, frm);
}
}
}
private void AddForm(string text, Form form)
{
text = text.PadLeft(10, ' ');
TabPage lineTabPage = new TabPage(text);
lineTabPage.AutoScroll = true;
Panel linePan = new Panel();
linePan.Dock = DockStyle.Fill;
linePan.AutoScroll = true;
lineTabPage.Controls.Add(linePan);
form.FormBorderStyle = FormBorderStyle.None;
form.TopLevel = false;
linePan.Controls.Add(form);
form.Dock = DockStyle.Fill;
linePan.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left)));
form.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left)));
form.Show();
tabPageList.Controls.Add(lineTabPage);
}
}
}
<?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 \ No newline at end of file
...@@ -23,7 +23,7 @@ namespace OnlineStore.ACPackingStore ...@@ -23,7 +23,7 @@ namespace OnlineStore.ACPackingStore
public partial class FrmStoreBox : FrmBase public partial class FrmStoreBox : FrmBase
{ {
private AC_SA_BoxBean store; public AC_BOX_Bean BoxBean=null;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmStoreBox() public FrmStoreBox()
{ {
...@@ -40,61 +40,43 @@ namespace OnlineStore.ACPackingStore ...@@ -40,61 +40,43 @@ namespace OnlineStore.ACPackingStore
string version = GetVersion(); string version = GetVersion();
LogUtil.logBox = this.richTextBox1; LogUtil.logBox = this.richTextBox1;
LoadStore(); // LoadStore();
chbDebug.Checked = store.IsDebug;
this.ShowInTaskbar = true;
this.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
notifyIcon1.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
//cmbHomeType.SelectedIndex = 1;
HideForm();
this.Opacity = 1;
txtTempPort.Text = store.Config.Humiture_Port;
if (HumitureController.HumitureControllerType.Equals(1))
{
groupHistory.Visible = true;
}
else
{
groupHistory.Visible = false;
}
LoadOk = true;
} }
private void LoadStore() private void LoadStore( )
{ {
this.store = StoreManager.InitStore(); if (BoxBean == null)
if (store == null)
{ {
LogUtil.error(LOGGER, "找不到对应的料仓"); LogUtil.error(LOGGER, "找不到对应的料仓");
this.Close(); this.Close();
return; return;
} }
//txtSpeed.Text = store.Config.CompressAxis_EndSpeed.ToString(); //txtSpeed.Text = BoxBean.Config.CompressAxis_EndSpeed.ToString();
cmbAxisList.DataSource = new List<ConfigMoveAxis>(store.moveAxisList); cmbAxisList.DataSource = new List<ConfigMoveAxis>(BoxBean.moveAxisList);
cmbAxisList.DisplayMember = "Explain"; cmbAxisList.DisplayMember = "Explain";
cmbAxisList.ValueMember = "Explain"; cmbAxisList.ValueMember = "Explain";
cmbAxisList.SelectedIndex = 0; cmbAxisList.SelectedIndex = 0;
ACStorePosition ktkPosition = null; ACStorePosition ktkPosition = null;
if (store.PositionNumList.Count > 0) if (BoxBean.PositionNumList.Count > 0)
{ {
cmbPosition.DataSource = store.PositionNumList; cmbPosition.DataSource = BoxBean.PositionNumList;
cmbPosition.SelectedIndex = 0; cmbPosition.SelectedIndex = 0;
ktkPosition = CSVPositionReader<ACStorePosition>.GetPositon(cmbPosition.Text); ktkPosition = CSVPositionReader<ACStorePosition>.GetPositon(cmbPosition.Text);
//store.PositionNumList = positionNumList; //BoxBean.PositionNumList = positionNumList;
} }
txtMiddleP1.Text = store.Config.MiddleAxis_P1_Position.ToString(); txtMiddleP1.Text = BoxBean.Config.MiddleAxis_P1_Position.ToString();
txtUpDownP1.Text = store.Config.UpDownAxis_DoorOPosition_P1.ToString(); txtUpDownP1.Text = BoxBean.Config.UpDownAxis_DoorOPosition_P1.ToString();
txtInOutP1.Text = store.Config.InOutAxis_P1_Position.ToString(); txtInOutP1.Text = BoxBean.Config.InOutAxis_P1_Position.ToString();
txtComP1.Text = store.Config.CompressAxis_P1_Position.ToString(); txtComP1.Text = BoxBean.Config.CompressAxis_P1_Position.ToString();
txtUpDownP2.Text = store.Config.UpDownAxis_DoorIPosition_P2.ToString(); txtUpDownP2.Text = BoxBean.Config.UpDownAxis_DoorIPosition_P2.ToString();
txtUpDownP7.Text = store.Config.UpDownAxis_DoorOBPosition_P7.ToString(); txtUpDownP7.Text = BoxBean.Config.UpDownAxis_DoorOBPosition_P7.ToString();
txtUpDownP8.Text = store.Config.UpDownAxis_DoorIBPosition_P8.ToString(); txtUpDownP8.Text = BoxBean.Config.UpDownAxis_DoorIBPosition_P8.ToString();
//txtInOutP2.Text = store.Config.InOutAxis_DoorPosition_P2.ToString(); //txtInOutP2.Text = BoxBean.Config.InOutAxis_DoorPosition_P2.ToString();
txtUpDownP1.Text = store.Config.UpDownAxis_DoorOPosition_P1.ToString(); txtUpDownP1.Text = BoxBean.Config.UpDownAxis_DoorOPosition_P1.ToString();
if (ktkPosition != null) if (ktkPosition != null)
{ {
txtMiddleP2.Text = ktkPosition.MiddleAxis_Position_P2.ToString(); txtMiddleP2.Text = ktkPosition.MiddleAxis_Position_P2.ToString();
...@@ -115,20 +97,38 @@ namespace OnlineStore.ACPackingStore ...@@ -115,20 +97,38 @@ namespace OnlineStore.ACPackingStore
//List<string> port = new List<string>(SerialPort.GetPortNames()); //List<string> port = new List<string>(SerialPort.GetPortNames());
//comboBoxPortName.DataSource = port; //comboBoxPortName.DataSource = port;
//if (port.IndexOf(store.Config.CompressAxis_PortName) >= 0) //if (port.IndexOf(BoxBean.Config.CompressAxis_PortName) >= 0)
//{ //{
// comboBoxPortName.SelectedIndex = port.IndexOf(store.Config.CompressAxis_PortName); // comboBoxPortName.SelectedIndex = port.IndexOf(BoxBean.Config.CompressAxis_PortName);
//} //}
//cmbHomeType.SelectedIndex = 0; //cmbHomeType.SelectedIndex = 0;
timer1.Enabled = true; timer1.Enabled = true;
chbDebug.Checked = BoxBean.IsDebug;
this.ShowInTaskbar = true;
this.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
notifyIcon1.Text = ConfigAppSettings.GetValue(Setting_Init.App_Title);
//cmbHomeType.SelectedIndex = 1;
HideForm();
this.Opacity = 1;
txtTempPort.Text = BoxBean.Config.Humiture_Port;
if (HumitureController.HumitureControllerType.Equals(1))
{
groupHistory.Visible = true;
}
else
{
groupHistory.Visible = false;
}
LoadOk = true;
} }
#endregion #endregion
private void start_button_Click(object sender, EventArgs e) private void start_button_Click(object sender, EventArgs e)
{ {
store.StartRun(); BoxBean.StartRun();
if (store.storeRunStatus >= StoreRunStatus.HomeMoving) if (BoxBean.storeRunStatus >= StoreRunStatus.HomeMoving)
{ {
StoreOpenStatus(true); StoreOpenStatus(true);
} }
...@@ -138,7 +138,7 @@ namespace OnlineStore.ACPackingStore ...@@ -138,7 +138,7 @@ namespace OnlineStore.ACPackingStore
{ {
try try
{ {
store.StopRun(); BoxBean.StopRun();
StoreOpenStatus(false); StoreOpenStatus(false);
} }
catch (Exception ex) catch (Exception ex)
...@@ -174,16 +174,16 @@ namespace OnlineStore.ACPackingStore ...@@ -174,16 +174,16 @@ namespace OnlineStore.ACPackingStore
} }
// button6_Click(null, null); // button6_Click(null, null);
// timer1.Interval = 300; // timer1.Interval = 300;
if (chbDebug.Checked.Equals(store.IsDebug).Equals(false)) if (chbDebug.Checked.Equals(BoxBean.IsDebug).Equals(false))
{ {
LoadOk = false; LoadOk = false;
chbDebug.Checked = store.IsDebug; chbDebug.Checked = BoxBean.IsDebug;
LoadOk = true; LoadOk = true;
} }
lblTemp.Text = store.currTempStr; lblTemp.Text = BoxBean.currTempStr;
lblMoveEquipInfo.Text = "移栽状态:"+(LineConnect.CanStartOut() ? "可出库":"不可出库" )+" "+LineConnect.LastUpdateTime.ToLongTimeString() ; // lblMoveEquipInfo.Text = "移栽状态:"+(LineConnect.CanStartOut() ? "可出库":"不可出库" )+" "+LineConnect.LastUpdateTime.ToLongTimeString() ;
//忙碌状态不读取状态 //忙碌状态不读取状态
if (!store.storeRunStatus.Equals(StoreRunStatus.Busy)) if (!BoxBean.storeRunStatus.Equals(StoreRunStatus.Busy))
{ {
if (chbAutoRead.Checked) if (chbAutoRead.Checked)
{ {
...@@ -207,20 +207,20 @@ namespace OnlineStore.ACPackingStore ...@@ -207,20 +207,20 @@ namespace OnlineStore.ACPackingStore
} }
//ReadPosistion(); //ReadPosistion();
if (store.storeRunStatus > StoreRunStatus.Wait) if (BoxBean.storeRunStatus > StoreRunStatus.Wait)
{ {
if (启动ToolStripMenuItem.Enabled.Equals(true)) if (启动ToolStripMenuItem.Enabled.Equals(true))
{ {
StoreOpenStatus(true); StoreOpenStatus(true);
} }
lblThisSta.Text = store.GetRunStr(); lblThisSta.Text = BoxBean.GetRunStr();
//复位按钮状态显示 //复位按钮状态显示
if (复位ToolStripMenuItem.Enabled == false) if (复位ToolStripMenuItem.Enabled == false)
{ {
if ((store.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || store.storeRunStatus.Equals(StoreRunStatus.Reset)) if ((BoxBean.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || BoxBean.storeRunStatus.Equals(StoreRunStatus.Reset))
&& store.alarmType.Equals(StoreAlarmType.None)) && BoxBean.alarmType.Equals(StoreAlarmType.None))
{ {
} }
else else
...@@ -233,8 +233,8 @@ namespace OnlineStore.ACPackingStore ...@@ -233,8 +233,8 @@ namespace OnlineStore.ACPackingStore
} }
else else
{ {
if ((store.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || store.storeRunStatus.Equals(StoreRunStatus.Reset)) if ((BoxBean.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || BoxBean.storeRunStatus.Equals(StoreRunStatus.Reset))
&& store.alarmType.Equals(StoreAlarmType.None)) && BoxBean.alarmType.Equals(StoreAlarmType.None))
{ {
if (启动ToolStripMenuItem.Enabled) if (启动ToolStripMenuItem.Enabled)
{ {
...@@ -243,44 +243,44 @@ namespace OnlineStore.ACPackingStore ...@@ -243,44 +243,44 @@ namespace OnlineStore.ACPackingStore
} }
} }
} }
lblWarnMsg.Text = store.WarnMsg; lblWarnMsg.Text = BoxBean.WarnMsg;
//if (store.Config.IsHasDoorLimit.Equals(1)) //if (BoxBean.Config.IsHasDoorLimit.Equals(1))
//{ //{
// if (IOManager.IOValue(IO_Type.Door_LimitSingle).Equals(IO_VALUE.LOW)) // if (BoxBean.IOValue(IO_Type.Door_LimitSingle).Equals(IO_VALUE.LOW))
// { // {
// lblWarnMsg.Text = lblWarnMsg.Text + " 前门未关"; // lblWarnMsg.Text = lblWarnMsg.Text + " 前门未关";
// } // }
//} //}
//如果不在出入库中,且叉子上有信号,需要提示检查叉子 //如果不在出入库中,且叉子上有信号,需要提示检查叉子
if (store.storeRunStatus.Equals(StoreRunStatus.Runing) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (BoxBean.storeRunStatus.Equals(StoreRunStatus.Runing) && BoxBean.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
lblWarnMsg.Text = lblWarnMsg.Text + " 叉子料盘检测有料,请检查"; lblWarnMsg.Text = lblWarnMsg.Text + " 叉子料盘检测有料,请检查";
} }
if (IOManager.IOValue(IO_Type.DoorLimit).Equals(IO_VALUE.LOW)) if (BoxBean.IOValue(IO_Type.DoorLimit).Equals(IO_VALUE.LOW))
{ {
lblWarnMsg.Text = lblWarnMsg.Text + " 无门禁信号,请检查"; lblWarnMsg.Text = lblWarnMsg.Text + " 无门禁信号,请检查";
} }
if (store.TempOrHumidityIsAlarm) if (BoxBean.TempOrHumidityIsAlarm)
{ {
lblWarnMsg.Text = lblWarnMsg.Text + " 温湿度报警[" + store.TempAlarmTime.ToLongTimeString() + "]"; lblWarnMsg.Text = lblWarnMsg.Text + " 温湿度报警[" + BoxBean.TempAlarmTime.ToLongTimeString() + "]";
} }
if (lblWarnMsg.Text.Equals("")) if (lblWarnMsg.Text.Equals(""))
{ {
List<string> list = new List<string>(LineConnect.WaitInStoreList); //List<string> list = new List<string>(LineConnect.WaitInStoreList);
if (list.Count > 0) //if (list.Count > 0)
{ //{
string msg = "等待入库:"; // string msg = "等待入库:";
foreach (string s in list) // foreach (string s in list)
{ // {
msg += s + "\t"; // msg += s + "\t";
} // }
lblWarnMsg.Text = msg; // lblWarnMsg.Text = msg;
} //}
} }
if (store.autoNext) if (BoxBean.autoNext)
{ {
string msg = store.autoMsg; string msg = BoxBean.autoMsg;
lblMsg.Text = msg; lblMsg.Text = msg;
if (btnStartAuTo.Text.Equals("开始自动出入库")) if (btnStartAuTo.Text.Equals("开始自动出入库"))
{ {
...@@ -290,7 +290,7 @@ namespace OnlineStore.ACPackingStore ...@@ -290,7 +290,7 @@ namespace OnlineStore.ACPackingStore
{ {
msg = msg.Replace("自动出库:", ""); msg = msg.Replace("自动出库:", "");
msg = msg.Replace("自动入库:", ""); msg = msg.Replace("自动入库:", "");
int index = store.PositionNumList.IndexOf(msg); int index = BoxBean.PositionNumList.IndexOf(msg);
if (index >= 0 && (!msg.Equals(""))) if (index >= 0 && (!msg.Equals("")))
{ {
cmbPosition.SelectedIndex = index; cmbPosition.SelectedIndex = index;
...@@ -329,45 +329,45 @@ namespace OnlineStore.ACPackingStore ...@@ -329,45 +329,45 @@ namespace OnlineStore.ACPackingStore
lblServerOn.Text = "伺服OFF"; lblServerOn.Text = "伺服OFF";
} }
string deviceName = GetPortName(); string deviceName = GetPortName();
if (ACServerManager.ServerOnStatus(store.Config.Middle_Axis.DeviceName, store.Config.Middle_Axis.GetAxisValue())) if (ACServerManager.ServerOnStatus(BoxBean.Config.Middle_Axis.DeviceName, BoxBean.Config.Middle_Axis.GetAxisValue()))
{ {
axis_1_Alarm.IOValue = ACServerManager.GetAlarmStatus(store.Config.Middle_Axis.DeviceName, store.Config.Middle_Axis.GetAxisValue()); axis_1_Alarm.IOValue = ACServerManager.GetAlarmStatus(BoxBean.Config.Middle_Axis.DeviceName, BoxBean.Config.Middle_Axis.GetAxisValue());
axis_1_Alarm.ShowData(); axis_1_Alarm.ShowData();
int lOutPulse1 = ACServerManager.GetTargetPosition(store.Config.Middle_Axis.DeviceName, store.Config.Middle_Axis.GetAxisValue()); int lOutPulse1 = ACServerManager.GetTargetPosition(BoxBean.Config.Middle_Axis.DeviceName, BoxBean.Config.Middle_Axis.GetAxisValue());
lblOutPulse1.Text = string.Format("{0:d}", lOutPulse1); lblOutPulse1.Text = string.Format("{0:d}", lOutPulse1);
int lCountPulse1 = ACServerManager.GetActualtPosition(store.Config.Middle_Axis.DeviceName, store.Config.Middle_Axis.GetAxisValue()); int lCountPulse1 = ACServerManager.GetActualtPosition(BoxBean.Config.Middle_Axis.DeviceName, BoxBean.Config.Middle_Axis.GetAxisValue());
lblCountPulse1.Text = string.Format("{0:d}", lCountPulse1); lblCountPulse1.Text = string.Format("{0:d}", lCountPulse1);
txtMiddleTarget.Text = store.Config.Middle_Axis.TargetPosition.ToString(); txtMiddleTarget.Text = BoxBean.Config.Middle_Axis.TargetPosition.ToString();
if ( store.Config.Middle_Axis.IsSameAxis(portName,SlvAddr)) if ( BoxBean.Config.Middle_Axis.IsSameAxis(portName,SlvAddr))
{ {
lblOutPulse.Text = lblOutPulse1.Text; lblOutPulse.Text = lblOutPulse1.Text;
lblCountPulse.Text = lblCountPulse1.Text; lblCountPulse.Text = lblCountPulse1.Text;
} }
} }
if (ACServerManager.ServerOnStatus(store.Config.UpDown_Axis.DeviceName, store.Config.UpDown_Axis.GetAxisValue())) if (ACServerManager.ServerOnStatus(BoxBean.Config.UpDown_Axis.DeviceName, BoxBean.Config.UpDown_Axis.GetAxisValue()))
{ {
axis_2_Alarm.IOValue = ACServerManager.GetAlarmStatus(store.Config.UpDown_Axis.DeviceName, store.Config.UpDown_Axis.GetAxisValue()); axis_2_Alarm.IOValue = ACServerManager.GetAlarmStatus(BoxBean.Config.UpDown_Axis.DeviceName, BoxBean.Config.UpDown_Axis.GetAxisValue());
axis_2_Alarm.ShowData(); axis_2_Alarm.ShowData();
int lOutPulse2 = ACServerManager.GetTargetPosition(store.Config.UpDown_Axis.DeviceName, store.Config.UpDown_Axis.GetAxisValue()); int lOutPulse2 = ACServerManager.GetTargetPosition(BoxBean.Config.UpDown_Axis.DeviceName, BoxBean.Config.UpDown_Axis.GetAxisValue());
lblOutPulse2.Text = string.Format("{0:d}", lOutPulse2); lblOutPulse2.Text = string.Format("{0:d}", lOutPulse2);
int lCountPulse2 = ACServerManager.GetActualtPosition(store.Config.UpDown_Axis.DeviceName, store.Config.UpDown_Axis.GetAxisValue()); int lCountPulse2 = ACServerManager.GetActualtPosition(BoxBean.Config.UpDown_Axis.DeviceName, BoxBean.Config.UpDown_Axis.GetAxisValue());
lblCountPulse2.Text = string.Format("{0:d}", lCountPulse2); lblCountPulse2.Text = string.Format("{0:d}", lCountPulse2);
txtInoutTarget.Text = store.Config.InOut_Axis.TargetPosition.ToString(); txtInoutTarget.Text = BoxBean.Config.InOut_Axis.TargetPosition.ToString();
if ( store.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr)) if ( BoxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
{ {
lblOutPulse.Text = lblOutPulse2.Text; lblOutPulse.Text = lblOutPulse2.Text;
lblCountPulse.Text = lblCountPulse2.Text; lblCountPulse.Text = lblCountPulse2.Text;
} }
} }
if (ACServerManager.ServerOnStatus(store.Config.InOut_Axis.DeviceName, store.Config.InOut_Axis.GetAxisValue())) if (ACServerManager.ServerOnStatus(BoxBean.Config.InOut_Axis.DeviceName, BoxBean.Config.InOut_Axis.GetAxisValue()))
{ {
axis_3_Alarm.IOValue = ACServerManager.GetAlarmStatus(store.Config.InOut_Axis.DeviceName, store.Config.InOut_Axis.GetAxisValue()); axis_3_Alarm.IOValue = ACServerManager.GetAlarmStatus(BoxBean.Config.InOut_Axis.DeviceName, BoxBean.Config.InOut_Axis.GetAxisValue());
int lOutPulse3 = ACServerManager.GetTargetPosition(store.Config.InOut_Axis.DeviceName, store.Config.InOut_Axis.GetAxisValue()); int lOutPulse3 = ACServerManager.GetTargetPosition(BoxBean.Config.InOut_Axis.DeviceName, BoxBean.Config.InOut_Axis.GetAxisValue());
lblOutPulse3.Text = string.Format("{0:d}", lOutPulse3); lblOutPulse3.Text = string.Format("{0:d}", lOutPulse3);
int lCountPulse3 = ACServerManager.GetActualtPosition(store.Config.InOut_Axis.DeviceName, store.Config.InOut_Axis.GetAxisValue()); int lCountPulse3 = ACServerManager.GetActualtPosition(BoxBean.Config.InOut_Axis.DeviceName, BoxBean.Config.InOut_Axis.GetAxisValue());
lblCountPulse3.Text = string.Format("{0:d}", lCountPulse3); lblCountPulse3.Text = string.Format("{0:d}", lCountPulse3);
txtUpdownTarget.Text = store.Config.UpDown_Axis.TargetPosition.ToString(); txtUpdownTarget.Text = BoxBean.Config.UpDown_Axis.TargetPosition.ToString();
if ( store.Config.InOut_Axis.IsSameAxis(portName, SlvAddr)) if ( BoxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr))
{ {
lblOutPulse.Text = lblOutPulse3.Text; lblOutPulse.Text = lblOutPulse3.Text;
lblCountPulse.Text = lblCountPulse3.Text; lblCountPulse.Text = lblCountPulse3.Text;
...@@ -411,11 +411,11 @@ namespace OnlineStore.ACPackingStore ...@@ -411,11 +411,11 @@ namespace OnlineStore.ACPackingStore
} }
private void btnOutStore_Click(object sender, EventArgs e) private void btnOutStore_Click(object sender, EventArgs e)
{ {
if (store.storeRunStatus >= StoreRunStatus.HomeMoving) if (BoxBean.storeRunStatus >= StoreRunStatus.HomeMoving)
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
store.StartOutStoreMove(new InOutStoreParam("", selectPositionNum, ktk)); BoxBean.StartOutStoreMove(new InOutParam("", selectPositionNum, ktk));
} }
else else
{ {
...@@ -425,11 +425,11 @@ namespace OnlineStore.ACPackingStore ...@@ -425,11 +425,11 @@ namespace OnlineStore.ACPackingStore
private void btnInStore_Click(object sender, EventArgs e) private void btnInStore_Click(object sender, EventArgs e)
{ {
if (store.storeRunStatus >= StoreRunStatus.HomeMoving) if (BoxBean.storeRunStatus >= StoreRunStatus.HomeMoving)
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
store.StartInStoreMove(new InOutStoreParam("", selectPositionNum, ktk)); BoxBean.StartInStoreMove(new InOutParam("", selectPositionNum, ktk));
} }
else else
{ {
...@@ -500,28 +500,28 @@ namespace OnlineStore.ACPackingStore ...@@ -500,28 +500,28 @@ namespace OnlineStore.ACPackingStore
{ {
if (this.cmbAxisList.SelectedIndex >= 0) if (this.cmbAxisList.SelectedIndex >= 0)
{ {
ConfigMoveAxis SlvAddr = store.moveAxisList[cmbAxisList.SelectedIndex]; ConfigMoveAxis SlvAddr = BoxBean.moveAxisList[cmbAxisList.SelectedIndex];
txtAxisDeviceName.Text = SlvAddr.DeviceName; txtAxisDeviceName.Text = SlvAddr.DeviceName;
txtAxisValue.Text = SlvAddr.GetAxisValue().ToString(); txtAxisValue.Text = SlvAddr.GetAxisValue().ToString();
txtASpeed.Text = SlvAddr.TargetSpeed.ToString(); txtASpeed.Text = SlvAddr.TargetSpeed.ToString();
//if (SlvAddr.Equals(store.Config.InOut_Axis)) //if (SlvAddr.Equals(BoxBean.Config.InOut_Axis))
//{ //{
// txtASpeed.Text = store.Config.InOutAxis_P1_Speed.ToString(); // txtASpeed.Text = BoxBean.Config.InOutAxis_P1_Speed.ToString();
//} //}
//else if (SlvAddr.Equals(store.Config.Middle_Axis)) //else if (SlvAddr.Equals(BoxBean.Config.Middle_Axis))
//{ //{
// txtASpeed.Text = store.Config.MiddleAxis_P1_Speed.ToString(); // txtASpeed.Text = BoxBean.Config.MiddleAxis_P1_Speed.ToString();
//} //}
//else if (SlvAddr.Equals(store.Config.UpDown_Axis)) //else if (SlvAddr.Equals(BoxBean.Config.UpDown_Axis))
//{ //{
// txtASpeed.Text = store.Config.UpDownAxis_P1_Speed.ToString(); // txtASpeed.Text = BoxBean.Config.UpDownAxis_P1_Speed.ToString();
//} //}
} }
} }
private void btnAxisAMove_Click(object sender, EventArgs e) private void btnAxisAMove_Click(object sender, EventArgs e)
{ {
//ConfigMoveAxis axisC = store.moveAxisList[cmbAxisList.SelectedIndex]; //ConfigMoveAxis axisC = BoxBean.moveAxisList[cmbAxisList.SelectedIndex];
string portName = txtAxisDeviceName.Text; string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue); short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
int position = FormUtil.GetIntValue(txtAPosition); int position = FormUtil.GetIntValue(txtAPosition);
...@@ -531,12 +531,12 @@ namespace OnlineStore.ACPackingStore ...@@ -531,12 +531,12 @@ namespace OnlineStore.ACPackingStore
// MessageBox.Show("位置超出" + axisC.Explain + "上下限(" + axisC.PositionMin + "-" + axisC.PositionMax + ")"); // MessageBox.Show("位置超出" + axisC.Explain + "上下限(" + axisC.PositionMin + "-" + axisC.PositionMax + ")");
// return; // return;
//} //}
if ( store.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (store.InOutAxisCanMove().Equals(false))) if ( BoxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (BoxBean.InOutAxisCanMove().Equals(false)))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
else if ( store.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || store.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr)) else if ( BoxBean.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || BoxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
{ {
if (!InOutIsIsP1()) if (!InOutIsIsP1())
{ {
...@@ -548,16 +548,16 @@ namespace OnlineStore.ACPackingStore ...@@ -548,16 +548,16 @@ namespace OnlineStore.ACPackingStore
} }
private void btnAxisVMove_Click(object sender, EventArgs e) private void btnAxisVMove_Click(object sender, EventArgs e)
{ {
//ConfigMoveAxis axisC = store.moveAxisList[cmbAxisList.SelectedIndex]; //ConfigMoveAxis axisC = BoxBean.moveAxisList[cmbAxisList.SelectedIndex];
string portName = txtAxisDeviceName.Text; string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue); short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
int speed = FormUtil.GetIntValue(txtASpeed); int speed = FormUtil.GetIntValue(txtASpeed);
if (store.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (store.InOutAxisCanMove().Equals(false))) if (BoxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (BoxBean.InOutAxisCanMove().Equals(false)))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
else if (store.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || store.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr)) else if (BoxBean.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || BoxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
{ {
if (!InOutIsIsP1()) if (!InOutIsIsP1())
{ {
...@@ -570,7 +570,7 @@ namespace OnlineStore.ACPackingStore ...@@ -570,7 +570,7 @@ namespace OnlineStore.ACPackingStore
private void btnAxisRMove_Click(object sender, EventArgs e) private void btnAxisRMove_Click(object sender, EventArgs e)
{ {
//ConfigMoveAxis axisC = store.moveAxisList[cmbAxisList.SelectedIndex]; //ConfigMoveAxis axisC = BoxBean.moveAxisList[cmbAxisList.SelectedIndex];
string portName = txtAxisDeviceName.Text; string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue); short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
int position = FormUtil.GetIntValue(txtAPosition); int position = FormUtil.GetIntValue(txtAPosition);
...@@ -583,12 +583,12 @@ namespace OnlineStore.ACPackingStore ...@@ -583,12 +583,12 @@ namespace OnlineStore.ACPackingStore
// return; // return;
//} //}
if (store.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (store.InOutAxisCanMove().Equals(false))) if (BoxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (BoxBean.InOutAxisCanMove().Equals(false)))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
else if (store.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || store.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr)) else if (BoxBean.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || BoxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
{ {
if (!InOutIsIsP1()) if (!InOutIsIsP1())
{ {
...@@ -654,7 +654,7 @@ namespace OnlineStore.ACPackingStore ...@@ -654,7 +654,7 @@ namespace OnlineStore.ACPackingStore
string positionConfigFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_Position_Config); string positionConfigFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_Position_Config);
if (!File.Exists(positionConfigFile)) if (!File.Exists(positionConfigFile))
{ {
positionConfigFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_Position_Config, "_" + store.StoreID.ToString()); positionConfigFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_Position_Config, "_" + BoxBean.DeviceID.ToString());
} }
bool result = CSVPositionReader<ACStorePosition>.SavePostion(positionConfigFile, ktkPosition); bool result = CSVPositionReader<ACStorePosition>.SavePostion(positionConfigFile, ktkPosition);
if (!result) if (!result)
...@@ -663,57 +663,57 @@ namespace OnlineStore.ACPackingStore ...@@ -663,57 +663,57 @@ namespace OnlineStore.ACPackingStore
} }
//料仓固定位置保存 //料仓固定位置保存
bool needUpdate = false; bool needUpdate = false;
if (store.Config.MiddleAxis_P1_Position != FormUtil.GetIntValue(txtMiddleP1)) if (BoxBean.Config.MiddleAxis_P1_Position != FormUtil.GetIntValue(txtMiddleP1))
{ {
store.Config.MiddleAxis_P1_Position = FormUtil.GetIntValue(txtMiddleP1); BoxBean.Config.MiddleAxis_P1_Position = FormUtil.GetIntValue(txtMiddleP1);
needUpdate = true; needUpdate = true;
} }
if (store.Config.UpDownAxis_DoorOPosition_P1 != FormUtil.GetIntValue(txtUpDownP1)) if (BoxBean.Config.UpDownAxis_DoorOPosition_P1 != FormUtil.GetIntValue(txtUpDownP1))
{ {
store.Config.UpDownAxis_DoorOPosition_P1 = FormUtil.GetIntValue(txtUpDownP1); BoxBean.Config.UpDownAxis_DoorOPosition_P1 = FormUtil.GetIntValue(txtUpDownP1);
needUpdate = true; needUpdate = true;
} }
if (store.Config.InOutAxis_P1_Position != FormUtil.GetIntValue(txtInOutP1)) if (BoxBean.Config.InOutAxis_P1_Position != FormUtil.GetIntValue(txtInOutP1))
{ {
store.Config.InOutAxis_P1_Position = FormUtil.GetIntValue(txtInOutP1); BoxBean.Config.InOutAxis_P1_Position = FormUtil.GetIntValue(txtInOutP1);
needUpdate = true; needUpdate = true;
} }
if (store.Config.CompressAxis_P1_Position != FormUtil.GetIntValue(txtComP1)) if (BoxBean.Config.CompressAxis_P1_Position != FormUtil.GetIntValue(txtComP1))
{ {
store.Config.CompressAxis_P1_Position = FormUtil.GetIntValue(txtComP1); BoxBean.Config.CompressAxis_P1_Position = FormUtil.GetIntValue(txtComP1);
needUpdate = true; needUpdate = true;
} }
if (store.Config.UpDownAxis_DoorIPosition_P2 != FormUtil.GetIntValue(txtUpDownP2)) if (BoxBean.Config.UpDownAxis_DoorIPosition_P2 != FormUtil.GetIntValue(txtUpDownP2))
{ {
store.Config.UpDownAxis_DoorIPosition_P2 = FormUtil.GetIntValue(txtUpDownP2); BoxBean.Config.UpDownAxis_DoorIPosition_P2 = FormUtil.GetIntValue(txtUpDownP2);
needUpdate = true; needUpdate = true;
} }
if (store.Config.UpDownAxis_DoorOBPosition_P7 != FormUtil.GetIntValue(txtUpDownP7)) if (BoxBean.Config.UpDownAxis_DoorOBPosition_P7 != FormUtil.GetIntValue(txtUpDownP7))
{ {
store.Config.UpDownAxis_DoorOBPosition_P7 = FormUtil.GetIntValue(txtUpDownP7); BoxBean.Config.UpDownAxis_DoorOBPosition_P7 = FormUtil.GetIntValue(txtUpDownP7);
needUpdate = true; needUpdate = true;
} }
if (store.Config.UpDownAxis_DoorIBPosition_P8 != FormUtil.GetIntValue(txtUpDownP8)) if (BoxBean.Config.UpDownAxis_DoorIBPosition_P8 != FormUtil.GetIntValue(txtUpDownP8))
{ {
store.Config.UpDownAxis_DoorIBPosition_P8 = FormUtil.GetIntValue(txtUpDownP8); BoxBean.Config.UpDownAxis_DoorIBPosition_P8 = FormUtil.GetIntValue(txtUpDownP8);
needUpdate = true; needUpdate = true;
} }
//if (store.Config.InOutAxis_DoorPosition_P2 != FormUtil.GetIntValue(txtInOutP2)) //if (BoxBean.Config.InOutAxis_DoorPosition_P2 != FormUtil.GetIntValue(txtInOutP2))
//{ //{
// store.Config.InOutAxis_DoorPosition_P2 = FormUtil.GetIntValue(txtInOutP2); // BoxBean.Config.InOutAxis_DoorPosition_P2 = FormUtil.GetIntValue(txtInOutP2);
// needUpdate = true; // needUpdate = true;
//} //}
if (store.Config.UpDownAxis_DoorOPosition_P1 != FormUtil.GetIntValue(txtUpDownP1)) if (BoxBean.Config.UpDownAxis_DoorOPosition_P1 != FormUtil.GetIntValue(txtUpDownP1))
{ {
store.Config.UpDownAxis_DoorOPosition_P1 = FormUtil.GetIntValue(txtUpDownP1); BoxBean.Config.UpDownAxis_DoorOPosition_P1 = FormUtil.GetIntValue(txtUpDownP1);
needUpdate = true; needUpdate = true;
} }
if (needUpdate) if (needUpdate)
{ {
//更新缓存 //更新缓存
StoreManager.UpdateBoxConfig(store.Config); StoreManager.UpdateBoxConfig(BoxBean.Config);
} }
} }
...@@ -736,7 +736,7 @@ namespace OnlineStore.ACPackingStore ...@@ -736,7 +736,7 @@ namespace OnlineStore.ACPackingStore
private bool InOutIsIsP1() private bool InOutIsIsP1()
{ {
int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition); int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
int currValue = ACServerManager.GetActualtPosition(store.Config.InOut_Axis.DeviceName, store.Config.InOut_Axis.GetAxisValue()); int currValue = ACServerManager.GetActualtPosition(BoxBean.Config.InOut_Axis.DeviceName, BoxBean.Config.InOut_Axis.GetAxisValue());
if (currValue <= InOutDefaultPosition) if (currValue <= InOutDefaultPosition)
{ {
return true; return true;
...@@ -761,7 +761,7 @@ namespace OnlineStore.ACPackingStore ...@@ -761,7 +761,7 @@ namespace OnlineStore.ACPackingStore
if (InOutIsIsP1()) if (InOutIsIsP1())
{ {
int value = FormUtil.GetIntValue(txtUpDownP1); int value = FormUtil.GetIntValue(txtUpDownP1);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P1_Speed); AxisABSMove(BoxBean.Config.UpDown_Axis, value, BoxBean.Config.UpDownAxis_P1_Speed);
} }
} }
...@@ -770,7 +770,7 @@ namespace OnlineStore.ACPackingStore ...@@ -770,7 +770,7 @@ namespace OnlineStore.ACPackingStore
if (InOutIsIsP1()) if (InOutIsIsP1())
{ {
int value = FormUtil.GetIntValue(txtUpDownP2); int value = FormUtil.GetIntValue(txtUpDownP2);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P2_Speed); AxisABSMove(BoxBean.Config.UpDown_Axis, value, BoxBean.Config.UpDownAxis_P2_Speed);
} }
} }
private void btnUpDownP7_Click(object sender, EventArgs e) private void btnUpDownP7_Click(object sender, EventArgs e)
...@@ -778,7 +778,7 @@ namespace OnlineStore.ACPackingStore ...@@ -778,7 +778,7 @@ namespace OnlineStore.ACPackingStore
if (InOutIsIsP1()) if (InOutIsIsP1())
{ {
int value = FormUtil.GetIntValue(txtUpDownP7); int value = FormUtil.GetIntValue(txtUpDownP7);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P7_Speed); AxisABSMove(BoxBean.Config.UpDown_Axis, value, BoxBean.Config.UpDownAxis_P7_Speed);
} }
} }
...@@ -787,7 +787,7 @@ namespace OnlineStore.ACPackingStore ...@@ -787,7 +787,7 @@ namespace OnlineStore.ACPackingStore
if (InOutIsIsP1()) if (InOutIsIsP1())
{ {
int value = FormUtil.GetIntValue(txtUpDownP8); int value = FormUtil.GetIntValue(txtUpDownP8);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P8_Speed); AxisABSMove(BoxBean.Config.UpDown_Axis, value, BoxBean.Config.UpDownAxis_P8_Speed);
} }
} }
...@@ -796,7 +796,7 @@ namespace OnlineStore.ACPackingStore ...@@ -796,7 +796,7 @@ namespace OnlineStore.ACPackingStore
if (InOutIsIsP1()) if (InOutIsIsP1())
{ {
int value = FormUtil.GetIntValue(txtUpDownP3); int value = FormUtil.GetIntValue(txtUpDownP3);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P3_Speed); AxisABSMove(BoxBean.Config.UpDown_Axis, value, BoxBean.Config.UpDownAxis_P3_Speed);
} }
} }
...@@ -805,7 +805,7 @@ namespace OnlineStore.ACPackingStore ...@@ -805,7 +805,7 @@ namespace OnlineStore.ACPackingStore
if (InOutIsIsP1()) if (InOutIsIsP1())
{ {
int value = FormUtil.GetIntValue(txtUpDownP4); int value = FormUtil.GetIntValue(txtUpDownP4);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P4_Speed); AxisABSMove(BoxBean.Config.UpDown_Axis, value, BoxBean.Config.UpDownAxis_P4_Speed);
} }
} }
...@@ -814,7 +814,7 @@ namespace OnlineStore.ACPackingStore ...@@ -814,7 +814,7 @@ namespace OnlineStore.ACPackingStore
if (InOutIsIsP1()) if (InOutIsIsP1())
{ {
int value = FormUtil.GetIntValue(txtUpDownP5); int value = FormUtil.GetIntValue(txtUpDownP5);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P5_Speed); AxisABSMove(BoxBean.Config.UpDown_Axis, value, BoxBean.Config.UpDownAxis_P5_Speed);
} }
} }
...@@ -823,7 +823,7 @@ namespace OnlineStore.ACPackingStore ...@@ -823,7 +823,7 @@ namespace OnlineStore.ACPackingStore
if (InOutIsIsP1()) if (InOutIsIsP1())
{ {
int value = FormUtil.GetIntValue(txtUpDownP6); int value = FormUtil.GetIntValue(txtUpDownP6);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P6_Speed); AxisABSMove(BoxBean.Config.UpDown_Axis, value, BoxBean.Config.UpDownAxis_P6_Speed);
} }
} }
...@@ -832,7 +832,7 @@ namespace OnlineStore.ACPackingStore ...@@ -832,7 +832,7 @@ namespace OnlineStore.ACPackingStore
if (InOutIsIsP1()) if (InOutIsIsP1())
{ {
int value = FormUtil.GetIntValue(txtMiddleP1); int value = FormUtil.GetIntValue(txtMiddleP1);
AxisABSMove(store.Config.Middle_Axis, value, store.Config.MiddleAxis_P1_Speed); AxisABSMove(BoxBean.Config.Middle_Axis, value, BoxBean.Config.MiddleAxis_P1_Speed);
} }
} }
...@@ -841,78 +841,78 @@ namespace OnlineStore.ACPackingStore ...@@ -841,78 +841,78 @@ namespace OnlineStore.ACPackingStore
if (InOutIsIsP1()) if (InOutIsIsP1())
{ {
int value = FormUtil.GetIntValue(txtMiddleP2); int value = FormUtil.GetIntValue(txtMiddleP2);
AxisABSMove(store.Config.Middle_Axis, value, store.Config.MiddleAxis_P2_Speed); AxisABSMove(BoxBean.Config.Middle_Axis, value, BoxBean.Config.MiddleAxis_P2_Speed);
} }
} }
private void btnInOutP1_Click(object sender, EventArgs e) private void btnInOutP1_Click(object sender, EventArgs e)
{ {
if (store.InOutAxisCanMove().Equals(false)) if (BoxBean.InOutAxisCanMove().Equals(false))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
int value = FormUtil.GetIntValue(txtInOutP1); int value = FormUtil.GetIntValue(txtInOutP1);
AxisABSMove(store.Config.InOut_Axis, value, store.Config.InOutAxis_P1_Speed); AxisABSMove(BoxBean.Config.InOut_Axis, value, BoxBean.Config.InOutAxis_P1_Speed);
} }
private void btnInOutP3_Click(object sender, EventArgs e) private void btnInOutP3_Click(object sender, EventArgs e)
{ {
if (store.InOutAxisCanMove().Equals(false)) if (BoxBean.InOutAxisCanMove().Equals(false))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
int value = FormUtil.GetIntValue(txtInOutP3); int value = FormUtil.GetIntValue(txtInOutP3);
AxisABSMove(store.Config.InOut_Axis, value, store.Config.InOutAxis_P3_Speed); AxisABSMove(BoxBean.Config.InOut_Axis, value, BoxBean.Config.InOutAxis_P3_Speed);
} }
private void btnInOutP2_Click(object sender, EventArgs e) private void btnInOutP2_Click(object sender, EventArgs e)
{ {
if (store.InOutAxisCanMove().Equals(false)) if (BoxBean.InOutAxisCanMove().Equals(false))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
int value = FormUtil.GetIntValue(txtInOutP2); int value = FormUtil.GetIntValue(txtInOutP2);
AxisABSMove(store.Config.InOut_Axis, value, store.Config.InOutAxis_P2_Speed); AxisABSMove(BoxBean.Config.InOut_Axis, value, BoxBean.Config.InOutAxis_P2_Speed);
} }
private void btnComP2_Click(object sender, EventArgs e) private void btnComP2_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtComP2); int value = FormUtil.GetIntValue(txtComP2);
AxisABSMove(store.Config.Comp_Axis, value, store.Config.CompAxis_P2_Speed); AxisABSMove(BoxBean.Config.Comp_Axis, value, BoxBean.Config.CompAxis_P2_Speed);
//ShuoKeControls.AbsMove(store.Config.CompressAxis_Slv, value); //ShuoKeControls.AbsMove(BoxBean.Config.CompressAxis_Slv, value);
} }
private void btnComP1_Click(object sender, EventArgs e) private void btnComP1_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtComP1); int value = FormUtil.GetIntValue(txtComP1);
AxisABSMove(store.Config.Comp_Axis, value, store.Config.CompAxis_P1_Speed); AxisABSMove(BoxBean.Config.Comp_Axis, value, BoxBean.Config.CompAxis_P1_Speed);
//ShuoKeControls.AbsMove(store.Config.CompressAxis_Slv, value); //ShuoKeControls.AbsMove(BoxBean.Config.CompressAxis_Slv, value);
} }
private void btnComP3_Click(object sender, EventArgs e) private void btnComP3_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtComP3); int value = FormUtil.GetIntValue(txtComP3);
AxisABSMove(store.Config.Comp_Axis, value, store.Config.CompAxis_P3_Speed); AxisABSMove(BoxBean.Config.Comp_Axis, value, BoxBean.Config.CompAxis_P3_Speed);
//ShuoKeControls.AbsMove(store.Config.CompressAxis_Slv, value); //ShuoKeControls.AbsMove(BoxBean.Config.CompressAxis_Slv, value);
} }
int xWidth = SystemInformation.PrimaryMonitorSize.Width;//获取显示器屏幕宽度 int xWidth = SystemInformation.PrimaryMonitorSize.Width;//获取显示器屏幕宽度
int yHeight = SystemInformation.PrimaryMonitorSize.Height;//高度 int yHeight = SystemInformation.PrimaryMonitorSize.Height;//高度
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
FormManager.ShowAxisDebug(store); FormManager.ShowAxisDebug(BoxBean);
} }
private void btnStartAuTo_Click(object sender, EventArgs e) private void btnStartAuTo_Click(object sender, EventArgs e)
{ {
if (store.storeRunStatus >= StoreRunStatus.HomeMoving) if (BoxBean.storeRunStatus >= StoreRunStatus.HomeMoving)
{ {
if (store.autoNext) if (BoxBean.autoNext)
{ {
store.autoNext = false; BoxBean.autoNext = false;
btnStartAuTo.Text = "开始自动出入库"; btnStartAuTo.Text = "开始自动出入库";
} }
else else
...@@ -920,19 +920,19 @@ namespace OnlineStore.ACPackingStore ...@@ -920,19 +920,19 @@ namespace OnlineStore.ACPackingStore
DialogResult res = MessageBox.Show("确定开始自动出入库?", "提示", MessageBoxButtons.YesNo); DialogResult res = MessageBox.Show("确定开始自动出入库?", "提示", MessageBoxButtons.YesNo);
if (res.Equals(DialogResult.Yes)) if (res.Equals(DialogResult.Yes))
{ {
store.autoNext = true; BoxBean.autoNext = true;
int jiange = FormUtil.GetIntValue(txtJiange); int jiange = FormUtil.GetIntValue(txtJiange);
store.autoJiange = jiange; BoxBean.autoJiange = jiange;
if (cmbPosition.SelectedIndex >= 0) if (cmbPosition.SelectedIndex >= 0)
{ {
int currIndex = cmbPosition.SelectedIndex; int currIndex = cmbPosition.SelectedIndex;
store.autoPositionIndex = currIndex; BoxBean.autoPositionIndex = currIndex;
store.AutoStartIndex = currIndex; BoxBean.AutoStartIndex = currIndex;
string poText = cmbPosition.Text; string poText = cmbPosition.Text;
store.autoMsg = "自动出库:" + poText; BoxBean.autoMsg = "自动出库:" + poText;
LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!"); LogUtil.info(LOGGER, BoxBean.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
//store.StartOutStoreMove(new InOutStoreParam("", poText)); //BoxBean.StartOutStoreMove(new InOutStoreParam("", poText));
store.StartInStoreMove(new InOutStoreParam("", poText)); BoxBean.StartInStoreMove(new InOutParam("", poText));
} }
btnStartAuTo.Text = "停止自动出入库"; btnStartAuTo.Text = "停止自动出入库";
} }
...@@ -965,14 +965,14 @@ namespace OnlineStore.ACPackingStore ...@@ -965,14 +965,14 @@ namespace OnlineStore.ACPackingStore
private void 复位ToolStripMenuItem_Click(object sender, EventArgs e) private void 复位ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
this.store.Reset(); this.BoxBean.Reset();
复位ToolStripMenuItem.Enabled = false; 复位ToolStripMenuItem.Enabled = false;
复位ToolStripMenuItem.Enabled = false; 复位ToolStripMenuItem.Enabled = false;
} }
private void 查看IOToolStripMenuItem_Click(object sender, EventArgs e) private void 查看IOToolStripMenuItem_Click(object sender, EventArgs e)
{ {
FormManager.ShowIOShow(store); FormManager.ShowIOShow(BoxBean);
} }
private void 清理日志ToolStripMenuItem_Click(object sender, EventArgs e) private void 清理日志ToolStripMenuItem_Click(object sender, EventArgs e)
...@@ -1006,34 +1006,34 @@ namespace OnlineStore.ACPackingStore ...@@ -1006,34 +1006,34 @@ namespace OnlineStore.ACPackingStore
private void 料仓运转ONToolStripMenuItem_Click(object sender, EventArgs e) private void 料仓运转ONToolStripMenuItem_Click(object sender, EventArgs e)
{ {
this.Enabled = false; this.Enabled = false;
store.RunAxis(false ); BoxBean.RunAxis(false );
this.Enabled = true; this.Enabled = true;
LogUtil.info("料仓运转ON完成"); LogUtil.info("料仓运转ON完成");
} }
private void 打开舱门ToolStripMenuItem_Click(object sender, EventArgs e) private void 打开舱门ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
StoreManager.Store.OpenDoor(false); // StoreManager.Store.OpenDoor(false);
} }
private void 料仓运转OFFToolStripMenuItem_Click(object sender, EventArgs e) private void 料仓运转OFFToolStripMenuItem_Click(object sender, EventArgs e)
{ {
store.CloseAllAxis(); BoxBean.CloseAllAxis();
LogUtil.info("料仓运转OFF完成"); LogUtil.info("料仓运转OFF完成");
} }
private void 关闭仓门ToolStripMenuItem_Click(object sender, EventArgs e) private void 关闭仓门ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
StoreManager.Store.CloseDoor(false); // StoreManager.Store.CloseDoor(false);
} }
private void 回待机点ToolStripMenuItem_Click(object sender, EventArgs e) private void 回待机点ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (store.storeRunStatus >= StoreRunStatus.HomeMoving) if (BoxBean.storeRunStatus >= StoreRunStatus.HomeMoving)
{ {
if (store.StoreMove.MoveType.Equals(StoreMoveType.None) && store.alarmType.Equals(StoreAlarmType.None)) if (BoxBean.MoveInfo.MoveType.Equals(StoreMoveType.None) && BoxBean.alarmType.Equals(StoreAlarmType.None))
{ {
store.MoveToP1(); BoxBean.MoveToP1();
} }
else else
{ {
...@@ -1118,12 +1118,12 @@ namespace OnlineStore.ACPackingStore ...@@ -1118,12 +1118,12 @@ namespace OnlineStore.ACPackingStore
{ {
string portName = txtAxisDeviceName.Text; string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue); short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
if (store.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (store.InOutAxisCanMove().Equals(false))) if (BoxBean.Config.InOut_Axis.IsSameAxis(portName, SlvAddr) && (BoxBean.InOutAxisCanMove().Equals(false)))
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
else if (store.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || store.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr)) else if (BoxBean.Config.Middle_Axis.IsSameAxis(portName, SlvAddr) || BoxBean.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
{ {
if (!InOutIsIsP1()) if (!InOutIsIsP1())
{ {
...@@ -1302,7 +1302,7 @@ namespace OnlineStore.ACPackingStore ...@@ -1302,7 +1302,7 @@ namespace OnlineStore.ACPackingStore
{ {
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.HIGH); //IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW); //IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
StoreManager.Store.OpenDoor(false); // StoreManager.Store.OpenDoor(false);
} }
private void btnClearL_Click(object sender, EventArgs e) private void btnClearL_Click(object sender, EventArgs e)
...@@ -1363,32 +1363,32 @@ namespace OnlineStore.ACPackingStore ...@@ -1363,32 +1363,32 @@ namespace OnlineStore.ACPackingStore
{ {
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW); //IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH); //IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
StoreManager.Store.CloseDoor(false); // StoreManager.Store.CloseDoor(false);
} }
private void button3_Click(object sender, EventArgs e) private void button3_Click(object sender, EventArgs e)
{ {
LineConnect.StartConnect(); // LineConnect.StartConnect();
} }
private void button5_Click(object sender, EventArgs e) private void button5_Click(object sender, EventArgs e)
{ {
LineConnect.StopConnect(); // LineConnect.StopConnect();
} }
private void button6_Click(object sender, EventArgs e) private void button6_Click(object sender, EventArgs e)
{ {
if (LineConnect.IsConnect()) //if (LineConnect.IsConnect())
{ //{
int hasTray = (int)IOManager.IOValue(IO_Type.TrayCheck_Door); // int hasTray = (int)BoxBean.IOValue(IO_Type.TrayCheck_Door);
StoreStatus ss = StoreStatus.StoreOnline; // StoreStatus ss = StoreStatus.StoreOnline;
if (store.IsDebug) // if (BoxBean.IsDebug)
{ // {
ss = StoreStatus.Debugging; // ss = StoreStatus.Debugging;
} // }
StoreSendBean bean = new StoreSendBean(StoreManager.Config.Id, StoreManager.Config.CID, (int)ss, (int)StoreRunStatus.Runing, hasTray, (int)StoreAlarmType.None); // StoreSendBean bean = new StoreSendBean(StoreManager.Config.Id, StoreManager.Config.CID, (int)ss, (int)StoreRunStatus.Runing, hasTray, (int)StoreAlarmType.None);
LineConnect.SendHeart(bean); // LineConnect.SendHeart(bean);
} //}
} }
private void chbDebug_CheckedChanged(object sender, EventArgs e) private void chbDebug_CheckedChanged(object sender, EventArgs e)
...@@ -1400,12 +1400,12 @@ namespace OnlineStore.ACPackingStore ...@@ -1400,12 +1400,12 @@ namespace OnlineStore.ACPackingStore
if (chbDebug.Checked) if (chbDebug.Checked)
{ {
if (!store.IsDebug) if (!BoxBean.IsDebug)
{ {
DialogResult result = MessageBox.Show("是否切换到调试状态?", "是否确认切换", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); DialogResult result = MessageBox.Show("是否切换到调试状态?", "是否确认切换", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result.Equals(DialogResult.Yes)) if (result.Equals(DialogResult.Yes))
{ {
store.IsDebug = true; BoxBean.IsDebug = true;
ConfigAppSettings.SaveValue(Setting_Init.IsInDebug, 1); ConfigAppSettings.SaveValue(Setting_Init.IsInDebug, 1);
LogUtil.info("用户切换到调试状态 "); LogUtil.info("用户切换到调试状态 ");
} }
...@@ -1413,12 +1413,12 @@ namespace OnlineStore.ACPackingStore ...@@ -1413,12 +1413,12 @@ namespace OnlineStore.ACPackingStore
} }
else else
{ {
if (store.IsDebug) if (BoxBean.IsDebug)
{ {
DialogResult result = MessageBox.Show("是否切换到正常工作状态?", "是否确认切换", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); DialogResult result = MessageBox.Show("是否切换到正常工作状态?", "是否确认切换", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result.Equals(DialogResult.Yes)) if (result.Equals(DialogResult.Yes))
{ {
store.IsDebug = false ; BoxBean.IsDebug = false ;
ConfigAppSettings.SaveValue(Setting_Init.IsInDebug, 0); ConfigAppSettings.SaveValue(Setting_Init.IsInDebug, 0);
LogUtil.info("用户切换到正常工作状态 "); LogUtil.info("用户切换到正常工作状态 ");
} }
......
...@@ -96,7 +96,7 @@ namespace OnlineStore.ACPackingStore ...@@ -96,7 +96,7 @@ namespace OnlineStore.ACPackingStore
XmlConfigurator.Configure(); XmlConfigurator.Configure();
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmStoreBox()); Application.Run(new FrmMain());
} }
} }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
......
...@@ -35,7 +35,7 @@ namespace OnlineStore.Common ...@@ -35,7 +35,7 @@ namespace OnlineStore.Common
/// </summary> /// </summary>
public static string Store_Type = "Store_Type"; public static string Store_Type = "Store_Type";
public static string Store_ConfigPath = "Store_ConfigPath"; public static string BOX_ConfigPath = "BOX_ConfigPath";
public static string Store_Position_Config = "Store_Position_Config"; public static string Store_Position_Config = "Store_Position_Config";
/// <summary> /// <summary>
/// 摄像机名称,多个中间使用#分割 /// 摄像机名称,多个中间使用#分割
...@@ -90,5 +90,7 @@ namespace OnlineStore.Common ...@@ -90,5 +90,7 @@ namespace OnlineStore.Common
public static string IsInDebug = "IsInDebug"; public static string IsInDebug = "IsInDebug";
public static string ACBaudRate = "ACBaudRate"; public static string ACBaudRate = "ACBaudRate";
public static string Store_ConfigPath = "Store_ConfigPath";
} }
} }
...@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 流水线自动料仓-Box类 /// 流水线自动料仓-Box类
/// </summary> /// </summary>
public partial class AC_SA_BoxBean : KTK_Store public partial class AC_BOX_Bean : KTK_Store
{ {
private static bool IsIntSlvBlock = false; private static bool IsIntSlvBlock = false;
/// <summary> /// <summary>
...@@ -22,7 +22,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -22,7 +22,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public static bool IsRun = false; public static bool IsRun = false;
public string CID = ""; public string CID = "";
public AC_SA_Config Config; public AC_BOX_Config Config;
/// <summary> /// <summary>
/// 记录最后一次 出库的posID,出库完成发送给服务器之后清除 /// 记录最后一次 出库的posID,出库完成发送给服务器之后清除
/// </summary> /// </summary>
...@@ -37,14 +37,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -37,14 +37,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
private Dictionary<string, AxisAlarmInfo> AxisAlarmCodeMap = new Dictionary<string, AxisAlarmInfo>(); private Dictionary<string, AxisAlarmInfo> AxisAlarmCodeMap = new Dictionary<string, AxisAlarmInfo>();
/// <summary>
/// 是否有压紧轴
/// </summary>
public bool IsHasCompress_Axis = true;
//public ScanSocket scanSocket = new ScanSocket();
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer(); private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
private System.Timers.Timer IoCheckTimer = new System.Timers.Timer(); private System.Timers.Timer IoCheckTimer = new System.Timers.Timer();
public AC_SA_BoxBean(AC_SA_Config config) public AC_BOX_Bean(AC_BOX_Config config)
{ {
Init(); Init();
serverConnectTimer = new System.Timers.Timer(); serverConnectTimer = new System.Timers.Timer();
...@@ -60,10 +56,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -60,10 +56,9 @@ namespace OnlineStore.DeviceLibrary
//添加调试 //添加调试
IsDebug = ConfigAppSettings.GetIntValue(Setting_Init.IsInDebug).Equals(1); IsDebug = ConfigAppSettings.GetIntValue(Setting_Init.IsInDebug).Equals(1);
IsHasCompress_Axis = config.IsHasCompress_Axis.Equals(1); Name = ("料仓BOX_" + config.Id + " ").ToUpper();
StoreName = ("料仓BOX_" + config.Id + " ").ToUpper(); this.DeviceID = config.Id;
this.StoreID = config.Id;
this.Config = config; this.Config = config;
moveAxisList = new List<ConfigMoveAxis>(); moveAxisList = new List<ConfigMoveAxis>();
MoveAxisConfig(); MoveAxisConfig();
...@@ -71,7 +66,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -71,7 +66,7 @@ namespace OnlineStore.DeviceLibrary
PositionNumList = new List<string>(); PositionNumList = new List<string>();
foreach (ACStorePosition position in positionList) foreach (ACStorePosition position in positionList)
{ {
if (position.StoreId.Equals(StoreID)) if (position.StoreId.Equals(DeviceID))
{ {
bool result = ACStorePosition.CheckPosition(position, Config); bool result = ACStorePosition.CheckPosition(position, Config);
if (result) if (result)
...@@ -103,13 +98,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -103,13 +98,13 @@ namespace OnlineStore.DeviceLibrary
//判断急停 //判断急停
if (storeRunStatus >= StoreRunStatus.HomeMoving) if (storeRunStatus >= StoreRunStatus.HomeMoving)
{ {
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{ {
if (isInSuddenDown.Equals(false)) if (isInSuddenDown.Equals(false))
{ {
isInSuddenDown = true; isInSuddenDown = true;
LogUtil.error(LOGGER, StoreName + "收到急停信号,报警急停"); LogUtil.error(LOGGER, Name + "收到急停信号,报警急停");
WarnMsg = StoreName + "收到急停信号,报警急停"; WarnMsg = Name + "收到急停信号,报警急停";
//报警时会关闭所有轴 //报警时会关闭所有轴
Alarm(StoreAlarmType.SuddenStop, "1", WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.SuddenStop, "1", WarnMsg, StoreMoveType.None);
...@@ -123,7 +118,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -123,7 +118,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public void MoveAxisConfig() public void MoveAxisConfig()
{ {
AC_SA_Config.ConfigAxis(Config); AC_BOX_Config.ConfigAxis(Config);
moveAxisList = new List<ConfigMoveAxis>(); moveAxisList = new List<ConfigMoveAxis>();
moveAxisList.Add(Config.Middle_Axis); moveAxisList.Add(Config.Middle_Axis);
...@@ -134,12 +129,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -134,12 +129,10 @@ namespace OnlineStore.DeviceLibrary
this.AxisAlarmCodeMap.Add(Config.UpDown_Axis.GetNameStr(), new AxisAlarmInfo()); this.AxisAlarmCodeMap.Add(Config.UpDown_Axis.GetNameStr(), new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(Config.InOut_Axis.GetNameStr(), new AxisAlarmInfo()); this.AxisAlarmCodeMap.Add(Config.InOut_Axis.GetNameStr(), new AxisAlarmInfo());
this.AxisAlarmCodeMap.Add(this.Config.Middle_Axis.GetNameStr(), new AxisAlarmInfo()); this.AxisAlarmCodeMap.Add(this.Config.Middle_Axis.GetNameStr(), new AxisAlarmInfo());
if (Config.IsHasCompress_Axis.Equals(1))
{
moveAxisList.Add(Config.Comp_Axis); moveAxisList.Add(Config.Comp_Axis);
this.AxisAlarmCodeMap.Add(this.Config.Comp_Axis.GetNameStr(), new AxisAlarmInfo()); this.AxisAlarmCodeMap.Add(this.Config.Comp_Axis.GetNameStr(), new AxisAlarmInfo());
}
} }
/// <summary> /// <summary>
...@@ -147,18 +140,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -147,18 +140,18 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public override bool StartRun() public override bool StartRun()
{ {
LogUtil.info(LOGGER, StoreName + "开始启动,启动时间:" + StartTime.ToString()); LogUtil.info(LOGGER, Name + "开始启动,启动时间:" + StartTime.ToString());
autoNext = false; autoNext = false;
mainTimer.Enabled = false; mainTimer.Enabled = false;
alarmType = StoreAlarmType.None; alarmType = StoreAlarmType.None;
//急停按钮和气压检测需要一起判断 //急停按钮和气压检测需要一起判断
IO_VALUE suddenBtn = IOManager.IOValue(IO_Type.SuddenStop_BTN); IO_VALUE suddenBtn = IOValue(IO_Type.SuddenStop_BTN);
IO_VALUE airCheck = IOManager.IOValue(IO_Type.Airpressure_Check); IO_VALUE airCheck = IOValue(IO_Type.Airpressure_Check);
//if (suddenBtn == IO_VALUE.HIGH) //if (suddenBtn == IO_VALUE.HIGH)
if (suddenBtn.Equals(IO_VALUE.HIGH) && (airCheck.Equals(IO_VALUE.HIGH) || Config.HasDoor.Equals(0))) if (suddenBtn.Equals(IO_VALUE.HIGH) && (airCheck.Equals(IO_VALUE.HIGH)) )
{ {
//lastAirValue = airCheck; //lastAirValue = airCheck;
lastAirCloseTime = DateTime.Now; lastAirCloseTime = DateTime.Now;
...@@ -172,7 +165,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -172,7 +165,7 @@ namespace OnlineStore.DeviceLibrary
storeStatus = StoreStatus.ResetMove; storeStatus = StoreStatus.ResetMove;
//启动温湿度服务器 //启动温湿度服务器
HumitureController.Init(Config.Humiture_Port); HumitureController.Init(Config.Humiture_Port);
LineConnect.StartConnect(); // LineConnect.StartConnect();
ReturnHome(); ReturnHome();
StartTime = DateTime.Now; StartTime = DateTime.Now;
...@@ -186,11 +179,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -186,11 +179,11 @@ namespace OnlineStore.DeviceLibrary
{ {
if (suddenBtn.Equals(IO_VALUE.LOW)) if (suddenBtn.Equals(IO_VALUE.LOW))
{ {
LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:急停没开 !启动失败!"); LogUtil.error(LOGGER, " (" + Name + ")启动出现错误:急停没开 !启动失败!");
} }
else else
{ {
LogUtil.error(LOGGER, " (" + StoreName + ")启动出现错误:没有气压信号 !启动失败!"); LogUtil.error(LOGGER, " (" + Name + ")启动出现错误:没有气压信号 !启动失败!");
} }
return false; return false;
} }
...@@ -209,20 +202,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -209,20 +202,20 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
storeRunStatus = StoreRunStatus.HomeMoving; storeRunStatus = StoreRunStatus.HomeMoving;
StoreMove.NewMove(StoreMoveType.ReturnHome); MoveInfo.NewMove(StoreMoveType.ReturnHome);
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack); MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
ACAxisHomeMove(Config.InOut_Axis); ACAxisHomeMove(Config.InOut_Axis);
LogUtil.info(LOGGER, StoreName + "开始原点返回,先把进出轴回原点"); LogUtil.info(LOGGER, Name + "开始原点返回,先把进出轴回原点");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
} }
public void MoveToP1() public void MoveToP1()
{ {
//压紧轴回原点,叉子回到P1,关闭门旋转轴和升降轴回到P1 //压紧轴回原点,叉子回到P1,关闭门旋转轴和升降轴回到P1
StoreMove.NewMove(StoreMoveType.StoreReset); MoveInfo.NewMove(StoreMoveType.StoreReset);
StoreMove.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_InOutToP1); MoveInfo.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_InOutToP1);
LogUtil.info(LOGGER, StoreName + "到待机状态,进出轴到P1,判断叉子没有料盘"); LogUtil.info(LOGGER, Name + "到待机状态,进出轴到P1,判断叉子没有料盘");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed); ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
//ComBeforeHomeMove(); //ComBeforeHomeMove();
//判断叉子没有料盘 //判断叉子没有料盘
...@@ -252,28 +245,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -252,28 +245,19 @@ namespace OnlineStore.DeviceLibrary
alarmType = StoreAlarmType.None; alarmType = StoreAlarmType.None;
storeRunStatus = StoreRunStatus.Reset; storeRunStatus = StoreRunStatus.Reset;
storeStatus = StoreStatus.ResetMove; storeStatus = StoreStatus.ResetMove;
StoreMove.NewMove(StoreMoveType.StoreReset); MoveInfo.NewMove(StoreMoveType.StoreReset);
WarnMsg = ""; WarnMsg = "";
if (!RunAxis(true)) if (!RunAxis(true))
////打开四个轴 ////打开四个轴
//if (!OpenAllAxis()) //if (!OpenAllAxis())
{ {
LogUtil.info(LOGGER, StoreName + "复位时打开轴失败,需要再次复位,直接报警停止复位"); LogUtil.info(LOGGER, Name + "复位时打开轴失败,需要再次复位,直接报警停止复位");
return; return;
} }
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
InoutStartReset(); InoutStartReset();
}
else
{
LogUtil.info(LOGGER, StoreName + "开始复位:先定位气缸下降");
// 复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_LocationCylinderBack);
LocationDownAndWait();
}
isInPro = false; isInPro = false;
} }
private void InoutStartReset() private void InoutStartReset()
...@@ -281,39 +265,39 @@ namespace OnlineStore.DeviceLibrary ...@@ -281,39 +265,39 @@ namespace OnlineStore.DeviceLibrary
string portName = Config.InOut_Axis.DeviceName; string portName = Config.InOut_Axis.DeviceName;
int slvAddr = Config.InOut_Axis.GetAxisValue(); int slvAddr = Config.InOut_Axis.GetAxisValue();
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack); MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
LogUtil.info(LOGGER, StoreName + "复位中,进出轴开始原点返回"); LogUtil.info(LOGGER, Name + "复位中,进出轴开始原点返回");
ACAxisHomeMove(Config.InOut_Axis); ACAxisHomeMove(Config.InOut_Axis);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
} }
/// <summary> /// <summary>
/// 复位处理 /// 复位处理
/// </summary> /// </summary>
protected override void ResetProcess() protected override void ResetProcess()
{ {
if (StoreMove.IsInWait) if (MoveInfo.IsInWait)
{ {
CheckWait(); CheckWait();
} }
if (StoreMove.IsInWait) if (MoveInfo.IsInWait)
{ {
return; return;
} }
switch (StoreMove.MoveStep) switch (MoveInfo.MoveStep)
{ {
case StoreMoveStep.BOX_H_LocationCylinderBack: case StoreMoveStep.BOX_H_LocationCylinderBack:
InoutStartReset(); InoutStartReset();
break; break;
case StoreMoveStep.BOX_H_InOutMove: case StoreMoveStep.BOX_H_InOutMove:
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack); MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
ACAxisHomeMove(Config.InOut_Axis); ACAxisHomeMove(Config.InOut_Axis);
LogUtil.info(LOGGER, StoreName + "复位中:进出轴开始原点返回"); LogUtil.info(LOGGER, Name + "复位中:进出轴开始原点返回");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break; break;
case StoreMoveStep.BOX_H_InOutBack: case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200); Thread.Sleep(200);
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1); MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogUtil.info(LOGGER, StoreName + "复位中:进出轴到待机点P1,关闭舱门"); LogUtil.info(LOGGER, Name + "复位中:进出轴到待机点P1,关闭舱门");
//进出轴原点返回完成,将进出轴的位置设置=0 //进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear(Config.InOut_Axis); AxisCountClear(Config.InOut_Axis);
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed); ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
...@@ -329,28 +313,27 @@ namespace OnlineStore.DeviceLibrary ...@@ -329,28 +313,27 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, "进出轴报警!复位失败,请检查!"); LogUtil.error(LOGGER, "进出轴报警!复位失败,请检查!");
} }
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴 //复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogUtil.info(LOGGER, StoreName + "复位中: 压紧轴,旋转轴,上下轴开始 原点返回"); LogUtil.info(LOGGER, Name + "复位中: 压紧轴,旋转轴,上下轴开始 原点返回");
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack); MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack);
if (IsHasCompress_Axis)
{
ACAxisHomeMove(Config.Comp_Axis); ACAxisHomeMove(Config.Comp_Axis);
}
ACAxisHomeMove(Config.Middle_Axis); ACAxisHomeMove(Config.Middle_Axis);
ACAxisHomeMove(Config.UpDown_Axis); ACAxisHomeMove(Config.UpDown_Axis);
break; break;
case StoreMoveStep.BOX_H_OtherAxisBack: case StoreMoveStep.BOX_H_OtherAxisBack:
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1); MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1);
LogUtil.info(LOGGER, StoreName + "复位中:旋转轴运动到P1,上下轴走到P1,压紧轴到P1!"); LogUtil.info(LOGGER, Name + "复位中:旋转轴运动到P1,上下轴走到P1,压紧轴到P1!");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed); ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break; break;
case StoreMoveStep.BOX_H_MiddleAxisToP1: case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogUtil.info(LOGGER, StoreName + "复位完成"); LogUtil.info(LOGGER, Name + "复位完成");
storeRunStatus = StoreRunStatus.Runing; storeRunStatus = StoreRunStatus.Runing;
StoreMove.EndMove(); MoveInfo.EndMove();
storeStatus = StoreStatus.StoreOnline; storeStatus = StoreStatus.StoreOnline;
if (alarmType.Equals(StoreAlarmType.None)) if (alarmType.Equals(StoreAlarmType.None))
{ {
...@@ -359,25 +342,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -359,25 +342,24 @@ namespace OnlineStore.DeviceLibrary
break; break;
case StoreMoveStep.BOX_M_H_TOP1_InOutToP1: case StoreMoveStep.BOX_M_H_TOP1_InOutToP1:
StoreMove.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_CompressHome); MoveInfo.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_CompressHome);
LogUtil.info(LOGGER, StoreName + "到待机状态,压紧轴回原点,关闭舱门"); LogUtil.info(LOGGER, Name + "到待机状态,压紧轴回原点,关闭舱门");
if (IsHasCompress_Axis)
{
ACAxisHomeMove(Config.Comp_Axis); ACAxisHomeMove(Config.Comp_Axis);
}
//关闭舱门 //关闭舱门
CloseDoor(); CloseDoor();
break; break;
case StoreMoveStep.BOX_M_H_TOP1_CompressHome: case StoreMoveStep.BOX_M_H_TOP1_CompressHome:
StoreMove.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1); MoveInfo.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1);
LogUtil.info(LOGGER, StoreName + "复位中:旋转轴运动到P1,上下轴走到P1,压紧轴到P1!"); LogUtil.info(LOGGER, Name + "复位中:旋转轴运动到P1,上下轴走到P1,压紧轴到P1!");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed); ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break; break;
case StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1: case StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1:
LogUtil.info(LOGGER, StoreName + "到待机状态完成"); LogUtil.info(LOGGER, Name + "到待机状态完成");
StoreMove.EndMove(); MoveInfo.EndMove();
storeStatus = StoreStatus.StoreOnline; storeStatus = StoreStatus.StoreOnline;
storeRunStatus = StoreRunStatus.Runing; storeRunStatus = StoreRunStatus.Runing;
if (alarmType.Equals(StoreAlarmType.None)) if (alarmType.Equals(StoreAlarmType.None))
...@@ -391,39 +373,33 @@ namespace OnlineStore.DeviceLibrary ...@@ -391,39 +373,33 @@ namespace OnlineStore.DeviceLibrary
} }
private void ComMoveToPosition(int targetPosition, int targetSpeed) private void ComMoveToPosition(int targetPosition, int targetSpeed)
{ {
if (IsHasCompress_Axis)
{
ACAxisMove(Config.Comp_Axis, targetPosition, targetSpeed); ACAxisMove(Config.Comp_Axis, targetPosition, targetSpeed);
}
} }
public void OpenDoor(bool IsWait = true) public void OpenDoor(bool IsWait = true)
{ {
if (Config.HasDoor.Equals(1))
{
Thread.Sleep(60); Thread.Sleep(60);
IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
if (IsWait) if (IsWait)
{ {
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Down, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Down, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Up, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Up, IO_VALUE.HIGH));
} }
}
} }
public void CloseDoor(bool IsWait = true) public void CloseDoor(bool IsWait = true)
{ {
if (Config.HasDoor.Equals(1))
{
IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
if (IsWait) if (IsWait)
{ {
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Down, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Down, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Up, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Up, IO_VALUE.LOW));
} }
}
} }
/// <summary> /// <summary>
...@@ -431,27 +407,27 @@ namespace OnlineStore.DeviceLibrary ...@@ -431,27 +407,27 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
protected override void ReturnHomeProcess() protected override void ReturnHomeProcess()
{ {
if (StoreMove.IsInWait) if (MoveInfo.IsInWait)
{ {
CheckWait(); CheckWait();
} }
if (StoreMove.IsInWait) if (MoveInfo.IsInWait)
{ {
return; return;
} }
switch (StoreMove.MoveStep) switch (MoveInfo.MoveStep)
{ {
case StoreMoveStep.BOX_H_LocationCylinderBack: case StoreMoveStep.BOX_H_LocationCylinderBack:
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack); MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
LogUtil.info(LOGGER, StoreName + "原点返回中,进出轴回原点"); LogUtil.info(LOGGER, Name + "原点返回中,进出轴回原点");
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴 //复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
ACAxisHomeMove(Config.InOut_Axis); ACAxisHomeMove(Config.InOut_Axis);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break; break;
case StoreMoveStep.BOX_H_InOutBack: case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200); Thread.Sleep(200);
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1); MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogUtil.info(LOGGER, StoreName + "原点返回中,进出轴退回P1点,关闭仓门,检测叉子没有料盘"); LogUtil.info(LOGGER, Name + "原点返回中,进出轴退回P1点,关闭仓门,检测叉子没有料盘");
//进出轴原点返回完成,将进出轴的位置设置=0 //进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear(Config.InOut_Axis); AxisCountClear(Config.InOut_Axis);
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed); ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
...@@ -469,27 +445,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -469,27 +445,26 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, "进出轴报警!复位失败,请检查!"); LogUtil.error(LOGGER, "进出轴报警!复位失败,请检查!");
} }
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴 //复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogUtil.info(LOGGER, StoreName + "原点返回中 :压紧轴,旋转轴,上下轴开始原点返回"); LogUtil.info(LOGGER, Name + "原点返回中 :压紧轴,旋转轴,上下轴开始原点返回");
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack); MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack);
if (IsHasCompress_Axis)
{
ACAxisHomeMove(Config.Comp_Axis); ACAxisHomeMove(Config.Comp_Axis);
}
ACAxisHomeMove(Config.Middle_Axis); ACAxisHomeMove(Config.Middle_Axis);
ACAxisHomeMove(Config.UpDown_Axis); ACAxisHomeMove(Config.UpDown_Axis);
break; break;
case StoreMoveStep.BOX_H_OtherAxisBack: case StoreMoveStep.BOX_H_OtherAxisBack:
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1); MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1);
LogUtil.info(LOGGER, StoreName + "回原点:旋转轴运动到P1,上下轴到P1,压紧轴到P1!"); LogUtil.info(LOGGER, Name + "回原点:旋转轴运动到P1,上下轴到P1,压紧轴到P1!");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed); ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break; break;
case StoreMoveStep.BOX_H_MiddleAxisToP1: case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogUtil.info(LOGGER, StoreName + "回原点完成"); LogUtil.info(LOGGER, Name + "回原点完成");
storeRunStatus = StoreRunStatus.Runing; storeRunStatus = StoreRunStatus.Runing;
StoreMove.EndMove(); MoveInfo.EndMove();
storeStatus = StoreStatus.StoreOnline; storeStatus = StoreStatus.StoreOnline;
WarnMsg = ""; WarnMsg = "";
break; break;
...@@ -544,27 +519,27 @@ namespace OnlineStore.DeviceLibrary ...@@ -544,27 +519,27 @@ namespace OnlineStore.DeviceLibrary
{ {
if (ACServerManager.ServerOnStatus(axis.DeviceName, axis.GetAxisValue())) if (ACServerManager.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
{ {
LogUtil.info(LOGGER, StoreName + "成功打开轴:" + axis.Explain); LogUtil.info(LOGGER, Name + "成功打开轴:" + axis.Explain);
} }
else else
{ {
//清理报警,再重新打开一次 //清理报警,再重新打开一次
LogUtil.info(LOGGER, StoreName + "第一次打开轴" + axis.Explain + "失败,先清理一下报警,再重新打开一次"); LogUtil.info(LOGGER, Name + "第一次打开轴" + axis.Explain + "失败,先清理一下报警,再重新打开一次");
ACServerManager.AlarmClear(axis.DeviceName, axis.GetAxisValue()); ACServerManager.AlarmClear(axis.DeviceName, axis.GetAxisValue());
System.Threading.Thread.Sleep(1200); System.Threading.Thread.Sleep(1200);
ACServerManager.ServoOn(axis.DeviceName, axis.GetAxisValue()); ACServerManager.ServoOn(axis.DeviceName, axis.GetAxisValue());
System.Threading.Thread.Sleep(100); System.Threading.Thread.Sleep(100);
if (ACServerManager.ServerOnStatus(axis.DeviceName, axis.GetAxisValue())) if (ACServerManager.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
{ {
LogUtil.info(LOGGER, StoreName + "清理报警后重新打卡轴成功:" + axis.Explain); LogUtil.info(LOGGER, Name + "清理报警后重新打卡轴成功:" + axis.Explain);
} }
else else
{ {
ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue()); ACServerManager.ServoOff(axis.DeviceName, axis.GetAxisValue());
int alarmCode = GetAlarmCodeByAxis(axis); int alarmCode = GetAlarmCodeByAxis(axis);
WarnMsg = StoreName + "打开轴" + axis.Explain + "失败 "; WarnMsg = Name + "打开轴" + axis.Explain + "失败 ";
LogUtil.info(LOGGER, StoreName + WarnMsg); LogUtil.info(LOGGER, Name + WarnMsg);
Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axis).ToString(), WarnMsg, StoreMove.MoveType); Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axis).ToString(), WarnMsg, MoveInfo.MoveType);
return false; return false;
} }
} }
...@@ -574,7 +549,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -574,7 +549,7 @@ namespace OnlineStore.DeviceLibrary
public void CloseAllAxis() public void CloseAllAxis()
{ {
LogUtil.info(StoreName + "关闭刹车,关闭伺服"); LogUtil.info(Name + "关闭刹车,关闭伺服");
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
foreach (ConfigMoveAxis axis in moveAxisList) foreach (ConfigMoveAxis axis in moveAxisList)
{ {
...@@ -618,21 +593,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -618,21 +593,17 @@ namespace OnlineStore.DeviceLibrary
autoNext = false; autoNext = false;
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
serverConnectTimer.Enabled = false; serverConnectTimer.Enabled = false;
StopMove(true); StopMove( );
storeRunStatus = StoreRunStatus.Wait; storeRunStatus = StoreRunStatus.Wait;
mainTimer.Enabled = false; mainTimer.Enabled = false;
TimeSpan span = DateTime.Now - StartTime; TimeSpan span = DateTime.Now - StartTime;
IsRun = false; IsRun = false;
LineConnect.StopConnect(); //LineConnect.StopConnect();
IOManager.instance.CloseAllDO(); IOManager.instance.CloseAllDO();
if (IsHasCompress_Axis)
{ LogUtil.info(LOGGER, Name + ",停止运行,总运行时间:" + span.ToString());
//ShuoKeControls.ClosePort();
}
LogUtil.info(LOGGER, StoreName + ",停止运行,总运行时间:" + span.ToString());
} }
public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType) public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType)
...@@ -644,31 +615,31 @@ namespace OnlineStore.DeviceLibrary ...@@ -644,31 +615,31 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
LogUtil.error(LOGGER, StoreName + " 报警,报警类型:" + alarmType); LogUtil.error(LOGGER, Name + " 报警,报警类型:" + alarmType);
this.alarmType = alarmType; this.alarmType = alarmType;
if (alarmType.Equals(StoreAlarmType.AxisAlarm) | alarmType.Equals(StoreAlarmType.AxisMoveError)) if (alarmType.Equals(StoreAlarmType.AxisAlarm) | alarmType.Equals(StoreAlarmType.AxisMoveError))
{ {
LogUtil.error(LOGGER, StoreName + "轴报警,关闭刹车,停止运动,关闭轴,打开报警灯"); LogUtil.error(LOGGER, Name + "轴报警,关闭刹车,停止运动,关闭轴,打开报警灯");
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
StopMove(true); StopMove( );
} }
else if (alarmType == StoreAlarmType.SuddenStop) else if (alarmType == StoreAlarmType.SuddenStop)
{ {
isInSuddenDown = true; isInSuddenDown = true;
LogUtil.error(LOGGER, StoreName + "收到急停信号,关闭刹车,停止运动,关闭轴,打开报警灯 "); LogUtil.error(LOGGER, Name + "收到急停信号,关闭刹车,停止运动,关闭轴,打开报警灯 ");
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
StoreMove.EndMove(); MoveInfo.EndMove();
StopMove(true); StopMove( );
storeStatus = StoreStatus.SuddenStop; storeStatus = StoreStatus.SuddenStop;
} }
else if (alarmType.Equals(StoreAlarmType.NoAirCheck)) else if (alarmType.Equals(StoreAlarmType.NoAirCheck))
{ {
isNoAirCheck = true; isNoAirCheck = true;
LogUtil.error(LOGGER, StoreName + " 未检测到气压信号 ,打开刹车,停止运动,关闭轴,打开报警灯 "); LogUtil.error(LOGGER, Name + " 未检测到气压信号 ,打开刹车,停止运动,关闭轴,打开报警灯 ");
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
StoreMove.EndMove(); MoveInfo.EndMove();
StopMove(true); StopMove( );
storeStatus = StoreStatus.SuddenStop; storeStatus = StoreStatus.SuddenStop;
} }
} }
...@@ -710,7 +681,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -710,7 +681,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LOGGER.Error(StoreName + "定时处理出错:" + ex.ToString()); LOGGER.Error(Name + "定时处理出错:" + ex.ToString());
} }
IsChongfu = false; IsChongfu = false;
InProcess = false; InProcess = false;
...@@ -718,11 +689,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -718,11 +689,8 @@ namespace OnlineStore.DeviceLibrary
private IO_VALUE preAirValue = IO_VALUE.HIGH; private IO_VALUE preAirValue = IO_VALUE.HIGH;
private void AirCheckProcess() private void AirCheckProcess()
{ {
if (Config.HasDoor.Equals(0))
{ IO_VALUE currAirValue = IOValue(IO_Type.Airpressure_Check);
return;
}
IO_VALUE currAirValue = IOManager.IOValue(IO_Type.Airpressure_Check);
if (isInSuddenDown) if (isInSuddenDown)
{ {
return; return;
...@@ -797,13 +765,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -797,13 +765,13 @@ namespace OnlineStore.DeviceLibrary
{ {
isNeedAlarmLed = true; isNeedAlarmLed = true;
} }
if (isNeedAlarmLed && IOManager.IOValue(IO_Type.Alarm_HddLed).Equals(IO_VALUE.LOW)) if (isNeedAlarmLed && IOValue(IO_Type.Alarm_HddLed).Equals(IO_VALUE.LOW))
{ {
IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.HIGH);
} }
else else
{ {
if (IOManager.IOValue(IO_Type.Alarm_HddLed).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.Alarm_HddLed).Equals(IO_VALUE.HIGH))
{ {
IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
} }
...@@ -813,11 +781,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -813,11 +781,11 @@ namespace OnlineStore.DeviceLibrary
//报警时绿灯和黄灯灭 //报警时绿灯和黄灯灭
if (isNeedAlarmLed) if (isNeedAlarmLed)
{ {
if (IOManager.IOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.HIGH))
{ {
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
} }
if (IOManager.IOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH))
{ {
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
} }
...@@ -825,9 +793,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -825,9 +793,9 @@ namespace OnlineStore.DeviceLibrary
} }
//绿灯闪 //绿灯闪
if ((StoreMove.MoveType.Equals(StoreMoveType.InStore) || StoreMove.MoveType.Equals(StoreMoveType.OutStore) if ((MoveInfo.MoveType.Equals(StoreMoveType.InStore) || MoveInfo.MoveType.Equals(StoreMoveType.OutStore)
|| storeRunStatus.Equals(StoreRunStatus.HomeMoving) || storeRunStatus.Equals(StoreRunStatus.Reset)) || storeRunStatus.Equals(StoreRunStatus.HomeMoving) || storeRunStatus.Equals(StoreRunStatus.Reset))
&& IOManager.IOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.HIGH)) && IOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.HIGH))
{ {
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
} }
...@@ -837,9 +805,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -837,9 +805,9 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
} }
//黄灯 //黄灯
if (StoreMove.MoveType.Equals(StoreMoveType.InStore) || StoreMove.MoveType.Equals(StoreMoveType.OutStore) || TempOrHumidityIsAlarm || isTemp30M) if (MoveInfo.MoveType.Equals(StoreMoveType.InStore) || MoveInfo.MoveType.Equals(StoreMoveType.OutStore) || TempOrHumidityIsAlarm || isTemp30M)
{ {
if (IOManager.IOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH))
{ {
IOManager.IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
} }
...@@ -850,7 +818,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -850,7 +818,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
if (IOManager.IOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH))
{ {
IOManager.IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
} }
...@@ -858,7 +826,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -858,7 +826,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LOGGER.Error(StoreName + "灯处理定时器出错:", ex); LOGGER.Error(Name + "灯处理定时器出错:", ex);
} }
} }
private IO_VALUE lastAutoRun = IO_VALUE.LOW; private IO_VALUE lastAutoRun = IO_VALUE.LOW;
...@@ -869,13 +837,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -869,13 +837,13 @@ namespace OnlineStore.DeviceLibrary
if (storeRunStatus.Equals(StoreRunStatus.Wait)) if (storeRunStatus.Equals(StoreRunStatus.Wait))
{ {
//取新的Io状态 //取新的Io状态
IO_VALUE autoSingle = IOManager.IOValue(IO_Type.Reset_BTN); IO_VALUE autoSingle = IOValue(IO_Type.Reset_BTN);
if (ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun).Equals(1)) if (ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun).Equals(1))
{ {
if (autoSingle.Equals(IO_VALUE.HIGH) && lastAutoRun.Equals(IO_VALUE.LOW)) if (autoSingle.Equals(IO_VALUE.HIGH) && lastAutoRun.Equals(IO_VALUE.LOW))
{ {
//没有启动时收到复位按钮,相当于启动按钮 //没有启动时收到复位按钮,相当于启动按钮
LogUtil.info(LOGGER, StoreName + "没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!"); LogUtil.info(LOGGER, Name + "没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!");
bool result = StartRun(); bool result = StartRun();
if (result.Equals(false)) if (result.Equals(false))
{ {
...@@ -892,8 +860,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -892,8 +860,8 @@ namespace OnlineStore.DeviceLibrary
else if (storeRunStatus >= StoreRunStatus.HomeMoving) else if (storeRunStatus >= StoreRunStatus.HomeMoving)
{ {
//取新的Io状态 //取新的Io状态
IO_VALUE suddenBtn = IOManager.IOValue(IO_Type.SuddenStop_BTN); IO_VALUE suddenBtn = IOValue(IO_Type.SuddenStop_BTN);
IO_VALUE resetBtn = IOManager.IOValue(IO_Type.Reset_BTN); IO_VALUE resetBtn = IOValue(IO_Type.Reset_BTN);
//急停按钮 //急停按钮
if (suddenBtn.Equals(IO_VALUE.LOW)) if (suddenBtn.Equals(IO_VALUE.LOW))
...@@ -905,14 +873,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -905,14 +873,14 @@ namespace OnlineStore.DeviceLibrary
//收到复位信号,若报警直接复位,若不报警且无操作,回到待机点 //收到复位信号,若报警直接复位,若不报警且无操作,回到待机点
if (alarmType.Equals(StoreAlarmType.None) && isInSuddenDown.Equals(false) && isNoAirCheck.Equals(false)) if (alarmType.Equals(StoreAlarmType.None) && isInSuddenDown.Equals(false) && isNoAirCheck.Equals(false))
{ {
if (StoreMove.MoveType.Equals(StoreMoveType.None)) if (MoveInfo.MoveType.Equals(StoreMoveType.None))
{ {
LogUtil.info(LOGGER, "收到复位信号,当前无报警,且空闲中,只回到待机点"); LogUtil.info(LOGGER, "收到复位信号,当前无报警,且空闲中,只回到待机点");
MoveToP1(); MoveToP1();
} }
else else
{ {
LogUtil.info(LOGGER, "收到复位信号,当前无报警, 在" + StoreMove.MoveType + "处理中,不处理复位"); LogUtil.info(LOGGER, "收到复位信号,当前无报警, 在" + MoveInfo.MoveType + "处理中,不处理复位");
} }
} }
else else
...@@ -932,7 +900,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -932,7 +900,7 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
DateTime time = DateTime.Now; DateTime time = DateTime.Now;
if (StoreMove.MoveType != StoreMoveType.None) if (MoveInfo.MoveType != StoreMoveType.None)
{ {
BusyMoveProcess(); BusyMoveProcess();
ShowTimeLog("BusyMoveProcess"); ShowTimeLog("BusyMoveProcess");
...@@ -950,7 +918,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -950,7 +918,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LOGGER.Error(StoreName + "定时处理出错", ex); LOGGER.Error(Name + "定时处理出错", ex);
} }
} }
...@@ -981,9 +949,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -981,9 +949,9 @@ namespace OnlineStore.DeviceLibrary
} }
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过 //若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
if (StoreMove.IsInWait == false) if (MoveInfo.IsInWait == false)
{ {
LogUtil.info(StoreName + "之前有IO超时异常【" + alarmInfo.alarmDetail + "】,但是当前已经没有在等待中,清理信号超时异常!"); LogUtil.info(Name + "之前有IO超时异常【" + alarmInfo.alarmDetail + "】,但是当前已经没有在等待中,清理信号超时异常!");
alarmType = StoreAlarmType.None; alarmType = StoreAlarmType.None;
WarnMsg = ""; WarnMsg = "";
} }
...@@ -1002,31 +970,33 @@ namespace OnlineStore.DeviceLibrary ...@@ -1002,31 +970,33 @@ namespace OnlineStore.DeviceLibrary
{ {
try try
{ {
bool noInStore = LineConnect.WaitInStoreList.Count <= 0; // bool noInStore = LineConnect.WaitInStoreList.Count <= 0;
bool noInStore = true;
if (CurrInOutACount >= this.Config.Box_ResetACount &&noInStore) if (CurrInOutACount >= this.Config.Box_ResetACount &&noInStore)
{ {
if (storeRunStatus < StoreRunStatus.Runing || StoreMove.MoveType == StoreMoveType.InStore || StoreMove.MoveType == StoreMoveType.OutStore) if (storeRunStatus < StoreRunStatus.Runing || MoveInfo.MoveType == StoreMoveType.InStore || MoveInfo.MoveType == StoreMoveType.OutStore)
{ {
LogUtil.info(LOGGER, StoreName + "已经累计出入库" + CurrInOutACount + "次,当时当前正在忙碌中暂不复位"); LogUtil.info(LOGGER, Name + "已经累计出入库" + CurrInOutACount + "次,当时当前正在忙碌中暂不复位");
} }
else else
{ {
LogUtil.info(LOGGER, StoreName + "已经累计出入库" + CurrInOutACount + "次,需要复位一下"); LogUtil.info(LOGGER, Name + "已经累计出入库" + CurrInOutACount + "次,需要复位一下");
Reset(); Reset();
} }
} }
else if (CurrInOutCount >= this.Config.Box_ResetMCount && noInStore) else if (CurrInOutCount >= this.Config.Box_ResetMCount && noInStore)
{ {
if (storeRunStatus < StoreRunStatus.Runing || StoreMove.MoveType == StoreMoveType.InStore || StoreMove.MoveType == StoreMoveType.OutStore) if (storeRunStatus < StoreRunStatus.Runing || MoveInfo.MoveType == StoreMoveType.InStore || MoveInfo.MoveType == StoreMoveType.OutStore)
{ {
LogUtil.info(LOGGER, StoreName + "已经累计出入库" + CurrInOutCount + "次,当时当前正在忙碌中暂不复位旋转轴"); LogUtil.info(LOGGER, Name + "已经累计出入库" + CurrInOutCount + "次,当时当前正在忙碌中暂不复位旋转轴");
} }
else else
{ {
LogUtil.info(LOGGER, StoreName + "已经累计出入库" + CurrInOutCount + "次,需要复位一下旋转轴"); LogUtil.info(LOGGER, Name + "已经累计出入库" + CurrInOutCount + "次,需要复位一下旋转轴");
} }
} }
else if (LineConnect.CanStartOut() || IsDebug) //else if (LineConnect.CanStartOut() || IsDebug)
else if ( IsDebug)
{ {
FixtureCodeInfo currInOutFixture = null; FixtureCodeInfo currInOutFixture = null;
lock (waitOutListLock) lock (waitOutListLock)
...@@ -1040,11 +1010,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -1040,11 +1010,11 @@ namespace OnlineStore.DeviceLibrary
if (currInOutFixture != null) if (currInOutFixture != null)
{ //出库 { //出库
LogUtil.info(LOGGER, StoreName + "开始执行排队中的出库【" + currInOutFixture.ToStr() + "】"); LogUtil.info(LOGGER, Name + "开始执行排队中的出库【" + currInOutFixture.ToStr() + "】");
bool result = StartOutStoreMove(new InOutStoreParam("", currInOutFixture.PosId, currInOutFixture.plateH, currInOutFixture.plateW)); bool result = StartOutStoreMove(new InOutParam("", currInOutFixture.PosId, currInOutFixture.plateH, currInOutFixture.plateW));
if (!result) if (!result)
{ {
LogUtil.info(LOGGER, StoreName + " 执行排队中的出库【" + currInOutFixture.ToStr() + "】失败,重新加入等待队列"); LogUtil.info(LOGGER, Name + " 执行排队中的出库【" + currInOutFixture.ToStr() + "】失败,重新加入等待队列");
AddWaitOutInfo(currInOutFixture); AddWaitOutInfo(currInOutFixture);
} }
} }
...@@ -1097,7 +1067,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1097,7 +1067,7 @@ namespace OnlineStore.DeviceLibrary
if (alarmIo == 1) if (alarmIo == 1)
{ {
WarnMsg = StoreName + " 运动轴" + axisInfo.Explain + "报警"; WarnMsg = Name + " 运动轴" + axisInfo.Explain + "报警";
info.AlarmIoValue = alarmIo; info.AlarmIoValue = alarmIo;
Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), WarnMsg, StoreMoveType.None); Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axisInfo).ToString(), WarnMsg, StoreMoveType.None);
isInAlarm = true; isInAlarm = true;
...@@ -1106,7 +1076,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1106,7 +1076,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (!info.AlarmIoValue.Equals(alarmIo)) if (!info.AlarmIoValue.Equals(alarmIo))
{ {
LogUtil.error(LOGGER, StoreName + " 运动轴 " + axisInfo.Explain + ",报警已解除!"); LogUtil.error(LOGGER, Name + " 运动轴 " + axisInfo.Explain + ",报警已解除!");
info.AlarmIoValue = alarmIo; info.AlarmIoValue = alarmIo;
} }
} }
...@@ -1119,7 +1089,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1119,7 +1089,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 停止所有运行 /// 停止所有运行
/// </summary> /// </summary>
public override void StopMove(bool IsCloseAxis) public override void StopMove( )
{ {
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
...@@ -1127,26 +1097,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -1127,26 +1097,13 @@ namespace OnlineStore.DeviceLibrary
ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue()); ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue()); ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()); ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
if (IsHasCompress_Axis)
{
ACServerManager.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue()); ACServerManager.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue());
//ShuoKeControls.SuddownStop(Config.CompressAxis_Slv);
}
else
{
if (Config.IsHasLocationCylinder >= 1)
{
//定位气缸停止
IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.LOW);
}
}
if (IsCloseAxis)
{
CloseAllAxis(); CloseAllAxis();
}
LogUtil.info(LOGGER, StoreName + "StopMove"); LogUtil.info(LOGGER, Name + "StopMove");
IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
...@@ -1186,7 +1143,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1186,7 +1143,7 @@ namespace OnlineStore.DeviceLibrary
string[] posArray = posId.Split('#'); string[] posArray = posId.Split('#');
if (!(posArray.Length == 2)) if (!(posArray.Length == 2))
{ {
WarnMsg = StoreName + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"; WarnMsg = Name + "入库库位格式错误:二维码【" + message + "】库位【" + posId + "】";
LogUtil.error(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"); LogUtil.error(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
LogUtil.info(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"); LogUtil.info(LOGGER, "服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
return; return;
...@@ -1205,14 +1162,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -1205,14 +1162,14 @@ namespace OnlineStore.DeviceLibrary
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器; //TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if (CanStarInOut()) if (CanStarInOut())
{ {
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW); InOutParam param = new InOutParam(message, posId, plateH, plateW);
StartInStoreMove(param); StartInStoreMove(param);
//如果当前正在出入库中,需要记录下来,等待空闲时执行 //如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(LOGGER, StoreName + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 开始入库!"); LogUtil.info(LOGGER, Name + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 开始入库!");
} }
else else
{ {
LogUtil.info(LOGGER, StoreName + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!"); LogUtil.info(LOGGER, Name + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
} }
} }
...@@ -1235,7 +1192,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1235,7 +1192,7 @@ namespace OnlineStore.DeviceLibrary
//发送扫码内容到服务器进行入库操作 //发送扫码内容到服务器进行入库操作
Operation operation = getLineBoxStatus(); Operation operation = getLineBoxStatus();
operation.op = 1; operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", StoreID.ToString() } }; operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", DeviceID.ToString() } };
operation.data.Add("inPos", posId); operation.data.Add("inPos", posId);
string server = ConfigAppSettings.GetValue(Setting_Init.http_server); string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false); Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false);
...@@ -1266,19 +1223,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -1266,19 +1223,19 @@ namespace OnlineStore.DeviceLibrary
public void ReviceLineInStoreCMD(string posId, string plateH, string plateW, string message) public void ReviceLineInStoreCMD(string posId, string plateH, string plateW, string message)
{ {
string logName = "流水线入库命令【 " + message + "】【" + posId + "】:"; string logName = "流水线入库命令【 " + message + "】【" + posId + "】:";
if (!LineConnect.WaitInStoreList.Contains(posId)) //if (!LineConnect.WaitInStoreList.Contains(posId))
{ //{
LogUtil.error(logName + "库位未验证通过,重新验证库位"); // LogUtil.error(logName + "库位未验证通过,重新验证库位");
bool result = ReviceLineCheckInStoreCMD(posId, plateH, plateW, message); // bool result = ReviceLineCheckInStoreCMD(posId, plateH, plateW, message);
if (!result) // if (!result)
{ // {
return; // return;
} // }
} //}
else //else
{ //{
LineConnect.WaitInStoreList.Remove(posId); // //LineConnect.WaitInStoreList.Remove(posId);
} //}
//根据发送的posId获取位置列表 //根据发送的posId获取位置列表
ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(posId); ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(posId);
if (position == null) if (position == null)
...@@ -1291,7 +1248,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1291,7 +1248,7 @@ namespace OnlineStore.DeviceLibrary
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器; //TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if (CanStarInOut()) if (CanStarInOut())
{ {
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW); InOutParam param = new InOutParam(message, posId, plateH, plateW);
LogUtil.info(logName + " 开始入库!"); LogUtil.info(logName + " 开始入库!");
StartInStoreMove(param); StartInStoreMove(param);
//如果当前正在出入库中,需要记录下来,等待空闲时执行 //如果当前正在出入库中,需要记录下来,等待空闲时执行
...@@ -1421,7 +1378,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1421,7 +1378,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LOGGER.Error(StoreName + "HumidityProcess出错:" + ex.ToString()); LOGGER.Error(Name + "HumidityProcess出错:" + ex.ToString());
} }
} }
private void HTAlarm() private void HTAlarm()
...@@ -1448,17 +1405,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -1448,17 +1405,17 @@ namespace OnlineStore.DeviceLibrary
isInProcess = true; isInProcess = true;
try try
{ {
if (LineConnect.IsConnect()) //if (LineConnect.IsConnect())
{ //{
int hasTray = (int)IOManager.IOValue(IO_Type.TrayCheck_Door); // int hasTray = (int)IOValue(IO_Type.TrayCheck_Door);
int ss = (int)storeStatus; // int ss = (int)storeStatus;
if (IsDebug) // if (IsDebug)
{ // {
ss = (int)StoreStatus.Debugging; // ss = (int)StoreStatus.Debugging;
} // }
StoreSendBean store=new StoreSendBean(Config.Id,Config.CID, (int)ss, (int)storeRunStatus, hasTray, (int)alarmType); // StoreSendBean store=new StoreSendBean(Config.Id,Config.CID, (int)ss, (int)storeRunStatus, hasTray, (int)alarmType);
LineConnect.SendHeart(store); // LineConnect.SendHeart(store);
} //}
if (StoreManager.IsConnectServer) if (StoreManager.IsConnectServer)
{ {
try try
...@@ -1517,7 +1474,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1517,7 +1474,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (CodeMsg.Equals("")) if (CodeMsg.Equals(""))
{ {
if (storeRunStatus.Equals(StoreRunStatus.Runing) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (storeRunStatus.Equals(StoreRunStatus.Runing) && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
boxStatus.msg = "叉子料盘检测有料,请检查"; boxStatus.msg = "叉子料盘检测有料,请检查";
lineOperation.msg = "叉子料盘检测有料,请检查"; lineOperation.msg = "叉子料盘检测有料,请检查";
...@@ -1541,20 +1498,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -1541,20 +1498,20 @@ namespace OnlineStore.DeviceLibrary
boxStatus.status = (int)lastPosIdStatus; boxStatus.status = (int)lastPosIdStatus;
if (lastPosId != "") if (lastPosId != "")
{ {
LogUtil.info(LOGGER, "给服务器发送出入库完成消息:" + StoreName + ",status【" + lastPosIdStatus + "】posId【" + lastPosId + "】"); LogUtil.info(LOGGER, "给服务器发送出入库完成消息:" + Name + ",status【" + lastPosIdStatus + "】posId【" + lastPosId + "】");
} }
lastPosId = ""; lastPosId = "";
} }
//如果在空闲中,且有入库未完成,直接发送入库执行中 ////如果在空闲中,且有入库未完成,直接发送入库执行中
if (boxStatus.status.Equals((int)StoreStatus.StoreOnline)) //if (boxStatus.status.Equals((int)StoreStatus.StoreOnline))
{ //{
List<string> list = new List<string>(LineConnect.WaitInStoreList); // List<string> list = new List<string>(LineConnect.WaitInStoreList);
if (list.Count > 0 && (LineConnect.CanStartOut().Equals(false))) // if (list.Count > 0 && (LineConnect.CanStartOut().Equals(false)))
{ // {
boxStatus.status = (int)StoreStatus.InStoreExecute; // boxStatus.status = (int)StoreStatus.InStoreExecute;
} // }
} //}
//温湿度 //温湿度
...@@ -1583,7 +1540,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1583,7 +1540,7 @@ namespace OnlineStore.DeviceLibrary
if (Max_Humidity <= 0 || (Max_Temperature <= 0)) if (Max_Humidity <= 0 || (Max_Temperature <= 0))
{ {
lineOperation.op = 5; lineOperation.op = 5;
LogUtil.info(LOGGER, StoreName + "没有湿度预警范围,需要从服务器获取,发送OP=" + lineOperation.op); LogUtil.info(LOGGER, Name + "没有湿度预警范围,需要从服务器获取,发送OP=" + lineOperation.op);
} }
string server = ConfigAppSettings.GetValue(Setting_Init.http_server); string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), lineOperation, false); Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), lineOperation, false);
...@@ -1613,7 +1570,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1613,7 +1570,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - time; TimeSpan span = DateTime.Now - time;
if (span.TotalMilliseconds > 10) if (span.TotalMilliseconds > 10)
{ {
LogUtil.info(StoreName + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒"); LogUtil.info(Name + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒");
} }
} }
private void ProcessHumidityCMD(Operation resultOperation) private void ProcessHumidityCMD(Operation resultOperation)
...@@ -1662,7 +1619,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1662,7 +1619,7 @@ namespace OnlineStore.DeviceLibrary
string[] posArray = posId.Split('#'); string[] posArray = posId.Split('#');
if (posArray.Length != 2) if (posArray.Length != 2)
{ {
WarnMsg = StoreName + "出库格式错误:库位号【" + posId + "】"; WarnMsg = Name + "出库格式错误:库位号【" + posId + "】";
LogUtil.error(LOGGER, "收到服务器出库命令:库位号【" + posId + "】格式错误"); LogUtil.error(LOGGER, "收到服务器出库命令:库位号【" + posId + "】格式错误");
continue; continue;
} }
...@@ -1673,7 +1630,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1673,7 +1630,7 @@ namespace OnlineStore.DeviceLibrary
if (position == null) if (position == null)
{ {
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因 //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = StoreName + "出库未找库位:【" + posId + "】"; WarnMsg = Name + "出库未找库位:【" + posId + "】";
LogUtil.error(LOGGER, "收到服务器出库命令:未找到【" + posId + "】的库位信息"); LogUtil.error(LOGGER, "收到服务器出库命令:未找到【" + posId + "】的库位信息");
continue; continue;
} }
...@@ -1684,9 +1641,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -1684,9 +1641,9 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
//判断是否接收过此库位的出库信息 //判断是否接收过此库位的出库信息
if (StoreMove.MoveType.Equals(StoreMoveType.OutStore) && StoreMove.MoveParam.PositionNum.Equals(posId)) if (MoveInfo.MoveType.Equals(StoreMoveType.OutStore) && MoveInfo.MoveParam.PositionNum.Equals(posId))
{ {
LogUtil.info(LOGGER, StoreName + " 收到出库【" + currInOutFixture.ToStr() + "】重复,当前已在【" + posId + "】出库中"); LogUtil.info(LOGGER, Name + " 收到出库【" + currInOutFixture.ToStr() + "】重复,当前已在【" + posId + "】出库中");
continue; continue;
} }
else else
...@@ -1696,7 +1653,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1696,7 +1653,7 @@ namespace OnlineStore.DeviceLibrary
reviceList = (from m in reviceList where m.PosId.Equals(posId) select m).ToList<FixtureCodeInfo>(); reviceList = (from m in reviceList where m.PosId.Equals(posId) select m).ToList<FixtureCodeInfo>();
if (reviceList.Count > 0) if (reviceList.Count > 0)
{ {
LogUtil.info(LOGGER, StoreName + " 收到出库【" + currInOutFixture.ToStr() + "】重复,排队列表中已存在【" + reviceList[0].ToStr() + "】"); LogUtil.info(LOGGER, Name + " 收到出库【" + currInOutFixture.ToStr() + "】重复,排队列表中已存在【" + reviceList[0].ToStr() + "】");
continue; continue;
} }
} }
...@@ -1705,12 +1662,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -1705,12 +1662,13 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("验证出库【" + currInOutFixture.ToStr() + "】是否重复出错:"+ex.ToString()); LogUtil.error("验证出库【" + currInOutFixture.ToStr() + "】是否重复出错:"+ex.ToString());
} }
if (CanStarInOut() &&( LineConnect.CanStartOut()||IsDebug)) if (CanStarInOut() )
//if (CanStarInOut() &&( LineConnect.CanStartOut()||IsDebug))
{ {
bool result = StartOutStoreMove(new InOutStoreParam("", posId, plateW,plateH)); bool result = StartOutStoreMove(new InOutParam("", posId, plateW,plateH));
if (!result) if (!result)
{ {
LogUtil.info(LOGGER, StoreName + " 执行出库【" + currInOutFixture.ToStr() + "】失败,加入等待队列"); LogUtil.info(LOGGER, Name + " 执行出库【" + currInOutFixture.ToStr() + "】失败,加入等待队列");
AddWaitOutInfo(currInOutFixture); AddWaitOutInfo(currInOutFixture);
} }
} }
...@@ -1725,7 +1683,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1725,7 +1683,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - time; TimeSpan span = DateTime.Now - time;
if (span.TotalMilliseconds > 10) if (span.TotalMilliseconds > 10)
{ {
LogUtil.info(StoreName + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒"); LogUtil.info(Name + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒");
} }
} }
} }
......
...@@ -8,7 +8,7 @@ using System.Threading; ...@@ -8,7 +8,7 @@ using System.Threading;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
partial class AC_SA_BoxBean partial class AC_BOX_Bean
{ {
#region 自动出入库参数 #region 自动出入库参数
...@@ -36,7 +36,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -36,7 +36,7 @@ namespace OnlineStore.DeviceLibrary
private int CurrInOutCount = 0; private int CurrInOutCount = 0;
private int CurrInOutACount = 0; private int CurrInOutACount = 0;
private bool LoadParamPosition(InOutStoreParam param) private bool LoadParamPosition(InOutParam param)
{ {
if (param == null) if (param == null)
{ {
...@@ -49,7 +49,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -49,7 +49,7 @@ namespace OnlineStore.DeviceLibrary
ACStorePosition position = param.GetACPosition(); ACStorePosition position = param.GetACPosition();
if (position == null) if (position == null)
{ {
LogUtil.error(LOGGER, StoreName + "出入库时发现param中取到的Position=null,没有库位不能执行出入库"); LogUtil.error(LOGGER, Name + "出入库时发现param中取到的Position=null,没有库位不能执行出入库");
return false; return false;
} }
...@@ -107,17 +107,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -107,17 +107,17 @@ namespace OnlineStore.DeviceLibrary
private void CheckWait() private void CheckWait()
{ {
List<WaitResultInfo> list = StoreMove.WaitList; List<WaitResultInfo> list = MoveInfo.WaitList;
//当等待超过一分钟时,需要打印提示 //当等待超过一分钟时,需要打印提示
TimeSpan span = DateTime.Now - StoreMove.LastSetpTime; TimeSpan span = DateTime.Now - MoveInfo.LastSetpTime;
string NotOkMsg = ""; string NotOkMsg = "";
if (list.Count <= 0) if (list.Count <= 0)
{ {
StoreMove.EndStepWait(); MoveInfo.EndStepWait();
return; return;
} }
bool isOk = true; bool isOk = true;
if (StoreMove.OneWaitCanEndStep) if (MoveInfo.OneWaitCanEndStep)
{ {
isOk = false; isOk = false;
} }
...@@ -143,32 +143,32 @@ namespace OnlineStore.DeviceLibrary ...@@ -143,32 +143,32 @@ namespace OnlineStore.DeviceLibrary
{ {
isOk = false; isOk = false;
WarnMsg = msg; WarnMsg = msg;
Alarm(StoreAlarmType.AxisMoveError, GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType); Alarm(StoreAlarmType.AxisMoveError, GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, MoveInfo.MoveType);
break; break;
} }
} }
else if (wait.WaitType == 2) else if (wait.WaitType == 2)
{ {
wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue); wait.IsEnd = IOValue(wait.IoType).Equals(wait.IoValue);
int timeOutMs = Config.IOSingle_TimerOut; int timeOutMs = Config.IOSingle_TimerOut;
if (StoreMove.MoveStep .Equals( StoreMoveStep.SO_14_WaitTake)) if (MoveInfo.MoveStep .Equals( StoreMoveStep.SO_14_WaitTake))
{ {
timeOutMs = 650000; timeOutMs = 650000;
} }
if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs) if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
{ {
ConfigIO io = Config.getWaitIO(wait.IoType); ConfigIO io = Config.getWaitIO(wait.IoType);
WarnMsg = StoreName + " 等待信号" + io.DisplayStr + "=" + wait.IoValue + "超时!"; WarnMsg = Name + " 等待信号" + io.DisplayStr + "=" + wait.IoValue + "超时!";
Alarm(StoreAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType); Alarm(StoreAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, MoveInfo.MoveType);
LogUtil.error(LOGGER, StoreName + wait.IoType + "等待信号(" + io.DisplayStr + "=" + wait.IoValue + ") 超时", 14); LogUtil.error(LOGGER, Name + wait.IoType + "等待信号(" + io.DisplayStr + "=" + wait.IoValue + ") 超时", 14);
isOk = false; isOk = false;
break; break;
} }
else if ((!wait.IsEnd) && StoreMove.MoveStep.Equals(StoreMoveStep.SO_14_WaitTake) && LineConnect.CanReSend()) //else if ((!wait.IsEnd) && MoveInfo.MoveStep.Equals(StoreMoveStep.SO_14_WaitTake) && LineConnect.CanReSend())
{ //{
//判断是否需要重发入库结束命令 // //判断是否需要重发入库结束命令
SendOutStoreEnd(StoreMove); // SendOutStoreEnd(MoveInfo);
} //}
} }
else if (wait.WaitType == 3) else if (wait.WaitType == 3)
{ {
...@@ -190,7 +190,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -190,7 +190,7 @@ namespace OnlineStore.DeviceLibrary
//} //}
if (wait.IsEnd) if (wait.IsEnd)
{ {
if (StoreMove.OneWaitCanEndStep) if (MoveInfo.OneWaitCanEndStep)
{ {
isOk = true; isOk = true;
break; break;
...@@ -198,7 +198,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -198,7 +198,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
if (!StoreMove.OneWaitCanEndStep ) if (!MoveInfo.OneWaitCanEndStep )
{ {
isOk = false; isOk = false;
break; break;
...@@ -207,14 +207,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -207,14 +207,14 @@ namespace OnlineStore.DeviceLibrary
} }
if (isOk) if (isOk)
{ {
StoreMove.EndStepWait(); MoveInfo.EndStepWait();
} }
else if (span.TotalSeconds > StoreMove.TimeOutSeconds) else if (span.TotalSeconds > MoveInfo.TimeOutSeconds)
{ {
WarnMsg = StoreName + "【" + StoreMove.MoveType + "】【" + StoreMove.MoveStep + "】等待超时 [" + NotOkMsg WarnMsg = Name + "【" + MoveInfo.MoveType + "】【" + MoveInfo.MoveStep + "】等待超时 [" + NotOkMsg
+ "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒"; + "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(LOGGER, WarnMsg,100); LogUtil.error(LOGGER, WarnMsg,100);
Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnMsg, StoreMove.MoveType); Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnMsg, MoveInfo.MoveType);
} }
} }
private static DateTime lastComRHomeTime = DateTime.Now; private static DateTime lastComRHomeTime = DateTime.Now;
...@@ -228,7 +228,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -228,7 +228,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始入库移动移动 /// 开始入库移动移动
/// </summary> /// </summary>
public void StartInStoreMove(InOutStoreParam param, bool isNeedCheckIO) public void StartInStoreMove(InOutParam param, bool isNeedCheckIO)
{ {
startInStoreTime = DateTime.Now; startInStoreTime = DateTime.Now;
string posId = param != null ? param.PositionNum : ""; string posId = param != null ? param.PositionNum : "";
...@@ -236,158 +236,132 @@ namespace OnlineStore.DeviceLibrary ...@@ -236,158 +236,132 @@ namespace OnlineStore.DeviceLibrary
{ {
if (!LoadParamPosition(param)) if (!LoadParamPosition(param))
{ {
LogUtil.error(LOGGER, StoreName + " 启动入库【" + posId + "】出错,找不到库位信息"); LogUtil.error(LOGGER, Name + " 启动入库【" + posId + "】出错,找不到库位信息");
return; return;
} }
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
LogUtil.error(LOGGER, StoreName + " 启动入库【" + posId + "】出错,叉子料盘检测有料"); LogUtil.error(LOGGER, Name + " 启动入库【" + posId + "】出错,叉子料盘检测有料");
return; return;
} }
LogUtil.info(LOGGER, StoreName + " 启动入库【" + posId + "】", storeMoveColor); LogUtil.info(LOGGER, Name + " 启动入库【" + posId + "】", storeMoveColor);
storeRunStatus = StoreRunStatus.Busy; storeRunStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute; storeStatus = StoreStatus.InStoreExecute;
StoreMove.NewMove(StoreMoveType.InStore, param); MoveInfo.NewMove(StoreMoveType.InStore, param);
if (isNeedCheckIO) if (isNeedCheckIO)
{ {
//料盘检测 //料盘检测
InStoreLog(" 入库:SI_00 检测料盘信号"); InStoreLog(" 入库:SI_00 检测料盘信号");
StoreMove.NextMoveStep(StoreMoveStep.SI_00_TrayCheck); MoveInfo.NextMoveStep(StoreMoveStep.SI_00_TrayCheck);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH));
} }
else else
{ {
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
SI_02_Move(param.MoveP); SI_02_Move(param.MoveP);
}
else
{
InStoreLog("入库:SI_01 定位气缸下降");
StoreMove.NextMoveStep(StoreMoveStep.SI_01_LocationCylinderDown);
LocationDownAndWait();
}
} }
} }
else else
{ {
LogUtil.error(LOGGER, StoreName + " 启动【" + posId + "】入库出错,当前状态,storeStatus=" + storeRunStatus); LogUtil.error(LOGGER, Name + " 启动【" + posId + "】入库出错,当前状态,storeStatus=" + storeRunStatus);
} }
} }
/// <summary> /// <summary>
/// 开始入库移动移动 /// 开始入库移动移动
/// </summary> /// </summary>
public override void StartInStoreMove(InOutStoreParam param) public override void StartInStoreMove(InOutParam param)
{ {
StartInStoreMove(param, false); StartInStoreMove(param, false);
} }
private void SI_02_Move(LineMoveP moveP) private void SI_02_Move(LineMoveP moveP)
{ {
InStoreLog("入库:SI_02_ 进出轴(叉子)动作至P1,打开舱门"); InStoreLog("入库:SI_02_ 进出轴(叉子)动作至P1,打开舱门");
StoreMove.NextMoveStep(StoreMoveStep.SI_02_InOutAxisHome); MoveInfo.NextMoveStep(StoreMoveStep.SI_02_InOutAxisHome);
OpenDoor(); OpenDoor();
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
} }
private void SI_05_DeviceToDoor() private void SI_05_DeviceToDoor()
{ {
InStoreLog("入库:SI_05 叉子进入入料口,进出轴至P2(进料口取料点) "); InStoreLog("入库:SI_05 叉子进入入料口,进出轴至P2(进料口取料点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_05_DeviceToDoor); MoveInfo.NextMoveStep(StoreMoveStep.SI_05_DeviceToDoor);
ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P2, Config.InOutAxis_P2_Speed); ACAxisMove(Config.InOut_Axis, MoveInfo.MoveParam.MoveP.InOut_P2, Config.InOutAxis_P2_Speed);
//NeedCheckSafetyLight = 1; //NeedCheckSafetyLight = 1;
} }
protected override void InStoreProcess() protected override void InStoreProcess()
{ {
LineMoveP moveP = StoreMove.MoveParam.MoveP; LineMoveP moveP = MoveInfo.MoveParam.MoveP;
if (StoreMove.IsInWait) if (MoveInfo.IsInWait)
{ {
CheckWait(); CheckWait();
} }
if (StoreMove.IsInWait) if (MoveInfo.IsInWait)
{ {
return; return;
} }
if (StoreMove.MoveStep == StoreMoveStep.SI_00_TrayCheck) if (MoveInfo.MoveStep == StoreMoveStep.SI_00_TrayCheck)
{ {
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
SI_02_Move(moveP); SI_02_Move(moveP);
}
else
{
InStoreLog("入库:SI_01 定位气缸下降");
StoreMove.NextMoveStep(StoreMoveStep.SI_01_LocationCylinderDown);
LocationDownAndWait();
}
} }
if (StoreMove.MoveStep == StoreMoveStep.SI_01_LocationCylinderDown) if (MoveInfo.MoveStep == StoreMoveStep.SI_01_LocationCylinderDown)
{ {
SI_02_Move(moveP); SI_02_Move(moveP);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_02_InOutAxisHome) else if (MoveInfo.MoveStep == StoreMoveStep.SI_02_InOutAxisHome)
{ {
InStoreLog("入库:SI_03 所有轴回到待机点,轴2、轴1 动作到P1,,轴4动作至P3"); InStoreLog("入库:SI_03 所有轴回到待机点,轴2、轴1 动作到P1,,轴4动作至P3");
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome); MoveInfo.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed); ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_03_ReturnHome) else if (MoveInfo.MoveStep == StoreMoveStep.SI_03_ReturnHome)
{ {
if (IsHasCompress_Axis)
{
InStoreLog("入库:SI_04_CompressWare 压紧物品(有压紧轴的才需要此步骤),压紧轴至P3(压紧前点) 开始"); InStoreLog("入库:SI_04_CompressWare 压紧物品(有压紧轴的才需要此步骤),压紧轴至P3(压紧前点) 开始");
StoreMove.NextMoveStep(StoreMoveStep.SI_04_CompressWare); MoveInfo.NextMoveStep(StoreMoveStep.SI_04_CompressWare);
ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed); ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed);
}
else
{
SI_05_DeviceToDoor();
}
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_04_CompressWare) else if (MoveInfo.MoveStep == StoreMoveStep.SI_04_CompressWare)
{ {
SI_05_DeviceToDoor(); SI_05_DeviceToDoor();
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_05_DeviceToDoor) else if (MoveInfo.MoveStep == StoreMoveStep.SI_05_DeviceToDoor)
{ {
//NeedCheckSafetyLight = 0; //NeedCheckSafetyLight = 0;
InStoreLog("入库:SI_06 拿物品,压紧轴至P2(压紧点)) 升降轴至P7(进料口取料缓冲点) "); InStoreLog("入库:SI_06 拿物品,压紧轴至P2(压紧点)) 升降轴至P7(进料口取料缓冲点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_06_DoorWarToDevice); MoveInfo.NextMoveStep(StoreMoveStep.SI_06_DoorWarToDevice);
ComMoveToPosition(moveP.ComPress_P2,Config.CompAxis_P2_Speed); ComMoveToPosition(moveP.ComPress_P2,Config.CompAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P7, Config.UpDownAxis_P7_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P7, Config.UpDownAxis_P7_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_06_DoorWarToDevice) else if (MoveInfo.MoveStep == StoreMoveStep.SI_06_DoorWarToDevice)
{ {
InStoreLog("入库:SI_07 叉子 从入料口抽出,进出轴至P1(待机点) "); InStoreLog("入库:SI_07 叉子 从入料口抽出,进出轴至P1(待机点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_07_DeviceBackFromDoor); MoveInfo.NextMoveStep(StoreMoveStep.SI_07_DeviceBackFromDoor);
//ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Speed); //ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Speed);
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_07_DeviceBackFromDoor) else if (MoveInfo.MoveStep == StoreMoveStep.SI_07_DeviceBackFromDoor)
{ {
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
InStoreLog("入库:SI_09 移动到库位点,旋转轴至P2(库位点),升降轴至P3(库位入库前点) "); InStoreLog("入库:SI_09 移动到库位点,旋转轴至P2(库位点),升降轴至P3(库位入库前点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_09_MoveToBag); MoveInfo.NextMoveStep(StoreMoveStep.SI_09_MoveToBag);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P2_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
//关闭舱门 //关闭舱门
//IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH); //IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW); //IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
CloseDoor(false); CloseDoor(false);
}
else
{
InStoreLog("入库:SI_08 定位气缸伸出 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_08_LocationCylinder_Up);
LocationUpAndWait();
}
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_08_LocationCylinder_Up) else if (MoveInfo.MoveStep == StoreMoveStep.SI_08_LocationCylinder_Up)
{ {
InStoreLog("入库:SI_09 移动到库位点,旋转轴至P2(库位点),升降轴至P3(库位入库前点)),关闭舱门 "); InStoreLog("入库:SI_09 移动到库位点,旋转轴至P2(库位点),升降轴至P3(库位入库前点)),关闭舱门 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_09_MoveToBag); MoveInfo.NextMoveStep(StoreMoveStep.SI_09_MoveToBag);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
//关闭舱门 //关闭舱门
...@@ -395,67 +369,60 @@ namespace OnlineStore.DeviceLibrary ...@@ -395,67 +369,60 @@ namespace OnlineStore.DeviceLibrary
//IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW); //IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
CloseDoor(false); CloseDoor(false);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_09_MoveToBag) else if (MoveInfo.MoveStep == StoreMoveStep.SI_09_MoveToBag)
{ {
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
InStoreLog("入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) "); InStoreLog("入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_11_DeviceToBag); MoveInfo.NextMoveStep(StoreMoveStep.SI_11_DeviceToBag);
ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed); ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
}
else
{
InStoreLog("入库:SI_10 定位气缸退回 ");
StoreMove.NextMoveStep(StoreMoveStep.SI_10_LocationCylinder_Down);
LocationDownAndWait();
}
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_10_LocationCylinder_Down) else if (MoveInfo.MoveStep == StoreMoveStep.SI_10_LocationCylinder_Down)
{ {
//IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW); //IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
InStoreLog("入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) "); InStoreLog("入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_11_DeviceToBag); MoveInfo.NextMoveStep(StoreMoveStep.SI_11_DeviceToBag);
ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed); ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_11_DeviceToBag) else if (MoveInfo.MoveStep == StoreMoveStep.SI_11_DeviceToBag)
{ {
InStoreLog("入库:SI_12 放下物品,升降轴至P4(库位入料缓冲点),压紧轴至P3(压紧前点) "); InStoreLog("入库:SI_12 放下物品,升降轴至P4(库位入料缓冲点),压紧轴至P3(压紧前点) ");
// 5= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态) // 5= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
lastPosId = posId; lastPosId = posId;
lastPosIdStatus = StoreStatus.InStoreEnd; lastPosIdStatus = StoreStatus.InStoreEnd;
storeStatus = StoreStatus.InStoreEnd; storeStatus = StoreStatus.InStoreEnd;
//手动发给服务器状态,防止没有手动 //手动发给服务器状态,防止没有手动
//SendLineStatus(StoreID, posId, StoreStatus.InStoreEnd); //SendLineStatus(StoreID, posId, StoreStatus.InStoreEnd);
StoreMove.NextMoveStep(StoreMoveStep.SI_12_PutWareToBag); MoveInfo.NextMoveStep(StoreMoveStep.SI_12_PutWareToBag);
ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed); ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P4, Config.UpDownAxis_P4_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P4, Config.UpDownAxis_P4_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_12_PutWareToBag) else if (MoveInfo.MoveStep == StoreMoveStep.SI_12_PutWareToBag)
{ {
InStoreLog("入库:SI_13 叉子从库位中返回,进出轴动作至P1(待机点) "); InStoreLog("入库:SI_13 叉子从库位中返回,进出轴动作至P1(待机点) ");
StoreMove.NextMoveStep(StoreMoveStep.SI_13_DeviceBackFromBag); MoveInfo.NextMoveStep(StoreMoveStep.SI_13_DeviceBackFromBag);
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_13_DeviceBackFromBag) else if (MoveInfo.MoveStep == StoreMoveStep.SI_13_DeviceBackFromBag)
{ {
InStoreLog("入库:SI_14 返回待机点,轴2/轴1/轴4动作至P1(待机点)),检测门关闭"); InStoreLog("入库:SI_14 返回待机点,轴2/轴1/轴4动作至P1(待机点)),检测门关闭");
StoreMove.NextMoveStep(StoreMoveStep.SI_14_GoBack); MoveInfo.NextMoveStep(StoreMoveStep.SI_14_GoBack);
ComMoveToPosition(moveP.ComPress_P1,Config.CompAxis_P1_Speed); ComMoveToPosition(moveP.ComPress_P1,Config.CompAxis_P1_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
CloseDoor(); CloseDoor();
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_14_GoBack) else if (MoveInfo.MoveStep == StoreMoveStep.SI_14_GoBack)
{ {
TimeSpan span = DateTime.Now - startInStoreTime; TimeSpan span = DateTime.Now - startInStoreTime;
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】 整个入库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!", storeMoveColor); LogUtil.info(LOGGER, Name + " 【" + posId + "】 整个入库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!", storeMoveColor);
StoreMove.EndMove(); MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing; storeRunStatus = StoreRunStatus.Runing;
//设备连接,入库后,BOX恢复原始状态 //设备连接,入库后,BOX恢复原始状态
storeStatus = StoreStatus.StoreOnline; storeStatus = StoreStatus.StoreOnline;
...@@ -463,7 +430,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -463,7 +430,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
LogUtil.info(LOGGER, StoreName + " 入库,moveStatus=" + StoreMove.MoveStep + ",没有对应的处理!"); LogUtil.info(LOGGER, Name + " 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
} }
} }
...@@ -476,7 +443,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -476,7 +443,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始出库运动 /// 开始出库运动
/// </summary> /// </summary>
public override bool StartOutStoreMove(InOutStoreParam param) public override bool StartOutStoreMove(InOutParam param)
{ {
startOutStoreTime = DateTime.Now; startOutStoreTime = DateTime.Now;
string posId = param != null ? param.PositionNum : ""; string posId = param != null ? param.PositionNum : "";
...@@ -484,181 +451,157 @@ namespace OnlineStore.DeviceLibrary ...@@ -484,181 +451,157 @@ namespace OnlineStore.DeviceLibrary
{ {
if (!LoadParamPosition(param)) if (!LoadParamPosition(param))
{ {
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】出错,找不到库位信息"); LogUtil.error(LOGGER, Name + " 启动出库【" + posId + "】出错,找不到库位信息");
return false ; return false ;
} }
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{ {
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】出错,叉子料盘检测有料"); LogUtil.error(LOGGER, Name + " 启动出库【" + posId + "】出错,叉子料盘检测有料");
return false ; return false ;
} }
storeStatus = StoreStatus.OutStoreExecute; storeStatus = StoreStatus.OutStoreExecute;
LogUtil.info(LOGGER, StoreName + "启动出库【" + posId + "】 ", storeMoveColor); LogUtil.info(LOGGER, Name + "启动出库【" + posId + "】 ", storeMoveColor);
storeRunStatus = StoreRunStatus.Busy; storeRunStatus = StoreRunStatus.Busy;
StoreMove.NewMove(StoreMoveType.OutStore, param); MoveInfo.NewMove(StoreMoveType.OutStore, param);
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{ MoveInfo.NextMoveStep(StoreMoveStep.SO_02_DeviceBack);
StoreMove.NextMoveStep(StoreMoveStep.SO_02_DeviceBack);
OutStoreLog("出库:SO_02 叉子先运动到P1 ,打开舱门 开始"); OutStoreLog("出库:SO_02 叉子先运动到P1 ,打开舱门 开始");
//ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P1, Config.InOutAxis_P1_Speed); //ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P1, Config.InOutAxis_P1_Speed);
InOutBackToP1(StoreMove.MoveParam.MoveP.InOut_P1); InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
//OpenDoorAndWait();
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.SO_01_LocationCylinderDown);
OutStoreLog("出库:SO_01 定位气缸下降");
LocationDownAndWait();
}
return true; return true;
} }
else else
{ {
LogUtil.error(LOGGER, StoreName + " 启动出库出错,当前状态,storeStatus=" + storeRunStatus); LogUtil.error(LOGGER, Name + " 启动出库出错,当前状态,storeStatus=" + storeRunStatus);
} }
return false; return false;
} }
protected override void OutStoreProcess() protected override void OutStoreProcess()
{ {
LineMoveP moveP = StoreMove.MoveParam.MoveP; LineMoveP moveP = MoveInfo.MoveParam.MoveP;
if (StoreMove.IsInWait) if (MoveInfo.IsInWait)
{ {
CheckWait(); CheckWait();
} }
if (StoreMove.IsInWait) if (MoveInfo.IsInWait)
{ {
return; return;
} }
if (StoreMove.MoveStep == StoreMoveStep.SO_01_LocationCylinderDown) if (MoveInfo.MoveStep == StoreMoveStep.SO_01_LocationCylinderDown)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_02_DeviceBack); MoveInfo.NextMoveStep(StoreMoveStep.SO_02_DeviceBack);
OutStoreLog("出库:SO_02 叉子先运动到P1 "); OutStoreLog("出库:SO_02 叉子先运动到P1 ");
InOutBackToP1(StoreMove.MoveParam.MoveP.InOut_P1); InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_02_DeviceBack) else if (MoveInfo.MoveStep == StoreMoveStep.SO_02_DeviceBack)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_03_ToBagPosition); MoveInfo.NextMoveStep(StoreMoveStep.SO_03_ToBagPosition);
OutStoreLog("出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)"); OutStoreLog("出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)");
ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed); ComMoveToPosition(moveP.ComPress_P3,Config.CompAxis_P3_Speed);
ACAxisMove(Config.Middle_Axis, StoreMove.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed); ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed); ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_03_ToBagPosition) else if (MoveInfo.MoveStep == StoreMoveStep.SO_03_ToBagPosition)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_04_DeviceToBag); MoveInfo.NextMoveStep(StoreMoveStep.SO_04_DeviceToBag);
OutStoreLog("出库:SO_04 叉子进入库位中, 进出轴至P3(库位取放料点) "); OutStoreLog("出库:SO_04 叉子进入库位中, 进出轴至P3(库位取放料点) ");
ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed); ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_04_DeviceToBag) else if (MoveInfo.MoveStep == StoreMoveStep.SO_04_DeviceToBag)
{ {
OutStoreLog("出库:SO_05 拿起物品,升降轴至P6(库位出料缓冲点),压紧轴至P2(压紧点) "); OutStoreLog("出库:SO_05 拿起物品,升降轴至P6(库位出料缓冲点),压紧轴至P2(压紧点) ");
StoreMove.NextMoveStep(StoreMoveStep.SO_05_BagWareToDevice); MoveInfo.NextMoveStep(StoreMoveStep.SO_05_BagWareToDevice);
ComMoveToPosition(moveP.ComPress_P2,Config.CompAxis_P2_Speed); ComMoveToPosition(moveP.ComPress_P2,Config.CompAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P6, Config.UpDownAxis_P6_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P6, Config.UpDownAxis_P6_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_05_BagWareToDevice) else if (MoveInfo.MoveStep == StoreMoveStep.SO_05_BagWareToDevice)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_06_BagDeviceBack); MoveInfo.NextMoveStep(StoreMoveStep.SO_06_BagDeviceBack);
OutStoreLog("出库:SO_06 叉子从库位返回,进出轴至P1(待机点) "); OutStoreLog("出库:SO_06 叉子从库位返回,进出轴至P1(待机点) ");
//ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Speed); //ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Speed);
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
//把库位的物品放到取到叉子上之后是出仓完成 //把库位的物品放到取到叉子上之后是出仓完成
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
lastPosId = posId; lastPosId = posId;
lastPosIdStatus = StoreStatus.OutStoreBoxEnd; lastPosIdStatus = StoreStatus.OutStoreBoxEnd;
storeStatus = StoreStatus.OutStoreBoxEnd; storeStatus = StoreStatus.OutStoreBoxEnd;
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_06_BagDeviceBack) else if (MoveInfo.MoveStep == StoreMoveStep.SO_06_BagDeviceBack)
{ {
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{ {
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
CodeMsg = "出库[" + posId + "]叉子从库位退出后,未检测到料盘有料"; CodeMsg = "出库[" + posId + "]叉子从库位退出后,未检测到料盘有料";
LogUtil.error(CodeMsg); LogUtil.error(CodeMsg);
} }
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{ MoveInfo.NextMoveStep(StoreMoveStep.SO_08_ToDoorPosition);
StoreMove.NextMoveStep(StoreMoveStep.SO_08_ToDoorPosition);
OutStoreLog("出库:SO_08 走到料门口,旋转轴至P1(待机点)升降轴至P2(进料口出料前点),打开舱门 "); OutStoreLog("出库:SO_08 走到料门口,旋转轴至P1(待机点)升降轴至P2(进料口出料前点),打开舱门 ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
//打开舱门 //打开舱门
//OpenDoorAndWait(); //OpenDoorAndWait();
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.SO_07_LocationCylinder_Up);
OutStoreLog("出库:SO_07 定位气缸伸出 ");
LocationUpAndWait();
}
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_LocationCylinder_Up) else if (MoveInfo.MoveStep == StoreMoveStep.SO_07_LocationCylinder_Up)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_08_ToDoorPosition); MoveInfo.NextMoveStep(StoreMoveStep.SO_08_ToDoorPosition);
OutStoreLog("出库:SO_08 走到料门口,旋转轴至P1(待机点)升降轴至P2(进料口出料前点) "); OutStoreLog("出库:SO_08 走到料门口,旋转轴至P1(待机点)升降轴至P2(进料口出料前点) ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_08_ToDoorPosition) else if (MoveInfo.MoveStep == StoreMoveStep.SO_08_ToDoorPosition)
{ {
if (IsHasCompress_Axis || Config.IsHasLocationCylinder.Equals(0))
{
//SO_10_DeviceToDoorPro(); //SO_10_DeviceToDoorPro();
StoreMove.NextMoveStep(StoreMoveStep.SO_091_WaitNoTray); MoveInfo.NextMoveStep(StoreMoveStep.SO_091_WaitNoTray);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0)); // StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
OpenDoor(); OpenDoor();
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.SO_09_LocationCylinder_Down);
OutStoreLog("出库:SO_09 定位气缸退回,定位气缸退回 ");
LocationDownAndWait();
}
} }
//此处需要等待移栽没有工作,才能把盘放入出料口 //此处需要等待移栽没有工作,才能把盘放入出料口
else if (StoreMove.MoveStep == StoreMoveStep.SO_09_LocationCylinder_Down) else if (MoveInfo.MoveStep == StoreMoveStep.SO_09_LocationCylinder_Down)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_091_WaitNoTray); MoveInfo.NextMoveStep(StoreMoveStep.SO_091_WaitNoTray);
OutStoreLog("出库:SO_091 打开仓门,等待门口无料盘 "); OutStoreLog("出库:SO_091 打开仓门,等待门口无料盘 ");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0)); // StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
OpenDoor(); OpenDoor();
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_091_WaitNoTray) else if (MoveInfo.MoveStep == StoreMoveStep.SO_091_WaitNoTray)
{ {
SO_10_DeviceToDoorPro(); SO_10_DeviceToDoorPro();
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_10_DeviceToDoor) else if (MoveInfo.MoveStep == StoreMoveStep.SO_10_DeviceToDoor)
{ {
OutStoreLog("出库:SO_11 放下物品,升降轴至P8(进料口出料缓冲点) "); OutStoreLog("出库:SO_11 放下物品,升降轴至P8(进料口出料缓冲点) ");
StoreMove.NextMoveStep(StoreMoveStep.SO_11_DevicePutWare); MoveInfo.NextMoveStep(StoreMoveStep.SO_11_DevicePutWare);
//NeedCheckSafetyLight = 0; //NeedCheckSafetyLight = 0;
ComMoveToPosition(moveP.ComPress_P1,Config.CompAxis_P1_Speed); ComMoveToPosition(moveP.ComPress_P1,Config.CompAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P8, Config.UpDownAxis_P8_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P8, Config.UpDownAxis_P8_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_11_DevicePutWare) else if (MoveInfo.MoveStep == StoreMoveStep.SO_11_DevicePutWare)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_12_DeviceOutFromDoor); MoveInfo.NextMoveStep(StoreMoveStep.SO_12_DeviceOutFromDoor);
OutStoreLog("出库:SO_12 叉子从出料口返回,,进出轴动作至P1(待机点) "); OutStoreLog("出库:SO_12 叉子从出料口返回,,进出轴动作至P1(待机点) ");
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_12_DeviceOutFromDoor) else if (MoveInfo.MoveStep == StoreMoveStep.SO_12_DeviceOutFromDoor)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_13_GoBack); MoveInfo.NextMoveStep(StoreMoveStep.SO_13_GoBack);
OutStoreLog("出库:SO_13 升降轴返回,轴2至P1(待机点) ,关闭舱门"); OutStoreLog("出库:SO_13 升降轴返回,轴2至P1(待机点) ,关闭舱门");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
CloseDoor(); CloseDoor();
//发送消息给流水线 //发送消息给流水线
SendOutStoreEnd(StoreMove); SendOutStoreEnd(MoveInfo);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_13_GoBack) else if (MoveInfo.MoveStep == StoreMoveStep.SO_13_GoBack)
{ {
int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds); int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds);
if (OutStoreWaitSeconds <= 0) if (OutStoreWaitSeconds <= 0)
...@@ -666,94 +609,67 @@ namespace OnlineStore.DeviceLibrary ...@@ -666,94 +609,67 @@ namespace OnlineStore.DeviceLibrary
OutStoreWaitSeconds = 600; OutStoreWaitSeconds = 600;
} }
int ms = OutStoreWaitSeconds * 1000; int ms = OutStoreWaitSeconds * 1000;
StoreMove.NextMoveStep(StoreMoveStep.SO_14_WaitTake); MoveInfo.NextMoveStep(StoreMoveStep.SO_14_WaitTake);
OutStoreLog("出库:SO_14_WaitTake 等待拿走物品,最多等待" + OutStoreWaitSeconds + "秒"); OutStoreLog("出库:SO_14_WaitTake 等待拿走物品,最多等待" + OutStoreWaitSeconds + "秒");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(ms)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(ms));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0)); // StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
StoreMove.OneWaitCanEndStep = true; MoveInfo.OneWaitCanEndStep = true;
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_14_WaitTake) else if (MoveInfo.MoveStep == StoreMoveStep.SO_14_WaitTake)
{ {
TimeSpan span = DateTime.Now - startOutStoreTime; TimeSpan span = DateTime.Now - startOutStoreTime;
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
storeStatus = StoreStatus.StoreOnline; storeStatus = StoreStatus.StoreOnline;
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】 整个出库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!", storeMoveColor); LogUtil.info(LOGGER, Name + " 【" + posId + "】 整个出库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!", storeMoveColor);
StoreMove.EndMove(); MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing; storeRunStatus = StoreRunStatus.Runing;
InOutEndProcess(StoreMoveType.OutStore); InOutEndProcess(StoreMoveType.OutStore);
} }
else else
{ {
LogUtil.error(LOGGER, StoreName + " 出库处理,moveStatus=" + StoreMove.MoveStep + ",没有对应的处理!"); LogUtil.error(LOGGER, Name + " 出库处理,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
} }
} }
private void SendOutStoreEnd(StoreMoveInfo storeMove) private void SendOutStoreEnd(StoreMoveInfo storeMove)
{ {
int hasTray = (int)IOManager.IOValue(IO_Type.TrayCheck_Door); //int hasTray = (int)IOValue(IO_Type.TrayCheck_Door);
int ss = (int)storeStatus; //int ss = (int)storeStatus;
if (IsDebug) //if (IsDebug)
{ //{
ss = (int)StoreStatus.Debugging; // ss = (int)StoreStatus.Debugging;
} //}
StoreSendBean store = new StoreSendBean(Config.Id, Config.CID, (int)storeStatus, (int)storeRunStatus, hasTray, (int)alarmType); //StoreSendBean store = new StoreSendBean(Config.Id, Config.CID, (int)storeStatus, (int)storeRunStatus, hasTray, (int)alarmType);
store.PosId = StoreMove.MoveParam.PositionNum; //store.PosId = MoveInfo.MoveParam.PositionNum;
store.PlateH = StoreMove.MoveParam.PlateH; //store.PlateH = MoveInfo.MoveParam.PlateH;
store.PlateW = StoreMove.MoveParam.PlateW; //store.PlateW = MoveInfo.MoveParam.PlateW;
LineConnect.OutStoreEnd(store); //LineConnect.OutStoreEnd(store);
} }
private void SO_10_DeviceToDoorPro() private void SO_10_DeviceToDoorPro()
{ {
LineMoveP moveP = StoreMove.MoveParam.MoveP; LineMoveP moveP = MoveInfo.MoveParam.MoveP;
StoreMove.NextMoveStep(StoreMoveStep.SO_10_DeviceToDoor); MoveInfo.NextMoveStep(StoreMoveStep.SO_10_DeviceToDoor);
OutStoreLog("出库:SO_10 叉子进出料口,进出轴至P2(进料口取料点) "); OutStoreLog("出库:SO_10 叉子进出料口,进出轴至P2(进料口取料点) ");
ACAxisMove(Config.InOut_Axis, moveP.InOut_P2, Config.InOutAxis_P2_Speed); ACAxisMove(Config.InOut_Axis, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
//NeedCheckSafetyLight = 1; //NeedCheckSafetyLight = 1;
} }
public bool InOutAxisCanMove() public bool InOutAxisCanMove()
{ {
if (StoreManager.Store.Config.IsHasLocationCylinder.Equals(0))
{
return true;
}
if (IOManager.IOValue(IO_Type.LocationCylinder_Down).Equals(IO_VALUE.HIGH) if (IOValue(IO_Type.LocationCylinder_Down).Equals(IO_VALUE.HIGH)
&& IOManager.IOValue(IO_Type.LocationCylinder_Up).Equals(IO_VALUE.LOW) && IOValue(IO_Type.LocationCylinder_Up).Equals(IO_VALUE.LOW)
&& IOManager.IOValue(IO_Type.LocationCylinder2_Down).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.LocationCylinder2_Down).Equals(IO_VALUE.HIGH)
&& IOManager.IOValue(IO_Type.LocationCylinder2_Up).Equals(IO_VALUE.LOW)) && IOValue(IO_Type.LocationCylinder2_Up).Equals(IO_VALUE.LOW))
{ {
return true; return true;
} }
return false; return false;
} }
private void LocationUpAndWait()
{
if (Config.IsHasLocationCylinder>=1)
{
IOManager.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder_Up, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder_Down, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder2_Up, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder2_Down, IO_VALUE.LOW));
}
}
private void LocationDownAndWait()
{
if (Config.IsHasLocationCylinder>=1)
{
IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.LOW);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder_Down, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder_Up, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder2_Down, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LocationCylinder2_Up, IO_VALUE.LOW));
}
}
#endregion #endregion
public List<FixtureCodeInfo> waitOutStoreList = new List<FixtureCodeInfo>(); public List<FixtureCodeInfo> waitOutStoreList = new List<FixtureCodeInfo>();
public object waitOutListLock = ""; public object waitOutListLock = "";
...@@ -785,13 +701,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -785,13 +701,13 @@ namespace OnlineStore.DeviceLibrary
if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count) if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count)
{ {
newIndex = AutoStartIndex; newIndex = AutoStartIndex;
LogUtil.info(LOGGER, StoreName + "下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex + "】"); LogUtil.info(LOGGER, Name + "下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex + "】");
} }
else else
{ {
autoNext = false; autoNext = false;
autoMsg = "自动出入库结束!"; autoMsg = "自动出入库结束!";
LogUtil.info(LOGGER, StoreName + "下一个索引不存在,自动 出入库结束!"); LogUtil.info(LOGGER, Name + "下一个索引不存在,自动 出入库结束!");
} }
} }
else else
...@@ -802,23 +718,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -802,23 +718,23 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重置 //判断是否需要重置
if (CurrInOutACount >= Config.Box_ResetACount) if (CurrInOutACount >= Config.Box_ResetACount)
{ {
LogUtil.info(LOGGER, StoreName + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把出库信息存入排队列表中"); LogUtil.info(LOGGER, Name + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把出库信息存入排队列表中");
Reset(false); Reset(false);
autoMsg = "自动出库:" + posid; autoMsg = "自动出库:" + posid;
AddWaitOutInfo(new FixtureCodeInfo(0, "", posid)); AddWaitOutInfo(new FixtureCodeInfo(0, "", posid));
} }
else if (CurrInOutCount >= Config.Box_ResetMCount) else if (CurrInOutCount >= Config.Box_ResetMCount)
{ {
LogUtil.info(LOGGER, StoreName + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中"); LogUtil.info(LOGGER, Name + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
//ResetMiddleAxis(false); //ResetMiddleAxis(false);
autoMsg = "自动出库:" + posid; autoMsg = "自动出库:" + posid;
AddWaitOutInfo(new FixtureCodeInfo(0, "", posid)); AddWaitOutInfo(new FixtureCodeInfo(0, "", posid));
} }
else else
{ {
LogUtil.info(LOGGER, StoreName + "自动进入下一个出库:posid=" + posid); LogUtil.info(LOGGER, Name + "自动进入下一个出库:posid=" + posid);
autoMsg = "自动出库:" + posid; autoMsg = "自动出库:" + posid;
StartOutStoreMove(new InOutStoreParam("", posid)); StartOutStoreMove(new InOutParam("", posid));
} }
} }
} }
...@@ -830,13 +746,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -830,13 +746,13 @@ namespace OnlineStore.DeviceLibrary
if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count) if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count)
{ {
newIndex = AutoStartIndex; newIndex = AutoStartIndex;
LogUtil.info(LOGGER, StoreName + "下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex + "】"); LogUtil.info(LOGGER, Name + "下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex + "】");
} }
else else
{ {
autoNext = false; autoNext = false;
autoMsg = "自动出入库结束!"; autoMsg = "自动出入库结束!";
LogUtil.info(LOGGER, StoreName + "下一个索引不存在,自动 出入库结束!"); LogUtil.info(LOGGER, Name + "下一个索引不存在,自动 出入库结束!");
} }
} }
else else
...@@ -845,23 +761,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -845,23 +761,23 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重置 //判断是否需要重置
if (CurrInOutACount >= Config.Box_ResetACount) if (CurrInOutACount >= Config.Box_ResetACount)
{ {
LogUtil.info(LOGGER, StoreName + "自动进入下一个入库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把入库信息存入排队列表中"); LogUtil.info(LOGGER, Name + "自动进入下一个入库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把入库信息存入排队列表中");
Reset(false); Reset(false);
autoMsg = "自动入库:" + posid; autoMsg = "自动入库:" + posid;
AddWaitOutInfo(new FixtureCodeInfo(0, "AAAA", posid)); AddWaitOutInfo(new FixtureCodeInfo(0, "AAAA", posid));
} }
else if (CurrInOutCount >= Config.Box_ResetMCount) else if (CurrInOutCount >= Config.Box_ResetMCount)
{ {
LogUtil.info(LOGGER, StoreName + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中"); LogUtil.info(LOGGER, Name + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
//ResetMiddleAxis(false); //ResetMiddleAxis(false);
autoMsg = "自动入库:" + posid; autoMsg = "自动入库:" + posid;
AddWaitOutInfo(new FixtureCodeInfo(0, "AAAA", posid)); AddWaitOutInfo(new FixtureCodeInfo(0, "AAAA", posid));
} }
else else
{ {
LogUtil.info(LOGGER, StoreName + "自动进入下一个入库:posid=" + posid); LogUtil.info(LOGGER, Name + "自动进入下一个入库:posid=" + posid);
autoMsg = "自动入库:" + posid; autoMsg = "自动入库:" + posid;
StartInStoreMove(new InOutStoreParam("AAAA", posid)); StartInStoreMove(new InOutParam("AAAA", posid));
} }
} }
} }
...@@ -874,12 +790,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -874,12 +790,12 @@ namespace OnlineStore.DeviceLibrary
private void InStoreLog(string msg) private void InStoreLog(string msg)
{ {
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
LogUtil.info(LOGGER, "【" + posId + "】" + msg, storeMoveColor); LogUtil.info(LOGGER, "【" + posId + "】" + msg, storeMoveColor);
} }
private void OutStoreLog(string msg) private void OutStoreLog(string msg)
{ {
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PositionNum : "";
LogUtil.info(LOGGER, "【" + posId + "】" + msg, storeMoveColor); LogUtil.info(LOGGER, "【" + posId + "】" + msg, storeMoveColor);
} }
} }
......
using log4net;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 流水线自动料仓-流水线类
/// </summary>
public partial class PackingStoreBean : KTK_Store
{
/// <summary>
/// 灯闪烁定时器
/// </summary>
private System.Timers.Timer ledProcessTimer = null;
/// <summary>
/// 分出一个线程,专门处理急停,报警,气压检测,工单信号检测等处理
/// </summary>
private System.Timers.Timer IoCheckTimer = null;
public Dictionary<int, AC_BOX_Config> BoxConfigMap { get; set; }
public Dictionary<int, AC_BOX_Bean> BoxMap = new Dictionary<int, AC_BOX_Bean>();
public Store_Config Config { get; set; }
#region 初始化
private bool canStart = false;
public PackingStoreBean(Store_Config lineConfig, Dictionary<int, AC_BOX_Config> configList)
{
BoxMap = new Dictionary<int, AC_BOX_Bean>();
if (lineConfig.IOSingle_TimerOut <= 0)
{
lineConfig.IOSingle_TimerOut = 5000;
}
Init();
InitTimer();
baseConfig = lineConfig;
this.Config = lineConfig;
this.DeviceID = lineConfig.Id;
MoveInfo = new StoreMoveInfo(DeviceID);
Name = (" Store_" + Config.CID + " ").ToUpper();
List<string> ioList = new List<string>();
AddDeviceName(ioList, Config.DIODeviceNameList);
foreach (AC_BOX_Config config in configList.Values)
{
AC_BOX_Bean equip = new AC_BOX_Bean(config);
AddDeviceName(ioList, config.DIODeviceNameList);
BoxMap.Add(config.Id, equip);
BoxConfigMap.Add(config.Id, config);
}
IOManager.Init();
//先初始化设备
//初始化摄像机配置
CodeManager.LoadConfig();
Task.Factory.StartNew(delegate
{
IOManager.instance.ConnectionIOList(ioList);
addLastDI(IO_Type.Airpressure_Check, IOValue(IO_Type.Airpressure_Check));
addLastDI(IO_Type.SuddenStop_BTN, IOValue(IO_Type.SuddenStop_BTN));
addLastDI(IO_Type.Reset_BTN, IOValue(IO_Type.Reset_BTN));
mainTimer.Enabled = true;
IoCheckTimer.Enabled = true;
canStart = true;
});
}
private void AddDeviceName(List<string> targetList, List<string> list)
{
foreach (string str in list)
{
if (!targetList.Contains(str))
{
targetList.Add(str);
}
}
}
public void InitTimer()
{
ledProcessTimer = new System.Timers.Timer();
ledProcessTimer.Interval = 1000;
ledProcessTimer.Elapsed += LedProcess;
ledProcessTimer.AutoReset = true;
ledProcessTimer.Enabled = false;
IoCheckTimer = new System.Timers.Timer();
IoCheckTimer.Interval = 200;
IoCheckTimer.Elapsed += IoCheckTimerProcess;
IoCheckTimer.AutoReset = true;
IoCheckTimer.Enabled = false;
}
private void IoCheckTimerProcess(object sender, ElapsedEventArgs e)
{
}
#endregion
public override bool StartRun( )
{
if (!canStart)
{
SetWarnMsg("启动失败:设备未初始化完成");
return false;
}
if (BoxConfigMap == null)
{
SetWarnMsg("启动失败:未加载到料仓配置");
return false;
}
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
SetWarnMsg("启动失败:急停未开");
}
else if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW))
{
SetWarnMsg("启动失败:没有气压信号");
}
else
{
LogUtil.info( Name + "开始启动,启动时间:" + StartTime.ToString());
storeRunStatus = StoreRunStatus.HomeMoving;
StartTime = DateTime.Now;
mainTimer.Enabled = false;
IoCheckTimer.Enabled = false;
isInSuddenDown = false;
isNoAirCheck = false;
alarmType = StoreAlarmType.None;
WarnMsg = "";
foreach (AC_BOX_Bean moveEquip in this.BoxMap.Values)
{
if (!moveEquip.IsDebug)
{
moveEquip.StartRun();
}
}
ledProcessTimer.Enabled = true;
IoCheckTimer.Enabled = true;
mainTimer.Enabled = true;
return true;
}
return false;
}
public override void Reset(bool isNeedClearAuto = true)
{
mainTimer.Enabled = false;
IoCheckTimer.Enabled = false;
//停止运动
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Reset;
mainTimer.Enabled = false;
IoCheckTimer.Enabled = false;
isInSuddenDown = false;
isNoAirCheck = false;
alarmType = StoreAlarmType.None;
WarnMsg = "";
foreach (AC_BOX_Bean equip in BoxMap.Values)
{
//调试状态不再重置
if (!equip.IsDebug)
{
if (!equip.alarmType.Equals(StoreAlarmType.None))
{
LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位");
equip.Reset();
}
else
{
LogUtil.info(Name + "收到复位信号," + equip.Name + " 正常无报警,不需要复位");
}
}
}
IoCheckTimer.Enabled = true;
mainTimer.Enabled = true;
}
public override void StopRun()
{
IoCheckTimer.Enabled = false;
mainTimer.Enabled = false;
ledProcessTimer.Enabled = false;
//停止运行时,把阻挡气缸上升
StopMove();
storeRunStatus = StoreRunStatus.Wait;
TimeSpan span = DateTime.Now - StartTime;
LogUtil.info( Name + ",停止运行,总运行时间:" + span.ToString());
}
#region 灯光处理
private void LedProcess(object sender, ElapsedEventArgs e)
{
//try
//{
// DateTime time = DateTime.Now;
// //黄灯
// if ( storeRunStatus.Equals(StoreRunStatus.HomeMoving) || storeRunStatus.Equals(StoreRunStatus.Reset))
// {
// //开机执行中时黄灯闪烁
// if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.HIGH))
// {
// IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
// }
// else
// {
// IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
// }
// }
// //休眠状态黄灯常亮
// else if (IsSleep)
// {
// if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.LOW))
// {
// IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
// }
// }
// else
// {
// if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.HIGH))
// {
// IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
// }
// }
// bool isNeedAlarmLed = false;
// bool isInOut = false;
// if (alarmType.Equals(StoreAlarmType.None).Equals(false) || isNoAirCheck || isInSuddenDown || TrayManager.TrayErrorMsg != "")
// {
// isNeedAlarmLed = true;
// }
// foreach (AC_Packing_Box moveEquip in BoxConfigMap.Values)
// {
// if (!moveEquip.alarmType.Equals(StoreAlarmType.None))
// {
// isNeedAlarmLed = true;
// }
// if (moveEquip.MoveInfo.MoveType.Equals(LineMoveType.InStore) || moveEquip.MoveInfo.MoveType.Equals(LineMoveType.OutStore))
// {
// isInOut = true;
// }
// }
// //忙碌中,判断是否有移栽在出入库执行,绿灯闪烁
// if (isInOut)
// {
// if (IsDoValue(IO_Type.AutoRun_HddLed, IO_VALUE.LOW))
// {
// IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
// }
// else
// {
// IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
// }
// }
// else if (IsDoValue(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH))
// {
// IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
// }
// //报警中 ,红灯闪烁
// if (isNeedAlarmLed)
// {
// if (IsDoValue(IO_Type.Alarm_HddLed, IO_VALUE.LOW))
// {
// IOMove(IO_Type.Alarm_HddLed, IO_VALUE.HIGH);
// }
// else
// {
// IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
// }
// }
// else if (IsDoValue(IO_Type.Alarm_HddLed, IO_VALUE.HIGH))
// {
// IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
// }
//}
//catch (Exception ex)
//{
// LogUtil.error(Name + "灯处理定时器出错:"+ ex.ToString());
//}
//Thread.Sleep(5);
}
#endregion
/// <summary>
/// 定时处理,监听信号,监听IO
/// </summary>
protected override void timersTimer_Elapsed(object sender, ElapsedEventArgs e)
{
try
{
DateTime time = DateTime.Now;
if (storeRunStatus.Equals(StoreRunStatus.Wait))
{
//取新的Io状态
IO_VALUE fuweiValue = IOValue(IO_Type.Reset_BTN);
IO_VALUE lastFuwei = DILastValueMap[IO_Type.Reset_BTN];
addLastDI(IO_Type.Reset_BTN, fuweiValue);
bool isAutoStart = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun) == 1;
//收到复位信号后启动
if (isAutoStart && fuweiValue.Equals(IO_VALUE.HIGH) && lastFuwei.Equals(IO_VALUE.LOW))
{
//没有启动时收到复位按钮,相当于启动按钮
LogUtil.info( Name + "没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!");
bool isOk = StartRun();
if (!isOk)
{
LogUtil.error("启动失败,等待下次启动");
mainTimer.Enabled = true;
}
}
return;
}
//判断急停
else if (this.storeRunStatus >= StoreRunStatus.HomeMoving)
{
foreach (AC_BOX_Bean moveEquip in this.BoxMap.Values)
{
if (!moveEquip.IsDebug)
{
moveEquip.TimerProcess();
}
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "主定时器出错:" + ex.ToString());
}
Thread.Sleep(1);
}
/// <summary>
/// 气压检测处理
/// </summary>
private IO_VALUE CheckAir(IO_VALUE airCheck, IO_VALUE lastAir)
{
IO_VALUE airValue = IO_VALUE.HIGH;
if (airCheck == IO_VALUE.LOW && (!isInSuddenDown))
{
//判断是否持续了3秒
if (lastAir == IO_VALUE.LOW)
{
if ((DateTime.Now - lastAirCloseTime).TotalSeconds > Config.AirCheckSeconds)
{
SetWarnMsg("持续"+Config.AirCheckSeconds+"秒未检测到气压信号");
//SendAlarmCode(0, LineAlarm.NoAirCheck);
airValue = IO_VALUE.LOW;
}
}
else
{
lastAirCloseTime = DateTime.Now;
isNoAirCheck = false;
}
}
else
{
isNoAirCheck = false;
}
return airValue;
}
public override void StopMove()
{
foreach (AC_BOX_Bean equip in this.BoxMap.Values)
{
if (!equip.IsDebug)
{
equip.StopRun();
}
}
MoveInfo.EndMove();
}
protected override void ResetProcess()
{
bool isOk = true;
//判断是否所有的已经返回完成
foreach (AC_BOX_Bean moveEquip in this.BoxMap.Values)
{
if ((moveEquip.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || moveEquip.storeRunStatus.Equals(StoreRunStatus.Reset)) && moveEquip.IsDebug.Equals(false))
{
if (moveEquip.alarmType.Equals(StoreAlarmType.None))
{
isOk = false;
break;
}
else
{
WarnMsg = moveEquip.Name + "在复位过程中报警,需要重新复位";
}
}
}
if (isOk)
{
//所有原点重置完成
storeRunStatus = StoreRunStatus.Runing;
LogUtil.info( Name + "所有设备重置完成");
}
}
private void SetWarnMsg(string msg)
{
WarnMsg = msg;
LogUtil.error(Name + WarnMsg);
}
public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType)
{
throw new NotImplementedException();
}
protected override void ReturnHomeProcess()
{
throw new NotImplementedException();
}
}
}
\ No newline at end of file \ No newline at end of file
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
partial class PackingStoreBean
{
#region 出库
public override bool StartOutStoreMove(InOutParam param)
{
return true;
}
protected override void OutStoreProcess()
{
}
#endregion
#region 入库
public override void StartInStoreMove(InOutParam param)
{
}
protected override void InStoreProcess()
{
}
#endregion
}
}
\ No newline at end of file \ No newline at end of file
...@@ -19,8 +19,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -19,8 +19,9 @@ namespace OnlineStore.DeviceLibrary
public static int CurrInOutType = 0; public static int CurrInOutType = 0;
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static AC_SA_BoxBean Store = null; public static PackingStoreBean Store = null;
public static AC_SA_Config Config = null; public static Store_Config Config = null;
public static Dictionary<int, StoreConfig> AllConfigMap = null;
private static bool isInit = false; private static bool isInit = false;
public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals(""); public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
public StoreManager() public StoreManager()
...@@ -44,10 +45,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -44,10 +45,11 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
public static AC_SA_BoxBean InitStore() public static PackingStoreBean InitStore()
{ {
try try
{ {
AllConfigMap = new Dictionary<int, StoreConfig>();
StoreConfig.ProIOIpMap = new Dictionary<string, string>(); StoreConfig.ProIOIpMap = new Dictionary<string, string>();
if (!isInit) if (!isInit)
{ {
...@@ -66,27 +68,31 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,27 +68,31 @@ namespace OnlineStore.DeviceLibrary
isInit = true; isInit = true;
string storeType = ConfigAppSettings.GetValue(Setting_Init.Store_Type); string storeType = ConfigAppSettings.GetValue(Setting_Init.Store_Type);
int count = ConfigAppSettings.GetIntValue(Setting_Init.store_count);
LogUtil.info(LOGGER, "配置的料仓 类型=" + storeType + ",开始加载料仓配置"); LogUtil.info(LOGGER, "配置的料仓 类型=" + storeType + ",开始加载料仓配置");
if (storeType == StoreType.RC_AC_SA) string appPath = Application.StartupPath;
string CID = ConfigAppSettings.GetValue(Setting_Init.Store_CID);
Dictionary<int, AC_BOX_Config> storeConfig = new Dictionary<int, AC_BOX_Config>();
if (storeType == StoreType.RC_AC_PA)
{ {
string appPath = Application.StartupPath;
string CID = ConfigAppSettings.GetValue(Setting_Init.Store_CID);
string linefilePath = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_ConfigPath); string linefilePath = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_ConfigPath);
int storeID = ConfigAppSettings.GetIntValue(Setting_Init.Store_ID); Config = CSVConfigReader.LoadLineConfig(0, CID, "Line", linefilePath);
StoreConfig storeConfig = CSVConfigReader.LoadConfig(storeID, CID, StoreType.RC_AC_SA, linefilePath); AllConfigMap.Add(0, Config);
string positionConfigFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_Position_Config);
if (File.Exists(positionConfigFile)) string moveEquipConfig = ConfigAppSettings.GetValue(Setting_Init.BOX_ConfigPath);
for (int i = 1; i <= count; i++)
{ {
LogUtil.info(LOGGER, "加载位置文件:" + positionConfigFile); string nameStr = i.ToString().PadLeft(1, '0');
CSVPositionReader<ACStorePosition>.ReloadCSVFile(positionConfigFile); string config = appPath + moveEquipConfig.Replace(".csv", "_" + nameStr + ".csv");
AC_BOX_Config moveConfig = CSVConfigReader.LoadStoreConfig(i, CID + "_" + i, "BOX", config);
AllConfigMap.Add(i, moveConfig);
storeConfig.Add(i, moveConfig);
} }
Config = (AC_SA_Config)storeConfig;
Store = new AC_SA_BoxBean(Config);
Store.CID = CID;
LogUtil.info(LOGGER, "加载料仓完成!"); LogUtil.info(LOGGER, "加载料仓完成!");
return Store;
} }
Store = new PackingStoreBean(Config, storeConfig);
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -101,21 +107,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -101,21 +107,21 @@ namespace OnlineStore.DeviceLibrary
/// 修改了料仓配置,更新缓存,更新配置文件(只能更新PRO的配置) /// 修改了料仓配置,更新缓存,更新配置文件(只能更新PRO的配置)
/// </summary> /// </summary>
/// <param name="kTK_LA_Store_Config"></param> /// <param name="kTK_LA_Store_Config"></param>
public static void UpdateBoxConfig(AC_SA_Config storeConfig) public static void UpdateBoxConfig(AC_BOX_Config storeConfig)
{ {
try try
{ {
//位置配置到文件中 //位置配置到文件中
string appPath = Application.StartupPath; string appPath = Application.StartupPath;
string configFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_ConfigPath); string configFile = appPath + ConfigAppSettings.GetValue(Setting_Init.BOX_ConfigPath);
bool result = CSVConfigReader.SaveBoxPosition(configFile, storeConfig); bool result = CSVConfigReader.SaveBoxPosition(configFile, storeConfig);
if (!result) if (!result)
{ {
LOGGER.Error("保存配置文件失败:" + configFile); LOGGER.Error("保存配置文件失败:" + configFile);
} }
Store.Config = storeConfig; //Store.Config = storeConfig;
Store.MoveAxisConfig(); //Store.MoveAxisConfig();
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -59,17 +59,19 @@ ...@@ -59,17 +59,19 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="acSingleStore\AC_SA_BoxBean.cs" /> <Compile Include="ACPackingStore\AC_BOX_Bean.cs" />
<Compile Include="acSingleStore\AC_SA_BoxBean_Partial.cs" /> <Compile Include="ACPackingStore\AC_BOX_Bean_Partial.cs" />
<Compile Include="acSingleStore\StoreManager.cs" /> <Compile Include="ACPackingStore\PackingStoreBean.cs" />
<Compile Include="IO\AIOBOX\AIOBOXManager.cs" /> <Compile Include="ACPackingStore\PackingStoreBean_Partial.cs" />
<Compile Include="IO\IOManager.cs" /> <Compile Include="ACPackingStore\StoreManager.cs" />
<Compile Include="IO\KangNaiDe\KNDManager.cs" /> <Compile Include="device\halcon\CodeManager.cs" />
<Compile Include="IO\KangNaiDe\MasterTcpClient.cs" /> <Compile Include="device\IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="lineConnect\LineConnect.cs" /> <Compile Include="device\IO\IOManager.cs" />
<Compile Include="PanasonicServo\ACCMDManager.cs" /> <Compile Include="device\IO\KangNaiDe\KNDManager.cs" />
<Compile Include="PanasonicServo\ACServerManager.cs" /> <Compile Include="device\IO\KangNaiDe\MasterTcpClient.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.cs" /> <Compile Include="device\PanasonicServo\ACCMDManager.cs" />
<Compile Include="device\PanasonicServo\ACServerManager.cs" />
<Compile Include="device\PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="store\LineMoveP.cs" /> <Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs"> <Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
...@@ -105,13 +107,16 @@ ...@@ -105,13 +107,16 @@
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<ItemGroup> <ItemGroup>
<None Include="StoreConfig\AC\linePositions.csv"> <None Include="StoreConfig\linePositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="StoreConfig\AC\StoreConfig - 复制.csv"> <None Include="StoreConfig\StoreConfig.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="StoreConfig\AC\StoreConfig.csv"> <None Include="StoreConfig\BoxConfig_2.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\BoxConfig_1.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
......
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
DI,急停,SuddenStop_BTN,200,192.168.200.11,0,急停,X01,DI-01,0,
DI,复位,Reset_BTN,201,192.168.200.11,0,复位,X02,DI-02,0,
DI,自动,AutoRun_Signal,202,192.168.200.11,0,自动,X03,DI-03,0,
DI,气压检测,Airpressure_Check,203,192.168.200.11,0,气压检测,X04,DI-04,0,
DI,料盘检测1(进料口),TrayCheck_Door,204,192.168.200.11,0,料盘检测1(进料口),X05,DI-05,0,
DI,料盘检测2(料叉),TrayCheck_Fixture,205,192.168.200.11,0,料盘检测2(料叉),X06,DI-06,0,
DI,进料口门上升端,Door_Up,206,192.168.200.11,0,进料口门上升端,X07,DI-07,0,
DI,进料口门下降端,Door_Down,207,192.168.200.11,0,进料口门下降端,X08,DI-08,0,
,,,208,192.168.200.11,0,,X09,DI-09,0,
,,,209,192.168.200.11,0,,X10,DI-10,0,
DI,前门限位,Door_LimitSingle,210,192.168.200.11,0,前门限位,X11,DI-11,0,
,,,211,192.168.200.11,0,,X12,DI-12,0,
DI,安全光栅,SafetyLightCurtains,212,192.168.200.11,0,安全光栅,X13,DI-13,0,
,,,213,192.168.200.11,0,,X14,DI-14,0,
,,,214,192.168.200.11,0,,X15,DI-15,0,
DI,压紧机构计量检测,CompressAxis_Check,215,192.168.200.11,0,压紧机构计量检测,X16,DI-16,0,
DO,自动指示灯,AutoRun_HddLed,100,192.168.200.11,0,自动指示灯,Y01,DO-01,0,
DO,故障指示灯,Alarm_HddLed,101,192.168.200.11,0,故障指示灯,Y02,DO-02,0,
DO,待机指示灯,RunSign_HddLed,102,192.168.200.11,0,待机指示灯,Y03,DO-03,0,
DO,吹气SOL ON,StartOrStopBlow,103,192.168.200.11,0,吹气SOL ON,Y04,DO-04,0,
DO,料仓运转ON,Run_Signal,104,192.168.200.11,0,料仓运转ON,Y05,DO-05,0,
DO,轴2刹车电源ON,Axis_Brake,105,192.168.200.11,0,轴2刹车电源ON,Y06,DO-06,0,
DO,进料口门上升SOL,Door_Up,106,192.168.200.11,0,进料口门上升SOL,Y07,DO-07,0,
DO,进料口门下降SOL,Door_Down,107,192.168.200.11,0,进料口门下降SOL,Y08,DO-08,0,
,,,108,192.168.200.11,0,,Y09,DO-09,0,
,,,109,192.168.200.11,0,,Y10,DO-10,0,
DO,相机照明开,CameraLight_Power,110,192.168.200.11,0,相机照明开,Y11,DO-11,0,
,,,111,192.168.200.11,0,,Y12,DO-12,0,
,,,112,192.168.200.11,0,,Y13,DO-13,0,
,,,113,192.168.200.11,0,,Y14,DO-14,0,
,,,114,192.168.200.11,0,,Y15,DO-15,0,
,,,115,192.168.200.11,0,,Y16,DO-16,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM6,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,1,COM5,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,1,COM4,0,,,,,
,温湿度传感器地址,Temperate_ServerAddress,192.168.200.14,,,,,,,
,扫码枪IP,Scanner_Ip,192.168.200.13,,,,,,,
,扫码枪端口号,Scanner_Port,51236,,,,,,,
PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,403000,,,,,,,
PRO,升降轴 进料口出料前点 P2,UpDownAxis_DoorIPosition_P2,415000,,,,,,,
PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,415000,,,,,,,
PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,-75000,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,, ,,
PRO,设备是否处于调试状态(1=调试,0=正常),IsInDebug,0,,,,,,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,温湿度传感器地址,TemperateServer_Port,9001,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,2500,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,800,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,800,,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,800,,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,500,,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,1500,,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,400,,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,400,,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,100,,,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,1000,,,,,,,
PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,300,,,,,,,
PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,300,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,200,,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,2500,,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,2500,,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,2500,,,,,,,
PRO,升降轴(轴2)P4速度,UpDownAxis_P4_Speed,1500,,,,,,,
PRO,升降轴(轴2)P5速度,UpDownAxis_P5_Speed,2500,,,,,,,
PRO,升降轴(轴2)P6速度,UpDownAxis_P6_Speed,1000,,,,,,,
PRO,升降轴(轴2)P7速度,UpDownAxis_P7_Speed,1000,,,,,, ,
PRO,升降轴(轴2)P8速度,UpDownAxis_P8_Speed,1000,,,,,,,
PRO,旋转轴(轴1)P1速度,MiddleAxis_P1_Speed,1200,,,,,,,
PRO,旋转轴(轴1)P2速度,MiddleAxis_P2_Speed,1200,,,,,,,
PRO,进出轴(轴3)P1速度,InOutAxis_P1_Speed,1000,,,,,,,
PRO,进出轴(轴3)P2速度,InOutAxis_P2_Speed,1000,,,,,,,
PRO,进出轴(轴3)P3速度,InOutAxis_P3_Speed,1000,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最小值,MiddleAxis_ErrorCountMin,10,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,,,, ,
PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最大值,MiddleAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,, ,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,,
PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,,
PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,,
PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,,
PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,,
PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
,,,,,,,,, ,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM3,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,5000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,6000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,6000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制归零速度(原点返回速度),CompressAxis_HomeSpeed,5000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,,,
,,,,,,,,, ,
PRO,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.12,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2920,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2920,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2920,,,,,,,
,,,,,,,,, ,
PRO,模拟信号1的地址,AIDI1_Addr,7,,,,,,,
PRO,模拟信号2的地址,AIDI2_Addr,8,,,,,,,
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID, 类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
PRO,IO模块对应的DI数量,IO_DILength,192.168.200.11#8,,,,,,, DI,L侧门禁,DoorLimit,3,PRO_AOI_IP_1,0,料盘检测1(进料口),X04,DI-04,0,
PRO,模块对应的DO数量,IO_DOLength,192.168.200.11#8,,,,,,, ,,,,,,,,,,
PRO,是否有仓门,HasDoor,1,,,,,,, DI,L侧料盘检测1(识别区),TrayCheck_1,0,PRO_AOI_IP_2,0,L侧料盘检测1(识别区),X21,DI-21,0,
PRO,IO模块IP,PRO_AOI_IP_1,192.168.200.11,,,,,,, DI,L侧料盘检测2(识别区),TrayCheck_2,1,PRO_AOI_IP_2,0,L侧料盘检测2(识别区),X22,DI-22,0,
DI,L侧料盘检测3(识别区),TrayCheck_3,2,PRO_AOI_IP_2,0,L侧料盘检测3(识别区),X23,DI-23,0,
DI,L侧料盘检测4(识别区),TrayCheck_4,3,PRO_AOI_IP_2,0,L侧料盘检测4(识别区),X24,DI-24,0,
DI,L侧入料口移门关闭端,EntranceDoor_Close,4,PRO_AOI_IP_2,0,L侧入料口移门关闭端,X25,DI-25,0,
DI,L侧入料口移门打开端,EntranceDoor_Open,5,PRO_AOI_IP_2,0,L侧入料口移门打开端,X26,DI-26,0,
DI,L侧线体入料口检测,LineIn_Check,6,PRO_AOI_IP_2,0,L侧线体入料口检测,X27,DI-27,0,
DI,L侧线体取料位检测,LineTake_Check,7,PRO_AOI_IP_2,0,L侧线体取料位检测,X28,DI-28,0,
DI,L侧料叉压紧确认检测,Compress_Check,8,PRO_AOI_IP_2,0,L侧料叉压紧确认检测,X29,DI-29,0,
DI,L侧NG料口料盘检测,NGTrayCheck,9,PRO_AOI_IP_2,0,L侧NG料口料盘检测,X30,DI-30,0,
DI,L侧NG料口升降门上升端,NGDoowCylinder_Up,10,PRO_AOI_IP_2,0,L侧NG料口升降门上升端,X31,DI-31,0,
DI,L侧NG料口升降门上升端,NGDoorCylinder_Down,11,PRO_AOI_IP_2,0,L侧NG料口升降门上升端,X32,DI-32,0,
DI,L侧顶升装置上升端,TopCylinder_Up,12,PRO_AOI_IP_2,0,L侧顶升装置上升端,X33,DI-33,0,
DI,L侧顶升装置下降端,TopCylinder_Down,13,PRO_AOI_IP_2,0,L侧顶升装置下降端,X34,DI-34,0,
DI,L侧定位装置上升端,LocationCylinder_Up,14,PRO_AOI_IP_2,0,L侧定位装置上升端,X35,DI-35,0,
DI,L侧定位装置下降端,LocationCylinder_Down,15,PRO_AOI_IP_2,0,L侧定位装置下降端,X36,DI-36,0,
,,,,,,,,,,
DO,L侧料仓运转ON,Run_Signal,0,PRO_AOI_IP_2,0,L侧料仓运转ON,Y21,DO-21,0,
DO,L侧轴2刹车电源ON,Axis_Brake,1,PRO_AOI_IP_2,0,L侧轴2刹车电源ON,Y22,DO-22,0,
DO,L侧相机光源ON,Camera_Led,2,PRO_AOI_IP_2,0,L侧相机光源ON,Y23,DO-23,0,
DO,L侧入料口移门关闭,EntranceDoor_Close,3,PRO_AOI_IP_2,0,L侧入料口移门关闭,Y24,DO-24,0,
DO,L侧入料口移门打开,EntranceDoor_Open,4,PRO_AOI_IP_2,0,L侧入料口移门打开,Y25,DO-25,0,
DO,L侧线体正转,Line_Run,5,PRO_AOI_IP_2,0,L侧线体正转,Y26,DO-26,0,
DO,L侧线体反转,Line_BackRun,6,PRO_AOI_IP_2,0,L侧线体反转,Y27,DO-27,0,
DO,L侧料仓吹气SOL,StartOrStopBlow,7,PRO_AOI_IP_2,0,L侧料仓吹气SOL,Y28,DO-28,0,
DO,L侧NG料口升降门上升SOL,NGDoowCylinder_Up,8,PRO_AOI_IP_2,0,L侧NG料口升降门上升SOL,Y29,DO-29,0,
DO,L侧NG料口升降门下降SOL,NGDoorCylinder_Down,9,PRO_AOI_IP_2,0,L侧NG料口升降门下降SOL,Y30,DO-30,0,
DO,L侧顶升装置上升SOL,TopCylinder_Up,10,PRO_AOI_IP_2,0,L侧顶升装置上升SOL,Y31,DO-31,0,
DO,L侧顶升装置下降SOL,TopCylinder_Down,11,PRO_AOI_IP_2,0,L侧顶升装置下降SOL,Y32,DO-32,0,
DO,L侧定位装置上升SOL,LocationCylinder_Up,12,PRO_AOI_IP_2,0,L侧定位装置上升SOL,Y33,DO-33,0,
DO,L侧定位装置下降SOL,LocationCylinder_Down,13,PRO_AOI_IP_2,0,L侧定位装置下降SOL,Y34,DO-34,0,
,,,14,PRO_AOI_IP_2,0,,Y35,DO-35,0,
,,,15,PRO_AOI_IP_2,0,,Y36,DO-36,0,
,,,,,,,,,, ,,,,,,,,,,
DI,急停,SuddenStop_BTN,0,PRO_AOI_IP_1,0,急停,X01,DI-01,0,
DI,复位,Reset_BTN,1,PRO_AOI_IP_1,0,复位,X02,DI-02,0,
DI,门禁,DoorLimit,2,PRO_AOI_IP_1,0,门禁,X03,DI-03,0,
DI,料盘检测1(进料口),TrayCheck_Door,3,PRO_AOI_IP_1,0,料盘检测1(进料口),X04,DI-04,0,
DI,料盘检测2(料叉),TrayCheck_Fixture,4,PRO_AOI_IP_1,0,料盘检测2(料叉),X05,DI-05,0,
DI,气压检测,Airpressure_Check,5,PRO_AOI_IP_1,0,气压检测,X06,DI-06,0,
DI,进料口门上升端,Door_Up,6,PRO_AOI_IP_1,0,进料口门上升端,X07,DI-07,0,
DI,进料口门下降端,Door_Down,7,PRO_AOI_IP_1,0,进料口门下降端,X08,DI-08,0,
DO,自动指示灯,AutoRun_HddLed,0,PRO_AOI_IP_1,0,自动指示灯,Y01,DO-01,0,
DO,故障指示灯,Alarm_HddLed,1,PRO_AOI_IP_1,0,故障指示灯,Y02,DO-02,0,
DO,待机指示灯,RunSign_HddLed,2,PRO_AOI_IP_1,0,待机指示灯,Y03,DO-03,0,
DO,料仓运转ON,Run_Signal,3,PRO_AOI_IP_1,0,料仓运转ON,Y04,DO-04,0,
DO,轴2刹车电源ON,Axis_Brake,4,PRO_AOI_IP_1,0,轴2刹车电源ON,Y05,DO-05,0,
DO,料仓吹气SOL,StartOrStopBlow,5,PRO_AOI_IP_1,0,料仓吹气SOL,Y06,DO-06,0,
DO,进料口门上升SOL,Door_Up,6,PRO_AOI_IP_1,0,进料口门上升SOL,Y07,DO-07,0,
DO,进料口门下降SOL,Door_Down,7,PRO_AOI_IP_1,0,进料口门下降SOL,Y08,DO-08,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM1,0,,,,, AXIS,(轴一)旋转轴,Middle_Axis,1,COM1,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,2,COM1,0,,,,, AXIS,(轴二)升降轴轴,UpDown_Axis,2,COM1,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,, AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,,
...@@ -31,13 +46,7 @@ PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,, ...@@ -31,13 +46,7 @@ PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,, PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,, PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,10000,,,,,,, PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,10000,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,, ,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,250,,,,,,, PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,250,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,80,,,,,,, PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,80,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,80,,,,,,, PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,80,,,,,,,
...@@ -65,7 +74,7 @@ PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,200,,,,,,, ...@@ -65,7 +74,7 @@ PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,200,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,250,,,,,,, PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,250,,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,250,,,,,,, PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,250,,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,250,,,,,,, PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,250,,,,,,,
PRO,升降轴(轴2)P4速度,UpDownAxis_P4_Speed,150,,,,,,, PRO,升降轴(轴2)P4速度,UpDownAxis_P4_Speed,150,,,,,,,
PRO,升降轴(轴2)P5速度,UpDownAxis_P5_Speed,250,,,,,,, PRO,升降轴(轴2)P5速度,UpDownAxis_P5_Speed,250,,,,,,,
PRO,升降轴(轴2)P6速度,UpDownAxis_P6_Speed,100,,,,,,, PRO,升降轴(轴2)P6速度,UpDownAxis_P6_Speed,100,,,,,,,
...@@ -84,21 +93,26 @@ PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,, ...@@ -84,21 +93,26 @@ PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,, PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最大值,MiddleAxis_ErrorCountMax,1000,,,,,,, PRO,(轴一)旋转轴停止时可误差的脉冲数的最大值,MiddleAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,,,,,,, PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,, PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,, ,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,, PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,,
PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,, PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,,
PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,, PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,,
PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,, PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,,
PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,, PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,,
PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,, PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,, ,
PRO,预警湿度,WarnHumidity,80,,,,,, ,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,, PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,, PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,, PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,, PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM2,,,,,,, PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
DI,R侧门禁,DoorLimit,4,PRO_AOI_IP_1,0,料盘检测2(料叉),X05,DI-05,0,
,,,,,,,,,,
DI,R侧料盘检测1(识别区),TrayCheck_1,0,PRO_AOI_IP_3,0,R侧料盘检测1(识别区),X41,DI-41,0,
DI,R侧料盘检测2(识别区),TrayCheck_2,1,PRO_AOI_IP_3,0,R侧料盘检测2(识别区),X42,DI-42,0,
DI,R侧料盘检测3(识别区),TrayCheck_3,2,PRO_AOI_IP_3,0,R侧料盘检测3(识别区),X43,DI-43,0,
DI,R侧料盘检测4(识别区),TrayCheck_4,3,PRO_AOI_IP_3,0,R侧料盘检测4(识别区),X44,DI-44,0,
DI,R侧入料口移门关闭端,EntranceDoor_Close,4,PRO_AOI_IP_3,0,R侧入料口移门关闭端,X45,DI-45,0,
DI,R侧入料口移门打开端,EntranceDoor_Open,5,PRO_AOI_IP_3,0,R侧入料口移门打开端,X46,DI-46,0,
DI,R侧线体入料口检测,LineIn_Check,6,PRO_AOI_IP_3,0,R侧线体入料口检测,X47,DI-47,0,
DI,R侧线体取料位检测,LineTake_Check,7,PRO_AOI_IP_3,0,R侧线体取料位检测,X48,DI-48,0,
DI,R侧料叉压紧确认检测,Compress_Check,8,PRO_AOI_IP_3,0,R侧料叉压紧确认检测,X49,DI-49,0,
DI,R侧NG料口料盘检测,NGTrayCheck,9,PRO_AOI_IP_3,0,R侧NG料口料盘检测,X50,DI-50,0,
DI,R侧NG料口升降门上升端,NGDoowCylinder_Up,10,PRO_AOI_IP_3,0,R侧NG料口升降门上升端,X51,DI-51,0,
DI,R侧NG料口升降门上升端,NGDoorCylinder_Down,11,PRO_AOI_IP_3,0,R侧NG料口升降门上升端,X52,DI-52,0,
DI,R侧顶升装置上升端,TopCylinder_Up,12,PRO_AOI_IP_3,0,R侧顶升装置上升端,X53,DI-53,0,
DI,R侧顶升装置下降端,TopCylinder_Down,13,PRO_AOI_IP_3,0,R侧顶升装置下降端,X54,DI-54,0,
DI,R侧定位装置上升端,LocationCylinder_Up,14,PRO_AOI_IP_3,0,R侧定位装置上升端,X55,DI-55,0,
DI,R侧定位装置下降端,LocationCylinder_Down,15,PRO_AOI_IP_3,0,R侧定位装置下降端,X56,DI-56,0,
,,,,,,,,,,
DO,R侧料仓运转ON,Run_Signal,0,PRO_AOI_IP_3,0,R侧料仓运转ON,Y41,DO-41,0,
DO,R侧轴2刹车电源ON,Axis_Brake,1,PRO_AOI_IP_3,0,R侧轴2刹车电源ON,Y42,DO-42,0,
DO,R侧相机光源ON,Camera_Led,2,PRO_AOI_IP_3,0,R侧相机光源ON,Y43,DO-43,0,
DO,R侧入料口移门关闭,EntranceDoor_Close,3,PRO_AOI_IP_3,0,R侧入料口移门关闭,Y44,DO-44,0,
DO,R侧入料口移门打开,EntranceDoor_Open,4,PRO_AOI_IP_3,0,R侧入料口移门打开,Y45,DO-45,0,
DO,R侧线体正转,Line_Run,5,PRO_AOI_IP_3,0,R侧线体正转,Y46,DO-46,0,
DO,R侧线体反转,Line_BackRun,6,PRO_AOI_IP_3,0,R侧线体反转,Y47,DO-47,0,
DO,R侧料仓吹气SOL,StartOrStopBlow,7,PRO_AOI_IP_3,0,R侧料仓吹气SOL,Y48,DO-48,0,
DO,R侧NG料口升降门上升SOL,NGDoowCylinder_Up,8,PRO_AOI_IP_3,0,R侧NG料口升降门上升SOL,Y49,DO-49,0,
DO,R侧NG料口升降门上升SOL,NGDoorCylinder_Down,9,PRO_AOI_IP_3,0,R侧NG料口升降门上升SOL,Y50,DO-50,0,
DO,R侧顶升装置上升SOL,TopCylinder_Up,10,PRO_AOI_IP_3,0,R侧顶升装置上升SOL,Y51,DO-51,0,
DO,R侧顶升装置下降SOL,TopCylinder_Down,11,PRO_AOI_IP_3,0,R侧顶升装置下降SOL,Y52,DO-52,0,
DO,R侧定位装置上升SOL,LocationCylinder_Up,12,PRO_AOI_IP_3,0,R侧定位装置上升SOL,Y53,DO-53,0,
DO,R侧定位装置下降SOL,LocationCylinder_Down,13,PRO_AOI_IP_3,0,R侧定位装置下降SOL,Y54,DO-54,0,
,,,14,PRO_AOI_IP_3,0,,Y55,DO-55,0,
,,,15,PRO_AOI_IP_3,0,,Y56,DO-56,0,
,,,,,,,,,,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM1,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,2,COM1,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,,
AXIS,(轴四)压紧轴,Comp_Axis,4,COM1,0,,,,,
PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,403000,,,,,,,
PRO,升降轴 进料口出料前点 P2,UpDownAxis_DoorIPosition_P2,415000,,,,,,,
PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,415000,,,,,,,
PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,10000,,,,,,,
,,,,,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,250,,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,80,,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,80,,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,80,,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,50,,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,150,,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,400,,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,400,,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,100,,,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,200,,,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,200,,,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,100,,,,,,,
PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,300,,,,,,,
PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,300,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,200,,,,,,,
PRO,(轴四)压紧轴目标速度,CompAxis_TargetSpeed,100,,,,,,,
PRO,(轴四)压紧轴加速度,CompAxis_AddSpeed,300,,,,,,,
PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,300,,,,,,,
PRO,(轴四)压紧轴原点低速,CompAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴四)压紧轴原点高速,CompAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,200,,,,,,,
,,,,,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,250,,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,250,,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,250,,,,,,,
PRO,升降轴(轴2)P4速度,UpDownAxis_P4_Speed,150,,,,,,,
PRO,升降轴(轴2)P5速度,UpDownAxis_P5_Speed,250,,,,,,,
PRO,升降轴(轴2)P6速度,UpDownAxis_P6_Speed,100,,,,,,,
PRO,升降轴(轴2)P7速度,UpDownAxis_P7_Speed,100,,,,,, ,
PRO,升降轴(轴2)P8速度,UpDownAxis_P8_Speed,100,,,,,,,
PRO,旋转轴(轴1)P1速度,MiddleAxis_P1_Speed,120,,,,,,,
PRO,旋转轴(轴1)P2速度,MiddleAxis_P2_Speed,120,,,,,,,
PRO,进出轴(轴3)P1速度,InOutAxis_P1_Speed,100,,,,,,,
PRO,进出轴(轴3)P2速度,InOutAxis_P2_Speed,100,,,,,,,
PRO,进出轴(轴3)P3速度,InOutAxis_P3_Speed,1000,,,,,,,
PRO,压紧轴(轴4)P1速度,CompAxis_P1_Speed,100,,,,,,,
PRO,压紧轴(轴4)P2速度,CompAxis_P2_Speed,100,,,,,,,
PRO,压紧轴(轴4)P3速度,CompAxis_P3_Speed,100,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最小值,MiddleAxis_ErrorCountMin,10,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,,,, ,
PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最大值,MiddleAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最大值,UpdownAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,, ,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,,
PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,,
PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,,
PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,,
PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,,
PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,,
,,,,,,,,, ,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,, ,
PRO,预警湿度,WarnHumidity,80,,,,,, ,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
PRO,IO模块对应的DI数量,IO_DILength,192.168.100.30#8;192.168.100.32#8;192.168.100.34#8;192.168.100.36#8;192.168.100.38#8;,,,,,
PRO,IO模块对应的DO数量,IO_DOLength,192.168.100.30#8;192.168.100.32#8;192.168.100.34#8;192.168.100.36#8;192.168.100.38#8;,,,,,
PRO,是否有仓门,HasDoor,1,,,,,,,
PRO,IO模块IP,PRO_AOI_IP_1,192.168.200.11,,,,,,,
PRO,IO模块IP,PRO_AOI_IP_2,192.168.200.12,,,,,,,
PRO,IO模块IP,PRO_AOI_IP_3,192.168.200.13,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
DI,急停,SuddenStop_BTN,0,PRO_AOI_IP_1,0,急停,X01,DI-01,0,
DI,复位,Reset_BTN,1,PRO_AOI_IP_1,0,复位,X02,DI-02,0,
DI,气压检测,Airpressure_Check,2,PRO_AOI_IP_1,0,门禁,X03,DI-03,0,
DI,L侧门禁,DoorLimit_L,3,PRO_AOI_IP_1,0,料盘检测1(进料口),X04,DI-04,0,
DI,R侧门禁,DoorLimit_R,4,PRO_AOI_IP_1,0,料盘检测2(料叉),X05,DI-05,0,
,,,5,PRO_AOI_IP_1,0,气压检测,X06,DI-06,0,
,,,6,PRO_AOI_IP_1,0,进料口门上升端,X07,DI-07,0,
,,,7,PRO_AOI_IP_1,0,进料口门下降端,X08,DI-08,0,
,,,8,PRO_AOI_IP_1,0,,X09,DI-09,0,
,,,9,PRO_AOI_IP_1,0,,X10,DI-10,0,
,,,10,PRO_AOI_IP_1,0,,X11,DI-11,0,
,,,11,PRO_AOI_IP_1,0,,X12,DI-12,0,
,,,12,PRO_AOI_IP_1,0,,X13,DI-13,0,
,,,13,PRO_AOI_IP_1,0,,X14,DI-14,0,
,,,14,PRO_AOI_IP_1,0,,X15,DI-15,0,
,,,15,PRO_AOI_IP_1,0,,X16,DI-16,0,
,,,,,,,,,,
DO,自动指示灯,AutoRun_HddLed,0,PRO_AOI_IP_1,0,自动指示灯,Y01,DO-01,0,
DO,故障指示灯,Alarm_HddLed,1,PRO_AOI_IP_1,0,故障指示灯,Y02,DO-02,0,
DO,待机指示灯,RunSign_HddLed,2,PRO_AOI_IP_1,0,待机指示灯,Y03,DO-03,0,
DO,报警蜂鸣器,Alarm_Buzzer,3,PRO_AOI_IP_1,0,报警蜂鸣器,Y04,DO-04,0,
DO,NG料线体电机运转,NGLine_Run,4,PRO_AOI_IP_1,0,NG料线体电机运转,Y05,DO-05,0,
,,,5,PRO_AOI_IP_1,0,,Y06,DO-06,0,
,,,6,PRO_AOI_IP_1,0,,Y07,DO-07,0,
,,,7,PRO_AOI_IP_1,0,,Y08,DO-08,0,
,,,8,PRO_AOI_IP_1,0,,Y09,DO-09,0,
,,,9,PRO_AOI_IP_1,0,,Y10,DO-10,0,
,,,10,PRO_AOI_IP_1,0,,Y11,DO-11,0,
,,,11,PRO_AOI_IP_1,0,,Y12,DO-12,0,
,,,12,PRO_AOI_IP_1,0,,Y13,DO-13,0,
,,,13,PRO_AOI_IP_1,0,,Y14,DO-14,0,
,,,14,PRO_AOI_IP_1,0,,Y15,DO-15,0,
,,,15,PRO_AOI_IP_1,0,,Y16,DO-16,0,
,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,, ,
PRO,预警湿度,WarnHumidity,80,,,,,, ,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,,,
PRO,需要吹气的温度(温度标准),Max_Temperature,0,,,,,,,
PRO,需要吹气的湿度(湿度标准),Max_Humidity,10,,,,,,,
PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
...@@ -16,53 +16,56 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,53 +16,56 @@ namespace OnlineStore.DeviceLibrary
#region KNDIO #region KNDIO
public static void IOMove(string ioType, IO_VALUE ioValue) public static void IOMove(string ioType, IO_VALUE ioValue, int subType = 0)
{ {
if (StoreManager.Config.StoreDOList.ContainsKey(ioType)) ConfigIO configIo = GetDO(ioType, subType);
if (configIo != null)
{ {
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType];
//DateTime time = DateTime.Now;
instance.WriteSingleDO(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr(), ioValue); instance.WriteSingleDO(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr(), ioValue);
//TimeSpan span = DateTime.Now - time;
//if (span.TotalMilliseconds > 100)
//{
// LogUtil.error("IOMove [" + ioType + "] ["+ioValue+"]耗时" + span.TotalMilliseconds);
//}
Thread.Sleep(60); Thread.Sleep(60);
} }
else else
{ {
LogUtil.error("没有DO=" + ioType); LogUtil.error("未找到DO,[" + ioType + "][" + subType + "]");
} }
} }
public static IO_VALUE IOValue(string ioType) public static IO_VALUE IOValue(string ioType, int subType)
{ {
IO_VALUE ioValue = IO_VALUE.LOW; IO_VALUE ioValue = IO_VALUE.LOW;
if (StoreManager.Config.StoreDIList.ContainsKey(ioType)) ConfigIO configIo = GetDI(ioType, subType);
if (configIo == null)
{ {
ConfigIO configIo = StoreManager.Config.StoreDIList[ioType]; configIo = GetDO(ioType, subType);
ioValue = instance.GetDIValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr());
//UpdateDoValue(ioType, ioValue);
} }
else if (StoreManager.Config.StoreDOList.ContainsKey(ioType))
if (configIo != null)
{ {
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType]; if (configIo.ProType.Equals(ConfigItemType.DI))
ioValue = instance.GetDOValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr()); {
ioValue = instance.GetDIValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr());
}
else
{
ioValue = instance.GetDOValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr());
}
} }
else else
{ {
LogUtil.error("没有DO=" + ioType); LogUtil.error("未找到IO[" + ioType + "][" + subType + "]");
} }
return ioValue; return ioValue;
} }
public static IO_VALUE DOValue(string ioType) public static IO_VALUE DOValue(string ioType, int subType = 0)
{ {
IO_VALUE ioValue = IO_VALUE.LOW; IO_VALUE ioValue = IO_VALUE.LOW;
if (StoreManager.Config.StoreDOList.ContainsKey(ioType)) ConfigIO configIo = GetDO(ioType, subType);
if (configIo != null)
{ {
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType];
ioValue = instance.GetDOValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr()); ioValue = instance.GetDOValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr());
} }
else else
...@@ -71,6 +74,78 @@ namespace OnlineStore.DeviceLibrary ...@@ -71,6 +74,78 @@ namespace OnlineStore.DeviceLibrary
} }
return ioValue; return ioValue;
} }
private static ConfigIO GetDI(string ioType, int subType)
{
ConfigIO configIo = null;
if (subType <= 0)
{
if (StoreManager.Config.DIList.ContainsKey(ioType))
{
return StoreManager.Config.DIList[ioType];
}
}
else
{
if (StoreManager.AllConfigMap.ContainsKey(subType))
{
string newType = ioType.Replace("SW1_", "SW_").Replace("SW2_", "SW_").Replace("SW3_", "SW_").Replace("SW4_", "SW_");
if (StoreManager.AllConfigMap[subType].DIList.ContainsKey(newType))
{
return StoreManager.AllConfigMap[subType].DIList[newType];
}
}
}
return configIo;
}
private static ConfigIO GetDO(string ioType, int subType)
{
ConfigIO configIo = null;
if (subType <= 0)
{
if (StoreManager.Config.DOList.ContainsKey(ioType))
{
return StoreManager.Config.DOList[ioType];
}
}
else
{
if (StoreManager.AllConfigMap.ContainsKey(subType))
{
string newType = ioType.Replace("SW1_", "SW_").Replace("SW2_", "SW_").Replace("SW3_", "SW_").Replace("SW4_", "SW_");
if (StoreManager.AllConfigMap[subType].DOList.ContainsKey(newType))
{
return StoreManager.AllConfigMap[subType].DOList[newType];
}
}
}
return configIo;
}
public static void CloseDeviceDO(List<ConfigIO> DoList)
{
foreach (ConfigIO io in DoList)
{
instance.WriteSingleDO(io.IO_IP, io.SlaveID, io.GetIOAddr(), IO_VALUE.LOW);
Thread.Sleep(60);
}
}
public static void CloseDeviceDO(int subType)
{
List<ConfigIO> DoList = new List<ConfigIO>();
if (subType <= 0)
{
DoList = new List<ConfigIO>(StoreManager.Config.DOList.Values);
}
else
{
if (StoreManager.AllConfigMap.ContainsKey(subType))
{
DoList = new List<ConfigIO>(StoreManager.AllConfigMap[subType].DOList.Values);
}
}
CloseDeviceDO(DoList);
}
#endregion #endregion
public static void Init() public static void Init()
{ {
...@@ -84,7 +159,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -84,7 +159,7 @@ namespace OnlineStore.DeviceLibrary
instance = new KNDManager(); instance = new KNDManager();
} }
} }
public abstract void ReadAllDI(string deviceName, byte slaveId); public abstract void ReadAllDI(string deviceName, byte slaveId);
public abstract void ReadAllDO(string deviceName, byte slaveId); public abstract void ReadAllDO(string deviceName, byte slaveId);
...@@ -92,18 +167,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -92,18 +167,14 @@ namespace OnlineStore.DeviceLibrary
public abstract void WriteSingleDO(string deviceName, byte slaveId, ushort index, IO_VALUE value); public abstract void WriteSingleDO(string deviceName, byte slaveId, ushort index, IO_VALUE value);
public abstract IO_VALUE GetDIValue(string deviceName, byte slaveID, ushort v); public abstract IO_VALUE GetDIValue(string deviceName, byte slaveID, ushort v);
public abstract IO_VALUE GetDOValue(string deviceName, byte slaveID, ushort v); public abstract IO_VALUE GetDOValue(string deviceName, byte slaveID, ushort v);
public abstract IO_VALUE GetIOValue(ConfigIO configIO); public abstract IO_VALUE GetIOValue(ConfigIO configIO);
public abstract void CloseAllDO(); public abstract void CloseAllDO();
public abstract void CloseAllConnection(); public abstract void CloseAllConnection();
} }
......
...@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary
public class CodeManager public class CodeManager
{ {
public static List<string> cameraNameList = new List<string>(); // public static List<string> cameraNameList = new List<string>();
public static List<string> codeTypeList = new List<string>(); public static List<string> codeTypeList = new List<string>();
public static List<string> balserNameList = new List<string>(); public static List<string> balserNameList = new List<string>();
...@@ -23,56 +23,86 @@ namespace OnlineStore.DeviceLibrary ...@@ -23,56 +23,86 @@ namespace OnlineStore.DeviceLibrary
private static char spiltChar = '#'; private static char spiltChar = '#';
/// <summary> /// <summary>
/// 初始化摄像机名称和二维码类型 /// 初始化摄像机名称和二维码类型
/// </summary> /// </summary>
/// <param name="nameStr">摄像机名称,多个用#分割</param> public static void LoadConfig()
/// <param name="codeStr">二维码类型,多个用#分割</param>
public static void LoadConfig(string nameStr, string codeStr)
{ {
cameraNameList = new List<string>(); // string nameStr = ConfigAppSettings.GetValue(Setting_Init.CameraName);
string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
// cameraNameList = new List<string>();
codeTypeList = new List<string>(); codeTypeList = new List<string>();
HDLogUtil.LogName = "RollingLogFileAppender"; HDLogUtil.LogName = "RollingLogFileAppender";
try try
{ {
string[] nameArray = nameStr.Split(spiltChar); //string[] nameArray = nameStr.Split(spiltChar);
foreach (string str in nameArray) //foreach (string str in nameArray)
{ //{
LogUtil.info("加载到配置摄像机名称:" + str.Trim()); // if (str.Trim().Equals(""))
cameraNameList.Add(str.Trim()); // {
} // continue;
// }
// //LogUtil.info("加载到配置摄像机名称:" + str.Trim());
// cameraNameList.Add(str.Trim());
//}
string[] codeArray = codeStr.Split(spiltChar); string[] codeArray = codeStr.Split(spiltChar);
foreach (string str in codeArray) foreach (string str in codeArray)
{ {
if (str.Trim().Equals(""))
{
continue;
}
LogUtil.info("加载到配置二维码类型:" + str.Trim()); LogUtil.info("加载到配置二维码类型:" + str.Trim());
codeTypeList.Add(str.Trim()); codeTypeList.Add(str.Trim());
} }
LoadCamera(false); LoadCamera(false);
CodeLibrary.HDCodeLearnHelper.LoadConfig(nameStr, codeStr); CodeLibrary.HDCodeLearnHelper.LoadConfig("", codeStr);
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("解析摄像机配置出错:" + ex.ToString()); LogUtil.error("解析摄像机配置出错:" + ex.StackTrace);
} }
} }
private static void LoadCamera(bool isReLoad) private static void LoadCamera(bool isReLoad)
{ {
if (isReLoad) if (isReLoad)
{ {
CodeLibrary.HIKCamera.Instance.Load(); try
CodeLibrary.BaslerCamera.Instance.Load(); {
CodeLibrary.HIKCamera.Instance.Load();
}
catch (Exception ex)
{
LogUtil.error("加载HIK相机出错:" + ex.ToString());
}
try
{
CodeLibrary.BaslerCamera.Instance.Load();
}
catch (Exception ex)
{
LogUtil.error("加载Basler相机出错:" + ex.ToString());
}
} }
string[] names = CodeLibrary.HIKCamera.Instance.CameraName; string[] names = CodeLibrary.HIKCamera.Instance.CameraName;
hikNameList.AddRange(names);
names = CodeLibrary.BaslerCamera.Instance.CameraName;
balserNameList.AddRange(names); if (names != null)
foreach (string name in hikNameList)
{ {
LogUtil.info("加载到HIK相机:" + name); hikNameList.AddRange(names);
foreach (string name in hikNameList)
{
LogUtil.info("加载到HIK相机:" + name);
}
} }
foreach (string name in balserNameList) names = CodeLibrary.BaslerCamera.Instance.CameraName;
if (names != null)
{ {
LogUtil.info("加载到Balser相机:" + name); balserNameList.AddRange(names);
foreach (string name in balserNameList)
{
LogUtil.info("加载到Balser相机:" + name);
}
} }
} }
public static void CloseCamera() public static void CloseCamera()
...@@ -88,17 +118,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -88,17 +118,13 @@ namespace OnlineStore.DeviceLibrary
{ {
if (balserNameList.Contains(cameraName)) if (balserNameList.Contains(cameraName))
{ {
bool result = BaslerCamera.Instance.IsOpen; bool result = BaslerCamera.Instance.Open(cameraName);
if (!result) // LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
{
result = BaslerCamera.Instance.Open(cameraName);
LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
}
if (result) if (result)
{ {
BaslerCamera.Instance.GrabOne(); BaslerCamera.Instance.GrabOne();
bitm = BaslerCamera.Instance.Image; bitm = BaslerCamera.Instance.Image;
//BaslerCamera.Instance.Close(); BaslerCamera.Instance.Close();
} }
else else
{ {
...@@ -107,17 +133,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -107,17 +133,13 @@ namespace OnlineStore.DeviceLibrary
} }
else if (hikNameList.Contains(cameraName)) else if (hikNameList.Contains(cameraName))
{ {
bool result = HIKCamera.Instance.IsOpen; bool result = HIKCamera.Instance.Open(cameraName);
if (!result) // LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
{
result = HIKCamera.Instance.Open(cameraName);
LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
}
if (result) if (result)
{ {
HIKCamera.Instance.GrabOne(); HIKCamera.Instance.GrabOne();
bitm = HIKCamera.Instance.Image; bitm = HIKCamera.Instance.Image;
//HIKCamera.Instance.Close(); HIKCamera.Instance.Close();
} }
else else
{ {
...@@ -143,11 +165,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -143,11 +165,14 @@ namespace OnlineStore.DeviceLibrary
} }
[HandleProcessCorruptedStateExceptions] [HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan() public static List<string> CameraScan(List<string> cameraNameList = null)
{ {
List<string> codeList = new List<string>(); List<string> codeList = new List<string>();
//List<CodeInfo> allCodeList = new List<CodeInfo>(); //List<CodeInfo> allCodeList = new List<CodeInfo>();
if (cameraNameList == null)
{
return codeList;
}
try try
{ {
foreach (string cameraName in cameraNameList) foreach (string cameraName in cameraNameList)
...@@ -185,7 +210,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -185,7 +210,7 @@ namespace OnlineStore.DeviceLibrary
codeList.Add(c.CodeStr); codeList.Add(c.CodeStr);
r = r + "##" + c.CodeStr; r = r + "##" + c.CodeStr;
} }
LogUtil.info(" 【" + cameraName + "】【" + codeType + "】扫码完成:"+r); LogUtil.debug(" 【" + cameraName + "】【" + codeType + "】扫码完成:"+r);
} }
} }
} }
...@@ -218,6 +243,44 @@ namespace OnlineStore.DeviceLibrary ...@@ -218,6 +243,44 @@ namespace OnlineStore.DeviceLibrary
return ""; return "";
} }
} }
/// <summary>
/// 处理接收后的二维码
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
private static string ReplaceCode(string message)
{
message = message.Trim();
message = message.Replace("\r", "");
message = message.Replace("\n", "");
char a = (char)02;
message = message.Replace(a.ToString(), "");
message = message.Trim();
System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
byte[] bytes = asciiEncoding.GetBytes(message);
List<byte> newBytes = new List<byte>();
foreach (byte by in bytes)
{
if (!by.Equals(24))
{
newBytes.Add(by);
}
}
message = asciiEncoding.GetString(newBytes.ToArray());
return message;
}
public static string ProcessCode(List<string> codeList)
{
string code = "";
foreach (string cc in codeList)
{
if (string.IsNullOrEmpty(cc))
{
continue;
}
code += cc + "##";
}
return ReplaceCode(code);
}
} }
} }
...@@ -13,10 +13,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -13,10 +13,10 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 出入仓参数(出入库操作时传入的参数类) /// 出入仓参数(出入库操作时传入的参数类)
/// </summary> /// </summary>
public class InOutStoreParam public class InOutParam
{ {
public static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public InOutStoreParam() public InOutParam()
{ {
ACStoreP = null; ACStoreP = null;
this.WareNumber = ""; this.WareNumber = "";
...@@ -27,7 +27,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -27,7 +27,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
/// <param name="wareNo">物品二维码</param> /// <param name="wareNo">物品二维码</param>
/// <param name="position">仓位号</param> /// <param name="position">仓位号</param>
public InOutStoreParam(string wareNo, string posId) public InOutParam(string wareNo, string posId)
{ {
ACStoreP = null; ACStoreP = null;
WareNumber = wareNo; WareNumber = wareNo;
...@@ -35,7 +35,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -35,7 +35,7 @@ namespace OnlineStore.DeviceLibrary
MoveP = null; MoveP = null;
IsSolderPaste = false; IsSolderPaste = false;
} }
public InOutStoreParam(string wareNo, string posId,string plateH,string plateW) public InOutParam(string wareNo, string posId,string plateH,string plateW)
{ {
ACStoreP = null; ACStoreP = null;
WareNumber = wareNo; WareNumber = wareNo;
...@@ -47,7 +47,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -47,7 +47,7 @@ namespace OnlineStore.DeviceLibrary
} }
public InOutStoreParam(string wareNo, string posId, LineMoveP linePosition) public InOutParam(string wareNo, string posId, LineMoveP linePosition)
{ {
ACStoreP = null; ACStoreP = null;
WareNumber = wareNo; WareNumber = wareNo;
......
...@@ -32,8 +32,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -32,8 +32,9 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
protected static Color storeMoveColor = Color.Blue; protected static Color storeMoveColor = Color.Blue;
protected static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); protected static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public string StoreName { get; set; } public string Name { get; set; }
public int StoreID { get; set; } public int DeviceID { get; set; }
public StoreConfig baseConfig = null;
/// <summary> /// <summary>
/// 料仓状态 /// 料仓状态
/// </summary> /// </summary>
...@@ -117,19 +118,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -117,19 +118,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return new TimeSpan(0); return new TimeSpan(0);
} }
} }
protected void AddAxisMoveTime(ConfigMoveAxis axis)
{
//int axisNo = axis.GetAxisValue();
//if (AxisLastStartTime.ContainsKey(axisNo))
//{
// AxisLastStartTime.Remove(axisNo);
//}
//AxisLastStartTime.Add(axisNo, DateTime.Now);
}
/// <summary> /// <summary>
/// 运动处理 /// 运动处理
/// </summary> /// </summary>
...@@ -143,7 +132,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -143,7 +132,7 @@ namespace OnlineStore.DeviceLibrary
isInPro = true; isInPro = true;
try try
{ {
switch (StoreMove.MoveType) switch (MoveInfo.MoveType)
{ {
case StoreMoveType.InStore: case StoreMoveType.InStore:
InStoreProcess(); InStoreProcess();
...@@ -172,7 +161,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -172,7 +161,7 @@ namespace OnlineStore.DeviceLibrary
} }
protected void SaveAlarmInfo(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType) protected void SaveAlarmInfo(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType)
{ {
alarmMsg = alarmMsg.Replace(StoreName, ""); alarmMsg = alarmMsg.Replace(Name, "");
int inoutStatus = 0; int inoutStatus = 0;
if (storeMoveType.Equals(StoreMoveType.InStore)) if (storeMoveType.Equals(StoreMoveType.InStore))
{ {
...@@ -208,7 +197,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -208,7 +197,7 @@ namespace OnlineStore.DeviceLibrary
break; break;
default: break; default: break;
} }
alarmInfo = new AlarmInfo(StoreID, aType, alarmDetial, alarmMsg, inoutStatus); alarmInfo = new AlarmInfo(DeviceID, aType, alarmDetial, alarmMsg, inoutStatus);
} }
/// <summary> /// <summary>
...@@ -232,7 +221,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -232,7 +221,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 停止所有运动 /// 停止所有运动
/// </summary> /// </summary>
public abstract void StopMove(bool IsCloseAxis); public abstract void StopMove( );
/// <summary> /// <summary>
/// 重置处理 /// 重置处理
...@@ -250,8 +239,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -250,8 +239,7 @@ namespace OnlineStore.DeviceLibrary
{ {
moveAxis.TargetPosition = 0; moveAxis.TargetPosition = 0;
LogUtil.info(LOGGER, moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回"); LogUtil.info(LOGGER, moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true)); MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
AddAxisMoveTime(moveAxis);
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed); ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
} }
...@@ -260,9 +248,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -260,9 +248,8 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
protected void ACAxisMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed) protected void ACAxisMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed)
{ {
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, targetPosition, targetSpeed)); MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, targetPosition, targetSpeed));
moveAxis.TargetPosition = targetPosition; moveAxis.TargetPosition = targetPosition;
AddAxisMoveTime(moveAxis);
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed); ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
} }
...@@ -274,17 +261,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -274,17 +261,7 @@ namespace OnlineStore.DeviceLibrary
msg = ""; msg = "";
string deviceName = moveAxis.DeviceName; string deviceName = moveAxis.DeviceName;
short axisNo = moveAxis.GetAxisValue(); short axisNo = moveAxis.GetAxisValue();
//如果是进出轴,并且光栅被遮挡,直接返回false
//if (NeedCheckSafetyLight.Equals(2))
//{
// if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_10_DeviceToDoor) ||
// StoreMove.MoveStep.Equals(StoreMoveStep.SI_05_DeviceToDoor))
// {
// return false;
// }
//}
bool isOk = ACServerManager.GetBusyStatus(deviceName, axisNo).Equals(0); bool isOk = ACServerManager.GetBusyStatus(deviceName, axisNo).Equals(0);
int outCount = ACServerManager.GetActualtPosition(deviceName, axisNo); int outCount = ACServerManager.GetActualtPosition(deviceName, axisNo);
int errorCount = Math.Abs(outCount - targetPosition); int errorCount = Math.Abs(outCount - targetPosition);
...@@ -295,16 +272,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -295,16 +272,16 @@ namespace OnlineStore.DeviceLibrary
return true; return true;
} }
//判断是否需要重新运动 //判断是否需要重新运动
if (StoreMove.CanWhileCount > 0) if (MoveInfo.CanWhileCount > 0)
{ {
LogUtil.error(LOGGER, moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount + LogUtil.error(LOGGER, moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,重新开始运动,剩余[" + StoreMove.CanWhileCount + "]次"); "],误差过大,重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed); ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
StoreMove.CanWhileCount--; MoveInfo.CanWhileCount--;
} }
else else
{ {
msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount
+ "],误差过大,需要报警"; + "],误差过大,需要报警";
LogUtil.error(LOGGER, msg); LogUtil.error(LOGGER, msg);
} }
...@@ -324,16 +301,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -324,16 +301,16 @@ namespace OnlineStore.DeviceLibrary
return true; return true;
} }
//判断是否需要重新运动 //判断是否需要重新运动
if (StoreMove.CanWhileCount > 0) if (MoveInfo.CanWhileCount > 0)
{ {
LogUtil.error(LOGGER, moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + StoreMove.CanWhileCount + "]次"); LogUtil.error(LOGGER, moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次");
//LogUtil.error(LOGGER, StoreName + moveAxis.DisplayStr + "重新回原点"); //LogUtil.error(LOGGER, StoreName + moveAxis.DisplayStr + "重新回原点");
ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed); ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
StoreMove.CanWhileCount--; MoveInfo.CanWhileCount--;
} }
else else
{ {
msg = StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警"; msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
LogUtil.error(LOGGER, msg); LogUtil.error(LOGGER, msg);
} }
} }
...@@ -352,7 +329,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -352,7 +329,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (!isInit) if (!isInit)
{ {
StoreMove = new StoreMoveInfo(StoreID); MoveInfo = new StoreMoveInfo(DeviceID);
mainTimer = new System.Timers.Timer(); mainTimer = new System.Timers.Timer();
mainTimer.Enabled = false; mainTimer.Enabled = false;
...@@ -378,7 +355,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -378,7 +355,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 移动信息 /// 移动信息
/// </summary> /// </summary>
public StoreMoveInfo StoreMove = null; public StoreMoveInfo MoveInfo = null;
/// <summary> /// <summary>
/// 定时处理,监听信号,监听IO /// 定时处理,监听信号,监听IO
...@@ -388,7 +365,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -388,7 +365,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始出库运动 /// 开始出库运动
/// </summary> /// </summary>
public abstract bool StartOutStoreMove(InOutStoreParam param); public abstract bool StartOutStoreMove(InOutParam param);
protected abstract void OutStoreProcess(); protected abstract void OutStoreProcess();
#endregion #endregion
...@@ -396,7 +373,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -396,7 +373,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始入库移动移动 /// 开始入库移动移动
/// </summary> /// </summary>
public abstract void StartInStoreMove(InOutStoreParam param); public abstract void StartInStoreMove(InOutParam param);
protected abstract void InStoreProcess(); protected abstract void InStoreProcess();
#endregion #endregion
...@@ -477,7 +454,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -477,7 +454,29 @@ namespace OnlineStore.DeviceLibrary
return sta; return sta;
} }
} }
public void CylinderMove(StoreMoveInfo moveInfo, string IoLowType, string IoHighType)
{
IOMove(IoLowType, IO_VALUE.LOW);
IOMove(IoHighType, IO_VALUE.HIGH);
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IoLowType, IO_VALUE.LOW));
moveInfo.WaitList.Add(WaitResultInfo.WaitIO(IoHighType, IO_VALUE.HIGH));
}
}
public void IOMove(string IoType, IO_VALUE value)
{
IOManager.IOMove(IoType, value, baseConfig.Id);
}
public IO_VALUE IOValue(string IoType)
{
return IOManager.IOValue(IoType, baseConfig.Id);
}
public void LogInfo(string logInfo)
{
LogUtil.info(Name + logInfo);
}
} }
} }
...@@ -22,7 +22,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -22,7 +22,7 @@ namespace OnlineStore.DeviceLibrary
{ {
moveType = StoreMoveType.None; moveType = StoreMoveType.None;
MoveParam = new InOutStoreParam(); MoveParam = new InOutParam();
this.storeId = storeId; this.storeId = storeId;
this.moveStep = StoreMoveStep.Wait; this.moveStep = StoreMoveStep.Wait;
IsInWait = false; IsInWait = false;
...@@ -50,7 +50,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -50,7 +50,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
///出入库参数 ///出入库参数
/// </summary> /// </summary>
public InOutStoreParam MoveParam { get; set; } public InOutParam MoveParam { get; set; }
/// <summary> /// <summary>
/// 当前运动是哪个料仓 /// 当前运动是哪个料仓
/// </summary> /// </summary>
...@@ -106,7 +106,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -106,7 +106,7 @@ namespace OnlineStore.DeviceLibrary
WaitList = new List<WaitResultInfo>(); WaitList = new List<WaitResultInfo>();
MoveNum++; MoveNum++;
} }
public void NewMove(StoreMoveType type, InOutStoreParam param) public void NewMove(StoreMoveType type, InOutParam param)
{ {
moveStep = StoreMoveStep.Wait; moveStep = StoreMoveStep.Wait;
this.moveType = type; this.moveType = type;
......
...@@ -50,9 +50,10 @@ ...@@ -50,9 +50,10 @@
<Compile Include="position\ACSAStorePosition.cs" /> <Compile Include="position\ACSAStorePosition.cs" />
<Compile Include="storeConfig\ConfigItemBase.cs" /> <Compile Include="storeConfig\ConfigItemBase.cs" />
<Compile Include="storeConfig\ConfigProAttribute.cs" /> <Compile Include="storeConfig\ConfigProAttribute.cs" />
<Compile Include="storeConfig\config\AC_SA_Config.cs" /> <Compile Include="storeConfig\config\Store_Config.cs" />
<Compile Include="storeConfig\config\AC_Box_Config.cs" />
<Compile Include="storeConfig\config\StoreType.cs" /> <Compile Include="storeConfig\config\StoreType.cs" />
<Compile Include="storeConfig\config\Store_IO_Type.cs" /> <Compile Include="storeConfig\config\IO_Type.cs" />
<Compile Include="CSVAttribute.cs" /> <Compile Include="CSVAttribute.cs" />
<Compile Include="storeConfig\CSVConfigReader.cs" /> <Compile Include="storeConfig\CSVConfigReader.cs" />
<Compile Include="position\CSVPositionReader.cs" /> <Compile Include="position\CSVPositionReader.cs" />
......
...@@ -67,7 +67,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -67,7 +67,7 @@ namespace OnlineStore.LoadCSVLibrary
[CSVAttribute("进出轴进料口取料点P2")] [CSVAttribute("进出轴进料口取料点P2")]
public int InOutAxis_DoorPosition_P2 { get; set; } public int InOutAxis_DoorPosition_P2 { get; set; }
public static bool CheckPosition(ACStorePosition position, AC_SA_Config Config) public static bool CheckPosition(ACStorePosition position, AC_BOX_Config Config)
{ {
try try
{ {
......
...@@ -133,12 +133,33 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -133,12 +133,33 @@ namespace OnlineStore.LoadCSVLibrary
} }
return configList; return configList;
} }
public static AC_BOX_Config LoadStoreConfig(int storeId, string cid, string storeType, string linefilePath)
{
StoreConfig config = null;
config = new Store_Config(storeId, cid, storeType, linefilePath);
return (AC_BOX_Config)LoadConfig(config);
}
public static Store_Config LoadLineConfig(int storeId, string cid, string storeType, string linefilePath)
{
StoreConfig config = null;
config = new Store_Config(storeId, cid, storeType, linefilePath);
return (Store_Config)LoadConfig(config);
}
public static StoreConfig LoadConfig(int storeId, string cid, string storeType, string filePath) public static StoreConfig LoadConfig(int storeId, string cid, string storeType, string filePath)
{ {
StoreConfig config = null; StoreConfig config = null;
if (storeType.Equals(StoreType.RC_AC_SA)) if (storeType.Equals(StoreType.RC_AC_SA))
{ {
config = new AC_SA_Config(storeId, cid, storeType, filePath); config = new AC_BOX_Config(storeId, cid, storeType, filePath);
} }
else else
{ {
......
...@@ -6,58 +6,17 @@ using System.Text; ...@@ -6,58 +6,17 @@ using System.Text;
namespace OnlineStore.LoadCSVLibrary namespace OnlineStore.LoadCSVLibrary
{ {
public class AC_SA_Config : StoreConfig public class AC_BOX_Config : StoreConfig
{ {
public AC_SA_Config() public AC_BOX_Config()
: base() : base()
{ {
} }
public AC_SA_Config(int id, string cid, string type, string filepath) public AC_BOX_Config(int id, string cid, string type, string filepath)
: base(id, cid, type, filepath) : base(id, cid, type, filepath)
{ {
} }
/// <summary>
/// 预警温度
/// </summary>
[ConfigProAttribute("WarnTemperate")]
public int WarnTemperate { get; set; }
/// <summary>
/// 预警湿度
/// </summary>
[ConfigProAttribute("WarnHumidity")]
public int WarnHumidity { get; set; }
/// <summary>
/// 气压检测IO关闭需要持续的时间(=3表示需要关闭三秒以上才算关闭)
/// </summary>
[ConfigProAttribute("AirCheckSeconds")]
public int AirCheckSeconds { get; set; }
/// <summary>
/// IsHasCompress_Axis是否使用压紧轴
/// </summary>
[ConfigProAttribute("IsHasCompress_Axis")]
public int IsHasCompress_Axis { get; set; }
/// <summary>
/// PRO 是否使用定位气缸 IsHasLocationCylinder 0
/// </summary>
[ConfigProAttribute("IsHasLocationCylinder")]
public int IsHasLocationCylinder { get; set; }
/// <summary>
/// PRO 是否有左右侧门 IsHasDoorLimit 0
/// </summary>
[ConfigProAttribute("IsHasDoorLimit")]
public int IsHasDoorLimit { get; set; }
/// <summary>
/// PRO 扫码枪IP Scanner_Ip 192.168.200.13
/// </summary>
[ConfigProAttribute("Scanner_Ip",false)]
public string Scanner_Ip { get; set; }
/// <summary>
/// PRO 扫码枪端口号 Scanner_Port 51236
/// </summary>
[ConfigProAttribute("Scanner_Port",false)]
public int Scanner_Port { get; set; }
/// <summary> /// <summary>
/// PRO (轴一)旋转轴原点目标速度 MiddleAxis_TargetSpeed 30000 /// PRO (轴一)旋转轴原点目标速度 MiddleAxis_TargetSpeed 30000
/// </summary> /// </summary>
...@@ -270,23 +229,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -270,23 +229,7 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("InoutAxis_ErrorCountMax")] [ConfigProAttribute("InoutAxis_ErrorCountMax")]
public int InoutAxis_ErrorCountMax { get; set; } public int InoutAxis_ErrorCountMax { get; set; }
/// <summary>
/// PRO,BOX出入库次数多少次时,会自动重置旋转轴,Box_ResetMCount,10,,,,,
/// </summary>
[ConfigProAttribute("Box_ResetMCount")]
public int Box_ResetMCount { get; set; }
/// <summary>
/// PRO,BOX出入库次数多少次时,会自动重置操作(会重置所有轴),Box_ResetACount,100,,,,,
/// </summary>
[ConfigProAttribute("Box_ResetACount")]
public int Box_ResetACount { get; set; }
/// <summary>
/// PRO IO信号超时时间(毫秒) IOSingle_TimerOut 5000
/// </summary>
[ConfigProAttribute("IOSingle_TimerOut", false)]
public int IOSingle_TimerOut { get; set; }
/// <summary> /// <summary>
/// 升降轴 进料口取料点 P1 /// 升降轴 进料口取料点 P1
/// </summary> /// </summary>
...@@ -325,14 +268,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -325,14 +268,7 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[ConfigProAttribute("CompressAxis_P1_Position")] [ConfigProAttribute("CompressAxis_P1_Position")]
public int CompressAxis_P1_Position { get; set; } public int CompressAxis_P1_Position { get; set; }
/// <summary>
/// PRO 是否使用料盘检测信号 IsUse_Tray_Check
/// </summary>
[ConfigProAttribute("IsUse_Tray_Check")]
public int IsUse_Tray_Check { get; set; }
/// <summary> /// <summary>
///轴2升降轴 运动上下轴 ///轴2升降轴 运动上下轴
/// </summary> /// </summary>
...@@ -416,70 +352,89 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -416,70 +352,89 @@ namespace OnlineStore.LoadCSVLibrary
/// PRO (轴三)进出轴最大限位 InoutAxis_PositionMax /// PRO (轴三)进出轴最大限位 InoutAxis_PositionMax
/// </summary> /// </summary>
[ConfigProAttribute("InoutAxis_PositionMax", false)] [ConfigProAttribute("InoutAxis_PositionMax", false)]
public int InoutAxis_PositionMax { get; set; }
/// <summary> /// <summary>
/// PRO 需要吹气的温度(温度标准) Max_Temperature 10 /// PRO 压紧轴(轴4)P1速度 CompAxis_P1_Speed 100
/// </summary> /// </summary>
[ConfigProAttribute("Max_Temperature", false)] [ConfigProAttribute("CompAxis_P1_Speed")]
public int Max_Temperature { get; set; } public int CompAxis_P1_Speed { get; set; }
/// <summary> /// <summary>
/// PRO 需要吹气的湿度(湿度标准) Max_Humidity 10 /// PRO 压紧轴(轴4)P2速度 CompAxis_P2_Speed 100
/// </summary> /// </summary>
[ConfigProAttribute("Max_Humidity", false)] [ConfigProAttribute("CompAxis_P2_Speed")]
public int Max_Humidity { get; set; } public int CompAxis_P2_Speed { get; set; }
/// <summary> /// <summary>
/// PRO 每次吹气的时间(分钟) BlowAir_Time 10 ///PRO 压紧轴(轴4)P3速度 CompAxis_P3_Speed 100
/// </summary> /// </summary>
[ConfigProAttribute("BlowAir_Time", false)] [ConfigProAttribute("CompAxis_P3_Speed")]
public int BlowAir_Time { get; set; } public int CompAxis_P3_Speed { get; set; }
/// <summary> /// <summary>
/// PRO 两次吹气间隔(分钟) BlowAir_Interval 10 /// 预警温度
/// </summary> /// </summary>
[ConfigProAttribute("BlowAir_Interval", false)] [ConfigProAttribute("WarnTemperate")]
public int BlowAir_Interval { get; set; } public int WarnTemperate { get; set; }
public int InoutAxis_PositionMax { get; set; }
/// <summary> /// <summary>
/// PRO,温湿度端口号,Humiture_Port,COM1,,,,,,, /// 预警湿度
/// </summary> /// </summary>
[ConfigProAttribute("Humiture_Port", true )] [ConfigProAttribute("WarnHumidity")]
public string Humiture_Port { get; set; } public int WarnHumidity { get; set; }
/// <summary>
/// 气压检测IO关闭需要持续的时间(=3表示需要关闭三秒以上才算关闭)
/// </summary>
[ConfigProAttribute("AirCheckSeconds")]
public int AirCheckSeconds { get; set; }
/// <summary> /// <summary>
/// PRO 压紧轴(轴4)P1速度 CompAxis_P1_Speed 100 /// PRO,BOX出入库次数多少次时,会自动重置旋转轴,Box_ResetMCount,10,,,,,
/// </summary> /// </summary>
[ConfigProAttribute("CompAxis_P1_Speed")] [ConfigProAttribute("Box_ResetMCount")]
public int CompAxis_P1_Speed { get; set; } public int Box_ResetMCount { get; set; }
/// <summary> /// <summary>
/// PRO 压紧轴(轴4)P2速度 CompAxis_P2_Speed 100 /// PRO,BOX出入库次数多少次时,会自动重置操作(会重置所有轴),Box_ResetACount,100,,,,,
/// </summary> /// </summary>
[ConfigProAttribute("CompAxis_P2_Speed")] [ConfigProAttribute("Box_ResetACount")]
public int CompAxis_P2_Speed { get; set; } public int Box_ResetACount { get; set; }
/// <summary> /// <summary>
///PRO 压紧轴(轴4)P3速度 CompAxis_P3_Speed 100 /// PRO IO信号超时时间(毫秒) IOSingle_TimerOut 5000
/// </summary> /// </summary>
[ConfigProAttribute("CompAxis_P3_Speed")] [ConfigProAttribute("IOSingle_TimerOut", false)]
public int CompAxis_P3_Speed { get; set; } public int IOSingle_TimerOut { get; set; }
/// <summary> /// <summary>
/// PRO IO模块对应的DI数量 IO_DILength 192.168.200.10#16;192.168.200.11#4 /// PRO 需要吹气的温度(温度标准) Max_Temperature 10
/// </summary> /// </summary>
[ConfigProAttribute("IO_DILength")] [ConfigProAttribute("Max_Temperature", false)]
public string IO_DILength { get; set; } public int Max_Temperature { get; set; }
/// <summary>
/// PRO 需要吹气的湿度(湿度标准) Max_Humidity 10
/// </summary>
[ConfigProAttribute("Max_Humidity", false)]
public int Max_Humidity { get; set; }
/// <summary> /// <summary>
/// PRO 模块对应的DO数量 IO_DOLength 192.168.200.10#16;192.168.200.11#4 /// PRO 每次吹气的时间(分钟) BlowAir_Time 10
/// </summary> /// </summary>
[ConfigProAttribute("IO_DOLength")] [ConfigProAttribute("BlowAir_Time", false)]
public string IO_DOLength { get; set; } public int BlowAir_Time { get; set; }
/// <summary> /// <summary>
/// PRO 是否有仓门 HasDoor 1 /// PRO 两次吹气间隔(分钟) BlowAir_Interval 10
/// </summary>
[ConfigProAttribute("BlowAir_Interval", false)]
public int BlowAir_Interval { get; set; }
/// <summary>
/// PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
/// </summary> /// </summary>
[ConfigProAttribute("HasDoor")] [ConfigProAttribute("Humiture_Port", true)]
public int HasDoor { get; set; } public string Humiture_Port { get; set; }
protected override void initMustHavePro() protected override void initMustHavePro()
{ {
...@@ -505,7 +460,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -505,7 +460,7 @@ namespace OnlineStore.LoadCSVLibrary
MustHaveDOList.Add(IO_Type.Door_Down); MustHaveDOList.Add(IO_Type.Door_Down);
MustHaveDOList.Add(IO_Type.Axis_Brake); MustHaveDOList.Add(IO_Type.Axis_Brake);
} }
public static void ConfigAxis(AC_SA_Config Config) public static void ConfigAxis(AC_BOX_Config Config)
{ {
Config.Middle_Axis.TargetSpeed = Config.MiddleAxis_TargetSpeed; Config.Middle_Axis.TargetSpeed = Config.MiddleAxis_TargetSpeed;
Config.Middle_Axis.AddSpeed = Config.MiddleAxis_AddSpeed; Config.Middle_Axis.AddSpeed = Config.MiddleAxis_AddSpeed;
...@@ -562,70 +517,6 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -562,70 +517,6 @@ namespace OnlineStore.LoadCSVLibrary
Config.Comp_Axis.CanErrorCountMin = 10; Config.Comp_Axis.CanErrorCountMin = 10;
Config.Comp_Axis.PositionMin = 0; Config.Comp_Axis.PositionMin = 0;
Config.Comp_Axis.PositionMax = 0; Config.Comp_Axis.PositionMax = 0;
} }
private Dictionary<string, ushort> DILengthMap = null;
private Dictionary<string, ushort> DOLengthMap = null;
public ushort GetDILength(string ip)
{
try
{
if (DILengthMap == null)
{
DILengthMap = new Dictionary<string, ushort>();
string[] arrayList = IO_DILength.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('#');
if (arrStr.Length == 2)
{
string ioip = arrStr[0];
ushort length = Convert.ToUInt16(arrStr[1]);
DILengthMap.Add(ioip, length);
}
}
}
}
catch (Exception ex)
{
}
if (DILengthMap.ContainsKey(ip))
{
return DILengthMap[ip];
}
return 16;
}
public ushort GetDOLength(string ip)
{
try
{
if (DOLengthMap == null)
{
DOLengthMap = new Dictionary<string, ushort>();
string[] arrayList = IO_DOLength.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('#');
if (arrStr.Length == 2)
{
string ioip = arrStr[0];
ushort length = Convert.ToUInt16(arrStr[1]);
DOLengthMap.Add(ioip, length);
}
}
}
}
catch (Exception ex)
{
}
if (DOLengthMap.ContainsKey(ip))
{
return DOLengthMap[ip];
}
return 16;
}
} }
} }
...@@ -34,12 +34,12 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -34,12 +34,12 @@ namespace OnlineStore.LoadCSVLibrary
/// 输入IO配置 /// 输入IO配置
/// 手动料仓输入Io列表,key=对应的坐标位置的positionNum /// 手动料仓输入Io列表,key=对应的坐标位置的positionNum
/// </summary> /// </summary>
public Dictionary<String, ConfigIO> StoreDIList { get; set; } public Dictionary<String, ConfigIO> DIList { get; set; }
/// <summary> /// <summary>
/// 输出IO配置 /// 输出IO配置
/// 手动料仓输出Io列表,key=对应的坐标位置的positionNum /// 手动料仓输出Io列表,key=对应的坐标位置的positionNum
/// </summary> /// </summary>
public Dictionary<String, ConfigIO> StoreDOList { get; set; } public Dictionary<String, ConfigIO> DOList { get; set; }
/// <summary> /// <summary>
/// 料仓所有用到的IO卡名称 /// 料仓所有用到的IO卡名称
/// </summary> /// </summary>
...@@ -80,8 +80,8 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -80,8 +80,8 @@ namespace OnlineStore.LoadCSVLibrary
public virtual void LoadConfig(List<ConfigBase> configList) public virtual void LoadConfig(List<ConfigBase> configList)
{ {
StoreDIList = new Dictionary<string, ConfigIO>(); DIList = new Dictionary<string, ConfigIO>();
StoreDOList = new Dictionary<string, ConfigIO>(); DOList = new Dictionary<string, ConfigIO>();
DIODeviceNameList = new List<string>(); DIODeviceNameList = new List<string>();
SMCDeviceNameList = new List<string>(); SMCDeviceNameList = new List<string>();
//取得属性集合 //取得属性集合
...@@ -142,7 +142,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -142,7 +142,7 @@ namespace OnlineStore.LoadCSVLibrary
{ {
DIODeviceNameList.Add(io.DeviceName); DIODeviceNameList.Add(io.DeviceName);
} }
this.StoreDIList.Add(con.ProName, io); this.DIList.Add(con.ProName, io);
} }
else else
{ {
...@@ -158,7 +158,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -158,7 +158,7 @@ namespace OnlineStore.LoadCSVLibrary
{ {
DIODeviceNameList.Add(io.DeviceName); DIODeviceNameList.Add(io.DeviceName);
} }
this.StoreDOList.Add(con.ProName, io); this.DOList.Add(con.ProName, io);
} }
else else
{ {
...@@ -182,7 +182,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -182,7 +182,7 @@ namespace OnlineStore.LoadCSVLibrary
{ {
if (att.IsMust) if (att.IsMust)
{ {
throw new CVSFieldNotMatchingExection(this.ToString() + "的属性" + str + "必须配置值!"); throw new CVSFieldNotMatchingExection(this.ToString() + "缺少配置【" + str + "】");
} }
else else
{ {
...@@ -202,7 +202,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -202,7 +202,7 @@ namespace OnlineStore.LoadCSVLibrary
//DI检测 //DI检测
foreach (string di in MustHaveDIList) foreach (string di in MustHaveDIList)
{ {
if (!StoreDIList.ContainsKey(di)) if (!DIList.ContainsKey(di))
{ {
throw new CVSFieldNotMatchingExection(this.ToString() + "的DI属性" + di + "必须配置值!"); throw new CVSFieldNotMatchingExection(this.ToString() + "的DI属性" + di + "必须配置值!");
} }
...@@ -211,7 +211,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -211,7 +211,7 @@ namespace OnlineStore.LoadCSVLibrary
//DO检测 //DO检测
foreach (string io in MustHaveDOList) foreach (string io in MustHaveDOList)
{ {
if (!this.StoreDOList.ContainsKey(io)) if (!this.DOList.ContainsKey(io))
{ {
throw new CVSFieldNotMatchingExection(this.ToString() + "的DO属性" + io + "必须配置值!"); throw new CVSFieldNotMatchingExection(this.ToString() + "的DO属性" + io + "必须配置值!");
} }
...@@ -222,13 +222,13 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -222,13 +222,13 @@ namespace OnlineStore.LoadCSVLibrary
public ConfigIO getWaitIO(string ioType) public ConfigIO getWaitIO(string ioType)
{ {
if (StoreDIList.ContainsKey(ioType)) if (DIList.ContainsKey(ioType))
{ {
return StoreDIList[ioType]; return DIList[ioType];
} }
else if (StoreDOList.ContainsKey(ioType)) else if (DOList.ContainsKey(ioType))
{ {
return StoreDOList[ioType]; return DOList[ioType];
} }
return null; return null;
} }
......
...@@ -39,5 +39,9 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -39,5 +39,9 @@ namespace OnlineStore.LoadCSVLibrary
/// 松下伺服485通信单台料仓 /// 松下伺服485通信单台料仓
/// </summary> /// </summary>
public static string RC_AC_SA = "RC_AC_SA"; public static string RC_AC_SA = "RC_AC_SA";
/// <summary>
/// 松下伺服控制的包装料料仓
/// </summary>
public static string RC_AC_PA = "RC_AC_PA";
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
public class Store_Config : StoreConfig
{
public Store_Config()
: base()
{
}
public Store_Config(int id, string cid, string type, string filepath)
: base(id, cid, type, filepath)
{
}
/// <summary>
/// 预警温度
/// </summary>
[ConfigProAttribute("WarnTemperate")]
public int WarnTemperate { get; set; }
/// <summary>
/// 预警湿度
/// </summary>
[ConfigProAttribute("WarnHumidity")]
public int WarnHumidity { get; set; }
/// <summary>
/// 气压检测IO关闭需要持续的时间(=3表示需要关闭三秒以上才算关闭)
/// </summary>
[ConfigProAttribute("AirCheckSeconds")]
public int AirCheckSeconds { get; set; }
/// <summary>
/// PRO,BOX出入库次数多少次时,会自动重置旋转轴,Box_ResetMCount,10,,,,,
/// </summary>
[ConfigProAttribute("Box_ResetMCount")]
public int Box_ResetMCount { get; set; }
/// <summary>
/// PRO,BOX出入库次数多少次时,会自动重置操作(会重置所有轴),Box_ResetACount,100,,,,,
/// </summary>
[ConfigProAttribute("Box_ResetACount")]
public int Box_ResetACount { get; set; }
/// <summary>
/// PRO IO信号超时时间(毫秒) IOSingle_TimerOut 5000
/// </summary>
[ConfigProAttribute("IOSingle_TimerOut", false)]
public int IOSingle_TimerOut { get; set; }
/// <summary>
/// PRO 需要吹气的温度(温度标准) Max_Temperature 10
/// </summary>
[ConfigProAttribute("Max_Temperature", false)]
public int Max_Temperature { get; set; }
/// <summary>
/// PRO 需要吹气的湿度(湿度标准) Max_Humidity 10
/// </summary>
[ConfigProAttribute("Max_Humidity", false)]
public int Max_Humidity { get; set; }
/// <summary>
/// PRO 每次吹气的时间(分钟) BlowAir_Time 10
/// </summary>
[ConfigProAttribute("BlowAir_Time", false)]
public int BlowAir_Time { get; set; }
/// <summary>
/// PRO 两次吹气间隔(分钟) BlowAir_Interval 10
/// </summary>
[ConfigProAttribute("BlowAir_Interval", false)]
public int BlowAir_Interval { get; set; }
public int InoutAxis_PositionMax { get; set; }
/// <summary>
/// PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
/// </summary>
[ConfigProAttribute("Humiture_Port", true )]
public string Humiture_Port { get; set; }
/// <summary>
/// PRO IO模块对应的DI数量 IO_DILength 192.168.200.10#16;192.168.200.11#4
/// </summary>
[ConfigProAttribute("IO_DILength")]
public string IO_DILength { get; set; }
/// <summary>
/// PRO 模块对应的DO数量 IO_DOLength 192.168.200.10#16;192.168.200.11#4
/// </summary>
[ConfigProAttribute("IO_DOLength")]
public string IO_DOLength { get; set; }
/// <summary>
/// PRO 是否有仓门 HasDoor 1
/// </summary>
[ConfigProAttribute("HasDoor")]
public int HasDoor { get; set; }
protected override void initMustHavePro()
{
MustHaveDIList = new List<string>();
MustHaveDOList = new List<string>();
MustHaveDIList.Add(IO_Type.SuddenStop_BTN);
MustHaveDIList.Add(IO_Type.Reset_BTN);
MustHaveDIList.Add(IO_Type.DoorLimit);
MustHaveDIList.Add(IO_Type.Airpressure_Check);
MustHaveDIList.Add(IO_Type.TrayCheck_Door);
MustHaveDIList.Add(IO_Type.TrayCheck_Fixture);
MustHaveDIList.Add(IO_Type.Door_Up);
MustHaveDIList.Add(IO_Type.Door_Down);
MustHaveDOList.Add(IO_Type.AutoRun_HddLed);
MustHaveDOList.Add(IO_Type.Alarm_HddLed);
MustHaveDOList.Add(IO_Type.RunSign_HddLed);
MustHaveDOList.Add(IO_Type.StartOrStopBlow);
MustHaveDOList.Add(IO_Type.Run_Signal);
MustHaveDOList.Add(IO_Type.Door_Up);
MustHaveDOList.Add(IO_Type.Door_Down);
MustHaveDOList.Add(IO_Type.Axis_Brake);
}
public static void ConfigAxis(AC_BOX_Config Config)
{
Config.Middle_Axis.TargetSpeed = Config.MiddleAxis_TargetSpeed;
Config.Middle_Axis.AddSpeed = Config.MiddleAxis_AddSpeed;
Config.Middle_Axis.DelSpeed = Config.MiddleAxis_DelSpeed;
Config.Middle_Axis.HomeAddSpeed = Config.MiddleAxis_HomeAddSpeed;
Config.Middle_Axis.HomeHighSpeed = Config.MiddleAxis_HomeHighSpeed;
Config.Middle_Axis.HomeLowSpeed = Config.MiddleAxis_HomeLowSpeed;
Config.InOut_Axis.TargetSpeed = Config.InoutAxis_TargetSpeed;
Config.InOut_Axis.DelSpeed = Config.InoutAxis_AddSpeed;
Config.InOut_Axis.AddSpeed = Config.InoutAxis_DelSpeed;
Config.InOut_Axis.HomeAddSpeed = Config.InoutAxis_HomeAddSpeed;
Config.InOut_Axis.HomeHighSpeed = Config.InoutAxis_HomeHighSpeed;
Config.InOut_Axis.HomeLowSpeed = Config.InoutAxis_HomeLowSpeed;
Config.UpDown_Axis.TargetSpeed = Config.UpdownAxis_TargetSpeed;
Config.UpDown_Axis.AddSpeed = Config.UpdownAxis_AddSpeed;
Config.UpDown_Axis.DelSpeed = Config.UpdownAxis_DelSpeed;
Config.UpDown_Axis.HomeAddSpeed = Config.UpdownAxis_HomeAddSpeed;
Config.UpDown_Axis.HomeHighSpeed = Config.UpdownAxis_HomeHighSpeed;
Config.UpDown_Axis.HomeLowSpeed = Config.UpdownAxis_HomeLowSpeed;
Config.Comp_Axis.TargetSpeed = Config.CompAxis_TargetSpeed;
Config.Comp_Axis.AddSpeed = Config.CompAxis_AddSpeed;
Config.Comp_Axis.DelSpeed = Config.CompAxis_DelSpeed;
Config.Comp_Axis.HomeAddSpeed = Config.CompAxis_HomeAddSpeed;
Config.Comp_Axis.HomeHighSpeed = Config.CompAxis_HomeHighSpeed;
Config.Comp_Axis.HomeLowSpeed = Config.CompAxis_HomeLowSpeed;
Config.Middle_Axis.CanErrorCountMin = Config.MiddleAxis_ErrorCountMin;
Config.InOut_Axis.CanErrorCountMin = Config.InoutAxis_ErrorCountMin;
Config.UpDown_Axis.CanErrorCountMin = Config.UpdownAxis_ErrorCountMin;
Config.Middle_Axis.CanErrorCountMax = Config.MiddleAxis_ErrorCountMax;
Config.InOut_Axis.CanErrorCountMax = Config.InoutAxis_ErrorCountMax;
Config.UpDown_Axis.CanErrorCountMax = Config.UpdownAxis_ErrorCountMax;
Config.Middle_Axis.PositionMin = Config.MiddleAxis_PositionMin;
Config.Middle_Axis.PositionMax = Config.MiddleAxis_PositionMax;
Config.InOut_Axis.PositionMin = Config.InoutAxis_PositionMin;
Config.InOut_Axis.PositionMax = Config.InoutAxis_PositionMax;
Config.UpDown_Axis.PositionMin = Config.UpdownAxis_PositionMin;
Config.UpDown_Axis.PositionMax = Config.UpdownAxis_PositionMax;
//Config.InOut_Axis.ResolveSpeed = Config.InoutAxis_ResolveSpeed;
//Config.UpDown_Axis.ResolveSpeed = Config.UpdownAxis_ResolveSpeed;
//Config.Middle_Axis.ResolveSpeed = Config.MiddleAxis_ResolveSpeed;
Config.Middle_Axis.DefaultPosition = Config.MiddleAxis_P1_Position;
Config.InOut_Axis.DefaultPosition = Config.InOutAxis_P1_Position;
Config.UpDown_Axis.DefaultPosition = Config.UpDownAxis_DoorOPosition_P1;
Config.Comp_Axis.DefaultPosition = Config.CompressAxis_P1_Position;
Config.Comp_Axis.CanErrorCountMax = 1000;
Config.Comp_Axis.CanErrorCountMin = 10;
Config.Comp_Axis.PositionMin = 0;
Config.Comp_Axis.PositionMax = 0;
}
private Dictionary<string, ushort> DILengthMap = null;
private Dictionary<string, ushort> DOLengthMap = null;
public ushort GetDILength(string ip)
{
try
{
if (DILengthMap == null)
{
DILengthMap = new Dictionary<string, ushort>();
string[] arrayList = IO_DILength.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('#');
if (arrStr.Length == 2)
{
string ioip = arrStr[0];
ushort length = Convert.ToUInt16(arrStr[1]);
DILengthMap.Add(ioip, length);
}
}
}
}
catch (Exception ex)
{
}
if (DILengthMap.ContainsKey(ip))
{
return DILengthMap[ip];
}
return 16;
}
public ushort GetDOLength(string ip)
{
try
{
if (DOLengthMap == null)
{
DOLengthMap = new Dictionary<string, ushort>();
string[] arrayList = IO_DOLength.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('#');
if (arrStr.Length == 2)
{
string ioip = arrStr[0];
ushort length = Convert.ToUInt16(arrStr[1]);
DOLengthMap.Add(ioip, length);
}
}
}
}
catch (Exception ex)
{
}
if (DOLengthMap.ContainsKey(ip))
{
return DOLengthMap[ip];
}
return 16;
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!