Commit 55ea3d49 张东亮

出入库根据料盘厚度压紧

1 个父辈 e3e21394
...@@ -94,16 +94,36 @@ namespace OnlineStore.DeviceLibrary ...@@ -94,16 +94,36 @@ namespace OnlineStore.DeviceLibrary
} }
private void BothComAxis_To_P3(bool isdebugSpeed = false) private void BothComAxis_To_P3(bool isdebugSpeed = false)
{ {
LineMoveP movep = new LineMoveP(Config, MoveInfo.MoveParam.PosInfoBack.PosId); int diff = 0;
BoxPosition position = CSVPositionReader<BoxPosition>.GetPositon(MoveInfo.MoveParam.PosInfo.PosId);
if (position != null)
{
diff = position.BagHigh - MoveInfo.MoveParam.PosInfo.PlateH;
if (diff < 0) diff = 0;
LogInfo($"{MoveInfo.MoveParam.PosInfo.PosId}库位高度:{position.BagHigh},料盘高度:{MoveInfo.MoveParam.PosInfo.PlateH},差值:{diff},系数:{comAxis_offset}," +
$"实际值:{MoveInfo.MoveParam.MoveP.ComAxis_AB_P3 + diff * comAxis_offset}={MoveInfo.MoveParam.MoveP.ComAxis_AB_P3}加{diff * comAxis_offset}");
}
int target = MoveInfo.MoveParam.MoveP.ComAxis_AB_P3 + diff * comAxis_offset;
if (isdebugSpeed) if (isdebugSpeed)
ComAxis_A.AbsMove(MoveInfo, MoveInfo.MoveParam.MoveP.ComAxis_AB_P3, Config.ComAxis_FindPosSpeed); ComAxis_A.AbsMove(MoveInfo, target, Config.ComAxis_FindPosSpeed);
else else
ComAxis_A.AbsMove(MoveInfo, MoveInfo.MoveParam.MoveP.ComAxis_AB_P3, Config.ComAxis_A_P3_Speed); ComAxis_A.AbsMove(MoveInfo, target, Config.ComAxis_A_P3_Speed);
diff = 0;
LineMoveP movep = new LineMoveP(Config, MoveInfo.MoveParam.PosInfoBack.PosId);
BoxPosition position1 = CSVPositionReader<BoxPosition>.GetPositon(MoveInfo.MoveParam.PosInfoBack.PosId);
if (position1 != null)
{
diff = position1.BagHigh - MoveInfo.MoveParam.PosInfoBack.PlateH;
if (diff < 0) diff = 0;
LogInfo($"{MoveInfo.MoveParam.PosInfoBack.PosId}库位高度:{position1.BagHigh},料盘高度:{MoveInfo.MoveParam.PosInfoBack.PlateH},差值:{diff}," +
$"实际值:{movep.ComAxis_AB_P3 + diff * comAxis_offset}={movep.ComAxis_AB_P3}加{diff * comAxis_offset}");
}
target = movep.ComAxis_AB_P3 + diff * comAxis_offset;
if (isdebugSpeed) if (isdebugSpeed)
ComAxis_B.AbsMove(MoveInfo, movep.ComAxis_AB_P3, Config.ComAxis_FindPosSpeed); ComAxis_B.AbsMove(MoveInfo, target, Config.ComAxis_FindPosSpeed);
else else
ComAxis_B.AbsMove(MoveInfo, movep.ComAxis_AB_P3, Config.ComAxis_B_P3_Speed); ComAxis_B.AbsMove(MoveInfo, target, Config.ComAxis_B_P3_Speed);
} }
private void BothXAxis_To_P3(bool isdebugSpeed = false) private void BothXAxis_To_P3(bool isdebugSpeed = false)
{ {
......
...@@ -6,6 +6,7 @@ using System.Collections.Generic; ...@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -63,7 +64,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -63,7 +64,7 @@ namespace OnlineStore.DeviceLibrary
/// <returns></returns> /// <returns></returns>
private bool CheckASide() private bool CheckASide()
{ {
if (MoveInfo.MoveParam.PosInfo.GetPosSide().Equals("A")) if (MoveInfo.MoveParam.PosInfoBack.GetPosSide().Equals("A"))
return true; return true;
return false; return false;
} }
...@@ -74,7 +75,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -74,7 +75,7 @@ namespace OnlineStore.DeviceLibrary
/// <returns></returns> /// <returns></returns>
private bool CheckASide(InOutParam param) private bool CheckASide(InOutParam param)
{ {
if (param.PosInfo.GetPosSide().Equals("A")) if (param.PosInfoBack.GetPosSide().Equals("A"))
return true; return true;
return false; return false;
} }
...@@ -468,24 +469,35 @@ namespace OnlineStore.DeviceLibrary ...@@ -468,24 +469,35 @@ namespace OnlineStore.DeviceLibrary
ComAxis_B.AbsMove(MoveInfo, MoveInfo.MoveParam.MoveP.ComAxis_AB_P2, Config.ComAxis_B_P2_Speed); ComAxis_B.AbsMove(MoveInfo, MoveInfo.MoveParam.MoveP.ComAxis_AB_P2, Config.ComAxis_B_P2_Speed);
} }
} }
int comAxis_offset = ConfigAppSettings.GetIntValue("Coeff_ComAxis");
/// <summary> /// <summary>
/// AB移栽压紧轴到压紧点P3 /// AB移栽压紧轴到压紧点P3
/// </summary> /// </summary>
private void ComAxis_To_P3(bool isdebugSpeed = false) private void ComAxis_To_P3(bool isdebugSpeed = false)
{ {
int diff = 0;
BoxPosition position = CSVPositionReader<BoxPosition>.GetPositon(MoveInfo.MoveParam.PosInfo.PosId);
if (position != null)
{
diff = position.BagHigh - MoveInfo.MoveParam.PosInfoBack.PlateH;
if (diff < 0) diff = 0;
LogInfo($"{MoveInfo.MoveParam.PosInfo.PosId}库位高度:{position.BagHigh},料盘高度:{MoveInfo.MoveParam.PosInfo.PlateH},差值:{diff},系数:{comAxis_offset}," +
$"实际值:{MoveInfo.MoveParam.MoveP.ComAxis_AB_P3 + diff * comAxis_offset}={MoveInfo.MoveParam.MoveP.ComAxis_AB_P3}加{diff * comAxis_offset}");
}
int target = MoveInfo.MoveParam.MoveP.ComAxis_AB_P3 + diff * comAxis_offset;
if (CheckASide()) if (CheckASide())
{ {
if (isdebugSpeed) if (isdebugSpeed)
ComAxis_A.AbsMove(MoveInfo, MoveInfo.MoveParam.MoveP.ComAxis_AB_P3, Config.ComAxis_FindPosSpeed); ComAxis_A.AbsMove(MoveInfo, target, Config.ComAxis_FindPosSpeed);
else else
ComAxis_A.AbsMove(MoveInfo, MoveInfo.MoveParam.MoveP.ComAxis_AB_P3, Config.ComAxis_A_P3_Speed); ComAxis_A.AbsMove(MoveInfo, target, Config.ComAxis_A_P3_Speed);
} }
else else
{ {
if (isdebugSpeed) if (isdebugSpeed)
ComAxis_B.AbsMove(MoveInfo, MoveInfo.MoveParam.MoveP.ComAxis_AB_P3, Config.ComAxis_FindPosSpeed); ComAxis_B.AbsMove(MoveInfo, target, Config.ComAxis_FindPosSpeed);
else else
ComAxis_B.AbsMove(MoveInfo, MoveInfo.MoveParam.MoveP.ComAxis_AB_P3, Config.ComAxis_B_P3_Speed); ComAxis_B.AbsMove(MoveInfo, target, Config.ComAxis_B_P3_Speed);
} }
} }
#endregion #endregion
...@@ -736,7 +748,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -736,7 +748,7 @@ namespace OnlineStore.DeviceLibrary
row = GetRowByPosition(side); row = GetRowByPosition(side);
PosId = $"{CID}{side}{row.ToString().PadLeft(2, '0')}{col.ToString().PadLeft(2, '0')}0101"; PosId = $"{CID}{side}{row.ToString().PadLeft(2, '0')}{col.ToString().PadLeft(2, '0')}0101";
MoveInfo.MoveParam = new InOutParam(new InOutPosInfo("Reset", PosId)); MoveInfo.MoveParam = new InOutParam(new InOutPosInfo("Reset", PosId));
MoveInfo.MoveParam.MoveP = new LineMoveP(Config, MoveInfo.MoveParam.PosInfo.PosId); MoveInfo.MoveParam.MoveP = new LineMoveP(Config, MoveInfo.MoveParam.PosInfoBack.PosId);
if (hookA && atAside) if (hookA && atAside)
{ {
return true; return true;
...@@ -963,13 +975,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -963,13 +975,13 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
startInStoreTime = DateTime.Now; startInStoreTime = DateTime.Now;
LogInfo(" 启动入库【" + param.PosInfo.ToStr() + "】 "); LogInfo(" 启动入库【" + param.PosInfoBack.ToStr() + "】 ");
param.MoveP = new LineMoveP(Config, param.PosInfo.PosId); param.MoveP = new LineMoveP(Config, param.PosInfoBack.PosId);
// LogInfo("LoadInoutParam:" + JsonHelper.SerializeObject(param.MoveP)); // LogInfo("LoadInoutParam:" + JsonHelper.SerializeObject(param.MoveP));
MoveInfo.NewMove(MoveType.InStore, param); MoveInfo.NewMove(MoveType.InStore, param);
///开始记录 ///开始记录
StartRecord(); StartRecord();
SetBoxStatus(DeviceStatus.InStoreExecute, RunStatus.Busy, param.PosInfo.PosId, param.PosInfo.barcode); SetBoxStatus(DeviceStatus.InStoreExecute, RunStatus.Busy, param.PosInfoBack.PosId, param.PosInfoBack.barcode);
if (param.PosInfoBack != null) if (param.PosInfoBack != null)
MoveInfo.NextMoveStep(StepEnum.SIB_00_StartInstore); MoveInfo.NextMoveStep(StepEnum.SIB_00_StartInstore);
else else
...@@ -980,18 +992,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -980,18 +992,18 @@ namespace OnlineStore.DeviceLibrary
private bool InDoorCheck(InOutParam param) private bool InDoorCheck(InOutParam param)
{ {
if (param.PosInfo == null) if (param.PosInfoBack == null)
return false; return false;
if (CheckASide(param)) if (CheckASide(param))
{ {
if (IOValue(IO_Type.FeedingA_Instore_UpperArea_ReelCheck).Equals(IO_VALUE.HIGH) && param.PosInfo != null) if (IOValue(IO_Type.FeedingA_Instore_UpperArea_ReelCheck).Equals(IO_VALUE.HIGH) && param.PosInfoBack != null)
{ {
return true; return true;
} }
} }
else else
{ {
if (IOValue(IO_Type.FeedingB_Instore_UpperArea_ReelCheck).Equals(IO_VALUE.HIGH) && param.PosInfo != null) if (IOValue(IO_Type.FeedingB_Instore_UpperArea_ReelCheck).Equals(IO_VALUE.HIGH) && param.PosInfoBack != null)
{ {
return true; return true;
} }
...@@ -1084,16 +1096,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -1084,16 +1096,16 @@ namespace OnlineStore.DeviceLibrary
/// <returns></returns> /// <returns></returns>
private bool OutDoorCheck(InOutParam param) private bool OutDoorCheck(InOutParam param)
{ {
if (param.PosInfo == null) if (param.PosInfoBack == null)
return false; return false;
if (param.PosInfo.GetPosSide().Equals("A"))//A面 if (param.PosInfoBack.GetPosSide().Equals("A"))//A面
{ {
if (CheckAOutDoor()) if (CheckAOutDoor())
{ {
return true; return true;
} }
} }
else if (param.PosInfo.GetPosSide().Equals("B"))//B面 else if (param.PosInfoBack.GetPosSide().Equals("B"))//B面
{ {
if (CheckBOutDoor()) if (CheckBOutDoor())
{ {
...@@ -1105,7 +1117,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1105,7 +1117,7 @@ namespace OnlineStore.DeviceLibrary
} }
private bool BothOutDoorCheck(InOutParam param) private bool BothOutDoorCheck(InOutParam param)
{ {
if (param.PosInfo == null || param.PosInfoBack == null) if (param.PosInfoBack == null || param.PosInfoBack == null)
return false; return false;
if (CheckAOutDoor() && CheckBOutDoor()) if (CheckAOutDoor() && CheckBOutDoor())
...@@ -1149,24 +1161,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -1149,24 +1161,24 @@ namespace OnlineStore.DeviceLibrary
{ {
lock (outStoreObject) lock (outStoreObject)
{ {
if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.MoveParam.PosInfo.PosId.Equals(param.PosInfo.PosId)) if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.MoveParam.PosInfoBack.PosId.Equals(param.PosInfoBack.PosId))
{ {
LogUtil.error(Name + " 出库命令【" + param.PosInfo.ToStr() + "】重复,【" + MoveInfo.MoveParam.PosInfo.PosId + "】出库执行中"); LogUtil.error(Name + " 出库命令【" + param.PosInfoBack.ToStr() + "】重复,【" + MoveInfo.MoveParam.PosInfoBack.PosId + "】出库执行中");
return; return;
} }
List<InOutParam> reviceList = new List<InOutParam>(); List<InOutParam> reviceList = new List<InOutParam>();
reviceList.AddRange(waitAOutStoreList); reviceList.AddRange(waitAOutStoreList);
reviceList.AddRange(waitBOutStoreList); reviceList.AddRange(waitBOutStoreList);
reviceList = (from m in reviceList where m.PosInfo.PosId.Equals(param.PosInfo.PosId) select m).ToList<InOutParam>(); reviceList = (from m in reviceList where m.PosInfoBack.PosId.Equals(param.PosInfoBack.PosId) select m).ToList<InOutParam>();
if (reviceList.Count == 0) if (reviceList.Count == 0)
{ {
LogInfo(" 执行出库【" + param.PosInfo.ToStr() + "】失败,加入等待队列"); LogInfo(" 执行出库【" + param.PosInfoBack.ToStr() + "】失败,加入等待队列");
if (param.PosInfo.GetPosSide().Equals("A")) if (param.PosInfoBack.GetPosSide().Equals("A"))
{ {
waitAOutStoreList.Enqueue(param); waitAOutStoreList.Enqueue(param);
} }
else if (param.PosInfo.GetPosSide().Equals("B")) else if (param.PosInfoBack.GetPosSide().Equals("B"))
{ {
waitBOutStoreList.Enqueue(param); waitBOutStoreList.Enqueue(param);
} }
...@@ -1200,16 +1212,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -1200,16 +1212,16 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
if (!param.PosInfo.CheckPosition()) if (!param.PosInfoBack.CheckPosition())
{ {
SetWarnMsg(Name + " 启动出库【" + param.PosInfo.ToStr() + "】出错,找不到库位信息"); SetWarnMsg(Name + " 启动出库【" + param.PosInfoBack.ToStr() + "】出错,找不到库位信息");
return false; return false;
} }
startOutStoreTime = DateTime.Now; startOutStoreTime = DateTime.Now;
param.MoveP = new LineMoveP(Config, param.PosInfo.PosId); param.MoveP = new LineMoveP(Config, param.PosInfoBack.PosId);
SetBoxStatus(DeviceStatus.OutStoreExecute, RunStatus.Busy, param.PosInfo.PosId, param.PosInfo.barcode); SetBoxStatus(DeviceStatus.OutStoreExecute, RunStatus.Busy, param.PosInfoBack.PosId, param.PosInfoBack.barcode);
MoveInfo.NewMove(MoveType.OutStore, param); MoveInfo.NewMove(MoveType.OutStore, param);
LogInfo("启动出库【" + param.PosInfo.ToStr() + "】 "); LogInfo("启动出库【" + param.PosInfoBack.ToStr() + "】 ");
///开始记录 ///开始记录
StartRecord(); StartRecord();
//LogInfo("LoadInoutParam:" + JsonHelper.SerializeObject(param.MoveP)); //LogInfo("LoadInoutParam:" + JsonHelper.SerializeObject(param.MoveP));
......
...@@ -73,6 +73,8 @@ ...@@ -73,6 +73,8 @@
<add key="UseBuzzer" value="0"/> <add key="UseBuzzer" value="0"/>
<!--料盘厚度对应的偏移量--> <!--料盘厚度对应的偏移量-->
<add key="ReelHeightOffset" value="12=0#16=100#24=200#32=300"/> <add key="ReelHeightOffset" value="12=0#16=100#24=200#32=300"/>
<!--压紧轴毫米到脉冲的转换系数-->
<add key="Coeff_ComAxis" value="1000"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
this.lblVersion.TabIndex = 276; this.lblVersion.TabIndex = 276;
this.lblVersion.Text = "版本号:1.1.0000.0000"; this.lblVersion.Text = "版本号:1.1.0000.0000";
this.lblVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblVersion.Click += new System.EventHandler(this.lblVersion_Click);
// //
// lblTime // lblTime
// //
...@@ -94,7 +95,7 @@ ...@@ -94,7 +95,7 @@
// //
// FrmAbout // FrmAbout
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(543, 248); this.ClientSize = new System.Drawing.Size(543, 248);
this.Controls.Add(this.btnCopy); this.Controls.Add(this.btnCopy);
......
...@@ -37,5 +37,10 @@ namespace OnlineStore.XLRStore ...@@ -37,5 +37,10 @@ namespace OnlineStore.XLRStore
{ {
Clipboard.SetDataObject(GetCodeNum(), true); Clipboard.SetDataObject(GetCodeNum(), true);
} }
private void lblVersion_Click(object sender, EventArgs e)
{
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!