bro how tf did I make this work before
This commit is contained in:
72
Model.cs
72
Model.cs
@@ -1,82 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
||||
namespace Gidrolock_Modbus_Scanner
|
||||
{
|
||||
public class Device :
|
||||
public class Device
|
||||
{
|
||||
public string name;
|
||||
public byte id;
|
||||
public string modelName;
|
||||
public List<Entry> entries;
|
||||
|
||||
public Device(string name, string modelName)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
public Entry valveStatus;
|
||||
public Entry alarmStatus;
|
||||
|
||||
}
|
||||
public bool hasCleaningMode;
|
||||
public Entry cleaningMode;
|
||||
|
||||
public interface IHasWiredSensors
|
||||
{
|
||||
Entry GetAlarmStatuses();
|
||||
Entry GetSignalLoss();
|
||||
}
|
||||
public interface IHasWirelessSensors
|
||||
{
|
||||
Entry GetWirelessSensors();
|
||||
Entry GetSensors();
|
||||
}
|
||||
public interface IHasEmergencyOpen
|
||||
{
|
||||
void EmergencyOpen();
|
||||
public bool hasBattery;
|
||||
public Entry batteryCharge;
|
||||
public Entry batteryUsed; // питание от баттареи/электросети для устройств с баттареями
|
||||
|
||||
public int wiredSensors;
|
||||
public bool hasScenarioSensor;
|
||||
public Entry sensorsAlarm;
|
||||
|
||||
public Entry wiredLineBreak;
|
||||
|
||||
public Entry radioStatus;
|
||||
}
|
||||
|
||||
public struct Entry
|
||||
{
|
||||
public string name;
|
||||
public RegisterType registerType;
|
||||
public ushort address;
|
||||
public ushort length;
|
||||
public string dataType;
|
||||
public List<string> labels;
|
||||
public Dictionary<string, string> valueParse;
|
||||
public bool readOnce;
|
||||
public bool isModbusID;
|
||||
|
||||
public Entry(string name, RegisterType registerType, ushort address, ushort length = 1, string dataType = "uint16", List<string> labels = null, Dictionary<string, string> valueParse = null, bool readOnce = false, bool isModbusID = false)
|
||||
public Entry(RegisterType registerType, ushort address, ushort length = 1)
|
||||
{
|
||||
this.name = name;
|
||||
this.registerType = registerType;
|
||||
this.address = address;
|
||||
this.length = length;
|
||||
this.dataType = dataType;
|
||||
this.labels = labels;
|
||||
this.valueParse = valueParse;
|
||||
|
||||
this.readOnce = readOnce;
|
||||
this.isModbusID = isModbusID;
|
||||
}
|
||||
}
|
||||
public struct CheckEntry
|
||||
{
|
||||
public RegisterType registerType;
|
||||
public ushort address;
|
||||
public ushort length;
|
||||
public string dataType;
|
||||
public string expectedValue;
|
||||
public CheckEntry(RegisterType registerType, ushort address, ushort length, string dataType, string expectedValue)
|
||||
{
|
||||
this.registerType = registerType;
|
||||
this.address = address;
|
||||
this.length = length;
|
||||
this.dataType = dataType;
|
||||
this.expectedValue = expectedValue;
|
||||
}
|
||||
}
|
||||
public enum RegisterType { Coil = 1, Discrete = 2, Holding = 3, Input = 4}
|
||||
|
||||
Reference in New Issue
Block a user