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.
70 lines
2.4 KiB
70 lines
2.4 KiB
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Mirle.Component.API.ProgrammableLogicController.Models
|
|
{
|
|
/// <summary>
|
|
/// 清除異常回報類別
|
|
/// </summary>
|
|
public class FP029ResetAlarmReportDto : CommonMessage
|
|
{
|
|
/// <summary>
|
|
/// 異常代碼
|
|
/// </summary>
|
|
[Required, StringLength(10), JsonPropertyName("alarm_code"), JsonPropertyOrder(101)]
|
|
public string AlarmCode { get; set; }
|
|
/// <summary>
|
|
/// 設備編號
|
|
/// </summary>
|
|
[Required, StringLength(10), JsonPropertyName("vehicle_id"), JsonPropertyOrder(102)]
|
|
public string VehicleID { get; set; }
|
|
/// <summary>
|
|
/// 異常清除時間
|
|
/// </summary>
|
|
[Required, JsonPropertyName("end_time"), JsonPropertyOrder(103)]
|
|
public DateTime EndTime { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 清除異常回應類別
|
|
/// </summary>
|
|
public class TP030ResetAlarmAckDto : CommonMessage
|
|
{
|
|
/// <summary>
|
|
/// 異常代碼
|
|
/// </summary>
|
|
[Required, StringLength(10), JsonPropertyName("alarm_code"), JsonPropertyOrder(101)]
|
|
public string AlarmCode { get; set; }
|
|
/// <summary>
|
|
/// 回應代碼
|
|
/// </summary>
|
|
/// <value>
|
|
/// 0 = OK <br/>
|
|
/// 1 = NG <br/>
|
|
/// </value>
|
|
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(102)]
|
|
public ReplyCode ReplyCode { get; set; }
|
|
/// <summary>
|
|
/// 取得清除異常回應
|
|
/// </summary>
|
|
/// <param name="transName">交易名稱</param>
|
|
/// <param name="softwareID">軟體編號</param>
|
|
/// <param name="taskID">任務編號</param>
|
|
/// <param name="alarmCode">異常代碼</param>
|
|
/// <param name="replyCode">回應代碼</param>
|
|
/// <returns>清除異常回應</returns>
|
|
public static TP030ResetAlarmAckDto Get(TransactionName transName, string softwareID, string taskID,
|
|
string alarmCode, ReplyCode replyCode)
|
|
{
|
|
return new TP030ResetAlarmAckDto()
|
|
{
|
|
Timetick = DateTime.Now,
|
|
TransactionName = transName.ToTransactionName(),
|
|
SoftwareID = softwareID,
|
|
TaskID = taskID,
|
|
AlarmCode = alarmCode,
|
|
ReplyCode = replyCode
|
|
};
|
|
}
|
|
}
|
|
}
|