Commit 6f747e76 几米阳光

增加单盘入库功能

1 个父辈 7a872b9d
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
this.label21 = new System.Windows.Forms.Label(); this.label21 = new System.Windows.Forms.Label();
this.btnOutStore = new System.Windows.Forms.Button(); this.btnOutStore = new System.Windows.Forms.Button();
this.groupBox6 = new System.Windows.Forms.GroupBox(); this.groupBox6 = new System.Windows.Forms.GroupBox();
this.btnSingleTrayIn = new System.Windows.Forms.Button();
this.lblBatchMsg = new System.Windows.Forms.Label(); this.lblBatchMsg = new System.Windows.Forms.Label();
this.btnOpenDoor = new System.Windows.Forms.Button(); this.btnOpenDoor = new System.Windows.Forms.Button();
this.lblWaitTragGo = new System.Windows.Forms.Label(); this.lblWaitTragGo = new System.Windows.Forms.Label();
...@@ -259,9 +260,6 @@ ...@@ -259,9 +260,6 @@
this.清理日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.清理日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
this.英文ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.英文ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.btnTrayIn = new System.Windows.Forms.Button();
this.btnTrayOk = new System.Windows.Forms.Button();
this.lblTray = new System.Windows.Forms.Label();
this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout();
this.groupAuto.SuspendLayout(); this.groupAuto.SuspendLayout();
this.groupBox6.SuspendLayout(); this.groupBox6.SuspendLayout();
...@@ -452,9 +450,7 @@ ...@@ -452,9 +450,7 @@
// //
this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.groupBox6.Controls.Add(this.lblTray); this.groupBox6.Controls.Add(this.btnSingleTrayIn);
this.groupBox6.Controls.Add(this.btnTrayIn);
this.groupBox6.Controls.Add(this.btnTrayOk);
this.groupBox6.Controls.Add(this.lblBatchMsg); this.groupBox6.Controls.Add(this.lblBatchMsg);
this.groupBox6.Controls.Add(this.btnOpenDoor); this.groupBox6.Controls.Add(this.btnOpenDoor);
this.groupBox6.Controls.Add(this.lblWaitTragGo); this.groupBox6.Controls.Add(this.lblWaitTragGo);
...@@ -473,6 +469,17 @@ ...@@ -473,6 +469,17 @@
this.groupBox6.TabStop = false; this.groupBox6.TabStop = false;
this.groupBox6.Text = "批量上下料操作"; this.groupBox6.Text = "批量上下料操作";
// //
// btnSingleTrayIn
//
this.btnSingleTrayIn.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSingleTrayIn.Location = new System.Drawing.Point(487, 177);
this.btnSingleTrayIn.Name = "btnSingleTrayIn";
this.btnSingleTrayIn.Size = new System.Drawing.Size(155, 38);
this.btnSingleTrayIn.TabIndex = 236;
this.btnSingleTrayIn.Text = "启动单盘入库";
this.btnSingleTrayIn.UseVisualStyleBackColor = true;
this.btnSingleTrayIn.Click += new System.EventHandler(this.btnTrayIn_Click);
//
// lblBatchMsg // lblBatchMsg
// //
this.lblBatchMsg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblBatchMsg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
...@@ -499,20 +506,20 @@ ...@@ -499,20 +506,20 @@
this.lblWaitTragGo.AutoSize = true; this.lblWaitTragGo.AutoSize = true;
this.lblWaitTragGo.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWaitTragGo.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWaitTragGo.ForeColor = System.Drawing.Color.Red; this.lblWaitTragGo.ForeColor = System.Drawing.Color.Red;
this.lblWaitTragGo.Location = new System.Drawing.Point(193, 99); this.lblWaitTragGo.Location = new System.Drawing.Point(171, 99);
this.lblWaitTragGo.Name = "lblWaitTragGo"; this.lblWaitTragGo.Name = "lblWaitTragGo";
this.lblWaitTragGo.Size = new System.Drawing.Size(250, 22); this.lblWaitTragGo.Size = new System.Drawing.Size(298, 22);
this.lblWaitTragGo.TabIndex = 231; this.lblWaitTragGo.TabIndex = 231;
this.lblWaitTragGo.Text = "请拿走料盘,并点击左侧按钮确认"; this.lblWaitTragGo.Text = "请拿走或放入料盘,并点击左侧按钮确认";
// //
// btnWaitTrgGo // btnWaitTrgGo
// //
this.btnWaitTrgGo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnWaitTrgGo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnWaitTrgGo.Location = new System.Drawing.Point(11, 92); this.btnWaitTrgGo.Location = new System.Drawing.Point(11, 91);
this.btnWaitTrgGo.Name = "btnWaitTrgGo"; this.btnWaitTrgGo.Name = "btnWaitTrgGo";
this.btnWaitTrgGo.Size = new System.Drawing.Size(155, 38); this.btnWaitTrgGo.Size = new System.Drawing.Size(155, 38);
this.btnWaitTrgGo.TabIndex = 230; this.btnWaitTrgGo.TabIndex = 230;
this.btnWaitTrgGo.Text = "门口料盘已拿出"; this.btnWaitTrgGo.Text = "料盘已拿出/放入";
this.btnWaitTrgGo.UseVisualStyleBackColor = true; this.btnWaitTrgGo.UseVisualStyleBackColor = true;
this.btnWaitTrgGo.Click += new System.EventHandler(this.btnWaitTrgGo_Click); this.btnWaitTrgGo.Click += new System.EventHandler(this.btnWaitTrgGo_Click);
// //
...@@ -575,9 +582,9 @@ ...@@ -575,9 +582,9 @@
// //
this.lblOutInfo.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblOutInfo.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblOutInfo.ForeColor = System.Drawing.Color.Green; this.lblOutInfo.ForeColor = System.Drawing.Color.Green;
this.lblOutInfo.Location = new System.Drawing.Point(22, 99); this.lblOutInfo.Location = new System.Drawing.Point(11, 99);
this.lblOutInfo.Name = "lblOutInfo"; this.lblOutInfo.Name = "lblOutInfo";
this.lblOutInfo.Size = new System.Drawing.Size(584, 22); this.lblOutInfo.Size = new System.Drawing.Size(631, 22);
this.lblOutInfo.TabIndex = 234; this.lblOutInfo.TabIndex = 234;
this.lblOutInfo.Text = "累积出库信息"; this.lblOutInfo.Text = "累积出库信息";
this.lblOutInfo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblOutInfo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
...@@ -2943,41 +2950,6 @@ ...@@ -2943,41 +2950,6 @@
this.英文ToolStripMenuItem.Text = "英文"; this.英文ToolStripMenuItem.Text = "英文";
this.英文ToolStripMenuItem.Click += new System.EventHandler(this.开启DEBUGToolStripMenuItem_Click); this.英文ToolStripMenuItem.Click += new System.EventHandler(this.开启DEBUGToolStripMenuItem_Click);
// //
// btnTrayIn
//
this.btnTrayIn.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnTrayIn.Location = new System.Drawing.Point(487, 177);
this.btnTrayIn.Name = "btnTrayIn";
this.btnTrayIn.Size = new System.Drawing.Size(155, 38);
this.btnTrayIn.TabIndex = 236;
this.btnTrayIn.Text = "启动单盘入库";
this.btnTrayIn.UseVisualStyleBackColor = true;
this.btnTrayIn.Visible = false;
this.btnTrayIn.Click += new System.EventHandler(this.btnTrayIn_Click);
//
// btnTrayOk
//
this.btnTrayOk.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnTrayOk.Location = new System.Drawing.Point(11, 176);
this.btnTrayOk.Name = "btnTrayOk";
this.btnTrayOk.Size = new System.Drawing.Size(155, 38);
this.btnTrayOk.TabIndex = 235;
this.btnTrayOk.Text = "料盘已放入";
this.btnTrayOk.UseVisualStyleBackColor = true;
this.btnTrayOk.Visible = false;
//
// lblTray
//
this.lblTray.AutoSize = true;
this.lblTray.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblTray.ForeColor = System.Drawing.Color.Red;
this.lblTray.Location = new System.Drawing.Point(193, 183);
this.lblTray.Name = "lblTray";
this.lblTray.Size = new System.Drawing.Size(250, 22);
this.lblTray.TabIndex = 237;
this.lblTray.Text = "请放入料盘,并点击左侧按钮确认";
this.lblTray.Visible = false;
//
// FrmStoreBox // FrmStoreBox
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
...@@ -3268,9 +3240,7 @@ ...@@ -3268,9 +3240,7 @@
public System.Windows.Forms.Label label30; public System.Windows.Forms.Label label30;
private System.Windows.Forms.GroupBox groupAuto; private System.Windows.Forms.GroupBox groupAuto;
private System.Windows.Forms.CheckBox checkBox1; private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Button btnTrayIn; private System.Windows.Forms.Button btnSingleTrayIn;
private System.Windows.Forms.Button btnTrayOk;
private System.Windows.Forms.Label lblTray;
} }
} }
...@@ -403,7 +403,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -403,7 +403,7 @@ namespace OnlineStore.AutoInOutStore
btnBatchInStore.Enabled = map[ParamDefine.startBatchIn].Equals(ParamDefine.enable); btnBatchInStore.Enabled = map[ParamDefine.startBatchIn].Equals(ParamDefine.enable);
btnGetOutTray.Enabled = map[ParamDefine.takeOutReel].Equals(ParamDefine.enable); btnGetOutTray.Enabled = map[ParamDefine.takeOutReel].Equals(ParamDefine.enable);
btnCloseDoor.Enabled = map[ParamDefine.closeLock].Equals(ParamDefine.enable); btnCloseDoor.Enabled = map[ParamDefine.closeLock].Equals(ParamDefine.enable);
btnSingleTrayIn.Enabled = map[ParamDefine.singleReelIn].Equals(ParamDefine.enable);
lblDoorStatus.Text = map[ParamDefine.doorStatus]; lblDoorStatus.Text = map[ParamDefine.doorStatus];
lblOutInfo.Visible = !lblWaitTragGo.Visible; lblOutInfo.Visible = !lblWaitTragGo.Visible;
lblOutInfo.Text = ResourceCulture.GetString(ResourceCulture.InstoreInfo,"批量出入库信息: 入库:" )+ AutomaticBaiting.BatchInStoreCount + "," + AutomaticBaiting.BatchInStoreHeight + "mm," + lblOutInfo.Text = ResourceCulture.GetString(ResourceCulture.InstoreInfo,"批量出入库信息: 入库:" )+ AutomaticBaiting.BatchInStoreCount + "," + AutomaticBaiting.BatchInStoreHeight + "mm," +
...@@ -1754,19 +1754,12 @@ namespace OnlineStore.AutoInOutStore ...@@ -1754,19 +1754,12 @@ namespace OnlineStore.AutoInOutStore
private void btnTrayIn_Click(object sender, EventArgs e) private void btnTrayIn_Click(object sender, EventArgs e)
{ {
string defaultPosId = ConfigAppSettings.GetValue(Setting_Init.SinglePosId).Trim(); string msg = AutomaticBaiting.doSingleReelIn();
if (store.PositionNumList.Contains(defaultPosId)) if (!msg.Equals(""))
{
bool result = store.StartInStoreMove(new InOutStoreParam("", defaultPosId), false, true);
if (!result)
{
MessageBox.Show("启动单盘出库失败:" + store.CodeOrInoutMsg);
}
}
else
{ {
MessageBox.Show("请先正确配置 " + Setting_Init.SinglePosId); MessageBox.Show(msg);
} }
} }
} }
} }
...@@ -899,10 +899,10 @@ ...@@ -899,10 +899,10 @@
<value>Open doorlock</value> <value>Open doorlock</value>
</data> </data>
<data name="FrmStoreBox_lblWaitTragGo_Text" xml:space="preserve"> <data name="FrmStoreBox_lblWaitTragGo_Text" xml:space="preserve">
<value>Take reel,click left to confirm</value> <value>Take/Put In reel,click left to confirm</value>
</data> </data>
<data name="FrmStoreBox_btnWaitTrgGo_Text" xml:space="preserve"> <data name="FrmStoreBox_btnWaitTrgGo_Text" xml:space="preserve">
<value>Portal reel taken</value> <value>Portal reel taken/put in</value>
</data> </data>
<data name="FrmStoreBox_lblBatchStatus_Text" xml:space="preserve"> <data name="FrmStoreBox_lblBatchStatus_Text" xml:space="preserve">
<value>Wait to start</value> <value>Wait to start</value>
......
...@@ -895,10 +895,10 @@ ...@@ -895,10 +895,10 @@
<value>打开门锁</value> <value>打开门锁</value>
</data> </data>
<data name="FrmStoreBox_lblWaitTragGo_Text" xml:space="preserve"> <data name="FrmStoreBox_lblWaitTragGo_Text" xml:space="preserve">
<value>请拿走料盘,并点击左侧按钮确认</value> <value>请拿走/放入料盘,并点击左侧按钮确认</value>
</data> </data>
<data name="FrmStoreBox_btnWaitTrgGo_Text" xml:space="preserve"> <data name="FrmStoreBox_btnWaitTrgGo_Text" xml:space="preserve">
<value>门口料盘已拿出</value> <value>料盘已拿出/放入</value>
</data> </data>
<data name="FrmStoreBox_lblBatchStatus_Text" xml:space="preserve"> <data name="FrmStoreBox_lblBatchStatus_Text" xml:space="preserve">
<value>等待启动</value> <value>等待启动</value>
......
...@@ -191,8 +191,10 @@ IO模块读取时间改为可配置。 ...@@ -191,8 +191,10 @@ IO模块读取时间改为可配置。
PRO,(轴五)上料轴出库上升最大高度,BatchAxis_OutMaxValue,1600000,,,,,,, PRO,(轴五)上料轴出库上升最大高度,BatchAxis_OutMaxValue,1600000,,,,,,,
20190529:增加单盘入库功能
增加配置:
<add key="SinglePosId" value="1#AC2_2_1_1" />
......
...@@ -225,6 +225,10 @@ namespace OnlineStore.Common ...@@ -225,6 +225,10 @@ namespace OnlineStore.Common
/// 门口料盘已取出 /// 门口料盘已取出
/// </summary> /// </summary>
public static string confirmReelOut = "confirmReelOut"; public static string confirmReelOut = "confirmReelOut";
/// <summary>
/// 单盘入库按钮
/// </summary>
public static string singleReelIn = "singleReelIn";
public static string doorStatus = "doorStatus"; public static string doorStatus = "doorStatus";
......
...@@ -12,6 +12,7 @@ using System.Net; ...@@ -12,6 +12,7 @@ using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Threading; using System.Threading;
using System.Collections.Generic; using System.Collections.Generic;
using OnlineStore.Common;
namespace Asa.IOModule namespace Asa.IOModule
{ {
...@@ -598,6 +599,8 @@ namespace Asa.IOModule ...@@ -598,6 +599,8 @@ namespace Asa.IOModule
{ {
while (true) while (true)
{ {
try
{
if (_receive.TryDequeue(out byte[] buff)) if (_receive.TryDequeue(out byte[] buff))
{ {
if (buff[7] == 1) if (buff[7] == 1)
...@@ -607,6 +610,10 @@ namespace Asa.IOModule ...@@ -607,6 +610,10 @@ namespace Asa.IOModule
else if (buff[7] == 5) else if (buff[7] == 5)
ReadSingle(buff); ReadSingle(buff);
} }
}catch(Exception ex)
{
LogUtil.error("AIOBOX2 Receive出错:" + ex.ToString());
}
Thread.Sleep(10); Thread.Sleep(10);
} }
} }
......
...@@ -12,6 +12,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -12,6 +12,12 @@ namespace OnlineStore.DeviceLibrary
public delegate string GetStringDelegate(string id, string defaultStr, params object[] param); public delegate string GetStringDelegate(string id, string defaultStr, params object[] param);
public static event GetStringDelegate GetStringEvent; public static event GetStringDelegate GetStringEvent;
public static string GetMsgStr(string value)
{
string result = GetStrEvent?.Invoke(value, value);
return result;
}
public static string GetString(string id, string defaultStr) public static string GetString(string id, string defaultStr)
{ {
string result = GetStrEvent?.Invoke(id, defaultStr); string result = GetStrEvent?.Invoke(id, defaultStr);
......
...@@ -125,12 +125,12 @@ PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM6,,,,,,, ...@@ -125,12 +125,12 @@ PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM6,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,, PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,, PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,, PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,60000,,,,,,, PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,40000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,100000,,,,,,, PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,70000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,100000,,,,,,, PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,70000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,40000,,,,,,, PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,40000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,40000,,,,,,, PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,40000,,,,,,,
PRO,硕科步进电机(压紧轴)原点返回速度,CompressAxis_HomeSpeed,10000,,,,,,, PRO,硕科步进电机(压紧轴)原点返回速度,CompressAxis_HomeSpeed,30000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,, , PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,, ,
,,,,,,,,,, ,,,,,,,,,,
PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,800,,,,,,, PRO,(轴五)上料轴目标速度,BatchAxis_TargetSpeed,800,,,,,,,
......
...@@ -527,7 +527,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -527,7 +527,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
InOutStoreParam param = new InOutStoreParam("", PositionNumList[0]); InOutStoreParam param = new InOutStoreParam("", PositionNumList[0]);
if (LoadParamPosition(param, false)) if (LoadParamPosition(param))
{ {
StoreMove.MoveParam = param; StoreMove.MoveParam = param;
StoreMove.NextMoveStep(StoreMoveStep.BOX_R41_InoutToP4); StoreMove.NextMoveStep(StoreMoveStep.BOX_R41_InoutToP4);
...@@ -1839,6 +1839,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -1839,6 +1839,11 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.info(StoreName + "收到服务器命令:confirmReelOut=doit"); LogUtil.info(StoreName + "收到服务器命令:confirmReelOut=doit");
AutomaticBaiting.doConfirmReelGo(); AutomaticBaiting.doConfirmReelGo();
} else if (dataMap.ContainsKey(ParamDefine.singleReelIn) && dataMap[ParamDefine.singleReelIn].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + "收到服务器命令:SingleReelIn=doit");
result = AutomaticBaiting.doSingleReelIn();
} }
if (!result.Equals("")) if (!result.Equals(""))
{ {
......
...@@ -38,7 +38,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -38,7 +38,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, bool IsBatch) private bool LoadParamPosition(InOutStoreParam param )
{ {
if (param == null) if (param == null)
{ {
...@@ -308,7 +308,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -308,7 +308,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (storeRunStatus == StoreRunStatus.Runing) if (storeRunStatus == StoreRunStatus.Runing)
{ {
if (!LoadParamPosition(param, false)) if (!LoadParamPosition(param))
{ {
UpdateInOutMsg(logMsg + "失败,找不到库位信息"); UpdateInOutMsg(logMsg + "失败,找不到库位信息");
return false; return false;
...@@ -613,7 +613,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -613,7 +613,8 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.InOut_Axis, moveP.InOut_P4, Config.InOutAxis_P2_Speed); ACAxisMove(Config.InOut_Axis, moveP.InOut_P4, Config.InOutAxis_P2_Speed);
ComMoveToPosition(moveP.ComPress_P3); ComMoveToPosition(moveP.ComPress_P3);
OpenDoorAndWait(); OpenDoorAndWait();
}else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_32_InoutToDoor)) }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_32_InoutToDoor))
{ {
InStoreLog("入库:SIS_33 等待操作人员放入料盘 "); InStoreLog("入库:SIS_33 等待操作人员放入料盘 ");
StoreMove.NextMoveStep(StoreMoveStep.SIS_33_WaitTray); StoreMove.NextMoveStep(StoreMoveStep.SIS_33_WaitTray);
...@@ -651,27 +652,54 @@ namespace OnlineStore.DeviceLibrary ...@@ -651,27 +652,54 @@ namespace OnlineStore.DeviceLibrary
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_37_InoutToP2)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_37_InoutToP2))
{ {
InStoreLog("入库:SIS_38 扫码,最多等待6000 "); InStoreLog("入库:SIS_38 ,清理扫码信息,开始扫码,最多等待6000 ");
AutomaticBaiting.ClearInStoreInfo();
StoreMove.NextMoveStep(StoreMoveStep.SIS_38_ScanCode); StoreMove.NextMoveStep(StoreMoveStep.SIS_38_ScanCode);
StoreMove.OneWaitCanEndStep = true; StoreMove.OneWaitCanEndStep = true;
StoreMove.WaitList.Add(WaitResultInfo.WaitCodeOK()); StoreMove.WaitList.Add(WaitResultInfo.WaitCodeOK());
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(6000)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(6000));
GetCameraCode(); AutomaticBaiting.GetCameraCode();
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_38_ScanCode)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_38_ScanCode))
{ {
if (AutomaticBaiting.LastCode.Equals(""))
{
SingleSendOut("未扫到二维码");
}
else
{
InStoreLog("入库:SIS_39 获取入库库位号 "); InStoreLog("入库:SIS_39 获取入库库位号 ");
StoreMove.NextMoveStep(StoreMoveStep.SIS_39_GetPosId); StoreMove.NextMoveStep(StoreMoveStep.SIS_39_GetPosId);
SingleInStorePosId = GetAutoPosid(); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(10000));//最多等待十秒
InOutStoreParam param = AutomaticBaiting.GetInStoreParam("单盘入库", AutomaticBaiting.ProcessMsg());
if (param == null)
{
SingleSendOut("从服务器获取入库信息失败");
}
else if (!LoadParamPosition(param))
{
SingleSendOut("加载入库" + param.PositionNum + "参数失败");
}
else
{
//更改当前入库参数
storeRunStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
StoreMove.NewMove(StoreMoveType.InStore, param);
lastMoveType = StoreMoveType.InStore;
StoreMove.IsBatchInOutStore = true;
StoreMove.IsNeedInStore = true;
StoreMove.NextMoveStep(StoreMoveStep.SI_01_LocationCylinderDown);
}
}
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_39_GetPosId)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_39_GetPosId))
{ {
InStoreLog("入库:SIS_40 启动新的入库 "); SingleSendOut("启动入库超时 ");
StoreMove.NextMoveStep(StoreMoveStep.SIS_40_StartInStore);
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_40_StartInStore)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_40_StartInStore))
{ {
InStoreLog("入库:SIS_32 开始送出料盘 ,叉子后退 "); InStoreLog("入库:SIS_41 开始送出料盘 ,叉子后退 ");
StoreMove.NextMoveStep(StoreMoveStep.SIS_41_StartSendTrayOut); StoreMove.NextMoveStep(StoreMoveStep.SIS_41_StartSendTrayOut);
ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Position); ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Position);
} }
...@@ -684,20 +712,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -684,20 +712,16 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private void GetCameraCode() private void SingleSendOut(string msg)
{ {
IOManager.IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH); StoreMove.IsBatchInOutStore = true;
Thread.Sleep(1000); StoreMove.IsNeedInStore = false ;
InStoreLog( msg+",将料盘送出,叉子后退");
IOManager.IOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW); StoreMove.NextMoveStep(StoreMoveStep.SIS_41_StartSendTrayOut);
ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P1, Config.InOutAxis_P1_Position);
} }
private string GetAutoPosid()
{
return ConfigAppSettings.GetValue(Setting_Init.SinglePosId);
}
string SingleInStorePosId = "";
#endregion #endregion
...@@ -718,7 +742,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -718,7 +742,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (storeRunStatus == StoreRunStatus.Runing) if (storeRunStatus == StoreRunStatus.Runing)
{ {
if (!LoadParamPosition(param, IsBatchWork)) if (!LoadParamPosition(param))
{ {
UpdateInOutMsg(logMsg + "失败,找不到库位信息"); UpdateInOutMsg(logMsg + "失败,找不到库位信息");
return false; return false;
......
...@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary
private static int LastHeight = 0; private static int LastHeight = 0;
private static int LastWidth = 0; private static int LastWidth = 0;
private static List<string> LastCodeList = new List<string>(); private static List<string> LastCodeList = new List<string>();
private static string LastCode = ""; public static string LastCode = "";
private static string LastPosId = ""; private static string LastPosId = "";
public static int AxisChangeValue = ConfigAppSettings.GetIntValue(Setting_Init.AxisChangeValue); public static int AxisChangeValue = ConfigAppSettings.GetIntValue(Setting_Init.AxisChangeValue);
public static string WarnMsg = ""; public static string WarnMsg = "";
...@@ -101,7 +101,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -101,7 +101,7 @@ namespace OnlineStore.DeviceLibrary
BatchInStoreCount = 0; BatchInStoreCount = 0;
BatchInStoreHeight = 0; BatchInStoreHeight = 0;
} }
private static void ClearInStoreInfo() public static void ClearInStoreInfo()
{ {
LastCode = ""; LastCode = "";
LastCodeList = new List<string>(); LastCodeList = new List<string>();
......
...@@ -377,7 +377,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -377,7 +377,7 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(highType, IO_VALUE.HIGH); IOManager.IOMove(highType, IO_VALUE.HIGH);
} }
private static string ProcessMsg() public static string ProcessMsg()
{ {
string msg = ""; string msg = "";
//string[] codeArray = LastCode.Split(new string[] { spiltStr}); //string[] codeArray = LastCode.Split(new string[] { spiltStr});
...@@ -432,48 +432,79 @@ namespace OnlineStore.DeviceLibrary ...@@ -432,48 +432,79 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
InOutStoreParam param = GetInStoreParam(Name, message);
if (param == null)
{
return;
}
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if (StoreManager.Store.CanStarInOut())
{
bool result = StoreManager.Store.StartInStoreMove(param, true);
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(Name + " 收到服务器入库命令:库位号【" + param.PositionNum + "】二维码【" + message + "】 开始入库!");
}
else
{
LogUtil.info(Name + " 收到服务器入库命令:库位号【" + param.PositionNum + "】二维码【" + message + "】 正在忙碌中,无法入库!");
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + ex.StackTrace);
}
}
public static InOutStoreParam GetInStoreParam(string LogName, string message)
{
message = ScanCodeManager.ReplaceCode(message); message = ScanCodeManager.ReplaceCode(message);
if (message.Equals("") || string.IsNullOrEmpty(message)) if (message.Equals("") || string.IsNullOrEmpty(message))
{ {
CodeMsg = "没有收到二维码信息,请重新放入料盘"; CodeMsg = "没有收到二维码信息,请重新放入料盘";
LogUtil.info(Name + "没有收到二维码信息,请重新放入料盘"); LogUtil.info(LogName + "没有收到二维码信息,请重新放入料盘");
return; return null;
} }
if (StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Wait)) if (StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Wait))
{ {
LogUtil.info(Name + "【 " + message + "】,设备未启动,不需要发送服务器"); LogUtil.info(LogName + "【 " + message + "】,设备未启动,不需要发送服务器");
return; return null;
} }
LogUtil.info(LogName + "【 " + message + "】,发送给服务器获取入库PosID");
//开启服务器日志
//HttpHelper.isLog = 1;
LogUtil.info(Name + "【 " + message + "】,发送给服务器获取入库PosID");
//发送扫码内容到服务器进行入库操作
Operation operation = StoreManager.Store.getLineBoxStatus(); Operation operation = StoreManager.Store.getLineBoxStatus();
operation.op = 1; operation.op = 1;
operation.data.Add("code", message); operation.data.Add("code", message);
operation.data.Add("boxId", StoreManager.Store.StoreID.ToString()); operation.data.Add("boxId", StoreManager.Store.StoreID.ToString());
if (LastHeight.Equals(0) && LastWidth.Equals(0))
{
//singleIn 单盘入库
operation.data.Add("singleIn", "true");
}
else
{
operation.data.Add("singleIn", "false");
}
string autoposId = StoreManager.Store.GetAutoPosid(true); string autoposId = StoreManager.Store.GetAutoPosid(true);
if (StoreManager.Store.autoNext && (!String.IsNullOrEmpty(autoposId))) if (StoreManager.Store.autoNext && (!String.IsNullOrEmpty(autoposId)))
{ {
operation.data.Add(ParamDefine.inPos, autoposId); operation.data.Add(ParamDefine.inPos, autoposId);
LogUtil.debug("添加自动入库库位号:"+autoposId); LogUtil.debug("添加自动入库库位号:" + autoposId);
} }
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);
if (resultOperation == null) if (resultOperation == null)
{ {
LogUtil.info(Name + "二维码【" + message + "】没有收到服务器反馈!"); LogUtil.info(LogName + "二维码【" + message + "】没有收到服务器反馈!");
return; return null;
} }
else if (!string.IsNullOrEmpty(resultOperation.msg)) else if (!string.IsNullOrEmpty(resultOperation.msg))
{ {
LogUtil.info(Name + "服务器反馈 二维码【" + message + "】【"+ autoposId + "】 :" + resultOperation.msg); LogUtil.info(LogName + "服务器反馈 二维码【" + message + "】【" + autoposId + "】 :" + resultOperation.msg);
return; return null;
} }
Dictionary<string, string> data = resultOperation.data; Dictionary<string, string> data = resultOperation.data;
...@@ -494,7 +525,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -494,7 +525,7 @@ namespace OnlineStore.DeviceLibrary
{ {
WarnMsg = Name + ResourceControl.GetString(ResourceControl.InStoreError, "入库库位格式错误:") + "【" + message + "】【" + posId + "】"; WarnMsg = Name + ResourceControl.GetString(ResourceControl.InStoreError, "入库库位格式错误:") + "【" + message + "】【" + posId + "】";
LogUtil.error("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】"); LogUtil.error("服务器反馈 入库库位格式错误:二维码【" + message + "】库位【" + posId + "】");
return; return null;
} }
int storeId = int.Parse(posArray[0]); int storeId = int.Parse(posArray[0]);
...@@ -504,37 +535,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -504,37 +535,21 @@ namespace OnlineStore.DeviceLibrary
{ //出入库没有找到服务器发送的库位,需要打印日志方便查询原因 { //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = ResourceControl.GetString(ResourceControl.InStoreNoPosition, "入库未找到库位:") + "【" + message + "】【" + posId + "】 "; WarnMsg = ResourceControl.GetString(ResourceControl.InStoreNoPosition, "入库未找到库位:") + "【" + message + "】【" + posId + "】 ";
LogUtil.error("服务器反馈 入库未找到库位:二维码【" + message + "】库位【" + posId + "】"); LogUtil.error("服务器反馈 入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
return; return null;
} }
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if (StoreManager.Store.CanStarInOut())
{
LastPosId = posId; LastPosId = posId;
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW); InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW);
bool result = StoreManager.Store.StartInStoreMove(param, true); return param;
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(Name + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 开始入库!");
}
else
{
LogUtil.info(Name + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
}
}
catch (Exception ex)
{
LogUtil.error(Name + "解析服务发送的入库【" + posId + "】出错" + ex.StackTrace);
}
}
}
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + ex.StackTrace); LogUtil.error(LogName + "解析服务发送的入库【" + posId + "】出错" + ex.StackTrace);
} }
}return null;
} }
public static Dictionary<string, string> GetBtnStatus() public static Dictionary<string, string> GetBtnStatus()
{ {
Dictionary<string, string> map = new Dictionary<string, string>(); Dictionary<string, string> map = new Dictionary<string, string>();
...@@ -543,6 +558,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -543,6 +558,7 @@ namespace OnlineStore.DeviceLibrary
map.Add(ParamDefine.closeLock, ParamDefine.disable); map.Add(ParamDefine.closeLock, ParamDefine.disable);
map.Add(ParamDefine.takeOutReel, ParamDefine.disable); map.Add(ParamDefine.takeOutReel, ParamDefine.disable);
map.Add(ParamDefine.confirmReelOut, ParamDefine.disable); map.Add(ParamDefine.confirmReelOut, ParamDefine.disable);
map.Add(ParamDefine.singleReelIn, ParamDefine.disable);
if ( DoorStatus.Equals(2)) if ( DoorStatus.Equals(2))
{ {
map.Add(ParamDefine.doorStatus, ResourceControl.GetString(ResourceControl.doorClose, "Door lock close")); map.Add(ParamDefine.doorStatus, ResourceControl.GetString(ResourceControl.doorClose, "Door lock close"));
...@@ -568,6 +584,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -568,6 +584,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
map[ParamDefine.openLock] = ParamDefine.enable; map[ParamDefine.openLock] = ParamDefine.enable;
map[ParamDefine.singleReelIn] = ParamDefine.enable;
} }
} }
else else
...@@ -640,8 +657,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -640,8 +657,6 @@ namespace OnlineStore.DeviceLibrary
return ""; return "";
} }
public static bool doConfirmReelGo() public static bool doConfirmReelGo()
{ {
LogUtil.info(ResourceControl.GetString(ResourceControl.TakeTrayOut, "Take out reel manually")); LogUtil.info(ResourceControl.GetString(ResourceControl.TakeTrayOut, "Take out reel manually"));
...@@ -649,5 +664,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -649,5 +664,23 @@ namespace OnlineStore.DeviceLibrary
IsGetTrayGo = true; IsGetTrayGo = true;
return true; return true;
} }
public static string doSingleReelIn()
{
string defaultPosId = ConfigAppSettings.GetValue(Setting_Init.SinglePosId).Trim();
if (StoreManager.Store.PositionNumList.Contains(defaultPosId))
{
bool result = StoreManager.Store.StartInStoreMove(new InOutStoreParam("", defaultPosId), false, true);
if (!result)
{
return ResourceControl.GetMsgStr("启动单盘入库失败:") + StoreManager.Store.CodeOrInoutMsg;
}
}
else
{
return (ResourceControl.GetMsgStr("请先正确配置:") + Setting_Init.SinglePosId);
}
return "";
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!