Skip to content

Commit

Permalink
Merge pull request #142 from MrPig91/AutoPlotCheck
Browse files Browse the repository at this point in the history
Auto plot check
  • Loading branch information
MrPig91 authored Jul 2, 2021
2 parents 12bdb17 + a67bb8b commit c26e354
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
14 changes: 14 additions & 0 deletions PSChiaPlotter/Classes/ChiaClasses.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ namespace PSChiaPlotter
public int Threads { get; set; }
public int Buckets { get; set; }
public ChiaVolume TempVolume { get; set; }
public bool AutoPlotCheckEnabled { get; set; }
public ChiaVolume SecondTempVolume
{
get { return _secondtempvolume; }
Expand Down Expand Up @@ -127,6 +128,7 @@ namespace PSChiaPlotter
ReplotEnabled = chiaParameters.ReplotEnabled;
AlternativePlotterEnabled = chiaParameters.AlternativePlotterEnabled;
AlternativePlotterPath = chiaParameters.AlternativePlotterPath;
AutoPlotCheckEnabled = chiaParameters.AutoPlotCheckEnabled;
}
public event PropertyChangedEventHandler PropertyChanged;
Expand Down Expand Up @@ -638,6 +640,7 @@ namespace PSChiaPlotter
private int _exitcode;
private DateTime _exittime;
private double _currentphaseprogress;
private double _plotcheckratio;
public int JobNumber { get; set; }
public int QueueNumber { get; set; }
Expand Down Expand Up @@ -678,6 +681,17 @@ namespace PSChiaPlotter
public string LogPath { get; set; }
public int ProcessID { get; set; }
public ChiaParameters PlottingParameters { get; set; }
public double PlotCheckRatio
{
get { return _plotcheckratio; }
set
{
_plotcheckratio = value;
OnPropertyChanged();
}
}
public string CheckPlotPowershellCommand { get; set; }
Expand Down
6 changes: 6 additions & 0 deletions PSChiaPlotter/Private/Start-GUIChiaPlotting.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ function Start-GUIChiaPlotting {
$DataHash.MainViewModel.CompletedRuns.Add($ChiaRun)
$ChiaRun.CheckPlotPowershellCommand = "&'$ChiaPath' plots check -g $plotid"
Update-ChiaGUISummary -Success
if ($ChiaRun.PlottingParameters.AutoPlotCheckEnabled){
$PlotCheckResults = Test-ChiaPlot -Path $plotid -ErrorAction Continue
if ($Null -ne $PlotCheckResults){
$ChiaRun.PlotCheckRatio = [math]::Round($PlotCheckResults.Ratio,2)
}
} #if autoplotcheck
}
$ChiaQueue.CurrentRun = $null
$DataHash.MainViewModel.CurrentRuns.Remove($ChiaRun)
Expand Down
1 change: 1 addition & 0 deletions PSChiaPlotter/WPFWindows/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="Ratio" Binding="{Binding Path=PlotCheckRatio}" />
<DataGridTextColumn Header="Pool Plot" Binding="{Binding Path=PlottingParameters.PoolContractEnabled}" />
<DataGridTextColumn Header="Replot" Binding="{Binding Path=PlottingParameters.ReplotEnabled}" />
</DataGrid.Columns>
Expand Down
12 changes: 8 additions & 4 deletions PSChiaPlotter/WPFWindows/NewJobWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,19 @@
<TextBox x:Name="Buckets_TextBox" Grid.Row="2" Grid.Column="4" Text="{Binding Path=NewChiaJob.InitialChiaParameters.Buckets}" />
<Separator Grid.Column="1" Grid.ColumnSpan="4" Grid.Row="3" Height="1" VerticalAlignment="Center" Margin="5"/>
<UniformGrid Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="4" Rows="1">
<CheckBox Content="Auto Check Plots"
IsThreeState="False"
IsChecked="{Binding Path=NewChiaJob.InitialChiaParameters.AutoPlotCheckEnabled}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
<CheckBox Content="Disable Bitfield"
Grid.Row="3" Grid.Column="3" Grid.ColumnSpan="2" HorizontalAlignment="Center"
HorizontalAlignment="Center"
IsChecked="{Binding Path=NewChiaJob.InitialChiaParameters.DisableBitField}" IsThreeState="False"
VerticalAlignment="Center" FontSize="11"/>
VerticalAlignment="Center"/>
<CheckBox Content="Exclude Final Directory"
Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Center"
HorizontalAlignment="Center"
IsChecked="{Binding Path=NewChiaJob.InitialChiaParameters.ExcludeFinalDirectory}"
Margin="5,0,0,0" IsThreeState="False"
VerticalAlignment="Center" FontSize="11"/>
VerticalAlignment="Center"/>
</UniformGrid>

</Grid>
Expand Down

0 comments on commit c26e354

Please sign in to comment.