Improvement: do not hardcode the id of compute-method and power-detection project instead use an attribute from the job
This commit is contained in:
@@ -39,13 +39,14 @@ public class Job {
|
|||||||
private boolean useGPU;
|
private boolean useGPU;
|
||||||
private String extras;
|
private String extras;
|
||||||
private String updateRenderingStatusMethod;
|
private String updateRenderingStatusMethod;
|
||||||
|
private boolean synchronousUpload;
|
||||||
|
|
||||||
private Process process;
|
private Process process;
|
||||||
private boolean askForRendererKill;
|
private boolean askForRendererKill;
|
||||||
|
|
||||||
private Configuration config;
|
private Configuration config;
|
||||||
|
|
||||||
public Job(Configuration config_, String id_, String frame_, String revision_, String path_, boolean use_gpu, String command_, String script_, String sceneMd5_, String rendererMd5_, String extras_) {
|
public Job(Configuration config_, String id_, String frame_, String revision_, String path_, boolean use_gpu, String command_, String script_, String sceneMd5_, String rendererMd5_, String extras_, boolean synchronous_upload_) {
|
||||||
config = config_;
|
config = config_;
|
||||||
id = id_;
|
id = id_;
|
||||||
numFrame = frame_;
|
numFrame = frame_;
|
||||||
@@ -56,6 +57,7 @@ public class Job {
|
|||||||
sceneMD5 = sceneMd5_;
|
sceneMD5 = sceneMd5_;
|
||||||
rendererMD5 = rendererMd5_;
|
rendererMD5 = rendererMd5_;
|
||||||
extras = extras_;
|
extras = extras_;
|
||||||
|
synchronousUpload = synchronous_upload_;
|
||||||
|
|
||||||
pictureFilename = null;
|
pictureFilename = null;
|
||||||
renderDuration = 0;
|
renderDuration = 0;
|
||||||
@@ -197,9 +199,6 @@ public class Job {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean simultaneousUploadIsAllowed() {
|
public boolean simultaneousUploadIsAllowed() {
|
||||||
// id 0 is power project
|
return synchronousUpload;
|
||||||
// id 1 is compute method project
|
|
||||||
// they are made to check is the computer can do render
|
|
||||||
return id.equals("0") == false && id.equals("1") == false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -375,6 +375,10 @@ public class Server extends Thread implements HostnameVerifier, X509TrustManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean use_gpu = (job_node.getAttribute("use_gpu").compareTo("1") == 0);
|
boolean use_gpu = (job_node.getAttribute("use_gpu").compareTo("1") == 0);
|
||||||
|
boolean synchronous_upload = true;
|
||||||
|
if (job_node.hasAttribute("synchronous_upload")) {
|
||||||
|
synchronous_upload = (job_node.getAttribute("synchronous_upload").compareTo("1") == 0);
|
||||||
|
}
|
||||||
|
|
||||||
String frame_extras = "";
|
String frame_extras = "";
|
||||||
if (job_node.hasAttribute("extras")) {
|
if (job_node.hasAttribute("extras")) {
|
||||||
@@ -392,7 +396,8 @@ public class Server extends Thread implements HostnameVerifier, X509TrustManager
|
|||||||
script,
|
script,
|
||||||
job_node.getAttribute("archive_md5"),
|
job_node.getAttribute("archive_md5"),
|
||||||
renderer_node.getAttribute("md5"),
|
renderer_node.getAttribute("md5"),
|
||||||
frame_extras
|
frame_extras,
|
||||||
|
synchronous_upload
|
||||||
);
|
);
|
||||||
|
|
||||||
this.client.getGui().framesRemaining(remaining_frames);
|
this.client.getGui().framesRemaining(remaining_frames);
|
||||||
|
|||||||
Reference in New Issue
Block a user