2026-06-05 13:44:39 +09:00

131 lines
8.4 KiB
XML

<UserControl x:Class="AuroraLaser.Views.PowerProfile"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AuroraLaser.Views"
xmlns:usercontrols="clr-namespace:AuroraUIComponent.UserControls;assembly=AuroraUIComponent"
xmlns:devui="clr-namespace:AuroraDevUI.PropertyGrid;assembly=AuroraDevUI"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" d:DataContext="{d:DesignInstance Type=local:PowerProfileViewModel}"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1200">
<UserControl.Resources>
<Style TargetType="{x:Type xctk:PropertyItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type xctk:PropertyItem}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="textBlock" Text="{Binding DisplayName}"
Background="#FF252525"
Foreground="White"
HorizontalAlignment="Center"
Margin="5"/>
<TextBox Grid.Column="1" Text="{Binding Value}"
Background="#FF333337"
BorderBrush="#55FFFFFF"
Foreground="White"
Width="200"
Margin="5"
HorizontalAlignment="Left"
/>
<Grid.Background>
<SolidColorBrush Color="{Binding ElementName=textBlock, Path=Background.Color}"/>
</Grid.Background>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type xctk:PropertyGrid}">
<Setter Property="Background" Value="#FF333337" />
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<GroupBox Grid.Row="0" Grid.Column="0" Header="Profiles" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" FontSize="18" Margin="5" Command="{Binding CMD_SaveProfiles}">Save Profiles</Button>
<Button Grid.Row="1" FontSize="18" Margin="5" Command="{Binding CMD_LoadProfiles}">Load Profiles</Button>
<Border Grid.Row="2" BorderBrush="Gray" BorderThickness="1" VerticalAlignment="Center" Margin="5">
<TextBlock FontSize="20" Foreground="White" TextAlignment="Center">Profile ID</TextBlock>
</Border>
<ComboBox Name="ProfileList" Grid.Row="3" Margin="5" FontSize="15" Foreground="Yellow" SelectionChanged="ProfileList_SelectionChanged"
ItemsSource="{Binding ProfileList}" SelectedIndex="{Binding ProfileListSelectedIndex}" SelectedItem="{Binding ProfileListSelectedItem}"></ComboBox>
<Button Grid.Row="4" FontSize="18" Margin="5" Command="{Binding CMD_AddProfiles}">Add Profiles</Button>
<Button Grid.Row="5" FontSize="18" Margin="5" Command="{Binding CMD_CopyProfiles}">Copy Profiles</Button>
<Button Grid.Row="6" FontSize="18" Margin="5" Command="{Binding CMD_DeleteProfiles}">Delete Profiles</Button>
</Grid>
</GroupBox>
<GroupBox Grid.Row="1" Grid.Column="0" Header="Profiles" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" FontSize="18" Margin="5" Command="{Binding CMD_LoadRecordProfiles}">Load Recrod Profile</Button>
<Border Grid.Row="1" BorderBrush="Gray" BorderThickness="1" VerticalAlignment="Center" Margin="5">
<TextBlock FontSize="20" Foreground="White" TextAlignment="Center">Region ID</TextBlock>
</Border>
<ComboBox Name="RegionIDList" Grid.Row="2" Margin="5" FontSize="15" Foreground="Yellow" SelectionChanged="RegionIDList_SelectionChanged"
ItemsSource="{Binding RegionIDList}" SelectedIndex="{Binding RegionIDListSelectedIndex}" SelectedItem="{Binding RegionIDListSelectedItem}"></ComboBox>
<usercontrols:UCKeyValue Grid.Row="3" Margin="3" KeyText="Record Period" Value="{Binding RecordPeriod}" DecimalPlaces="2" ShowKeypad="False"></usercontrols:UCKeyValue>
<usercontrols:UCKeyValue Grid.Row="4" Margin="3" KeyText="Threshold" Value="{Binding Threshold}" DecimalPlaces="2" ShowKeypad="False"></usercontrols:UCKeyValue>
<usercontrols:UCKeyValue Grid.Row="5" Margin="3" KeyText="Stabilized Value" Value="{Binding StabilizedValue}" DecimalPlaces="2" ShowKeypad="False"></usercontrols:UCKeyValue>
<Button Grid.Row="6" FontSize="18" Margin="5" Command="{Binding CMD_UploadRecord}">Upload Record</Button>
</Grid>
</GroupBox>
<Border Grid.Row="0" Grid.Column="1" Margin="5" BorderBrush="Gray" BorderThickness="1" Background="Black">
<lvc:CartesianChart Series="{Binding ChartPowerProfile}"></lvc:CartesianChart>
</Border>
<GroupBox Grid.Row="0" Grid.Column="2" Header="Parameter">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#55FFFFFF" BorderThickness="1" Margin="5">
<ListBox Name="ListboxProfileList" ItemsSource="{Binding ListboxProfileList}" SelectedIndex="{Binding ListboxProfileListSelectedIndex}" SelectedItem="{Binding ListboxProfileListSelectedItem}" SelectionChanged="ListBox_SelectionChanged"></ListBox>
</Border>
<Button Grid.Row="1" FontSize="18" Margin="5" Command="{Binding CMD_AddParameter}">Add Parameter</Button>
<Button Grid.Row="2" FontSize="18" Margin="5" Command="{Binding CMD_CopyParameter}">Copy Parameter</Button>
<Button Grid.Row="3" FontSize="18" Margin="5" Command="{Binding CMD_DeleteParameter}">Delete Parameter</Button>
</Grid>
</GroupBox>
<xctk:PropertyGrid Name="propertyGrid" Grid.Row="0" Grid.Column="3" Margin="5" SelectedObject="{Binding PowerProfileParamSelectedObject}" ></xctk:PropertyGrid>
<Border Grid.Row="1" Grid.Column="1" Margin="5" BorderBrush="#55FFFFFF" BorderThickness="1" Background="Black">
<lvc:CartesianChart Series="{Binding ChartRecord}"></lvc:CartesianChart>
</Border>
</Grid>
</UserControl>