Commit 97edbb72 几米阳光

压紧轴,升降轴P1都根据高度改变。最后一个料盘高度需要增加补充。

1 个父辈 8c107f8f
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
<add key="AxisChangeValue" value="5000" /> <add key="AxisChangeValue" value="5000" />
<!--压紧轴计量检测信号亮1次的脉冲值--> <!--压紧轴计量检测信号亮1次的脉冲值-->
<add key="ComAxisChangeValue" value="10000" /> <add key="ComAxisChangeValue" value="10000" />
<add key ="DebugPosId" value ="1#AC1_2_1_1"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -172,6 +172,8 @@ namespace OnlineStore.AutoInOutStore ...@@ -172,6 +172,8 @@ namespace OnlineStore.AutoInOutStore
private DateTime preReadModblsTime = DateTime.Now; private DateTime preReadModblsTime = DateTime.Now;
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
try
{
if (this.Visible.Equals(false)) if (this.Visible.Equals(false))
{ {
return; return;
...@@ -215,7 +217,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -215,7 +217,7 @@ namespace OnlineStore.AutoInOutStore
{ {
StoreOpenStatus(true); StoreOpenStatus(true);
} }
lblThisSta.Text = store.GetRunStr(store.storeRunStatus,true); lblThisSta.Text = store.GetRunStr(store.storeRunStatus, true);
//复位按钮状态显示 //复位按钮状态显示
if (复位ToolStripMenuItem.Enabled == false) if (复位ToolStripMenuItem.Enabled == false)
{ {
...@@ -286,6 +288,10 @@ namespace OnlineStore.AutoInOutStore ...@@ -286,6 +288,10 @@ namespace OnlineStore.AutoInOutStore
btnStartAuTo.Text = "开始自动出入库"; btnStartAuTo.Text = "开始自动出入库";
lblDoorStatus.Text = "仓门状态未知"; lblDoorStatus.Text = "仓门状态未知";
} }
}catch(Exception ex)
{
LogUtil.error("主界面定时器出错:"+ex.StackTrace);
}
} }
private void BatchInoutStatus() private void BatchInoutStatus()
...@@ -316,7 +322,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -316,7 +322,7 @@ namespace OnlineStore.AutoInOutStore
} }
lblOutInfo.Visible = !lblWaitTragGo.Visible; lblOutInfo.Visible = !lblWaitTragGo.Visible;
lblOutInfo.Text ="批量出入库信息: 入库:"+AutomaticBaiting.BatchInStoreCount+"盘共"+AutomaticBaiting.BatchInStoreHeight+"mm,"+ lblOutInfo.Text = "批量出入库信息: 入库:" + AutomaticBaiting.BatchInStoreCount + "盘共" + AutomaticBaiting.BatchInStoreHeight + "mm," +
"出库: " + AutomaticBaiting.BatchOutStoreCount + "盘共" + AutomaticBaiting.BatchOutStoreHeight + "mm"; "出库: " + AutomaticBaiting.BatchOutStoreCount + "盘共" + AutomaticBaiting.BatchOutStoreHeight + "mm";
if (HumitureController.IsRun) if (HumitureController.IsRun)
{ {
...@@ -326,9 +332,9 @@ namespace OnlineStore.AutoInOutStore ...@@ -326,9 +332,9 @@ namespace OnlineStore.AutoInOutStore
} }
else else
{ {
btnSelTemp.Enabled = false ; btnSelTemp.Enabled = false;
btnTempClose.Enabled = false ; btnTempClose.Enabled = false;
btnTempInit.Enabled = true ; btnTempInit.Enabled = true;
} }
} }
...@@ -475,7 +481,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -475,7 +481,7 @@ namespace OnlineStore.AutoInOutStore
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
store.StartOutStoreMove(new InOutStoreParam("", selectPositionNum, ktk),false); store.StartOutStoreMove(new InOutStoreParam("", selectPositionNum, ktk), false);
} }
else else
{ {
...@@ -485,13 +491,13 @@ namespace OnlineStore.AutoInOutStore ...@@ -485,13 +491,13 @@ namespace OnlineStore.AutoInOutStore
private void btnInStore_Click(object sender, EventArgs e) private void btnInStore_Click(object sender, EventArgs e)
{ {
MessageBox.Show("此设备不支持单个入库","提示",MessageBoxButtons.OK,MessageBoxIcon.Error); MessageBox.Show("此设备不支持单个入库", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
if (store.storeRunStatus >= StoreRunStatus.HomeMoving) if (store.storeRunStatus >= StoreRunStatus.HomeMoving)
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
store.StartInStoreMove(new InOutStoreParam("", selectPositionNum, ktk),false); store.StartInStoreMove(new InOutStoreParam("", selectPositionNum, ktk), false);
} }
else else
{ {
...@@ -732,6 +738,11 @@ namespace OnlineStore.AutoInOutStore ...@@ -732,6 +738,11 @@ namespace OnlineStore.AutoInOutStore
store.Config.UpdateUpDownP1(ktkPosition.BagHeight, FormUtil.GetIntValue(txtUpDownP1)); store.Config.UpdateUpDownP1(ktkPosition.BagHeight, FormUtil.GetIntValue(txtUpDownP1));
needUpdate = true; needUpdate = true;
} }
if (store.Config.GetComP2(ktkPosition.BagHeight) != FormUtil.GetIntValue(txtComP2))
{
store.Config.UpdateComP2(ktkPosition.BagHeight, FormUtil.GetIntValue(txtComP2));
needUpdate = true;
}
} }
if (store.Config.InOutAxis_P1_Position != FormUtil.GetIntValue(txtInOutP1)) if (store.Config.InOutAxis_P1_Position != FormUtil.GetIntValue(txtInOutP1))
{ {
...@@ -809,7 +820,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -809,7 +820,7 @@ namespace OnlineStore.AutoInOutStore
{ {
return true; return true;
} }
MessageBox.Show("叉子不在待机位,请先将叉子退回待机位("+InOutDefaultPosition+")!", "警告(叉子在待机位时,才能移动升降轴和旋转轴) ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); MessageBox.Show("叉子不在待机位,请先将叉子退回待机位(" + InOutDefaultPosition + ")!", "警告(叉子在待机位时,才能移动升降轴和旋转轴) ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false; return false;
} }
private void btnCloseAxis_Click(object sender, EventArgs e) private void btnCloseAxis_Click(object sender, EventArgs e)
...@@ -998,7 +1009,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -998,7 +1009,7 @@ namespace OnlineStore.AutoInOutStore
store.autoMsg = "自动出库:" + poText; store.autoMsg = "自动出库:" + poText;
LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!"); LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
//store.StartOutStoreMove(new InOutStoreParam("", poText)); //store.StartOutStoreMove(new InOutStoreParam("", poText));
store.StartInStoreMove(new InOutStoreParam("", poText),false); store.StartInStoreMove(new InOutStoreParam("", poText), false);
} }
btnStartAuTo.Text = "停止自动出入库"; btnStartAuTo.Text = "停止自动出入库";
} }
...@@ -1440,7 +1451,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -1440,7 +1451,7 @@ namespace OnlineStore.AutoInOutStore
{ {
int value = ShuoKeControls.GetABSPosition(store.Config.CompressAxis_Slv); int value = ShuoKeControls.GetABSPosition(store.Config.CompressAxis_Slv);
lblComMsg.Text=DateTime.Now.ToLongTimeString() + "实时位置:" + value; lblComMsg.Text = DateTime.Now.ToLongTimeString() + "实时位置:" + value;
} }
private void btnStop_Click(object sender, EventArgs e) private void btnStop_Click(object sender, EventArgs e)
{ {
...@@ -1489,7 +1500,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -1489,7 +1500,7 @@ namespace OnlineStore.AutoInOutStore
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
store.StartOutStoreMove(new InOutStoreParam("", selectPositionNum, ktk), true ); store.StartOutStoreMove(new InOutStoreParam("", selectPositionNum, ktk), true);
} }
else else
{ {
...@@ -1555,7 +1566,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -1555,7 +1566,7 @@ namespace OnlineStore.AutoInOutStore
private void btnWaitTrgGo_Click(object sender, EventArgs e) private void btnWaitTrgGo_Click(object sender, EventArgs e)
{ {
DialogResult result = MessageBox.Show("已经将料盘手动拿出?","确认提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question); DialogResult result = MessageBox.Show("已经将料盘手动拿出?", "确认提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result.Equals(DialogResult.Yes)) if (result.Equals(DialogResult.Yes))
{ {
LogUtil.info("已确认料盘已手动拿出"); LogUtil.info("已确认料盘已手动拿出");
...@@ -1577,7 +1588,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -1577,7 +1588,7 @@ namespace OnlineStore.AutoInOutStore
if (AutomaticBaiting.CanOpenBatchDoor()) if (AutomaticBaiting.CanOpenBatchDoor())
{ {
AutomaticBaiting.BatchDoorOpen(false); AutomaticBaiting.BatchDoorOpen(false);
AutomaticBaiting.IsNeedStartInout = false ; AutomaticBaiting.IsNeedStartInout = false;
} }
else else
{ {
...@@ -1610,7 +1621,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -1610,7 +1621,7 @@ namespace OnlineStore.AutoInOutStore
return; return;
} }
AutomaticBaiting.BatchDoorClose(false); AutomaticBaiting.BatchDoorClose(false);
AutomaticBaiting.Reset(false ); AutomaticBaiting.Reset(false);
} }
private void btnGetOutTray_Click(object sender, EventArgs e) private void btnGetOutTray_Click(object sender, EventArgs e)
...@@ -1642,7 +1653,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -1642,7 +1653,7 @@ namespace OnlineStore.AutoInOutStore
} }
AutomaticBaiting.BatchDoorClose(false); AutomaticBaiting.BatchDoorClose(false);
bool result = AutomaticBaiting.Reset(false ); bool result = AutomaticBaiting.Reset(false);
} }
private void btnTempInit_Click(object sender, EventArgs e) private void btnTempInit_Click(object sender, EventArgs e)
...@@ -1698,5 +1709,25 @@ namespace OnlineStore.AutoInOutStore ...@@ -1698,5 +1709,25 @@ namespace OnlineStore.AutoInOutStore
bool result = AutomaticBaiting.Reset(false); bool result = AutomaticBaiting.Reset(false);
} }
private void toolStripMenuItem2_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
}
private void toolStripMenuItem3_Click(object sender, EventArgs e)
{
KND.IOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
}
private void btnSave_Click(object sender, EventArgs e)
{
if (cmbPosition.SelectedIndex >= 0)
{
string selectPositionNum = cmbPosition.Text;
ConfigAppSettings.SaveValue(Setting_Init.DebugPosId, selectPositionNum);
}
}
} }
} }
...@@ -79,15 +79,22 @@ X22_气压检测: ...@@ -79,15 +79,22 @@ X22_气压检测:
压紧轴改为同步返回数据模式,压紧轴增加计量检测功能。 压紧轴改为同步返回数据模式,压紧轴增加计量检测功能。
20121226 20181226
出库状态下,如果复位未开门锁,不能清理出库信息 出库状态下,如果复位未开门锁,不能清理出库信息
出入库增加统计,增加气压检测功能。 出入库增加统计,增加气压检测功能。
出入库失败信息发个服务器 出入库失败信息发个服务器
20181227
压紧轴修改
最后一盘料需要补充高度
PRO,压紧轴(轴4)P2压紧点集合,CompressAxis_P2_List,52#-10000;48#-10000,,,,,,,,,
PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
·
入库老报警,入库的P1没有重新加载
......
...@@ -78,5 +78,7 @@ namespace OnlineStore.Common ...@@ -78,5 +78,7 @@ namespace OnlineStore.Common
public static string CodeRun = "CodeRun"; public static string CodeRun = "CodeRun";
public static string ComAxisChangeValue = "ComAxisChangeValue"; public static string ComAxisChangeValue = "ComAxisChangeValue";
public static string DebugPosId = "DebugPosId";
} }
} }
...@@ -202,5 +202,10 @@ namespace OnlineStore.Common ...@@ -202,5 +202,10 @@ namespace OnlineStore.Common
LogUtil.error(LOGGER, "SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + "," + ex.StackTrace); LogUtil.error(LOGGER, "SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + "," + ex.StackTrace);
} }
} }
public static string GetValue(object debugPosId)
{
throw new NotImplementedException();
}
} }
} }
...@@ -939,9 +939,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -939,9 +939,9 @@ namespace OnlineStore.DeviceLibrary
//没有启动时收到复位按钮,相当于启动按钮 //没有启动时收到复位按钮,相当于启动按钮
LogUtil.info(LOGGER, StoreName + "没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!"); LogUtil.info(LOGGER, StoreName + "没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!");
bool result = StartRun(); bool result = StartRun();
if (result.Equals(false)) if (!result)
{ {
LogUtil.error("料仓启动失败,继续等待下次启动!"); LogUtil.info("料仓启动失败,继续等待下次启动!");
int isAuto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun); int isAuto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
if (isAuto == 1) if (isAuto == 1)
{ {
...@@ -1588,7 +1588,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1588,7 +1588,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (CanStarInOut()) if (CanStarInOut())
{ {
StartOutStoreMove(new InOutStoreParam("", posId, position), !isSingleOut); StartOutStoreMove(new InOutStoreParam("", posId), !isSingleOut);
} }
else else
{ {
......
...@@ -38,16 +38,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -38,16 +38,12 @@ namespace OnlineStore.DeviceLibrary
{ {
return false; return false;
} }
int height = 24;
if (Config.Default_TrayWidth.Equals(7))
{
height = 8;
}
//加载位置 //加载位置
if (param.MoveP == null) if (param.MoveP == null)
{ {
LineMoveP p = new LineMoveP(); LineMoveP p = new LineMoveP();
AutoStorePosition position = param.GetACPosition(); AutoStorePosition position = param.GetPosition();
if (position == null) if (position == null)
{ {
LogUtil.error(LOGGER, StoreName + "出入库时发现param中取到的Position=null,没有库位不能执行出入库"); LogUtil.error(LOGGER, StoreName + "出入库时发现param中取到的Position=null,没有库位不能执行出入库");
...@@ -62,12 +58,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -62,12 +58,9 @@ namespace OnlineStore.DeviceLibrary
p.UpDown_OutLow_P8 = Config.UpDownAxis_OutLow_P8; p.UpDown_OutLow_P8 = Config.UpDownAxis_OutLow_P8;
p.InOut_P2 = position.InOutAxis_Batch_P2; p.InOut_P2 = position.InOutAxis_Batch_P2;
p.InOut_P4 = position.InOutAxis_DoorOutPosition_P4; p.InOut_P4 = position.InOutAxis_DoorOutPosition_P4;
//if (IsBatch)
//{
// p.InOut_P2 = position.InOutAxis_Batch_P2;
//}
p.UpDown_P1 = Config.GetUpDownP1(position.BagHeight); p.UpDown_P1 = Config.GetUpDownP1(param.PlateH);
p.ComPress_P2 = position.CompressAxis_Position_P2; p.ComPress_P2 = position.CompressAxis_Position_P2;
p.ComPress_P3 = position.CompressAxis_CPosition_P3; p.ComPress_P3 = position.CompressAxis_CPosition_P3;
p.InOut_P3 = position.InOutAxis_Position_P3; p.InOut_P3 = position.InOutAxis_Position_P3;
...@@ -76,22 +69,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -76,22 +69,20 @@ namespace OnlineStore.DeviceLibrary
p.UpDown_P4 = position.UpDownAxis_ILPosition_P4; p.UpDown_P4 = position.UpDownAxis_ILPosition_P4;
p.UpDown_P5 = position.UpDownAxis_OHPosition_P5; p.UpDown_P5 = position.UpDownAxis_OHPosition_P5;
p.UpDown_P6 = position.UpDownAxis_OLPosition_P6; p.UpDown_P6 = position.UpDownAxis_OLPosition_P6;
height = position.BagHeight;
param.MoveP = p; param.MoveP = p;
return true;
} }
else
{ int com2Value = Config.GetComP2(param.PlateH);
AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(param.PositionNum); if (com2Value.Equals(-1).Equals(false))
if (position != null)
{ {
height = position.BagHeight; param.MoveP.ComPress_P2 = com2Value;
} //LogUtil.debug("【" + param.PositionNum + "】高度【" + param.PlateH + "】压紧点2位置【" + param.MoveP.ComPress_P2 + "】");
} }
//出库时批量上下料轴需要下降的高度 //出库时批量上下料轴需要下降的高度
param.MoveP.BatchAxis_DownValue = AutomaticBaiting.AxisChangeValue * height + Config.BatchAxis_OutDownPosition; param.MoveP.BatchAxis_DownValue = AutomaticBaiting.AxisChangeValue * param.PlateH + Config.BatchAxis_OutDownPosition;
LogUtil.debug("【" + param.PositionNum + "】高度【" + height + "】批量上下料轴需要下降【" + param.MoveP.BatchAxis_DownValue + "】"); //LogUtil.debug("【" + param.PositionNum + "】高度【" + param.PlateH + "】批量上下料轴需要下降【" + param.MoveP.BatchAxis_DownValue + "】");
param.MoveP.UpDown_P1 = Config.GetUpDownP1(param.PlateH);
LogUtil.info("【" + param.PositionNum + "】高【" + param.PlateH + "】升降轴P1【" + param.MoveP.UpDown_P1 + "】压紧轴P2【" + param.MoveP.ComPress_P2 + "】批量上下料轴需要下降【" + param.MoveP.BatchAxis_DownValue + "】");
return true; return true;
} }
...@@ -597,7 +588,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -597,7 +588,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
} }
int height = param.GetACPosition().BagHeight; int height = param.GetPosition().BagHeight;
if (AutomaticBaiting.BatchOutStoreHeight+ height > Config.BatchAxis_MaxHeight) if (AutomaticBaiting.BatchOutStoreHeight+ height > Config.BatchAxis_MaxHeight)
{ {
LogUtil.error(LOGGER, StoreName + logMsg + " 出错,当前高【"+ AutomaticBaiting.BatchOutStoreHeight + "】出库料盘高【"+ height + "】,最大高【"+ Config.BatchAxis_MaxHeight + "】"); LogUtil.error(LOGGER, StoreName + logMsg + " 出错,当前高【"+ AutomaticBaiting.BatchOutStoreHeight + "】出库料盘高【"+ height + "】,最大高【"+ Config.BatchAxis_MaxHeight + "】");
...@@ -756,7 +747,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -756,7 +747,7 @@ namespace OnlineStore.DeviceLibrary
OutStoreLog("出库:SO_11_PutTray 放下料盘,升降轴到P8(出库低点),压紧轴至P3(压紧前点)"); OutStoreLog("出库:SO_11_PutTray 放下料盘,升降轴到P8(出库低点),压紧轴至P3(压紧前点)");
ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3,true); ComMoveToPosition(StoreMove.MoveParam.MoveP.ComPress_P3,true);
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_OutLow_P8, Config.UpDownAxis_P8_Speed); ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_OutLow_P8, Config.UpDownAxis_P8_Speed);
AutomaticBaiting.BatchOutStoreHeight += StoreMove.MoveParam.GetACPosition().BagHeight; AutomaticBaiting.BatchOutStoreHeight += StoreMove.MoveParam.GetPosition().BagHeight;
AutomaticBaiting.BatchOutStoreCount++; AutomaticBaiting.BatchOutStoreCount++;
} }
else if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH)) else if (KND.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
......
...@@ -19,7 +19,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -19,7 +19,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public static int DoorStatus = 2; public static int DoorStatus = 2;
private static int LastHeight = 0; private static int LastHeight = 0;
private static int LastSize = 0; private static int LastWidth = 0;
private static string LastCode = ""; private 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);
...@@ -102,7 +102,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -102,7 +102,7 @@ namespace OnlineStore.DeviceLibrary
LastCode = ""; LastCode = "";
LastPosId = ""; LastPosId = "";
LastHeight = 0; LastHeight = 0;
LastSize = 0; LastWidth = 0;
} }
public static void StopRun() public static void StopRun()
...@@ -133,13 +133,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -133,13 +133,13 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.info(Name + " 复位前,清理报警【" + StoreManager.Store.alarmType + "】"); LogUtil.info(Name + " 复位前,清理报警【" + StoreManager.Store.alarmType + "】");
StoreManager.Store.alarmType = StoreAlarmType.None; StoreManager.Store.alarmType = StoreAlarmType.None;
WarnMsg = "";
} }
AutomaticBaiting.IsNeedStartInout = isNeedInout; AutomaticBaiting.IsNeedStartInout = isNeedInout;
if (!StoreMove.MoveType.Equals(StoreMoveType.None)) if (!StoreMove.MoveType.Equals(StoreMoveType.None))
{ {
StopMove(); StopMove();
} }
WarnMsg = "";
ClearInStoreInfo(); ClearInStoreInfo();
DoorStatus = 2; DoorStatus = 2;
AutoBaitingStatus = StoreRunStatus.Reset; AutoBaitingStatus = StoreRunStatus.Reset;
...@@ -289,6 +289,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -289,6 +289,7 @@ namespace OnlineStore.DeviceLibrary
if (KND.IOValue(IO_Type.SuckingDisc_Air).Equals(IO_VALUE.HIGH)) if (KND.IOValue(IO_Type.SuckingDisc_Air).Equals(IO_VALUE.HIGH))
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_SuckingDisc_Up); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I06_SuckingDisc_Up);
LogUtil.info(Name + "入料: 吸盘上升,等待宽度到达" + StoreManager.Config.Default_TrayWidth); LogUtil.info(Name + "入料: 吸盘上升,等待宽度到达" + StoreManager.Config.Default_TrayWidth);
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true); CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, true);
if (StoreManager.Config.Default_TrayWidth.Equals(7)) if (StoreManager.Config.Default_TrayWidth.Equals(7))
...@@ -323,6 +324,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -323,6 +324,11 @@ namespace OnlineStore.DeviceLibrary
{ {
if (StoreManager.Store.CanStarInOut()) if (StoreManager.Store.CanStarInOut())
{ {
LastWidth = StoreManager.Config.Default_TrayWidth;
LastHeight = GetHeight();
BatchInStoreCount++;
BatchInStoreHeight += LastHeight;
if (LastCode.Equals("")) if (LastCode.Equals(""))
{ {
LogUtil.info(Name + "入料: 未扫到二维码,将料盘送出,等待料盘拿走"); LogUtil.info(Name + "入料: 未扫到二维码,将料盘送出,等待料盘拿走");
...@@ -331,11 +337,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -331,11 +337,8 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I08_GetPosId); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I08_GetPosId);
LastSize = StoreManager.Config.Default_TrayWidth;
LastHeight = GetHeight(); LogUtil.info(Name + "入料: 从服务器获取入库PosId,尺寸:【" + LastWidth + "*" + LastHeight + "】二维码【" + LastCode + "】");
BatchInStoreCount++;
BatchInStoreHeight += LastHeight;
LogUtil.info(Name + "入料: 从服务器获取入库PosId,尺寸:【" + LastSize + "*" + LastHeight + "】二维码【" + LastCode + "】");
GetInStorePosId(ProcessMsg()); GetInStorePosId(ProcessMsg());
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(3000)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(3000));
...@@ -389,8 +392,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -389,8 +392,23 @@ namespace OnlineStore.DeviceLibrary
{ {
//计算高度 //计算高度
EndMovePosition = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue()); EndMovePosition = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
if (EndMovePosition.Equals(-1))
{
EndMovePosition = ACServerManager.GetActualtPosition(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
}
LastHeight = (int)Math.Ceiling(1F * (EndMovePosition - StartMovePosition) / AxisChangeValue); LastHeight = (int)Math.Ceiling(1F * (EndMovePosition - StartMovePosition) / AxisChangeValue);
LogUtil.info(Name + "入料: 计算盘高:上升前【" + StartMovePosition + "】实时【" + EndMovePosition + "】计算后高度【" + LastHeight + "】"); int addHeight = 0;
//如果检测信号未亮,极限亮了,需要补充高
if (KND.IOValue(IO_Type.TrayCheck_LoadMaterial).Equals(IO_VALUE.LOW))
{
addHeight = StoreManager.Config.LastTrayAddHeight;
}
LastHeight += addHeight;
LogUtil.info(Name + "入料: 计算盘高:上升前【" + StartMovePosition + "】实时【" + EndMovePosition + "】补充【"+addHeight+"】计算后高度【" + LastHeight + "】");
if (LastHeight < 0)
{
LastHeight = StoreManager.Config.GetDefaultHeight();
}
if (StoreManager.Config.Default_TrayWidth.Equals(7)) if (StoreManager.Config.Default_TrayWidth.Equals(7))
{ {
if (LastHeight <= 8) { LastHeight = 8; } if (LastHeight <= 8) { LastHeight = 8; }
...@@ -405,15 +423,27 @@ namespace OnlineStore.DeviceLibrary ...@@ -405,15 +423,27 @@ namespace OnlineStore.DeviceLibrary
LastHeight = (int)Math.Ceiling(1F * LastHeight / 4) * 4; LastHeight = (int)Math.Ceiling(1F * LastHeight / 4) * 4;
} }
} }
return LastHeight; return LastHeight;
} }
private static List<AutoStorePosition> AllPosList = null;
private static void SendTrayOut() private static void SendTrayOut()
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_I10_WaitTrayGo); StoreMove.NextMoveStep(StoreMoveStep.AUTO_I10_WaitTrayGo);
StoreMove.TimeOutSeconds = 120; StoreMove.TimeOutSeconds = 120;
string posId = StoreManager.Store.PositionNumList[0]; string posId = StoreManager.Store.PositionNumList[0];
StoreManager.Store.StartInStoreMove(new InOutStoreParam("", posId), true, false); //盘先根据高低排序
if (AllPosList == null) {
AllPosList = CSVPositionReader<AutoStorePosition>.getPositionList();
AllPosList = (from m in AllPosList orderby m.BagHeight ascending select m).ToList<AutoStorePosition>();
}
List<AutoStorePosition> okList = (from m in AllPosList where m.BagHeight >= LastHeight select m ).ToList<AutoStorePosition>();
if (okList.Count > 0)
{
posId = okList[0].PositionNum;
}
StoreManager.Store.StartInStoreMove(new InOutStoreParam(LastCode, posId,LastHeight,LastWidth), true, false);
StoreMove.WaitList.Add(WaitResultInfo.WaitStoreRuning()); StoreMove.WaitList.Add(WaitResultInfo.WaitStoreRuning());
} }
...@@ -432,7 +462,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -432,7 +462,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LastCode = ""; LastCode = "";
LastHeight = 0; LastHeight = 0;
LastSize = 0; LastWidth = 0;
LastPosId = ""; LastPosId = "";
SuckingDisc_WorkCount = 0; SuckingDisc_WorkCount = 0;
//如果有超时异常,需要清理 //如果有超时异常,需要清理
......
...@@ -93,17 +93,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -93,17 +93,17 @@ namespace OnlineStore.DeviceLibrary
else if (wait.WaitType == (int)Wait_Type.IOMove_2) else if (wait.WaitType == (int)Wait_Type.IOMove_2)
{ {
wait.IsEnd = KND.IOValue(wait.IoType).Equals(wait.IoValue); wait.IsEnd = KND.IOValue(wait.IoType).Equals(wait.IoValue);
int timeOutMs = StoreManager.Config.IOSingle_TimerOut; //int timeOutMs = StoreManager.Config.IOSingle_TimerOut;
//timeOutMs = 20;
if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs) //if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
{ //{
ConfigIO io = StoreManager.Config.getWaitIO(wait.IoType); // ConfigIO io = StoreManager.Config.getWaitIO(wait.IoType);
WarnMsg = "[" + StoreMove.MoveStep + "] 等待[" + io.ElectricalDefinition + "_" + io.Explain + "=" + wait.IoValue + "]超时"; // WarnMsg = "[" + StoreMove.MoveStep + "] 等待[" + io.ElectricalDefinition + "_" + io.Explain + "=" + wait.IoValue + "]超时";
StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType); // StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType);
LogUtil.error(WarnMsg,101); // LogUtil.error(WarnMsg,101);
isOk = false; // isOk = false;
break; // break;
} //}
} }
else if (wait.WaitType == (int)Wait_Type.Time_3) else if (wait.WaitType == (int)Wait_Type.Time_3)
{ {
...@@ -250,28 +250,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -250,28 +250,12 @@ namespace OnlineStore.DeviceLibrary
if (result) if (result)
{ {
//AutoAxisIsMove = 0; //AutoAxisIsMove = 0;
LogUtil.info(wait.ToStr() + " 停止运动"); LogUtil.debug(wait.ToStr() + " 停止运动");
ACServerManager.SuddenStop(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()); ACServerManager.SuddenStop(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
} }
return result; return result;
} }
//public static int GetWidth()
//{
// if (KND.IOValue(IO_Type.WidthCheck1).Equals(IO_VALUE.HIGH))
// {
// if (KND.IOValue(IO_Type.WidthCheck2).Equals(IO_VALUE.HIGH))
// {
// return 13;
// }
// else
// {
// return 7;
// }
// }
// return 0;
//}
#region Halcon扫码枪代码 #region Halcon扫码枪代码
public bool IsTestCamera = false; public bool IsTestCamera = false;
private static char spiltStr = '#'; private static char spiltStr = '#';
...@@ -331,7 +315,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -331,7 +315,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (!code.Equals("")) if (!code.Equals(""))
{ {
msg = msg + "=1+0x0-" + LastSize + "x" + LastHeight + "=" + code + spiltStr + spiltStr; msg = msg + "=1+0x0-" + LastWidth + "x" + LastHeight + "=" + code + spiltStr + spiltStr;
} }
} }
return msg; return msg;
...@@ -356,15 +340,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -356,15 +340,16 @@ namespace OnlineStore.DeviceLibrary
if (StoreManager.Store.IsDebug) if (StoreManager.Store.IsDebug)
{ {
string posId = "1#AC1_1_1_4"; string posId = ConfigAppSettings.GetValue(Setting_Init.DebugPosId);
if (!posId.Equals(""))
{
//"1#AC2_2_1_1";
LogUtil.info(Name + "调试模式,模拟库位号【" + posId + "】"); LogUtil.info(Name + "调试模式,模拟库位号【" + posId + "】");
string plateH = "8";
string plateW = "7";
if (StoreManager.Store.CanStarInOut()) if (StoreManager.Store.CanStarInOut())
{ {
LastPosId = posId; LastPosId = posId;
InOutStoreParam param = new InOutStoreParam(message, posId, LastHeight, LastWidth );
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW, 0);
StoreManager.Store.StartInStoreMove(param, true); StoreManager.Store.StartInStoreMove(param, true);
//如果当前正在出入库中,需要记录下来,等待空闲时执行 //如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(Name + " 入库调试模拟:库位号【" + posId + "】二维码【" + message + "】 开始入库!"); LogUtil.info(Name + " 入库调试模拟:库位号【" + posId + "】二维码【" + message + "】 开始入库!");
...@@ -375,6 +360,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -375,6 +360,7 @@ namespace OnlineStore.DeviceLibrary
} }
return; return;
} }
}
// CodeMsg = "收到二维码【 " + message + "】,发送给服务器获取入库PosID"; // CodeMsg = "收到二维码【 " + message + "】,发送给服务器获取入库PosID";
LogUtil.info(Name + "收到二维码【 " + message + "】,发送给服务器获取入库PosID"); LogUtil.info(Name + "收到二维码【 " + message + "】,发送给服务器获取入库PosID");
...@@ -402,8 +388,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -402,8 +388,11 @@ namespace OnlineStore.DeviceLibrary
//服务器返回时有:posId库位编号,plateW:料盘宽度,plateH:料盘高度, //服务器返回时有:posId库位编号,plateW:料盘宽度,plateH:料盘高度,
//postId格式BoxId#位置 //postId格式BoxId#位置
string posId = data[ParamDefine.posId]; string posId = data[ParamDefine.posId];
string plateW = data[ParamDefine.plateW]; try
string plateH = data[ParamDefine.plateH]; {
int plateW = Convert.ToInt32(data[ParamDefine.plateW]);
int plateH = Convert.ToInt32(data[ParamDefine.plateH]);
string singleOut = data[ParamDefine.singleOut]; string singleOut = data[ParamDefine.singleOut];
//bool isSingleOut = singleOut.ToLower().Equals("true"); //bool isSingleOut = singleOut.ToLower().Equals("true");
string[] posArray = posId.Split('#'); string[] posArray = posId.Split('#');
...@@ -428,7 +417,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -428,7 +417,7 @@ namespace OnlineStore.DeviceLibrary
if (StoreManager.Store.CanStarInOut()) if (StoreManager.Store.CanStarInOut())
{ {
LastPosId = posId; LastPosId = posId;
InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW, 0); InOutStoreParam param = new InOutStoreParam(message, posId, plateH, plateW);
StoreManager.Store.StartInStoreMove(param, true); StoreManager.Store.StartInStoreMove(param, true);
//如果当前正在出入库中,需要记录下来,等待空闲时执行 //如果当前正在出入库中,需要记录下来,等待空闲时执行
...@@ -438,6 +427,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -438,6 +427,10 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.info(Name + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!"); LogUtil.info(Name + " 收到服务器入库命令:库位号【" + posId + "】二维码【" + message + "】 正在忙碌中,无法入库!");
} }
}catch(Exception ex)
{
LogUtil.error(Name +"解析服务发送的入库【"+posId+"】出错"+ ex.StackTrace);
}
} }
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -369,15 +369,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -369,15 +369,6 @@ namespace OnlineStore.DeviceLibrary
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_04_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);
...@@ -385,14 +376,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -385,14 +376,6 @@ namespace OnlineStore.DeviceLibrary
{ {
if (errorCount > moveAxis.CanErrorCountMax) if (errorCount > moveAxis.CanErrorCountMax)
{ {
//if (NeedCheckSafetyLight.Equals(2))
//{
// if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_10_DeviceToDoor) ||
// StoreMove.MoveStep.Equals(StoreMoveStep.SI_04_DeviceToDoor))
// {
// return false;
// }
//}
//判断是否需要重新运动 //判断是否需要重新运动
if (StoreMove.CanWhileCount > 0) if (StoreMove.CanWhileCount > 0)
{ {
......
...@@ -34,8 +34,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -34,8 +34,9 @@ namespace OnlineStore.DeviceLibrary
PositionNum = posId; PositionNum = posId;
MoveP = null; MoveP = null;
IsSolderPaste = false; IsSolderPaste = false;
SetSize();
} }
public InOutStoreParam(string wareNo, string posId,string plateH,string plateW) public InOutStoreParam(string wareNo, string posId, int plateH, int plateW)
{ {
ACStoreP = null; ACStoreP = null;
WareNumber = wareNo; WareNumber = wareNo;
...@@ -45,17 +46,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -45,17 +46,17 @@ namespace OnlineStore.DeviceLibrary
this.PlateH = plateH; this.PlateH = plateH;
IsSolderPaste = false; IsSolderPaste = false;
} }
public InOutStoreParam(string wareNo, string posId, string plateH, string plateW,int trayCode) //public InOutStoreParam(string wareNo, string posId, int plateH, int plateW,int trayCode)
{ //{
ACStoreP = null; // ACStoreP = null;
WareNumber = wareNo; // WareNumber = wareNo;
PositionNum = posId; // PositionNum = posId;
MoveP = null; // MoveP = null;
this.PlagtW = plateW; // this.PlagtW = plateW;
this.PlateH = plateH; // this.PlateH = plateH;
this.TrayCode = trayCode; // this.TrayCode = trayCode;
IsSolderPaste = false; // IsSolderPaste = false;
} //}
public InOutStoreParam(string wareNo, string posId, LineMoveP linePosition) public InOutStoreParam(string wareNo, string posId, LineMoveP linePosition)
{ {
...@@ -64,19 +65,33 @@ namespace OnlineStore.DeviceLibrary ...@@ -64,19 +65,33 @@ namespace OnlineStore.DeviceLibrary
PositionNum = posId; PositionNum = posId;
MoveP = linePosition; MoveP = linePosition;
IsSolderPaste = false; IsSolderPaste = false;
SetSize();
} }
public InOutStoreParam(string wareNo, string posId, AutoStorePosition movep) //public InOutStoreParam(string wareNo, string posId, AutoStorePosition movep)
//{
// ACStoreP = movep;
// WareNumber = wareNo;
// PositionNum = posId;
// MoveP = null;
// IsSolderPaste = false;
//}
public void SetSize()
{ {
ACStoreP = movep; AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(PositionNum);
WareNumber = wareNo; if (!(position == null))
PositionNum = posId; {
MoveP = null; this.PlateH = position.BagHeight;
IsSolderPaste = false; this.PlagtW = position.BagWidth;
}
else
{
this.PlagtW = StoreManager.Config.Default_TrayWidth;
this.PlateH = StoreManager.Config.GetDefaultHeight();
}
} }
private AutoStorePosition ACStoreP = null; private AutoStorePosition ACStoreP = null;
public AutoStorePosition GetACPosition() public AutoStorePosition GetPosition()
{ {
try try
{ {
...@@ -109,11 +124,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -109,11 +124,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 料盘高度 /// 料盘高度
/// </summary> /// </summary>
public string PlateH { get; set; } public int PlateH { get; set; }
/// <summary> /// <summary>
/// 料盘宽度 /// 料盘宽度
/// </summary> /// </summary>
public string PlagtW { get; set; } public int PlagtW { get; set; }
/// <summary> /// <summary>
/// 是否是放入锡膏(在线料仓才需要此字段) /// 是否是放入锡膏(在线料仓才需要此字段)
/// </summary> /// </summary>
......
using System; using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
...@@ -17,16 +18,29 @@ namespace OnlineStore.DeviceLibrary ...@@ -17,16 +18,29 @@ namespace OnlineStore.DeviceLibrary
this.TrayCode = trayCode; this.TrayCode = trayCode;
this.WareNum = wareNum; this.WareNum = wareNum;
this.PosId = posId; this.PosId = posId;
this.plateH = ""; SetSize();
this.plateW = "";
} }
public FixtureCodeInfo(int trayCode, string wareNum, string posId,string platew,string plateh) //public FixtureCodeInfo(int trayCode, string wareNum, string posId,int platew, int plateh)
//{
// this.TrayCode = trayCode;
// this.WareNum = wareNum;
// this.PosId = posId;
// this.plateW = platew;
// this.plateH = plateh;
//}
public void SetSize()
{ {
this.TrayCode = trayCode; AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(PosId);
this.WareNum = wareNum; if (!(position == null))
this.PosId = posId; {
this.plateW = platew; this.plateH = position.BagHeight;
this.plateH = plateh; this.plateW = position.BagWidth;
}
else
{
this.plateW = StoreManager.Config.Default_TrayWidth;
this.plateH = StoreManager.Config.GetDefaultHeight();
}
} }
/// <summary> /// <summary>
/// 夹具编码值(1-6) /// 夹具编码值(1-6)
...@@ -43,11 +57,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -43,11 +57,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 料盘宽 /// 料盘宽
/// </summary> /// </summary>
public string plateW { get; set; } public int plateW { get; set; }
/// <summary> /// <summary>
/// 料盘高 /// 料盘高
/// </summary> /// </summary>
public string plateH { get; set; } public int plateH { get; set; }
public string ToStr() public string ToStr()
......
...@@ -352,6 +352,11 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -352,6 +352,11 @@ namespace OnlineStore.LoadCSVLibrary
public int CompressAxis_P1_Position { get; set; } public int CompressAxis_P1_Position { get; set; }
/// <summary> /// <summary>
/// PRO,压紧轴(轴4)P2压紧点集合,CompressAxis_P2_List,52#-10000;48#-10000,,,,,,,,,
/// </summary>
[ConfigProAttribute("CompressAxis_P2_List")]
public string CompressAxis_P2_List { get; set; }
/// <summary>
/// PRO 是否使用料盘检测信号 IsUse_Tray_Check /// PRO 是否使用料盘检测信号 IsUse_Tray_Check
/// </summary> /// </summary>
[ConfigProAttribute("IsUse_Tray_Check")] [ConfigProAttribute("IsUse_Tray_Check")]
...@@ -594,11 +599,73 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -594,11 +599,73 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("IO_DOLength")] [ConfigProAttribute("IO_DOLength")]
public string IO_DOLength { get; set; } public string IO_DOLength { get; set; }
/// <summary>
/// PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
/// </summary>
[ConfigProAttribute("LastTrayAddHeight")]
public int LastTrayAddHeight { get; set; }
private Dictionary<string, ushort> DILengthMap = null; private Dictionary<string, ushort> DILengthMap = null;
private Dictionary<string, ushort> DOLengthMap = null; private Dictionary<string, ushort> DOLengthMap = null;
private Dictionary<int, int> ComP2Map = null;
public int GetComP2(int trayHeight)
{
try
{
if (ComP2Map == null)
{
ComP2Map = new Dictionary<int, int>();
string[] arrayList = CompressAxis_P2_List.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('#');
if (arrStr.Length == 2)
{
int ioip = Convert.ToInt32(arrStr[0]);
int length = Convert.ToInt32(arrStr[1]);
ComP2Map.Add(ioip, length);
}
}
}
}
catch (Exception ex)
{
}
if (ComP2Map.ContainsKey(trayHeight))
{
return ComP2Map[trayHeight];
}
else
{
LogUtil.error("未找到料盘高度为【" + trayHeight + "】的压紧轴P2");
return -1;
}
}
public void UpdateComP2(int height, int value)
{
int oldP1 = GetComP2(height);
if (!oldP1.Equals(value))
{
if (ComP2Map.ContainsKey(height))
{
ComP2Map[height] = value;
}
else
{
ComP2Map.Add(height, value);
}
}
string msg = "";
foreach (int key in ComP2Map.Keys)
{
msg += key + "#" + ComP2Map[key] + ";";
}
this.CompressAxis_P2_List = msg;
}
private Dictionary<int, int> UpDownAxisP1Map = null; private Dictionary<int, int> UpDownAxisP1Map = null;
public int GetUpDownP1(int trayHeight) public int GetUpDownP1(int trayHeight)
{ {
...@@ -630,11 +697,12 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -630,11 +697,12 @@ namespace OnlineStore.LoadCSVLibrary
} }
else else
{ {
LogUtil.error("未找到料盘高度为【"+trayHeight+"】的升降轴P1"); LogUtil.error("未找到料盘高度为【"+trayHeight+"】的升降轴P1,查找最大高度的P1");
if (UpDownAxisP1Map.Count > 0) if (UpDownAxisP1Map.Count > 0)
{ {
List<int> list = new List<int>(UpDownAxisP1Map.Values); List<int> list = new List<int>(UpDownAxisP1Map.Keys);
return list[0]; list = (from m in list orderby m descending select m).ToList<int>();
return UpDownAxisP1Map[list[0]];
} }
} }
...@@ -663,7 +731,17 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -663,7 +731,17 @@ namespace OnlineStore.LoadCSVLibrary
} }
public int GetDefaultUpDownP1() public int GetDefaultUpDownP1()
{ {
return GetUpDownP1(8); return GetUpDownP1(GetDefaultHeight());
}
public int GetDefaultHeight()
{
int defaultH = 8;
if (Default_TrayWidth.Equals(13))
{
defaultH = 40;
}
return defaultH;
} }
public ushort GetDILength(string ip) public ushort GetDILength(string ip)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!