34 lines
1.6 KiB
C#
34 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace AGVSystem.Cls
|
|
{
|
|
class Path_Reset
|
|
{
|
|
public static void label12_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
if (((System.Windows.Forms.Label)sender).Tag.ToString() == "")
|
|
return;
|
|
if (MessageBox.Show("是否复位该路口?", "消息", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) return;
|
|
int[] num = new int[2];
|
|
num[0] = Convert.ToInt16(((System.Windows.Forms.Label)sender).Tag.ToString().Split('-')[0]);
|
|
num[1] = Convert.ToInt16(((System.Windows.Forms.Label)sender).Tag.ToString().Split('-')[1]);
|
|
for (int i = 0; i < mainfrm.ds_CrossInfo.Tables[0].Rows.Count; i++)
|
|
{
|
|
string s = mainfrm.ds_CrossInfo.Tables[0].Rows[i]["当前地标编号"].ToString();
|
|
string a = mainfrm.ds_CrossInfo.Tables[0].Rows[i]["AGV编号"].ToString();
|
|
if (mainfrm.ds_CrossInfo.Tables[0].Rows[i]["当前产线编号"].ToString() == num[0].ToString() &&
|
|
mainfrm.ds_CrossInfo.Tables[0].Rows[i]["当前地标编号"].ToString() == num[1].ToString() &&
|
|
mainfrm.ds_CrossInfo.Tables[0].Rows[i]["AGV编号"].ToString() != "0")
|
|
{
|
|
MessageBox.Show("AGV-" + mainfrm.ds_CrossInfo.Tables[0].Rows[i]["AGV编号"].ToString() + "占用路口信息被清除!");
|
|
mainfrm.ds_CrossInfo.Tables[0].Rows[i]["AGV编号"] = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|