Initial commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<UserControl x:Class="ProductionUiCordonel.ctls.ctlMultiModeMarriage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:ProductionUiCordonel.ctls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="150" d:DesignWidth="450">
|
||||
<Grid>
|
||||
<StackPanel Background="BlanchedAlmond" >
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100*"/>
|
||||
<ColumnDefinition Width="225*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBox Name="TxtSerialNumber" Text="{Binding SerialNr, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Height="26" Margin="24,10,0,0" TextWrapping="Wrap" IsEnabled="False" VerticalAlignment="Top" Width="190" Grid.Column="1" Grid.Row="0"/>
|
||||
<Label Content="SerialNumber" HorizontalAlignment="Left" Margin="14,10,0,0" VerticalAlignment="Top" Grid.Row="0" Height="26" Width="82"/>
|
||||
<TextBox x:Name="TxtPcbId" Text="{Binding CurrentPcbID, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Height="26" Margin="24,10,0,0" IsEnabled="False" TextWrapping="Wrap" VerticalAlignment="Top" Width="190" Grid.Column="1" Grid.Row="1"/>
|
||||
<Label Content="PcbId" HorizontalAlignment="Left" Margin="14,10,0,0" VerticalAlignment="Top" Grid.Row="1" Height="26" Width="40"/>
|
||||
<Button Name="btnMarry" IsEnabled="{Binding CanMarry, UpdateSourceTrigger=PropertyChanged}" Grid.ColumnSpan="2" Content="Marry" Height="35" Margin="35,5,0,0" Grid.Row="2" VerticalAlignment="Top" Click="btnMarry_Click" HorizontalAlignment="Left" Width="395"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,45 @@
|
||||
using ProductionUiCordonel.Model;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace ProductionUiCordonel.ctls
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ctlMultiModeMarriage.xaml
|
||||
/// </summary>
|
||||
public partial class ctlMultiModeMarriage : UserControl
|
||||
{
|
||||
private MarriageMultiModeViewModel ViewModel = null;
|
||||
public ctlMultiModeMarriage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void setViewModel(MarriageMultiModeViewModel viewModel)
|
||||
{
|
||||
ViewModel = viewModel;
|
||||
//ViewModel.Store();
|
||||
}
|
||||
|
||||
private void btnMarry_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Task<bool>.Run(() =>
|
||||
{
|
||||
return ViewModel.Store();
|
||||
}).ContinueWith(a =>
|
||||
{
|
||||
if (a.Result)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Meter has passed");
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Meter not has passed");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<UserControl x:Class="ProductionUiCordonel.ctls.ctlMultiModePicking"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:ProductionUiCordonel.ctls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<StackPanel Background="BlueViolet" >
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="30"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="20*"/>
|
||||
<ColumnDefinition Width="80*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Picking Tool" Height="30" Grid.Row="0" Grid.ColumnSpan="2"></Label>
|
||||
<Label Content="Order" Height="80" Grid.Row="1" Grid.Column="0"></Label>
|
||||
<Label Name="lblPickingOrder" Height="80" Grid.Row="1" Grid.Column="1"></Label>
|
||||
<Label Name="lblStatus" Height="80" Grid.Row="2" Grid.ColumnSpan="2"></Label>
|
||||
</Grid>
|
||||
<DockPanel>
|
||||
|
||||
<ItemsControl Name="icPicking" ItemsSource="{Binding Data}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="Black" Background="{Binding ResultColor}" BorderThickness="1" Margin="2">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Content="{Binding Ident}" Grid.Row="0" Grid.Column="0"/>
|
||||
<Label Content="{Binding CheckText}" Grid.Row="0" Grid.Column="1"/>
|
||||
<Label Content="{Binding CurrentValueText}" Grid.Row="0" Grid.Column="2"/>
|
||||
<Label Content="{Binding Result}" Grid.Row="0" Grid.Column="3"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
|
||||
<ItemsControl.Template>
|
||||
<ControlTemplate TargetType="ItemsControl">
|
||||
<ScrollViewer CanContentScroll="True">
|
||||
<ItemsPresenter/>
|
||||
</ScrollViewer>
|
||||
</ControlTemplate>
|
||||
</ItemsControl.Template>
|
||||
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,135 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Threading;
|
||||
using ProductionUiCordonel.Data;
|
||||
using ProductionUiCordonel.Model;
|
||||
|
||||
namespace ProductionUiCordonel.ctls
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ctlMultiModePicking.xaml
|
||||
/// </summary>
|
||||
public partial class ctlMultiModePicking : UserControl
|
||||
{
|
||||
private PickingMultiModeViewModel ViewModel = null;
|
||||
public ctlMultiModePicking()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
public void setViewModel(PickingMultiModeViewModel viewModel)
|
||||
{
|
||||
ViewModel = viewModel;
|
||||
ViewModel.MeterDetectedHandler += ViewModel_MeterDetectedHandler;
|
||||
viewModel.OnDataChanged += PickingData_OnDataChanged;
|
||||
ViewModel.OnUpdateUi += UpdatePickingUi;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
|
||||
var ts = DateTimeOffset.UtcNow - new DateTimeOffset(2000, 1, 1, 0, 0, 0, new TimeSpan(0));
|
||||
ViewModel.CurrentMeter.Login();
|
||||
ViewModel.CurrentMeter.WriteRegister("GENESISFLOW_SealDisplay", 0);
|
||||
ViewModel.CurrentMeter.WriteRegister("POWERMON_WarnFromClamp", (UInt32)473040000);
|
||||
ViewModel.CurrentMeter.WriteRegister("SYSTEM_CalendarSeconds", Convert.ToInt32(ts.TotalSeconds));
|
||||
ViewModel.CurrentMeter.SetLcdText(false, new byte[] { 0x12, 0x34 });
|
||||
|
||||
|
||||
//ViewModel.ReloadData(false);
|
||||
}
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
private void UpdatePickingUi(object sender, EventArgs e)
|
||||
{
|
||||
icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
|
||||
{
|
||||
lblStatus.Content = ViewModel.StatusText;
|
||||
lblStatus.Background = ViewModel.StatusColor;
|
||||
lblPickingOrder.Content = $"{ViewModel.Order}({ViewModel.Done}/{ViewModel.ToDo}";
|
||||
if (ViewModel.Done > 0 && ViewModel.Done >= ViewModel.ToDo)
|
||||
{
|
||||
MessageBox.Show("Order is Finish");
|
||||
lblStatus.Content = "Please input a new order number";
|
||||
}
|
||||
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
private void PickingData_OnDataChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (sender is ObservableCollection<IPickingResultData> newData)
|
||||
{
|
||||
icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { icPicking.ItemsSource = newData; }));
|
||||
}
|
||||
|
||||
icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { lblStatus.Content = ViewModel.StatusText; lblStatus.Background = ViewModel.StatusColor; }));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//private void UpdatePickingUi(string state, System.Windows.Media.Brush StateColor, string Order, int toDo, int Done)
|
||||
//{
|
||||
// icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
|
||||
// {
|
||||
// lblStatus.Content = state;
|
||||
// lblStatus.Background = StateColor;
|
||||
// lblPickingOrder.Content = $"{Order}({Done}/{toDo}";
|
||||
// txtHiddenInput.Focus();
|
||||
// if (Done > 0 && Done >= toDo)
|
||||
// {
|
||||
// MessageBox.Show("Order is Finish");
|
||||
// txtOrderNr.Text = "";
|
||||
// lblStatus.Content = "Please input a new order number";
|
||||
// }
|
||||
|
||||
// }));
|
||||
|
||||
//}
|
||||
|
||||
//private void PickingData_OnDataChanged(object sender, EventArgs e)
|
||||
//{
|
||||
// if (sender is ObservableCollection<IPickingResultData> newData)
|
||||
// {
|
||||
// icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { icPicking.ItemsSource = newData; }));
|
||||
// }
|
||||
|
||||
// icPicking.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => { lblStatus.Content = PickingData.StatusText; lblStatus.Background = PickingData.StatusColor; }));
|
||||
|
||||
|
||||
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
<UserControl x:Class="ProductionUiCordonel.ctls.ctlMultiModePressure"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:ProductionUiCordonel.ctls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="600" Background="CadetBlue" IsEnabled="{Binding InputIsEnabled, UpdateSourceTrigger=PropertyChanged}" >
|
||||
<Grid>
|
||||
<!--<Grid Grid.Row="8">
|
||||
<Grid.RowDefinitions>
|
||||
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="5*"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="5*"/>
|
||||
<RowDefinition Height="10*" />
|
||||
<RowDefinition Height="30*"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="65"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Rectangle Grid.Row="0" Grid.ColumnSpan="2" Fill="Transparent" />
|
||||
<Rectangle Grid.Row="1" Grid.ColumnSpan="2" Fill="Black" />
|
||||
<Rectangle Grid.Row="2" Grid.ColumnSpan="2" Fill="LightGreen" />
|
||||
<Rectangle Grid.Row="3" Grid.ColumnSpan="2" Fill="LightGreen" />
|
||||
<Rectangle Grid.Row="4" Grid.ColumnSpan="2" Fill="Black" />
|
||||
|
||||
<Rectangle Grid.Row="5" Grid.ColumnSpan="2" Fill="LightPink" />
|
||||
<Rectangle Grid.Row="6" Grid.ColumnSpan="2" Fill="LightPink" />
|
||||
<Rectangle Grid.Row="7" Grid.ColumnSpan="2" Fill="LightPink" />
|
||||
<Rectangle Grid.Row="8" Grid.ColumnSpan="2" Fill="Black" />
|
||||
|
||||
<TextBox x:Name="TxtPresurePcbId" HorizontalAlignment="Left" Height="26" Margin="0,0,0,0" IsEnabled="False" TextWrapping="Wrap" Text="{Binding CurrentPcbID, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" Width="268" Grid.Row="0" Grid.Column="1"/>
|
||||
<Label Content="PcbId" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" Grid.Row="0" Height="26" Width="40"/>
|
||||
<Label Content="Presue was successful" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Left" Width="630" />
|
||||
<Button Name="btnPresueOk" Grid.ColumnSpan="2" Content="Pressure test successful" HorizontalAlignment="Left" Height="35" Margin="9,5,0,0" Grid.Row="3" VerticalAlignment="Top" Width="435" Click="BtnPresueOk_Click"/>
|
||||
|
||||
|
||||
<Label Content="Presue Failed" HorizontalAlignment="Left" Width="630" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="2" />
|
||||
|
||||
<Label Content="Remark" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" Height="26" Width="54" Grid.Column="0" Grid.Row="6" />
|
||||
|
||||
<TextBox x:Name="TxtPresureFailedText" HorizontalAlignment="Left" Height="102" Margin="3,10,0,0" TextWrapping="Wrap" AcceptsReturn="True" AcceptsTab="True" SpellCheck.IsEnabled="True" SpellCheck.SpellingReform="PreAndPostreform" Text="" VerticalAlignment="Top" Width="478" Grid.Row="6" Grid.Column="1"/>
|
||||
|
||||
<Button Name="btnPresueFailed" Grid.ColumnSpan="2" Content="Pressure test was unsuccessful" HorizontalAlignment="Left" Height="35" Margin="9,5,0,0" Grid.Row="7" VerticalAlignment="Top" Width="435" Click="BtnPresueFailed_Click" />
|
||||
|
||||
|
||||
|
||||
</Grid>-->
|
||||
|
||||
<Grid Grid.Row="8">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="12*"/>
|
||||
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="100*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="20*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120" />
|
||||
<ColumnDefinition Width="180" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="200" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<Label x:Name="lblHeadline" Content="HE-Schnüffeln" Grid.Column="0" Grid.Row="0" FontWeight="Bold" FontSize="24" Height="47" VerticalAlignment="Top" Margin="0,0,113,0" Grid.RowSpan="2" Grid.ColumnSpan="2" />
|
||||
|
||||
<Label x:Name="lblLeakrate" Content="Grenz-Leckrate >" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Row="0" Grid.Column="2" Height="26" Width="123" />
|
||||
<TextBox x:Name="txtLeakrate" Height="26" IsEnabled="True" TextWrapping="Wrap" Text="{Binding Result.LeakRate, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" Grid.Row="0" Grid.Column="3" HorizontalAlignment="Left" Width="171" TextChanged="TextBox_TextChanged"/>
|
||||
|
||||
|
||||
|
||||
<TextBox x:Name="TxtPresurePcbId" Height="26" IsEnabled="False" TextWrapping="Wrap" Text="{Binding CurrentPcbID, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Width="150" TextChanged="TextBox_TextChanged"/>
|
||||
<Label Content="PcbId" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Row="1" Grid.Column="0" Height="26" Width="40"/>
|
||||
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="2">
|
||||
<TextBlock Text="Rev: "/>
|
||||
<Label Content="{Binding Result.Rev, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="26" Width="40"/>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<Label Content="Prüfdruck in bar" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Row="2" Grid.Column="0" Height="26" Width="113" Grid.ColumnSpan="2" />
|
||||
<TextBox x:Name="txtPressure" Height="26" IsEnabled="True" TextWrapping="Wrap" Text="{Binding Result.TestPressure, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Width="150" TextChanged="TextBox_TextChanged"/>
|
||||
|
||||
|
||||
<TextBox x:Name="txtTester" Height="26" IsEnabled="True" TextWrapping="Wrap" Text="{Binding Result.TesterName, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" Width="150" TextChanged="TextBox_TextChanged" />
|
||||
|
||||
|
||||
<Label Content="Prüfer" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Grid.Row="3" Grid.Column="0" Height="26" Width="85" />
|
||||
|
||||
|
||||
<ListView x:Name="listViewTestPotins" ItemsSource="{Binding Result.Testpoints, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="2" Grid.RowSpan="4" HorizontalAlignment="left" Width="251" Margin="10,10,0,0" Grid.ColumnSpan="2" >
|
||||
<ListView.View>
|
||||
<GridView >
|
||||
<GridViewColumn Header="Nr" >
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate >
|
||||
<Label Content="{Binding Ident}" Height="22" FontWeight="Bold" FontSize="10" />
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Header="Wert" >
|
||||
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding Input}" Height="22" Width="100" FontWeight="Bold" FontSize="13" TextChanged="TextBox_TextChanged" />
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
|
||||
</GridViewColumn>
|
||||
|
||||
<GridViewColumn Header="" >
|
||||
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="Für alle übernehmen" Height="22" FontWeight="Bold" FontSize="13" Click="Button_Click" />
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
|
||||
</GridViewColumn>
|
||||
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
|
||||
<Label Content="Bemerkung" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" Height="26" Width="113" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" />
|
||||
|
||||
<TextBox Text="{Binding Result.Remark, UpdateSourceTrigger=PropertyChanged}" Margin="10,10,10,7" TextWrapping="Wrap" AcceptsReturn="True" AcceptsTab="True" SpellCheck.IsEnabled="True" SpellCheck.SpellingReform="PreAndPostreform" Grid.Row="4" Grid.Column="1" TextChanged="TextBox_TextChanged"/>
|
||||
|
||||
|
||||
<Button Name="btnPresueOk" Background="LightGreen" Grid.ColumnSpan="2" Content="Bestanden" HorizontalAlignment="Left" Height="35" Margin="10,5,0,0" Grid.Row="6" VerticalAlignment="Top" Width="280" Click="BtnPresueOk_Click" Grid.Column="2"/>
|
||||
|
||||
<Button Name="btnPresueFailed" Background="LightPink" Grid.ColumnSpan="2" Content="Nicht Bestanden" HorizontalAlignment="Left" Height="35" Margin="9,5,0,0" Grid.Row="6" VerticalAlignment="Top" Width="281" Click="BtnPresueFailed_Click" Grid.Column="0" />
|
||||
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,169 @@
|
||||
using ProductionUiCordonel.Event;
|
||||
using ProductionUiCordonel.Model;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using Xylem.Common.Logic.ProductionOrderCore.TestResults;
|
||||
|
||||
namespace ProductionUiCordonel.ctls
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ctlMultiModePressure.xaml
|
||||
/// </summary>
|
||||
public partial class ctlMultiModePressure : UserControl
|
||||
{
|
||||
public event EventHandler<StringArgs> OnBarcodeInput;
|
||||
|
||||
private PressureMultiModeViewModel ViewModel = null;
|
||||
public ctlMultiModePressure()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void setViewModel(PressureMultiModeViewModel viewModel)
|
||||
{
|
||||
ViewModel = viewModel;
|
||||
viewModel.MeterDetectedHandler += ViewModel_MeterDetectedHandler;
|
||||
ViewModel.OnStoreDone += ViewModel_OnStoreDone;
|
||||
//OnBarcodeInput = "PressureControl_OnBarcodeInput"
|
||||
//
|
||||
if (viewModel.ChildName == "PressureHY")
|
||||
{
|
||||
ViewModel.StationID = 1;
|
||||
lblHeadline.Content = "hydraulisch Dichtheitsprüfung";
|
||||
txtLeakrate.Visibility = Visibility.Hidden;
|
||||
lblLeakrate.Visibility = Visibility.Hidden;
|
||||
listViewTestPotins.Visibility = Visibility.Hidden;
|
||||
}
|
||||
else
|
||||
{
|
||||
ViewModel.StationID = 2;
|
||||
lblHeadline.Content = "Helium Dichtheitsprüfung";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
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
|
||||
{
|
||||
ViewModel.ReloadData(false);
|
||||
}
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
private void BtnPresueOk_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.StoreData(true);
|
||||
}
|
||||
|
||||
private void BtnPresueFailed_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.StoreData(false);
|
||||
}
|
||||
private void ViewModel_OnStoreDone(object sender, StringArgs e)
|
||||
{
|
||||
MessageBox.Show(e.Content);
|
||||
}
|
||||
private int? BarcodeInputActiveOffset = null;
|
||||
private string BarcodeInput = "";
|
||||
|
||||
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
if (sender is TextBox txtSender)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string input = "";
|
||||
var obj = ((FrameworkElement)sender).DataContext;
|
||||
if (obj is 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