-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
220 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Zeus.Enums.Devices; | ||
using Zeus.Enums.SerialPorts; | ||
using Zeus.Models.Base.Commands; | ||
|
||
namespace Zeus.Models.Devices.Commands | ||
{ | ||
public sealed class CreateDeviceCommand : BaseCreateCommand | ||
{ | ||
public int LocationId { get; init; } | ||
public string Name { get; init; } | ||
public DeviceType Type { get; init; } | ||
public byte ModbusId { get; init; } | ||
public BoundRate RsBoundRate { get; init; } | ||
public DataBits RsDataBits { get; init; } | ||
public Parity RsParity { get; init; } | ||
public StopBits RsStopBits { get; init; } | ||
public bool IncludeReport { get; init; } | ||
|
||
public CreateDeviceCommand() | ||
{ | ||
Name = string.Empty; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Zeus.Enums.Devices; | ||
using Zeus.Enums.SerialPorts; | ||
using Zeus.Models.Base.Commands; | ||
|
||
namespace Zeus.Models.Devices.Commands | ||
{ | ||
public sealed class UpdateDeviceCommand : BaseUpdateCommand | ||
{ | ||
public int LocationId { get; init; } | ||
public string Name { get; init; } | ||
public DeviceType Type { get; init; } | ||
public byte ModbusId { get; init; } | ||
public BoundRate RsBoundRate { get; init; } | ||
public DataBits RsDataBits { get; init; } | ||
public Parity RsParity { get; init; } | ||
public StopBits RsStopBits { get; init; } | ||
public bool IncludeReport { get; init; } | ||
|
||
public UpdateDeviceCommand() | ||
{ | ||
Name = string.Empty; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Zeus.Enums.Devices; | ||
using Zeus.Enums.SerialPorts; | ||
using Zeus.Models.Base.Dto; | ||
|
||
namespace Zeus.Models.Devices.Dto | ||
{ | ||
public sealed class DeviceDto : BaseDto | ||
{ | ||
public int LocationId { get; init; } | ||
public string Name { get; init; } | ||
public string SerialNumber { get; init; } | ||
public DeviceType Type { get; init; } | ||
public byte ModbusId { get; init; } | ||
public BoundRate RsBoundRate { get; init; } | ||
public DataBits RsDataBits { get; init; } | ||
public Parity RsParity { get; init; } | ||
public StopBits RsStopBits { get; init; } | ||
public bool IncludeReport { get; init; } | ||
|
||
public DeviceDto() | ||
{ | ||
Name = string.Empty; | ||
SerialNumber = string.Empty; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Zeus.Models.Base.Dto; | ||
|
||
namespace Zeus.Models.Devices.Dto | ||
{ | ||
public sealed class DeviceHistoryDto : BaseHistoryDto | ||
{ | ||
public string Name { get; init; } | ||
public string LocationName { get; init; } | ||
public string Type { get; init; } | ||
public string ModbusId { get; init; } | ||
public string RsBoundRate { get; init; } | ||
public string RsDataBits { get; init; } | ||
public string RsParity { get; init; } | ||
public string RsStopBits { get; init; } | ||
public bool IncludeReport { get; init; } | ||
|
||
public DeviceHistoryDto() | ||
{ | ||
Name = string.Empty; | ||
LocationName = string.Empty; | ||
Type = string.Empty; | ||
ModbusId = string.Empty; | ||
RsBoundRate = string.Empty; | ||
RsDataBits = string.Empty; | ||
RsParity = string.Empty; | ||
RsStopBits = string.Empty; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Zeus.Enums.Devices; | ||
using Zeus.Enums.Plcs; | ||
using Zeus.Models.Base.Dto; | ||
|
||
namespace Zeus.Models.Devices.Dto | ||
{ | ||
public sealed class DeviceReportDto : BaseReportDto | ||
{ | ||
public int LocationId { get; init; } | ||
public string Name { get; init; } | ||
public DeviceType Type { get; init; } | ||
|
||
public PlcType PlcType => | ||
Type switch | ||
{ | ||
DeviceType.Kamstrup or DeviceType.KamstrupRs500 => PlcType.Meter, | ||
DeviceType.Rvd145Co or DeviceType.Rvd145CoCwu => PlcType.Rvd145, | ||
_ => PlcType.None | ||
}; | ||
|
||
public bool IsPlc => | ||
Type != DeviceType.Kamstrup && | ||
Type != DeviceType.KamstrupRs500; | ||
|
||
public bool IsCo => | ||
Type == DeviceType.ClimatixCo || | ||
Type == DeviceType.ClimatixCoCwu || | ||
Type == DeviceType.Rvd145Co || | ||
Type == DeviceType.Rvd145CoCwu; | ||
|
||
public bool IsCwu => | ||
Type == DeviceType.ClimatixCoCwu || | ||
Type == DeviceType.Rvd145CoCwu; | ||
|
||
public DeviceReportDto() | ||
{ | ||
Name = string.Empty; | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Zeus.Models/Devices/Queries/GetDeviceBoundRateDictionaryQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Collections.Generic; | ||
using MediatR; | ||
|
||
namespace Zeus.Models.Devices.Queries | ||
{ | ||
public sealed class GetDeviceBoundRateDictionaryQuery : IRequest<IEnumerable<KeyValuePair<int, string>>> | ||
{ | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Zeus.Models/Devices/Queries/GetDeviceDataBitDictionaryQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Collections.Generic; | ||
using MediatR; | ||
|
||
namespace Zeus.Models.Devices.Queries | ||
{ | ||
public sealed class GetDeviceDataBitDictionaryQuery : IRequest<IEnumerable<KeyValuePair<int, string>>> | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections.Generic; | ||
using MediatR; | ||
using Zeus.Models.Devices.Dto; | ||
|
||
namespace Zeus.Models.Devices.Queries | ||
{ | ||
public sealed class GetDeviceHistoryQuery : IRequest<IEnumerable<DeviceHistoryDto>> | ||
{ | ||
public int DeviceId { get; init; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Zeus.Models/Devices/Queries/GetDeviceParityDictionaryQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Collections.Generic; | ||
using MediatR; | ||
|
||
namespace Zeus.Models.Devices.Queries | ||
{ | ||
public sealed class GetDeviceParityDictionaryQuery : IRequest<IEnumerable<KeyValuePair<int, string>>> | ||
{ | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Zeus.Models/Devices/Queries/GetDeviceStopBitDictionaryQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Collections.Generic; | ||
using MediatR; | ||
|
||
namespace Zeus.Models.Devices.Queries | ||
{ | ||
public sealed class GetDeviceStopBitDictionaryQuery : IRequest<IEnumerable<KeyValuePair<int, string>>> | ||
{ | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Zeus.Models/Devices/Queries/GetDeviceTypeDictionaryQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Collections.Generic; | ||
using MediatR; | ||
|
||
namespace Zeus.Models.Devices.Queries | ||
{ | ||
public sealed class GetDeviceTypeDictionaryQuery : IRequest<IEnumerable<KeyValuePair<int, string>>> | ||
{ | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Zeus.Models/Devices/Queries/GetDevicesFromLocationQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections.Generic; | ||
using MediatR; | ||
using Zeus.Models.Devices.Dto; | ||
|
||
namespace Zeus.Models.Devices.Queries | ||
{ | ||
public sealed class GetDevicesFromLocationQuery : IRequest<IEnumerable<DeviceDto>> | ||
{ | ||
public int LocationId { get; init; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Collections.Generic; | ||
using MediatR; | ||
using Zeus.Models.Devices.Dto; | ||
|
||
namespace Zeus.Models.Devices.Queries | ||
{ | ||
public sealed class GetDevicesQuery : IRequest<IEnumerable<DeviceDto>> | ||
{ | ||
} | ||
} |