Commit 4f9a19c2 LN

增加托盘编辑功能

1 个父辈 003634a7
......@@ -118,9 +118,17 @@ namespace OnlineStore.AssemblyLine
LoadListView();
托盘初始化ToolStripMenuItem.Visible = ConfigAppSettings.GetIntValue(Setting_Init.OpenRFIDWrite).Equals(1);
cmbTray.Items.Clear();
for(int i = 1; i <= 30; i++)
{
cmbTray.Items.Add(i.ToString());
}
cmbTrayType.SelectedIndex = 0;
cmbTray.SelectedIndex = 0;
LoadOk = true;
HideForm();
timer1.Start();
}
private void LoadListView()
......@@ -248,21 +256,35 @@ namespace OnlineStore.AssemblyLine
DialogResult result = MessageBox.Show("是否确定退出流水线客户端?", "提示", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes))
{
//如果料仓还在运行状态,先关闭料仓
if (!lineBean.runStatus.Equals(LineRunStatus.Wait))
try
{
LogUtil.info(LOGGER, "退出程序之前先停止运行 ");
lineBean.StopRun();
//如果料仓还在运行状态,先关闭料仓
if (!lineBean.runStatus.Equals(LineRunStatus.Wait))
{
LogUtil.info(LOGGER, "即将退出程序,停止" + lineBean.Name + "运行 ");
lineBean.StopRun();
}
foreach (EquipBase equip in lineBean.AllEquipMap.Values)
{
if (equip.runStatus > LineRunStatus.Wait)
{
LogUtil.info(LOGGER, "即将退出程序,停止" + equip.Name + "运行 ");
equip.StopRun();
}
}
// IOManager.instance.CloseAllDO();
IOManager.instance.CloseAllConnection();
//AIManager.CloseConnect();
ACServerManager.CloseAllPort();
// CodeManager.CloseAllCamera();
RFIDManager.RfidReader.Close();
System.Environment.Exit(System.Environment.ExitCode);
}
catch(Exception ex)
{
LogUtil.error("退出出错:" + ex.ToString());
}
// IOManager.instance.CloseAllDO();
IOManager.instance.CloseAllConnection();
//AIManager.CloseConnect();
ACServerManager.CloseAllPort();
// CodeManager.CloseAllCamera();
RFIDManager.RfidReader.Close();
//this.Close();
System.Environment.Exit(System.Environment.ExitCode);
}
}
private void 显示ToolStripMenuItem_Click(object sender, EventArgs e)
......@@ -734,14 +756,48 @@ namespace OnlineStore.AssemblyLine
private void btnClearTray_Click(object sender, EventArgs e)
{
List<TrayInfo> tray = TrayManager.getTrayList();
LogUtil.info("-------------------点击:清空托盘。清空前打印托盘信息:");
foreach (TrayInfo t in tray)
DialogResult resut = MessageBox.Show("确定手动清空所有托盘信息?", "提示", MessageBoxButtons.YesNo);
if (resut.Equals(DialogResult.Yes))
{
LogUtil.info(t.ToStr());
List<TrayInfo> tray = TrayManager.getTrayList();
LogUtil.info("-------------------点击:清空托盘。清空前打印托盘信息:");
foreach (TrayInfo t in tray)
{
LogUtil.info(t.ToStr());
}
TrayManager.ClearTrayInfo();
LogUtil.info("-------------------点击:清空托盘。托盘内容已清空");
}
}
private void btnUpdateTray_Click(object sender, EventArgs e)
{
int num = cmbTray.SelectedIndex + 1;
DialogResult resut = MessageBox.Show("确定手动更新托盘【"+num+"】的信息?", "提示", MessageBoxButtons.YesNo);
if (resut.Equals(DialogResult.Yes))
{
int trayType = cmbTrayType.SelectedIndex;
string posId = txtTrayPosid.Text;
int ph = FormUtil.GetIntValue(txtTrayH);
int pw = FormUtil.GetIntValue(txtTrayW);
bool hasTray = trayType > 0;
bool inNg = chbInStoNG.Checked;
if (hasTray)
{
TrayManager.UpdateTrayInfo(num, hasTray, trayType, "CodeTest", posId, ph, pw);
}
else
{
TrayManager.UpdateTrayInfo(num, hasTray);
}
if (trayType.Equals(1) && inNg)
{
TrayManager.UpdateInStoreNG(num, inNg, "InStoreNG ");
}
TrayInfo info = TrayManager.GetTrayInfo(num);
MessageBox.Show("更新成功:\r" + info.ToStr());
LogUtil.info("手动更新托盘信息:" + info.ToStr());
}
TrayManager.ClearTrayInfo();
LogUtil.info("-------------------点击:清空托盘。托盘内容已清空");
}
}
}
......@@ -969,15 +969,16 @@ namespace OnlineStore.DeviceLibrary
//是出料的模块
if (Config.IsCanOut.Equals(1))
{
//此托盘是紧急出料盘,需要通过料架出库
bool debugNeed = (runStatus >= LineRunStatus.Runing)&&info.IsFull&&info.InOrOutStore.Equals(2);
//此托盘是紧急出料盘,需要通过料架出库
bool debugNeed = (runStatus >= LineRunStatus.Runing) && info.IsFull && info.InOrOutStore.Equals(2);
if (info.PosId.Equals(""))
{
param = new InOutParam(trayNum, "紧急出料测试", "1#AC1_3_2", 12, 7);
}
bool isJinji = info.EmergencyOut && info.IsFull && runStatus >= LineRunStatus.Runing;
if (debugNeed || isJinji)
//入料失败的盘也从此处出库
bool instoeEnd = (runStatus >= LineRunStatus.Runing) && info.IsFull && info.InStoreNG;
if (debugNeed || isJinji || instoeEnd)
{
//判断是否有料架,是否可以出库
......
......@@ -67,7 +67,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
internal static TrayInfo GetTrayInfo(int trayNum)
public static TrayInfo GetTrayInfo(int trayNum)
{
if (TrayInfoMap.ContainsKey(trayNum))
{
......@@ -79,7 +79,7 @@ namespace OnlineStore.DeviceLibrary
}
internal static void UpdateTrayInfo(int trayNum, bool isFull = false, int inOrOut = 0, string wareCode = "", string posId = "", int plateH = 0, int plateW = 0)
public static void UpdateTrayInfo(int trayNum, bool isFull = false, int inOrOut = 0, string wareCode = "", string posId = "", int plateH = 0, int plateW = 0)
{
if (TrayInfoMap.ContainsKey(trayNum))
{
......@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary
}
}
internal static void UpdateInStoreNG(int trayNum, bool isNg, string msg)
public static void UpdateInStoreNG(int trayNum, bool isNg, string msg)
{
LogUtil.info("更新托盘【" + trayNum + "】InStoreNG=【" + isNg + "】NgMsg=【" + msg + "】");
if (TrayInfoMap.ContainsKey(trayNum))
......
......@@ -41,10 +41,10 @@ namespace OnlineStore.DeviceLibrary
{
type = "出库";
}
string err =InStoreNG? "入库失败:"+NgMsg:"";
string jinji = EmergencyOut ? "紧急出料" : "";
return "托盘[" + TrayCode + "][" + (IsFull ? "有料," : "空,") +"]["+ type +
"]二维码[" + WareCode + "]库位号[" + PosId + "]盘高[" + PlateH + "]盘宽[" + PlateW + "] [" + err + "] ["+ jinji + "]" ;
string err =InStoreNG? "[入库失败:"+NgMsg+"]":"";
string jinji = EmergencyOut ? "[紧急出料]" : "";
return "托盘 [" + TrayCode + "] [" + (IsFull ? "有料" : "空") +"] ["+ type +
"]二维码[" + WareCode + "]库位号[" + PosId + "] [" + PlateW + "X" + PlateH+ "] " + err + " "+ jinji + "" ;
}
/// <summary>
/// 夹具编码值(1-32?)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!