Skip to content

Commit

Permalink
Hide compression option if bladebit version < 3 (#2196)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiaMineJP authored Oct 12, 2023
1 parent 4d242de commit dd40593
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gui/src/components/plot/add/PlotAddChooseSize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export default function PlotAddChooseSize(props: Props) {

const compressionAvailable =
op.haveBladebitCompressionLevel &&
(plotterName === PlotterName.BLADEBIT_CUDA || plotterName === PlotterName.BLADEBIT_RAM);
(plotterName === PlotterName.BLADEBIT_CUDA || plotterName === PlotterName.BLADEBIT_RAM) &&
plotter.version &&
+plotter.version.split('.')[0] >= 3;

const [allowedPlotSizes, setAllowedPlotSizes] = useState(
getPlotSizeOptions(plotterName, compressionLevel).filter((option) => plotter.options.kSizes.includes(option.value))
Expand Down
9 changes: 9 additions & 0 deletions packages/gui/src/components/plot/add/PlotAddForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ export default function PlotAddForm(props: Props) {
maxRam,
};

if (
(plotterName === PlotterName.BLADEBIT_RAM ||
plotterName === PlotterName.BLADEBIT_DISK ||
plotterName === PlotterName.BLADEBIT_CUDA) &&
+plotters[plotterName].version.split('.')[0] < 3 // Bladebit < 3.0.0 does not support plot compression
) {
defaults.bladebitCompressionLevel = undefined;
}

return defaults;
};

Expand Down

0 comments on commit dd40593

Please sign in to comment.