diff --git a/Machines/ILSOS_CCW_H52A/EquipmentSetup.cs b/Machines/ILSOS_CCW_H52A/EquipmentSetup.cs index c3f2f7c..d455e8d 100644 --- a/Machines/ILSOS_CCW_H52A/EquipmentSetup.cs +++ b/Machines/ILSOS_CCW_H52A/EquipmentSetup.cs @@ -23,12 +23,16 @@ using CoreUnit.Scanner.UserControl.ScannerCanvas; using DB; using DB.Recipe; using GUI; +using Hermes; using ILSOS_CCW_H52A.Alarm; using ILSOS_CCW_H52A.Device; using ILSOS_CCW_H52A.Models; using ILSOS_CCW_H52A.Recipes; using ILSOS_CCW_H52A.Sequences; using ILSOS_CCW_H52A.Views; +using System; +using System.Reactive.Linq; +using System.Windows; using System.Windows.Controls; using System.Windows.Media; using WeldingCommon; @@ -39,9 +43,6 @@ using WeldingCommon.Utils; using WeldingCommon.Views; using WeldingCommon.Vision.Factory; using static WeldingCommon.Vision.Factory.VisionFactory; -using System.Reactive.Linq; -using System; -using System.Windows; namespace ILSOS_CCW_H52A { @@ -91,22 +92,20 @@ namespace ILSOS_CCW_H52A var seq = AuroraEnv.SequenceEntry[SequenceIds.SeqAutoRunCCWH52A] as ISequence; seq.RunStateChanged += AutoRunSeq_RunStateChanged; } - private void ApplyRecipeByState(bool bON) - { - Application.Current.Dispatcher.Invoke(() => { - if (bON == false) - WeldingRecipeManager.OnActiveReloaded(); - else - WeldingRecipeManager.ReloadWeldingRecipe(WeldingRecipeManager.SelectedRecipe.name); - }); - } + private void AutoRunSeq_RunStateChanged(object sender, (string sequenceId, SequenceRunState state) e) { //AutoRun 상황에서 Recipe Save Lock AuroraEnv.RecipeManager.SaveLock(CommonRecipeIds.ScannerObjectTeaching, e.state != SequenceRunState.Idle); bool AutoRunState = e.state == SequenceRunState.Running; - ApplyRecipeByState(AutoRunState); - _UCRecipe.IsEnabled = e.state != SequenceRunState.Running; + Application.Current.Dispatcher.Invoke(() => { + if (AutoRunState) + WeldingRecipeManager.OnActiveReloaded(); + else + WeldingRecipeManager.ReloadWeldingRecipe(WeldingRecipeManager.SelectedRecipe.name); + + _UCRecipe.IsEnabled = e.state != SequenceRunState.Running; + }); } private void OnPermissionChanged(EventMessage message) { @@ -114,7 +113,12 @@ namespace ILSOS_CCW_H52A AuroraEnv.RecipeManager.SaveLock(CommonRecipeIds.ScannerObjectTeaching, !permissionOn); // Login 권한이 없어지면 Active된 레시피로 변경하도록 함 - ApplyRecipeByState(permissionOn); + Application.Current.Dispatcher.Invoke(() => { + if (!permissionOn) + WeldingRecipeManager.OnActiveReloaded(); + else + WeldingRecipeManager.ReloadWeldingRecipe(WeldingRecipeManager.SelectedRecipe.name); + }); //LogOut 상황에서 Recipe Save Lock //LogOut 상황에서 Reicpe 화면 수정할 수 없도록 함 diff --git a/WeldingComponents/LASA/GUI/Canvas/CanvasCtrl/Canvas.cs b/WeldingComponents/LASA/GUI/Canvas/CanvasCtrl/Canvas.cs index 0ff7596..015cd56 100644 --- a/WeldingComponents/LASA/GUI/Canvas/CanvasCtrl/Canvas.cs +++ b/WeldingComponents/LASA/GUI/Canvas/CanvasCtrl/Canvas.cs @@ -1,9 +1,12 @@ +using Aurora.Api; using CoreUnit.ScannerCanvasCoreUnit; using GUI.Properties; using System; using System.Collections.Generic; using System.Drawing; +using System.Drawing.Text; using System.Linq; +using System.Security.Cryptography.X509Certificates; using System.Windows.Forms; namespace CoreUnit.Control.UserControl.Canvas @@ -253,6 +256,7 @@ namespace CoreUnit.Control.UserControl.Canvas public partial class CanvasCtrl : System.Windows.Forms.UserControl { public List scannerParamColorList = new List(); + public Logger Log = new Logger("CanvasCtrl"); // ´õºí¹öÆÛ Å׽ºƮ private BufferedGraphicsContext context; @@ -1660,6 +1664,7 @@ namespace CoreUnit.Control.UserControl.Canvas if (evtGetOffsetValue != null) { float offsetValue = evtGetOffsetValue(); Model.MoveObjects(new UnitPoint(0, offsetValue), Model.SelectedObjects, true); + Log.I($"Input Key Up, Layer Move. [X : 0, {offsetValue}"); DoInvalidate(true); } break; @@ -1668,6 +1673,7 @@ namespace CoreUnit.Control.UserControl.Canvas if (evtGetOffsetValue != null) { float offsetValue = evtGetOffsetValue(); Model.MoveObjects(new UnitPoint(0, -1 * offsetValue), Model.SelectedObjects, true); + Log.I($"Input Key Down, Layer Move. [X : 0, {-1 * offsetValue}"); DoInvalidate(true); } break; @@ -1676,6 +1682,7 @@ namespace CoreUnit.Control.UserControl.Canvas if (evtGetOffsetValue != null) { float offsetValue = evtGetOffsetValue(); Model.MoveObjects(new UnitPoint(offsetValue, 0), Model.SelectedObjects, true); + Log.I($"Input Key Right, Layer Move. [X : {offsetValue}, 0"); DoInvalidate(true); } break; @@ -1684,6 +1691,7 @@ namespace CoreUnit.Control.UserControl.Canvas if (evtGetOffsetValue != null) { double offsetValue = evtGetOffsetValue(); Model.MoveObjects(new UnitPoint(-1 * offsetValue, 0), Model.SelectedObjects, true); + Log.I($"Input Key Left, Layer Move. [X : {-1 * offsetValue}, 0"); DoInvalidate(true); } break; @@ -1692,6 +1700,7 @@ namespace CoreUnit.Control.UserControl.Canvas if (evtGetAngleOffsetValue != null) { float angleOffset = evtGetAngleOffsetValue(); ((DataModel)Model).RotateObjects(-1 * (float)angleOffset, Model.SelectedObjects, true); + Log.I($"Input Key E, Angle Rotate"); DoInvalidate(true); } break; @@ -1700,6 +1709,7 @@ namespace CoreUnit.Control.UserControl.Canvas if (evtGetAngleOffsetValue != null) { float angleOffset = evtGetAngleOffsetValue(); ((DataModel)Model).RotateObjects((float)angleOffset, Model.SelectedObjects, true); + Log.I($"Input Key Q, Angle Rotate"); DoInvalidate(true); } break;