Key 입력 Offset Log 추가 & Apply 메서드 삭제

This commit is contained in:
최민영 2026-03-17 12:26:47 +09:00
parent 5a9579b887
commit a73ee05068
2 changed files with 29 additions and 15 deletions

View File

@ -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);
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 화면 수정할 수 없도록 함

View File

@ -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<Color> scannerParamColorList = new List<Color>();
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;