You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

78 lines
2.7 KiB

using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
/// <summary>
/// 鎖定庫區命令派送回報類別
/// </summary>
public class FP045LockStorageDispatchReportDto : CommonMessage
{
/// <summary>
/// 站點編號
/// </summary>
[Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)]
public string StationID { get; set; }
/// <summary>
/// 庫區事件
/// </summary>
/// <remarks>
/// 0 = Lock <br/>
/// 1 = Unlock <br/>
/// </remarks>
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(102)]
public DispatchEvent EventType { get; set; }
}
/// <summary>
/// 鎖定庫區命令派送回應類別
/// </summary>
public class TP046LockStorageDispatchAckDto : CommonMessage
{
/// <summary>
/// 站點編號
/// </summary>
[Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)]
public string StationID { get; set; }
/// <summary>
/// 庫區事件
/// </summary>
/// <remarks>
/// 0 = Lock <br/>
/// 1 = Unlock <br/>
/// </remarks>
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(102)]
public DispatchEvent EventType { get; set; }
/// <summary>
/// 回應代碼
/// </summary>
/// <value>
/// 0 = OK <br/>
/// 1 = NG <br/>
/// </value>
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(103)]
public ReplyCode ReplyCode { get; set; }
/// <summary>
/// 取得鎖定庫區命令派送回應
/// </summary>
/// <param name="transName">交易名稱</param>
/// <param name="softwareID">軟體編號</param>
/// <param name="stationID">站點編號</param>
/// <param name="eventType">事件類別</param>
/// <param name="replyCode">回應代碼</param>
/// <returns>鎖定庫區命令派送回應</returns>
public static TP046LockStorageDispatchAckDto Get(TransactionName transName, string softwareID,
string stationID, DispatchEvent eventType, ReplyCode replyCode)
{
return new TP046LockStorageDispatchAckDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
SoftwareID = softwareID,
StationID = stationID,
EventType = eventType,
ReplyCode = replyCode
};
}
}
}