Commit 47660d67 张东亮

HY11阻挡放行托盘等待到达HY22信号等待修改

1 个父辈 f3c975c4
...@@ -19,7 +19,7 @@ using System.Windows.Forms; ...@@ -19,7 +19,7 @@ using System.Windows.Forms;
namespace OnlineStore.AssemblyLine namespace OnlineStore.AssemblyLine
{ {
internal partial class FrmLineStore : FrmBase internal partial class FrmLineStore : FrmBase
{ {
private LineBean lineBean = null; private LineBean lineBean = null;
private List<TabPage> tabPageList = new List<TabPage>(); private List<TabPage> tabPageList = new List<TabPage>();
private bool LoadOk = false; private bool LoadOk = false;
...@@ -119,12 +119,12 @@ namespace OnlineStore.AssemblyLine ...@@ -119,12 +119,12 @@ namespace OnlineStore.AssemblyLine
cmbBoxIndex.SelectedIndex = 0; cmbBoxIndex.SelectedIndex = 0;
} }
string opStr = "双击进入详情界面"; string opStr = "双击进入详情界面";
lblOpText.Text = opStr; lblOpText.Text = opStr;
LogUtil.logBox = this.logBox; LogUtil.logBox = this.logBox;
lastLogTime = DateTime.Now.AddMinutes(-10); lastLogTime = DateTime.Now.AddMinutes(-10);
this.Opacity = 100; this.Opacity = 100;
LoadOk = true; LoadOk = true;
} }
private void AddForm(string text, Form form) private void AddForm(string text, Form form)
...@@ -147,7 +147,7 @@ namespace OnlineStore.AssemblyLine ...@@ -147,7 +147,7 @@ namespace OnlineStore.AssemblyLine
tabPageList.Add(lineTabPage); tabPageList.Add(lineTabPage);
tabControl1.Controls.Add(lineTabPage); tabControl1.Controls.Add(lineTabPage);
} }
private void HideForm() private void HideForm()
{ {
this.Opacity = 0; this.Opacity = 0;
...@@ -224,7 +224,7 @@ namespace OnlineStore.AssemblyLine ...@@ -224,7 +224,7 @@ namespace OnlineStore.AssemblyLine
{ {
Camera._cam.CloseAll(); Camera._cam.CloseAll();
} }
//System.Environment.Exit(System.Environment.ExitCode); //System.Environment.Exit(System.Environment.ExitCode);
System.Diagnostics.Process.GetCurrentProcess().Kill(); System.Diagnostics.Process.GetCurrentProcess().Kill();
this.Close(); this.Close();
...@@ -279,7 +279,7 @@ namespace OnlineStore.AssemblyLine ...@@ -279,7 +279,7 @@ namespace OnlineStore.AssemblyLine
{ {
if (lineBean.runStatus != LineRunStatus.Wait) if (lineBean.runStatus != LineRunStatus.Wait)
{ {
MessageBox.Show(lineBean.Name + "当前状态:" + lineBean.runStatus + ",不能启动!","提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show(lineBean.Name + "当前状态:" + lineBean.runStatus + ",不能启动!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
LogUtil.info("点击 开始启动"); LogUtil.info("点击 开始启动");
...@@ -308,9 +308,9 @@ namespace OnlineStore.AssemblyLine ...@@ -308,9 +308,9 @@ namespace OnlineStore.AssemblyLine
} }
private void formLineStatus(bool isStart) private void formLineStatus(bool isStart)
{ {
启动AToolStripMenuItem.Enabled = !isStart; 启动AToolStripMenuItem.Enabled = !isStart;
停止TToolStripMenuItem.Enabled = isStart; 停止TToolStripMenuItem.Enabled = isStart;
} }
private void 停止所有料仓TToolStripMenuItem_Click(object sender, EventArgs e) private void 停止所有料仓TToolStripMenuItem_Click(object sender, EventArgs e)
{ {
...@@ -369,7 +369,7 @@ namespace OnlineStore.AssemblyLine ...@@ -369,7 +369,7 @@ namespace OnlineStore.AssemblyLine
#region 内存回收 #region 内存回收
[DllImport("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize")] [DllImport("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize")]
public static extern int SetProcessWorkingSetSize(IntPtr process, int minSize, int maxSize); public static extern int SetProcessWorkingSetSize(IntPtr process, int minSize, int maxSize);
public static void ClearMemory() public static void ClearMemory()
{ {
try try
...@@ -424,73 +424,76 @@ namespace OnlineStore.AssemblyLine ...@@ -424,73 +424,76 @@ namespace OnlineStore.AssemblyLine
} }
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
LogM(); lock (timer1)
StopRunProcess();
UpdateControl();
string canScanCode = "";
if (AgvClient.CurrCancelState)
{
aGVCancelStateToolStripMenuItem.Text = gouStr + " AGV cancelState";
}
else
{
aGVCancelStateToolStripMenuItem.Text = "AGV cancelState";
}
lblStatus.Text = lineBean.GetRunStr() + canScanCode;
string warnMsg = "";
if (LineManager.Line.runStatus > LineRunStatus.Wait)
{ {
string time = LineManager.Line.alarmType.Equals(LineAlarmType.None) ? "" : LineManager.Line.LastAlarmTime.ToLongTimeString(); LogM();
warnMsg = LineManager.Line.WarnMsg.Equals("") ? "" : (time + LineManager.Line.WarnMsg + "\r\n"); StopRunProcess();
UpdateControl();
if (TrayManager.TrayErrorMsg.Equals("").Equals(false)) string canScanCode = "";
if (AgvClient.CurrCancelState)
{ {
warnMsg += TrayManager.TrayErrorMsg + "\r\n"; aGVCancelStateToolStripMenuItem.Text = gouStr + " AGV cancelState";
} }
} else
foreach (EquipBase move in lineBean.AllEquipMap.Values)
{
if (move.runStatus > LineRunStatus.Wait && (move.WarnMsg.Equals("").Equals(false)))
{ {
if (move.alarmType.Equals(LineAlarmType.None).Equals(false)) aGVCancelStateToolStripMenuItem.Text = "AGV cancelState";
{ }
warnMsg += move.LastAlarmTime.ToLongTimeString() + " " + move.WarnMsg + "\r\n"; lblStatus.Text = lineBean.GetRunStr() + canScanCode;
} string warnMsg = "";
else if (LineManager.Line.runStatus > LineRunStatus.Wait)
{
string time = LineManager.Line.alarmType.Equals(LineAlarmType.None) ? "" : LineManager.Line.LastAlarmTime.ToLongTimeString();
warnMsg = LineManager.Line.WarnMsg.Equals("") ? "" : (time + LineManager.Line.WarnMsg + "\r\n");
if (TrayManager.TrayErrorMsg.Equals("").Equals(false))
{ {
warnMsg += move.WarnMsg + "\r\n"; warnMsg += TrayManager.TrayErrorMsg + "\r\n";
} }
} }
}
lblWarnMsg.Text = warnMsg;
lblCardMsg.Text = HuichuanLibrary.HCBoardManager.CardMsg; foreach (EquipBase move in lineBean.AllEquipMap.Values)
if (lineBean.runStatus > LineRunStatus.Wait)
{
if (启动AToolStripMenuItem.Enabled.Equals(true))
{ {
formLineStatus(true); if (move.runStatus > LineRunStatus.Wait && (move.WarnMsg.Equals("").Equals(false)))
{
if (move.alarmType.Equals(LineAlarmType.None).Equals(false))
{
warnMsg += move.LastAlarmTime.ToLongTimeString() + " " + move.WarnMsg + "\r\n";
}
else
{
warnMsg += move.WarnMsg + "\r\n";
}
}
} }
if ((lineBean.runStatus.Equals(LineRunStatus.HomeMoving) || lineBean.runStatus.Equals(LineRunStatus.Reset)) lblWarnMsg.Text = warnMsg;
&& lineBean.alarmType.Equals(LineAlarmType.None))
lblCardMsg.Text = HuichuanLibrary.HCBoardManager.CardMsg;
if (lineBean.runStatus > LineRunStatus.Wait)
{ {
SetMenuS(复位RToolStripMenuItem, false); if (启动AToolStripMenuItem.Enabled.Equals(true))
SetMenuS(启动AToolStripMenuItem, false); {
formLineStatus(true);
}
if ((lineBean.runStatus.Equals(LineRunStatus.HomeMoving) || lineBean.runStatus.Equals(LineRunStatus.Reset))
&& lineBean.alarmType.Equals(LineAlarmType.None))
{
SetMenuS(复位RToolStripMenuItem, false);
SetMenuS(启动AToolStripMenuItem, false);
}
else
{
SetMenuS(复位RToolStripMenuItem, true);
}
} }
else else
{ {
SetMenuS(复位RToolStripMenuItem, true); SetMenuS(启动AToolStripMenuItem, true);
SetMenuS(复位RToolStripMenuItem, false);
SetMenuS(停止TToolStripMenuItem, false);
} }
} }
else
{
SetMenuS(启动AToolStripMenuItem, true);
SetMenuS(复位RToolStripMenuItem, false);
SetMenuS(停止TToolStripMenuItem, false);
}
} }
bool stopRun = false; bool stopRun = false;
bool stopRequest = false; bool stopRequest = false;
...@@ -581,7 +584,7 @@ namespace OnlineStore.AssemblyLine ...@@ -581,7 +584,7 @@ namespace OnlineStore.AssemblyLine
FrmAbout about = new FrmAbout(); FrmAbout about = new FrmAbout();
about.ShowDialog(); about.ShowDialog();
} }
private void 二维码学习ToolStripMenuItem_Click(object sender, EventArgs e) private void 二维码学习ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
...@@ -630,7 +633,7 @@ namespace OnlineStore.AssemblyLine ...@@ -630,7 +633,7 @@ namespace OnlineStore.AssemblyLine
LineServer.StartInStore(index, new InOutParam(0, "", posId, 0, 0)); LineServer.StartInStore(index, new InOutParam(0, "", posId, 0, 0));
} }
} }
private void 托盘初始化ToolStripMenuItem_Click(object sender, EventArgs e) private void 托盘初始化ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
FrmRFIPEdit FRM = new FrmRFIPEdit(); FrmRFIPEdit FRM = new FrmRFIPEdit();
...@@ -641,7 +644,7 @@ namespace OnlineStore.AssemblyLine ...@@ -641,7 +644,7 @@ namespace OnlineStore.AssemblyLine
{ {
//FrmIOMsg frm = new FrmIOMsg(); //FrmIOMsg frm = new FrmIOMsg();
//frm.ShowDialog(); //frm.ShowDialog();
string msg = ""; string msg = "";
List<int> list = new List<int>(LineManager.Line.MoveEquipMap.Keys); List<int> list = new List<int>(LineManager.Line.MoveEquipMap.Keys);
LogUtil.info("-------------------开始打印料仓连接信息:"); LogUtil.info("-------------------开始打印料仓连接信息:");
...@@ -664,11 +667,11 @@ namespace OnlineStore.AssemblyLine ...@@ -664,11 +667,11 @@ namespace OnlineStore.AssemblyLine
} }
} }
storeMsg=("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✔ " + LineServer.ClientMap[storeId].AddStr + " " + doorTray + "\n"; storeMsg = ("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✔ " + LineServer.ClientMap[storeId].AddStr + " " + doorTray + "\n";
} }
else else
{ {
storeMsg=("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✘ " + "\n"; storeMsg = ("BOX[" + storeId + "]").PadLeft(16, ' ') + " ✘ " + "\n";
} }
LogUtil.info(storeMsg); LogUtil.info(storeMsg);
msg += storeMsg; msg += storeMsg;
...@@ -692,7 +695,7 @@ namespace OnlineStore.AssemblyLine ...@@ -692,7 +695,7 @@ namespace OnlineStore.AssemblyLine
msg += "-------------------结束打印托盘信息"; msg += "-------------------结束打印托盘信息";
MessageBox.Show(msg, "托盘信息列表---------"); MessageBox.Show(msg, "托盘信息列表---------");
} }
private void logBox_VisibleChanged(object sender, EventArgs e) private void logBox_VisibleChanged(object sender, EventArgs e)
{ {
...@@ -708,7 +711,7 @@ namespace OnlineStore.AssemblyLine ...@@ -708,7 +711,7 @@ namespace OnlineStore.AssemblyLine
private void 清空日志ToolStripMenuItem_Click(object sender, EventArgs e) private void 清空日志ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
LogUtil.ClearLog(); LogUtil.ClearLog();
} }
private void 复制日志ToolStripMenuItem_Click(object sender, EventArgs e) private void 复制日志ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
...@@ -737,8 +740,8 @@ namespace OnlineStore.AssemblyLine ...@@ -737,8 +740,8 @@ namespace OnlineStore.AssemblyLine
{ {
//FrmAgvTest frm = new FrmAgvTest(); //FrmAgvTest frm = new FrmAgvTest();
//frm.ShowDialog(); //frm.ShowDialog();
} }
private string gouStr = "✔"; private string gouStr = "✔";
private void 开机自动启动ToolStripMenuItem_Click(object sender, EventArgs e) private void 开机自动启动ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
...@@ -834,7 +837,7 @@ namespace OnlineStore.AssemblyLine ...@@ -834,7 +837,7 @@ namespace OnlineStore.AssemblyLine
} }
else else
{ {
con.ShowData(lineBean.HYEquipMap[key]); con.ShowData(lineBean.HYEquipMap[key]);
} }
} }
} }
...@@ -852,9 +855,9 @@ namespace OnlineStore.AssemblyLine ...@@ -852,9 +855,9 @@ namespace OnlineStore.AssemblyLine
List<HYEquipBase> hyList = new List<HYEquipBase>(lineBean.HYEquipMap.Values); List<HYEquipBase> hyList = new List<HYEquipBase>(lineBean.HYEquipMap.Values);
int num = 0; int num = 0;
List<int> moveIDList = new List<int>() { 1,3,5,7,9,11,2,4,6,8,10,12,13,15,17,19,21,23,14,16,18,20,22,24 }; List<int> moveIDList = new List<int>() { 1, 3, 5, 7, 9, 11, 2, 4, 6, 8, 10, 12, 13, 15, 17, 19, 21, 23, 14, 16, 18, 20, 22, 24 };
//for (int i = 0; i < moveEquipList.Count; i++) //for (int i = 0; i < moveEquipList.Count; i++)
foreach(int i in moveIDList) foreach (int i in moveIDList)
{ {
int index = i - 1; int index = i - 1;
MoveEquip equip = moveEquipList[index]; MoveEquip equip = moveEquipList[index];
...@@ -871,7 +874,7 @@ namespace OnlineStore.AssemblyLine ...@@ -871,7 +874,7 @@ namespace OnlineStore.AssemblyLine
} }
this.panMove.Controls.Add(control, col, row); this.panMove.Controls.Add(control, col, row);
equipControls1.Add(equip.DeviceID, control); equipControls1.Add(equip.DeviceID, control);
num++; num++;
} }
num = 0; num = 0;
...@@ -883,7 +886,7 @@ namespace OnlineStore.AssemblyLine ...@@ -883,7 +886,7 @@ namespace OnlineStore.AssemblyLine
control.DoubleClick += Control_DoubleClick; control.DoubleClick += Control_DoubleClick;
control.ContextMenuStrip = contextMenuStrip_control; control.ContextMenuStrip = contextMenuStrip_control;
control.MouseEnter += Control_Click; control.MouseEnter += Control_Click;
int row = num / 5; int row = num / 5;
int col = num % 5; int col = num % 5;
this.panSL.Controls.Add(control, col, row); this.panSL.Controls.Add(control, col, row);
...@@ -897,10 +900,10 @@ namespace OnlineStore.AssemblyLine ...@@ -897,10 +900,10 @@ namespace OnlineStore.AssemblyLine
//for (int i = 0; i < hyList.Count; i++) //for (int i = 0; i < hyList.Count; i++)
num = 0; num = 0;
foreach (int i in hyIDList) foreach (int i in hyIDList)
{ {
if (i > 0) if (i > 0)
{ {
int index = i - 200-1; int index = i - 200 - 1;
HYEquipBase equip = hyList[index]; HYEquipBase equip = hyList[index];
EquipControl control = EquipControl.NewControl(equip); EquipControl control = EquipControl.NewControl(equip);
...@@ -908,7 +911,7 @@ namespace OnlineStore.AssemblyLine ...@@ -908,7 +911,7 @@ namespace OnlineStore.AssemblyLine
control.ContextMenuStrip = contextMenuStrip_control; control.ContextMenuStrip = contextMenuStrip_control;
control.MouseEnter += Control_Click; control.MouseEnter += Control_Click;
int row = num / 9; int row = num / 9;
int col = num % 9; int col = num % 9;
this.panHY.Controls.Add(control, col, row); this.panHY.Controls.Add(control, col, row);
...@@ -931,7 +934,7 @@ namespace OnlineStore.AssemblyLine ...@@ -931,7 +934,7 @@ namespace OnlineStore.AssemblyLine
private EquipBase seleEquip = null; private EquipBase seleEquip = null;
private EquipControl selControl = null; private EquipControl selControl = null;
private Dictionary<int, FrmEquipBase> FormMap = new Dictionary<int, FrmEquipBase>(); private Dictionary<int, FrmEquipBase> FormMap = new Dictionary<int, FrmEquipBase>();
private void Control_Click(object sender ,EventArgs s) private void Control_Click(object sender, EventArgs s)
{ {
if (sender is EquipControl) if (sender is EquipControl)
{ {
...@@ -946,24 +949,24 @@ namespace OnlineStore.AssemblyLine ...@@ -946,24 +949,24 @@ namespace OnlineStore.AssemblyLine
if (lineBean.MoveEquipMap.ContainsKey(deviceId)) if (lineBean.MoveEquipMap.ContainsKey(deviceId))
{ {
seleEquip=lineBean.MoveEquipMap[deviceId]; seleEquip = lineBean.MoveEquipMap[deviceId];
} }
else if (lineBean.FeedingEquipMap.ContainsKey(deviceId)) else if (lineBean.FeedingEquipMap.ContainsKey(deviceId))
{ {
seleEquip=lineBean.FeedingEquipMap[deviceId]; seleEquip = lineBean.FeedingEquipMap[deviceId];
} }
else if (lineBean.HYEquipMap.ContainsKey(deviceId)) else if (lineBean.HYEquipMap.ContainsKey(deviceId))
{ {
seleEquip=lineBean.HYEquipMap[deviceId]; seleEquip = lineBean.HYEquipMap[deviceId];
} }
if (seleEquip.runStatus > LineRunStatus.Wait) if (seleEquip.runStatus > LineRunStatus.Wait)
{ {
control_StartDebug.Text = seleEquip.Name + "复位 " + ""; control_StartDebug.Text = seleEquip.Name + "复位 " + "";
} }
else else
{ {
control_StartDebug.Text = seleEquip.Name + "启动调试" + ""; control_StartDebug.Text = seleEquip.Name + "启动调试" + "";
} }
string name = seleEquip.Name + "打开详情"; string name = seleEquip.Name + "打开详情";
if (control_InDetial.Text.Equals(name)) if (control_InDetial.Text.Equals(name))
...@@ -1003,11 +1006,11 @@ namespace OnlineStore.AssemblyLine ...@@ -1003,11 +1006,11 @@ namespace OnlineStore.AssemblyLine
FrmEquipBase frm; FrmEquipBase frm;
if (lineBean.MoveEquipMap.ContainsKey(deviceId)) if (lineBean.MoveEquipMap.ContainsKey(deviceId))
{ {
frm = new FrmMoveEquip(lineBean.MoveEquipMap[deviceId]); frm = new FrmMoveEquip(lineBean.MoveEquipMap[deviceId]);
} }
else if (lineBean.FeedingEquipMap.ContainsKey(deviceId)) else if (lineBean.FeedingEquipMap.ContainsKey(deviceId))
{ {
frm = new FrmFeedingEquip(lineBean.FeedingEquipMap[deviceId]); frm = new FrmFeedingEquip(lineBean.FeedingEquipMap[deviceId]);
} }
else if (lineBean.HYEquipMap.ContainsKey(deviceId)) else if (lineBean.HYEquipMap.ContainsKey(deviceId))
{ {
...@@ -1054,7 +1057,7 @@ namespace OnlineStore.AssemblyLine ...@@ -1054,7 +1057,7 @@ namespace OnlineStore.AssemblyLine
bool result = seleEquip.Reset(); bool result = seleEquip.Reset();
if (!result) if (!result)
{ {
MessageBox.Show("[" + seleEquip.Name + "]复位失败:" + seleEquip.WarnMsg,"错误",MessageBoxButtons.OK,MessageBoxIcon.Error); MessageBox.Show("[" + seleEquip.Name + "]复位失败:" + seleEquip.WarnMsg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
} }
else else
...@@ -1148,7 +1151,7 @@ namespace OnlineStore.AssemblyLine ...@@ -1148,7 +1151,7 @@ namespace OnlineStore.AssemblyLine
} }
#endregion #endregion
private void 自动保存托盘信息ToolStripMenuItem_Click(object sender, EventArgs e) private void 自动保存托盘信息ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
...@@ -1158,7 +1161,7 @@ namespace OnlineStore.AssemblyLine ...@@ -1158,7 +1161,7 @@ namespace OnlineStore.AssemblyLine
} }
bool result = 自动保存托盘信息ToolStripMenuItem.Text.Contains(gouStr); bool result = 自动保存托盘信息ToolStripMenuItem.Text.Contains(gouStr);
if (result.Equals( TrayManager.DisTraySave)) if (result.Equals(TrayManager.DisTraySave))
{ {
return; return;
} }
...@@ -1186,19 +1189,19 @@ namespace OnlineStore.AssemblyLine ...@@ -1186,19 +1189,19 @@ namespace OnlineStore.AssemblyLine
return; return;
} }
LineManager.DisLeftOutLine = chbLeftDis.Checked; LineManager.DisLeftOutLine = chbLeftDis.Checked;
if (LineManager.DisLeftOutLine) if (LineManager.DisLeftOutLine)
{ {
LogUtil.info("界面点击勾选:" + chbLeftDis.Text + "=" + LineManager.DisLeftOutLine+",设置 HY5,HY7,HY10 为调试状态"); LogUtil.info("界面点击勾选:" + chbLeftDis.Text + "=" + LineManager.DisLeftOutLine + ",设置 HY5,HY7,HY10 为调试状态");
} }
else else
{ {
LogUtil.info("界面点击勾选:" + chbLeftDis.Text + "=" + LineManager.DisLeftOutLine); LogUtil.info("界面点击勾选:" + chbLeftDis.Text + "=" + LineManager.DisLeftOutLine);
} }
List<int> leftHYs = new List<int>() { 205, 207, 210 }; List<int> leftHYs = new List<int>() { 205, 207, 210 };
foreach (int id in leftHYs) foreach (int id in leftHYs)
{ {
bool isD = LineManager.DisLeftOutLine ? true: LineManager.Line.HYEquipMap[id].Config.IsDebug.Equals(1); bool isD = LineManager.DisLeftOutLine ? true : LineManager.Line.HYEquipMap[id].Config.IsDebug.Equals(1);
LineManager.Line.HYEquipMap[id].IsDebug = isD; LineManager.Line.HYEquipMap[id].IsDebug = isD;
} }
} }
...@@ -1213,13 +1216,13 @@ namespace OnlineStore.AssemblyLine ...@@ -1213,13 +1216,13 @@ namespace OnlineStore.AssemblyLine
{ {
return; return;
} }
LineManager.DisRightOutLine = chbRightDis.Checked; LineManager.DisRightOutLine = chbRightDis.Checked;
if (LineManager.DisRightOutLine) if (LineManager.DisRightOutLine)
{ {
LogUtil.info("界面点击勾选:" + chbRightDis.Text + "=" + LineManager.DisRightOutLine + ",设置 HY12,HY14,HY17 为调试状态"); LogUtil.info("界面点击勾选:" + chbRightDis.Text + "=" + LineManager.DisRightOutLine + ",设置 HY12,HY14,HY17 为调试状态");
} }
else else
{ {
LogUtil.info("界面点击勾选:" + chbRightDis.Text + "=" + LineManager.DisRightOutLine); LogUtil.info("界面点击勾选:" + chbRightDis.Text + "=" + LineManager.DisRightOutLine);
} }
List<int> rightHYs = new List<int>() { 212, 214, 217 }; List<int> rightHYs = new List<int>() { 212, 214, 217 };
...@@ -1269,7 +1272,7 @@ namespace OnlineStore.AssemblyLine ...@@ -1269,7 +1272,7 @@ namespace OnlineStore.AssemblyLine
} }
LineManager.DisAllHy = chbDisHy.Checked; LineManager.DisAllHy = chbDisHy.Checked;
if (LineManager.DisAllHy) if (LineManager.DisAllHy)
{ {
LogUtil.info("界面点击勾选:" + chbDisHy.Text + "=" + LineManager.DisAllHy + ",设置所有HY为调试状态"); LogUtil.info("界面点击勾选:" + chbDisHy.Text + "=" + LineManager.DisAllHy + ",设置所有HY为调试状态");
} }
else else
...@@ -1290,10 +1293,10 @@ namespace OnlineStore.AssemblyLine ...@@ -1290,10 +1293,10 @@ namespace OnlineStore.AssemblyLine
codeCount = 3, codeCount = 3,
timeout = 3000 timeout = 3000
}; };
Bitmap bitmap = new Bitmap("test.bmp"); Bitmap bitmap = new Bitmap("test.bmp");
List<CodeInfo> LastCodeList = RemoteDecodeHelper.DecodeRequest(bitmap, remoteDecodeParam); List<CodeInfo> LastCodeList = RemoteDecodeHelper.DecodeRequest(bitmap, remoteDecodeParam);
List<string> test = new List<string>(); List<string> test = new List<string>();
foreach(CodeInfo codeInfo in LastCodeList) foreach (CodeInfo codeInfo in LastCodeList)
{ {
test.Add(codeInfo.CodeStr); test.Add(codeInfo.CodeStr);
} }
...@@ -1340,8 +1343,8 @@ namespace OnlineStore.AssemblyLine ...@@ -1340,8 +1343,8 @@ namespace OnlineStore.AssemblyLine
{ {
return; return;
} }
LineManager.TrayToOutLineTest = chbTrayTest.Checked; LineManager.TrayToOutLineTest = chbTrayTest.Checked;
LogUtil.info("界面点击勾选:" + chbTrayTest.Text + "=" + LineManager.TrayToOutLineTest); LogUtil.info("界面点击勾选:" + chbTrayTest.Text + "=" + LineManager.TrayToOutLineTest);
} }
private void chbDisGetWare_CheckedChanged(object sender, EventArgs e) private void chbDisGetWare_CheckedChanged(object sender, EventArgs e)
......
...@@ -44,7 +44,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -44,7 +44,7 @@ namespace OnlineStore.DeviceLibrary
StopMove(); StopMove();
runStatus = LineRunStatus.Reset; runStatus = LineRunStatus.Reset;
MoveInfo.NewMove(LineMoveType.Reset); MoveInfo.NewMove(LineMoveType.Reset);
StartReset(); StartReset();
return true; return true;
} }
...@@ -123,7 +123,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -123,7 +123,7 @@ namespace OnlineStore.DeviceLibrary
{ {
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW); IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
IOMove(IO_Type.HY_StopDown, IO_VALUE.LOW); IOMove(IO_Type.HY_StopDown, IO_VALUE.LOW);
} }
//CylinderMove(null, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down); //CylinderMove(null, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
//HY_StopCylinderDown(null); //HY_StopCylinderDown(null);
//LocationCylinderDown(null); //LocationCylinderDown(null);
...@@ -178,7 +178,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -178,7 +178,7 @@ namespace OnlineStore.DeviceLibrary
{ {
FixtureProcess(); FixtureProcess();
} }
} }
HY22Process(); HY22Process();
} }
} }
...@@ -191,7 +191,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -191,7 +191,7 @@ namespace OnlineStore.DeviceLibrary
private Stopwatch hy22CheckWait = new Stopwatch(); private Stopwatch hy22CheckWait = new Stopwatch();
private object lockObj = ""; private object lockObj = "";
private bool preTrayIsC1Line = false; private bool preTrayIsC1Line = false;
private bool currIsOutLineTray = false; private bool currIsOutLineTray = false;
...@@ -229,53 +229,53 @@ namespace OnlineStore.DeviceLibrary ...@@ -229,53 +229,53 @@ namespace OnlineStore.DeviceLibrary
{ {
//if (Monitor.TryEnter(lockObj, TrayManager.mTimeOut)) //if (Monitor.TryEnter(lockObj, TrayManager.mTimeOut))
//{ //{
try try
{
if (MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{ {
if (MoveInfo.MoveType.Equals(LineMoveType.None).Equals(false)) LogUtil.error(Name + " CheckFixture " + " 不在空闲中,直接返回 ");
return;
}
if (MoveInfo.MoveType.Equals(LineMoveType.None))
{
if (IOValue(IO_Type.HY_TrayCheck).Equals(IO_VALUE.HIGH))
{ {
LogUtil.error(Name + " CheckFixture " + " 不在空闲中,直接返回 "); if (CheckStopWatch(trayCheckWait, TrayWaitTime, true))
return; {
TrayStart_HY03_FrontStopUp();
}
} }
if (MoveInfo.MoveType.Equals(LineMoveType.None)) else
{ {
if (IOValue(IO_Type.HY_TrayCheck).Equals(IO_VALUE.HIGH)) bool check2IsOk = CheckStopWatch(trayCheckLowWait, TrayWaitTime, false) || String.IsNullOrEmpty(RFIDIP);
bool isHY11 = DeviceID.Equals(211);//HY11优先处理C5出来的托盘
isHY11 = false;
if ((preTrayIsC1Line || isHY11) && Config.IsOutLineOut && IOValue(IO_Type.HY_OL_Tray_Check).Equals(IO_VALUE.HIGH))
{ {
if (CheckStopWatch(trayCheckWait, TrayWaitTime, true)) StopDownCount = 0;
{ //C1线和出料线交替处理
TrayStart_HY03_FrontStopUp(); HY71_OL_Wait();
}
} }
else else if (Config.DIList.ContainsKey(IO_Type.HY_FrontStopCheck) && IOValue(IO_Type.HY_FrontStopCheck).Equals(IO_VALUE.HIGH))
{ {
bool check2IsOk = CheckStopWatch(trayCheckLowWait, TrayWaitTime, false)||String.IsNullOrEmpty(RFIDIP); if (CheckStopWatch(frontTrayCheckWait, TrayWaitTime, false) && check2IsOk)
bool isHY11 = DeviceID.Equals(211);//HY11优先处理C5出来的托盘
isHY11 = false;
if ((preTrayIsC1Line||isHY11) && Config.IsOutLineOut && IOValue(IO_Type.HY_OL_Tray_Check).Equals(IO_VALUE.HIGH))
{
StopDownCount = 0;
//C1线和出料线交替处理
HY71_OL_Wait();
}
else if (Config.DIList.ContainsKey(IO_Type.HY_FrontStopCheck) && IOValue(IO_Type.HY_FrontStopCheck).Equals(IO_VALUE.HIGH))
{
if (CheckStopWatch(frontTrayCheckWait, TrayWaitTime, false) && check2IsOk)
{
TrayStart_HY02_FrontStopDown();
}
}
else if (Config.IsOutLineOut && IOValue(IO_Type.HY_OL_Tray_Check).Equals(IO_VALUE.HIGH))
{ {
HY71_OL_Wait(); TrayStart_HY02_FrontStopDown();
} }
} }
else if (Config.IsOutLineOut && IOValue(IO_Type.HY_OL_Tray_Check).Equals(IO_VALUE.HIGH))
{
HY71_OL_Wait();
}
} }
} }
catch (Exception ex) }
{ catch (Exception ex)
LogUtil.error(Name + " CheckFixture " + " 出错:" + ex.ToString()); {
} LogUtil.error(Name + " CheckFixture " + " 出错:" + ex.ToString());
}
// finally // finally
// { // {
// Monitor.Exit(lockObj); // Monitor.Exit(lockObj);
...@@ -286,13 +286,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -286,13 +286,13 @@ namespace OnlineStore.DeviceLibrary
// LogUtil.error(Name + " CheckFixture " + "失败,未得到锁"); // LogUtil.error(Name + " CheckFixture " + "失败,未得到锁");
//} //}
} }
private bool IsHY11() private bool IsHY11()
{ {
if ( DeviceID.Equals(211)) if (DeviceID.Equals(211))
{ {
return true ; return true;
} }
return false; return false;
} }
...@@ -325,7 +325,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -325,7 +325,7 @@ namespace OnlineStore.DeviceLibrary
{ {
SecondMoveInfo.NewMove(LineMoveType.Fixture); SecondMoveInfo.NewMove(LineMoveType.Fixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.HY02_FrontStopDown); SecondMoveInfo.NextMoveStep(LineMoveStep.HY02_FrontStopDown);
LogUtil.info(Name + " HY22_FTrayCheck 检测到托盘,开始下降阻挡 HY22_FStopDown,等待检测到 HY22_TrayCheck=HIGH"); LogUtil.info(Name + " HY22_FTrayCheck 检测到托盘,开始下降阻挡 HY22_FStopDown,等待检测到 HY22_TrayCheck=HIGH");
IOMove(IO_Type.HY22_FStopDown, IO_VALUE.HIGH, TrayManager.StopDTime); IOMove(IO_Type.HY22_FStopDown, IO_VALUE.HIGH, TrayManager.StopDTime);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY22_TrayCheck, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY22_TrayCheck, IO_VALUE.HIGH));
...@@ -338,9 +338,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -338,9 +338,9 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
SMoveProcess(); SMoveProcess();
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -348,7 +348,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -348,7 +348,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private void SMoveProcess() private void SMoveProcess()
{ {
if (SecondMoveInfo.IsInWait) if (SecondMoveInfo.IsInWait)
{ {
...@@ -371,7 +371,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -371,7 +371,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.OneWaitCanEndStep = true; SecondMoveInfo.OneWaitCanEndStep = true;
break; break;
case LineMoveStep.HY05_TrayCheck: case LineMoveStep.HY05_TrayCheck:
SecondMoveInfo.EndMove(); SecondMoveInfo.EndMove();
break; break;
...@@ -379,16 +379,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -379,16 +379,16 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private bool HY22StopDownCanMove() private bool HY22StopDownCanMove()
{ {
if (!IsHY11()) if (!IsHY11())
{ {
return false ; return false;
} }
if (IOValue(IO_Type.HY22_FStopDown).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.HY22_FStopDown).Equals(IO_VALUE.HIGH))
{ {
hy22CheckWait.Stop(); hy22CheckWait.Stop();
return false; return false;
} }
if (!SecondMoveInfo.MoveType.Equals(LineMoveType.None)) if (!SecondMoveInfo.MoveType.Equals(LineMoveType.None))
...@@ -432,9 +432,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -432,9 +432,9 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_FrontStopCheck, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_FrontStopCheck, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.HIGH));
CylinderMove(null, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down); CylinderMove(null, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.LOW); IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.LOW);
MoveInfo.OneWaitCanEndStep = true; MoveInfo.OneWaitCanEndStep = true;
if ( IOValue(IO_Type.HY_FrontStopDown).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.HY_FrontStopDown).Equals(IO_VALUE.LOW))
{ {
LogInfo(" 托盘检测:" + MoveInfo.SLog + ",重新写前阻挡下降"); LogInfo(" 托盘检测:" + MoveInfo.SLog + ",重新写前阻挡下降");
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.HIGH); IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.HIGH);
...@@ -443,7 +443,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -443,7 +443,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + mName + " 出错:" + ex.ToString()); LogUtil.error(Name + mName + " 出错:" + ex.ToString());
} }
finally finally
{ {
...@@ -453,7 +453,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -453,7 +453,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
LogUtil.error(Name + mName + "失败,未得到锁"); LogUtil.error(Name + mName + "失败,未得到锁");
} }
} }
private void TrayStart_HY03_FrontStopUp() private void TrayStart_HY03_FrontStopUp()
...@@ -536,7 +536,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -536,7 +536,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.LOW); IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_OL_Tray_Check, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_OL_Tray_Check, IO_VALUE.HIGH));
if (IsHY11()) if (IsHY11())
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY22_FStopDown, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY22_FStopDown, IO_VALUE.LOW));
} }
} }
...@@ -556,7 +556,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -556,7 +556,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + " HY71_OL_Wait " + "失败,未得到锁"); LogUtil.error(Name + " HY71_OL_Wait " + "失败,未得到锁");
} }
} }
internal void HY03_FrontStopUp(int timeout= 20000,bool frontStopUp=true) internal void HY03_FrontStopUp(int timeout = 20000, bool frontStopUp = true)
{ {
frontTrayCheckWait.Stop(); frontTrayCheckWait.Stop();
trayCheckLowWait.Stop(); trayCheckLowWait.Stop();
...@@ -569,22 +569,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -569,22 +569,22 @@ namespace OnlineStore.DeviceLibrary
CheckAndMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW); CheckAndMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
} }
else else
{ {
CheckLog("托盘阻挡" + MoveInfo.SLog + " 前阻挡检测信号灭,等待托盘检测信号"); CheckLog("托盘阻挡" + MoveInfo.SLog + " 前阻挡检测信号灭,等待托盘检测信号");
} }
MoveInfo.OneWaitCanEndStep = true; MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(timeout)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(timeout));
} }
private int StopDownCount = 0; private int StopDownCount = 0;
private void EndOrReStopDown(string msg ) private void EndOrReStopDown(string msg)
{ {
if (StopDownCount == 0) if (StopDownCount == 0)
{ {
LogInfo(MoveInfo.SLog + msg + ",暂不结束,重新下降一次前阻挡"); LogInfo(MoveInfo.SLog + msg + ",暂不结束,重新下降一次前阻挡");
//阻挡重新下降一次 //阻挡重新下降一次
StopDownCount++; StopDownCount++;
MoveInfo.NextMoveStep(LineMoveStep.HY02_FrontStopDown); MoveInfo.NextMoveStep(LineMoveStep.HY02_FrontStopDown);
if (DeviceID.Equals(219)) if (DeviceID.Equals(219))
{ {
...@@ -604,7 +604,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -604,7 +604,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.LOW); IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.LOW);
} }
else else
{ {
LogInfo(MoveInfo.SLog + msg); LogInfo(MoveInfo.SLog + msg);
MoveEndS(); MoveEndS();
} }
...@@ -1000,9 +1000,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -1000,9 +1000,9 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.LOW); IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.LOW);
if (IsHY11()) if (IsHY11())
{ {
IOMove(IO_Type.HY22_FStopDown, IO_VALUE.LOW); IOMove(IO_Type.HY22_FStopDown, IO_VALUE.LOW);
} }
} }
else if (MoveInfo.IsStep(LineMoveStep.HY72_OL_AllStopUp)) else if (MoveInfo.IsStep(LineMoveStep.HY72_OL_AllStopUp))
{ {
...@@ -1015,14 +1015,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -1015,14 +1015,15 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
MoveInfo.NextMoveStep(LineMoveStep.HY73_OL_TopUp); MoveInfo.NextMoveStep(LineMoveStep.HY73_OL_TopUp);
CheckLog("托盘阻挡" + MoveInfo.SLog + " 开始横移,顶升上升,出料线阻挡气缸下降,横移阻挡气缸上升"); CheckLog("托盘阻挡" + MoveInfo.SLog + " 开始横移,顶升上升,出料线阻挡气缸下降,横移阻挡气缸上升");
CylinderMove(MoveInfo, IO_Type.HY_TopCylinder_Down, IO_Type.HY_TopCylinder_Up); CylinderMove(MoveInfo, IO_Type.HY_TopCylinder_Down, IO_Type.HY_TopCylinder_Up);
OL_StopCylinderDown(MoveInfo); OL_StopCylinderDown(MoveInfo);
HY_StopCylinderUp(MoveInfo); HY_StopCylinderUp(MoveInfo);
} }
}else if (MoveInfo.IsStep(LineMoveStep.HY72_OL_WaitHY22)) }
else if (MoveInfo.IsStep(LineMoveStep.HY72_OL_WaitHY22))
{ {
MoveInfo.NextMoveStep(LineMoveStep.HY73_OL_TopUp); MoveInfo.NextMoveStep(LineMoveStep.HY73_OL_TopUp);
CheckLog("托盘阻挡" + MoveInfo.SLog + " 开始横移,顶升上升,出料线阻挡气缸下降,横移阻挡气缸上升"); CheckLog("托盘阻挡" + MoveInfo.SLog + " 开始横移,顶升上升,出料线阻挡气缸下降,横移阻挡气缸上升");
...@@ -1043,11 +1044,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -1043,11 +1044,16 @@ namespace OnlineStore.DeviceLibrary
CheckLog("托盘阻挡" + MoveInfo.SLog + " 等待出料线托盘检测无信号"); CheckLog("托盘阻挡" + MoveInfo.SLog + " 等待出料线托盘检测无信号");
IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.HIGH, 1200); IOMove(IO_Type.HY_OL_StopDown, IO_VALUE.HIGH, 1200);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_OL_Tray_Check, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_OL_Tray_Check, IO_VALUE.LOW));
if (DeviceID.Equals(211) && Config.DIList.ContainsKey(IO_Type.HY22_TrayCheck))
{
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY22_TrayCheck, IO_VALUE.HIGH));
MoveInfo.OneWaitCanEndStep = true;
}
} }
else if (MoveInfo.IsStep(LineMoveStep.HY75_OL_StopDown)) else if (MoveInfo.IsStep(LineMoveStep.HY75_OL_StopDown))
{ {
MoveInfo.NextMoveStep(LineMoveStep.HY76_OL_WaitTray); MoveInfo.NextMoveStep(LineMoveStep.HY76_OL_WaitTray);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_OL_Tray_Check, IO_VALUE.LOW)); // MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_OL_Tray_Check, IO_VALUE.LOW));
if (DeviceID.Equals(211) && Config.DIList.ContainsKey(IO_Type.HY22_TrayCheck)) if (DeviceID.Equals(211) && Config.DIList.ContainsKey(IO_Type.HY22_TrayCheck))
{ {
...@@ -1185,7 +1191,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1185,7 +1191,7 @@ namespace OnlineStore.DeviceLibrary
private int hyIndex = 0; private int hyIndex = 0;
private void HY11_TopUpToHY() private void HY11_TopUpToHY()
{ {
HY_C1Line hyout =(HY_C1Line) GetHyOutEquip(); HY_C1Line hyout = (HY_C1Line)GetHyOutEquip();
if (hyout.HYOut51_WaitFree()) if (hyout.HYOut51_WaitFree())
{ {
MoveInfo.NextMoveStep(LineMoveStep.HY13_WaitHY2Ready); MoveInfo.NextMoveStep(LineMoveStep.HY13_WaitHY2Ready);
...@@ -1218,7 +1224,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1218,7 +1224,7 @@ namespace OnlineStore.DeviceLibrary
if (Config.IsSideWayIn && trayNum > 0) if (Config.IsSideWayIn && trayNum > 0)
{ {
//出口启动才能横移 //出口启动才能横移
HYEquipBase hyE= GetHyOutEquip(); HYEquipBase hyE = GetHyOutEquip();
if (hyE == null || hyE.runStatus <= LineRunStatus.Wait) if (hyE == null || hyE.runStatus <= LineRunStatus.Wait)
{ {
return false; return false;
...@@ -1270,14 +1276,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -1270,14 +1276,14 @@ namespace OnlineStore.DeviceLibrary
{ {
//非 1,2,3,4,5,13,14,15,16的入库料需要横移 //非 1,2,3,4,5,13,14,15,16的入库料需要横移
if (tray.IsFull) if (tray.IsFull)
{ {
//NG料需要横移 //NG料需要横移
if (tray.InoutPar.IsNG) if (tray.InoutPar.IsNG)
{ {
return true; return true;
} }
if (tray.InOrOutStore.Equals(1)) if (tray.InOrOutStore.Equals(1))
{ {
int storeId = tray.InoutPar.GetStoreId(); int storeId = tray.InoutPar.GetStoreId();
List<int> instoreId = new List<int> { 1, 2, 3, 4, 5, 13, 14, 15, 16 }; List<int> instoreId = new List<int> { 1, 2, 3, 4, 5, 13, 14, 15, 16 };
if (!instoreId.Contains(storeId)) if (!instoreId.Contains(storeId))
...@@ -1318,7 +1324,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1318,7 +1324,7 @@ namespace OnlineStore.DeviceLibrary
MoveEquip move14 = LineManager.Line.MoveEquipMap[14]; MoveEquip move14 = LineManager.Line.MoveEquipMap[14];
MoveEquip move15 = LineManager.Line.MoveEquipMap[15]; MoveEquip move15 = LineManager.Line.MoveEquipMap[15];
MoveEquip move16 = LineManager.Line.MoveEquipMap[16]; MoveEquip move16 = LineManager.Line.MoveEquipMap[16];
if (move14.hasTray()&& move15.hasTray() && move16.hasTray()) if (move14.hasTray() && move15.hasTray() && move16.hasTray())
{ {
return true; return true;
} }
...@@ -1343,7 +1349,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1343,7 +1349,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return false; return false;
} }
if (tray.InoutPar.cutReel ) if (tray.InoutPar.cutReel)
{ {
if (preToOut4) if (preToOut4)
...@@ -1408,11 +1414,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -1408,11 +1414,11 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
//如果横移20和横移21都有托盘, ,空托盘需要横移,不需要判断是否都在 顶升 //如果横移20和横移21都有托盘, ,空托盘需要横移,不需要判断是否都在 顶升
if (IOManager.IOValue(IO_Type.HY_TrayCheck, 220).Equals(IO_VALUE.HIGH) if (IOManager.IOValue(IO_Type.HY_TrayCheck, 220).Equals(IO_VALUE.HIGH)
&& IOManager.IOValue(IO_Type.HY_TrayCheck, 221).Equals(IO_VALUE.HIGH) ) && IOManager.IOValue(IO_Type.HY_TrayCheck, 221).Equals(IO_VALUE.HIGH))
// if (IOManager.IOValue(IO_Type.HY_TrayCheck, 220).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.HY_TopCylinder_Up, 220).Equals(IO_VALUE.HIGH) // if (IOManager.IOValue(IO_Type.HY_TrayCheck, 220).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.HY_TopCylinder_Up, 220).Equals(IO_VALUE.HIGH)
//&& IOManager.IOValue(IO_Type.HY_TrayCheck, 221).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.HY_TopCylinder_Up, 221).Equals(IO_VALUE.HIGH)) //&& IOManager.IOValue(IO_Type.HY_TrayCheck, 221).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.HY_TopCylinder_Up, 221).Equals(IO_VALUE.HIGH))
{ {
return true; return true;
} }
...@@ -1427,12 +1433,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -1427,12 +1433,12 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name+"TrayNeed 出错:" + ex.ToString()); LogUtil.error(Name + "TrayNeed 出错:" + ex.ToString());
} }
return false; return false;
} }
private int pandianliao = 0; private int pandianliao = 0;
private int PreIsToOutCount = 0; private int PreIsToOutCount = 0;
private bool TrayNeedToOutLine(int trayNum) private bool TrayNeedToOutLine(int trayNum)
{ {
try try
...@@ -1485,7 +1491,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1485,7 +1491,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.MoveParam = param; MoveInfo.MoveParam = param;
return true; return true;
} }
else if (trayInfo.InOrOutStore.Equals(ReelType.OutStore) && param.cutReel && this.DeviceID.Equals(216)) else if (trayInfo.InOrOutStore.Equals(ReelType.OutStore) && param.cutReel && this.DeviceID.Equals(216))
{ {
string lName = param.urgentReel ? "紧急料" : "盘点料"; string lName = param.urgentReel ? "紧急料" : "盘点料";
...@@ -1632,7 +1638,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1632,7 +1638,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (HY12NoTray()) if (HY12NoTray())
{ {
LogInfo(" C1->出料线:工单料,HY12空闲10秒" + LastValue + "," + "" + param.ToStr()); LogInfo(" C1->出料线:工单料,HY12空闲10秒" + LastValue + "," + "" + param.ToStr());
MoveInfo.MoveParam = param; MoveInfo.MoveParam = param;
return true; return true;
} }
...@@ -1665,7 +1671,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1665,7 +1671,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name+"TrayNeedToOutLine 出错:" + ex.ToString()); LogUtil.error(Name + "TrayNeedToOutLine 出错:" + ex.ToString());
} }
return false; return false;
} }
...@@ -1725,7 +1731,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1725,7 +1731,7 @@ namespace OnlineStore.DeviceLibrary
if (Monitor.TryEnter(lockObj, TrayManager.mTimeOut)) if (Monitor.TryEnter(lockObj, TrayManager.mTimeOut))
{ {
try try
{ {
if (runStatus > LineRunStatus.Wait && MoveInfo.MoveType.Equals(LineMoveType.None)) if (runStatus > LineRunStatus.Wait && MoveInfo.MoveType.Equals(LineMoveType.None))
{ {
LogUtil.debug("进仓05托盘离开," + Name + "开始等待托盘检测信号 HY03_FrontStopUp"); LogUtil.debug("进仓05托盘离开," + Name + "开始等待托盘检测信号 HY03_FrontStopUp");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!