только админу дается возможность использовать больше 14 ядер

This commit is contained in:
2023-11-14 22:37:33 +03:00
parent c1c56621c2
commit 3a175e0767
3 changed files with 12 additions and 9 deletions

View File

@@ -26,7 +26,8 @@ public class TestingBar extends VisualiserMenuBar {
add(sKernels = new JSpinner());
sKernels.setPreferredSize(new Dimension(60, 26));
sKernels.setMaximumSize(new Dimension(60, 26));
sKernels.setModel(new SpinnerNumberModel(Global.properties.TestingKernels, 1, 64, 1));
sKernels.setModel(new SpinnerNumberModel(Global.properties.TestingKernels, 1,
Utils.getTestingMaxKernels(), 1));
sKernels.setValue(Global.properties.TestingKernels);
UI.MakeSpinnerRapid(sKernels, e -> {
Global.properties.updateField("TestingKernels", sKernels.getValue());

View File

@@ -1,5 +1,6 @@
package Common.Utils;
import Common.Constants;
import Common.Current;
import Common.Global;
import Common.UI.UI;
import ProjectData.Files.DBProjectFile;
@@ -1039,5 +1040,11 @@ public class Utils {
}
return false;
}
public static int getTestingMaxKernels() {
if (Current.HasAccount()) {
return (Current.getAccount().isAdmin()) ? 64 : 14;
}
return 1;
}
}