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/HmiChModel.cs

78 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using HslCommunication;
using NewLife.Caching;
using NewLife.Reflection;
namespace Tool.Model
{
public class HmiChModel : BoolModelFactory
{
public HmiChModel() : base("HMI_button_CH_ON[0]", "HMI_button_CH_ON[1]")
{
}
}
public class HmiCqModel : BoolModelFactory
{
public HmiCqModel() : base("HMI_button_CQ_ON[0]", "HMI_button_CQ_ON[1]")
{
}
}
public class HmiLpModel : BoolModelFactory
{
public HmiLpModel() : base("HMI_button_LP_ON[0]", "HMI_button_LP_ON[1]")
{
}
}
public class HmiChAlarm : BoolModelFactory
{
public HmiChAlarm() : base("CH_alarm_A", "CH_alarm_B")
{
}
}
public class HmiCqAlarm : BoolModelFactory
{
public HmiCqAlarm() : base("CQ_alarm_A", "CQ_alarm_B")
{
}
}
public class EsStop
{
public List<bool> GetDb()
{
bool[] bitArray = new bool[32];
var readUInt32 = PlcConnect.Instance.ReadUInt32("estop_temporary_storage");
var bo = readUInt32.IsSuccess;
var context = readUInt32.Content;
if (bo)
{
for (int i = 0; i < 31; i++)
{
bitArray[i] = context.GetBoolByIndex(i);
}
}
return bitArray.ToList();
}
}
}