LINE_NUMBER update method does not work, since blender 2.70 the remaining time is better
This commit is contained in:
@@ -51,7 +51,6 @@ import com.sheepit.client.hardware.gpu.GPUDevice;
|
|||||||
import com.sheepit.client.os.OS;
|
import com.sheepit.client.os.OS;
|
||||||
|
|
||||||
public class Client {
|
public class Client {
|
||||||
public static final String UPDATE_METHOD_BY_LINE_NUMBER = "linenumber";
|
|
||||||
public static final String UPDATE_METHOD_BY_REMAINING_TIME = "remainingtime";
|
public static final String UPDATE_METHOD_BY_REMAINING_TIME = "remainingtime";
|
||||||
public static final String UPDATE_METHOD_BLENDER_INTERNAL_BY_PART = "blenderinternal";
|
public static final String UPDATE_METHOD_BLENDER_INTERNAL_BY_PART = "blenderinternal";
|
||||||
|
|
||||||
@@ -582,7 +581,6 @@ public class Client {
|
|||||||
|
|
||||||
long rending_start = new Date().getTime();
|
long rending_start = new Date().getTime();
|
||||||
|
|
||||||
int nb_lines = 0;
|
|
||||||
try {
|
try {
|
||||||
String line;
|
String line;
|
||||||
this.log.debug(command.toString());
|
this.log.debug(command.toString());
|
||||||
@@ -594,12 +592,11 @@ public class Client {
|
|||||||
this.log.debug("renderer output");
|
this.log.debug("renderer output");
|
||||||
try {
|
try {
|
||||||
while ((line = input.readLine()) != null) {
|
while ((line = input.readLine()) != null) {
|
||||||
nb_lines++;
|
|
||||||
this.updateRenderingMemoryPeak(line, ajob);
|
this.updateRenderingMemoryPeak(line, ajob);
|
||||||
|
|
||||||
this.log.debug(line);
|
this.log.debug(line);
|
||||||
if ((new Date().getTime() - last_update_status) > 2000) { // only call the update every two seconds
|
if ((new Date().getTime() - last_update_status) > 2000) { // only call the update every two seconds
|
||||||
this.updateRenderingStatus(line, nb_lines, ajob);
|
this.updateRenderingStatus(line, ajob);
|
||||||
last_update_status = new Date().getTime();
|
last_update_status = new Date().getTime();
|
||||||
}
|
}
|
||||||
Type error = this.detectError(line, ajob);
|
Type error = this.detectError(line, ajob);
|
||||||
@@ -636,7 +633,6 @@ public class Client {
|
|||||||
|
|
||||||
ajob.setRenderDuration((int) ((rending_end - rending_start) / 1000 + 1)); // render time is in seconds but the getTime is in milliseconds
|
ajob.setRenderDuration((int) ((rending_end - rending_start) / 1000 + 1)); // render time is in seconds but the getTime is in milliseconds
|
||||||
|
|
||||||
ajob.setMaxOutputNbLines(nb_lines);
|
|
||||||
int exit_value = 0;
|
int exit_value = 0;
|
||||||
try {
|
try {
|
||||||
exit_value = ajob.getProcess().exitValue();
|
exit_value = ajob.getProcess().exitValue();
|
||||||
@@ -878,11 +874,8 @@ public class Client {
|
|||||||
return (concurrent_job >= this.config.maxUploadingJob());
|
return (concurrent_job >= this.config.maxUploadingJob());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateRenderingStatus(String line, int current_number_of_lines, Job ajob) {
|
protected void updateRenderingStatus(String line, Job ajob) {
|
||||||
if (ajob.getUpdateRenderingStatusMethod() != null && ajob.getUpdateRenderingStatusMethod().equals(Client.UPDATE_METHOD_BY_LINE_NUMBER) && ajob.getMaxOutputNbLines() > 0) {
|
if (ajob.getUpdateRenderingStatusMethod() != null && ajob.getUpdateRenderingStatusMethod().equals(Client.UPDATE_METHOD_BLENDER_INTERNAL_BY_PART)) {
|
||||||
this.gui.status(String.format("Rendering %s %%", (int) (100.0 * current_number_of_lines / ajob.getMaxOutputNbLines())));
|
|
||||||
}
|
|
||||||
else if (ajob.getUpdateRenderingStatusMethod() != null && ajob.getUpdateRenderingStatusMethod().equals(Client.UPDATE_METHOD_BLENDER_INTERNAL_BY_PART)) {
|
|
||||||
String search = " Part ";
|
String search = " Part ";
|
||||||
int index = line.lastIndexOf(search);
|
int index = line.lastIndexOf(search);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ public class Job {
|
|||||||
private long memoryUsed; // in kB
|
private long memoryUsed; // in kB
|
||||||
private String rendererCommand;
|
private String rendererCommand;
|
||||||
private String script;
|
private String script;
|
||||||
private int maxOutputNbLines;
|
|
||||||
private boolean useGPU;
|
private boolean useGPU;
|
||||||
private String extras;
|
private String extras;
|
||||||
private String updateRenderingStatusMethod;
|
private String updateRenderingStatusMethod;
|
||||||
@@ -63,7 +62,6 @@ public class Job {
|
|||||||
renderDuration = 0;
|
renderDuration = 0;
|
||||||
memoryUsed = 0;
|
memoryUsed = 0;
|
||||||
script = script_;
|
script = script_;
|
||||||
maxOutputNbLines = 0;
|
|
||||||
updateRenderingStatusMethod = update_method_;
|
updateRenderingStatusMethod = update_method_;
|
||||||
process = null;
|
process = null;
|
||||||
askForRendererKill = false;
|
askForRendererKill = false;
|
||||||
@@ -106,10 +104,6 @@ public class Job {
|
|||||||
return updateRenderingStatusMethod;
|
return updateRenderingStatusMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxOutputNbLines() {
|
|
||||||
return maxOutputNbLines;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAskForRendererKill(boolean val) {
|
public void setAskForRendererKill(boolean val) {
|
||||||
askForRendererKill = val;
|
askForRendererKill = val;
|
||||||
}
|
}
|
||||||
@@ -142,10 +136,6 @@ public class Job {
|
|||||||
renderDuration = val;
|
renderDuration = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMaxOutputNbLines(int val) {
|
|
||||||
maxOutputNbLines = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRenderCommand() {
|
public String getRenderCommand() {
|
||||||
return rendererCommand;
|
return rendererCommand;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user