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