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.
 
 
 
 
 

58 lines
1.9 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
/// <summary>
/// 緊急停止回應類別
/// </summary>
public class FP053EmergencyOffReportDto : CommonMessage
{
/// <summary>
/// 站點編號
/// </summary>
[Required, JsonPropertyName("station_id"), JsonPropertyOrder(101)]
public List<string> StationID { get; set; }
}
/// <summary>
/// 緊急停止回應類別
/// </summary>
public class TP054EmergencyOffAckDto : CommonMessage
{
/// <summary>
/// 站點編號
/// </summary>
[Required, JsonPropertyName("station_id"), JsonPropertyOrder(101)]
public List<string> StationID { get; set; }
/// <summary>
/// 結果代碼
/// </summary>
/// <value>
/// 0 = OK <br/>
/// 1 = NG <br/>
/// </value>
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
public ReplyCode ReplyCode { get; set; }
/// <summary>
/// 取得緊急停止回應
/// </summary>
/// <param name="transName">交易名稱</param>
/// <param name="softwareID">軟體編號</param>
/// <param name="staionID">站點編號</param>
/// <param name="replyCode">回應代碼</param>
/// <returns>緊急停止回應</returns>
public static TP054EmergencyOffAckDto Get(TransactionName transName, string softwareID, List<string> staionID, ReplyCode replyCode)
{
return new TP054EmergencyOffAckDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
SoftwareID = softwareID,
StationID = staionID,
ReplyCode = replyCode
};
}
}
}