using Aurora; using Aurora.Api; using Aurora.Api.Manager; using Aurora.Api.Services; using Aurora.View; using Aurora.View.Alarm; using Aurora.View.AutoBackup; using AuroraACS; using AuroraACS.Views; using AuroraCellTracker; using AuroraCellTracker.Views; using AuroraChiller; using AuroraHeightSensor; using AuroraHeightSensor.Keyence; using AuroraHeightSensor.Keyence.Views; using AuroraIO; using AuroraIO.View; using AuroraLaser; using AuroraLaserScanner; using AuroraLBAD; using AuroraLBAD.Services; using AuroraLight; using AuroraLight.View; using AuroraMassFlowMeter; using AuroraMassFlowMeter.MFC; using AuroraMotionBoard.Ajin; using AuroraMotionBoard.Ajin.Views; using AuroraOCT; using AuroraOCT.Trumpf; using AuroraOCT.Trumpf.Views; using AuroraOCT.Views; using AuroraPLC; using AuroraPLC.Views; using CoreUnit.Scanner.UserControl.ScannerCanvas; using DB; using DB.Recipe; using GUI; using Hermes; using ILSOS_PrismaticGun.Alarm; using ILSOS_PrismaticGun.Device; using ILSOS_PrismaticGun.Device.ACS; using ILSOS_PrismaticGun.Models; using ILSOS_PrismaticGun.Process; using ILSOS_PrismaticGun.Recipes; using ILSOS_PrismaticGun.Sequences; using ILSOS_PrismaticGun.Sequences.Monitoring; using ILSOS_PrismaticGun.Sequences.SubSequence; using ILSOS_PrismaticGun.Settings; using ILSOS_PrismaticGun.Views; using ILSOS_PrismaticGun.Views.Recipe; using OpenCvSharp.Flann; using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Disposables; using System.Reactive.Linq; using System.Threading.Tasks; using System.Windows.Controls; using System.Windows.Documents; using WeldingCommon; using WeldingCommon.Alarm; using WeldingCommon.Devices; using WeldingCommon.Recipes; using WeldingCommon.Sequences; using WeldingCommon.Settings; using WeldingCommon.Utils; using WeldingCommon.Views; using WeldingCommon.Views.Recipes.History; using WeldingCommon.Vision.Factory; using static WeldingCommon.Vision.Factory.VisionFactory; using OCT = AuroraOCT.Trumpf.OCT; using OCTConfig = AuroraOCT.Trumpf.OCTConfig; namespace ILSOS_PrismaticGun { internal class EquipmentSetup : CommonEquipmentSetup, IEquipmentSetup { private PrismaticGunACS _acs; private IPrismaticGunACS _motion; private AJINDevice _ajin; private PLCControllerPrismaticGun _plc; public override void BuildMainStatusView(MainStatusBuilder builder) { //base.BuildMainStatusView(builder); builder .AddLanguage("en-US", "ko-KR") .AddDeviceActiveStatus(CommonDeviceIds.Laser) .AddDeviceActiveStatus(CommonDeviceIds.IODevice) .AddDeviceActiveStatus(CommonDeviceIds.PLCDevice) .AddDeviceActiveStatus(CommonDeviceIds.SmcChiller) .AddDeviceActiveStatus(DeviceIds.ACS) .AddDeviceActiveStatus(DeviceIds.AJIN) .AddDeviceActiveStatus(DeviceIds.MassFlowMeterStageA) .AddDeviceActiveStatus(DeviceIds.MassFlowMeterStageB) .AddDeviceActiveStatus(DeviceIds.HeightSensor); } public override string GetEquipmentName() { return "ILSOS PrismaticGun"; } public override void OnSetAlarm(int code, bool isHeavy) { base.OnSetAlarm(code, isHeavy); if (isHeavy) { AlarmManager_PrismaticGun.StopSequenceByAlarm(code); } } public override async void OnStartUp() { var equipSetting = AuroraEnv.SettingEntry[AuroraSettings.Equipment] as EquipmentInfo; if (equipSetting.AutomaticallyConnectDevices) { await ActivateDevices(); } // 위에 Activate를 실행하고 이벤트를 넣어야 이벤트에 의한 중복 Activate가 안됩니다. Observable.Merge(AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_DEVICE_ACTIVATED), AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_DEVICE_DEACTIVATED)) .Select(msg => msg.Param as string) .Where(x => x == DeviceIds.ACS) .ObserveOnDispatcher() .Subscribe(x => OnACSActivateChanged()); Observable.Merge(AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_DEVICE_ACTIVATED), AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_DEVICE_DEACTIVATED)) .Select(msg => msg.Param as string) .Where(x => x == CommonDeviceIds.Laser) .ObserveOnDispatcher() .Subscribe(x => OnLaserActivateChanged()); Observable.Merge(AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_DEVICE_ACTIVATED), AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_DEVICE_DEACTIVATED)) .Select(msg => msg.Param as string) .Where(x => x == DeviceIds.AJIN) .ObserveOnDispatcher() .Subscribe(x => OnAJINActivateChanged()); AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_ALARM_RESET_ALARM) .Select(msg => msg.Param) .Subscribe(ClearAlarm); AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_ALARM_RESET_ALL_ALARM) .Select(msg => msg.Param) .Subscribe(ClearAllAlarm); AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_RECIPE_ACTIVATED) .Select(x => (RecipeInfo)x.Param) .Subscribe(info => OnActivatedRecipeChange(info)); AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_SETTING_CHANGED) .Subscribe(UpdateSettingChanged); AuroraEnv.EventObservable.AsObservable(AuroraSysEvent.SYS_PERMISSION_CHANGED) .Select(msg => msg.Param) .Subscribe(LoginChanged); _motion = _acs = AuroraEnv.DeviceManager[DeviceIds.ACS] as PrismaticGunACS; _ajin = AuroraEnv.DeviceManager[DeviceIds.AJIN] as AJINDevice; _plc = AuroraEnv.DeviceManager[DeviceIds.PLCDevice] as PLCControllerPrismaticGun; AuroraEx.RegisterRmsHandler(); AuroraEnv.RecipeManager.RmsHandler().RegistryDeviceHandler(AuroraEnv); AuroraEnv.RecipeManager.RmsHandler().Start(); // [Singleton Instance] Recipe Change History AuroraEnv.RecipeManager.RchHandler().RegistryDeviceHandler(AuroraEnv); AuroraEnv.SequenceEntry[SequenceIds.StatusMonitor].Start(); AuroraEnv.SequenceEntry[CommonSequenceIds.AlarmMonitor].Start(); AuroraEnv.SequenceEntry[CommonSequenceIds.PLCMonitor].Start(); base.OnStartUp(); } private void LoginChanged(object obj) { var userId = ApplicationExt.CurrUserID; var currentPermissionLevel = ApplicationExt.PermissionLevel; } private void UpdateSettingChanged(EventMessage message) { var setting = message.Param as string; switch (setting) { case CommonSettingIds.Sequence: //_acs.RemarkUseStageB(true); break; default: break; } } private void OnActivatedRecipeChange(RecipeInfo info) { } public override void OnShutDown() { // 모니터링 시퀀스 먼저 종료 SequenceManagerForMainWelder.Instance.Terminate(); base.OnShutDown(); } private void ClearAllAlarm(object obj) { _acs.ClearAlarms(); if (_acs.HasHeavyAlarm | _acs.HasLightAlarm) _motion.ResetAlarm(); _ajin.AlarmReset((int)MotorIds.eMotorIdx.ALineZ); _ajin.AlarmReset((int)MotorIds.eMotorIdx.BLineZ); } // Common에 AlarmManager가 있는데, 그걸 못써서.. 일단 이렇게 함 private void ClearAlarm(object obj) { } public override void OnPostDeviceActivated(string dev) { base.OnPostDeviceActivated(dev); switch (dev) { case DeviceIds.ACS: if (_acs == null) _acs = AuroraEnv.DeviceManager[dev] as PrismaticGunACS; var setting = AuroraEnv.SettingEntry[CommonSettingIds.Sequence] as SequenceSetting; _acs.RemarkUseStageB(setting.BLineHookMarkingUse); break; } } private IDisposable OnAJINActivateChanged() { var isActivated = AuroraEnv.DeviceManager[DeviceIds.AJIN].IsActivated; if (isActivated) { AuroraEnv.DeviceManager[MotorIds.ALineZ].Activate(); AuroraEnv.DeviceManager[MotorIds.BLineZ].Activate(); } else { AuroraEnv.DeviceManager[MotorIds.ALineZ].Deactivate(); AuroraEnv.DeviceManager[MotorIds.BLineZ].Deactivate(); } return Disposable.Empty; } public IDisposable OnACSActivateChanged() { var isActivated = AuroraEnv.DeviceManager[DeviceIds.ACS].IsActivated; if (isActivated) { AuroraEnv.DeviceManager[CommonDeviceIds.IODevice].Activate(); foreach (var motorId in MotorIds.GetMotorList()) { if (motorId == MotorIds.ALineZ || motorId == MotorIds.BLineZ) continue; AuroraEnv.DeviceManager[motorId].Activate(); } } else { AuroraEnv.DeviceManager[CommonDeviceIds.IODevice].Deactivate(); foreach (var motorId in MotorIds.GetMotorList()) { if (motorId == MotorIds.ALineZ || motorId == MotorIds.BLineZ) continue; AuroraEnv.DeviceManager[motorId].Deactivate(); } } return Disposable.Empty; } public IDisposable OnLaserActivateChanged() { var isActivated = AuroraEnv.DeviceManager[CommonDeviceIds.Laser].IsActivated; if (isActivated) { AuroraEnv.DeviceManager[CommonDeviceIds.OCT].Activate(); var Setting = AuroraEnv.SettingEntry[CommonSettingIds.LaserPowerCalParam] as LaserPowerCalParam; Setting.Initialize(Setting.PowerCalibrationCenterBeamCSVFile, Setting.PowerCalibrationRingBeamCSVFile); return Disposable.Empty; } else { AuroraEnv.DeviceManager[CommonDeviceIds.OCT].Deactivate(); return Disposable.Empty; } } public override void RegisterDevices(IDeviceRegistry registry) { // Common영역 복붙. 왜냐하면, Scanner 안 쓰므로 공통부를 그대로 사용할 수 없음. var equipSetting = AuroraEnv.SettingEntry[AuroraSettings.Equipment] as EquipmentInfo; var isSimul = ApplicationExt.IsSimulation; var setting = AuroraEnv.SettingEntry[AuroraSettings.Equipment] as EquipmentInfo; var systemParameterILSOS = AuroraEnv.SettingEntry[CommonSettingIds.SystemParameter] as SystemParameter; //IODevice는 AjinIO가 아니라 IOUnit으로 받아오는것으로 수정해야 함 #warning ACS IO Board로 변경 //registry.Register(CommonDeviceIds.IODevice, () => new IODevice(AuroraEnv, CommonDeviceIds.IODevice, isSimul), new IOUnitConfig()); var laser = new Laser(CommonDeviceIds.Laser, isSimul); registry.Register(CommonDeviceIds.Laser, () => laser, new LaserConfig(), device => new UCLaserDevice() { DataContext = new UCLaserDeviceViewModel(AuroraEnv, CommonDeviceIds.Laser) }); var oct = new OCT(laser); registry.Register(CommonDeviceIds.OCT, () => oct, new OCTConfig(), device => new UCTrumpfOCTView() { DataContext = new UCTrumpfOCTViewModel(AuroraEnv, CommonDeviceIds.OCT) }); registry.Register(CommonDeviceIds.SmcChiller, () => new SmcChiller(CommonDeviceIds.SmcChiller, 0, isSimul), new SmcChiller.Config(), device => new UCSMCChillerDevice() { DataContext = new UCSMCChillerDeviceViewModel(AuroraEnv, CommonDeviceIds.SmcChiller) }); #warning Vision에서도 Light를 사용하는데... 중복으로 있는게 맞는지? >> 설비마다 설치된 Light가 다른데 Device를 어떻게 가져와서 사용하는거지 //VisionFactory.RegisterDevices(registry); #warning MainWelder에서 사용하는건지?? >> 일단 주석 //registry.Register(CommonDeviceIds.Light, () => new LightDevice(CommonDeviceIds.Light, eLight.ERI, isSimul), new LightConfig(), // device => new UCLight() { DataContext = new UCLightViewModel(AuroraEnv, CommonDeviceIds.Light) }); // TODO: SystemParameterManager.Initialize 할 위치 찾자. 여기는 조금.... //SystemParameterManager.Initialize(AuroraEnv); AlarmManager.Init(AuroraEnv); var _plc = new PLCControllerPrismaticGun(CommonDeviceIds.PLCDevice, ePLCNetType.MXComponent, ApplicationExt.IsSimulation, PLCMMapFileType.CSV, AuroraEnv); registry.Register(CommonDeviceIds.PLCDevice, () => _plc, PLCMxComponentConfig.GetDefaultConfig(), device => new UCPLCDevice() { DataContext = new UCPLCDeviceViewModel(AuroraEnv, _plc) }); var ACS = new PrismaticGunACS(ApplicationExt.IsSimulation); registry.Register(DeviceIds.ACS, () => ACS, new ACSDeviceConfig(), device => new UCACSDevice { DataContext = new UCACSDeviceViewModel(AuroraEnv, DeviceIds.ACS, SettingIds.ACS) }); registry.Register(CommonDeviceIds.IODevice, () => new PrismaticGunACSIO(AuroraEnv, CommonDeviceIds.IODevice, ApplicationExt.IsSimulation, ACS), new IOUnitConfig()); var AmotorX = new ACSMotor(MotorIds.ALineX, ACS, 12, (int)MotorIds.eMotorIdx.ALineX); registry.Register(MotorIds.ALineX , () => AmotorX , new ACSMotorConfig(MotorIds.ALineX) , motor => new UCACSMotor(AuroraEnv.DeviceManager, motor.DeviceId)); var AmotorY = new ACSMotor(MotorIds.ALineY, ACS, 13, (int)MotorIds.eMotorIdx.ALineY); registry.Register(MotorIds.ALineY , () => AmotorY , new ACSMotorConfig(MotorIds.ALineY) , motor => new UCACSMotor(AuroraEnv.DeviceManager, motor.DeviceId)); oct.GetAXVelocity = ACS.extAXVelocity; oct.GetAYVelocity = ACS.extAYVelocity; oct.GetAXPosition = ACS.extAXPosition; oct.GetAYPosition = ACS.extAYPosition; var BmotorX = new ACSMotor(MotorIds.BLineX, ACS, 14, (int)MotorIds.eMotorIdx.BLineX); registry.Register(MotorIds.BLineX , () => BmotorX , new ACSMotorConfig(MotorIds.BLineX) , motor => new UCACSMotor(AuroraEnv.DeviceManager, motor.DeviceId)); var BmotorY = new ACSMotor(MotorIds.BLineY, ACS, 15, (int)MotorIds.eMotorIdx.BLineY); registry.Register(MotorIds.BLineY , () => BmotorY , new ACSMotorConfig(MotorIds.BLineY) , motor => new UCACSMotor(AuroraEnv.DeviceManager, motor.DeviceId)); oct.GetBXVelocity = ACS.extBXVelocity; oct.GetBYVelocity = ACS.extBYVelocity; oct.GetBXPosition = ACS.extBXPosition; oct.GetBYPosition = ACS.extBYPosition; var ajinDevice = new AJINDevice(ApplicationExt.IsSimulation, AuroraEnv.DeviceManager, DeviceIds.AJIN, isSimul); registry.Register(DeviceIds.AJIN, () => ajinDevice, new AJINDeviceConfig(), (dev) => new UCAJINDeviceView() { DataContext = new UCAJINDeviceViewModel(dev)}); registry.Register(MotorIds.ALineZ, () => new AJINMotor(MotorIds.ALineZ, (int)MotorIds.eMotorIdx.ALineZ, ajinDevice), new AJINMotorConfig(MotorIds.ALineZ), (motor) => new UCAJINMotorView(AuroraEnv.DeviceManager, motor.DeviceId)); registry.Register(MotorIds.BLineZ, () => new AJINMotor(MotorIds.BLineZ, (int)MotorIds.eMotorIdx.BLineZ, ajinDevice), new AJINMotorConfig(MotorIds.BLineZ), (motor) => new UCAJINMotorView(AuroraEnv.DeviceManager, motor.DeviceId)); registry.Register(DeviceIds.MassFlowMeterStageA, () => new MassFlowMeter(eMassFlowMeter.MFC, isSimul), new MassFlowMeterConfig(), (dev) => new UCMassFlowMeterDevice() { DataContext = new UCMassFlowMeterDeviceViewModel(dev) }); registry.Register(DeviceIds.MassFlowMeterStageB, () => new MassFlowMeter(eMassFlowMeter.MFC, isSimul), new MassFlowMeterConfig(), (dev) => new UCMassFlowMeterDevice() { DataContext = new UCMassFlowMeterDeviceViewModel(dev) }); registry.Register(DeviceIds.HeightSensor, () => new HeightSensor(DeviceIds.HeightSensor, eHeightSensor.KeyenceIL, ApplicationExt.IsSimulation) ,HeightSensorConfig.GetDefaultConfig(eHeightSensor.KeyenceIL) ,(dev) => new UCHeightSensorControlView() { DataContext = new UCHeightSensorControlViewModel(AuroraEnv, dev.DeviceId) }); } public override void RegisterRecipes(RecipeRegister register) { register(RecipeIds.StageAMainRecipe, new MainRecipe(), (recipe, item) => new UCMainRecipe() { DataContext = new UCMainRecipeViewModel(AuroraEnv, recipe, item, RecipeIds.StageAMainRecipe, lockedOutputType: MainRecipe.eOutType.AnalogCtrlVelocityRatio) }); register(RecipeIds.StageBMainRecipe, new MainRecipe(), (recipe, item) => new UCMainRecipe() { DataContext = new UCMainRecipeViewModel(AuroraEnv, recipe, item, RecipeIds.StageBMainRecipe) }); //base.RegisterRecipes(register); } public override void RegisterModels(ModelRegister register) { //register(CommonModelIds.EquipmentSpecificModel, new EquipmentSpecificModel_PrismaticGun(), // (id, item) => new UCModelEditor(new UCModelEditorViewModel(AuroraEnv), ModelExternalDelegate.ExternalCreateEquipmentSpecificEditor)); //base.RegisterModels(register); } public override void RegisterSequences(SequenceRegister register) { SequenceManagerForMainWelder.Instance.Init(AuroraEnv); SequenceManagerForMainWelder.Instance.RegisterSequence(AuroraEnv, register); } public override void RegisterSettings(SettingRegister register) { base.RegisterSettings(register); register(SettingIds.ACS, new ACSDeviceSetting()); register(SettingIds.TeachingPos, new TeachingPositionSetting()); register(CommonSettingIds.UploadDatas, new SettingUploadDataListForMainWelder()); register(SettingIds.ManualLaser, new ManualLaserSetting()); } public override void RegisterServices(IServiceRegistry register) { //Stream 사용 시에만 등록하도록 하자 var equipSetting = AuroraEnv.SettingEntry[AuroraSettings.Equipment] as EquipmentInfo; if (equipSetting.UseStream) { //LBAD register.Register(CommonServiceIds.StreamLBADClient, () => new StreamLBADClient(CommonStreamServiceNames.LBADRPC), new StreamClientConfig()); #region StreamTest //PubSub register.Register(CommonServiceIds.StreamPubTest, () => new StreamPub(CommonStreamServiceNames.PubSubTest), new StreamPubConfig()); register.Register(CommonServiceIds.StreamSubTest, () => new StreamSub(CommonStreamServiceNames.PubSubTest), new StreamSubConfig()); //RPC register.Register(CommonServiceIds.StreamServerTest, () => new StreamServer(CommonStreamServiceNames.LBADRPC), new StreamServerConfig()); register.Register(CommonServiceIds.StreamClientTest, () => new StreamClient(CommonStreamServiceNames.LBADRPC), new StreamClientConfig()); //MessageBroadcasting register.Register(CommonServiceIds.StreamBroadcastPub, () => new StreamBroadcastPub(), new StreamBroadcastPubConfig()); register.Register(CommonServiceIds.StreamBroadcastSub, () => new StreamBroadcastSub(), new StreamBroadcastSubConfig()); #endregion } } // Views는 장비별로 별도로 등록하자. public override void RegisterViews(IViewManager manager) { // Manager Create >> Main UI화면에서 Manager에 있는 데이터를 로드함 ProcessManager.Instance.Init(AuroraEnv); base.RegisterViews(manager); // Auto Run UI 구성 필요 // Auto Run var MainAutoRun = new MainMenu(CommonViewIds.AutoRun, MenuIcon.GetMenuIcon(eMenuIcon.HOME), PermissionLevel.NONE, false); MainAutoRun.AddSubMenu(CommonViewIds.AutoRun, new UCMainAutoRun(new UCMainAutoRunViewModel(AuroraEnv, SequenceIds.SeqAutoRunPrismaticGunStageA))); manager.RegisterMainMenu(MainAutoRun); // Recipe MainMenu recipe = new MainMenu(CommonViewIds.Recipe, MenuIcon.GetMenuIcon(eMenuIcon.RECIPE), PermissionLevel.NONE, true); recipe.AddSubMenu(CommonViewIds.Recipe, new UCRecipe()); recipe.AddSubMenu(CommonViewIds.RecipeChangeHistory, new UCRecipeChangeHistory() { DataContext = new UCRecipeChangeHistoryViewModel(AuroraEnv) }); recipe.AddSubMenu(CommonViewIds.ModelEditor, new UCModel()); manager.RegisterMainMenu(recipe); // Manual var manual = new MainMenu(CommonViewIds.Manual, MenuIcon.GetMenuIcon(eMenuIcon.CAMERA), PermissionLevel.NONE, true); manual.AddSubMenu(ViewIds.StageManual, new UCStageManual(AuroraEnv, AuroraEnv.DeviceManager)); //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.ConvEdgeObject, new UCConvEdgeObject(AuroraEnv)); // 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은 필요 없어보임. ////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, MenuIcon.GetMenuIcon(eMenuIcon.MONITORING), PermissionLevel.NONE, true); //manual.AddSubMenu(CommonViewIds.PLCInterfaceView, new UCPLCInterfaceView(AuroraEnv, CommonDeviceIds.PLCDevice)); monitoring.AddSubMenu(CommonViewIds.PLCBitMonitoring, new UCPLCBit() { DataContext = PLCStatic.GetInstanceBitVM(AuroraEnv, CommonDeviceIds.PLCDevice, ePLCNetType.MXComponent, PLCBase.ePLCDevice.M) }); monitoring.AddSubMenu(CommonViewIds.PLCWordMonitoring, new UCPLCWord() { DataContext = PLCStatic.GetInstanceWordVM(AuroraEnv, CommonDeviceIds.PLCDevice, ePLCNetType.MXComponent, PLCBase.ePLCDevice.D) }); monitoring.AddSubMenu(CommonViewIds.IOInterfaceView, new UCIOInterfaceView(AuroraEnv, CommonDeviceIds.IODevice)); manager.RegisterMainMenu(monitoring); // Device var device = new MainMenu(CommonViewIds.Device, MenuIcon.GetMenuIcon(eMenuIcon.GEAR), 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.LEVEL1, true); setting.AddSubMenu(CommonViewIds.Setting, new EquipSettingView()); setting.AddSubMenu(CommonViewIds.LogSetting, new LogSettingView()); setting.AddSubMenu(CommonViewIds.AutoBackupView, new AutoBackupView2() { DataContext = new AutoBackupViewModel() }); manager.RegisterMainMenu(setting); // Alarm MainMenu alarm = new MainMenu(CommonViewIds.Alarm, MenuIcon.GetMenuIcon(eMenuIcon.BARCODE), PermissionLevel.NONE, true) .AddSubMenu(CommonViewIds.History, new AlarmHistoryView()) .AddSubMenu(CommonViewIds.Description, new AlarmDescView()); manager.RegisterMainMenu(alarm); var equipSetting = AuroraEnv.SettingEntry[AuroraSettings.Equipment] as EquipmentInfo; if (equipSetting.UseStream) { MainMenu service = new MainMenu(CommonViewIds.StreamDevice, MenuIcon.GetMenuIcon(eMenuIcon.DEVICE)) .AddSubMenu(CommonViewIds.StreamDevice, new UCServiceSettingView()); manager.RegisterMainMenu(service); } // Vision (미사용) //VisionFactory.RegisterViews(manager); } } }