山东时代原料后WCS代码
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.

74 lines
2.0 KiB

using DBFactory;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace wcfControlMonitorClient
{
public partial class AGVStationChange : Form
{
public int DeviceIdx = 0;
DBOperator dbo = CStaticClass.dbo;
DBOperator dboM = CStaticClass.dboM;
public AGVStationChange()
{
InitializeComponent();
}
public AGVStationChange( int device)
{
InitializeComponent();
DeviceIdx= device;
}
//无
//已离开
//取货申请
//取货中
//取货完成
//放货申请
//放货中
//放货完成
private void savebutton_Click(object sender, EventArgs e)
{
int status = 0;
switch(AGVStatus.Text){
case "无":
status = 3;
break;
case "已离开":
status = 9;
break;
case "取货申请":
status = 6;
break;
case "取货中":
status = 1;
break;
case "取货完成":
status = 2;
break;
case "放货申请":
status = 7;
break;
case "放货中":
status = 4;
break;
case "放货完成":
status = 5;
break;
}
int count= dbo.ExecuteSql($"update T_AGVIOStation set F_AGVStatus={status} where F_PLCOtherDevice ={DeviceIdx}");
if (count == 1) {
MessageBox.Show("下发AGV状态给PLC信息成功!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}