mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-12 19:42:32 +02:00
4ec98cfab1
* (Add) Help - Material manager (F10): Allow to manage material stock and costs with statistic over time * (Add) File - I printed this file (CTRL + P): Allow to select a material and consume resin from stock and print time from the loaded file
255 lines
12 KiB
XML
255 lines
12 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 IsExpanded="True">
|
|
<Expander.Header>
|
|
<TextBlock Text="Global statistics"
|
|
FontWeight="Bold"
|
|
Cursor="Hand"/>
|
|
</Expander.Header>
|
|
|
|
<StackPanel>
|
|
<!--<Button VerticalAlignment="Center"
|
|
Command="{Binding RefreshStatistics}">
|
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
|
<Image Source="/Assets/Icons/refresh-16x16.png"/>
|
|
<TextBlock Text="Refresh statistics"/>
|
|
</StackPanel>
|
|
</Button>
|
|
!-->
|
|
|
|
<WrapPanel Orientation="Horizontal">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="Bottles in stock:" VerticalAlignment="Center" FontWeight="Bold"/>
|
|
<TextBox Classes="TransparentReadOnly"
|
|
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="TransparentReadOnly"
|
|
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="TransparentReadOnly"
|
|
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="TransparentReadOnly"
|
|
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="TransparentReadOnly"
|
|
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="TransparentReadOnly"
|
|
Text="{Binding Manager.PrintTimeSpan.TotalDays, StringFormat=\{0:N4\}}"/>
|
|
<TextBlock Text="days" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</WrapPanel>
|
|
|
|
</StackPanel>
|
|
|
|
</Expander>
|
|
</Border>
|
|
|
|
|
|
<Border Grid.Row="1" BorderBrush="Black" BorderThickness="1" Padding="5">
|
|
<Expander IsExpanded="False">
|
|
<Expander.Header>
|
|
<TextBlock Text="Add new material"
|
|
FontWeight="Bold"
|
|
Cursor="Hand"/>
|
|
</Expander.Header>
|
|
|
|
<Grid
|
|
RowDefinitions="Auto,10,Auto,10,Auto,10,Auto"
|
|
ColumnDefinitions="Auto,10,150,5,Auto,20,Auto,10,Auto,5,Auto,20,Auto,10,150,5,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="17"
|
|
HorizontalAlignment="Stretch"
|
|
Watermark="A descriptive material name, eg: Epax Hard Grey"
|
|
Text="{Binding Material.Name}"/>
|
|
|
|
<Button
|
|
Grid.Row="0" Grid.Column="20" Grid.ColumnSpan="3"
|
|
VerticalContentAlignment="Center"
|
|
HorizontalContentAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
Command="{Binding AddNewMaterial}">
|
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
|
<Image Source="/Assets/Icons/plus-16x16.png"/>
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
Text="Add new material"/>
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="0"
|
|
VerticalAlignment="Center"
|
|
ToolTip.Tip="Bottle material volume"
|
|
Text="Volume:"/>
|
|
|
|
<NumericUpDown Grid.Row="2" Grid.Column="2"
|
|
Minimum="100"
|
|
Maximum="100000"
|
|
Increment="100"
|
|
Value="{Binding Material.BottleVolume}"
|
|
/>
|
|
<TextBlock Grid.Row="2" Grid.Column="4"
|
|
VerticalAlignment="Center"
|
|
Text="ml"/>
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="6"
|
|
VerticalAlignment="Center"
|
|
ToolTip.Tip="Used to calculate weight and cost"
|
|
Text="Density:"/>
|
|
|
|
<NumericUpDown Grid.Row="2" Grid.Column="8"
|
|
Minimum="0.1"
|
|
Maximum="10"
|
|
Increment="0.1"
|
|
Value="{Binding Material.Density}"/>
|
|
<TextBlock Grid.Row="2" Grid.Column="10"
|
|
VerticalAlignment="Center"
|
|
Text="g/ml"/>
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="12"
|
|
VerticalAlignment="Center"
|
|
ToolTip.Tip="One bottle unit cost"
|
|
Text="Cost:"/>
|
|
|
|
<NumericUpDown Grid.Row="2" Grid.Column="14"
|
|
Minimum="1"
|
|
Maximum="100000"
|
|
Increment="1"
|
|
Value="{Binding Material.BottleCost}"/>
|
|
<TextBlock Grid.Row="2" Grid.Column="16"
|
|
VerticalAlignment="Center"
|
|
Text=""/>
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="18"
|
|
VerticalAlignment="Center"
|
|
ToolTip.Tip="Number of bottles in stock"
|
|
Text="Stock:"/>
|
|
|
|
<NumericUpDown Grid.Row="2" Grid.Column="20"
|
|
Minimum="1"
|
|
Maximum="100000"
|
|
Increment="1"
|
|
Value="{Binding Material.BottlesInStock}"/>
|
|
<TextBlock Grid.Row="2" Grid.Column="22"
|
|
VerticalAlignment="Center"
|
|
Text="units"/>
|
|
</Grid>
|
|
</Expander>
|
|
</Border>
|
|
|
|
<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">
|
|
|
|
<Button VerticalAlignment="Center"
|
|
IsEnabled="{Binding #MaterialsTable.SelectedItem, Converter={x:Static ObjectConverters.IsNotNull}}"
|
|
Command="{Binding RemoveSelectedMaterials}">
|
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
|
<Image Source="/Assets/Icons/trash-16x16.png"/>
|
|
<TextBlock Text="Remove selected materials"/>
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
<Button VerticalAlignment="Center"
|
|
IsEnabled="{Binding Manager.Count}"
|
|
Command="{Binding ClearMaterials}">
|
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
|
<Image Source="/Assets/Icons/delete-16x16.png"/>
|
|
<TextBlock Text="{Binding Manager.Count, StringFormat=Clear {0} materials}"/>
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
</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>
|