Commit e6920f6a 张东亮

更改自动出入库测试功能(以4个料盘进行,上下有料)

1 个父辈 2470f161
......@@ -70,6 +70,12 @@
</ItemGroup>
<ItemGroup>
<Compile Include="FormManager.cs" />
<Compile Include="FrmInOutStore.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmInOutStore.Designer.cs">
<DependentUpon>FrmInOutStore.cs</DependentUpon>
</Compile>
<Compile Include="FrmLanguare.cs">
<SubType>Form</SubType>
</Compile>
......@@ -128,6 +134,9 @@
<Compile Include="useControl\AxisMoveControl.Designer.cs">
<DependentUpon>AxisMoveControl.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="FrmInOutStore.resx">
<DependentUpon>FrmInOutStore.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmLanguare.resx">
<DependentUpon>FrmLanguare.cs</DependentUpon>
</EmbeddedResource>
......
namespace OnlineStore.ACSingleStore
{
partial class FrmInOutStore
{
/// <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.components = new System.ComponentModel.Container();
this.lstBoxInOK = new System.Windows.Forms.ListBox();
this.grpBoxOKList = new System.Windows.Forms.GroupBox();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.grpBoxLog = new System.Windows.Forms.GroupBox();
this.grpBoxOperation = new System.Windows.Forms.GroupBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnOut4 = new System.Windows.Forms.Button();
this.btnOut3 = new System.Windows.Forms.Button();
this.btnOut2 = new System.Windows.Forms.Button();
this.btnOut1 = new System.Windows.Forms.Button();
this.btnOutStore = new System.Windows.Forms.Button();
this.cmbPosition = new System.Windows.Forms.ComboBox();
this.btnStartAuto = new System.Windows.Forms.Button();
this.btnStoreStart = new System.Windows.Forms.Button();
this.mainTimer = new System.Windows.Forms.Timer(this.components);
this.grpBoxOKList.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.grpBoxLog.SuspendLayout();
this.grpBoxOperation.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// lstBoxInOK
//
this.lstBoxInOK.Dock = System.Windows.Forms.DockStyle.Fill;
this.lstBoxInOK.FormattingEnabled = true;
this.lstBoxInOK.ItemHeight = 20;
this.lstBoxInOK.Location = new System.Drawing.Point(3, 23);
this.lstBoxInOK.Name = "lstBoxInOK";
this.lstBoxInOK.Size = new System.Drawing.Size(253, 589);
this.lstBoxInOK.TabIndex = 0;
//
// grpBoxOKList
//
this.grpBoxOKList.Controls.Add(this.lstBoxInOK);
this.grpBoxOKList.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpBoxOKList.Location = new System.Drawing.Point(741, 3);
this.grpBoxOKList.Name = "grpBoxOKList";
this.grpBoxOKList.Size = new System.Drawing.Size(259, 615);
this.grpBoxOKList.TabIndex = 1;
this.grpBoxOKList.TabStop = false;
this.grpBoxOKList.Text = "入仓成功列表";
//
// richTextBox1
//
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Location = new System.Drawing.Point(3, 23);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(510, 589);
this.richTextBox1.TabIndex = 2;
this.richTextBox1.Text = "";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 21.53539F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 52.04387F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 26.32104F));
this.tableLayoutPanel1.Controls.Add(this.grpBoxOKList, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.grpBoxLog, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.grpBoxOperation, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1003, 621);
this.tableLayoutPanel1.TabIndex = 3;
//
// grpBoxLog
//
this.grpBoxLog.Controls.Add(this.richTextBox1);
this.grpBoxLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpBoxLog.Location = new System.Drawing.Point(219, 3);
this.grpBoxLog.Name = "grpBoxLog";
this.grpBoxLog.Size = new System.Drawing.Size(516, 615);
this.grpBoxLog.TabIndex = 2;
this.grpBoxLog.TabStop = false;
this.grpBoxLog.Text = "操作日志";
//
// grpBoxOperation
//
this.grpBoxOperation.Controls.Add(this.groupBox1);
this.grpBoxOperation.Controls.Add(this.btnOutStore);
this.grpBoxOperation.Controls.Add(this.cmbPosition);
this.grpBoxOperation.Controls.Add(this.btnStartAuto);
this.grpBoxOperation.Controls.Add(this.btnStoreStart);
this.grpBoxOperation.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpBoxOperation.Location = new System.Drawing.Point(3, 3);
this.grpBoxOperation.Name = "grpBoxOperation";
this.grpBoxOperation.Size = new System.Drawing.Size(210, 615);
this.grpBoxOperation.TabIndex = 3;
this.grpBoxOperation.TabStop = false;
this.grpBoxOperation.Text = "料仓操作";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.btnOut4);
this.groupBox1.Controls.Add(this.btnOut3);
this.groupBox1.Controls.Add(this.btnOut2);
this.groupBox1.Controls.Add(this.btnOut1);
this.groupBox1.Location = new System.Drawing.Point(9, 343);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(172, 239);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "待出库信息";
//
// btnOut4
//
this.btnOut4.Location = new System.Drawing.Point(6, 183);
this.btnOut4.Name = "btnOut4";
this.btnOut4.Size = new System.Drawing.Size(150, 47);
this.btnOut4.TabIndex = 7;
this.btnOut4.Text = "出库";
this.btnOut4.UseVisualStyleBackColor = true;
this.btnOut4.Click += new System.EventHandler(this.ManualOutStore);
//
// btnOut3
//
this.btnOut3.Location = new System.Drawing.Point(6, 130);
this.btnOut3.Name = "btnOut3";
this.btnOut3.Size = new System.Drawing.Size(150, 47);
this.btnOut3.TabIndex = 6;
this.btnOut3.Text = "出库";
this.btnOut3.UseVisualStyleBackColor = true;
this.btnOut3.Click += new System.EventHandler(this.ManualOutStore);
//
// btnOut2
//
this.btnOut2.Location = new System.Drawing.Point(6, 79);
this.btnOut2.Name = "btnOut2";
this.btnOut2.Size = new System.Drawing.Size(150, 47);
this.btnOut2.TabIndex = 5;
this.btnOut2.Text = "出库";
this.btnOut2.UseVisualStyleBackColor = true;
this.btnOut2.Click += new System.EventHandler(this.ManualOutStore);
//
// btnOut1
//
this.btnOut1.Location = new System.Drawing.Point(6, 26);
this.btnOut1.Name = "btnOut1";
this.btnOut1.Size = new System.Drawing.Size(150, 47);
this.btnOut1.TabIndex = 4;
this.btnOut1.Text = "出库";
this.btnOut1.UseVisualStyleBackColor = true;
this.btnOut1.Click += new System.EventHandler(this.ManualOutStore);
//
// btnOutStore
//
this.btnOutStore.Location = new System.Drawing.Point(15, 267);
this.btnOutStore.Name = "btnOutStore";
this.btnOutStore.Size = new System.Drawing.Size(150, 47);
this.btnOutStore.TabIndex = 3;
this.btnOutStore.Text = "出库";
this.btnOutStore.UseVisualStyleBackColor = true;
this.btnOutStore.Click += new System.EventHandler(this.btnOutStore_Click);
//
// cmbPosition
//
this.cmbPosition.FormattingEnabled = true;
this.cmbPosition.Location = new System.Drawing.Point(15, 221);
this.cmbPosition.Name = "cmbPosition";
this.cmbPosition.Size = new System.Drawing.Size(150, 28);
this.cmbPosition.TabIndex = 2;
//
// btnStartAuto
//
this.btnStartAuto.Location = new System.Drawing.Point(15, 129);
this.btnStartAuto.Name = "btnStartAuto";
this.btnStartAuto.Size = new System.Drawing.Size(150, 47);
this.btnStartAuto.TabIndex = 1;
this.btnStartAuto.Text = "启动自动出入库";
this.btnStartAuto.UseVisualStyleBackColor = true;
this.btnStartAuto.Click += new System.EventHandler(this.btnStartAuto_Click);
//
// btnStoreStart
//
this.btnStoreStart.Location = new System.Drawing.Point(15, 54);
this.btnStoreStart.Name = "btnStoreStart";
this.btnStoreStart.Size = new System.Drawing.Size(150, 47);
this.btnStoreStart.TabIndex = 0;
this.btnStoreStart.Text = "启动料仓";
this.btnStoreStart.UseVisualStyleBackColor = true;
this.btnStoreStart.Click += new System.EventHandler(this.btnStoreStart_Click);
//
// FrmInOutStore
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1003, 621);
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "FrmInOutStore";
this.Text = "FrmInOutStore";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmInOutStore_FormClosing);
this.Load += new System.EventHandler(this.FrmInOutStore_Load);
this.grpBoxOKList.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.grpBoxLog.ResumeLayout(false);
this.grpBoxOperation.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ListBox lstBoxInOK;
private System.Windows.Forms.GroupBox grpBoxOKList;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.GroupBox grpBoxLog;
private System.Windows.Forms.GroupBox grpBoxOperation;
private System.Windows.Forms.Button btnStoreStart;
private System.Windows.Forms.Button btnStartAuto;
private System.Windows.Forms.Timer mainTimer;
private System.Windows.Forms.ComboBox cmbPosition;
private System.Windows.Forms.Button btnOutStore;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button btnOut4;
private System.Windows.Forms.Button btnOut3;
private System.Windows.Forms.Button btnOut2;
private System.Windows.Forms.Button btnOut1;
}
}
\ No newline at end of file
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;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using log4net;
using System.Reflection;
using OnlineStore.LoadCSVLibrary;
namespace OnlineStore.ACSingleStore
{
public partial class FrmInOutStore : FrmBase
{
/// <summary>
/// 放入4个料盘步骤
/// </summary>
enum IniPositionStep
{
None,
Pos1,
Pos3,
Pos0,
Pos2,
Success
}
/// <summary>
/// 将料盘放到初始位置步骤
/// </summary>
enum MoveToStartPosStep
{
None,
S1_Out,
S1_In,
S2_Out,
S2_In,
S3_In,
S3_Out,
Sucess
}
/// <summary>
/// 循环体退出后的执行步骤
/// </summary>
enum LastStageInOutStep
{
None,
S1_Out,
S1_In,
S2_Out,
S2_In,
S3_Out,
S3_In,
S4_Out,
S4_In,
S5_Out,
S5_In,
S6_In,
S6_Out,
S7_Out,
S7_In,
Success
}
/// <summary>
/// 循环体的执行步骤
/// </summary>
enum GeneralInOutStep
{
None,
S1_Out,
S1_In,
S2_Out,
S2_In,
S3_Out,
S3_In,
S4_Out,
S4_In,
S5_Out,
S5_In,
S6_In,
S6_Out,
S7_Out,
S7_In,
S8_Out,
S8_In
}
Button[] btnOuts;
public List<string> needToInStoreNumList;
private string StartAuto = ResourceCulture.GetString("开始自动出入库");
private string StopAuto = ResourceCulture.GetString("停止自动出入库");
private bool IsRun = false; //是否自动运行
private bool IsInit = false;
private AC_SA_BoxBean store = null;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
MoveToStartPosStep moveToStartPosStep;
IniPositionStep iniPositionStep;
LastStageInOutStep lastStageInOutStep;
GeneralInOutStep generalInOutStep;
public List<int> curState; //料盘所在位置
public FrmInOutStore(AC_SA_BoxBean store)
{
InitializeComponent();
this.store = store;
lastStageInOutStep = new LastStageInOutStep();
generalInOutStep = new GeneralInOutStep();
moveToStartPosStep = new MoveToStartPosStep();
needToInStoreNumList = new List<string>();
curState = new List<int>();
iniPositionStep = new IniPositionStep();
store.PositionNumList.ForEach(var => needToInStoreNumList.Add(var));
store.IsInOutStoreAuto = true;
initValue();
btnOuts = new Button[] { btnOut1, btnOut2, btnOut3, btnOut4 };
}
#region "初始化界面数据"
private void initValue()
{
InitStoreValue();
}
private void InitStoreValue()
{
this.store = StoreManager.InitStore();
if (store == null)
{
LogUtil.error(LOGGER, "找不到对应的料仓");
return;
}
}
#endregion
private void FrmInOutStore_Load(object sender, EventArgs e)
{
LogUtil.logBox = this.richTextBox1;
btnStartAuto.Text = StartAuto;
mainTimer.Tick += MainTimer_Tick;
if (store.PositionNumList.Count > 0)
{
cmbPosition.DataSource = store.PositionNumList;
cmbPosition.SelectedIndex = 0;
}
}
/// <summary>
/// 启动测试
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnStoreStart_Click(object sender, EventArgs e)
{
store.StartRun();
if (store.storeRunStatus >= StoreRunStatus.HomeMoving)
{
StoreOpenStatus(true);
}
}
private bool preOpen = false;
public void StoreOpenStatus(bool isOpen)
{
if (preOpen.Equals(isOpen))
{
return;
}
preOpen = isOpen;
btnOutStore.Enabled = !isOpen;
cmbPosition.Enabled = !isOpen;
btnStoreStart.Enabled = !isOpen;
}
private void btnStartAuto_Click(object sender, EventArgs e)
{
if (store.storeRunStatus >= StoreRunStatus.HomeMoving)
{
if (btnStartAuto.Text == StartAuto)
{
IsRun = true;
StoreOpenStatus(true);
btnStartAuto.Text = StopAuto;
mainTimer.Enabled = true;
// store.storeRunStatus = StoreRunStatus.Runing;
//store.storeStatus = StoreStatus.StoreOnline;
}
else
{
IsRun = false;
StoreOpenStatus(false);
btnStartAuto.Text = StartAuto;
mainTimer.Enabled = false;
}
}
else
{
MyMessage.Show("请先启动料仓!");
}
}
string selectPositionNum;
/// <summary>
/// 检查仓内料盘是否为4个,不足则向料仓放料
/// </summary>
private void IniPositionProcess()
{
if (iniPositionStep == IniPositionStep.None)
{
//放置到初始位置1
//PlacePlateFromEntrance(1);
selectPositionNum = store.PositionNumList[1];
iniPositionStep = IniPositionStep.Pos1;
store.StartInStoreMove(new InOutStoreParam("", selectPositionNum), true);
}
else if (iniPositionStep == IniPositionStep.Pos1)
{
if (IsMoveFinished())
{
curState.Add(1);
LogUtil.info(LOGGER, selectPositionNum + "入库");
//放置到初始位置3
// PlacePlateFromEntrance(3);
selectPositionNum = store.PositionNumList[3];
iniPositionStep = IniPositionStep.Pos3;
store.StartInStoreMove(new InOutStoreParam("", selectPositionNum), true);
}
}
else if (iniPositionStep == IniPositionStep.Pos3)
{
if (IsMoveFinished())
{
curState.Add(3);
LogUtil.info(LOGGER, selectPositionNum + "入库");
selectPositionNum = store.PositionNumList[0];
iniPositionStep = IniPositionStep.Pos0;
store.StartInStoreMove(new InOutStoreParam("", selectPositionNum), true);
}
}
else if (iniPositionStep == IniPositionStep.Pos0)
{
if (IsMoveFinished())
{
curState.Add(0);
OnInStore(selectPositionNum);
needToInStoreNumList.Remove(selectPositionNum);
selectPositionNum = store.PositionNumList[2];
iniPositionStep = IniPositionStep.Pos2;
store.StartInStoreMove(new InOutStoreParam("", selectPositionNum), true);
}
}
else if (iniPositionStep == IniPositionStep.Pos2)
{
if (IsMoveFinished())
{
curState.Add(2);
OnInStore(selectPositionNum);
needToInStoreNumList.Remove(selectPositionNum);
curState.Sort();
iniPositionStep = IniPositionStep.Success;
}
}
else if (iniPositionStep == IniPositionStep.Success)
{
MoveToStartPositionProcess();
}
}
/// <summary>
/// 将料盘放置到循环运行的开始位置
/// </summary>
private void MoveToStartPositionProcess()
{
if (needToInStoreNumList.Count == 3)//数量为5个的情况
{
if (moveToStartPosStep == MoveToStartPosStep.None)
{
moveToStartPosStep = MoveToStartPosStep.S1_Out;
OutStoreExecution(curState[1]);
}
else if (moveToStartPosStep == MoveToStartPosStep.S1_Out)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.S1_In;
InStore(curState[1],curState[3] + 1);
}
}
else if (moveToStartPosStep == MoveToStartPosStep.S1_In)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.S2_Out;
OutStoreExecution(curState[2]);
}
}
else if (moveToStartPosStep == MoveToStartPosStep.S2_Out)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.S2_In;
InStore(curState[2], curState[0] + 1);
}
}
else if (moveToStartPosStep == MoveToStartPosStep.S2_In)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.S3_Out;
OutStoreExecution(curState[0]);
}
}
else if (moveToStartPosStep == MoveToStartPosStep.S3_Out)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.S3_In;
InStore(curState[0], curState[3] - 1);
}
}
else if (moveToStartPosStep == MoveToStartPosStep.S3_In)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.Sucess;
ClearToDeleteList();
IsInit = true;
}
}
else if (moveToStartPosStep == MoveToStartPosStep.Sucess)
{
}
}
else //大于5个的情况
{
if (moveToStartPosStep == MoveToStartPosStep.None)
{
moveToStartPosStep = MoveToStartPosStep.S1_Out;
OutStoreExecution(curState[1]);
}
else if (moveToStartPosStep == MoveToStartPosStep.S1_Out)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.S1_In;
InStoreExecution(curState[1],curState[3] + 1);
}
}
else if (moveToStartPosStep == MoveToStartPosStep.S1_In)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.S2_Out;
OutStoreExecution(curState[2]);
}
}
else if (moveToStartPosStep == MoveToStartPosStep.S2_Out)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.S2_In;
InStore(curState[2],curState[0] + 1);
}
}
else if (moveToStartPosStep == MoveToStartPosStep.S2_In)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.S3_Out;
OutStoreExecution(curState[0]);
}
}
else if (moveToStartPosStep == MoveToStartPosStep.S3_Out)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.S3_In;
InStore(curState[0],curState[3] - 1);
}
}
else if (moveToStartPosStep == MoveToStartPosStep.S3_In)
{
if (IsMoveFinished())
{
moveToStartPosStep = MoveToStartPosStep.Sucess;
ClearToDeleteList();
IsInit = true;
}
}
else if (moveToStartPosStep == MoveToStartPosStep.Sucess)
{
}
}
///移动到初始位置
//store.MoveToPos(store.curState[1], store.curState[3] + 1);
//store.InStore(store.curState[2], store.curState[0] + 1);
// store.InStore(store.curState[0], store.curState[3] - 1);
}
/// <summary>
/// 出入库流程
/// </summary>
public void InOutProcess()
{
try
{
if (needToInStoreNumList.Count >= 0)
{
if (needToInStoreNumList.Count == 0) //针对数量只有5个的情况
{
if (lastStageInOutStep == LastStageInOutStep.None)
{
lastStageInOutStep = LastStageInOutStep.Success;
LogUtil.info(LOGGER, "所有仓位入料测试完成");
}
else if (lastStageInOutStep == LastStageInOutStep.Success)
{
}
}
if (needToInStoreNumList.Count == 1)
{
// MoveToPos(curState[3], curState[3] + 1);
if (lastStageInOutStep == LastStageInOutStep.None)
{
lastStageInOutStep = LastStageInOutStep.S1_Out;
OutStoreExecution(curState[3]);
}
else if (lastStageInOutStep == LastStageInOutStep.S1_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S1_In;
InStoreExecution(curState[3], curState[3] + 1);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S1_In) // InStore(curState[0], curState[3] - 1);
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S2_Out;
OutStoreExecution(curState[0]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S2_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S2_In;
InStore(curState[0], curState[3] - 1);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S2_In) // MoveToPos(curState[0], curState[3] + 2);
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S3_Out;
OutStoreExecution(curState[0]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S3_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S3_In;
InStoreExecution(curState[0], curState[3] + 2);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S3_In) // InStore(curState[0], curState[3] - 1);
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S4_Out;
OutStoreExecution(curState[0]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S4_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S4_In;
InStore(curState[0], curState[3] - 1);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S4_In) //InStore(curState[1], curState[1]);
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S5_Out;
OutStoreExecution(curState[1]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S5_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S5_In;
InStore(curState[1], curState[1]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S5_In) // InStore(curState[3], curState[3]);
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S6_Out;
OutStoreExecution(curState[0]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S6_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S6_In;
InStore(curState[0], curState[3] + 1);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S6_In) // InStore(curState[3], curState[3]);
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S7_Out;
OutStoreExecution(curState[3]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S7_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S7_In;
InStore(curState[3], curState[3]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S7_In)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.Success;
ClearToDeleteList();
LogUtil.info(LOGGER, "所有仓位入料测试完成");
}
}
else if (lastStageInOutStep == LastStageInOutStep.Success)
{
}
}
else if (needToInStoreNumList.Count == 2)
{
if (lastStageInOutStep == LastStageInOutStep.None)
{
lastStageInOutStep = LastStageInOutStep.S1_Out;
OutStoreExecution(curState[0]);
}
else if (lastStageInOutStep == LastStageInOutStep.S1_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S1_In;
InStore(curState[0], curState[3] + 1);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S1_In)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S2_Out;
OutStoreExecution(curState[2]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S2_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S2_In;
InStore(curState[2], curState[2]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S2_In)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.Success;
ClearToDeleteList();
LogUtil.info(LOGGER, "所有仓位入料测试完成");
}
}
else if (lastStageInOutStep == LastStageInOutStep.Success)
{
}
}
else if (needToInStoreNumList.Count == 3)
{
if (lastStageInOutStep == LastStageInOutStep.None)
{
lastStageInOutStep = LastStageInOutStep.S1_Out;
OutStoreExecution(curState[3]);
}
else if (lastStageInOutStep == LastStageInOutStep.S1_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S1_In;
InStoreExecution(curState[3], curState[3] + 1);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S1_In)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S2_Out;
OutStoreExecution(curState[0]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S2_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S2_In;
InStore(curState[0], curState[3] - 1);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S2_In)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S3_Out;
OutStoreExecution(curState[0]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S3_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S3_In;
InStore(curState[0], curState[3] + 1);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S3_In)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S4_Out;
OutStoreExecution(curState[2]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S4_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S4_In;
InStore(curState[2], curState[2]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S4_In)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.Success;
ClearToDeleteList();
LogUtil.info(LOGGER, "所有仓位入料测试完成");
}
}
else if (lastStageInOutStep == LastStageInOutStep.Success)
{
}
}
else if (needToInStoreNumList.Count == 4)
{
// MoveToPos(curState[3], curState[3] + 1);
if (lastStageInOutStep == LastStageInOutStep.None)
{
lastStageInOutStep = LastStageInOutStep.S1_Out;
OutStoreExecution(curState[3]);
}
else if (lastStageInOutStep == LastStageInOutStep.S1_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S1_In;
InStoreExecution(curState[3], curState[3] + 1);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S1_In) // InStore(curState[0], curState[3] - 1);
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S2_Out;
OutStoreExecution(curState[0]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S2_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S2_In;
InStore(curState[0], curState[3] - 1);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S2_In) // MoveToPos(curState[0], curState[3] + 2);
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S3_Out;
OutStoreExecution(curState[0]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S3_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S3_In;
InStoreExecution(curState[0], curState[3] + 2);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S3_In) // InStore(curState[0], curState[3] - 1);
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S4_Out;
OutStoreExecution(curState[0]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S4_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S4_In;
InStore(curState[0], curState[3] - 1);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S4_In) //InStore(curState[1], curState[1]);
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S5_Out;
OutStoreExecution(curState[1]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S5_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S5_In;
InStore(curState[1], curState[1]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S5_In) // InStore(curState[3], curState[3]);
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S6_Out;
OutStoreExecution(curState[3]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S6_Out)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.S6_In;
InStore(curState[3], curState[3]);
}
}
else if (lastStageInOutStep == LastStageInOutStep.S6_In)
{
if (IsMoveFinished())
{
lastStageInOutStep = LastStageInOutStep.Success;
ClearToDeleteList();
LogUtil.info(LOGGER, "所有仓位入料测试完成");
}
}
else if (lastStageInOutStep == LastStageInOutStep.Success)
{
}
}
else if (needToInStoreNumList.Count > 4)
{
InOutMainProcess();
}
}
}
catch (Exception ex)
{
LogUtil.error(LOGGER, ex.ToString());
}
}
/// <summary>
/// 循环体执行流程
/// </summary>
void InOutMainProcess()
{
if (generalInOutStep == GeneralInOutStep.None) // MoveToPos(curState[3], curState[3] + 1);
{
generalInOutStep = GeneralInOutStep.S1_Out;
OutStoreExecution(curState[3]);
}
else if (generalInOutStep == GeneralInOutStep.S1_Out)
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S1_In;
InStoreExecution(curState[3], curState[3] + 1);
}
}
else if (generalInOutStep == GeneralInOutStep.S1_In) // InStore(curState[0], curState[3] - 1);
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S2_Out;
OutStoreExecution(curState[0]);
}
}
else if (generalInOutStep == GeneralInOutStep.S2_Out)
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S2_In;
InStore(curState[0], curState[3] - 1);
}
}
else if (generalInOutStep == GeneralInOutStep.S2_In) // MoveToPos(curState[0], curState[3] + 2);
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S3_Out;
OutStoreExecution(curState[0]);
}
}
else if (generalInOutStep == GeneralInOutStep.S3_Out)
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S3_In;
InStoreExecution(curState[0], curState[3] + 2);
}
}
else if (generalInOutStep == GeneralInOutStep.S3_In) // InStore(curState[0], curState[3] - 1);
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S4_Out;
OutStoreExecution(curState[0]);
}
}
else if (generalInOutStep == GeneralInOutStep.S4_Out)
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S4_In;
InStore(curState[0], curState[3] - 1);
}
}
else if (generalInOutStep == GeneralInOutStep.S4_In) //MoveToPos(curState[1], curState[3] + 1);
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S5_Out;
OutStoreExecution(curState[1]);
}
}
else if (generalInOutStep == GeneralInOutStep.S5_Out)
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S5_In;
InStoreExecution(curState[1], curState[3] + 1);
}
}
else if (generalInOutStep == GeneralInOutStep.S5_In) // InStore(curState[2], curState[0] + 1);
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S6_Out;
OutStoreExecution(curState[2]);
}
}
else if (generalInOutStep == GeneralInOutStep.S6_Out)
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S6_In;
InStore(curState[2], curState[0] + 1);
}
}
else if (generalInOutStep == GeneralInOutStep.S6_In) //InStore(curState[1], curState[3] - 1);
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S7_Out;
OutStoreExecution(curState[1]);
}
}
else if (generalInOutStep == GeneralInOutStep.S7_Out)
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S7_In;
InStore(curState[1], curState[3] - 1);
}
}
else if (generalInOutStep == GeneralInOutStep.S7_In) // MoveToPos(curState[0], curState[0] + 1);
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S8_Out;
OutStoreExecution(curState[0]);
}
}
else if (generalInOutStep == GeneralInOutStep.S8_Out)
{
if (IsMoveFinished())
{
generalInOutStep = GeneralInOutStep.S8_In;
InStoreExecution(curState[0], curState[0] + 1);
}
}
else if (generalInOutStep == GeneralInOutStep.S8_In)
{
if (IsMoveFinished())
{
ClearToDeleteList();
generalInOutStep = GeneralInOutStep.None;
}
}
}
private void MainTimer_Tick(object sender, EventArgs e)
{
if (!IsRun)
return;
if (IsInit)//料盘到达初始位置
{
InOutProcess();
}
else
{
IniPositionProcess();
}
if (curState.Count != 0) //将目前料盘的位置信息更新到按钮中,方便后续出库
{
for (int i = 0; i < curState.Count; i++)
{
btnOuts[i].Text = store.PositionNumList[curState[i]];
btnOuts[i].Tag = curState[i];
}
}
}
private void FrmInOutStore_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult result = MyMessage.Show("是否确定退出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result.Equals(DialogResult.Yes))
{
ExitApp();
}
}
/// <summary>
/// 退出程序
/// </summary>
private void ExitApp()
{
try
{
store.IsInOutStoreAuto = false;
IsRun = false;
mainTimer.Enabled = false;
curState = null;
needToInStoreNumList.Clear();
needToInStoreNumList = null;
IsInit = false;
if (lstBoxInOK.Items.Count != 0)
lstBoxInOK.Items.Clear();
}
catch
{ }
}
/// <summary>
/// 出库操作
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnOutStore_Click(object sender, EventArgs e)
{
if (store.storeRunStatus >= StoreRunStatus.HomeMoving)
{
string selectPositionNum = cmbPosition.Text;
store.StartOutStoreMove(new InOutStoreParam("", selectPositionNum));
}
else
{
MyMessage.Show("请先启动料仓!");
}
}
/// <summary>
/// 将4个料盘出库操作
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ManualOutStore(object sender, EventArgs e)
{
if (store.storeRunStatus >= StoreRunStatus.HomeMoving)
{
if(IsMoveFinished())
{
Button btn = sender as Button;
int idx = (int)btn.Tag;
string selectPositionNum = (string)btn.Text;
btn.Enabled = false;
store.StartOutStoreMove(new InOutStoreParam("", selectPositionNum));
}
else
{
MyMessage.Show("请先等待当前出/入库操作完成后再进行操作!");
}
}
else
{
MyMessage.Show("请先启动料仓!");
}
}
/// <summary>
/// 检查出库/入库是否完成
/// </summary>
/// <returns></returns>
bool IsMoveFinished()
{
if (store.storeRunStatus == StoreRunStatus.Runing && store.storeStatus == StoreStatus.StoreOnline)
return true;
return false;
}
List<string> toDeleteList = new List<string>();
public void ClearToDeleteList()
{
foreach (string item in toDeleteList)
{
needToInStoreNumList.Remove(item);
}
toDeleteList.Clear();
}
/// <summary>
/// 入库测试成功(上下有料情况)
/// </summary>
/// <param name="fromPositionIdx"></param>
/// <param name="toPositionIdx"></param>
public void InStore(int fromPositionIdx, int toPositionIdx)
{
InStoreExecution(fromPositionIdx, toPositionIdx);
toDeleteList.Add(store.PositionNumList[toPositionIdx]);
OnInStore(store.PositionNumList[toPositionIdx]);
}
/// <summary>
/// 入库操作
/// </summary>
/// <param name="fromPositionIdx"></param>
/// <param name="toPositionIdx"></param>
public void InStoreExecution(int fromPositionIdx, int toPositionIdx)
{
string selectPositionNum = store.PositionNumList[toPositionIdx];
curState.Remove(fromPositionIdx);
curState.Add(toPositionIdx);
curState.Sort();
store.StartInStoreMove(new InOutStoreParam("", selectPositionNum));
}
/// <summary>
/// 出库操作
/// </summary>
/// <param name="fromPositionIdx"></param>
public void OutStoreExecution(int fromPositionIdx)
{
string selectPositionNum = store.PositionNumList[fromPositionIdx];
store.StartOutStoreMove(new InOutStoreParam("", selectPositionNum));
//LogUtil.info(LOGGER, selectPositionNum + "出库");
}
/// <summary>
/// 仓位测试完成
/// </summary>
/// <param name="selectPositionNum"></param>
public void OnInStore(string selectPositionNum)
{
lstBoxInOK.Items.Add(selectPositionNum);
lstBoxInOK.SelectedIndex = lstBoxInOK.Items.Count - 1;
grpBoxOKList.Text = "仓位入库成功列表_" + lstBoxInOK.Items.Count + "/" + store.PositionNumList.Count;
LogUtil.info(LOGGER, selectPositionNum + "仓位入库测试完成");
}
}
}
<?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>
<metadata name="mainTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
......@@ -692,6 +692,20 @@ namespace OnlineStore.ACSingleStore
}
}
/// <summary>
/// 打开自动出入库测试
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnOpenAutoInOut_Click(object sender, EventArgs e)
{
FrmInOutStore frmInOutStore = new FrmInOutStore(store);
if(frmInOutStore.ShowDialog() == DialogResult.Yes)
{
frmInOutStore = null;
}
}
private void 轴卡点动ToolStripMenuItem_Click(object sender, EventArgs e)
{
button1_Click(null, null);
......@@ -1201,6 +1215,7 @@ namespace OnlineStore.ACSingleStore
{
IOManager.IOMove(IO_Type.Device_Led, IO_VALUE.LOW);
}
}
}
......@@ -27,6 +27,7 @@ namespace OnlineStore.DeviceLibrary
public int autoPositionIndex = 0;
public string autoMsg = "";
public int AutoStartIndex = -1;
public bool IsInOutStoreAuto = false; //是否开启自动出入库
#endregion
#region 出入库参数
......@@ -498,7 +499,7 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Runing;
//设备连接,入库后,BOX恢复原始状态
storeStatus = StoreStatus.StoreOnline;
InOutEndProcess(StoreMoveType.InStore);
//InOutEndProcess(StoreMoveType.InStore);
}
else
{
......@@ -733,10 +734,18 @@ namespace OnlineStore.DeviceLibrary
}
int ms = OutStoreWaitSeconds * 1000;
StoreMove.NextMoveStep(StoreMoveStep.SO_15_WaitTake);
OutStoreLog("出库:SO_14_WaitTake 等待拿走物品,最多等待" + OutStoreWaitSeconds + "秒");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(ms));
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
if(!IsInOutStoreAuto)
{
OutStoreLog("出库:SO_14_WaitTake 等待拿走物品,最多等待" + OutStoreWaitSeconds + "秒");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(ms));
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
}
else
{
OutStoreLog("出库:SO_14_WaitTake 放置物品,最多等待" + "3秒");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(3000));
}
StoreMove.OneWaitCanEndStep = true;
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_15_WaitTake)
......@@ -748,7 +757,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】出库结束[" + FormUtil.GetSpanStr(span) + "]", storeMoveColor);
StoreMove.EndMove();
storeRunStatus = StoreRunStatus.Runing;
InOutEndProcess(StoreMoveType.OutStore);
//InOutEndProcess(StoreMoveType.OutStore);
}
else
{
......@@ -830,6 +839,7 @@ namespace OnlineStore.DeviceLibrary
waitOutStoreList.Add(code);
}
}
private void InOutEndProcess(StoreMoveType storeMoveType)
{
try
......@@ -844,29 +854,29 @@ namespace OnlineStore.DeviceLibrary
if (storeMoveType.Equals(StoreMoveType.InStore))
{
// autoPositionIndex = newIndex;
string posid = PositionNumList[autoPositionIndex];
string posid = PositionNumList[autoPositionIndex];
//判断是否需要重置
if (CurrInOutACount >= Config.Box_ResetACount)
{
LogUtil.info(LOGGER, StoreName + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把出库信息存入排队列表中");
Reset(false);
autoMsg = "自动出库:" + posid;
AddWaitOutInfo(new FixtureCodeInfo(0, "", posid));
}
//else if (CurrInOutCount >= Config.Box_ResetMCount)
//{
// LogUtil.info(LOGGER, StoreName + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
// //ResetMiddleAxis(false);
// autoMsg = "自动出库:" + posid;
// AddWaitOutInfo(new FixtureCodeInfo(0, "", posid));
//}
else
{
LogUtil.info(LOGGER, StoreName + "自动进入下一个出库:posid=" + posid);
autoMsg = "自动出库:" + posid;
StartOutStoreMove(new InOutStoreParam("", posid));
}
//判断是否需要重置
if (CurrInOutACount >= Config.Box_ResetACount)
{
LogUtil.info(LOGGER, StoreName + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把出库信息存入排队列表中");
Reset(false);
autoMsg = "自动出库:" + posid;
AddWaitOutInfo(new FixtureCodeInfo(0, "", posid));
}
//else if (CurrInOutCount >= Config.Box_ResetMCount)
//{
// LogUtil.info(LOGGER, StoreName + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
// //ResetMiddleAxis(false);
// autoMsg = "自动出库:" + posid;
// AddWaitOutInfo(new FixtureCodeInfo(0, "", posid));
//}
else
{
LogUtil.info(LOGGER, StoreName + "自动进入下一个出库:posid=" + posid);
autoMsg = "自动出库:" + posid;
StartOutStoreMove(new InOutStoreParam("", posid));
}
//}
}
else if (storeMoveType.Equals(StoreMoveType.OutStore))
......@@ -886,7 +896,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + "下一个索引不存在,自动 出入库结束!");
}
}
if(autoNext)
if (autoNext)
{
autoPositionIndex = newIndex;
string posid = PositionNumList[autoPositionIndex];
......@@ -919,7 +929,6 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, ex.ToString());
}
}
private void InStoreLog(string msg)
{
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!