Initial commit
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
using CordonelAssemblyLine.Event;
|
||||
using CordonelAssemblyLine.Model;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace CordonelAssemblyLine
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Leak.xaml
|
||||
/// </summary>
|
||||
public partial class Leak : Window
|
||||
{
|
||||
private LeakViewModel ViewModel = null;
|
||||
public Leak(CancellationToken globalCancellationToken, int slotNR, int? stationID = null, string Tester= "-")
|
||||
{
|
||||
InitializeComponent();
|
||||
ViewModel = new LeakViewModel(slotNR, stationID);
|
||||
ViewModel.TesterName = Tester;
|
||||
DataContext = ViewModel;
|
||||
ViewModel.MeterDetectedHandler += ViewModel_MeterDetectedHandler;
|
||||
ViewModel.OnStoreDone += ViewModel_OnStoreDone;
|
||||
tippBox.Text = ViewModel.ToolTipInput;
|
||||
|
||||
}
|
||||
|
||||
private void BtnPresueFailed_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.StoreData(false);
|
||||
}
|
||||
|
||||
private void BtnPresueOk_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.StoreData(true);
|
||||
}
|
||||
private void ViewModel_OnStoreDone(object sender, StringArgs e)
|
||||
{
|
||||
MessageBox.Show(e.Content);
|
||||
}
|
||||
private void ViewModel_MeterDetectedHandler(object sender, EventArgs e)
|
||||
{
|
||||
Dispatcher.Invoke(DispatcherPriority.Normal,
|
||||
new Action(() =>
|
||||
{
|
||||
bool update = false;
|
||||
if (sender is null)
|
||||
{
|
||||
ViewModel.InputIsEnabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
ViewModel.ReloadData(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ViewModel.InputIsEnabled = false;
|
||||
MessageBox.Show($"Fehler: {ex.Message}");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
));
|
||||
}
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string input = "";
|
||||
var obj = ((FrameworkElement)sender).DataContext;
|
||||
if (obj is Xylem.Common.Logic.ProductionOrderCore.TestResults.PressureTestPoints ptp)
|
||||
{
|
||||
ViewModel.Result.SetAllTestPoints(ptp.Input);
|
||||
|
||||
|
||||
}
|
||||
var d = listViewTestPotins.DataContext;
|
||||
listViewTestPotins.DataContext = null;
|
||||
listViewTestPotins.DataContext = d;
|
||||
// var c = e.Changes.First();
|
||||
// if (c.RemovedLength == 0)
|
||||
// {
|
||||
// var input = txtSender.Text.Substring(c.Offset, c.AddedLength);
|
||||
// if (BarcodeInputActiveOffset.HasValue)
|
||||
// {
|
||||
// BarcodeInput = $"{BarcodeInput}{input}";
|
||||
|
||||
// if (input == System.Environment.NewLine)
|
||||
// {
|
||||
// var tmpOffset = BarcodeInputActiveOffset.Value;
|
||||
// BarcodeInputActiveOffset = null;
|
||||
// OnBarcodeInput?.Invoke(null, new StringArgs(BarcodeInput));
|
||||
// txtSender.Text = txtSender.Text.Replace(BarcodeInput, "");
|
||||
// BarcodeInput = "";
|
||||
// txtSender.Focus();
|
||||
// txtSender.CaretIndex = tmpOffset;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (ViewModel != null && ViewModel.BarcodeTrigger.Any(t => t == input))
|
||||
// {
|
||||
|
||||
// BarcodeInput = txtSender.Text.Substring(c.Offset, c.AddedLength);
|
||||
// BarcodeInputActiveOffset = c.Offset;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user