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.
 
 
 
 
 

57 lines
1.9 KiB

using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
/// <summary>
/// 執行命令回報類別
/// </summary>
public class FP003ExecuteCommandReportDto : CommonMessage
{
/// <summary>
/// 設備編號
/// </summary>
[Required, StringLength(10), JsonPropertyName("vehicle_id"), JsonPropertyOrder(101)]
public string VehicleID { get; set; }
/// <summary>
/// 任務起始時間
/// </summary>
[Required, JsonPropertyName("start_time"), JsonPropertyOrder(102)]
public DateTime StartTime { get; set; }
}
/// <summary>
/// 執行命令回應類別
/// </summary>
public class TP004ExecuteCommandAckDto : CommonMessage
{
/// <summary>
/// 回應代碼
/// </summary>
/// <value>
/// 0 = OK <br/>
/// 1 = NG <br/>
/// </value>
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(101)]
public ReplyCode ReplyCode { get; set; }
/// <summary>
/// 取得執行命令回應
/// </summary>
/// <param name="transName">交易名稱</param>
/// <param name="softwareID">軟體編號</param>
/// <param name="taskID">任務編號</param>
/// <param name="replyCode">回應代碼</param>
/// <returns>執行命令回應</returns>
public static TP004ExecuteCommandAckDto Get(TransactionName transName, string softwareID, string taskID, ReplyCode replyCode)
{
return new TP004ExecuteCommandAckDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
SoftwareID = softwareID,
TaskID = taskID,
ReplyCode = replyCode
};
}
}
}