mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-12 03:22:32 +02:00
e550fdc266
- (Add) Debug sub menu to test some behaviours (Only when compiled in debug mode, not visible on public release) - (Add) Utility method `LayerExists` to the file formats to know if specific layer index exists in the collection - (Improvement) Add loaded file information to the crash dialog message - (Fix) Message dialog height do not expand with text (#537) - (Fix) Crash when all layers get removed and UI attempt to show a layer (#538)
218 lines
10 KiB
XML
218 lines
10 KiB
XML
<controls:WindowEx xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:controls="clr-namespace:UVtools.WPF.Controls"
|
|
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="450"
|
|
x:Class="UVtools.WPF.Windows.MaterialManagerWindow"
|
|
Title="Material manager"
|
|
MinWidth="900"
|
|
MinHeight="600"
|
|
WindowStartupLocation="CenterOwner"
|
|
Icon="/Assets/Icons/UVtools.ico">
|
|
|
|
<Grid RowDefinitions="Auto,Auto,Auto,*">
|
|
<Border Grid.Row="0" Padding="5">
|
|
<Expander
|
|
Header="Global statistics"
|
|
IsExpanded="True">
|
|
|
|
<StackPanel>
|
|
<WrapPanel Orientation="Horizontal">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="Bottles in stock:" VerticalAlignment="Center" FontWeight="Bold"/>
|
|
<TextBox Classes="TransparentReadOnlyMultiLineNoBorder"
|
|
Text="{Binding Manager.BottlesInStock, StringFormat=\{0:N0\}}"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
|
<TextBlock Text="Owned bottles:" VerticalAlignment="Center" FontWeight="Bold"/>
|
|
<TextBox Classes="TransparentReadOnlyMultiLineNoBorder"
|
|
Text="{Binding Manager.OwnedBottles, StringFormat=\{0:N0\}}"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
|
<TextBlock Text="Consumed volume:" VerticalAlignment="Center" FontWeight="Bold"/>
|
|
<TextBox Classes="TransparentReadOnlyMultiLineNoBorder"
|
|
Text="{Binding Manager.ConsumedVolumeLiters, StringFormat=\{0:N4\}}"/>
|
|
<TextBlock Text="liters" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
|
<TextBlock Text="Volume in stock:" VerticalAlignment="Center" FontWeight="Bold"/>
|
|
<TextBox Classes="TransparentReadOnlyMultiLineNoBorder"
|
|
Text="{Binding Manager.VolumeInStockLiters, StringFormat=\{0:N4\}}"/>
|
|
<TextBlock Text="liters" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
|
<TextBlock Text="Spent:" VerticalAlignment="Center" FontWeight="Bold"/>
|
|
<TextBox Classes="TransparentReadOnlyMultiLineNoBorder"
|
|
Text="{Binding Manager.TotalCost, StringFormat=\{0:N2\}}"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
|
<TextBlock Text="Print time:" VerticalAlignment="Center" FontWeight="Bold"/>
|
|
<TextBox Classes="TransparentReadOnlyMultiLineNoBorder"
|
|
Text="{Binding Manager.PrintTimeSpan.TotalDays, StringFormat=\{0:N4\}}"/>
|
|
<TextBlock Text="days" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</WrapPanel>
|
|
|
|
</StackPanel>
|
|
|
|
</Expander>
|
|
</Border>
|
|
|
|
|
|
<Expander Grid.Row="1"
|
|
Header="Add new material"
|
|
IsExpanded="True">
|
|
|
|
<Grid
|
|
RowDefinitions="Auto,10,Auto,10,Auto,10,Auto"
|
|
ColumnDefinitions="Auto,10,Auto,20,Auto,10,Auto,20,Auto,10,Auto,20,Auto,10,Auto,5,Auto">
|
|
|
|
<TextBlock Grid.Row="0" Grid.Column="0"
|
|
VerticalAlignment="Center"
|
|
Text="Name:"/>
|
|
|
|
<TextBox Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="11"
|
|
HorizontalAlignment="Stretch"
|
|
Watermark="A descriptive material name, eg: Epax Hard Grey"
|
|
Text="{Binding Material.Name}"/>
|
|
|
|
<controls:ButtonWithIcon
|
|
Grid.Row="0" Grid.Column="14" Grid.ColumnSpan="3"
|
|
VerticalContentAlignment="Center"
|
|
HorizontalContentAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
Icon="fa-solid fa-plus"
|
|
Text="Add new material"
|
|
Command="{Binding AddNewMaterial}"/>
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="0"
|
|
VerticalAlignment="Center"
|
|
ToolTip.Tip="Bottle material volume"
|
|
Text="Volume:"/>
|
|
|
|
<NumericUpDown Grid.Row="2" Grid.Column="2"
|
|
Classes="ValueLabel ValueLabel_ml"
|
|
Minimum="100"
|
|
Maximum="100000"
|
|
Increment="100"
|
|
Value="{Binding Material.BottleVolume}"/>
|
|
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="4"
|
|
VerticalAlignment="Center"
|
|
ToolTip.Tip="Used to calculate weight and cost"
|
|
Text="Density:"/>
|
|
|
|
<NumericUpDown Grid.Row="2" Grid.Column="6"
|
|
Classes="ValueLabel ValueLabel_gml"
|
|
Minimum="0.1"
|
|
Maximum="10"
|
|
Increment="0.1"
|
|
Value="{Binding Material.Density}"/>
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="8"
|
|
VerticalAlignment="Center"
|
|
ToolTip.Tip="One bottle unit cost"
|
|
Text="Cost:"/>
|
|
|
|
<NumericUpDown Grid.Row="2" Grid.Column="10"
|
|
Minimum="1"
|
|
Maximum="100000"
|
|
Increment="1"
|
|
Value="{Binding Material.BottleCost}"/>
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="12"
|
|
VerticalAlignment="Center"
|
|
ToolTip.Tip="Number of bottles in stock"
|
|
Text="Stock:"/>
|
|
|
|
<NumericUpDown Grid.Row="2" Grid.Column="14"
|
|
Minimum="1"
|
|
Maximum="100000"
|
|
Increment="1"
|
|
Value="{Binding Material.BottlesInStock}"/>
|
|
<TextBlock Grid.Row="2" Grid.Column="16"
|
|
VerticalAlignment="Center"
|
|
Text="units"/>
|
|
</Grid>
|
|
</Expander>
|
|
|
|
<TextBlock Grid.Row="2"
|
|
VerticalAlignment="Center" FontWeight="Bold"
|
|
Margin="10,0,0,0"
|
|
Text="{Binding Manager.Count, StringFormat=Materials: {0}}"/>
|
|
|
|
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Spacing="1">
|
|
|
|
<controls:ButtonWithIcon VerticalAlignment="Center"
|
|
IsEnabled="{Binding #MaterialsTable.SelectedItem, Converter={x:Static ObjectConverters.IsNotNull}}"
|
|
Icon="fa-solid fa-trash-alt"
|
|
Text="Remove selected materials"
|
|
Command="{Binding RemoveSelectedMaterials}"/>
|
|
|
|
<controls:ButtonWithIcon VerticalAlignment="Center"
|
|
IsEnabled="{Binding Manager.Count}"
|
|
Icon="fa-solid fa-xmark"
|
|
Text="{Binding Manager.Count, StringFormat=Clear {0} materials}"
|
|
Command="{Binding ClearMaterials}"/>
|
|
|
|
</StackPanel>
|
|
|
|
<DataGrid Grid.Row="3"
|
|
Name="MaterialsTable"
|
|
CanUserReorderColumns="True"
|
|
CanUserResizeColumns="True"
|
|
CanUserSortColumns="True"
|
|
GridLinesVisibility="Horizontal"
|
|
ClipboardCopyMode="IncludeHeader"
|
|
VerticalAlignment="Stretch"
|
|
Items="{Binding Manager.Materials}">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Header="Name"
|
|
Binding="{Binding Name}"
|
|
Width="Auto" />
|
|
<DataGridTextColumn Header="Volume (ml)"
|
|
Binding="{Binding BottleVolume}"
|
|
Width="Auto" />
|
|
<!--
|
|
<DataGridTextColumn Header="Density (g/ml)"
|
|
Binding="{Binding Density}"
|
|
Width="Auto" />!-->
|
|
<DataGridTextColumn Header="Cost"
|
|
Binding="{Binding BottleCost}"
|
|
Width="Auto" />
|
|
<DataGridTextColumn Header="In stock"
|
|
Binding="{Binding BottlesInStock}"
|
|
Width="Auto" />
|
|
<DataGridTextColumn Header="Consumed bottles"
|
|
IsReadOnly="True"
|
|
Binding="{Binding ConsumedBottles, StringFormat=\{0:N0\}}"
|
|
Width="Auto" />
|
|
<DataGridTextColumn Header="Spent"
|
|
IsReadOnly="True"
|
|
Binding="{Binding TotalCost, StringFormat=\{0:N2\}}"
|
|
Width="Auto" />
|
|
<DataGridTextColumn Header="Remaining volume (ml)"
|
|
Binding="{Binding BottleRemainingVolume}"
|
|
Width="Auto" />
|
|
<DataGridTextColumn Header="Consumed volume (l)"
|
|
IsReadOnly="True"
|
|
Binding="{Binding ConsumedVolumeLiters, StringFormat=\{0:N3\}}"
|
|
Width="Auto" />
|
|
<DataGridTextColumn Header="Print time (days)"
|
|
IsReadOnly="True"
|
|
Binding="{Binding PrintTimeSpan.TotalDays, StringFormat=\{0:N4\}}"
|
|
Width="Auto" />
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
|
</Grid>
|
|
|
|
</controls:WindowEx>
|