You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Net.NetworkInformation;
|
|
using System.Text;
|
|
using System.Linq;
|
|
using System.Data;
|
|
using System.Threading;
|
|
using Mesnac.Action.Base;
|
|
using Mesnac.Controls.Base;
|
|
using System.Windows.Forms;
|
|
using Mesnac.Codd.Session;
|
|
using System.IO;
|
|
|
|
namespace Mesnac.Action.Feeding.ProducingPlan
|
|
{
|
|
/// <summary>
|
|
/// 系统复位
|
|
/// </summary>
|
|
public class SystemReset : WritePLCAction, IAction
|
|
{
|
|
private string youliaobiaozhi = "是否存在物料";
|
|
private string fuweibiaozhi = "系统复位标志";
|
|
public void Run(RuntimeParameter runtime)
|
|
{
|
|
base.LogDebug("系统复位...");
|
|
return;
|
|
|
|
if (MessageBox.Show("确认系统复位吗?", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
|
|
{
|
|
return;
|
|
}
|
|
int iExistsMaterial = 0;
|
|
object[] readBuff = null;
|
|
if (base.ProcessRead(base.GetDeviceDesignDataName(youliaobiaozhi), out readBuff))
|
|
{
|
|
MessageBox.Show("数据读取失败!");
|
|
return;
|
|
}
|
|
iExistsMaterial = Convert.ToInt32(readBuff[0].ToString());
|
|
if (iExistsMaterial == 1)
|
|
{
|
|
MessageBox.Show("存在物料,不能进行复位!");
|
|
return;
|
|
}
|
|
if (!base.ProcessWrite(base.GetDeviceDesignDataName(fuweibiaozhi), new object[1] { 1 }))
|
|
{
|
|
MessageBox.Show("写入复位标志失败!");
|
|
return;
|
|
}
|
|
MessageBox.Show("写入复位标志成功!");
|
|
}
|
|
}
|
|
} |