Files
UVtools/UVtools.WPF/Controls/Tools/ToolCalculatorControl.axaml
Tiago Conceição 6dc26f7434 v3.8.0
- **File formats:**
  - (Add) Property: DisplayTotalOnTime
  - (Add) Property: DisplayTotalOffTime
  - (Add) SL1File Property: high_viscosity_tilt_time
- **Tools**
  - **I printed this file**
    - (Add) Display on time for the print information
    - (Improvement) Labels on numeric box
    - (Improvement) Show print time label formatted as hh:mm:ss
  - **PCB Exposure:**
    - (Improvement) Increase "Exposure time" maximum from 200s to 1000s (#592)
    - (Fix) Set `BottomLightHeight` to 0
    - (Fix) Set `TransitionLayerCount` to 0
- **Issues:**
  - (Improvement) Overhang detection by using a dynamic cross kernel
  - (Improvement) Bring back the discard logic of "false-positive" islands based on overhang detection but improve the threshold of the detection to be safer (#591, #591)
- **PrusaSlicer:**
  - (Change) Elegoo Mars 2 to use file version 4
  - (Change) Elegoo Mars 2 Pro to use file version 4
- (Add) Status bar: On and Off time (hh:mm:ss) as tooltip in the Print time label
- (Improvement) When any of libcvextern dependencies are missing, it try to show the missing libraries in the error message (Linux only)
- (Improvement) Auto-upgrade procedure for non-Windows systems
- (Improvement) macOS arm64 (M1/M2) can now run natively if installed via the auto installer script
- (Fix) Error on Mat cache manager when file have only one layer
- (Fix) Suggestion "Transition layer count" shows as never applied when using with file formats that use in-firmware transition layers
- (Upgrade) openCV from 4.5.4 to 4.6.0
  - Custom library is now built to strip unused dependencies and reduce library size
- (Remove) arch and rhel packages in favor of a generic linux
2022-10-30 00:52:49 +01:00

476 lines
21 KiB
XML

<UserControl 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"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
MaxWidth="800"
x:Class="UVtools.WPF.Controls.Tools.ToolCalculatorControl">
<TabControl>
<TabItem Header="Millimeters to pixels">
<Grid RowDefinitions="Auto,10,Auto,30,Auto">
<Border
Background="{DynamicResource LightBackground}"
BorderBrush="Black" BorderThickness="1">
<TextBox VerticalAlignment="Center"
Classes="TransparentReadOnlyMultiLineNoBorder"
Padding="10">
<TextBox.Text>
<MultiBinding StringFormat="{}{0}&#x0a;&#x0a;Formula: {1}">
<Binding Path="Operation.CalcMillimetersToPixels.Description"/>
<Binding Path="Operation.CalcMillimetersToPixels.Formula"/>
</MultiBinding>
</TextBox.Text>
</TextBox>
</Border>
<Grid
Grid.Row="2"
RowDefinitions="Auto,10,Auto"
ColumnDefinitions="Auto,10,190,30,Auto,10,190">
<!-- Resolution -->
<TextBlock Grid.Row="0" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Resolution X:"/>
<NumericUpDown Grid.Row="0" Grid.Column="2"
Classes="ValueLabel ValueLabel_px"
VerticalAlignment="Center"
Minimum="0"
Maximum="100000"
Value="{Binding Operation.CalcMillimetersToPixels.ResolutionX}"/>
<TextBlock Grid.Row="2" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Resolution Y:"/>
<NumericUpDown Grid.Row="2" Grid.Column="2"
Classes="ValueLabel ValueLabel_px"
VerticalAlignment="Center"
Minimum="0"
Maximum="100000"
Value="{Binding Operation.CalcMillimetersToPixels.ResolutionY}"/>
<!-- Display -->
<TextBlock Grid.Row="0" Grid.Column="4"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Display width:"/>
<NumericUpDown Grid.Row="0" Grid.Column="6"
Classes="ValueLabel ValueLabel_mm"
VerticalAlignment="Center"
Minimum="0"
Maximum="100000"
Increment="0.01"
FormatString="F2"
Value="{Binding Operation.CalcMillimetersToPixels.DisplayWidth}"/>
<TextBlock Grid.Row="2" Grid.Column="4"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Display height:"/>
<NumericUpDown Grid.Row="2" Grid.Column="6"
Classes="ValueLabel ValueLabel_mm"
VerticalAlignment="Center"
Minimum="0"
Maximum="100000"
Increment="0.01"
FormatString="F2"
Value="{Binding Operation.CalcMillimetersToPixels.DisplayHeight}"/>
</Grid>
<Grid Grid.Row="4"
RowDefinitions="Auto,10,Auto,10,Auto,10,Auto,10,Auto"
ColumnDefinitions="Auto,10,190,5,Auto">
<TextBlock Grid.Row="0" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Input millimeters:"/>
<NumericUpDown Grid.Row="0" Grid.Column="2"
Classes="ValueLabel ValueLabel_mm"
VerticalAlignment="Center"
Minimum="0"
Maximum="100000"
Increment="0.5"
FormatString="F2"
Value="{Binding Operation.CalcMillimetersToPixels.Millimeters}"/>
<TextBlock Grid.Row="2" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="X pixels per millimeter:"/>
<TextBox Grid.Row="2" Grid.Column="2"
VerticalAlignment="Center"
IsReadOnly="True"
Text="{Binding Operation.CalcMillimetersToPixels.PixelsPerMillimeterX}"/>
<TextBlock Grid.Row="2" Grid.Column="4"
VerticalAlignment="Center"
Text="ppmmX"/>
<TextBlock Grid.Row="4" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Y pixels per millimeter:"/>
<TextBox Grid.Row="4" Grid.Column="2"
VerticalAlignment="Center"
IsReadOnly="True"
Text="{Binding Operation.CalcMillimetersToPixels.PixelsPerMillimeterY}"/>
<TextBlock Grid.Row="4" Grid.Column="4"
VerticalAlignment="Center"
Text="ppmmY"/>
<TextBlock Grid.Row="6" Grid.Column="0"
Classes="ValueLabel ValueLabel_px"
VerticalAlignment="Center"
FontWeight="Bold"
HorizontalAlignment="Right"
Text="X Pixels"/>
<NumericUpDown Grid.Row="6" Grid.Column="2"
Classes="ValueLabel ValueLabel_px ReadOnly"
VerticalAlignment="Center"
FontWeight="Bold"
Value="{Binding Operation.CalcMillimetersToPixels.PixelsX}"/>
<TextBlock Grid.Row="8" Grid.Column="0"
VerticalAlignment="Center"
FontWeight="Bold"
HorizontalAlignment="Right"
Text="Y Pixels"/>
<NumericUpDown Grid.Row="8" Grid.Column="2"
Classes="ValueLabel ValueLabel_px ReadOnly"
VerticalAlignment="Center"
FontWeight="Bold"
Value="{Binding Operation.CalcMillimetersToPixels.PixelsY}"/>
</Grid>
</Grid>
</TabItem>
<TabItem Header="Light-off delay" IsVisible="{Binding SlicerFile.CanUseAnyLightOffDelay}">
<Grid RowDefinitions="Auto,10,Auto">
<Border
Background="{DynamicResource LightBackground}"
BorderBrush="Black" BorderThickness="1">
<TextBox VerticalAlignment="Center"
Classes="TransparentReadOnlyMultiLineNoBorder"
Padding="10">
<TextBox.Text>
<MultiBinding StringFormat="{}{0}&#x0a;&#x0a;Formula: {1}">
<Binding Path="Operation.CalcLightOffDelay.Description"/>
<Binding Path="Operation.CalcLightOffDelay.Formula"/>
</MultiBinding>
</TextBox.Text>
</TextBox>
</Border>
<Grid Grid.Row="2"
RowDefinitions="Auto,10,Auto,10,Auto,10,Auto,10,Auto,10,Auto,10,Auto,10,Auto,10,Auto"
ColumnDefinitions="Auto,10,220,30,Auto,10,220">
<!-- Normal -->
<TextBlock Grid.Row="0" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Lift height:"/>
<NumericUpDown Grid.Row="0" Grid.Column="2"
Classes="ValueLabel ValueLabel_mm"
VerticalAlignment="Center"
Minimum="0"
Maximum="1000"
Increment="1.0"
FormatString="F2"
Value="{Binding Operation.CalcLightOffDelay.LiftHeight}"/>
<TextBlock Grid.Row="2" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Lift speed:"/>
<NumericUpDown Grid.Row="2" Grid.Column="2"
Classes="ValueLabel ValueLabel_mmmin"
VerticalAlignment="Center"
Minimum="0"
Maximum="1000"
Increment="1.0"
FormatString="F2"
Value="{Binding Operation.CalcLightOffDelay.LiftSpeed}"/>
<TextBlock Grid.Row="4" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Retract speed:"/>
<NumericUpDown Grid.Row="4" Grid.Column="2"
Classes="ValueLabel ValueLabel_mmmin"
VerticalAlignment="Center"
Minimum="0"
Maximum="1000"
Increment="1.0"
FormatString="F2"
Value="{Binding Operation.CalcLightOffDelay.RetractSpeed}"/>
<TextBlock Grid.Row="6" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Desired wait time:"/>
<NumericUpDown Grid.Row="6" Grid.Column="2"
Classes="ValueLabel ValueLabel_s"
VerticalAlignment="Center"
Minimum="0"
Maximum="1000"
Increment="0.5"
FormatString="F2"
Value="{Binding Operation.CalcLightOffDelay.WaitTime}"/>
<TextBlock Grid.Row="8" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
FontWeight="Bold"
Text="Light-off delay:"/>
<NumericUpDown Grid.Row="8" Grid.Column="2"
Classes="ValueLabel ValueLabel_s ReadOnly"
VerticalAlignment="Center"
FontWeight="Bold"
Text="{Binding Operation.CalcLightOffDelay.LightOffDelay}"/>
<Button Grid.Row="10" Grid.Column="0"
Grid.ColumnSpan="3"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Padding="10"
Content="Set this parameters on file"
Command="{Binding LightOffDelaySetParameters}"
CommandParameter="1"/>
<TextBlock Grid.Row="12" Grid.Column="0"
Grid.ColumnSpan="5"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="{Binding SlicerFile.LightOffDelay, StringFormat=Current value: {0}}"/>
<TextBlock Grid.Row="14" Grid.Column="0"
Grid.ColumnSpan="7"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="{Binding SlicerFile.PrintTimeHours, StringFormat=Old print time: {0}h}"/>
<TextBlock Grid.Row="16" Grid.Column="0"
Grid.ColumnSpan="7"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="{Binding LightOffDelayPrintTimeHours, StringFormat=New print time: {0}h}"/>
<!-- Bottom -->
<TextBlock Grid.Row="0" Grid.Column="4"
IsVisible="{Binding SlicerFile.CanUseBottomLightOffDelay}"
IsEnabled="{Binding SlicerFile.CanUseBottomLightOffDelay}"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Bottom lift height:"/>
<NumericUpDown Grid.Row="0" Grid.Column="6"
Classes="ValueLabel ValueLabel_mm"
IsVisible="{Binding SlicerFile.CanUseBottomLightOffDelay}"
IsEnabled="{Binding SlicerFile.CanUseBottomLightOffDelay}"
VerticalAlignment="Center"
Minimum="0"
Maximum="1000"
Increment="1.0"
FormatString="F2"
Value="{Binding Operation.CalcLightOffDelay.BottomLiftHeight}"/>
<TextBlock Grid.Row="2" Grid.Column="4"
IsVisible="{Binding SlicerFile.CanUseBottomLightOffDelay}"
IsEnabled="{Binding SlicerFile.CanUseBottomLightOffDelay}"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Bottom lift speed:"/>
<NumericUpDown Grid.Row="2" Grid.Column="6"
Classes="ValueLabel ValueLabel_mmmin"
IsVisible="{Binding SlicerFile.CanUseBottomLightOffDelay}"
IsEnabled="{Binding SlicerFile.CanUseBottomLightOffDelay}"
VerticalAlignment="Center"
Minimum="0"
Maximum="1000"
Increment="1.0"
FormatString="F2"
Value="{Binding Operation.CalcLightOffDelay.BottomLiftSpeed}"/>
<TextBlock Grid.Row="6" Grid.Column="4"
IsVisible="{Binding SlicerFile.CanUseBottomLightOffDelay}"
IsEnabled="{Binding SlicerFile.CanUseBottomLightOffDelay}"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Bottom desired wait time:"/>
<NumericUpDown Grid.Row="6" Grid.Column="6"
Classes="ValueLabel ValueLabel_s"
IsVisible="{Binding SlicerFile.CanUseBottomLightOffDelay}"
IsEnabled="{Binding SlicerFile.CanUseBottomLightOffDelay}"
VerticalAlignment="Center"
Minimum="0"
Maximum="1000"
Increment="0.5"
FormatString="F2"
Value="{Binding Operation.CalcLightOffDelay.BottomWaitTime}"/>
<TextBlock Grid.Row="8" Grid.Column="4"
IsVisible="{Binding SlicerFile.CanUseBottomLightOffDelay}"
IsEnabled="{Binding SlicerFile.CanUseBottomLightOffDelay}"
VerticalAlignment="Center"
HorizontalAlignment="Right"
FontWeight="Bold"
Text="Bottom light-off delay:"/>
<TextBox Grid.Row="8" Grid.Column="6"
Classes="ValueLabel ValueLabel_s"
IsVisible="{Binding SlicerFile.CanUseBottomLightOffDelay}"
IsEnabled="{Binding SlicerFile.CanUseBottomLightOffDelay}"
VerticalAlignment="Center"
IsReadOnly="true"
FontWeight="Bold"
Text="{Binding Operation.CalcLightOffDelay.BottomLightOffDelay}"/>
<Button Grid.Row="10" Grid.Column="4"
Grid.ColumnSpan="3"
IsVisible="{Binding SlicerFile.CanUseBottomLightOffDelay}"
IsEnabled="{Binding SlicerFile.CanUseBottomLightOffDelay}"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Padding="10"
Content="Set this parameters on file"
Command="{Binding LightOffDelaySetParameters}"
CommandParameter="0"/>
<TextBlock Grid.Row="12" Grid.Column="4"
Grid.ColumnSpan="3"
IsVisible="{Binding SlicerFile.CanUseBottomLightOffDelay}"
IsEnabled="{Binding SlicerFile.CanUseBottomLightOffDelay}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="{Binding SlicerFile.BottomLightOffDelay, StringFormat=Current value: {0}}"/>
</Grid>
</Grid>
</TabItem>
<TabItem Header="Optimal model tilt">
<Grid RowDefinitions="Auto,10,Auto,30,Auto">
<Border
Background="{DynamicResource LightBackground}"
BorderBrush="Black" BorderThickness="1">
<TextBox VerticalAlignment="Center" Classes="TransparentReadOnlyMultiLineNoBorder" Padding="10">
<TextBox.Text>
<MultiBinding StringFormat="{}{0}&#x0a;&#x0a;Formula: {1}">
<Binding Path="Operation.CalcOptimalModelTilt.Description"/>
<Binding Path="Operation.CalcOptimalModelTilt.Formula"/>
</MultiBinding>
</TextBox.Text>
</TextBox>
</Border>
<Grid Grid.Row="2"
RowDefinitions="Auto,10,Auto"
ColumnDefinitions="Auto,10,190,30,Auto,10,190">
<!-- Resolution -->
<TextBlock Grid.Row="0" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Resolution X:"/>
<NumericUpDown Grid.Row="0" Grid.Column="2"
Classes="ValueLabel ValueLabel_px"
VerticalAlignment="Center"
Minimum="0"
Maximum="100000"
Value="{Binding Operation.CalcOptimalModelTilt.ResolutionX}"/>
<TextBlock Grid.Row="2" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Resolution Y:"/>
<NumericUpDown Grid.Row="2" Grid.Column="2"
Classes="ValueLabel ValueLabel_px"
VerticalAlignment="Center"
Minimum="0"
Maximum="100000"
Value="{Binding Operation.CalcOptimalModelTilt.ResolutionY}"/>
<!-- Display -->
<TextBlock Grid.Row="0" Grid.Column="4"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Display width:"/>
<NumericUpDown Grid.Row="0" Grid.Column="6"
Classes="ValueLabel ValueLabel_mm"
VerticalAlignment="Center"
Minimum="0"
Maximum="100000"
Increment="0.01"
FormatString="F2"
Value="{Binding Operation.CalcOptimalModelTilt.DisplayWidth}"/>
<TextBlock Grid.Row="2" Grid.Column="4"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Display height:"/>
<NumericUpDown Grid.Row="2" Grid.Column="6"
Classes="ValueLabel ValueLabel_mm"
VerticalAlignment="Center"
Minimum="0"
Maximum="100000"
Increment="0.01"
FormatString="F2"
Value="{Binding Operation.CalcOptimalModelTilt.DisplayHeight}"/>
</Grid>
<Grid Grid.Row="4"
RowDefinitions="Auto,10,Auto,10,Auto"
ColumnDefinitions="Auto,10,190">
<TextBlock Grid.Row="0" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="Layer height:"/>
<NumericUpDown Grid.Row="0" Grid.Column="2"
Classes="ValueLabel ValueLabel_mm"
VerticalAlignment="Center"
Minimum="0.01"
Maximum="0.20"
Increment="0.01"
FormatString="F3"
Value="{Binding Operation.CalcOptimalModelTilt.LayerHeight}"/>
<TextBlock Grid.Row="2" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Text="XY resolution:"/>
<NumericUpDown Grid.Row="2" Grid.Column="2"
Classes="ValueLabel ValueLabel_um ReadOnly"
VerticalAlignment="Center"
Text="{Binding Operation.CalcOptimalModelTilt.XYResolutionUm}"/>
<TextBlock Grid.Row="4" Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
FontWeight="Bold"
Text="Optimal tilt angle:"/>
<NumericUpDown Grid.Row="4" Grid.Column="2"
Classes="ValueLabel ValueLabel_deg ReadOnly"
VerticalAlignment="Center"
FontWeight="Bold"
Text="{Binding Operation.CalcOptimalModelTilt.TiltAngleDegrees}"/>
</Grid>
</Grid>
</TabItem>
</TabControl>
</UserControl>