Files
GSS2Rework/GSS2/Views/AmineContent/SeparatorCalibrationView.axaml
amkovkov 72ae26eee7 comprehensive update
1) remove unused components: camera view (due it causes segmentation faults), compute resources and all related, illuminator controller (due in useless without camera view), image storage service, temperature and humidity service
2) database schema - reduce tables references, features storing in records themselves in compressed form, add records creation and editing date and time, add separator comment column
3) analysis - rework of pipeline and ui, now database storing only raw data and all display values calculated from it
4) lights service - add reconnection if disconnected
5) add width and height command line arguments
6) fix some typos and other issues
2026-06-29 15:13:29 +03:00

468 lines
20 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<UserControl
x:Class="GSS2.Views.AmineContent.SeparatorCalibrationView"
x:DataType="vm:SeparatorCalibrationViewModel"
xmlns:controls="using:GSS2.Controls"
xmlns:core="using:GSS2.UI.Core"
xmlns:i="using:Avalonia.Xaml.Interactivity"
xmlns:ia="using:Avalonia.Xaml.Interactions.Custom"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:GSS2.ViewModels.AmineContent"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="https://github.com/avaloniaui"
>
<Grid Background="{StaticResource MainBackground}">
<!-- Основная форма -->
<Grid IsEnabled="{Binding CanInteract}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" /> <!-- Кнопка "Удалить" -->
<ColumnDefinition Width="*" /> <!-- Кнопка "Сохранить" -->
<ColumnDefinition Width="*" /> <!-- Кнопки "К информации"/"К изображению" -->
</Grid.ColumnDefinitions>
<Grid.ColumnSpacing>5</Grid.ColumnSpacing>
<Grid.RowDefinitions>
<RowDefinition Height="*" /> <!-- Главная панель -->
<RowDefinition Height="Auto" /> <!-- Кнопки главной панели -->
</Grid.RowDefinitions>
<Grid.RowSpacing>5</Grid.RowSpacing>
<!-- Главная панель -->
<core:SectionPanel
CanScrollBackward="{Binding MainSectionCanScrollBackward}"
CanScrollForward="{Binding MainSectionCanScrollForward}"
ClipToBounds="True"
CurrentIndex="{Binding MainSectionCurrentIndex}"
Grid.Column="0"
Grid.ColumnSpan="3"
Grid.Row="0"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
IsScrolling="{Binding MainSectionIsScrolling}"
Orientation="Vertical"
>
<!-- Информация -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <!-- Кнопка меню -->
<ColumnDefinition Width="*" /> <!-- Информация -->
</Grid.ColumnDefinitions>
<Grid.ColumnSpacing>5</Grid.ColumnSpacing>
<!-- Кнопка меню -->
<Button
Classes="vertical"
Command="{Binding ToggleMenuCommand}"
Grid.Column="0"
VerticalAlignment="Stretch"
>
<TextBlock Text="☰"/>
</Button>
<!-- Id / Uuid / Type -->
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.ColumnSpacing>5</Grid.ColumnSpacing>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <!-- Id (подпись) | Uuid (подпись) -->
<RowDefinition Height="Auto" /> <!-- Id (поле ) | Uuid (поле ) -->
<RowDefinition Height="Auto" /> <!-- Type (подпись) -->
<RowDefinition Height="Auto" /> <!-- Type (поле ) -->
<RowDefinition Height="Auto" /> <!-- Comment (подпись) -->
<RowDefinition Height="*" /> <!-- Comment (поле ) -->
</Grid.RowDefinitions>
<Grid.RowSpacing>5</Grid.RowSpacing>
<!-- Id (подпись) -->
<TextBlock
Classes="mini"
Grid.Column="0"
Grid.Row="0"
Text="ИД:"
/>
<!-- Id (поле) -->
<TextBox
Classes="singleline"
Grid.Column="0"
Grid.Row="1"
IsReadOnly="True"
PlaceholderText="ИД"
Text="{Binding Record.Id}"
/>
<!-- Uuid (подпись) -->
<TextBlock
Classes="mini"
Grid.Column="1"
Grid.Row="0"
Text="Уникальный ИД:"
/>
<!-- Uuid (поле) -->
<TextBox
Classes="singleline"
Grid.Column="1"
Grid.Row="1"
IsReadOnly="True"
PlaceholderText="Уникальный ИД"
Text="{Binding Record.Uuid}"
/>
<!-- Type (подпись) -->
<TextBlock
Grid.Row="2"
Grid.Column="0"
Classes="mini"
Text="Тип:"
/>
<!-- Type (поле) -->
<controls:TouchTextBox
Classes="singleline"
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="3"
PlaceholderText="Тип"
Text="{Binding Record.Type}"
/>
<!-- Comment (подпись) -->
<TextBlock
Classes="mini"
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="4"
Text="Дополнительная информация:"
/>
<!-- Comment (поле) -->
<controls:TouchTextBox
Classes="multiline"
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="5"
PlaceholderText="Дополнительная информация"
Text="{Binding Record.Comment}"
/>
</Grid>
</Grid>
<!-- Изображение -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" /> <!-- Изображение -->
<RowDefinition Height="Auto" /> <!-- Кнопка "Получить изображения" / "Отменить съёмку" -->
</Grid.RowDefinitions>
<Grid.RowSpacing>5</Grid.RowSpacing>
<!-- Изображение -->
<Grid>
<!-- Изображение -->
<core:ZoomPanImage
Background="Black"
HorizontalAlignment="Stretch"
ImageSource="{Binding Record.Image.Image}"
VerticalAlignment="Stretch"
>
<core:ZoomPanImage.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Converter="{x:Static StringConverters.IsNotNullOrEmpty}" Path="Record.Image.Data" />
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.Image.IsLoading" />
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
</MultiBinding>
</core:ZoomPanImage.IsVisible>
</core:ZoomPanImage>
<!-- Оверлей "Изображение загружается" -->
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" >
<StackPanel.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="Record.Image.IsLoading" />
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
</MultiBinding>
</StackPanel.IsVisible>
<ProgressBar IsIndeterminate="True" />
<TextBlock HorizontalAlignment="Center" Text="Изображение загружается" />
</StackPanel>
<!-- Оверлей "Изображение отсутствует" -->
<TextBlock
HorizontalAlignment="Center"
Text="Изображение отсутствует"
VerticalAlignment="Center"
>
<TextBlock.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Converter="{x:Static StringConverters.IsNullOrEmpty}" Path="Record.Image.Data" />
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.Image.IsLoading" />
<Binding Converter="{x:Static BoolConverters.Not}" Path="ImagesIsCapturing" />
</MultiBinding>
</TextBlock.IsVisible>
</TextBlock>
<!-- Оверлей прогресс -->
<StackPanel
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
>
<StackPanel.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Converter="{x:Static StringConverters.IsNullOrEmpty}" Path="Record.Image.Data" />
<Binding Converter="{x:Static BoolConverters.Not}" Path="Record.Image.IsLoading" />
<Binding Path="ImagesIsCapturing" />
</MultiBinding>
</StackPanel.IsVisible>
<ProgressBar IsIndeterminate="True" />
<TextBlock HorizontalAlignment="Center" Text="{Binding ImagesCapturingProgress}" />
</StackPanel>
</Grid>
<!-- Кнопка "Получить изображения" -->
<Button
Command="{Binding CaptureImageCommand}"
Grid.Row="1"
HorizontalAlignment="Stretch"
IsVisible="{Binding !ImagesIsCapturing}"
>
<TextBlock Text="Получить изображения"/>
</Button>
<!-- Кнопка "Отменить съёмку" -->
<Button
Command="{Binding CancelImageCapturingCommand}"
Grid.Row="1"
HorizontalAlignment="Stretch"
IsVisible="{Binding ImagesIsCapturing}"
>
<TextBlock Text="Отменить съёмку"/>
</Button>
</Grid>
</core:SectionPanel>
<!-- Кнопки главной панели -->
<!-- Кнопка "Удалить" -->
<Button
Classes="danger"
Command="{Binding DeleteRecordCommand}"
Grid.Column="0"
Grid.Row="1"
HorizontalAlignment="Stretch"
>
<TextBlock Text="Удалить"/>
</Button>
<!-- Кнопка "Сохранить" -->
<Button
Command="{Binding SaveRecordCommand}"
Content="Сохранить"
Grid.Column="1"
Grid.Row="1"
HorizontalAlignment="Stretch"
>
<TextBlock Text="Сохранить"/>
</Button>
<!-- Кнопка "К информации" -->
<Button
Command="{Binding SwitchMainSectionCommand}"
Content="К информации"
Grid.Column="2"
Grid.Row="1"
HorizontalAlignment="Stretch"
IsVisible="{Binding MainSectionCurrentIndex, Converter={StaticResource EqualsConverter}, ConverterParameter=1}"
>
<TextBlock Text="К информации"/>
<Button.IsEnabled>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="MainSectionCanScrollBackward" />
<Binding Converter="{x:Static BoolConverters.Not}" Path="MainSectionIsScrolling" />
</MultiBinding>
</Button.IsEnabled>
</Button>
<!-- Кнопка "К изображению" -->
<Button
Command="{Binding SwitchMainSectionCommand}"
Content="К изображению"
Grid.Column="2"
Grid.Row="1"
HorizontalAlignment="Stretch"
IsVisible="{Binding MainSectionCurrentIndex, Converter={StaticResource EqualsConverter}, ConverterParameter=0}"
>
<TextBlock Text="К изображению"/>
<Button.IsEnabled>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="MainSectionCanScrollForward" />
<Binding Converter="{x:Static BoolConverters.Not}" Path="MainSectionIsScrolling" />
</MultiBinding>
</Button.IsEnabled>
</Button>
</Grid>
<!-- Полупрозрачный оверлей -->
<Border
Background="{StaticResource Overlay}"
IsEnabled="{Binding MenuOpened}"
IsVisible="{Binding MenuOpened}"
>
<Interaction.Behaviors>
<TappedTrigger>
<InvokeCommandAction Command="{Binding CloseMenuCommand}" />
</TappedTrigger>
</Interaction.Behaviors>
</Border>
<!-- Выезжающая боковая панель -->
<Border
Background="{StaticResource MenuBackground}"
BorderBrush="{StaticResource MenuBorder}"
BorderThickness="0,0,1,0"
HorizontalAlignment="Left"
IsEnabled="{Binding MenuOpened}"
IsVisible="{Binding MenuOpened}"
>
<!-- Переходы -->
<Border.Transitions>
<Transitions>
<TransformOperationsTransition Duration="0:0:0.25" Property="RenderTransform" />
</Transitions>
</Border.Transitions>
<!-- Поведения -->
<Interaction.Behaviors>
<!-- Поведение при открытии меню -->
<DataTriggerBehavior
Binding="{Binding MenuOpened}"
ComparisonCondition="Equal"
Value="True"
>
<ChangePropertyAction PropertyName="RenderTransform" Value="translateX(0px)" />
</DataTriggerBehavior>
<!-- Поведение при закрытии меню -->
<DataTriggerBehavior
Binding="{Binding MenuOpened}"
ComparisonCondition="Equal"
Value="False"
>
<ChangePropertyAction PropertyName="RenderTransform" Value="translateX(-320px)" />
</DataTriggerBehavior>
</Interaction.Behaviors>
<!-- Содержимое меню -->
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <!-- Кнопка "Новая запись" -->
<RowDefinition Height="*"/> <!-- Элементы меню -->
</Grid.RowDefinitions>
<Grid.RowSpacing>10</Grid.RowSpacing>
<!-- Кнопка "Новая запись" -->
<Button
Command="{Binding CreateRecordCommand}"
Grid.Row="0"
HorizontalAlignment="Stretch"
MinWidth="200"
>
<TextBlock Text="Новая запись"/>
</Button>
<!-- Элементы меню -->
<ListBox
Background="{StaticResource MenuBackground}"
Grid.Row="1"
ItemsSource="{Binding MenuItems}"
SelectedIndex="{Binding MenuSelectedIndex}"
>
<!-- Шаблон списка элементов -->
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<!-- Стили элементов -->
<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>
<!-- Стиль элемента над которым находится указатель -->
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{StaticResource MainBackground}" />
</Style>
</ListBox.Styles>
<!-- Шаблон элемента -->
<ListBox.ItemTemplate>
<DataTemplate x:DataType="vm:SeparatorCalibrationViewModel+MenuItemViewModel">
<Border Margin="3" CornerRadius="5">
<TextBlock
Classes="mini"
HorizontalAlignment="Center"
VerticalAlignment="Center"
>
<Run Text="{Binding Id, StringFormat='[{0}] '}" />
<Run Text="{Binding Type}" />
</TextBlock>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Border>
</Grid>
</UserControl>