Merge branch 'Conf-setPriority' into 'master'
Rename setUsePriority to setPriority See merge request sheepitrenderfarm/client!260
This commit is contained in:
@@ -159,14 +159,13 @@ import lombok.Data;
|
||||
* @param priority integer that will be clamped between 19 and -19,
|
||||
* lowest to highest in terms of priority
|
||||
*/
|
||||
public void setUsePriority(int priority) {
|
||||
public void setPriority(int priority) {
|
||||
if (priority > 19)
|
||||
priority = 19;
|
||||
if (priority < -19)
|
||||
else if (priority < -19)
|
||||
priority = -19;
|
||||
|
||||
this.priority = priority;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,8 +39,6 @@ import com.sheepit.client.hardware.gpu.GPUDevice;
|
||||
import com.sheepit.client.standalone.GuiText;
|
||||
import com.sheepit.client.standalone.GuiTextOneLine;
|
||||
import com.sheepit.client.os.OS;
|
||||
import com.sheepit.client.os.Linux;
|
||||
import com.sheepit.client.os.Mac;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@@ -453,7 +451,7 @@ public class SettingsLoader {
|
||||
}
|
||||
|
||||
if (config.getPriority() == 19) { // 19 is default value
|
||||
config.setUsePriority(priority.getValue());
|
||||
config.setPriority(priority.getValue());
|
||||
}
|
||||
try {
|
||||
if (config.getComputeMethod() == null && computeMethod == null) {
|
||||
|
||||
@@ -136,7 +136,7 @@ public class Worker {
|
||||
ComputeType compute_method = null;
|
||||
Configuration config = new Configuration(null, login, password);
|
||||
config.setPrintLog(print_log);
|
||||
config.setUsePriority(priority);
|
||||
config.setPriority(priority);
|
||||
config.setDetectGPUs(!no_gpu_detection);
|
||||
|
||||
if (sharedDownloadsDir != null) {
|
||||
|
||||
@@ -748,10 +748,10 @@ public class Settings implements Activity {
|
||||
boolean high_priority_support = os.getSupportHighPriority();
|
||||
if (high_priority_support) {
|
||||
// inverse
|
||||
config.setUsePriority(-1 * priority.getValue());
|
||||
config.setPriority(-1 * priority.getValue());
|
||||
}
|
||||
else {
|
||||
config.setUsePriority(19 - priority.getValue());
|
||||
config.setPriority(19 - priority.getValue());
|
||||
}
|
||||
|
||||
config.setHeadless(headlessCheckbox.isSelected());
|
||||
|
||||
@@ -80,7 +80,7 @@ public class CLIInputActionHandler implements CLIInputListener {
|
||||
Configuration config = client.getConfiguration();
|
||||
if (config != null) {
|
||||
try {
|
||||
config.setUsePriority(Integer.parseInt(newPriority.trim()));
|
||||
config.setPriority(Integer.parseInt(newPriority.trim()));
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
System.out.println("Invalid priority: " + newPriority);
|
||||
|
||||
Reference in New Issue
Block a user