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;
|
using DevComponents.DotNetBar;
|
|
namespace WCS
|
{
|
public partial class plcset : Office2007Form
|
{
|
public int stano = 0;
|
public plcset(int stn)
|
{
|
InitializeComponent();
|
this.Text = "站点:"+stn.ToString()+"--->快速维护";
|
stano = stn;
|
}
|
|
private void set_Click(object sender, EventArgs e)
|
{
|
int idno = 0, destno = 0,seqno=0;
|
int plcno = 0;
|
try
|
{
|
seqno=Common.GetStnSeq(stano);
|
plcno = Common.g_ari_staion_plc_no[seqno] - 1;
|
if (id.Checked == true)
|
{
|
idno = Int32.Parse(this.idval.Text);
|
Common.AddPlcQuereCmd(plcno, "02" + idno.ToString("0000") + stano.ToString("0000") + "0000");
|
//Common.PlcAQueue.Enqueue("02" + idno.ToString("0000") + stano.ToString("0000") + "0000");
|
}
|
else if (dest.Checked == true)
|
{
|
destno = Int32.Parse(this.destval.Text);
|
Common.AddPlcQuereCmd(plcno, "030000" + stano.ToString("0000") + destno.ToString("0000"));
|
//Common.PlcAQueue.Enqueue("030000" + stano.ToString("0000") + destno.ToString("0000"));
|
}
|
else
|
{
|
idno = Int32.Parse(this.idval.Text);
|
destno = Int32.Parse(this.destval.Text);
|
Common.AddPlcQuereCmd(plcno, "04" + idno.ToString("0000") + stano.ToString("0000") + destno.ToString("0000"));
|
//Common.PlcAQueue.Enqueue("04" + idno.ToString("0000") + stano.ToString("0000") + destno.ToString("0000"));
|
}
|
}
|
catch (Exception r)
|
{
|
|
}
|
this.Close();
|
}
|
|
private void idval_TextChanged(object sender, EventArgs e)
|
{
|
try
|
{
|
int i = Int32.Parse(idval.Text);
|
if (i < 0)
|
{
|
iderr.Text = "错误";
|
this.idval.Text = "0";
|
return;
|
}
|
iderr.Text = "";
|
}
|
catch (Exception t)
|
{
|
iderr.Text = "错误";
|
this.idval.Text = "0";
|
return;
|
}
|
}
|
|
private void destval_TextChanged(object sender, EventArgs e)
|
{
|
try
|
{
|
int i = Int32.Parse(destval.Text);
|
if (i < 0)
|
{
|
desterr.Text = "错误";
|
this.destval.Text = "0";
|
return;
|
}
|
desterr.Text = "";
|
}
|
catch (Exception t)
|
{
|
desterr.Text = "错误";
|
this.destval.Text = "0";
|
return;
|
}
|
}
|
|
private void plcset_Load(object sender, EventArgs e)
|
{
|
this.idval.Enabled = true;
|
this.destval.Enabled = false;
|
}
|
|
private void id_Click(object sender, EventArgs e)
|
{
|
this.idval.Enabled = true;
|
this.destval.Enabled = false;
|
}
|
|
private void dest_Click(object sender, EventArgs e)
|
{
|
this.idval.Enabled = false;
|
this.destval.Enabled = true;
|
}
|
|
private void iddest_Click(object sender, EventArgs e)
|
{
|
this.idval.Enabled = true;
|
this.destval.Enabled = true;
|
}
|
|
|
}
|
}
|