Commit 7f829544 LN

灯状态修改

1 个父辈 8a4f38b7
......@@ -57,6 +57,7 @@
<add key ="NeedScanCode" value ="1"/>
<add key ="Agv_Log_Open" value ="0"/>
<add key ="MaxTrayNum" value ="30"/>
<add key ="UseBuzzer" value ="0"/>
</appSettings>
<!-- <log4net> -->
<!-- <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> -->
......
......@@ -99,6 +99,7 @@
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.chbBuzzer = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -308,6 +309,7 @@
//
// groupBox2
//
this.groupBox2.Controls.Add(this.chbBuzzer);
this.groupBox2.Controls.Add(this.btnTrayInfo);
this.groupBox2.Controls.Add(this.chbAutoRun);
this.groupBox2.Controls.Add(this.chkDebug);
......@@ -347,7 +349,7 @@
//
this.chkDebug.AutoSize = true;
this.chkDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkDebug.Location = new System.Drawing.Point(211, 25);
this.chkDebug.Location = new System.Drawing.Point(158, 25);
this.chkDebug.Name = "chkDebug";
this.chkDebug.Size = new System.Drawing.Size(72, 24);
this.chkDebug.TabIndex = 194;
......@@ -764,6 +766,18 @@
this.timer1.Interval = 2000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// chbBuzzer
//
this.chbBuzzer.AutoSize = true;
this.chbBuzzer.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbBuzzer.Location = new System.Drawing.Point(244, 25);
this.chbBuzzer.Name = "chbBuzzer";
this.chbBuzzer.Size = new System.Drawing.Size(98, 24);
this.chbBuzzer.TabIndex = 196;
this.chbBuzzer.Text = "启用蜂鸣器";
this.chbBuzzer.UseVisualStyleBackColor = true;
this.chbBuzzer.CheckedChanged += new System.EventHandler(this.chbBuzzer_CheckedChanged);
//
// FrmLineStore
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -872,6 +886,7 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
private System.Windows.Forms.CheckBox chbAGV;
private System.Windows.Forms.CheckBox chbBuzzer;
}
}
......@@ -58,7 +58,7 @@ namespace OnlineStore.AssemblyLine
{
FeedingEquip feed = feeds[i];
FrmFeedingEquip test = new FrmFeedingEquip(feed);
AddForm(" " + feed.Name+ " ", test);
AddForm(" " + feed.Name + " ", test);
}
List<ProvidingEquip> provids = new List<ProvidingEquip>(lineBean.ProvidingEquipMap.Values);
for (int i = 0; i < provids.Count; i++)
......@@ -69,7 +69,7 @@ namespace OnlineStore.AssemblyLine
}
List<DischargeLine> diss = new List<DischargeLine>(lineBean.DisLineMap.Values);
for(int i = 0; i < diss.Count; i++)
for (int i = 0; i < diss.Count; i++)
{
DischargeLine line = diss[i];
FrmDischargeLine frm = new FrmDischargeLine(line);
......@@ -120,7 +120,7 @@ namespace OnlineStore.AssemblyLine
托盘初始化ToolStripMenuItem.Visible = ConfigAppSettings.GetIntValue(Setting_Init.OpenRFIDWrite).Equals(1);
cmbTray.Items.Clear();
for(int i = 1; i <= 30; i++)
for (int i = 1; i <= 30; i++)
{
cmbTray.Items.Add(i.ToString());
}
......@@ -202,7 +202,7 @@ namespace OnlineStore.AssemblyLine
this.listView1.Items.Add(lvi);
}
cmbBoxIndex.Items.Clear();
foreach(int key in lineBean.MoveEquipMap.Keys)
foreach (int key in lineBean.MoveEquipMap.Keys)
{
cmbBoxIndex.Items.Add("BOX-" + key);
......@@ -286,7 +286,7 @@ namespace OnlineStore.AssemblyLine
}
catch (Exception ex)
{
LogUtil.error("退出出错:" ,ex);
LogUtil.error("退出出错:", ex);
}
//this.Close();
}
......@@ -311,7 +311,7 @@ namespace OnlineStore.AssemblyLine
}
catch (Exception ex)
{
LogUtil.error("显示界面出错:" ,ex);
LogUtil.error("显示界面出错:", ex);
}
}
......@@ -447,7 +447,7 @@ namespace OnlineStore.AssemblyLine
{
if (process.ProcessName.EndsWith("AssemblyLine"))
{
sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存大小:{1}M ", process.ProcessName, process.PrivateMemorySize64 / 1024/1024F);
sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存大小:{1}M ", process.ProcessName, process.PrivateMemorySize64 / 1024 / 1024F);
totalMemery += process.PrivateMemorySize64 / 1024;
// string result = string.Format("进程总数 {0} 个,共占内存:{1}MB \n", processes.Length, totalMemery / 1024) + sbResult.ToString();
LogUtil.info(sbResult.ToString());
......@@ -455,7 +455,8 @@ namespace OnlineStore.AssemblyLine
}
}
}catch(Exception ex)
}
catch (Exception ex)
{
LogUtil.error("LogM Error: ", ex);
}
......@@ -472,13 +473,13 @@ namespace OnlineStore.AssemblyLine
//{
// //canScanCode = lineBean.CanScanCode() ? "(可扫码入库)" : "(出库未完成,不可扫码入库)";
//}
lblStatus.Text = KTK_Store.GetRunStr(lineBean.lineStatus, lineBean.runStatus)+canScanCode;
string warnMsg= LineManager.Line.WarnMsg.Equals("")?"":LineManager.Line.WarnMsg+"\r\n";
lblStatus.Text = KTK_Store.GetRunStr(lineBean.lineStatus, lineBean.runStatus) + canScanCode;
string warnMsg = LineManager.Line.WarnMsg.Equals("") ? "" : LineManager.Line.WarnMsg + "\r\n";
lblMoveInfo.Text = LineManager.Line.GetMoveStr();
if (TrayManager.TrayErrorMsg.Equals("").Equals(false))
{
warnMsg+= TrayManager.TrayErrorMsg + "\r\n";
warnMsg += TrayManager.TrayErrorMsg + "\r\n";
}
foreach (EquipBase move in lineBean.AllEquipMap.Values)
......@@ -498,7 +499,7 @@ namespace OnlineStore.AssemblyLine
int item_cid_index = 4;
int item_SAlarmType_index = 5;
int item_LastMsgTime_index = 6;
int item_BoxStr_index =7;
int item_BoxStr_index = 7;
foreach (MoveEquip move in lineBean.MoveEquipMap.Values)
{
ListViewItem lvi = new ListViewItem();
......@@ -514,7 +515,7 @@ namespace OnlineStore.AssemblyLine
SetItemText(i, item_LastMsgTime_index, box.LastMsgTime.ToLongTimeString());
SetItemText(i, item_BoxStr_index, box.ToShowStr());
}
SetItemColor(i,move.runStatus);
SetItemColor(i, move.runStatus);
i++;
}
i++;
......@@ -594,14 +595,14 @@ namespace OnlineStore.AssemblyLine
}
}
private void SetMenuS(ToolStripMenuItem toolMenu,bool isEn)
private void SetMenuS(ToolStripMenuItem toolMenu, bool isEn)
{
if (!toolMenu.Enabled.Equals(isEn))
{
toolMenu.Enabled = isEn;
}
}
private void SetItemColor(int i,Color color)
private void SetItemColor(int i, Color color)
{
if (!listView1.Items[i].BackColor.Equals(color))
{
......@@ -733,7 +734,7 @@ namespace OnlineStore.AssemblyLine
string name = listView1.Items[index].SubItems[0].Text;
name = "BOX-" + (index + 1);
BoxInfo boxInfo = LineServer.GetBoxInfo(index + 1);
if (boxInfo != null&&boxInfo.SRunStatus>=1)
if (boxInfo != null && boxInfo.SRunStatus >= 1)
{
if (boxInfo.SStatus.Equals((int)LineStatus.Debugging))
{
......@@ -791,7 +792,7 @@ namespace OnlineStore.AssemblyLine
{
List<TrayInfo> tray = TrayManager.getTrayList();
LogUtil.info("-------------------开始打印托盘信息:");
foreach(TrayInfo t in tray)
foreach (TrayInfo t in tray)
{
LogUtil.info(t.ToStr());
}
......@@ -817,7 +818,7 @@ namespace OnlineStore.AssemblyLine
private void btnUpdateTray_Click(object sender, EventArgs e)
{
int num = cmbTray.SelectedIndex + 1;
DialogResult resut = MessageBox.Show("确定手动更新托盘【"+num+"】的信息?", "提示", MessageBoxButtons.YesNo);
DialogResult resut = MessageBox.Show("确定手动更新托盘【" + num + "】的信息?", "提示", MessageBoxButtons.YesNo);
if (resut.Equals(DialogResult.Yes))
{
int trayType = cmbTrayType.SelectedIndex;
......@@ -907,5 +908,20 @@ namespace OnlineStore.AssemblyLine
AgvClient.SetCancelState(result);
LogUtil.info("勾选:AgvClient.SetCancelState =" + result);
}
private void chbBuzzer_CheckedChanged(object sender, EventArgs e)
{
if (!LoadOk)
{
return;
}
if (chbBuzzer.Checked.Equals(LineManager.UseBuzzer))
{
return;
}
LineManager.UseBuzzer = chbBuzzer.Checked;
LogUtil.info("勾选:UseBuzzer =" + LineManager.UseBuzzer);
ConfigAppSettings.SaveValue(Setting_Init.UseBuzzer, (LineManager.UseBuzzer ? 1 : 0));
}
}
}
......@@ -264,11 +264,12 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800
问题:入料1 9:36,料架送走以后又发needLeave B20,B26
托盘号增加一致性判断,不一致时打印日志并显示文字。
托盘卡时,等待StopChecck2的报警不显示红灯
20200307
灯状态修改:启动流水线绿灯常亮,有出入库是绿灯闪烁
复位过程中黄灯闪烁,信号超时报警黄灯闪烁
急停或无气压报警 红灯闪烁,蜂鸣器亮
上料模块夹走料盘后,需要判断信号是否消失
......
......@@ -86,5 +86,7 @@ namespace OnlineStore.Common
public static string DefaultTrayNum = "DefaultTrayNum";
public static string MaxTrayNum = "MaxTrayNum";
public static string UseBuzzer = "UseBuzzer";
}
}
......@@ -319,7 +319,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager.TrayErrorMsg = DateTime.Now.ToLongTimeString() + " " + Name + "托盘号出现错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],连续两个托盘号一样";
LogUtil.error(Name + "托盘号错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],连续两个托盘号一样");
}
else if (TrayManager.CheckIsRightNum(currTrayNum, preTrayNum))
else if (!TrayManager.CheckIsRightNum(currTrayNum, preTrayNum))
{
TrayManager.TrayErrorMsg = DateTime.Now.ToLongTimeString() + " " + Name + "托盘号出现错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],托盘号不连续";
LogUtil.error(Name + "托盘号错乱:上一个托盘[" + preTrayNum + "] 当前托盘 [" + currTrayNum + "],托盘号不连续");
......@@ -440,20 +440,11 @@ namespace OnlineStore.DeviceLibrary
//一分钟还未检测到
if (span.TotalSeconds > LineManager.Config.IOSingle_TimerOut && NoAlarm())
{
if (IsLowAlarm(moveInfo))
{
ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = "提示" + moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时";
LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID + 13, 30);
}
else
{
ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时";
Alarm(LineAlarmType.IoSingleTimeOut);
LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID + 13);
}
}
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2)
{
preRWTime = DateTime.Now;
......@@ -519,15 +510,18 @@ namespace OnlineStore.DeviceLibrary
{
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg
+ "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
if (IsLowAlarm(moveInfo) && span.TotalSeconds < moveInfo.TimeOutSeconds * 3)
int ms = 10;
if (IsLowAlarm(moveInfo))
{
LogUtil.error(WarnMsg, DeviceID + 15,30);
ms = 30;
}
else
ms = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds);
if (ms > 120)
{
LogUtil.error(WarnMsg, DeviceID + 15);
Alarm(LineAlarmType.IoSingleTimeOut);
ms = 120;
}
LogUtil.error(WarnMsg, DeviceID + 15, ms);
Alarm(LineAlarmType.IoSingleTimeOut);
}
}
catch (Exception ex)
......
......@@ -632,14 +632,20 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_UpdownAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_17_BatchAxisToP3);
MoveInfo.NextMoveStep(LineMoveStep.FI_18_WaitNoLocationCheck);
InLog("料盘移栽" + MoveInfo.SLog + ":等待 SL_AxisLocationCheck=LOW");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_AxisLocationCheck, IO_VALUE.LOW));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_WaitNoLocationCheck))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_19_BatchAxisToP3);
InLog("料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3,横移气缸上升");
CylinderMove(null, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
BatchAxisToP3();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_BatchAxisToP3))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_BatchAxisToP3))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_18_SaveSize);
MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
LastHeight = GetHeight();
LastWidth = GetWidth();
......@@ -665,24 +671,24 @@ namespace OnlineStore.DeviceLibrary
InLog("料盘移栽" + MoveInfo.SLog + ":记录 高度【" + LastHeight + "】宽度【" + LastWidth + "】");
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_SaveSize))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_SaveSize))
{
if (MoveCylineCanTakeOrGive())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_19_CylinderGive);
MoveInfo.NextMoveStep(LineMoveStep.FI_21_CylinderGive);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_18_SaveSize);
MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_CylinderGive))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_CylinderGive))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_20_WaitTray);
MoveInfo.NextMoveStep(LineMoveStep.FI_22_WaitTray);
int targetPositon = Config.GetUpdownP2Detial(LastHeight, LastWidth);
string log = ":移栽伺服下降到P2:" + targetPositon;
UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
......@@ -690,7 +696,7 @@ namespace OnlineStore.DeviceLibrary
//TODO 此处需要等待空托盘
if (MoveInfo.ShelfNoTray.Equals(false) && isScan)
{
InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达 "+ log + ",预扫码");
InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达 " + log + ",预扫码");
//还有料盘,直接扫码
NextCodeList = new List<string>();
try
......@@ -698,10 +704,10 @@ namespace OnlineStore.DeviceLibrary
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name);
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
if (NextCodeList.Count <= 0)
{
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name);
NextCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
}
return NextCodeList;
});
......@@ -718,7 +724,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_WaitTray))//TODO
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_WaitTray))//TODO
{
if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember))
{
......@@ -727,7 +733,7 @@ namespace OnlineStore.DeviceLibrary
//InLog("料盘移栽" + MoveInfo.SLog + ":移栽伺服下降到P2:" + targetPositon + ",托盘号【" + currTrayNum + "】,获取库位号,更新托盘信息");
//UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
MoveInfo.NextMoveStep(LineMoveStep.FI_22_CylinderDown);
MoveInfo.NextMoveStep(LineMoveStep.FI_24_CylinderDown);
InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降, 托盘号【" + currTrayNum + "】,获取库位号,更新托盘信息");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
......@@ -769,22 +775,22 @@ namespace OnlineStore.DeviceLibrary
// InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降,");
// CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
//}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_CylinderDown))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_CylinderDown))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_23_CylinderRelax);
MoveInfo.NextMoveStep(LineMoveStep.FI_25_CylinderRelax);
InLog("料盘移栽" + MoveInfo.SLog + ":上料气缸放松");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_CylinderRelax))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_CylinderRelax))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_24_CylinderUp);
MoveInfo.NextMoveStep(LineMoveStep.FI_26_CylinderUp);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升 ");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_CylinderUp))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_26_CylinderUp))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_25_UpDownAxisToP1);
MoveInfo.NextMoveStep(LineMoveStep.FI_27_UpDownAxisToP1);
InLog("料盘移栽" + MoveInfo.SLog + ":升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
if (Config.SidesWayNum > 0)
......@@ -799,7 +805,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_UpDownAxisToP1))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_27_UpDownAxisToP1))
{
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升已到位,托盘开始放行 ");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_12_MoveOk);
......@@ -1122,7 +1128,7 @@ namespace OnlineStore.DeviceLibrary
if (trayCanUse && runStatus.Equals(LineRunStatus.Busy) && MoveInfo.MoveType.Equals(LineMoveType.InStore))
{
//入料执行中, 且需要空托盘
if (MoveInfo.MoveStep .Equals(LineMoveStep.FI_20_WaitTray)&&MoveInfo.IsInWait.Equals(false))
if (MoveInfo.MoveStep .Equals(LineMoveStep.FI_22_WaitTray)&&MoveInfo.IsInWait.Equals(false))
//if (MoveInfo.MoveStep >= LineMoveStep.FI_11_CylinderUp && MoveInfo.MoveStep <= LineMoveStep.FI_20_WaitTray)
{
if (NeedSaveParam)
......
......@@ -35,10 +35,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public Dictionary<int, MoveEquip> MoveEquipMap { get; set; }
public Dictionary <int,FeedingEquip> FeedingEquipMap { get; set; }
public Dictionary<int, FeedingEquip> FeedingEquipMap { get; set; }
public Dictionary<int, ProvidingEquip> ProvidingEquipMap { get; set; }
public Dictionary<int, DischargeLine> DisLineMap { get; set; }
public Dictionary<int ,EquipBase> AllEquipMap { get; set; }
public Dictionary<int, EquipBase> AllEquipMap { get; set; }
/// <summary>
/// 流水线配置
......@@ -46,7 +46,7 @@ namespace OnlineStore.DeviceLibrary
public Line_Config Config { get; set; }
#region 初始化
public List<string> cioList = new List<string>( );
public List<string> cioList = new List<string>();
// public List<string> rfidList = new List<string>();
private bool canStart = false;
......@@ -163,7 +163,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name + "加载调试设备出错:",ex);
LogUtil.error(Name + "加载调试设备出错:", ex);
}
}
RFIDManager.Init();
......@@ -253,9 +253,10 @@ namespace OnlineStore.DeviceLibrary
}
else
{
ledProcessTimer.Enabled = false;
// ledProcessTimer.Enabled = false;
IoCheckTimer.Enabled = false;
mainTimer.Enabled = false;
ledProcessTimer.Enabled = true;
lineStatus = LineStatus.ResetMove;
runStatus = LineRunStatus.HomeMoving;
StartTime = DateTime.Now;
......@@ -273,7 +274,6 @@ namespace OnlineStore.DeviceLibrary
EquipStartRun(moveEquip);
}
ledProcessTimer.Enabled = true;
IoCheckTimer.Enabled = true;
mainTimer.Enabled = true;
return true;
......@@ -313,7 +313,7 @@ namespace OnlineStore.DeviceLibrary
}
TrayManager.ErrorDeviceId = -1;
WriteDrivetMotorRun( IO_VALUE.LOW);
WriteDrivetMotorRun(IO_VALUE.LOW);
//横移轨道下降
SideWayStop();
......@@ -345,11 +345,11 @@ namespace OnlineStore.DeviceLibrary
{
//TrayManager.LineNeedEmptyTrayNum = 0;
isNeedAllReset = true;
LogUtil.error( Name + "收到复位信号,急停中或没有气压报警中,强制所有设备复位~");
LogUtil.error(Name + "收到复位信号,急停中或没有气压报警中,强制所有设备复位~");
}
else if ((runStatus == LineRunStatus.HomeMoving || runStatus == LineRunStatus.Reset) && NoAlarm())
{
LogUtil.error( Name + "收到复位信号,已经在复位或原点返回中,且当前无报警,不处理复位");
LogUtil.error(Name + "收到复位信号,已经在复位或原点返回中,且当前无报警,不处理复位");
return false;
}
......@@ -399,13 +399,14 @@ namespace OnlineStore.DeviceLibrary
{
IoCheckTimer.Enabled = false;
mainTimer.Enabled = false;
ledProcessTimer.Enabled = false;
AgvClient.SetCancelState(true);
WriteDrivetMotorRun(IO_VALUE.LOW);
//停止运行时,把阻挡气缸上升
StopMove();
runStatus = LineRunStatus.Wait;
ledProcessTimer.Enabled = false;
CloseLed();
LineServer.StopServer();
RFIDManager.Close();
......@@ -413,7 +414,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + ",停止运行,总运行时间:" + span.ToString());
}
public override void Alarm(LineAlarmType alarmType )
public override void Alarm(LineAlarmType alarmType)
{
if (this.alarmType.Equals(alarmType))
{
......@@ -449,78 +450,94 @@ namespace OnlineStore.DeviceLibrary
#region 灯光处理
private void CloseLed()
{
CheckAndMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
CheckAndMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
CheckAndMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
CheckAndMove(IO_Type.Alarm_Buzzer, IO_VALUE.LOW);
}
private void LedProcess(object sender, ElapsedEventArgs e)
{
try
{
DateTime time = DateTime.Now;
//黄灯
if ( runStatus.Equals(LineRunStatus.HomeMoving) || runStatus.Equals(LineRunStatus.Reset))
if (runStatus <= LineRunStatus.Wait)
{
//开机执行中时黄灯闪烁
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.HIGH))
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
CloseLed();
return;
}
else
bool isNeedAlarmLed = false;
bool isInOut = false;
bool yellowShanShuo = false;
if (runStatus.Equals(LineRunStatus.HomeMoving) || runStatus.Equals(LineRunStatus.Reset))
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
}
yellowShanShuo = true;
}
//休眠状态黄灯常亮
//else if (IsSleep)
//{
// if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.LOW))
// {
// IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
// }
//}
//else
//{
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.HIGH))
if (isInSuddenDown||isNoAirCheck||alarmType>LineAlarmType.AxisAlarm )
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
isNeedAlarmLed = true;
}
//}
bool isNeedAlarmLed = false;
bool isInOut = false;
if (NoAlarm().Equals(false) || TrayManager.TrayErrorMsg != "")
else if(alarmType.Equals(LineAlarmType.None).Equals(false)||TrayManager.TrayErrorMsg!="")
{
isNeedAlarmLed = true;
yellowShanShuo = true;
}
foreach (MoveEquip moveEquip in MoveEquipMap.Values)
{
if (!moveEquip.NoAlarm())
if (moveEquip.isNoAirCheck || moveEquip.isInSuddenDown || moveEquip.alarmType > LineAlarmType.AxisAlarm)
{
isNeedAlarmLed = true;
}
else if (moveEquip.alarmType.Equals(LineAlarmType.None).Equals(false))
{
yellowShanShuo = true;
}
if (moveEquip.MoveInfo.MoveType.Equals(LineMoveType.InStore) || moveEquip.MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{
isInOut = true;
}
}
//忙碌中,判断是否有移栽在出入库执行,绿灯闪烁
if (isInOut)
//黄灯
if (yellowShanShuo)
{
if (IsDoValue(IO_Type.AutoRun_HddLed, IO_VALUE.LOW))
//开机执行中时黄灯闪烁
if (IsDoValue(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH))
{
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
}
else
{
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
}
}
else if (IsDoValue(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH))
{
IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
}
//忙碌中,判断是否有移栽在出入库执行,绿灯闪烁
if (isInOut)
{
if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.LOW))
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
}
else
{
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
}
}
else if (IsDoValue(IO_Type.RunSign_HddLed, IO_VALUE.LOW))
{
//平常常亮绿灯
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
}
//报警中 ,红灯闪烁
//严重报警中 ,红灯闪烁
if (isNeedAlarmLed)
{
if (IsDoValue(IO_Type.Alarm_HddLed, IO_VALUE.LOW))
......@@ -536,11 +553,19 @@ namespace OnlineStore.DeviceLibrary
{
IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
}
if (isNeedAlarmLed && LineManager.UseBuzzer)
{
CheckAndMove(IO_Type.Alarm_Buzzer, IO_VALUE.HIGH);
}
else
{
CheckAndMove(IO_Type.Alarm_Buzzer, IO_VALUE.LOW);
}
}
catch (Exception ex)
{
LogUtil.error(Name + "灯处理定时器出错:",ex);
LogUtil.error(Name + "灯处理定时器出错:", ex);
}
Thread.Sleep(5);
}
......
......@@ -415,11 +415,11 @@ namespace OnlineStore.DeviceLibrary
sdIsInprocess = false;
return;
}
if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None) && SW23WaitTrayNum > 0)
if (SW23_MoveInfo.MoveType.Equals(LineMoveType.None) && SW23WaitTrayNum >= 0)
{
Equip_TrayPEndEvent(2, SW23WaitTrayNum);
}
if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None) && SW41WaitTrayNum > 0)
if (SW41_MoveInfo.MoveType.Equals(LineMoveType.None) && SW41WaitTrayNum >= 0)
{
Equip_TrayPEndEvent(4, SW41WaitTrayNum);
}
......
......@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary
{
public class LineManager
{
public static bool UseBuzzer = ConfigAppSettings.GetIntValue(Setting_Init.UseBuzzer).Equals(1);
private static bool isInit = false;
public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
......
......@@ -177,7 +177,7 @@ namespace OnlineStore.DeviceLibrary
/// 没有严重的报警
/// </summary>
/// <returns></returns>
protected bool NoErrorAlarm()
internal bool NoErrorAlarm()
{
if (isInSuddenDown || isNoAirCheck)
{
......
......@@ -645,26 +645,30 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
FI_16_CylinderTighten = 11016,
/// <summary>
/// 料盘移栽:上料横移机构上升,同时伺服运动到P3
/// 料盘移栽:升降伺服到P1点
/// </summary>
FI_17_UpdownAxisToP1,
/// <summary>
/// 料盘移栽:等待没有伺服料盘检测信号
/// </summary>
FI_17_UpdownAxisToP1 ,
FI_18_WaitNoLocationCheck,
/// <summary>
/// 料盘移栽:批量轴到P3点,检测是否有料盘
/// </summary>
FI_17_BatchAxisToP3,
FI_19_BatchAxisToP3,
/// <summary>
/// 料盘移栽:记录高度尺寸
/// </summary>
FI_18_SaveSize ,
FI_20_SaveSize ,
/// <summary>
/// 料盘移栽: 上料横移气缸放料SOL
/// </summary>
FI_19_CylinderGive ,
FI_21_CylinderGive ,
/// <summary>
/// 料盘移栽:等待空托盘到达,移栽伺服下降到P2,并预扫码
/// </summary>
FI_20_WaitTray,
FI_22_WaitTray,
///// <summary>
///// 料盘移栽:移栽伺服下降到P2
///// </summary>
......@@ -672,20 +676,20 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 料盘移栽: 上料机构下降
/// </summary>
FI_22_CylinderDown,
FI_24_CylinderDown,
/// <summary>
/// 料盘移栽: 上料气缸放松
/// </summary>
FI_23_CylinderRelax ,
FI_25_CylinderRelax ,
/// <summary>
/// 料盘移栽:上料横移机构上升,定位或者顶升可以先下降
/// </summary>
FI_24_CylinderUp,
FI_26_CylinderUp,
/// <summary>
/// 料盘移栽:升降伺服到P1点
/// </summary>
FI_25_UpDownAxisToP1,
FI_27_UpDownAxisToP1,
///// <summary>
///// 料盘移栽:上料横移机构到取料端
///// </summary>
......
......@@ -54,15 +54,15 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// DO 0 待机状态(指示灯) AutoRun_HddLed 24 待机状态(指示灯) Y01 DO-01
/// DO 0 黄灯 待机状态(指示灯) AutoRun_HddLed 24 待机状态(指示灯) Y01 DO-01
/// </summary>
public static string AutoRun_HddLed = "AutoRun_HddLed";
/// <summary>
/// DO 0 运行状态(指示灯) RunSign_HddLed 25 运行状态(指示灯) Y02 DO-02
/// DO 0 绿灯 运行状态(指示灯) RunSign_HddLed 25 运行状态(指示灯) Y02 DO-02
/// </summary>
public static string RunSign_HddLed = "RunSign_HddLed";
/// <summary>
/// DO 0 故障状态(指示灯) Alarm_HddLed 26 故障状态(指示灯) Y03 DO-03
/// DO 0 红灯 故障状态(指示灯) Alarm_HddLed 26 故障状态(指示灯) Y03 DO-03
/// </summary>
public static string Alarm_HddLed = "Alarm_HddLed";
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!