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.
CaiQie/Tool/Model/HmiPoint.cs

208 lines
6.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using HslCommunication;
namespace Tool.Model
{
public class HmiPoint
{
/// <summary>
/// DInt 供料电机速度
/// </summary>
public static readonly string feeding_motor_speed = "feeding_motor_speed";
public static UInt32 GetFeedingMotorSpeed => GetValue(feeding_motor_speed);
/// <summary>
/// DInt 层合电机速度
/// </summary>
public static readonly string Laminated_motor_speed = "Laminated_motor_speed";
public static UInt32 GetLaminatedMotorSpeed => GetValue(Laminated_motor_speed);
/// <summary>
/// DInt 毛毡带电机速度
/// </summary>
public static readonly string Felt_belt_motor_speed = "Felt_belt_motor_speed";
public static UInt32 GetFeltBeltMotorSpeed => GetValue(Felt_belt_motor_speed);
/// <summary>
/// DInt 收料电机1速度
/// </summary>
public static readonly string Receiving_Electric_motor_speed = "Receiving_Electric_motor_speed";
public static UInt32 GeReceivingMotorSpeed => GetValue(Receiving_Electric_motor_speed);
/// <summary>
/// 层合生产数量
/// </summary>
public static readonly string Product_counter2 = "Product_counter2";
public static UInt32 GetProduct_counter2 => GetValue(Product_counter2);
/// <summary>
/// 裁切1生产数量
/// </summary>
public static readonly string CQ_Chip1_counter = "CQ_Chip1_counter";
public static UInt32 GetCQ_Chip1_counter => GetValue(CQ_Chip1_counter);
/// <summary>
/// 裁切2生产数量
/// </summary>
public static readonly string CQ_Chip2_counter = "CQ_Chip2_counter";
public static UInt32 GetCQ_Chip2_counter => GetValue(CQ_Chip2_counter);
/// <summary>
/// 裁刀1温度
/// </summary>
public static readonly string QDWD1SS = "QDWD1SS";
public static UInt32 GetQDWD1SS => GetValue(QDWD1SS);
/// <summary>
/// 裁刀1温度
/// </summary>
public static readonly string QDWD2SS = "QDWD2SS";
public static UInt32 GetQDWD2SS => GetValue(QDWD2SS);
/// <summary>
/// 设备内部温度
/// </summary>
public static readonly string SWSS = "SWSS";
public static UInt32 GetSWSS => GetValue(SWSS);
private static UInt32 GetValue(string key)
{
var plc = PlcConnect.Instance;
var result = plc.ReadUInt32(key);
return result.IsSuccess ? result.Content : (uint)0;
}
public static readonly string CUTTING_SET_TEMPERATURE1_1 = "CUTTING_SET_TEMPERATURE1_1";
public static UInt32 GetCUTTING_SET_TEMPERATURE1_1 => GetValue(CUTTING_SET_TEMPERATURE1_1);
public static readonly string CUTTING_SET_TEMPERATURE1_2 = "CUTTING_SET_TEMPERATURE1_2";
public static UInt32 GetCUTTING_SET_TEMPERATURE1_2 => GetValue(CUTTING_SET_TEMPERATURE1_2);
public static readonly string CUTTING_SET_TEMPERATURE1_3 = "CUTTING_SET_TEMPERATURE1_3";
public static UInt32 GetCUTTING_SET_TEMPERATURE1_3 => GetValue(CUTTING_SET_TEMPERATURE1_3);
public static readonly string CUTTING_SET_TEMPERATURE1_4 = "CUTTING_SET_TEMPERATURE1_4";
public static UInt32 GetCUTTING_SET_TEMPERATURE1_4 => GetValue(CUTTING_SET_TEMPERATURE1_4);
public static readonly string CUTTING_SET_TEMPERATURE2_1 = "CUTTING_SET_TEMPERATURE2_1";
public static UInt32 GetCUTTING_SET_TEMPERATURE2_1 => GetValue(CUTTING_SET_TEMPERATURE2_1);
public static readonly string CUTTING_SET_TEMPERATURE2_2 = "CUTTING_SET_TEMPERATURE2_2";
public static UInt32 GetCUTTING_SET_TEMPERATURE2_2 => GetValue(CUTTING_SET_TEMPERATURE2_2);
public static readonly string CUTTING_SET_TEMPERATURE2_3 = "CUTTING_SET_TEMPERATURE2_3";
public static UInt32 GetCUTTING_SET_TEMPERATURE2_3 => GetValue(CUTTING_SET_TEMPERATURE2_3);
public static readonly string CUTTING_SET_TEMPERATURE2_4 = "CUTTING_SET_TEMPERATURE2_4";
public static UInt32 GetCUTTING_SET_TEMPERATURE2_4 => GetValue(CUTTING_SET_TEMPERATURE2_4);
public static readonly string CUTTING_SET_TIME1_1 = "CUTTING_SET_TIME1_1";
public static UInt32 GetCUTTING_SET_TIME1_1 => GetValue(CUTTING_SET_TIME1_1);
public static readonly string CUTTING_SET_TIME1_2 = "CUTTING_SET_TIME1_2";
public static UInt32 GetCUTTING_SET_TIME1_2 => GetValue(CUTTING_SET_TIME1_2);
public static readonly string CUTTING_SET_TIME1_3 = "CUTTING_SET_TIME1_3";
public static UInt32 GetCUTTING_SET_TIME1_3 => GetValue(CUTTING_SET_TIME1_3);
public static readonly string CUTTING_SET_TIME1_4 = "CUTTING_SET_TIME1_4";
public static UInt32 GetCUTTING_SET_TIME1_4 => GetValue(CUTTING_SET_TIME1_4);
public static readonly string CUTTING_SET_TIME2_1 = "CUTTING_SET_TIME2_1";
public static UInt32 GetCUTTING_SET_TIME2_1 => GetValue(CUTTING_SET_TIME2_1);
public static readonly string CUTTING_SET_TIME2_2 = "CUTTING_SET_TIME2_2";
public static UInt32 GetCUTTING_SET_TIME2_2 => GetValue(CUTTING_SET_TIME2_2);
public static readonly string CUTTING_SET_TIME2_3 = "CUTTING_SET_TIME2_3";
public static UInt32 GetCUTTING_SET_TIME2_3 => GetValue(CUTTING_SET_TIME2_3);
public static readonly string CUTTING_SET_TIME2_4 = "CUTTING_SET_TIME2_4";
public static UInt32 GetCUTTING_SET_TIME2_4 => GetValue(CUTTING_SET_TIME2_4);
public static String GetStateText()
{
string text = "";
var plc = PlcConnect.Instance;
var result = plc.ReadUInt32("status_indicator");
if (result.IsSuccess)
{
var context = result.Content;
switch (context)
{
case 0:
text = "异常";
break;
case 1:
text = "手动模式";
break;
case 2:
text = "自动模式";
break;
case 3:
text = "自动运行中";
break;
case 4:
text = "停止";
break;
case 5:
text = "安全回路正常";
break;
}
}
return text;
}
}
}