64 lines
1.9 KiB
C#
64 lines
1.9 KiB
C#
/*
|
|
* Copyright (c) 2025 LG Electronics Inc.
|
|
* SPDX-License-Identifier: LicenseRef-LGE-Proprietary
|
|
*/
|
|
using System.Text;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
using System;
|
|
using VisionCommon;
|
|
|
|
namespace VisionUI.Pattern {
|
|
/// <summary>
|
|
/// 바코드 로그 뷰
|
|
/// BcrLogView.xaml beindCode
|
|
/// </summary>
|
|
public partial class BcrLogView : UserControl {
|
|
private SubSysInfo _SubSysInfo;
|
|
private SubSysRecipe _SubSysRecipe;
|
|
/// <summary>
|
|
/// 생성자
|
|
/// </summary>
|
|
/// <param name="subSysInfo">서브시스템 정보</param>
|
|
public BcrLogView(SubSysInfo subSysInfo) {
|
|
_SubSysInfo = subSysInfo;
|
|
_SubSysRecipe = VisionRecipeManager.GetSubSysRecipe(_SubSysInfo);
|
|
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void listView_KeyDown(object sender, KeyEventArgs e) {
|
|
var listView = (sender as ListView);
|
|
|
|
if (sender != listView) {
|
|
return;
|
|
}
|
|
|
|
if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.C) {
|
|
CopySelectedValuesToClipboard(listView);
|
|
}
|
|
}
|
|
|
|
private void CopySelectedValuesToClipboard(ListView listView) {
|
|
var builder = new StringBuilder();
|
|
|
|
Clipboard.SetText(builder.ToString());
|
|
}
|
|
|
|
private void UserControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) {
|
|
bool isVisible = (bool)e.NewValue;
|
|
if (isVisible == true) {
|
|
UpdateVisionRecipes();
|
|
|
|
if (((BcrLogViewModel)DataContext).SelectedDate != DateTime.Now.Date) {
|
|
((BcrLogViewModel)DataContext).SelectedDate = DateTime.Now.Date;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void UpdateVisionRecipes() {
|
|
_SubSysRecipe = VisionRecipeManager.GetSubSysRecipe(_SubSysInfo);
|
|
}
|
|
}
|
|
} |