Commit 602d04fd LN

一键检查料叉功能。出库未检测到物料时自动禁用库位。

1 个父辈 c58170bf
......@@ -808,10 +808,10 @@ namespace DeviceLibrary
string msg = "";
try
{
if (String.IsNullOrEmpty(barcode))
{
return msg;
}
//if (String.IsNullOrEmpty(barcode))
//{
// return msg;
//}
Dictionary<string, string> paramMap = new Dictionary<string, string>
{
{ "posId", poid },//posId:库位号
......@@ -819,7 +819,7 @@ namespace DeviceLibrary
{ "msg", reason }
};
string server = GetAddr(Addr_cancelPutInTask, paramMap);
string server = GetAddr(Addr_disabledPos, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "",3000);
LogUtil.info(deviceName + "DisablePos " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
......
......@@ -54,17 +54,18 @@ namespace DeviceLibrary
string WareCode = "";
int plateH = 0;
bool PreMove = false;
private bool AlarmNeedDisPos = false;
/// <summary>
/// 料盘放置在校准库位是否正常
/// </summary>
bool reelStatusInFix = true;
public bool Start(BoxStorePosition from, BoxStorePosition to, StoreMoveType _storeMoveType, bool premove = false)
public bool Start(BoxStorePosition from, BoxStorePosition to, StoreMoveType _storeMoveType, bool premove = false,bool needDisPos=false )
{
if (MoveInfo.MoveStep != MoveStep.Wait)
return false;
AlarmNeedDisPos = needDisPos;
storeMoveType = _storeMoveType;
PreMove = premove;
if (from == null)
......@@ -73,7 +74,7 @@ namespace DeviceLibrary
plateH = 32;
To = to.clone();
MoveInfo.NewMove(MoveStep.StoreTS10);
MoveInfo.log($"{storeMoveType}:开始运输料盘,直接到:{to.posid}");
MoveInfo.log($"{storeMoveType}:开始运输料盘{WareCode},直接到:{to.posid}, AlarmNeedDisPos=" + AlarmNeedDisPos);
MoveInfo.MoveParam.PosID = $"NA=>{To.posid}";
}
else
......@@ -84,7 +85,7 @@ namespace DeviceLibrary
To = to.clone();
MoveInfo.NewMove(MoveStep.StoreTS01);
MoveInfo.log($"{storeMoveType}:开始运输料盘,从:{from.posid},到:{to.posid}");
MoveInfo.log($"{storeMoveType}:开始运输料盘{WareCode},从:{from.posid},到:{to.posid},AlarmNeedDisPos=" + AlarmNeedDisPos);
MoveInfo.MoveParam.PosID = $"{From.posid}=>{To.posid}";
}
if (To.posid == BoxStorePosition.strings)
......@@ -106,7 +107,7 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.StoreTS06);
return true;
}
private bool isWaitIgnoreX09 = false;
private bool disPos = false;
public bool Process()
{
if (mainMachine.CheckWait(MoveInfo))
......@@ -176,29 +177,32 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.StoreTS09);
InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
IgnoreX09 = false;
isWaitIgnoreX09 = false;
MoveInfo.log($"{storeMoveType}:进出轴去待机点P1【{Config.InOut_P1}】【{Config.InOut_P1_speed}】,设置 isWaitIgnoreX09="+ isWaitIgnoreX09);
disPos = false;
MoveInfo.log($"{storeMoveType}:进出轴去待机点P1【{Config.InOut_P1}】【{Config.InOut_P1_speed}】,设置 IgnoreX09=" + IgnoreX09);
break;
case MoveStep.StoreTS09:
RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(From.posid, WareCode, storeMoveType, FixtureState.FromOut));
if (!IgnoreX09 && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{
isWaitIgnoreX09 = true;
Msg.add(crc.GetString(L.out_store_not_detect_material, "取料后料叉X30没有检测到有物料无法继续,请检查."), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
if (!disPos && storeMoveType.Equals(StoreMoveType.OutStore) && AlarmNeedDisPos )
{
disPos = true;
//屏蔽库位
string pos = From.posid;
MoveInfo.log($"{storeMoveType}:取到料后未检测到物料,AlarmNeedDisPos={AlarmNeedDisPos},需要屏蔽库位:{pos}, WareCode={WareCode}" );
ServerCommunication.DisablePos(Setting_Init.App_CID, WareCode, pos, "IgnoreX09");
}
//RobotManage.UserPause(crc.GetString(L.out_store_not_detect_material, "取料前料叉X30没有检测到有物料无法继续,请检查."));
}
else
{
if (isWaitIgnoreX09 && IgnoreX09&& storeMoveType.Equals(StoreMoveType.OutStore))
{ //屏蔽库位
string pos = From.posid;
MoveInfo.log($"{storeMoveType}:取到料后未检测到物料,点忽略信号继续,需要屏蔽库位:"+pos);
ServerCommunication.DisablePos(Setting_Init.App_CID, WareCode, pos, "IgnoreX09");
}
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
IgnoreX09 = false;
isWaitIgnoreX09 = false;
disPos = false;
if (To.posid == BoxStorePosition.strings && Setting_Init.Enable_Fixpos && Fix != null)
MoveInfo.NextMoveStep(MoveStep.StoreFIX01);
else
......
......@@ -183,8 +183,8 @@ namespace DeviceLibrary
outTo = new BoxStorePosition(Config, StoreSide.NGDoor, StoreMoveInfo.MoveParam);
else
outTo = new BoxStorePosition(Config, StoreSide.String, StoreMoveInfo.MoveParam);
boxTransport.Start(outFrom == null ? null : new BoxStorePosition(Config, outFrom, StoreMoveInfo.MoveParam), outTo, StoreMoveType.OutStore);
StoreMoveInfo.log($"开始转运料盘{(StoreMoveInfo.MoveParam.IsNg ? "单料口" : "料串")}");
boxTransport.Start(outFrom == null ? null : new BoxStorePosition(Config, outFrom, StoreMoveInfo.MoveParam), outTo, StoreMoveType.OutStore,false,true);
StoreMoveInfo.log($"开始转运料盘{(StoreMoveInfo.MoveParam.IsNg ? "单料口" : "料串")}, 未检测到物料时需要屏蔽库位");
break;
case MoveStep.StoreOut11:
......@@ -266,5 +266,18 @@ namespace DeviceLibrary
return state;
}
public bool isInBusy()
{
//出入库 绿闪 黄闪
if (ClampMoveInfo.MoveStep > MoveStep.Wait
|| StoreMoveInfo.MoveStep > MoveStep.Wait
|| (StringMoveInfo.MoveStep > MoveStep.Wait && StringMoveInfo.MoveStep != MoveStep.StringReadyPut && StringMoveInfo.MoveStep <= MoveStep.StringOut_01))
{
return true;
}
return false;
}
}
}
\ No newline at end of file
......@@ -52,6 +52,49 @@ namespace DeviceLibrary
HEND_HomeReset,
/// <summary>
/// 料叉检查功能:进出轴返回待机点P1
/// </summary>
CH01_StartTo,
/// <summary>
/// 料叉检查功能:进出轴返回待机点P1
/// </summary>
CH02_InoutToP1,
/// <summary>
/// 料叉检查功能:旋转轴到NG门位置,升降轴到NG门位置
/// </summary>
CH03_ToTarget,
/// <summary>
/// 料叉检查功能:打开NG门
/// </summary>
CH04_OpenDoor,
/// <summary>
/// 料叉检查功能:进出轴前进
/// </summary>
CH05_InoutToP2,
/// <summary>
/// 料叉检查功能:等待检查,检查完成必须复位
/// </summary>
CH06_WaitCheck,
/// <summary>
/// 料叉检查功能:检查完成
/// </summary>
CH07_CheckOk,
/// <summary>
/// 料叉检查功能: ,进出轴返回待机点
/// </summary>
CH08_InoutBack,
/// <summary>
/// 料叉检查功能: ,NG关闭
/// </summary>
CH09_CloseDoor,
StringLoad_01,
StringLoad_01a,
StringLoad_02,
......
......@@ -31,6 +31,7 @@ namespace TheMachine
{
this.components = new System.ComponentModel.Container();
this.panel1 = new System.Windows.Forms.Panel();
this.btnCheck = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.btnChangeColor = new System.Windows.Forms.Button();
this.btnGree = new System.Windows.Forms.Button();
......@@ -44,12 +45,15 @@ namespace TheMachine
this.configControl1 = new TheMachine.ConfigControl();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.btnCheckOk = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.btnCheckOk);
this.panel1.Controls.Add(this.btnCheck);
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.btnChangeColor);
this.panel1.Controls.Add(this.btnGree);
......@@ -67,9 +71,23 @@ namespace TheMachine
this.panel1.Size = new System.Drawing.Size(1234, 924);
this.panel1.TabIndex = 2;
//
// btnCheck
//
this.btnCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCheck.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCheck.Location = new System.Drawing.Point(16, 453);
this.btnCheck.Name = "btnCheck";
this.btnCheck.Size = new System.Drawing.Size(155, 31);
this.btnCheck.TabIndex = 21;
this.btnCheck.Text = "启动料叉检测";
this.btnCheck.UseVisualStyleBackColor = true;
this.btnCheck.Click += new System.EventHandler(this.btnCheck_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(211, 578);
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(211, 624);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(155, 31);
this.button1.TabIndex = 20;
......@@ -79,7 +97,9 @@ namespace TheMachine
//
// btnChangeColor
//
this.btnChangeColor.Location = new System.Drawing.Point(211, 541);
this.btnChangeColor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnChangeColor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnChangeColor.Location = new System.Drawing.Point(211, 587);
this.btnChangeColor.Name = "btnChangeColor";
this.btnChangeColor.Size = new System.Drawing.Size(155, 31);
this.btnChangeColor.TabIndex = 19;
......@@ -89,7 +109,9 @@ namespace TheMachine
//
// btnGree
//
this.btnGree.Location = new System.Drawing.Point(25, 578);
this.btnGree.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnGree.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnGree.Location = new System.Drawing.Point(25, 624);
this.btnGree.Name = "btnGree";
this.btnGree.Size = new System.Drawing.Size(155, 31);
this.btnGree.TabIndex = 18;
......@@ -99,7 +121,9 @@ namespace TheMachine
//
// btnYellow
//
this.btnYellow.Location = new System.Drawing.Point(25, 541);
this.btnYellow.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnYellow.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnYellow.Location = new System.Drawing.Point(25, 587);
this.btnYellow.Name = "btnYellow";
this.btnYellow.Size = new System.Drawing.Size(155, 31);
this.btnYellow.TabIndex = 17;
......@@ -110,7 +134,7 @@ namespace TheMachine
// lblLed
//
this.lblLed.AutoSize = true;
this.lblLed.Location = new System.Drawing.Point(23, 508);
this.lblLed.Location = new System.Drawing.Point(23, 554);
this.lblLed.Name = "lblLed";
this.lblLed.Size = new System.Drawing.Size(41, 12);
this.lblLed.TabIndex = 16;
......@@ -119,7 +143,7 @@ namespace TheMachine
// lblOkValue
//
this.lblOkValue.AutoSize = true;
this.lblOkValue.Location = new System.Drawing.Point(23, 482);
this.lblOkValue.Location = new System.Drawing.Point(23, 528);
this.lblOkValue.Name = "lblOkValue";
this.lblOkValue.Size = new System.Drawing.Size(65, 12);
this.lblOkValue.TabIndex = 15;
......@@ -128,7 +152,7 @@ namespace TheMachine
// lblSensor
//
this.lblSensor.AutoSize = true;
this.lblSensor.Location = new System.Drawing.Point(23, 456);
this.lblSensor.Location = new System.Drawing.Point(23, 502);
this.lblSensor.Name = "lblSensor";
this.lblSensor.Size = new System.Drawing.Size(65, 12);
this.lblSensor.TabIndex = 14;
......@@ -136,7 +160,9 @@ namespace TheMachine
//
// btnAxisRStop
//
this.btnAxisRStop.Location = new System.Drawing.Point(397, 495);
this.btnAxisRStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisRStop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisRStop.Location = new System.Drawing.Point(397, 541);
this.btnAxisRStop.Name = "btnAxisRStop";
this.btnAxisRStop.Size = new System.Drawing.Size(155, 31);
this.btnAxisRStop.TabIndex = 13;
......@@ -146,7 +172,9 @@ namespace TheMachine
//
// btnAxisRTest
//
this.btnAxisRTest.Location = new System.Drawing.Point(397, 453);
this.btnAxisRTest.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisRTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAxisRTest.Location = new System.Drawing.Point(397, 499);
this.btnAxisRTest.Name = "btnAxisRTest";
this.btnAxisRTest.Size = new System.Drawing.Size(155, 31);
this.btnAxisRTest.TabIndex = 12;
......@@ -176,6 +204,18 @@ namespace TheMachine
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// btnCheckOk
//
this.btnCheckOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCheckOk.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCheckOk.Location = new System.Drawing.Point(211, 453);
this.btnCheckOk.Name = "btnCheckOk";
this.btnCheckOk.Size = new System.Drawing.Size(155, 31);
this.btnCheckOk.TabIndex = 22;
this.btnCheckOk.Text = "检测完成";
this.btnCheckOk.UseVisualStyleBackColor = true;
this.btnCheckOk.Click += new System.EventHandler(this.btnCheckOk_Click);
//
// AxisControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -207,5 +247,7 @@ namespace TheMachine
private System.Windows.Forms.Button btnYellow;
private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btnCheck;
private System.Windows.Forms.Button btnCheckOk;
}
}
......@@ -231,5 +231,52 @@ namespace TheMachine
{
RobotManage.mainMachine.CloseColor();
}
private void btnCheck_Click(object sender, EventArgs e)
{
//判断是否空闲中
if (RobotManage.mainMachine.isInBusy())
{
MessageBox.Show("操作失败:当前忙碌中");
return;
}
if (RobotManage.mainMachine.runStatus != RunStatus.Running)
{
MessageBox.Show("操作失败:设备未在待机状态");
return;
}
DialogResult result=MessageBox.Show("启动料叉检测后需要复位设备,确定启动?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question); ;
if (result.Equals(DialogResult.Yes))
{
LogUtil.info("点击按钮:" + btnCheck.Text + ", 确认开始料叉检测");
RobotManage.mainMachine.StartToCheck();
MessageBox.Show("操作成功:请在料叉到位后进行检查,确认后请点检测完成按钮!");
}
}
private void btnCheckOk_Click(object sender, EventArgs e)
{
if (RobotManage.mainMachine.ResetMoveInfo.IsStep(MoveStep.CH06_WaitCheck))
{
LogUtil.info("点击按钮:" + btnCheck.Text + ", 确认检查完成");
bool result = RobotManage.mainMachine.CheckOk();
LogUtil.info("点击按钮:" + btnCheck.Text + ", CheckOk 结果:" + result);
if(result)
{
MessageBox.Show("操作成功");
}
else
{
MessageBox.Show("操作失败");
}
}
else
{
MessageBox.Show("操作失败");
}
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!