53 lines
1.9 KiB
C#
53 lines
1.9 KiB
C#
using Aurora.Api;
|
|
using Hermes;
|
|
using System;
|
|
using VisionCommon;
|
|
|
|
namespace WeldingCommon.Vision.Adapter
|
|
{
|
|
/// <summary>
|
|
/// 비전 알람을 등록하거나, 발생시키기 위한 매니저
|
|
/// </summary>
|
|
public class VisionAlarm : IVisionAlarm {
|
|
private readonly Logger _Logger = new Logger(typeof(VisionAlarm).Name);
|
|
|
|
/// <summary>
|
|
/// 알람을 등록한다.
|
|
/// </summary>
|
|
/// <returns>성공 유무</returns>
|
|
public int RegisterAlarm() {
|
|
// 고정부 패치 후 수정 예정
|
|
//var list = new List<(int, string)>();
|
|
//foreach (var item in Enum.GetValues(typeof(VisionAlarm))) {
|
|
// list.Add(((int)item, item.ToString()));
|
|
//}
|
|
//VisionEnv.AuroraEnv.AlarmService.RegisterAlarm(list);
|
|
|
|
return E1.OK;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 비전에서 정의한 알람 코드를 발생시킨다. (알람 코드 : 베이스 알람 코드 + 비전 알람 코드)
|
|
/// </summary>
|
|
/// <param name="visionAlarmCode">비전 알람 코드</param>
|
|
/// <returns>성공 유무</returns>
|
|
public int SetAlarm(eVisionAlarmCode visionAlarmCode) {
|
|
return SetAlarm(VisionSettingManager.VisionSetting.AlarmBaseCode + (int)visionAlarmCode);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 장비에서 정의한 알람 코드를 발생시킨다. (알람 코드 : 장비별로 정의해서 사용할 것)
|
|
/// </summary>
|
|
/// <param name="alarmCode">장비 알람 코드</param>
|
|
/// <returns>성공 유무</returns>
|
|
public int SetAlarm(int alarmCode) {
|
|
if (VisionEnv.AuroraEnv.AlarmService.SetAlarm(alarmCode)) {
|
|
_Logger.FuncI($"Alarm Set!! [{alarmCode}]");
|
|
return E1.OK;
|
|
}
|
|
else {
|
|
return E1.GENERIC;
|
|
}
|
|
}
|
|
}
|
|
} |