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.
226 lines
6.1 KiB
226 lines
6.1 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Module.DB.Model;
|
|
using Module.Common;
|
|
|
|
namespace Module.Plc.Profinet.Tool
|
|
{
|
|
/// <summary>
|
|
/// PLC配方处理
|
|
/// </summary>
|
|
public class PlcRecipeUtils
|
|
{
|
|
#region 匀胶配方
|
|
|
|
/// <summary>
|
|
/// 通道1中PLC匀胶配方是否可修改
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static bool T1CotRecipeCanEdit()
|
|
{
|
|
bool iRet = false;
|
|
if (PublicParams.T1ConnectPlc)
|
|
{
|
|
int value = PlcCommon.DeltaTcpNetClient01.ReadInt16("D1700").Content;
|
|
char[] results = BitConvert.ToFullBinaryChars(Convert.ToInt16(value));
|
|
if (results[13] == '1')
|
|
{
|
|
iRet = false;
|
|
}
|
|
else
|
|
{
|
|
iRet = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
iRet = true;
|
|
}
|
|
return iRet;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 通道2中PLC匀胶配方是否可修改
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static bool T2CotRecipeCanEdit()
|
|
{
|
|
bool iRet = false;
|
|
if (PublicParams.T2ConnectPlc)
|
|
{
|
|
int value = PlcCommon.DeltaTcpNetClient02.ReadInt16("D1700").Content;
|
|
char[] results = BitConvert.ToFullBinaryChars(Convert.ToInt16(value));
|
|
if (results[13] == '1')
|
|
{
|
|
iRet = false;
|
|
}
|
|
else
|
|
{
|
|
iRet = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
iRet = true;
|
|
}
|
|
return iRet;
|
|
}
|
|
|
|
#endregion 匀胶配方
|
|
|
|
#region 热板1配方
|
|
|
|
/// <summary>
|
|
/// 通道1中热板1配方是否可修改
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static bool T1Hp1RecipeCanEdit()
|
|
{
|
|
bool iRet = false;
|
|
if (PublicParams.T1ConnectPlc)
|
|
{
|
|
int value = PlcCommon.DeltaTcpNetClient01.ReadInt16("D1800").Content;
|
|
char[] results = BitConvert.ToFullBinaryChars(Convert.ToInt16(value));
|
|
if (results[13] == '1')
|
|
{
|
|
iRet = false;
|
|
}
|
|
else
|
|
{
|
|
iRet = true;
|
|
}
|
|
}
|
|
return iRet;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 通道2中热板1配方是否可修改
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static bool T2Hp1RecipeCanEdit()
|
|
{
|
|
bool iRet = false;
|
|
if (PublicParams.T2ConnectPlc)
|
|
{
|
|
int value = PlcCommon.DeltaTcpNetClient02.ReadInt16("D1800").Content;
|
|
char[] results = BitConvert.ToFullBinaryChars(Convert.ToInt16(value));
|
|
if (results[13] == '1')
|
|
{
|
|
iRet = false;
|
|
}
|
|
else
|
|
{
|
|
iRet = true;
|
|
}
|
|
}
|
|
return iRet;
|
|
}
|
|
|
|
#endregion 热板1配方
|
|
|
|
#region 热板2配方
|
|
|
|
/// <summary>
|
|
/// 通道1中热板2配方是否可修改
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static bool T1Hp2RecipeCanEdit()
|
|
{
|
|
bool iRet = false;
|
|
if (PublicParams.T1ConnectPlc)
|
|
{
|
|
int value = PlcCommon.DeltaTcpNetClient01.ReadInt16("D1900").Content;
|
|
char[] results = BitConvert.ToFullBinaryChars(Convert.ToInt16(value));
|
|
if (results[13] == '1')
|
|
{
|
|
iRet = false;
|
|
}
|
|
else
|
|
{
|
|
iRet = true;
|
|
}
|
|
}
|
|
return iRet;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 通道2中热板2配方是否可修改
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static bool T2Hp2RecipeCanEdit()
|
|
{
|
|
bool iRet = false;
|
|
if (PublicParams.T2ConnectPlc)
|
|
{
|
|
int value = PlcCommon.DeltaTcpNetClient02.ReadInt16("D1900").Content;
|
|
char[] results = BitConvert.ToFullBinaryChars(Convert.ToInt16(value));
|
|
if (results[13] == '1')
|
|
{
|
|
iRet = false;
|
|
}
|
|
else
|
|
{
|
|
iRet = true;
|
|
}
|
|
}
|
|
return iRet;
|
|
}
|
|
|
|
#endregion 热板2配方
|
|
|
|
#region 冷板配方
|
|
|
|
/// <summary>
|
|
/// 通道1中冷板配方是否可修改
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static bool T1CpRecipeCanEdit()
|
|
{
|
|
bool iRet = false;
|
|
if (PublicParams.T1ConnectPlc)
|
|
{
|
|
int value = PlcCommon.DeltaTcpNetClient01.ReadInt16("D2000").Content;
|
|
char[] results = BitConvert.ToFullBinaryChars(Convert.ToInt16(value));
|
|
if (results[13] == '1')
|
|
{
|
|
iRet = false;
|
|
}
|
|
else
|
|
{
|
|
iRet = true;
|
|
}
|
|
}
|
|
return iRet;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 通道2中冷板配方是否可修改
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static bool T2CpRecipeCanEdit()
|
|
{
|
|
bool iRet = false;
|
|
if (PublicParams.T2ConnectPlc)
|
|
{
|
|
int value = PlcCommon.DeltaTcpNetClient02.ReadInt16("D2000").Content;
|
|
char[] results = BitConvert.ToFullBinaryChars(Convert.ToInt16(value));
|
|
if (results[13] == '1')
|
|
{
|
|
iRet = false;
|
|
}
|
|
else
|
|
{
|
|
iRet = true;
|
|
}
|
|
}
|
|
return iRet;
|
|
}
|
|
|
|
#endregion 冷板配方
|
|
|
|
}
|
|
}
|