Code formating
This commit is contained in:
@@ -424,12 +424,12 @@ public class Client {
|
||||
this.log.debug("Client::askForStop");
|
||||
this.running = false;
|
||||
}
|
||||
|
||||
|
||||
public void cancelStop() {
|
||||
this.log.debug("Client::cancelStop");
|
||||
this.running = true;
|
||||
}
|
||||
|
||||
|
||||
public boolean isRunning() {
|
||||
return this.running;
|
||||
}
|
||||
@@ -703,7 +703,7 @@ public class Client {
|
||||
File f = new File(ajob.getRendererPath());
|
||||
f.setExecutable(true);
|
||||
}
|
||||
catch (SecurityException e) {
|
||||
catch (SecurityException e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ public class Configuration {
|
||||
public String getProxy() {
|
||||
return this.proxy;
|
||||
}
|
||||
|
||||
|
||||
public void setProxy(String url) {
|
||||
this.proxy = url;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ public class Error {
|
||||
case RENDERER_MISSING_LIBRARIES:
|
||||
return "Failed to launch renderer. Please check if you have necessary libraries installed and if you have enough free space in your working directory.";
|
||||
case RENDERER_KILLED:
|
||||
return "The renderer stopped because either you asked to stop or the server did (usually for a render time too high).";
|
||||
return "The renderer stopped because either you asked to stop or the server did (usually for a render time too high).";
|
||||
case RENDERER_KILLED_BY_USER:
|
||||
return "The renderer stopped because you've blocked its project.";
|
||||
case RENDERER_KILLED_BY_SERVER:
|
||||
|
||||
@@ -284,7 +284,7 @@ public class SettingsLoader {
|
||||
config.setUseGPU(device);
|
||||
}
|
||||
}
|
||||
if (config.getNbCores() == -1 && cores != null) {
|
||||
if (config.getNbCores() == -1 && cores != null) {
|
||||
config.setUseNbCores(Integer.valueOf(cores));
|
||||
}
|
||||
if (config.getUserSpecifiedACacheDir() == false && cacheDir != null && new File(cacheDir).exists()) {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
|
||||
package com.sheepit.client;
|
||||
|
||||
public class Stats {
|
||||
@@ -41,7 +41,7 @@ public class Stats {
|
||||
waitingProject = 0;
|
||||
connectedMachine = 0;
|
||||
}
|
||||
|
||||
|
||||
public int getRemainingFrame() {
|
||||
return remainingFrame;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class Stats {
|
||||
public int getConnectedMachine() {
|
||||
return connectedMachine;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Stats [remainingFrame=" + remainingFrame + ", creditsEarned=" + creditsEarned + ", creditsEarnedSession=" + creditsEarnedSession + ", waitingProject=" + waitingProject + ", connectedMachine=" + connectedMachine + "]";
|
||||
|
||||
@@ -59,7 +59,7 @@ public class GPUDevice {
|
||||
public String toString() {
|
||||
return "GPUDevice [model=" + model + ", memory=" + memory + ", cudaName=" + cudaName + "]";
|
||||
}
|
||||
|
||||
|
||||
public int getRecommandedTileSize() {
|
||||
// GPU
|
||||
// if the vram is lower than 1G reduce the size of tile to avoid black output
|
||||
|
||||
@@ -65,7 +65,7 @@ public abstract class OS {
|
||||
else if (os.contains("nix") || os.contains("nux")) {
|
||||
return new Linux();
|
||||
}
|
||||
else if(os.contains("freebsd")){
|
||||
else if (os.contains("freebsd")) {
|
||||
return new FreeBSD();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -220,5 +220,5 @@ public interface Kernel32Lib extends Library {
|
||||
* @return If the function succeeds, the return value is the thread's previous affinity mask.
|
||||
*/
|
||||
public boolean SetProcessAffinityMask(HANDLE hProcess, DWORD_PTR dwProcessAffinityMask);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -83,11 +83,11 @@ public class WinProcess {
|
||||
public WinProcess(int pid_) throws IOException {
|
||||
this();
|
||||
this.handle = Kernel32.INSTANCE.OpenProcess(0x0400 | // PROCESS_QUERY_INFORMATION
|
||||
0x0800 | // PROCESS_SUSPEND_RESUME
|
||||
0x0001 | // PROCESS_TERMINATE
|
||||
0x0200 | // PROCESS_SET_INFORMATION
|
||||
0x00100000, // SYNCHRONIZE
|
||||
false, pid_);
|
||||
0x0800 | // PROCESS_SUSPEND_RESUME
|
||||
0x0001 | // PROCESS_TERMINATE
|
||||
0x0200 | // PROCESS_SET_INFORMATION
|
||||
0x00100000, // SYNCHRONIZE
|
||||
false, pid_);
|
||||
if (this.handle == null) {
|
||||
throw new IOException("OpenProcess failed: " + Kernel32Util.formatMessageFromLastErrorCode(Kernel32.INSTANCE.GetLastError()) + " (pid: " + pid_ + ")");
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ public class GuiText implements Gui {
|
||||
public static final String type = "text";
|
||||
|
||||
private int framesRendered;
|
||||
|
||||
|
||||
private int sigIntCount = 0;
|
||||
|
||||
|
||||
private Log log;
|
||||
|
||||
private Client client;
|
||||
@@ -46,12 +46,12 @@ public class GuiText implements Gui {
|
||||
@Override
|
||||
public void start() {
|
||||
if (client != null) {
|
||||
|
||||
|
||||
Signal.handle(new Signal("INT"), new SignalHandler() {
|
||||
@Override
|
||||
public void handle(Signal signal) {
|
||||
sigIntCount++;
|
||||
|
||||
|
||||
if (sigIntCount == 4) {
|
||||
// This is only for ugly issues that might occur
|
||||
System.out.println("WARNING: Hitting Ctrl-C again will force close the application.");
|
||||
@@ -70,7 +70,7 @@ public class GuiText implements Gui {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
client.run();
|
||||
client.stop();
|
||||
}
|
||||
|
||||
@@ -34,10 +34,10 @@ public class GuiTextOneLine implements Gui {
|
||||
private int remaining;
|
||||
private String creditsEarned;
|
||||
private int sigIntCount = 0;
|
||||
|
||||
|
||||
private String status;
|
||||
private String line;
|
||||
|
||||
|
||||
private boolean exiting = false;
|
||||
|
||||
private Client client;
|
||||
@@ -54,12 +54,12 @@ public class GuiTextOneLine implements Gui {
|
||||
@Override
|
||||
public void start() {
|
||||
if (client != null) {
|
||||
|
||||
|
||||
Signal.handle(new Signal("INT"), new SignalHandler() {
|
||||
@Override
|
||||
public void handle(Signal signal) {
|
||||
sigIntCount++;
|
||||
|
||||
|
||||
if (sigIntCount == 5) {
|
||||
Signal.raise(new Signal("INT"));
|
||||
Runtime.getRuntime().halt(0);
|
||||
@@ -74,7 +74,7 @@ public class GuiTextOneLine implements Gui {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
client.run();
|
||||
client.stop();
|
||||
}
|
||||
|
||||
@@ -185,7 +185,6 @@ public class Working implements Activity {
|
||||
buttonsPanel.add(blockJob);
|
||||
buttonsPanel.add(exitAfterFrame);
|
||||
|
||||
|
||||
parent.getContentPane().setLayout(new GridBagLayout());
|
||||
GridBagConstraints global_constraints = new GridBagConstraints();
|
||||
global_constraints.fill = GridBagConstraints.HORIZONTAL;
|
||||
|
||||
Reference in New Issue
Block a user