forked from amkovkov/GranuSightSoftware2
599 lines
26 KiB
XML
599 lines
26 KiB
XML
<UserControl
|
|
x:Class="GSS2.UI.Core.Views.AmineContentSeparatorCalibrationView"
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:avalonia_converters="using:Avalonia.Data.Converters"
|
|
xmlns:converters="using:GSS2.UI.Core.Converters"
|
|
xmlns:core="using:GSS2.UI.Core"
|
|
xmlns:i="using:Avalonia.Xaml.Interactivity"
|
|
xmlns:ia="using:Avalonia.Xaml.Interactions.Custom"
|
|
xmlns:local="using:GSS2.UI.Core.Views"
|
|
xmlns:vm="using:GSS2.UI.Core.ViewModels"
|
|
x:DataType="vm:AmineContentSeparatorCalibrationViewModel">
|
|
|
|
<!-- #001e46 -->
|
|
<!-- #00357a -->
|
|
|
|
<!-- #0865b2 -->
|
|
|
|
<!-- #4182d2 -->
|
|
<!-- #67a0f3 -->
|
|
<!-- #8abfff -->
|
|
<!-- #acdfff -->
|
|
|
|
<UserControl.Resources>
|
|
<converters:NotEqualsConverter x:Key="NotEqualsConverter" />
|
|
<converters:EqualsConverter x:Key="EqualsConverter" />
|
|
|
|
<SolidColorBrush x:Key="HeaderBackground" Color="#00357a" />
|
|
<SolidColorBrush x:Key="MenuBackground" Color="#00357a" />
|
|
<SolidColorBrush x:Key="MenuBorder" Color="#0865b2" />
|
|
<SolidColorBrush x:Key="Overlay" Color="#0865b23f" />
|
|
<SolidColorBrush x:Key="ButtonBackground" Color="#0865b2" />
|
|
<SolidColorBrush x:Key="ButtonDangerBackground" Color="#b20808" />
|
|
<SolidColorBrush x:Key="ButtonForeground" Color="#ffffff" />
|
|
<SolidColorBrush x:Key="MainBackground" Color="#001e46" />
|
|
<!-- <SolidColorBrush x:Key="TextBoxBackground" Color="#0865b2" /> -->
|
|
<!-- <SolidColorBrush x:Key="TextBoxForeground" Color="#ffffff" /> -->
|
|
</UserControl.Resources>
|
|
|
|
<UserControl.Styles>
|
|
|
|
<Style Selector="Button">
|
|
<Setter Property="MinHeight" Value="40" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
<Setter Property="Background" Value="{StaticResource ButtonBackground}" />
|
|
<Setter Property="Foreground" Value="{StaticResource ButtonForeground}" />
|
|
</Style>
|
|
|
|
<Style Selector="Button.danger">
|
|
<Setter Property="Background" Value="{StaticResource ButtonDangerBackground}" />
|
|
</Style>
|
|
|
|
<Style Selector="Button.vertical">
|
|
<Setter Property="MinWidth" Value="40" />
|
|
</Style>
|
|
|
|
<Style Selector="TextBox">
|
|
<Setter Property="MinHeight" Value="40" />
|
|
<!-- <Setter Property="Background" Value="{StaticResource TextBoxBackground}" /> -->
|
|
<!-- <Setter Property="Foreground" Value="{StaticResource TextBoxForeground}" /> -->
|
|
</Style>
|
|
|
|
<Style Selector="TextBox.singleline">
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
</Style>
|
|
|
|
<Style Selector="TextBox.multiline">
|
|
<Setter Property="VerticalContentAlignment" Value="Top" />
|
|
</Style>
|
|
|
|
<Style Selector="TextBlock">
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
</Style>
|
|
|
|
<Style Selector="TextBlock.mini">
|
|
<Setter Property="Margin" Value="0,0,0,0" />
|
|
</Style>
|
|
|
|
<Style Selector="NumericUpDown">
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
</Style>
|
|
|
|
</UserControl.Styles>
|
|
|
|
<Grid Background="{StaticResource MainBackground}">
|
|
|
|
<!-- Основная форма -->
|
|
<Grid IsEnabled="{Binding !IsMenuOpen}">
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Верхняя панель -->
|
|
<Border
|
|
Grid.Row="0"
|
|
Padding="8"
|
|
Background="{StaticResource HeaderBackground}">
|
|
<Grid ColumnSpacing="5">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Button
|
|
Grid.Column="0"
|
|
Width="70"
|
|
Command="{Binding ToggleMenuCommand}"
|
|
Content="☰" />
|
|
|
|
<TextBlock
|
|
Grid.Column="1"
|
|
Margin="10,0,0,0"
|
|
VerticalAlignment="Center"
|
|
FontSize="18"
|
|
Text="{Binding EditingRecord.Id, StringFormat='Id: {0}'}" />
|
|
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- Основной контент -->
|
|
<Grid
|
|
Grid.Row="1"
|
|
Margin="8"
|
|
ColumnSpacing="5"
|
|
RowSpacing="5">
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- Главная панель -->
|
|
<core:SectionPanel
|
|
Grid.Row="0"
|
|
Grid.Column="0"
|
|
Grid.ColumnSpan="3"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
CanScrollBackward="{Binding MainSectionCanScrollBackward}"
|
|
CanScrollForward="{Binding MainSectionCanScrollForward}"
|
|
ClipToBounds="True"
|
|
CurrentIndex="{Binding MainSectionsCurrentIndex}"
|
|
IsScrolling="{Binding MainSectionIsScrolling}"
|
|
Orientation="Vertical">
|
|
|
|
<!-- Информация -->
|
|
<Grid ColumnSpacing="5" RowSpacing="5">
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBlock
|
|
Grid.Row="0"
|
|
Classes="mini"
|
|
Text="Тип:" />
|
|
|
|
<TextBox
|
|
Grid.Row="1"
|
|
Classes="singleline"
|
|
Text="{Binding EditingRecord.Type}"
|
|
Watermark="Тип" />
|
|
|
|
<TextBlock
|
|
Grid.Row="2"
|
|
Classes="mini"
|
|
Text="Партия:" />
|
|
|
|
<TextBox
|
|
Grid.Row="3"
|
|
Classes="singleline"
|
|
Text="{Binding EditingRecord.Batch}"
|
|
Watermark="Партия" />
|
|
|
|
</Grid>
|
|
|
|
<!-- Изображениямя -->
|
|
<Grid ColumnSpacing="5" RowSpacing="5">
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Изображения -->
|
|
<Grid Grid.Row="0">
|
|
|
|
<Grid ColumnSpacing="5">
|
|
|
|
<Grid.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
|
|
<Binding
|
|
Converter="{StaticResource NotEqualsConverter}"
|
|
ConverterParameter="0"
|
|
Path="Images.Count" />
|
|
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
|
|
</MultiBinding>
|
|
</Grid.IsVisible>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Button
|
|
Grid.Column="0"
|
|
VerticalAlignment="Stretch"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Classes="vertical"
|
|
Command="{Binding ImagesSectionPreviousCommand}"
|
|
Content="◀">
|
|
|
|
<Button.IsEnabled>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="ImagesSectionCanScrollBackward" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesSectionIsScrolling" />
|
|
</MultiBinding>
|
|
</Button.IsEnabled>
|
|
|
|
</Button>
|
|
|
|
<core:SectionPanel
|
|
Grid.Column="1"
|
|
CanScrollBackward="{Binding ImagesSectionCanScrollBackward}"
|
|
CanScrollForward="{Binding ImagesSectionCanScrollForward}"
|
|
ChildrenSource="{Binding Images}"
|
|
ClipToBounds="True"
|
|
CurrentIndex="{Binding ImagesSectionCurrentIndex}"
|
|
Cyclic="True"
|
|
IsScrolling="{Binding ImagesSectionIsScrolling}"
|
|
Orientation="Horizontal">
|
|
|
|
<core:SectionPanel.ChildrenTemplate>
|
|
<DataTemplate>
|
|
|
|
<Grid ColumnSpacing="5" RowSpacing="5">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid
|
|
Grid.Row="0"
|
|
Grid.RowSpan="11"
|
|
Grid.Column="0">
|
|
|
|
<core:ZoomPanImage
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
Background="Black"
|
|
ImageSource="{Binding Image}"
|
|
IsVisible="{Binding IsLoading, Converter={x:Static BoolConverters.Not}}" />
|
|
|
|
<StackPanel
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Center"
|
|
IsVisible="{Binding IsLoading}">
|
|
|
|
<ProgressBar IsIndeterminate="True" />
|
|
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
FontSize="18"
|
|
Text="Изображение загружается" />
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
<TextBlock
|
|
Grid.Row="0"
|
|
Grid.Column="1"
|
|
Text="Id: " />
|
|
|
|
<TextBox
|
|
Grid.Row="1"
|
|
Grid.Column="1"
|
|
Classes="singleline"
|
|
IsReadOnly="True"
|
|
Text="{Binding ImageRecord.Id}" />
|
|
|
|
<TextBlock
|
|
Grid.Row="2"
|
|
Grid.Column="1"
|
|
Text="Имя: " />
|
|
|
|
<TextBox
|
|
Grid.Row="3"
|
|
Grid.Column="1"
|
|
Classes="singleline"
|
|
IsReadOnly="True"
|
|
Text="{Binding ImageRecord.ImagePath}" />
|
|
|
|
<TextBlock
|
|
Grid.Row="4"
|
|
Grid.Column="1"
|
|
Text="Интенсивность видимого: " />
|
|
|
|
<TextBox
|
|
Grid.Row="5"
|
|
Grid.Column="1"
|
|
Classes="singleline"
|
|
IsReadOnly="True"
|
|
Text="{Binding ImageRecord.VisibleIntensity}" />
|
|
|
|
<TextBlock
|
|
Grid.Row="6"
|
|
Grid.Column="1"
|
|
Text="Интенсивность УФ 365 нм: " />
|
|
|
|
<TextBox
|
|
Grid.Row="7"
|
|
Grid.Column="1"
|
|
Classes="singleline"
|
|
IsReadOnly="True"
|
|
Text="{Binding ImageRecord.Uv365Intensity}" />
|
|
|
|
<TextBlock
|
|
Grid.Row="8"
|
|
Grid.Column="1"
|
|
Text="Интенсивность УФ 254 нм: " />
|
|
|
|
<TextBox
|
|
Grid.Row="9"
|
|
Grid.Column="1"
|
|
Classes="singleline"
|
|
IsReadOnly="True"
|
|
Text="{Binding ImageRecord.Uv254Intensity}" />
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
</core:SectionPanel.ChildrenTemplate>
|
|
|
|
</core:SectionPanel>
|
|
|
|
<Button
|
|
Grid.Column="2"
|
|
VerticalAlignment="Stretch"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Classes="vertical"
|
|
Command="{Binding ImagesSectionNextCommand}"
|
|
Content="▶">
|
|
|
|
<Button.IsEnabled>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="ImagesSectionCanScrollForward" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesSectionIsScrolling" />
|
|
</MultiBinding>
|
|
</Button.IsEnabled>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontSize="18"
|
|
Text="Изображения сепаратора отсутствуют">
|
|
|
|
<TextBlock.IsVisible>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
|
|
<Binding
|
|
Converter="{StaticResource EqualsConverter}"
|
|
ConverterParameter="0"
|
|
Path="Images.Count" />
|
|
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
|
|
|
|
</MultiBinding>
|
|
</TextBlock.IsVisible>
|
|
|
|
</TextBlock>
|
|
|
|
<StackPanel
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Center"
|
|
IsVisible="{Binding ImagesIsCapturing}">
|
|
|
|
<ProgressBar IsIndeterminate="True" />
|
|
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
FontSize="18"
|
|
Text="{Binding ImagesCapturingProgress}" />
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
<!-- Кнопки -->
|
|
<Button
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding CaptureImageCommand}"
|
|
Content="Получить изображения"
|
|
IsVisible="{Binding CaptureImagesTask, Converter={x:Static ObjectConverters.IsNull}}" />
|
|
|
|
<Button
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding CencelImageCapturingCommand}"
|
|
Content="Отменить съёмку"
|
|
IsVisible="{Binding CaptureImagesTask, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
|
|
|
</Grid>
|
|
|
|
</core:SectionPanel>
|
|
|
|
<!-- Общие конпки гланой панели -->
|
|
<Button
|
|
Grid.Row="1"
|
|
Grid.Column="0"
|
|
HorizontalAlignment="Stretch"
|
|
Classes="danger"
|
|
Command="{Binding DeleteRecordCommand}"
|
|
Content="Удалить" />
|
|
|
|
<Button
|
|
Grid.Row="1"
|
|
Grid.Column="1"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding SaveRecordCommand}"
|
|
Content="Сохранить" />
|
|
|
|
<Button
|
|
Grid.Row="1"
|
|
Grid.Column="2"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding SwitchMainSectionCommand}"
|
|
Content="К информации"
|
|
IsVisible="{Binding MainSectionsCurrentIndex, Converter={StaticResource EqualsConverter}, ConverterParameter=1}">
|
|
|
|
<Button.IsEnabled>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="MainSectionCanScrollBackward" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="MainSectionIsScrolling" />
|
|
</MultiBinding>
|
|
</Button.IsEnabled>
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
Grid.Row="1"
|
|
Grid.Column="2"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding SwitchMainSectionCommand}"
|
|
Content="К изображениям"
|
|
IsVisible="{Binding MainSectionsCurrentIndex, Converter={StaticResource EqualsConverter}, ConverterParameter=0}">
|
|
|
|
<Button.IsEnabled>
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
<Binding Path="MainSectionCanScrollForward" />
|
|
<Binding Converter="{x:Static BoolConverters.Not}" Path="MainSectionIsScrolling" />
|
|
</MultiBinding>
|
|
</Button.IsEnabled>
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
<!-- Полупрозрачный оверлей -->
|
|
<Border
|
|
Background="{StaticResource Overlay}"
|
|
IsEnabled="{Binding IsMenuOpen}"
|
|
IsVisible="{Binding IsMenuOpen}">
|
|
|
|
<Interaction.Behaviors>
|
|
<TappedTrigger>
|
|
<InvokeCommandAction Command="{Binding CloseMenuCommand}" />
|
|
</TappedTrigger>
|
|
</Interaction.Behaviors>
|
|
|
|
</Border>
|
|
|
|
<!-- Выезжающая панель -->
|
|
<Border
|
|
HorizontalAlignment="Left"
|
|
Background="{StaticResource MenuBackground}"
|
|
BorderBrush="{StaticResource MenuBorder}"
|
|
BorderThickness="0,0,1,0"
|
|
IsEnabled="{Binding IsMenuOpen}"
|
|
IsVisible="{Binding IsMenuOpen}">
|
|
|
|
<Border.Transitions>
|
|
<Transitions>
|
|
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.25" />
|
|
</Transitions>
|
|
</Border.Transitions>
|
|
|
|
<Interaction.Behaviors>
|
|
|
|
<DataTriggerBehavior
|
|
Binding="{Binding IsMenuOpen}"
|
|
ComparisonCondition="Equal"
|
|
Value="True">
|
|
|
|
<ChangePropertyAction PropertyName="RenderTransform" Value="translateX(0px)" />
|
|
|
|
</DataTriggerBehavior>
|
|
|
|
<DataTriggerBehavior
|
|
Binding="{Binding IsMenuOpen}"
|
|
ComparisonCondition="Equal"
|
|
Value="False">
|
|
|
|
<ChangePropertyAction PropertyName="RenderTransform" Value="translateX(-320px)" />
|
|
|
|
</DataTriggerBehavior>
|
|
|
|
</Interaction.Behaviors>
|
|
|
|
<!-- Содержимое меню -->
|
|
<StackPanel Margin="10" Spacing="10">
|
|
|
|
<Button
|
|
MinWidth="200"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding CreateRecordCommand}"
|
|
Content="Новая запись" />
|
|
|
|
<ListBox ItemsSource="{Binding Records}" SelectedItem="{Binding SelectedRecord}">
|
|
|
|
<ListBox.Styles>
|
|
|
|
<Style Selector="ListBoxItem">
|
|
<Setter Property="Background" Value="{StaticResource ButtonBackground}" />
|
|
</Style>
|
|
|
|
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
|
|
<Setter Property="Background" Value="{StaticResource MainBackground}" />
|
|
</Style>
|
|
|
|
</ListBox.Styles>
|
|
|
|
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Margin="5">
|
|
<Border Margin="3" CornerRadius="5">
|
|
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Run Text="{Binding Id, StringFormat='[{0}] '}" />
|
|
<Run Text="{Binding Type}" />
|
|
<Run Text=": " />
|
|
<Run Text="{Binding Batch}" />
|
|
</TextBlock>
|
|
</Border>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
|
|
</ListBox>
|
|
|
|
</StackPanel>
|
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
</UserControl>
|