You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
3.6 KiB
114 lines
3.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using DBFactory;
|
|
namespace wcfControlMonitorClient
|
|
{
|
|
/// <summary>
|
|
/// Creator:Richard.liu
|
|
/// 机台状态管理
|
|
/// </summary>
|
|
public partial class FrmWorkstationStatus : Form
|
|
{
|
|
#region 变量定义
|
|
DBOperator dbo = CStaticClass.dbo;
|
|
DBOperator dboM = CStaticClass.dboM;
|
|
Model.MDevice _device = null;
|
|
int _deviceIndex;
|
|
/// <summary>
|
|
/// 设置要显示的设备索引
|
|
/// </summary>
|
|
public int DeviceIndex
|
|
{
|
|
set { _deviceIndex = value;}
|
|
}
|
|
#endregion
|
|
|
|
#region 构造函数/初始化
|
|
public FrmWorkstationStatus()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void FrmDeviceStatus_Load(object sender, EventArgs e)
|
|
{
|
|
btnRefresh_Click(null, EventArgs.Empty);
|
|
}
|
|
#endregion
|
|
|
|
#region 更新设备状态
|
|
private void btnRefresh_Click(object sender, EventArgs e)
|
|
{
|
|
//20100108
|
|
DataView dv;
|
|
try
|
|
{
|
|
_device = Model.CGetInfo.GetDeviceInfo(_deviceIndex);
|
|
//设备索引
|
|
this.lblDeviceIndex.Text = _device.DeviceIndex.ToString();
|
|
//设备名称
|
|
this.lblDeviceName.Text = _device.DeviceName;
|
|
dv = dbo.ExceSQL("SELECT F_Address FROM T_Base_AGV_Gate WHERE (F_AGVGateDeviceIndex = " + _deviceIndex + ")").Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
//AGV地址
|
|
this.lblAGVAddress.Text = dv[0]["F_Address"].ToString();
|
|
}
|
|
dv = dbo.ExceSQL("SELECT F_PALLETBARCODE FROM T_Base_Device WHERE (F_DeviceIndex = " + _deviceIndex + ")").Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
//托盘条码
|
|
|
|
this.lblPALLETBARCODE.Text = dv[0]["F_PALLETBARCODE"].ToString();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv = null;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region 关闭窗体
|
|
private void btnClose_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
#endregion
|
|
|
|
private void button5_Click(object sender, EventArgs e)
|
|
{
|
|
if (MessageBox.Show("您确认【机台无托盘】吗?", "操作提示:", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
|
|
{
|
|
return;
|
|
}
|
|
//20090817给管理置无托盘信息
|
|
dboM.ExecuteSql("UPDATE T_ITEMDEVICE SET devicestatus ='0' WHERE devicecode = '" + _deviceIndex + "'");
|
|
dbo.ExceSQL("UPDATE T_Base_Device SET F_PALLETBARCODE='-',F_HaveGoods = 0 where F_DeviceIndex =" + _deviceIndex);
|
|
}
|
|
|
|
private void button6_Click(object sender, EventArgs e)
|
|
{
|
|
if (MessageBox.Show("您确认【机台有托盘】吗?", "操作提示:", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
|
|
{
|
|
return;
|
|
}
|
|
//20090817给管理置有托盘信息
|
|
dboM.ExecuteSql("UPDATE T_ITEMDEVICE SET devicestatus ='1' WHERE devicecode = '" + _deviceIndex + "'");
|
|
dbo.ExceSQL("UPDATE T_Base_Device SET F_HaveGoods = 1 where F_DeviceIndex =" + _deviceIndex);
|
|
}
|
|
|
|
|
|
}
|
|
}
|