NohDoyeon241104 fc8c2186d4 feat: WeldingCommon에 ScannerACS 독립 구현 및 Scanner 등록
- WeldingCommon/Devices/ACS/ 에 ScannerACS 3개 파일 추가
  (ScannerACS.cs / ScannerACS.Parameter.cs / MotionVariable.cs)
- Gun 프로젝트 참조 제거, ScannerACS로 독립 분리
- WeldingCommon에 AuroraACS / AuroraMotor / ACS.SPiiPlusNET 참조 추가
- Scanner EquipmentSetup.RegisterDevices()에 ScannerACS 및 모터 등록
- EquipDef.cs에 MotorIds 추가
- AuroraEx.IsAutoActivation Device 네임스페이스 충돌 수정
- CommonEquipmentSetup.ActivateDevices() Aurora.Api.Device 타입 명시

TODO: 이정인 선임 ACS 변수 맵 수신 후 축 번호 및 변수명 검증 필요
2026-04-06 12:52:12 +09:00

61 lines
1.8 KiB
C#

using Aurora;
using Aurora.Api;
// AuroraEx.cs 상단에
using AuroraDevice = Aurora.Api.Device;
using Aurora.Api.Manager;
using AuroraMassFlowMeter;
using AuroraOCT.Trumpf;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using WeldingCommon.Recipes;
using WeldingCommon.RMS;
namespace WeldingCommon.Utils
{
public static class AuroraEx
{
public static bool IsAutoActivation(this AuroraDevice dev)
{
var Config = Application.Current.AuroraEnv().DeviceManager.GetDeviceConfig(dev.DeviceId);
if(Config is OCTConfig config)
return config.IsAutoActivation;
return true;
}
#region RMS Interface object
private static Func<RMSHandler> _factory;
private static readonly ConcurrentDictionary<Type, RMSHandler> _cache = new ConcurrentDictionary<Type, RMSHandler>();
public static void RegisterRmsHandler<T>() where T : RMSHandler, new()
{
_factory = () => (RMSHandler)_cache.GetOrAdd(typeof(T), _ => new T());
}
public static RMSHandler RmsHandler(this IRecipeManager _)
{
if (_factory == null)
throw new InvalidOperationException("RMSHandler가 등록되지 않았습니다. AuroraEx.RegisterRmsHandler<T>()를 먼저 호출하세요.");
return _factory();
}
#endregion
#region Recipe History Interface object
private static RecipeChangeHistoryHandler _Instance;
public static RecipeChangeHistoryHandler RchHandler(this IRecipeManager _)
{
if (_Instance == null)
_Instance = new RecipeChangeHistoryHandler();
return _Instance;
}
#endregion
}
}