Files
gidrolock-configurator/Model.cs

46 lines
1.2 KiB
C#
Raw Normal View History

2024-12-05 15:57:07 +03:00
using System;
using System.Collections.Generic;
namespace Gidrolock_Modbus_Scanner
{
2025-01-21 14:38:59 +03:00
public class Device
2024-12-05 15:57:07 +03:00
{
public string name;
2025-01-14 11:31:23 +03:00
public byte id;
2025-01-17 10:40:18 +03:00
public string modelName;
2025-01-21 14:38:59 +03:00
public Entry valveStatus;
public Entry alarmStatus;
2025-01-17 10:40:18 +03:00
2025-01-21 14:38:59 +03:00
public bool hasCleaningMode;
public Entry cleaningMode;
2025-01-17 10:40:18 +03:00
2025-01-21 14:38:59 +03:00
public bool hasBattery;
public Entry batteryCharge;
public Entry batteryUsed; // питание от баттареи/электросети для устройств с баттареями
public int wiredSensors;
public bool hasScenarioSensor;
2025-01-24 17:54:04 +03:00
public Entry sensorAlarm;
2025-01-21 14:38:59 +03:00
2025-01-24 11:46:36 +03:00
public List<Entry> wiredLineBreak;
2025-01-21 14:38:59 +03:00
public Entry radioStatus;
2025-01-17 10:40:18 +03:00
}
2024-12-05 15:57:07 +03:00
public struct Entry
{
public RegisterType registerType;
public ushort address;
public ushort length;
2024-12-05 15:57:07 +03:00
2025-01-21 14:38:59 +03:00
public Entry(RegisterType registerType, ushort address, ushort length = 1)
2024-12-05 15:57:07 +03:00
{
this.registerType = registerType;
this.address = address;
this.length = length;
}
}
2024-12-09 17:58:37 +03:00
public enum RegisterType { Coil = 1, Discrete = 2, Holding = 3, Input = 4}
2024-12-05 15:57:07 +03:00
}