Commit f4cd7e79 LN

C1横移修改

1 个父辈 663ad2f6
正在显示 31 个修改的文件 包含 426 行增加114 行删除
......@@ -21,6 +21,7 @@
<add key="ConfigPath_FeedingEquip" value="\LineConfig\Config_FeedingEquip.csv" />
<add key="ConfigPath_HYEquip" value="\LineConfig\HY\Config_HYEquip.csv" />
<add key="ConfigPath_DischargeLine" value="\LineConfig\Config_DischargeLine.csv" />
<add key ="ConfigPath_TrayList" value ="\LineConfig\TrayList.data"/>
<add key="Line_Type" value="Line" />
<add key="Line_CID" value="rc1250" />
<!--end one store config-->
......
......@@ -28,19 +28,157 @@
/// </summary>
private void InitializeComponent()
{
this.panBase = new System.Windows.Forms.Panel();
this.btnExit = new System.Windows.Forms.Button();
this.lblName = new System.Windows.Forms.Label();
this.chbDebug = new System.Windows.Forms.CheckBox();
this.lblStoreStatus = new System.Windows.Forms.Label();
this.btnOutStore = new System.Windows.Forms.Button();
this.btnStart = new System.Windows.Forms.Button();
this.btnInStore = new System.Windows.Forms.Button();
this.btnStop = new System.Windows.Forms.Button();
this.panBase.SuspendLayout();
this.SuspendLayout();
//
// panBase
//
this.panBase.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panBase.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panBase.Controls.Add(this.btnExit);
this.panBase.Controls.Add(this.lblName);
this.panBase.Controls.Add(this.chbDebug);
this.panBase.Controls.Add(this.lblStoreStatus);
this.panBase.Controls.Add(this.btnOutStore);
this.panBase.Controls.Add(this.btnStart);
this.panBase.Controls.Add(this.btnInStore);
this.panBase.Controls.Add(this.btnStop);
this.panBase.Location = new System.Drawing.Point(2, 3);
this.panBase.Name = "panBase";
this.panBase.Size = new System.Drawing.Size(1177, 50);
this.panBase.TabIndex = 259;
//
// btnExit
//
this.btnExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnExit.BackColor = System.Drawing.Color.White;
this.btnExit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnExit.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnExit.Location = new System.Drawing.Point(1062, 4);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(110, 40);
this.btnExit.TabIndex = 260;
this.btnExit.Text = "退出";
this.btnExit.UseVisualStyleBackColor = false;
//
// lblName
//
this.lblName.BackColor = System.Drawing.Color.DodgerBlue;
this.lblName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblName.ForeColor = System.Drawing.Color.Black;
this.lblName.Location = new System.Drawing.Point(5, 4);
this.lblName.Name = "lblName";
this.lblName.Size = new System.Drawing.Size(180, 40);
this.lblName.TabIndex = 250;
this.lblName.Text = "进仓移栽";
this.lblName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// chbDebug
//
this.chbDebug.AutoSize = true;
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(682, 12);
this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(84, 24);
this.chbDebug.TabIndex = 247;
this.chbDebug.Text = "调试状态";
this.chbDebug.UseVisualStyleBackColor = true;
//
// lblStoreStatus
//
this.lblStoreStatus.AutoSize = true;
this.lblStoreStatus.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblStoreStatus.ForeColor = System.Drawing.Color.Green;
this.lblStoreStatus.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblStoreStatus.Location = new System.Drawing.Point(804, 14);
this.lblStoreStatus.Name = "lblStoreStatus";
this.lblStoreStatus.Size = new System.Drawing.Size(65, 20);
this.lblStoreStatus.TabIndex = 245;
this.lblStoreStatus.Text = "等待启动";
this.lblStoreStatus.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnOutStore
//
this.btnOutStore.BackColor = System.Drawing.Color.White;
this.btnOutStore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOutStore.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOutStore.Location = new System.Drawing.Point(414, 4);
this.btnOutStore.Name = "btnOutStore";
this.btnOutStore.Size = new System.Drawing.Size(110, 40);
this.btnOutStore.TabIndex = 101;
this.btnOutStore.Text = "出库测试";
this.btnOutStore.UseVisualStyleBackColor = false;
//
// btnStart
//
this.btnStart.BackColor = System.Drawing.Color.White;
this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStart.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStart.Location = new System.Drawing.Point(188, 4);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(110, 40);
this.btnStart.TabIndex = 86;
this.btnStart.Text = "启动调试";
this.btnStart.UseVisualStyleBackColor = false;
//
// btnInStore
//
this.btnInStore.BackColor = System.Drawing.Color.White;
this.btnInStore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnInStore.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnInStore.Location = new System.Drawing.Point(527, 4);
this.btnInStore.Name = "btnInStore";
this.btnInStore.Size = new System.Drawing.Size(110, 40);
this.btnInStore.TabIndex = 102;
this.btnInStore.Text = "入库测试";
this.btnInStore.UseVisualStyleBackColor = false;
//
// btnStop
//
this.btnStop.BackColor = System.Drawing.Color.White;
this.btnStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStop.Location = new System.Drawing.Point(301, 4);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(110, 40);
this.btnStop.TabIndex = 87;
this.btnStop.Text = "停止";
this.btnStop.UseVisualStyleBackColor = false;
//
// FrmEquipBase
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1318, 532);
this.ClientSize = new System.Drawing.Size(1184, 611);
this.Controls.Add(this.panBase);
this.Name = "FrmEquipBase";
this.Text = "FrmEquipBase";
this.panBase.ResumeLayout(false);
this.panBase.PerformLayout();
this.ResumeLayout(false);
}
#endregion
protected System.Windows.Forms.Panel panBase;
protected System.Windows.Forms.Button btnExit;
protected System.Windows.Forms.Label lblName;
protected System.Windows.Forms.CheckBox chbDebug;
protected System.Windows.Forms.Label lblStoreStatus;
protected System.Windows.Forms.Button btnOutStore;
protected System.Windows.Forms.Button btnStart;
protected System.Windows.Forms.Button btnInStore;
protected System.Windows.Forms.Button btnStop;
}
}
\ No newline at end of file
......@@ -726,9 +726,9 @@
this.lblWarnMsg.AutoEllipsis = true;
this.lblWarnMsg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.Location = new System.Drawing.Point(351, 3);
this.lblWarnMsg.Location = new System.Drawing.Point(378, 3);
this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(985, 75);
this.lblWarnMsg.Size = new System.Drawing.Size(958, 75);
this.lblWarnMsg.TabIndex = 96;
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
......@@ -866,73 +866,73 @@
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator6.Visible = false;
//
// 二维码学习ToolStripMenuItem
//
this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem";
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.二维码学习ToolStripMenuItem.Text = "二维码学习";
this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
//
// 托盘初始化ToolStripMenuItem
//
this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem";
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.托盘初始化ToolStripMenuItem.Text = "托盘编码";
this.托盘初始化ToolStripMenuItem.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(176, 26);
this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem2.Text = "AGV调试";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// toolStripSeparator13
//
this.toolStripSeparator13.Name = "toolStripSeparator13";
this.toolStripSeparator13.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator13.Size = new System.Drawing.Size(177, 6);
//
// iO模块状态ToolStripMenuItem
//
this.iO模块状态ToolStripMenuItem.Name = "iO模块状态ToolStripMenuItem";
this.iO模块状态ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.iO模块状态ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.iO模块状态ToolStripMenuItem.Text = "查看料仓状态";
this.iO模块状态ToolStripMenuItem.Click += new System.EventHandler(this.iO模块状态ToolStripMenuItem_Click);
//
// toolStripSeparator14
//
this.toolStripSeparator14.Name = "toolStripSeparator14";
this.toolStripSeparator14.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator14.Size = new System.Drawing.Size(177, 6);
//
// 查看托盘信息ToolStripMenuItem
//
this.查看托盘信息ToolStripMenuItem.Name = "查看托盘信息ToolStripMenuItem";
this.查看托盘信息ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.查看托盘信息ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.查看托盘信息ToolStripMenuItem.Text = "查看托盘信息";
this.查看托盘信息ToolStripMenuItem.Click += new System.EventHandler(this.btnTrayInfo_Click);
//
// toolStripSeparator12
//
this.toolStripSeparator12.Name = "toolStripSeparator12";
this.toolStripSeparator12.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator12.Size = new System.Drawing.Size(177, 6);
//
// 清空托盘信息ToolStripMenuItem
//
this.清空托盘信息ToolStripMenuItem.Name = "清空托盘信息ToolStripMenuItem";
this.清空托盘信息ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.清空托盘信息ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.清空托盘信息ToolStripMenuItem.Text = "清空托盘信息";
this.清空托盘信息ToolStripMenuItem.Click += new System.EventHandler(this.清空托盘信息ToolStripMenuItem_Click);
//
......@@ -985,8 +985,8 @@
this.menuStrip1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.操作ToolStripMenuItem,
this.设置TToolStripMenuItem,
this.运行参数ToolStripMenuItem,
this.设置TToolStripMenuItem,
this.帮助ToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
......
......@@ -72,6 +72,7 @@
//
// txtIP
//
this.txtIP.Enabled = false;
this.txtIP.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtIP.Location = new System.Drawing.Point(144, 72);
this.txtIP.Name = "txtIP";
......
......@@ -41,6 +41,16 @@ namespace OnlineStore.AssemblyLine
rfMap.Add(key, value);
comboxType.Items.Add(key);
}
foreach (HYEquipBase b in LineManager.Line.HYEquipMap.Values)
{
string key = b.Name + "-托盘RF";
string value = RFIDManager.GetRFIP(b.DeviceID, 1);
if (!String.IsNullOrEmpty(value))
{
rfMap.Add(key, value);
comboxType.Items.Add(key);
}
}
comboxType.SelectedIndex = 0;
comType.SelectedIndex = 0;
......
......@@ -266,7 +266,11 @@ namespace OnlineStore.AssemblyLine
}
private void ReadAxisStatus()
{
groupBox2.Text = cmbAxis.Text + "-状态监控";
string groupText = cmbAxis.Text + "-状态监控";
if (!groupBox2.Equals(groupText))
{
groupBox2.Text = groupText;
}
//【1】更新轴号
short axisNo = SlvAddr;
if (axisNo < 0)
......
......@@ -147,7 +147,6 @@ namespace OnlineStore.AssemblyLine
}
}
this.BackColor = equip.GetShowColor();
//SetItemColor(equip.runStatus, equip.alarmType);
}
public EquipControl()
{
......@@ -155,10 +154,6 @@ namespace OnlineStore.AssemblyLine
}
private void EquipControl_Load(object sender, EventArgs e)
{
//lblName.Text = "";
//lblTrayNum.Text = "";
//lblStatus.Text = "";
//lblMoveInfo.Text = "";
}
public static EquipControl NewControl(EquipBase equip)
......
......@@ -99,5 +99,7 @@ namespace OnlineStore.Common
public static string SaveErrorImageToFile = "SaveErrorImageToFile";
public static string UseHCBoard = "UseHCBoard";
public static string ConfigPath_TrayList = "ConfigPath_TrayList";
}
}
......@@ -13,6 +13,7 @@ namespace OnlineStore.DeviceLibrary
{
public abstract class EquipBase : KTK_Store
{
public bool MoveStop = false;
public LineMoveInfo SecondMoveInfo = null;
......@@ -64,7 +65,6 @@ namespace OnlineStore.DeviceLibrary
{
}
public bool MoveStop = false;
private DateTime lastProTimer = DateTime.Now;
......@@ -162,6 +162,12 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + " BusyMoveProcess 出错:" + ex.ToString());
}
}
protected void MoveTimeOut(string msg)
{
WarnMsg = SecondMoveInfo.Name + "[" + SecondMoveInfo.MoveStep + "] 等待移栽机构开始抓料超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 30);
Alarm(LineAlarmType.IoSingleTimeOut);
}
protected void ClearTimeoutAlarm(string msg)
{
if (isInSuddenDown || isNoAirCheck)
......
......@@ -292,24 +292,18 @@ namespace OnlineStore.DeviceLibrary
internal override void StopMove()
{
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
//StopMove时设置状态为none
AgvClient.SetStatus(Config.AgvInName,"",ClientAction.None,ClientLevel.Low,true);
AgvClient.SetStatus(Config.AgvOutName, "", ClientAction.None, ClientLevel.Low, true);
//MoveInfo.EndMove();
//SecondMoveInfo.EndMove();
BatchAxisStopCheck();
BatchAxis.SuddenStop();
UpdownAxis.SuddenStop();
CloseAxis(BatchAxis);
CloseAxis(UpdownAxis);
//if (Config.SidesWayNum <= 0)
//{
// CheckAndMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
// CheckAndMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.LOW);
// CheckAndMove(IO_Type.FL_TopCylinder_Down, IO_VALUE.LOW);
// CheckAndMove(IO_Type.FL_TopCylinder_Up, IO_VALUE.LOW);
//}
CheckAndMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
CheckAndMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.LOW);
CheckAndMove(IO_Type.SL_OutLine_Run, IO_VALUE.LOW);
......@@ -330,8 +324,7 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Enabled = false;
}
StopMove();
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
AgvClient.SetStatus(Config.AgvInName, "", ClientAction.None, ClientLevel.Low, true);
AgvClient.SetStatus(Config.AgvOutName, "", ClientAction.None, ClientLevel.Low, true);
}
......@@ -384,7 +377,7 @@ namespace OnlineStore.DeviceLibrary
BusyMoveProcess();
IOTimeOutProcess();
//判断流水线打开了才可以运行
if (MoveInfo.MoveType.Equals(LineMoveType.None) && NoErrorAlarm())
if (MoveInfo.MoveType.Equals(LineMoveType.None) && NoErrorAlarm() && (!MoveStop))
{
if (Config.IsCanOut.Equals(0))
{
......@@ -395,17 +388,7 @@ namespace OnlineStore.DeviceLibrary
StartOutStoreP();
}
}
//if (SecondMoveInfo.MoveType.Equals(LineMoveType.None) && NoErrorAlarm())
//{
// if (Config.IsCanOut.Equals(0))
// {
// CheckFixture();
// }
// else if (LineManager.Line.runStatus <= LineRunStatus.Wait)
// {
// CheckFixture();
// }
//}
if (NoErrorAlarm())
{
if (IOValue(IO_Type.SL_Out_Check).Equals(IO_VALUE.HIGH))
......
......@@ -319,6 +319,7 @@ namespace OnlineStore.DeviceLibrary
{
if (ScanCodeTask == null || ScanCodeTask.IsCompleted)
{
ClearTimeoutAlarm("扫码执行结束超时");
MoveInfo.NextMoveStep(LineMoveStep.FI_21_CylinderTake);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
......@@ -509,6 +510,7 @@ namespace OnlineStore.DeviceLibrary
InLog("获取库位" + MoveInfo.SLog + ": 上料轴开始慢速上升到P3点,不等待结果");
BatchAxisToP3(false, false);
}
ClearTimeoutAlarm("等待空托盘到达超时");
}
else if (MoveInfo.IsTimeOut(180))
{
......
......@@ -711,6 +711,7 @@ namespace OnlineStore.DeviceLibrary
MoveEndS();
}
}
ClearTimeoutAlarm("等待给服务器发送afterPut完成超时");
}
else if (MoveInfo.IsTimeOut(60))
{
......
......@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 当前设备对应的横移出口的设备ID
/// </summary>
private int HyOutDeviceId = 0;
protected int HyOutDeviceId = 0;
/// <summary>
/// 当前设备对应的横移入口的设备ID
/// </summary>
......
......@@ -372,16 +372,17 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(LineMoveStep.HY11_TopUpToHY))
{
MoveInfo.NextMoveStep(LineMoveStep.HY12_WaitHY2Free);
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待HY2空闲,可以开始横移 ");
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待HY" + HyOutDeviceId + " 空闲,可以开始横移 ");
}
else if (MoveInfo.IsStep(LineMoveStep.HY12_WaitHY2Free))
{
if (GetHyOutEquip().MoveInfo.MoveType.Equals(LineMoveType.None))
{
MoveInfo.NextMoveStep(LineMoveStep.HY13_WaitHY2Ready);
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待HY2准备完成(顶升上升,定位下降) ");
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待HY" + HyOutDeviceId + " 准备完成(顶升上升,定位下降) ");
GetHyOutEquip().MoveInfo.NewMove(LineMoveType.CheckFixture);
GetHyOutEquip().MoveInfo.NextMoveStep(LineMoveStep.HY51_WaitFree);
ClearTimeoutAlarm("等待横移出口可以横移超时");
}
else if (MoveInfo.IsTimeOut())
{
......@@ -400,6 +401,7 @@ namespace OnlineStore.DeviceLibrary
LineRun(MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.LOW));
ClearTimeoutAlarm("等待横移出口顶升上升完成超时");
}
else if (MoveInfo.IsTimeOut())
{
......@@ -412,7 +414,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(LineMoveStep.HY14_HYLineRun))
{
MoveInfo.NextMoveStep(LineMoveStep.HY15_WaitOutCheck);
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待托盘到达HY2 ");
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待托盘到达HY" + HyOutDeviceId + " ");
}
else if (MoveInfo.IsStep(LineMoveStep.HY15_WaitOutCheck))
{
......@@ -420,7 +422,8 @@ namespace OnlineStore.DeviceLibrary
if (result)
{
MoveInfo.NextMoveStep(LineMoveStep.HY16_WatOutFixture2);
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待托盘到达HY2持续一段时间 ");
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待托盘到达HY" + HyOutDeviceId + "持续一段时间 ");
ClearTimeoutAlarm("等待托盘到达横移出口超时");
}
else if (MoveInfo.IsTimeOut())
{
......@@ -440,6 +443,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
HY_StopCylinderUp(MoveInfo);
OL_StopCylinderUp(MoveInfo);
ClearTimeoutAlarm("等待托盘到达横移出口");
}
else if (MoveInfo.IsTimeOut())
{
......@@ -702,21 +706,113 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.MoveParam = inoup;
return true ;
}
else if (trayInfo.InOrOutStore.Equals(ReelType.OutStore) && inoup.urgentReel && this.DeviceID.Equals(216))
{
//紧急料到NG箱
LogInfo(" 托盘需要横移到出料线:紧急出料" + "" + inoup.ToStr());
MoveInfo.MoveParam = inoup;
return true;
}
else if (trayInfo.InOrOutStore.Equals(ReelType.OutStore) && inoup.urgentReel.Equals(false) && inoup.cutReel.Equals(false))
{
LogInfo(" 托盘需要横移到出料线:工单出库料" + "" + inoup.ToStr());
List<int> mustLine = new List<int>();
List<int> firstLine = new List<int>();
//urgentReel: true 表示紧急料,需要出到料串上
//cutReel: true 表示分盘料,需要出到料串上
//smallReel: true 小料(7x8),放置到小料架上
//rfid: 分配的料架RFID
//rfidLoc:
//是否是小盘
if (inoup.rfidLoc <= 0)
{
//-1时随意放
}
else if (inoup.smallReel)
{
if (inoup.rfidLoc >= 70 && inoup.rfidLoc <= 72)
{
// 70,71,72时只能分配到3 / 4号皮带线;
mustLine = new List<int> { 213, 216 };
}
else if (inoup.rfidLoc <= 46)
{
// 小料时,架位为1 - 46优先走1 / 2号皮带线
firstLine = new List<int> { 204, 206 };
}
else if (inoup.rfidLoc >= 47)
{
// ,47 - 92优先走3 / 4号皮带线,
firstLine = new List<int> { 213, 216 };
}
}
else
{
//大料12号只能走1号2后皮带线
// 料架的架位大料时,架位1 - 6,12号优先走1 / 2号皮带线,
//7 - 11优先走3 / 4号皮带线
if (inoup.rfidLoc.Equals(12))
{
// 大料12号只能走1号2后皮带线
mustLine = new List<int> { 204, 206 };
}
else if (inoup.rfidLoc <= 6)
{
firstLine = new List<int> { 204, 206 };
}
else if (inoup.rfidLoc >= 7)
{
firstLine = new List<int> { 213, 216 };
}
}
if (mustLine.Count > 0)
{
if (mustLine.Contains(DeviceID))
{
LogInfo(" 托盘需要横移到出料线:工单出料,必须线" + "" + inoup.ToStr());
MoveInfo.MoveParam = inoup;
return true;
}
}
else if (firstLine.Count > 0)
{
if (firstLine.Contains(DeviceID) )
{
LogInfo(" 托盘需要横移到出料线:工单出料,优先线" + "" + inoup.ToStr());
MoveInfo.MoveParam = inoup;
return true;
}
else
{
TimeSpan span = DateTime.Now - trayInfo.LastUpdateTime;
if (span.TotalSeconds > 300)
{
LogInfo(" 托盘需要横移到出料线:工单出料,超时五分钟" + "" + inoup.ToStr());
MoveInfo.MoveParam = inoup;
return true;
}
}
}
else
{
LogInfo(" 托盘需要横移到出料线:工单出料,随意放" + "" + inoup.ToStr());
MoveInfo.MoveParam = inoup;
return true;
}
}
}
}
}
catch (Exception ex)
{
LogUtil.error(Name+"TrayNeedToOutLine 出错:" + ex.ToString());
}
return false;
}
#region 阻挡气缸处理
private void HY_StopCylinderUp(LineMoveInfo moveinfo = null)
......
......@@ -198,7 +198,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("检测托盘," + MoveInfo.SLog + " ,阻挡上升");
UpdateTrayNum();
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_FrontStopCheck, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_FrontStopDown, IO_VALUE.LOW));
IOMove(IO_Type.HY_StopDown, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.HIGH));
}
......@@ -228,9 +228,9 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.HY02_FrontStopDown);
LogInfo(" 托盘检测:" + MoveInfo.SLog + ",检测到前阻挡托盘检测,前阻挡下降,清理托盘RFID");
ClearTrayRFID();
IOMove(IO_Type.HY_FrontStopCheck, IO_VALUE.HIGH, 1200);
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.HIGH, 1200);
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_FrontStopCheck, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_FrontStopDown, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.HIGH));
}
}
......@@ -327,16 +327,17 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(LineMoveStep.HY11_TopUpToHY))
{
MoveInfo.NextMoveStep(LineMoveStep.HY12_WaitHY2Free);
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待HY2空闲,可以开始横移 ");
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待HY"+ HyOutDeviceId + "空闲,可以开始横移 ");
}
else if (MoveInfo.IsStep(LineMoveStep.HY12_WaitHY2Free))
{
if (GetHyOutEquip().MoveInfo.MoveType.Equals(LineMoveType.None))
{
MoveInfo.NextMoveStep(LineMoveStep.HY13_WaitHY2Ready);
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待HY2准备完成(顶升上升,定位下降) ");
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待HY"+ HyOutDeviceId + "准备完成(顶升上升,定位下降) ");
GetHyOutEquip().MoveInfo.NewMove(LineMoveType.CheckFixture);
GetHyOutEquip().MoveInfo.NextMoveStep(LineMoveStep.HY51_WaitFree);
ClearTimeoutAlarm("等待横移出口可以横移超时");
}
else if (MoveInfo.IsTimeOut())
{
......@@ -354,7 +355,7 @@ namespace OnlineStore.DeviceLibrary
CheckLog("托盘横移" + MoveInfo.SLog + " ,横移电机转动 ");
LineRun(MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.LOW));
ClearTimeoutAlarm("等待横移出口顶升上升完成超时");
}
else if (MoveInfo.IsTimeOut())
{
......@@ -367,7 +368,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(LineMoveStep.HY14_HYLineRun))
{
MoveInfo.NextMoveStep(LineMoveStep.HY15_WaitOutCheck);
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待托盘到达HY2 ");
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待托盘到达HY"+HyOutDeviceId+" ");
}
else if (MoveInfo.IsStep(LineMoveStep.HY15_WaitOutCheck))
{
......@@ -375,7 +376,8 @@ namespace OnlineStore.DeviceLibrary
if (result)
{
MoveInfo.NextMoveStep(LineMoveStep.HY16_WatOutFixture2);
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待托盘到达HY2持续一段时间 ");
CheckLog("托盘横移" + MoveInfo.SLog + " ,等待托盘到达HY" + HyOutDeviceId + " 持续一段时间 ");
ClearTimeoutAlarm("等待托盘到达横移出口超时");
}
else if (MoveInfo.IsTimeOut())
{
......@@ -394,6 +396,7 @@ namespace OnlineStore.DeviceLibrary
LineStop(MoveInfo);
CylinderMove(MoveInfo, IO_Type.HY_TopCylinder_Up, IO_Type.HY_TopCylinder_Down);
LocationCylinderDown(MoveInfo);
ClearTimeoutAlarm("等待托盘到达横移出口");
}
else if (MoveInfo.IsTimeOut())
{
......
......@@ -190,21 +190,6 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error(checkWaitInfo.Name + " [" + checkWaitInfo.MoveStep + "] CheckWait 出错:", ex);
//如果是空指针异常,并且MoveStep=SW06_TopCylinderUp,单独处理
// [2020-08-10 13:32:45,352] [132] ERROR 横移轨道-41 [SW06_TopCylinderUp]
// CheckWait 出错:
//System.IndexOutOfRangeException: 索引超出了数组界限。
// 在 System.Collections.Generic.List`1.Enumerator.MoveNext()
// 在 OnlineStore.DeviceLibrary.LineBean.CheckWait(LineMoveInfo checkWaitInfo) 位置 E:\VSSource\RC1250_佳士达\RC1250-AssemblyLine\source\DeviceLibrary\assemblyLine\LineBean_Partial.cs:行号 89
//if (ex is System.IndexOutOfRangeException)
//{
// if (checkWaitInfo.IsStep(LineMoveStep.SW06_TopCylinderUp))
// {
// LogUtil.error(checkWaitInfo.Name + " 当前步骤:SW06_TopCylinderUp,IndexOutOfRangeException异常,自动回到上一个步骤 SW05_LocationDown,等待500 重新开始 ");
// checkWaitInfo.NextMoveStep(LineMoveStep.SW05_LocationDown);
// checkWaitInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
// }
//}
}
}
#endregion
......
......@@ -215,6 +215,7 @@ namespace OnlineStore.DeviceLibrary
{
if (SecondMoveInfo.IsStep(LineMoveStep.MO_11_CodeRember) && !SecondMoveInfo.IsInWait)
{
ClearTimeoutAlarm("等待空托盘到达超时");
return true;
}
else if (MoveInfo.IsTimeOut(180))
......@@ -911,20 +912,20 @@ namespace OnlineStore.DeviceLibrary
private void MO_16_Stop2Down()
{
//if (LineManager.Line.Move9CanStop2Down(DeviceID,currTrayNum))
if (true)
{
//if (true)
//{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_16_Stop2Down);
CheckLog("托盘放行" + SecondMoveInfo.SLog + " ,阻挡气缸1-2下降 ");
IOMove(IO_Type.StopDown2, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopDown2, IO_VALUE.HIGH));
}
else if (SecondMoveInfo.IsTimeOut(120))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待分流横移1空闲[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
Alarm(LineAlarmType.IoSingleTimeOut);
}
//}
//else if (SecondMoveInfo.IsTimeOut(120))
//{
// WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待分流横移1空闲[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
// LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
// Alarm(LineAlarmType.IoSingleTimeOut);
//}
}
#endregion
......
......@@ -5,9 +5,11 @@ using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary
{
......@@ -39,11 +41,6 @@ namespace OnlineStore.DeviceLibrary
return new List<TrayInfo>(TrayInfoMap.Values);
}
/// <summary>
/// 对应的盘号(1-6)是否有料盘
/// </summary>
/// <param name="trayNum">盘号1-6</param>
/// <returns>盘上是否有料盘</returns>
internal static bool TrayIsFull(int trayNum)
{
if (TrayInfoMap.ContainsKey(trayNum))
......@@ -91,9 +88,10 @@ namespace OnlineStore.DeviceLibrary
}
else
{
TrayInfo fixture = new TrayInfo(trayNum, isFull, inOrOut, param,ngMsg);
TrayInfo fixture = new TrayInfo(trayNum, isFull, inOrOut, param, ngMsg);
TrayInfoMap.TryAdd(trayNum, fixture);
}
SaveMapToFile();
}
public static void UpdateInStoreNG(int trayNum, bool isNg, string msg)
......@@ -104,6 +102,8 @@ namespace OnlineStore.DeviceLibrary
TrayInfoMap[trayNum].InoutPar.InStoreNg = isNg;
TrayInfoMap[trayNum].ShowMsg = msg;
TrayInfoMap[trayNum].LastUpdateTime = DateTime.Now;
SaveMapToFile();
}
}
......@@ -121,20 +121,7 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
/// <summary>
/// 是否还有有料仓正在出库的盘
/// </summary>
internal static bool IsHasFullOutFixture()
{
foreach (int key in TrayInfoMap.Keys)
{
if (TrayInfoMap[key].IsFull && TrayInfoMap[key].InOrOutStore.Equals(2))
{
return true;
}
}
return false;
}
public static bool NeedCheckTray = ConfigAppSettings.GetIntValue(Setting_Init.NeedCheckTray).Equals(1);
internal static bool CheckIsRightNum(int trayNum, int preTrayNum, bool isCanUpdateMax = true)
{
......@@ -158,10 +145,10 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
internal static bool RightTrayCode(int trayNum, int preTrayNum, bool isCanUpdateMax=true)
internal static bool RightTrayCode(int trayNum, int preTrayNum, bool isCanUpdateMax = true)
{
return true;
return CheckIsRightNum(trayNum,preTrayNum,isCanUpdateMax);
return CheckIsRightNum(trayNum, preTrayNum, isCanUpdateMax);
}
internal static void UpdateTrayNumError(int errorStoreID, string errorMsg)
......@@ -172,9 +159,60 @@ namespace OnlineStore.DeviceLibrary
public static void ClearTrayInfo()
{
LogUtil.info("-------------------点击:清空托盘。清空前打印托盘信息:");
List<TrayInfo> tray = TrayManager.getTrayList();
foreach (TrayInfo t in tray)
{
LogUtil.info(t.ToStr());
}
TrayInfoMap = new ConcurrentDictionary<int, TrayInfo>();
LogUtil.info("-------------------点击:清空托盘。托盘内容已清空");
}
private static string FilePath = "";
public static void InitFileData()
{
TrayInfoMap = new ConcurrentDictionary<int, TrayInfo>();
FilePath = Application.StartupPath + ConfigAppSettings.GetValue(Setting_Init.ConfigPath_TrayList);
if (File.Exists(FilePath))
{
LogUtil.info("开始加载文件缓存托盘:" + FilePath);
string[] lines = FileEncoding.GetFileLines(FilePath);
foreach (string line in lines)
{
TrayInfo tray = JsonHelper.DeserializeJsonToObject<TrayInfo>(line);
if (tray != null && tray.TrayNum > 0 && tray.IsFull)
{
LogUtil.info("加载到缓存托盘:" + tray.ToStr());
TrayInfoMap.TryAdd(tray.TrayNum, tray);
}
}
LogUtil.info("托盘加载完成");
}
}
public static void SaveMapToFile()
{
try
{
List<TrayInfo> trayList = new List<TrayInfo>();
List<string> lineList = new List<string>();
foreach (TrayInfo tray in trayList)
{
string line = JsonHelper.SerializeObject(tray);
if (!string.IsNullOrEmpty(line))
{
lineList.Add(line);
}
}
FileEncoding.WritteFile(FilePath, lineList.ToArray());
}
catch (Exception ex)
{
LogUtil.error("SaveTrayToFile出错:" + ex.ToString());
}
}
}
}
......
......@@ -1327,21 +1327,21 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 接驳台托盘放行: 阻挡上升,定位气缸下降,顶升气缸下降
/// 托盘放行: 阻挡上升,定位气缸下降,顶升气缸下降
/// </summary>
JHY_11_TopDown =53011,
/// <summary>
/// 接驳台托盘放行: 等待托盘检测无信号
/// 托盘放行: 等待托盘检测无信号
/// </summary>
JHY_12_WaitTrayLeave ,
/// <summary>
/// 接驳台托盘放行: 延迟500ms后再次等待托盘无信号
/// 托盘放行: 延迟500ms后再次等待托盘无信号
/// </summary>
JHY_13_TrayLeave,
/// <summary>
/// 接驳台托盘放行: 阻挡上升,定位气缸下降,顶升气缸下降
/// 托盘放行: 阻挡上升,定位气缸下降,顶升气缸下降
/// </summary>
JHY_14_TopDown ,
......
......@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary
{
public TrayInfo(int trayNum, bool isFull, int inOrOut = 0, InOutParam inoutParam = null,string ngMsg = "")
{
this.TrayCode = trayNum;
this.TrayNum = trayNum;
this.IsFull = isFull;
this.InOrOutStore = inOrOut;
if (inoutParam == null)
......@@ -47,12 +47,12 @@ namespace OnlineStore.DeviceLibrary
//return "托盘 [" + TrayCode + "] [" + (IsFull ? "有料" : "空") +"] ["+ type +
// "]二维码[" + WareCode + "]库位号[" + PosId + "] [" + PlateW + "X" + PlateH+ "] " + err + " "+ jinji + "" ;
return "托盘 [" + TrayCode + "] [" + LastUpdateTime.ToLongTimeString() + "] [" + (IsFull ? "有料" : "空") + "] [" + type + "]";
return "托盘 [" + TrayNum + "] [" + LastUpdateTime.ToLongTimeString() + "] [" + (IsFull ? "有料" : "空") + "] [" + type + "]";
}
/// <summary>
/// 夹具编码值(1-32?)
/// </summary>
public int TrayCode = -1;
public int TrayNum = -1;
/// <summary>
/// 是否有料盘,true=有料盘
/// </summary>
......@@ -75,7 +75,7 @@ namespace OnlineStore.DeviceLibrary
{
inoutPar = new InOutParam();
}
inoutPar.TrayNumber = TrayCode;
inoutPar.TrayNumber = TrayNum;
return inoutPar;
}
set
......
using System;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
......@@ -8,6 +9,51 @@ namespace OnlineStore.LoadCSVLibrary
{
public class FileEncoding
{
public static bool WritteFile(string filePath, string[] lines)
{
try
{
//备份保存
try
{
if (File.Exists(filePath))
{
FileInfo file = new FileInfo(filePath);
string date = DateTime.Now.ToString("yyyy-MM-dd");
string targetBackPath = @"C:\configBack\" + date + @"\";
if (!Directory.Exists(targetBackPath))
{
Directory.CreateDirectory(targetBackPath);
}
string fileName = file.Name;
string backFile = targetBackPath + fileName;
if (File.Exists(backFile))
{
File.Delete(backFile);
}
File.Copy(filePath, backFile, true);
}
}
catch (Exception e)
{
LogUtil.error(" WritteFile备份文件 filePath 出错:", e);
}
if (File.Exists(filePath))
{
File.Delete(filePath);
}
File.WriteAllLines(filePath, lines, Encoding.UTF8);
}
catch (Exception ex)
{
LogUtil.error(ex.ToString());
return false;
}
return true;
}
public static string[] GetFileLines(string filePath)
{
if (!File.Exists(filePath))
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!