77 lines
2.5 KiB
C#
77 lines
2.5 KiB
C#
using Aurora.Api;
|
|
using VisionAligner;
|
|
using VisionCommon;
|
|
using System;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using VisionCommonUI;
|
|
using VisionCommonUI.Resources;
|
|
using System.Windows.Media;
|
|
using System.Windows.Shapes;
|
|
using System.Windows.Input;
|
|
|
|
namespace VisionUI.ProcTest {
|
|
/// <summary>
|
|
/// 자재 공차 테스트 뷰
|
|
/// MaterialToleranceTestView.xaml behind code
|
|
/// </summary>
|
|
public partial class MaterialToleranceTestView : UserControl {
|
|
private Logger _Logger = new Logger(typeof(MaterialToleranceTestView).Name);
|
|
|
|
private SubSysInfo _SubSysInfo;
|
|
private SubSysRecipe _SubSysRecipe;
|
|
/// <summary>
|
|
/// 생성자
|
|
/// </summary>
|
|
/// <param name="subSysInfo">서브시스템 정보</param>
|
|
public MaterialToleranceTestView(SubSysInfo subSysInfo) {
|
|
_SubSysInfo = subSysInfo;
|
|
_SubSysRecipe = VisionRecipeManager.GetSubSysRecipe(_SubSysInfo);
|
|
InitializeComponent();
|
|
}
|
|
|
|
private double _scaleFactor = 1.0;
|
|
private const double ZoomIncrement = 0.1; // 확대/축소 비율
|
|
private void Grid_MouseWheel(object sender, MouseWheelEventArgs e) {
|
|
scaleTransform.CenterX = 450;
|
|
scaleTransform.CenterY = 350;
|
|
|
|
if (e.Delta > 0) {
|
|
_scaleFactor += ZoomIncrement;
|
|
}
|
|
else {
|
|
_scaleFactor = Math.Max(0.1, _scaleFactor - ZoomIncrement);
|
|
}
|
|
|
|
scaleTransform.ScaleX = _scaleFactor;
|
|
scaleTransform.ScaleY = _scaleFactor;
|
|
|
|
e.Handled = true; // 이벤트 처리 완료
|
|
}
|
|
private void UserControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) {
|
|
bool isVisible = (bool)e.NewValue;
|
|
if (isVisible == true) {
|
|
UpdateVisionRecipes();
|
|
}
|
|
}
|
|
|
|
private void UpdateVisionRecipes() {
|
|
_SubSysRecipe = VisionRecipeManager.GetSubSysRecipe(_SubSysInfo);
|
|
}
|
|
|
|
private void Ellipse_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) {
|
|
if (sender is Ellipse path) {
|
|
path.StrokeThickness = 2;
|
|
path.Stroke = new SolidColorBrush(Colors.Yellow);
|
|
}
|
|
}
|
|
|
|
private void Ellipse_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) {
|
|
if (sender is Ellipse path) {
|
|
path.StrokeThickness = 0;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
} |