1321 lines
61 KiB
C#
1321 lines
61 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel;
|
||
using System.Data;
|
||
using System.Drawing;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Windows.Forms;
|
||
|
||
namespace AGVSystem
|
||
{
|
||
public partial class SetControl : Form
|
||
{
|
||
private ClsDBConn_sql db = new ClsDBConn_sql();
|
||
private System.Data.DataSet ds = new System.Data.DataSet();
|
||
private string str_sql = "";
|
||
public SetControl(int w, int h)
|
||
{
|
||
InitializeComponent();
|
||
panel3.Enabled = false;
|
||
panel4.Enabled = false;
|
||
panel5.Enabled = false;
|
||
panel6.Enabled = false;
|
||
panel7.Enabled = false;
|
||
panel8.Enabled = false;
|
||
panel9.Enabled = false;
|
||
panel10.Enabled = false;
|
||
panel11.Enabled = false;
|
||
panel12.Enabled = false;
|
||
panel13.Enabled = false;
|
||
panel14.Enabled = false;
|
||
this.Width = w;
|
||
this.Height = h;
|
||
ds = db.connDt("select CONVERT( VARCHAR(10),id)+' . '+ line_name as info from Assembly_Line order by id");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_standard_line.Items.Add(dr[0].ToString());
|
||
cmb_line1.Items.Add(dr[0].ToString());
|
||
cmb_line2.Items.Add(dr[0].ToString());
|
||
cmb_line3.Items.Add(dr[0].ToString());
|
||
cmb_line4.Items.Add(dr[0].ToString());
|
||
cmb_line5.Items.Add(dr[0].ToString());
|
||
cmb_line6.Items.Add(dr[0].ToString());
|
||
cmb_line7.Items.Add(dr[0].ToString());
|
||
cmb_line8.Items.Add(dr[0].ToString());
|
||
cmb_line9.Items.Add(dr[0].ToString());
|
||
cmb_line10.Items.Add(dr[0].ToString());
|
||
cmb_line11.Items.Add(dr[0].ToString());
|
||
cmb_line12.Items.Add(dr[0].ToString());
|
||
}
|
||
cmb_standard_line.Items.Add("");
|
||
cmb_line1.Items.Add("");
|
||
cmb_line2.Items.Add("");
|
||
cmb_line3.Items.Add("");
|
||
cmb_line4.Items.Add("");
|
||
cmb_line5.Items.Add("");
|
||
cmb_line6.Items.Add("");
|
||
cmb_line7.Items.Add("");
|
||
cmb_line8.Items.Add("");
|
||
cmb_line9.Items.Add("");
|
||
cmb_line10.Items.Add("");
|
||
cmb_line11.Items.Add("");
|
||
cmb_line12.Items.Add("");
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
|
||
private void btn_Click()
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
//if ((cmb_standard_line.Text != "" || cmb_point_id.Text != "" )&& btn.Text == "查询")
|
||
//{
|
||
// if(ds !=null)ds.Tables.Clear();
|
||
// if (cmb_standard_line.Text != "" && cmb_point_id.Text != "")
|
||
// {
|
||
// ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
// " CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号,"+
|
||
// " reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
// " FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
// " where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
// " name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
// " Crossing_LandMark.LandMark_ID= " + cmb_point_id.Text.Split('.')[0] +" and "+
|
||
// " Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0]);
|
||
// }
|
||
// else
|
||
// {
|
||
// ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
// " CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
// " reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
// " FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
// " where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
// " name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
// " Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0]);
|
||
// }
|
||
// if (ds == null) return;
|
||
// if (ds.Tables.Count > 0)
|
||
// {
|
||
// dataGridView1.DataSource = ds.Tables[0];
|
||
// }
|
||
// return;
|
||
//}
|
||
if (cmb_standard_line.Text == "" || cmb_point_id.Text == "")
|
||
{
|
||
MessageBox.Show("请设置线体名称和管控点编号!");
|
||
return;
|
||
}
|
||
if (cmb_line1.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode ) values ("+
|
||
cmb_standard_line.Text.Split('.')[0] + ","+
|
||
cmb_point_id.Text +","+
|
||
cmb_line1.Text.Split('.')[0] +","+
|
||
cmb_value1.Text+",0,"+cmb_rst1.SelectedIndex+")")=="1")
|
||
{
|
||
lab_st1.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st1.Text = "×";
|
||
}
|
||
}
|
||
if (cmb_line2.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode ) values (" +
|
||
cmb_standard_line.Text.Split('.')[0] + "," +
|
||
cmb_point_id.Text + "," +
|
||
cmb_line2.Text.Split('.')[0] + "," +
|
||
cmb_value2.Text + ",0," + cmb_rst2.SelectedIndex + ")") == "1")
|
||
{
|
||
lab_st2.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st2.Text = "×";
|
||
}
|
||
}
|
||
if (cmb_line3.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode ) values (" +
|
||
cmb_standard_line.Text.Split('.')[0] + "," +
|
||
cmb_point_id.Text + "," +
|
||
cmb_line3.Text.Split('.')[0] + "," +
|
||
cmb_value3.Text + ",0,"+cmb_rst3.SelectedIndex+")") == "1")
|
||
{
|
||
lab_st3.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st3.Text = "×";
|
||
}
|
||
}
|
||
if (cmb_line4.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode ) values (" +
|
||
cmb_standard_line.Text.Split('.')[0] + "," +
|
||
cmb_point_id.Text + "," +
|
||
cmb_line4.Text.Split('.')[0] + "," +
|
||
cmb_value4.Text + ",0,"+ cmb_rst4.SelectedIndex +")") == "1")
|
||
{
|
||
lab_st4.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st4.Text = "×";
|
||
}
|
||
}
|
||
if (cmb_line5.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode) values (" +
|
||
cmb_standard_line.Text.Split('.')[0] + "," +
|
||
cmb_point_id.Text + "," +
|
||
cmb_line5.Text.Split('.')[0] + "," +
|
||
cmb_value5.Text + ",0,"+cmb_rst5.SelectedIndex+")") == "1")
|
||
{
|
||
lab_st5.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st5.Text = "×";
|
||
}
|
||
}
|
||
if (cmb_line6.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode ) values (" +
|
||
cmb_standard_line.Text.Split('.')[0] + "," +
|
||
cmb_point_id.Text + "," +
|
||
cmb_line6.Text.Split('.')[0] + "," +
|
||
cmb_value6.Text + ",0,"+cmb_rst6.SelectedIndex+")") == "1")
|
||
{
|
||
lab_st6.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st6.Text = "×";
|
||
}
|
||
}
|
||
if (cmb_line7.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode ) values (" +
|
||
cmb_standard_line.Text.Split('.')[0] + "," +
|
||
cmb_point_id.Text + "," +
|
||
cmb_line7.Text.Split('.')[0] + "," +
|
||
cmb_value7.Text + ",0,"+ cmb_rst7.SelectedIndex +")") == "1")
|
||
{
|
||
lab_st7.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st7.Text = "×";
|
||
}
|
||
}
|
||
if (cmb_line8.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode ) values (" +
|
||
cmb_standard_line.Text.Split('.')[0] + "," +
|
||
cmb_point_id.Text + "," +
|
||
cmb_line8.Text.Split('.')[0] + "," +
|
||
cmb_value8.Text + ",0,"+cmb_rst8.SelectedIndex+")") == "1")
|
||
{
|
||
lab_st8.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st8.Text = "×";
|
||
}
|
||
}
|
||
if (cmb_line9.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode ) values (" +
|
||
cmb_standard_line.Text.Split('.')[0] + "," +
|
||
cmb_point_id.Text + "," +
|
||
cmb_line9.Text.Split('.')[0] + "," +
|
||
cmb_value9.Text + ",0,"+cmb_rst9.SelectedIndex+")") == "1")
|
||
{
|
||
lab_st9.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st9.Text = "×";
|
||
}
|
||
}
|
||
if (cmb_line10.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode ) values (" +
|
||
cmb_standard_line.Text.Split('.')[0] + "," +
|
||
cmb_point_id.Text + "," +
|
||
cmb_line10.Text.Split('.')[0] + "," +
|
||
cmb_value10.Text + ",0," + cmb_rst10.SelectedIndex + ")") == "1")
|
||
{
|
||
lab_st10.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st10.Text = "×";
|
||
}
|
||
}
|
||
if (cmb_line11.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode ) values (" +
|
||
cmb_standard_line.Text.Split('.')[0] + "," +
|
||
cmb_point_id.Text + "," +
|
||
cmb_line11.Text.Split('.')[0] + "," +
|
||
cmb_value11.Text + ",0,"+cmb_rst11.SelectedIndex+")") == "1")
|
||
{
|
||
lab_st11.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st11.Text = "×";
|
||
}
|
||
}
|
||
if (cmb_line12.Text != "")
|
||
{
|
||
if (db.Command("insert into Crossing_LandMark ( Assembly_ID, LandMark_ID, Assembly_ID2, LandMark_ID2, agv_no , Reset_Mode ) values (" +
|
||
cmb_standard_line.Text.Split('.')[0] + "," +
|
||
cmb_point_id.Text + "," +
|
||
cmb_line12.Text.Split('.')[0] + "," +
|
||
cmb_value12.Text + ",0,"+cmb_rst12.SelectedIndex+")") == "1")
|
||
{
|
||
lab_st12.Text = "√";
|
||
}
|
||
else
|
||
{
|
||
lab_st12.Text = "×";
|
||
}
|
||
}
|
||
ds.Tables.Clear();
|
||
str_sql = "SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0];
|
||
|
||
ds = db.connDt(str_sql);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void cmb_standard_line_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_point_id.Items.Clear();
|
||
comboBox1.Items.Clear();
|
||
ds.Tables.Clear();
|
||
lab_plc_value.Text = "";
|
||
if (cmb_standard_line.Text == "") return;
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_standard_line.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_point_id.Items.Add(dr[0].ToString());
|
||
comboBox1.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
cmb_point_id_TextChanged(null,null);
|
||
}
|
||
|
||
private void cmb_point_id_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
lab_plc_value.Text = comboBox1.Items[cmb_point_id.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_line1_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value1.Items.Clear();
|
||
cmb_plc1.Items.Clear();
|
||
cmb_plc1.Text = "";
|
||
cmb_value1.Text = "";
|
||
cmb_rst1.SelectedIndex = 1;
|
||
lab_st1.Text = "";
|
||
if (cmb_line1.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line1.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value1.Items.Add(dr[0].ToString());
|
||
cmb_plc1.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_line2_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value2.Items.Clear();
|
||
cmb_plc2.Items.Clear();
|
||
cmb_plc2.Text = "";
|
||
cmb_value2.Text = "";
|
||
lab_st2.Text = "";
|
||
cmb_rst2.SelectedIndex = 1;
|
||
if (cmb_line2.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line2.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value2.Items.Add(dr[0].ToString());
|
||
cmb_plc2.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_line3_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value3.Items.Clear();
|
||
cmb_plc3.Items.Clear();
|
||
cmb_plc3.Text = "";
|
||
cmb_value3.Text = "";
|
||
lab_st3.Text = "";
|
||
cmb_rst3.SelectedIndex = 1;
|
||
if (cmb_line3.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line3.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value3.Items.Add(dr[0].ToString());
|
||
cmb_plc3.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_line4_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value4.Items.Clear();
|
||
cmb_plc4.Items.Clear();
|
||
cmb_plc4.Text = "";
|
||
cmb_value4.Text = "";
|
||
lab_st4.Text = "";
|
||
cmb_rst4.SelectedIndex = 1;
|
||
if (cmb_line4.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line4.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value4.Items.Add(dr[0].ToString());
|
||
cmb_plc4.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_line5_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value5.Items.Clear();
|
||
cmb_plc5.Items.Clear();
|
||
cmb_plc5.Text = "";
|
||
cmb_value5.Text = "";
|
||
lab_st5.Text = "";
|
||
cmb_rst5.SelectedIndex = 1;
|
||
if (cmb_line5.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line5.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value5.Items.Add(dr[0].ToString());
|
||
cmb_plc5.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_line6_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value6.Items.Clear();
|
||
cmb_plc6.Items.Clear();
|
||
cmb_plc6.Text = "";
|
||
cmb_value6.Text = "";
|
||
lab_st6.Text = "";
|
||
cmb_rst6.SelectedIndex = 1;
|
||
if (cmb_line6.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line6.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value6.Items.Add(dr[0].ToString());
|
||
cmb_plc6.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_value1_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc1.Text = cmb_plc1.Items[cmb_value1.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_value2_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc2.Text = cmb_plc2.Items[cmb_value2.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_value3_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc3.Text = cmb_plc3.Items[cmb_value3.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_value4_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc4.Text = cmb_plc4.Items[cmb_value4.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_value5_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc5.Text = cmb_plc5.Items[cmb_value5.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_value6_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc6.Text = cmb_plc6.Items[cmb_value6.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_point_id_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_line1.Text = "";
|
||
cmb_line2.Text = "";
|
||
cmb_line3.Text = "";
|
||
cmb_line4.Text = "";
|
||
cmb_line5.Text = "";
|
||
cmb_line6.Text = "";
|
||
cmb_line7.Text = "";
|
||
cmb_line8.Text = "";
|
||
cmb_line9.Text = "";
|
||
cmb_line10.Text = "";
|
||
cmb_line11.Text = "";
|
||
cmb_line12.Text = "";
|
||
//if (cmb_point_id.Text == "") return;
|
||
ds.Tables.Clear();
|
||
str_sql = "SELECT CONVERT( VARCHAR(10),name1.ID) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 ";
|
||
if (cmb_standard_line.Text.Split('.')[0] != null && cmb_standard_line.Text.Split('.')[0]!="")
|
||
str_sql = str_sql + " and Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0];
|
||
if (cmb_point_id.Text.Split('.')[0] != null && cmb_point_id.Text.Split('.')[0] !="")
|
||
str_sql = str_sql + " and Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0];
|
||
ds = db.connDt(str_sql);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void dataGridView1_DoubleClick(object sender, EventArgs e)
|
||
{
|
||
if (dataGridView1.RowCount > 0)
|
||
{
|
||
string line_name = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["线体名称"].Value.ToString();
|
||
string loc_id = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["位置编号"].Value.ToString();
|
||
cmb_line1.Text = "";
|
||
cmb_line2.Text = "";
|
||
cmb_line3.Text = "";
|
||
cmb_line4.Text = "";
|
||
cmb_line5.Text = "";
|
||
cmb_line6.Text = "";
|
||
cmb_line7.Text = "";
|
||
cmb_line8.Text = "";
|
||
cmb_line9.Text = "";
|
||
cmb_line10.Text = "";
|
||
cmb_line11.Text = "";
|
||
cmb_line12.Text = "";
|
||
for (int i = 0; i < dataGridView1.RowCount; i++)
|
||
{
|
||
if (dataGridView1.Rows[i].Cells["线体名称"].Value.ToString() == line_name && dataGridView1.Rows[i].Cells["位置编号"].Value.ToString() == loc_id)
|
||
{
|
||
if (cmb_line1.Text == "")
|
||
{
|
||
cmb_line1.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value1.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst1.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
|
||
}
|
||
else if (cmb_line2.Text == "")
|
||
{
|
||
cmb_line2.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value2.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst2.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
}
|
||
else if (cmb_line3.Text == "")
|
||
{
|
||
cmb_line3.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value3.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst3.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
}
|
||
else if (cmb_line4.Text == "")
|
||
{
|
||
cmb_line4.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value4.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst4.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
}
|
||
else if (cmb_line5.Text == "")
|
||
{
|
||
cmb_line5.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value5.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst5.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
}
|
||
else if (cmb_line6.Text == "")
|
||
{
|
||
cmb_line6.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value6.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst6.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
}
|
||
else if (cmb_line7.Text == "")
|
||
{
|
||
cmb_line7.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value7.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst7.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
}
|
||
else if (cmb_line8.Text == "")
|
||
{
|
||
cmb_line8.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value8.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst8.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
}
|
||
else if (cmb_line9.Text == "")
|
||
{
|
||
cmb_line9.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value9.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst9.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
}
|
||
else if (cmb_line10.Text == "")
|
||
{
|
||
cmb_line10.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value10.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst10.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
}
|
||
else if (cmb_line11.Text == "")
|
||
{
|
||
cmb_line11.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value11.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst11.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
}
|
||
else if (cmb_line12.Text == "")
|
||
{
|
||
cmb_line12.Text = dataGridView1.Rows[i].Cells["参考线体"].Value.ToString();
|
||
cmb_value12.Text = dataGridView1.Rows[i].Cells["参考位置编号"].Value.ToString();
|
||
cmb_rst12.SelectedIndex = Convert.ToInt16(dataGridView1.Rows[i].Cells["复位模式"].Value.ToString());
|
||
}
|
||
panel3.Enabled = false;
|
||
panel4.Enabled = false;
|
||
panel5.Enabled = false;
|
||
panel6.Enabled = false;
|
||
panel7.Enabled = false;
|
||
panel8.Enabled = false;
|
||
panel9.Enabled = false;
|
||
panel10.Enabled = false;
|
||
panel11.Enabled = false;
|
||
panel12.Enabled = false;
|
||
panel13.Enabled = false;
|
||
panel14.Enabled = false;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void btn_del1_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line1.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value1.Text) == "1")
|
||
{
|
||
lab_st1.Text = "√";
|
||
cmb_line1.Text = "";
|
||
cmb_value1.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st1.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void btn_del2_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line2.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value2.Text) == "1")
|
||
{
|
||
lab_st2.Text = "√";
|
||
cmb_line2.Text = "";
|
||
cmb_value2.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st2.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void btn_del3_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line3.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value3.Text) == "1")
|
||
{
|
||
lab_st3.Text = "√";
|
||
cmb_line3.Text = "";
|
||
cmb_value3.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st3.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void btn_del4_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line4.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value4.Text) == "1")
|
||
{
|
||
lab_st4.Text = "√";
|
||
cmb_line4.Text = "";
|
||
cmb_value4.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st4.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void btn_del5_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line5.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value5.Text) == "1")
|
||
{
|
||
lab_st5.Text = "√";
|
||
cmb_line5.Text = "";
|
||
cmb_value5.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st5.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void btn_del6_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line6.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value6.Text) == "1")
|
||
{
|
||
lab_st6.Text = "√";
|
||
cmb_line6.Text = "";
|
||
cmb_value6.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st6.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void groupBox2_Enter(object sender, EventArgs e)
|
||
{
|
||
|
||
}
|
||
|
||
private void cmb_line7_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value7.Items.Clear();
|
||
cmb_plc7.Items.Clear();
|
||
cmb_plc7.Text = "";
|
||
cmb_value7.Text = "";
|
||
lab_st7.Text = "";
|
||
cmb_rst7.SelectedIndex = 1;
|
||
if (cmb_line7.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line7.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value7.Items.Add(dr[0].ToString());
|
||
cmb_plc7.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_line8_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value8.Items.Clear();
|
||
cmb_plc8.Items.Clear();
|
||
cmb_plc8.Text = "";
|
||
cmb_value8.Text = "";
|
||
lab_st8.Text = "";
|
||
cmb_rst8.SelectedIndex = 1;
|
||
if (cmb_line8.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line8.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value8.Items.Add(dr[0].ToString());
|
||
cmb_plc8.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_line9_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value9.Items.Clear();
|
||
cmb_plc9.Items.Clear();
|
||
cmb_plc9.Text = "";
|
||
cmb_value9.Text = "";
|
||
lab_st9.Text = "";
|
||
cmb_rst9.SelectedIndex = 1;
|
||
if (cmb_line9.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line9.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value9.Items.Add(dr[0].ToString());
|
||
cmb_plc9.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_line10_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value10.Items.Clear();
|
||
cmb_plc10.Items.Clear();
|
||
cmb_plc10.Text = "";
|
||
cmb_value10.Text = "";
|
||
lab_st10.Text = "";
|
||
cmb_rst10.SelectedIndex = 1;
|
||
if (cmb_line10.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line10.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value10.Items.Add(dr[0].ToString());
|
||
cmb_plc10.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_line11_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value11.Items.Clear();
|
||
cmb_plc11.Items.Clear();
|
||
cmb_plc11.Text = "";
|
||
cmb_value11.Text = "";
|
||
lab_st11.Text = "";
|
||
cmb_rst11.SelectedIndex = 1;
|
||
if (cmb_line11.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line11.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value11.Items.Add(dr[0].ToString());
|
||
cmb_plc11.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_line12_TextChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_value12.Items.Clear();
|
||
cmb_plc12.Items.Clear();
|
||
cmb_plc12.Text = "";
|
||
cmb_value12.Text = "";
|
||
lab_st12.Text = "";
|
||
cmb_rst12.SelectedIndex = 1;
|
||
if (cmb_line12.Text == "") return;
|
||
|
||
ds = db.connDt("SELECT distinct [Loc_ID] ,[Flag_Value] FROM [LandMarkInfo] where [Assembly_Line] = " + cmb_line12.Text.Split('.')[0] + " and Assembly_ID <>0");
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||
{
|
||
cmb_value12.Items.Add(dr[0].ToString());
|
||
cmb_plc12.Items.Add(dr[1].ToString());
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void cmb_value7_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc7.Text = cmb_plc7.Items[cmb_value7.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_value8_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc8.Text = cmb_plc8.Items[cmb_value8.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_value9_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc9.Text = cmb_plc9.Items[cmb_value9.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_value10_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc10.Text = cmb_plc10.Items[cmb_value10.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_value11_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc11.Text = cmb_plc11.Items[cmb_value11.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void cmb_value12_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
cmb_plc12.Text = cmb_plc12.Items[cmb_value12.SelectedIndex].ToString();
|
||
}
|
||
|
||
private void btn_del7_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line7.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value7.Text) == "1")
|
||
{
|
||
lab_st7.Text = "√";
|
||
cmb_line7.Text = "";
|
||
cmb_value7.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st7.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void btn_del8_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line8.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value8.Text) == "1")
|
||
{
|
||
lab_st8.Text = "√";
|
||
cmb_line8.Text = "";
|
||
cmb_value8.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st8.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void btn_del9_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line9.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value9.Text) == "1")
|
||
{
|
||
lab_st9.Text = "√";
|
||
cmb_line9.Text = "";
|
||
cmb_value9.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st9.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void btn_del10_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line10.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value10.Text) == "1")
|
||
{
|
||
lab_st10.Text = "√";
|
||
cmb_line10.Text = "";
|
||
cmb_value10.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st10.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号,"+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void btn_del11_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line11.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value11.Text) == "1")
|
||
{
|
||
lab_st11.Text = "√";
|
||
cmb_line11.Text = "";
|
||
cmb_value11.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st11.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void btn_del12_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
if (db.Command("delete from Crossing_LandMark where assembly_id = " + cmb_standard_line.Text.Split('.')[0] +
|
||
" and landmark_id = " + cmb_point_id.Text +
|
||
" and assembly_id2 = " + cmb_line12.Text.Split('.')[0] +
|
||
" and landmark_id2 = " + cmb_value12.Text) == "1")
|
||
{
|
||
lab_st12.Text = "√";
|
||
cmb_line12.Text = "";
|
||
cmb_value12.Text = "";
|
||
}
|
||
else
|
||
{
|
||
lab_st12.Text = "×";
|
||
}
|
||
ds.Tables.Clear();
|
||
ds = db.connDt("SELECT CONVERT( VARCHAR(10),name1.id) +' . '+ name1.line_name as 线体名称, Crossing_LandMark.LandMark_ID as 位置编号, " +
|
||
" CONVERT( VARCHAR(10),name2.id) +' . '+ name2.line_name as 参考线体, Crossing_LandMark.LandMark_ID2 as 参考位置编号, "+
|
||
" reset_mode as 复位模式 ,Crossing_LandMark.agv_no AS 当前路口AGV " +
|
||
" FROM Crossing_LandMark, Assembly_Line as name1 , Assembly_Line as name2 " +
|
||
" where name1.id = Crossing_LandMark.Assembly_ID and " +
|
||
" name2.id = Crossing_LandMark.Assembly_ID2 and " +
|
||
" Crossing_LandMark.Assembly_id= " + cmb_standard_line.Text.Split('.')[0] + " and " +
|
||
" Crossing_LandMark.landmark_id= " + cmb_point_id.Text.Split('.')[0]);
|
||
if (ds.Tables.Count > 0)
|
||
{
|
||
dataGridView1.DataSource = ds.Tables[0];
|
||
}
|
||
}
|
||
|
||
private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
|
||
{
|
||
|
||
}
|
||
|
||
private void toolStripButton5_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
panel3.Enabled = true;
|
||
panel4.Enabled = true;
|
||
panel5.Enabled = true;
|
||
panel6.Enabled = true;
|
||
panel7.Enabled = true;
|
||
panel8.Enabled = true;
|
||
panel9.Enabled = true;
|
||
panel10.Enabled = true;
|
||
panel11.Enabled = true;
|
||
panel12.Enabled = true;
|
||
panel13.Enabled = true;
|
||
panel14.Enabled = true;
|
||
|
||
}
|
||
|
||
private void toolStripButton6_Click(object sender, EventArgs e)
|
||
{
|
||
if (Cls.Param.UserName_temp == "")
|
||
{
|
||
MessageBox.Show("请登录管理员权限!", "AGV调度管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||
return;
|
||
}
|
||
btn_Click();
|
||
panel3.Enabled = false;
|
||
panel4.Enabled = false;
|
||
panel5.Enabled = false;
|
||
panel6.Enabled = false;
|
||
panel7.Enabled = false;
|
||
panel8.Enabled = false;
|
||
panel9.Enabled = false;
|
||
panel10.Enabled = false;
|
||
panel11.Enabled = false;
|
||
panel12.Enabled = false;
|
||
panel13.Enabled = false;
|
||
panel14.Enabled = false;
|
||
}
|
||
|
||
private void splitContainer1_Panel1_Paint(object sender, PaintEventArgs e)
|
||
{
|
||
|
||
}
|
||
|
||
private void toolStripButton4_Click(object sender, EventArgs e)
|
||
{
|
||
|
||
}
|
||
|
||
|
||
}
|
||
}
|