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