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.
405 lines
18 KiB
405 lines
18 KiB
using System;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Mirle.Component.API.ProgrammableLogicController.Models
|
|
{
|
|
/// <summary>
|
|
/// 交易名稱列舉
|
|
/// </summary>
|
|
[JsonConverter(typeof(JsonStringEnumConverter))]
|
|
public enum TransactionName
|
|
{
|
|
/// <summary>
|
|
/// 建立命令請求
|
|
/// </summary>
|
|
TP_001_CreateCommandRequest,
|
|
/// <summary>
|
|
/// 建立命令回應
|
|
/// </summary>
|
|
FP_002_CreateCommandResponse,
|
|
/// <summary>
|
|
/// 執行命令回報
|
|
/// </summary>
|
|
FP_003_ExecuteCommandReport,
|
|
/// <summary>
|
|
/// 執行命令回應
|
|
/// </summary>
|
|
TP_004_ExecuteCommandAck,
|
|
/// <summary>
|
|
/// 完成命令回報
|
|
/// </summary>
|
|
FP_005_FinishCommandReport,
|
|
/// <summary>
|
|
/// 完成命令回應
|
|
/// </summary>
|
|
TP_006_FinishCommandAck,
|
|
/// <summary>
|
|
/// 取消命令請求
|
|
/// </summary>
|
|
TP_007_CancelCommandRequest,
|
|
/// <summary>
|
|
/// 取消命令回應
|
|
/// </summary>
|
|
FP_008_CancelCommandResponse,
|
|
/// <summary>
|
|
/// 建立取放貨請求
|
|
/// </summary>
|
|
TP_009_CreateLoadUnloadRequest,
|
|
/// <summary>
|
|
/// 建立取放貨回應
|
|
/// </summary>
|
|
FP_010_CreateLoadUnloadResponse,
|
|
/// <summary>
|
|
/// 完成取放貨回報
|
|
/// </summary>
|
|
TP_011_FinishLoadUnloadReport,
|
|
/// <summary>
|
|
/// 完成取放貨回應
|
|
/// </summary>
|
|
FP_012_FinishLoadUnloadAck,
|
|
/// <summary>
|
|
/// 允許取放貨回報
|
|
/// </summary>
|
|
FP_013_PermitLoadUnloadReport,
|
|
/// <summary>
|
|
/// 允許取放貨回應
|
|
/// </summary>
|
|
TP_014_PermitLoadUnloadAck,
|
|
/// <summary>
|
|
/// 確認載具編號請求
|
|
/// </summary>
|
|
FP_015_CheckCarrierIDRequest,
|
|
/// <summary>
|
|
/// 確認載具編號回應
|
|
/// </summary>
|
|
TP_016_CheckCarruerIDResponse,
|
|
/// <summary>
|
|
/// 棧板供收狀態回報
|
|
/// </summary>
|
|
FP_017_PalletSupplyStatusReport,
|
|
/// <summary>
|
|
/// 棧板供收狀態回應
|
|
/// </summary>
|
|
TP_018_PalletSupplyStatusAck,
|
|
/// <summary>
|
|
/// 移動台車狀態請求
|
|
/// </summary>
|
|
TP_019_MoveCarStatusRequest,
|
|
/// <summary>
|
|
/// 移動台車狀態回應
|
|
/// </summary>
|
|
FP_020_MoveCarStatusResponse,
|
|
/// <summary>
|
|
/// 呼叫電梯請求
|
|
/// </summary>
|
|
TP_021_CallLifterRequest,
|
|
/// <summary>
|
|
/// 呼叫電梯回應
|
|
/// </summary>
|
|
FP_022_CallLifterResponse,
|
|
/// <summary>
|
|
/// 電梯抵達回報
|
|
/// </summary>
|
|
FP_023_ArrivedLifterReport,
|
|
/// <summary>
|
|
/// 電梯抵達回應
|
|
/// </summary>
|
|
TP_024_ArrivedLifterAck,
|
|
/// <summary>
|
|
/// 電梯貨物檢知回報
|
|
/// </summary>
|
|
TP_025_CheckLifterItemReport,
|
|
/// <summary>
|
|
/// 電梯貨物檢知回應
|
|
/// </summary>
|
|
FP_026_CheckLifterItemAck,
|
|
/// <summary>
|
|
/// 發生異常回報
|
|
/// </summary>
|
|
FP_027_HappenAlarmReport,
|
|
/// <summary>
|
|
/// 發生異常回應
|
|
/// </summary>
|
|
TP_028_HappenAlarmAck,
|
|
/// <summary>
|
|
/// 清除異常回報
|
|
/// </summary>
|
|
FP_029_ResetAlarmReport,
|
|
/// <summary>
|
|
/// 清除異常回應
|
|
/// </summary>
|
|
TP_030_ResetAlarmAck,
|
|
/// <summary>
|
|
/// 使用維修門請求
|
|
/// </summary>
|
|
FP_031_UseRepairDoorRequest,
|
|
/// <summary>
|
|
/// 使用維修門回應
|
|
/// </summary>
|
|
TP_032_UseRepairDoorResponse,
|
|
/// <summary>
|
|
/// 釋放維修門回報
|
|
/// </summary>
|
|
TP_033_ReleaseRepairDoorReport,
|
|
/// <summary>
|
|
/// 釋放維修門回應
|
|
/// </summary>
|
|
FP_034_ReleaseRepairDoorAck,
|
|
/// <summary>
|
|
/// 維修門狀態回報
|
|
/// </summary>
|
|
FP_035_RepairDoorStatusReport,
|
|
/// <summary>
|
|
/// 維修門狀態回應
|
|
/// </summary>
|
|
TP_036_RepairDoorStatusAck,
|
|
/// <summary>
|
|
/// 使用鐵捲門請求
|
|
/// </summary>
|
|
TP_037_UseRollingDoorRequest,
|
|
/// <summary>
|
|
/// 使用鐵捲門回應
|
|
/// </summary>
|
|
FP_038_UseRollingDoorResponse,
|
|
/// <summary>
|
|
/// 鐵捲門狀態回報
|
|
/// </summary>
|
|
FP_039_RollingDoorStatusReport,
|
|
/// <summary>
|
|
/// 鐵捲門狀態回應
|
|
/// </summary>
|
|
TP_040_RollingDoorStatusAck,
|
|
/// <summary>
|
|
/// 心跳包請求
|
|
/// </summary>
|
|
FP_041_HeartbeatReport,
|
|
/// <summary>
|
|
/// 心跳包回應
|
|
/// </summary>
|
|
TP_042_HeartbeatAck,
|
|
/// <summary>
|
|
/// 操作模式回報
|
|
/// </summary>
|
|
FP_043_OperationModeReport,
|
|
/// <summary>
|
|
/// 操作模式回應
|
|
/// </summary>
|
|
TP_044_OperationModeAck,
|
|
/// <summary>
|
|
/// 鎖定庫區命令派送回報
|
|
/// </summary>
|
|
FP_045_LockStorageDispatchReport,
|
|
/// <summary>
|
|
/// 鎖定庫區命令派送回應
|
|
/// </summary>
|
|
TP_046_LockStorageDispatchAck,
|
|
/// <summary>
|
|
/// 量測物料重量請求
|
|
/// </summary>
|
|
TP_047_MaterialWeightRequest,
|
|
/// <summary>
|
|
/// 量測物料重量回應
|
|
/// </summary>
|
|
FP_048_MaterialWeightResponse,
|
|
/// <summary>
|
|
/// 消防警訊通知回報
|
|
/// </summary>
|
|
FP_049_FireAlarmNotifyReport,
|
|
/// <summary>
|
|
/// 消防警訊通知回應
|
|
/// </summary>
|
|
TP_050_FireAlarmNotifyAck,
|
|
/// <summary>
|
|
/// 緊急應變請求
|
|
/// </summary>
|
|
TP_051_EmergencyEventRequest,
|
|
/// <summary>
|
|
/// 緊急應變回應
|
|
/// </summary>
|
|
FP_052_EmergencyEventResponse,
|
|
/// <summary>
|
|
/// 緊急停止回報
|
|
/// </summary>
|
|
FP_053_EmergencyOffReport,
|
|
/// <summary>
|
|
/// 緊急停止回應
|
|
/// </summary>
|
|
TP_054_EmergencyoffAck,
|
|
/// <summary>
|
|
/// 建立電梯命令請求
|
|
/// </summary>
|
|
TP_055_CreateLifterCommandRequest,
|
|
/// <summary>
|
|
/// 建立電梯命令回應
|
|
/// </summary>
|
|
FP_056_CreateLifterCommandResponse,
|
|
/// <summary>
|
|
/// 完成電梯命令回報
|
|
/// </summary>
|
|
FP_057_FinishLifterCommandReport,
|
|
/// <summary>
|
|
/// 完成電梯命令回應
|
|
/// </summary>
|
|
TP_058_FinishLifterCommandAck,
|
|
/// <summary>
|
|
/// 取消電梯命令請求
|
|
/// </summary>
|
|
TP_059_CancelLifterCommandRequest,
|
|
/// <summary>
|
|
/// 取消電梯命令回應
|
|
/// </summary>
|
|
FP_060_CancelLifterCommandResponse
|
|
}
|
|
/// <summary>
|
|
/// 交易名稱擴充方法類別
|
|
/// </summary>
|
|
public static class TransactionNameExtension
|
|
{
|
|
/// <summary>
|
|
/// 轉轉換成交易識別碼
|
|
/// </summary>
|
|
/// <param name="transactionName">交易名稱列舉項目</param>
|
|
/// <returns>交易識別碼</returns>
|
|
/// <exception cref="ArgumentException">未知交易名稱列舉項目</exception>
|
|
public static string ToTransactionName(this TransactionName transactionName)
|
|
{
|
|
return (transactionName) switch
|
|
{
|
|
TransactionName.TP_001_CreateCommandRequest => "TP001",
|
|
TransactionName.FP_002_CreateCommandResponse => "FP002",
|
|
TransactionName.FP_003_ExecuteCommandReport => "FP003",
|
|
TransactionName.TP_004_ExecuteCommandAck => "TP004",
|
|
TransactionName.FP_005_FinishCommandReport => "FP005",
|
|
TransactionName.TP_006_FinishCommandAck => "TP006",
|
|
TransactionName.TP_007_CancelCommandRequest => "TP007",
|
|
TransactionName.FP_008_CancelCommandResponse => "FP008",
|
|
TransactionName.TP_009_CreateLoadUnloadRequest => "TP009",
|
|
TransactionName.FP_010_CreateLoadUnloadResponse => "FP010",
|
|
TransactionName.TP_011_FinishLoadUnloadReport => "TP011",
|
|
TransactionName.FP_012_FinishLoadUnloadAck => "FP012",
|
|
TransactionName.FP_013_PermitLoadUnloadReport => "FP013",
|
|
TransactionName.TP_014_PermitLoadUnloadAck => "TP014",
|
|
TransactionName.FP_015_CheckCarrierIDRequest => "FP015",
|
|
TransactionName.TP_016_CheckCarruerIDResponse => "TP016",
|
|
TransactionName.FP_017_PalletSupplyStatusReport => "FP017",
|
|
TransactionName.TP_018_PalletSupplyStatusAck => "TP018",
|
|
TransactionName.TP_019_MoveCarStatusRequest => "TP019",
|
|
TransactionName.FP_020_MoveCarStatusResponse => "FP020",
|
|
TransactionName.TP_021_CallLifterRequest => "TP021",
|
|
TransactionName.FP_022_CallLifterResponse => "FP022",
|
|
TransactionName.FP_023_ArrivedLifterReport => "FP023",
|
|
TransactionName.TP_024_ArrivedLifterAck => "TP024",
|
|
TransactionName.TP_025_CheckLifterItemReport => "TP025",
|
|
TransactionName.FP_026_CheckLifterItemAck => "FP026",
|
|
TransactionName.FP_027_HappenAlarmReport => "FP027",
|
|
TransactionName.TP_028_HappenAlarmAck => "TP028",
|
|
TransactionName.FP_029_ResetAlarmReport => "FP029",
|
|
TransactionName.TP_030_ResetAlarmAck => "TP030",
|
|
TransactionName.FP_031_UseRepairDoorRequest => "FP031",
|
|
TransactionName.TP_032_UseRepairDoorResponse => "TP032",
|
|
TransactionName.TP_033_ReleaseRepairDoorReport => "TP033",
|
|
TransactionName.FP_034_ReleaseRepairDoorAck => "FP034",
|
|
TransactionName.FP_035_RepairDoorStatusReport => "FP035",
|
|
TransactionName.TP_036_RepairDoorStatusAck => "TP036",
|
|
TransactionName.TP_037_UseRollingDoorRequest => "TP037",
|
|
TransactionName.FP_038_UseRollingDoorResponse => "FP038",
|
|
TransactionName.FP_039_RollingDoorStatusReport => "FP039",
|
|
TransactionName.TP_040_RollingDoorStatusAck => "TP040",
|
|
TransactionName.FP_041_HeartbeatReport => "FP041",
|
|
TransactionName.TP_042_HeartbeatAck => "TP042",
|
|
TransactionName.FP_043_OperationModeReport => "FP043",
|
|
TransactionName.TP_044_OperationModeAck => "TP044",
|
|
TransactionName.FP_045_LockStorageDispatchReport => "FP045",
|
|
TransactionName.TP_046_LockStorageDispatchAck => "TP046",
|
|
TransactionName.TP_047_MaterialWeightRequest => "TP047",
|
|
TransactionName.FP_048_MaterialWeightResponse => "FP048",
|
|
TransactionName.FP_049_FireAlarmNotifyReport => "FP049",
|
|
TransactionName.TP_050_FireAlarmNotifyAck => "TP050",
|
|
TransactionName.TP_051_EmergencyEventRequest => "TP051",
|
|
TransactionName.FP_052_EmergencyEventResponse => "FP052",
|
|
TransactionName.FP_053_EmergencyOffReport => "FP053",
|
|
TransactionName.TP_054_EmergencyoffAck => "TP054",
|
|
TransactionName.TP_055_CreateLifterCommandRequest => "TP055",
|
|
TransactionName.FP_056_CreateLifterCommandResponse => "FP056",
|
|
TransactionName.FP_057_FinishLifterCommandReport => "FP057",
|
|
TransactionName.TP_058_FinishLifterCommandAck => "TP058",
|
|
TransactionName.TP_059_CancelLifterCommandRequest => "TP059",
|
|
TransactionName.FP_060_CancelLifterCommandResponse => "FP060",
|
|
_ => throw new ArgumentException($"Unknow transaction name: {transactionName}")
|
|
};
|
|
}
|
|
/// <summary>
|
|
/// 轉換成 WEB API URL
|
|
/// </summary>
|
|
/// <param name="transactionName">交易名稱列舉項目</param>
|
|
/// <returns>WEB API URL</returns>
|
|
/// <exception cref="ArgumentException">未知交易名稱列舉項目</exception>
|
|
public static string ToUrl(this TransactionName transactionName)
|
|
{
|
|
return (transactionName) switch
|
|
{
|
|
TransactionName.TP_001_CreateCommandRequest => "PLCC/ToPLCC/CREATE_COMMAND",
|
|
TransactionName.FP_002_CreateCommandResponse => "PLCC/FromPLCC/CREATE_COMMAND",
|
|
TransactionName.FP_003_ExecuteCommandReport => "PLCC/FromPLCC/EXECUTE_COMMAND",
|
|
TransactionName.TP_004_ExecuteCommandAck => "PLCC/ToPLCC/EXECUTE_COMMAND",
|
|
TransactionName.FP_005_FinishCommandReport => "PLCC/FromPLCC/FINISH_COMMAND",
|
|
TransactionName.TP_006_FinishCommandAck => "PLCC/ToPLCC/FINISH_COMMAND",
|
|
TransactionName.TP_007_CancelCommandRequest => "PLCC/ToPLCC/CANCEL_COMMAND",
|
|
TransactionName.FP_008_CancelCommandResponse => "PLCC/FromPLCC/CANCEL_COMMAND",
|
|
TransactionName.TP_009_CreateLoadUnloadRequest => "PLCC/ToPLCC/CREATE_LOAD_UNLOAD",
|
|
TransactionName.FP_010_CreateLoadUnloadResponse => "PLCC/FromPLCC/CREATE_LOAD_UNLOAD",
|
|
TransactionName.TP_011_FinishLoadUnloadReport => "PLCC/ToPLCC/FINISH_LOAD_UNLOAD",
|
|
TransactionName.FP_012_FinishLoadUnloadAck => "PLCC/FromPLCC/FINISH_LOAD_UNLOAD",
|
|
TransactionName.FP_013_PermitLoadUnloadReport => "PLCC/FromPLCC/PERMIT_LOAD_UNLOAD",
|
|
TransactionName.TP_014_PermitLoadUnloadAck => "PLCC/ToPLCC/PERMIT_LOAD_UNLOAD",
|
|
TransactionName.FP_015_CheckCarrierIDRequest => "PLCC/FromPLCC/CHECK_CARRIER_ID",
|
|
TransactionName.TP_016_CheckCarruerIDResponse => "PLCC/ToPLCC/CHECK_CARRIER_ID",
|
|
TransactionName.FP_017_PalletSupplyStatusReport => "PLCC/FromPLCC/PALLET_SUPPLY_STATUS",
|
|
TransactionName.TP_018_PalletSupplyStatusAck => "PLCC/ToPLCC/PALLET_SUPPLY_STATUS",
|
|
TransactionName.TP_019_MoveCarStatusRequest => "PLCC/ToPLCC/MOVE_CAR_STATUS",
|
|
TransactionName.FP_020_MoveCarStatusResponse => "PLCC/FromPLCC/MOVE_CAR_STATUS",
|
|
TransactionName.TP_021_CallLifterRequest => "PLCC/ToPLCC/CALL_LIFTER",
|
|
TransactionName.FP_022_CallLifterResponse => "PLCC/FromPLCC/CALL_LIFTER",
|
|
TransactionName.FP_023_ArrivedLifterReport => "PLCC/FromPLCC/ARRIVED_LIFTER",
|
|
TransactionName.TP_024_ArrivedLifterAck => "PLCC/ToPLCC/ARRIVED_LIFTER",
|
|
TransactionName.TP_025_CheckLifterItemReport => "PLCC/ToPLCC/CHECK_LIFTER_ITEM",
|
|
TransactionName.FP_026_CheckLifterItemAck => "PLCC/FromPLCC/CHECK_LIFTER_ITEM",
|
|
TransactionName.FP_027_HappenAlarmReport => "PLCC/FromPLCC/HAPPEN_ALARM",
|
|
TransactionName.TP_028_HappenAlarmAck => "PLCC/ToPLCC/HAPPEN_ALARM",
|
|
TransactionName.FP_029_ResetAlarmReport => "PLCC/FromPLCC/RESET_ALARM",
|
|
TransactionName.TP_030_ResetAlarmAck => "PLCC/ToPLCC/RESET_ALARM",
|
|
TransactionName.FP_031_UseRepairDoorRequest => "PLCC/FromPLCC/USE_REPAIR_DOOR",
|
|
TransactionName.TP_032_UseRepairDoorResponse => "PLCC/ToPLCC/USE_REPAIR_DOOR",
|
|
TransactionName.TP_033_ReleaseRepairDoorReport => "PLCC/ToPLCC/RELEASE_REPAIR_DOOR",
|
|
TransactionName.FP_034_ReleaseRepairDoorAck => "PLCC/FromPLCC/RELEASE_REPAIR_DOOR",
|
|
TransactionName.FP_035_RepairDoorStatusReport => "PLCC/FromPLCC/REPAIR_DOOR_STATUS",
|
|
TransactionName.TP_036_RepairDoorStatusAck => "PLCC/ToPLCC/REPAIR_DOOR_STATUS",
|
|
TransactionName.TP_037_UseRollingDoorRequest => "PLCC/ToPLCC/USE_ROLLING_DOOR",
|
|
TransactionName.FP_038_UseRollingDoorResponse => "PLCC/FromPLCC/USE_ROLLING_DOOR",
|
|
TransactionName.FP_039_RollingDoorStatusReport => "PLCC/FromPLCC/ROLLING_DOOR_STATUS",
|
|
TransactionName.TP_040_RollingDoorStatusAck => "PLCC/ToPLCC/ROLLING_DOOR_STATUS",
|
|
TransactionName.FP_041_HeartbeatReport => "PLCC/FromPLCC/HEARTBEAT",
|
|
TransactionName.TP_042_HeartbeatAck => "PLCC/ToPLCC/HEARTBEAT",
|
|
TransactionName.FP_043_OperationModeReport => "PLCC/FromPLCC/OPERATION_MODE",
|
|
TransactionName.TP_044_OperationModeAck => "PLCC/ToPLCC/OPERATION_MODE",
|
|
TransactionName.FP_045_LockStorageDispatchReport => "PLCC/FromPLCC/LOCK_STORAGE_DISPATCH",
|
|
TransactionName.TP_046_LockStorageDispatchAck => "PLCC/ToPLCC/LOCK_STORAGE_DISPATCH",
|
|
TransactionName.TP_047_MaterialWeightRequest => "PLCC/FromPLCC/MATERIAL_WEIGHT",
|
|
TransactionName.FP_048_MaterialWeightResponse => "PLCC/ToPLCC/MATERIAL_WEIGHT",
|
|
TransactionName.FP_049_FireAlarmNotifyReport => "PLCC/FromPLCC/FIRE_ALARM_NOTIFY",
|
|
TransactionName.TP_050_FireAlarmNotifyAck => "PLCC/ToPLCC/FIRE_ALARM_NOTIFY",
|
|
TransactionName.TP_051_EmergencyEventRequest => "PLCC/ToPLCC/EMERGRNCY_EVENT",
|
|
TransactionName.FP_052_EmergencyEventResponse => "PLCC/FromPLCC/EMERGENCY_ENVET",
|
|
TransactionName.FP_053_EmergencyOffReport => "PLCC/FromPLCC/EMERGENCY_OFF",
|
|
TransactionName.TP_054_EmergencyoffAck => "PLCC/ToPLCC/EMERGENCY_OFF",
|
|
TransactionName.TP_055_CreateLifterCommandRequest => "PLCC/ToPLCC/CREATE_LIFTER_COMMAND",
|
|
TransactionName.FP_056_CreateLifterCommandResponse => "PLCC/FromPLCC/CREATE_LIFTER_COMMAND",
|
|
TransactionName.FP_057_FinishLifterCommandReport => "PLCC/FromPLCC/FINISH_LIFTER_COMMAND",
|
|
TransactionName.TP_058_FinishLifterCommandAck => "PLCC/ToPLCC/FINISH_LIFTER_COMMAND",
|
|
TransactionName.TP_059_CancelLifterCommandRequest => "PLCC/ToPLCC/CANCLE_LIFTER_COMMAND",
|
|
TransactionName.FP_060_CancelLifterCommandResponse => "PLCC/FromPLCC/CANCLE_LIFTER_COMMAND",
|
|
_ => throw new ArgumentException($"Unknow transaction name: {transactionName}")
|
|
};
|
|
}
|
|
}
|
|
}
|