- 오토런 시작 시 RCC 패턴 폴더 변경 감지 → B2506 ON, PLC ACK(B2409) 수신 시 OFF - 서브 패턴 1~10, 패턴 목록에 서브 썸네일 표시(행 내 좌우 스크롤) - 서브 패턴 등록 직후 활성화 OFF - 패턴 파일이 다른 프로그램에서 열려 있으면 삭제하지 않고 안내 - 현장 소스 반영: Train ROI 슬라이더, KS 조명 밝기 저장/적용, 조명 ID 분리, 스캔 후 카메라 라이브 재시작, 레시피 21 RCC NG 우회, 오토런 상태 판단
309 lines
15 KiB
C#
309 lines
15 KiB
C#
using Aurora;
|
|
using Aurora.Api;
|
|
using Aurora.Api.Devices;
|
|
using Aurora.Api.Manager;
|
|
using Aurora.View;
|
|
using Aurora.View.Alarm;
|
|
using Aurora.View.AutoBackup;
|
|
using AuroraCellTracker;
|
|
using AuroraCellTracker.Views;
|
|
using AuroraIO;
|
|
using AuroraIO.View;
|
|
using AuroraLaser;
|
|
using AuroraLaser.Amplitude.Satsuma;
|
|
using AuroraLaser.Amplitude.Satsuma.Views;
|
|
using AuroraLaser.Coherent.Arm;
|
|
using AuroraLaser.Coherent.Compact;
|
|
using AuroraLaser.Coherent.Compact.Views;
|
|
using AuroraLaser.Coherent.HyperRapid;
|
|
using AuroraLaser.Coherent.HyperRapid.Views;
|
|
using AuroraLaser.Coherent.RapidLX;
|
|
using AuroraLaser.Ekspla;
|
|
using AuroraLaser.IPG.YLPN;
|
|
using AuroraLaser.IPG.YLS;
|
|
using AuroraLaser.Trumpf.TruDisk;
|
|
using AuroraLaser.Trumpf.TruPulseNano;
|
|
using AuroraLaser.Trumpf.TruPulseNano.Views;
|
|
using AuroraLBAD;
|
|
using AuroraLBAD.Services;
|
|
using AuroraLight;
|
|
using AuroraLight.View;
|
|
using AuroraOCT;
|
|
using AuroraOCT.Views;
|
|
using AuroraPLC;
|
|
using AuroraPLC.Views;
|
|
using AuroraTriggerBoard.SJT;
|
|
using CoreUnit.Scanner.UserControl.ScannerCanvas;
|
|
using DB;
|
|
using DB.Recipe;
|
|
using GUI;
|
|
using ILSOS_KS.Alarm;
|
|
using ILSOS_KS.Device;
|
|
using ILSOS_KS.Models;
|
|
using ILSOS_KS.Recipes;
|
|
using ILSOS_KS.RMS;
|
|
using ILSOS_KS.Sequences;
|
|
using ILSOS_KS.Views;
|
|
using Microsoft.Win32;
|
|
using System.Collections.Generic;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Media;
|
|
using WeldingCommon;
|
|
using WeldingCommon.Recipes;
|
|
using WeldingCommon.Sequences;
|
|
using WeldingCommon.Views;
|
|
using WeldingCommon.Vision.Factory;
|
|
using static WeldingCommon.Vision.Factory.VisionFactory;
|
|
|
|
namespace ILSOS_KS
|
|
{
|
|
internal class EquipmentSetup : CommonEquipmentSetup, IEquipmentSetup
|
|
{
|
|
private SequenceBuilder _SeqAutoRunKS_New_Builder;
|
|
private SequenceBuilder _SeqDryRun_Builder;
|
|
|
|
public override void BuildMainStatusView(MainStatusBuilder builder)
|
|
{
|
|
base.BuildMainStatusView(builder);
|
|
|
|
builder.AddDeviceActiveStatus(CommonDeviceIds.LBAD)
|
|
.AddDeviceActiveStatus(DeviceIds.KSLight1)
|
|
.AddDeviceActiveStatus(DeviceIds.KSLight2);
|
|
|
|
//builder.AddDeviceActiveStatus(CommonDeviceIds.CellTracker)
|
|
//.AddDeviceActiveStatus(CommonDeviceIds.OCT);
|
|
}
|
|
|
|
public override string GetEquipmentName()
|
|
{
|
|
return "ILSOS KS";
|
|
}
|
|
|
|
public void OnSetAlarm(int code, bool isHeavy)
|
|
{
|
|
base.OnSetAlarm(code, isHeavy);
|
|
|
|
if (isHeavy) {
|
|
AlarmManager_KS.StopSequenceByAlarm(code);
|
|
}
|
|
}
|
|
|
|
public override async void OnStartUp()
|
|
{
|
|
await ActivateDevices();
|
|
|
|
base.OnStartUp();
|
|
}
|
|
|
|
// For Selection LaserDevice
|
|
public void RegisterLaserDevice(IDeviceRegistry registry, ILaserDevice laserDeviceWithIO)
|
|
{
|
|
// All
|
|
registry.Register(CommonDeviceIds.Laser, () => new LaserDevice(CommonDeviceIds.Laser, laserDeviceWithIO), new LaserConfig(),
|
|
device => new UCLaserDevice() { DataContext = new UCLaserDeviceViewModel(AuroraEnv, CommonDeviceIds.Laser) });
|
|
}
|
|
|
|
public void RegisterViewsLaserDevice(IViewManager manager)
|
|
{
|
|
// 아래는 진행한 장비에서의 View 화면 목록 임. 구현에 참고.
|
|
// 동일 장비가 아니므로, 그대로 사용하는 것은 권장하지 않음.
|
|
//var laserDevice = new MainMenu(CommonViewIds.LaserDevice, MenuIcon.GetMenuIcon(eMenuIcon.DEVICE), PermissionLevel.LEVEL3, false);
|
|
|
|
// Case: Amplitude_Satsuma_Laser (Modbus), For setting or monitoring
|
|
//laserDevice.AddSubMenu(CommonViewIds.LaserDevice, new UCLaserController(AuroraEnv, CommonDeviceIds.Laser, string.Empty));
|
|
|
|
// Case: Coherent_Compact_Laser (Serial), For calibration
|
|
//var laserIDList = new List<string>() { CommonDeviceIds.Laser };
|
|
//laserDevice.AddSubMenu(CommonViewIds.LaserDevice, new UCLaserCompactCalibration() { DataContext = new UCLaserCompactCalibrationViewModel(AuroraEnv, laserIDList, DeviceIds.PowerMeter) });
|
|
|
|
// Case: Coherent_HyperRapid_Laser (Serial), For monitoring
|
|
//var laser = AuroraEnv.DeviceManager[CommonDeviceIds.Laser] as LaserDeviceHyperRapid;
|
|
//laserDevice.AddSubMenu(CommonViewIds.LaserDevice, new UCCoherentHyperRapidResourceMonitoring() { DataContext = new UCCoherentHyperRapidResourceMonitoringViewModel(AuroraEnv, laser) });
|
|
|
|
//manager.RegisterMainMenu(laserDevice);
|
|
}
|
|
|
|
public override void RegisterDevices(IDeviceRegistry registry)
|
|
{
|
|
base.RegisterDevices(registry);
|
|
|
|
var isSimul = ApplicationExt.IsSimulation;
|
|
|
|
var ioController = new IOController_KS(AuroraEnv, CommonDeviceIds.IODevice);
|
|
registry.Register(CommonDeviceIds.IODevice, () => ioController, new IOUnitConfig());
|
|
|
|
var laserDeviceWithIO = new LaserIPG_AjinIO(CommonDeviceIds.LaserIO, isSimul, ioController);
|
|
RegisterLaserDevice(registry, laserDeviceWithIO);
|
|
|
|
//registry.Register(CommonDeviceIds.OCT, () => new OCT(CommonDeviceIds.OCT), new OCTConfig(),
|
|
//device => new UCOCTDevice() { DataContext = new UCOCTDeviceViewModel(AuroraEnv, CommonDeviceIds.OCT) });
|
|
|
|
registry.Register(CommonDeviceIds.LBAD, () => new LBAD(CommonDeviceIds.LBAD), new LBADConfig());
|
|
|
|
registry.Register(CommonDeviceIds.CellTracker, () => new CellTracker(CommonDeviceIds.CellTracker, eCellTrackerType.Daekhon), new CellTrackerConfig(),
|
|
device => new UCCellTrackerDevice() { DataContext = new UCCellTrackerDeviceViewModel(AuroraEnv, CommonDeviceIds.CellTracker) });
|
|
|
|
registry.Register(DeviceIds.TriggerBoard,
|
|
() => new AuroraTriggerBoard.Trigger(DeviceIds.TriggerBoard, AuroraTriggerBoard.Trigger.eTriggerType.SJT), AuroraTriggerBoard.TriggerConfig.GetDefaultConfig(),
|
|
device => new UCTriggerBoard() { DataContext = new UCTriggerBoardViewModel(AuroraEnv, DeviceIds.TriggerBoard) });
|
|
|
|
var _plc = new PLCControllerKS(CommonDeviceIds.PLCDevice, ePLCNetType.MXComponent, PLCMMapFileType.CSV, AuroraEnv);
|
|
registry.Register(CommonDeviceIds.PLCDevice,
|
|
() => _plc, PLCMxComponentConfig.GetDefaultConfig(),
|
|
device => new UCPLCDevice() { DataContext = new UCPLCDeviceViewModel(AuroraEnv, _plc) });
|
|
//var _plc = new PLCControllerKS(CommonDeviceIds.PLCDevice, ePLCNetType.MelsecNet, PLCMMapFileType.CSV, AuroraEnv);
|
|
//registry.Register(CommonDeviceIds.PLCDevice,
|
|
// () => _plc, PLCMelsecNetConfig.GetDefaultConfig(),
|
|
// device => new UCPLCDevice() { DataContext = new UCPLCDeviceViewModel(AuroraEnv, _plc) });
|
|
|
|
registry.Register(DeviceIds.KSLight1, () => new LightDevice(DeviceIds.KSLight1, eLight.ERI), new LightConfig(),
|
|
device => new UCLight() { DataContext = new UCLightViewModel(AuroraEnv, DeviceIds.KSLight1) });
|
|
|
|
registry.Register(DeviceIds.KSLight2, () => new LightDevice(DeviceIds.KSLight2, eLight.ERI), new LightConfig(),
|
|
device => new UCLight() { DataContext = new UCLightViewModel(AuroraEnv, DeviceIds.KSLight2) });
|
|
|
|
RegisterStreamServices(registry);
|
|
}
|
|
|
|
public void RegisterStreamServices(IDeviceRegistry registry)
|
|
{
|
|
//Stream 사용 시에만 등록하도록 하자
|
|
var equipSetting = AuroraEnv.SettingEntry[AuroraSettings.Equipment] as EquipmentInfo;
|
|
|
|
if (equipSetting.UseStream) {
|
|
//LBAD
|
|
registry.Register(CommonServiceIds.StreamLightLBADClient, () =>
|
|
new StreamLightClient(CommonStreamServiceNames.LBADClient, CommonStreamLightPort.LBADClientPort), new StreamLightClientConfig());
|
|
|
|
registry.Register(CommonServiceIds.StreamLightLBADSub, () =>
|
|
new StreamLightSub(CommonStreamServiceNames.LBADSub, CommonStreamLightPort.LBADSubPort), new StreamLightSubConfig());
|
|
}
|
|
}
|
|
|
|
public override void RegisterRecipes(RecipeRegister register)
|
|
{
|
|
//register(CommonRecipeIds.ScannerObjectTeaching, new ScannerObjectTeachingRecipe(),
|
|
// (id, item) => new UCScannerObjectTeaching(AuroraEnv,
|
|
// RecipeEventHelper.ExternalRecipeChangeRequest,
|
|
// RecipeEventHelper.ExternalRecipeChangeComplete));
|
|
|
|
register(CommonRecipeIds.ScannerObjectTeaching, new ScannerObjectTeachingRecipe(),
|
|
(id, item) => new UCScannerObjectTeaching2(AuroraEnv,
|
|
RecipeEventHelper.KS_RecipeChangeRequest,
|
|
RecipeEventHelper.KS_RecipeChangeComplete));
|
|
|
|
base.RegisterRecipes(register);
|
|
}
|
|
|
|
public override void RegisterModels(ModelRegister register)
|
|
{
|
|
register(CommonModelIds.EquipmentSpecificModel, new EquipmentSpecificModel_KS(),
|
|
(id, item) => new UCModelEditor(new UCModelEditorViewModel(AuroraEnv), ModelExternalDelegate.ExternalCreateEquipmentSpecificEditor));
|
|
|
|
base.RegisterModels(register);
|
|
}
|
|
|
|
public override void RegisterSequences(SequenceRegister register)
|
|
{
|
|
// Common Sequences register
|
|
base.RegisterSequences(register);
|
|
AlarmMonitoring.SetExternalDeviceActivatedCheckWithIO(AlarmHelper.ExternalDeviceActivatedCheckWithIO);
|
|
|
|
var equipSetting = AuroraEnv.SettingEntry[AuroraSettings.Equipment] as EquipmentInfo;
|
|
|
|
var seqAutoRunKS_New = new SeqAutoRunKS();
|
|
_SeqAutoRunKS_New_Builder = seqAutoRunKS_New.Builder();
|
|
register(SequenceIds.SeqAutoRunKS_New, _SeqAutoRunKS_New_Builder);
|
|
|
|
var seqDryRun = new SeqRCCTeachingRun();
|
|
_SeqDryRun_Builder = seqDryRun.Builder();
|
|
register(SequenceIds.SeqDryRun, _SeqDryRun_Builder);
|
|
|
|
|
|
//SequenceManager.RegisterSequence(AuroraEnv, register);
|
|
}
|
|
|
|
public override void RegisterSettings(SettingRegister register) {
|
|
base.RegisterSettings(register);
|
|
}
|
|
|
|
// Views는 장비별로 별도로 등록하자.
|
|
public override void RegisterViews(IViewManager manager)
|
|
{
|
|
base.RegisterViews(manager);
|
|
|
|
//manager.RegisterTitleComponent(new UCInformationPanelView() { DataContext = new UCInformationPanelViewModel(AuroraEnv, CommonDeviceIds.IODevice) });
|
|
|
|
_UCRecipe = new UCRecipe();
|
|
|
|
// Auto Run
|
|
var MainAutoRun = new MainMenu(CommonViewIds.AutoRun, MenuIcon.GetMenuIcon(eMenuIcon.HOME), PermissionLevel.LEVEL5, false);
|
|
MainAutoRun.AddSubMenu(CommonViewIds.AutoRun, new UCMainAutoRun(new UCMainAutoRunViewModel(AuroraEnv, _UCRecipe, SequenceIds.SeqAutoRunKS_New, RecipeEventHelper.ExternalRecipeUpdate)));
|
|
manager.RegisterMainMenu(MainAutoRun);
|
|
|
|
// Recipe
|
|
MainMenu recipe = new MainMenu(CommonViewIds.Recipe, MenuIcon.GetMenuIcon(eMenuIcon.RECIPE), PermissionLevel.LEVEL3, true);
|
|
recipe.AddSubMenu(CommonViewIds.Recipe, _UCRecipe);
|
|
recipe.AddSubMenu(CommonViewIds.ModelEditor, new UCModel());
|
|
manager.RegisterMainMenu(recipe);
|
|
|
|
// Manual
|
|
var manual = new MainMenu(CommonViewIds.Manual, (DrawingImage)IconDictionary["Maint"], PermissionLevel.LEVEL3, true);
|
|
manual.AddSubMenu(CommonViewIds.ScannerOperation, new UCManualScannerOperation(new UCManualScannerOperationViewModel(AuroraEnv, CommonDeviceIds.Scanner, false)));
|
|
//manual.AddSubMenu(CommonViewIds.OCT, new UCOCTManualMotion(AuroraEnv, CommonDeviceIds.OCT));
|
|
|
|
manual.AddSubMenu(CommonViewIds.LBAD, new UCLBADDevice(AuroraEnv, CommonDeviceIds.LBAD, CommonDeviceIds.IODevice));
|
|
manual.AddSubMenu(CommonViewIds.RCCOperation, new UCManualRCCOperation(new UCManualRCCOperationViewModel(AuroraEnv)));
|
|
|
|
manual.AddSubMenu("KSLight", new KsLight(new KsLightModel(AuroraEnv, DeviceIds.KSLight1, DeviceIds.KSLight2)));
|
|
|
|
// Manual - For Test
|
|
//manual.AddSubMenu(CommonViewIds.TestDevice, new UCTestDevice(new UCTestDeviceViewModel(AuroraEnv)));
|
|
//manual.AddSubMenu(CommonViewIds.TestSequence, new UCTestSequence(new UCTestSequenceViewModel(AuroraEnv)));
|
|
manager.RegisterMainMenu(manual);
|
|
|
|
//Calibration
|
|
var calibration = new MainMenu(CommonViewIds.Calibration, MenuIcon.GetMenuIcon(eMenuIcon.SCANNER), PermissionLevel.LEVEL3, true);
|
|
calibration.AddSubMenu(CommonViewIds.Scanner, new UCScannerCalibration(new UCScannerCalibrationViewModel(AuroraEnv)));
|
|
//calibration.AddSubMenu(CommonViewIds.Power, new UCPowerCalibration(AuroraEnv)); // 불필요
|
|
//calibration.AddSubMenu(CommonViewIds.PowerCalProfile, new UCPowerProfile(AuroraEnv, CommonDeviceIds.Laser)); // 불필요
|
|
calibration.AddSubMenu(CommonViewIds.PixelResolution, new UCCameraPixelResolution(new UCCameraPixelResolutionViewModel(AuroraEnv)));
|
|
manager.RegisterMainMenu(calibration);
|
|
|
|
// Monitoring
|
|
var monitoring = new MainMenu(CommonViewIds.Monitoring, (DrawingImage)IconDictionary["Monitoring"], PermissionLevel.LEVEL3, true);
|
|
//manual.AddSubMenu(CommonViewIds.PLCInterfaceView, new UCPLCInterfaceView(AuroraEnv, CommonDeviceIds.PLCDevice));
|
|
monitoring.AddSubMenu(CommonViewIds.PLCBitMonitoring, new UCPLCBit() { DataContext = PLCStatic.GetInstanceBitVM(AuroraEnv, CommonDeviceIds.PLCDevice, ePLCNetType.MXComponent) });
|
|
monitoring.AddSubMenu(CommonViewIds.PLCWordMonitoring, new UCPLCWord() { DataContext = PLCStatic.GetInstanceWordVM(AuroraEnv, CommonDeviceIds.PLCDevice, ePLCNetType.MXComponent) });
|
|
monitoring.AddSubMenu(CommonViewIds.IOInterfaceView, new UCIOInterfaceView(AuroraEnv, CommonDeviceIds.IODevice));
|
|
//monitoring.AddSubMenu(CommonViewIds.OCT, new UCOCTManualMotion(AuroraEnv, CommonDeviceIds.OCT));
|
|
monitoring.AddSubMenu(CommonViewIds.LBAD, new UCLBADDevice(AuroraEnv, CommonDeviceIds.LBAD, CommonDeviceIds.IODevice));
|
|
|
|
manager.RegisterMainMenu(monitoring);
|
|
|
|
// Device
|
|
var device = new MainMenu(CommonViewIds.Device, MenuIcon.GetMenuIcon(eMenuIcon.DEVICE), PermissionLevel.LEVEL3, false);
|
|
device.AddSubMenu(CommonViewIds.Device, new DeviceSettingView()); // "CommonViewIds.Setting" 는 EquipDef.cs 에서 정의한 ViewId
|
|
manager.RegisterMainMenu(device);
|
|
|
|
//Setting
|
|
var setting = new MainMenu(CommonViewIds.Setting, MenuIcon.GetMenuIcon(eMenuIcon.SETTING), PermissionLevel.LEVEL3, true);
|
|
setting.AddSubMenu(CommonViewIds.Setting, new EquipSettingView());
|
|
setting.AddSubMenu(CommonViewIds.AutoBackupView, new AutoBackupView2() { DataContext = new AutoBackupViewModel() });
|
|
manager.RegisterMainMenu(setting);
|
|
|
|
// Alarm
|
|
MainMenu alarm = new MainMenu(CommonViewIds.Alarm, (DrawingImage)IconDictionary["AlarmBell"], PermissionLevel.LEVEL5, true)
|
|
.AddSubMenu(CommonViewIds.History, new AlarmHistoryView())
|
|
.AddSubMenu(CommonViewIds.Description, new AlarmDescView());
|
|
manager.RegisterMainMenu(alarm);
|
|
|
|
// For Laser Device View
|
|
RegisterViewsLaserDevice(manager);
|
|
|
|
// Vision (미사용)
|
|
//VisionFactory.RegisterViews(manager);
|
|
}
|
|
}
|
|
}
|