рефакторинг
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
package GlobalData.Tasks.CompilationTask;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
@@ -15,7 +16,7 @@ import org.apache.commons.io.FileUtils;
|
||||
import java.io.File;
|
||||
import java.util.LinkedHashMap;
|
||||
public class CompilationTask extends Task {
|
||||
public int makefile_id = Utils.Nan;
|
||||
public int makefile_id = Constants.Nan;
|
||||
public String binary_name = ""; //исполняемый файл.
|
||||
//---------------------------------------------------
|
||||
@Description("DEFAULT ''")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.Tasks.RunTask;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.Utils.StringTemplate;
|
||||
@@ -17,8 +18,8 @@ import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
public class RunTask extends Task {
|
||||
public int compilation_task_id = Utils.Nan; //нужна для бинарника
|
||||
public int run_configuration_id = Utils.Nan;
|
||||
public int compilation_task_id = Constants.Nan; //нужна для бинарника
|
||||
public int run_configuration_id = Constants.Nan;
|
||||
@Description("DEFAULT ''")
|
||||
public String last_sts_name = "";
|
||||
@Description("DEFAULT 0")
|
||||
@@ -152,7 +153,7 @@ public class RunTask extends Task {
|
||||
public boolean hasDVMPar() {
|
||||
RunConfiguration config = getRunConfiguration();
|
||||
return
|
||||
config.compiler_id != Utils.Nan &&
|
||||
config.compiler_id != Constants.Nan &&
|
||||
config.getCompiler().type.equals(CompilerType.dvm) &&
|
||||
!config.getParList().isEmpty()
|
||||
;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.Tasks.Supervisor.Local;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Tasks.RunTask.RunTask;
|
||||
@@ -22,7 +23,7 @@ public abstract class LocalTaskSupervisor<T extends Task> extends TaskSupervisor
|
||||
protected int exitCode;
|
||||
@Override
|
||||
protected void StartTask() throws Exception {
|
||||
exitCode = Utils.Nan;
|
||||
exitCode = Constants.Nan;
|
||||
taskProcess = Utils.startScript(task.getLocalWorkspace(), getProjectCopy(), "start_task_script", getScriptText(), getEnvs());
|
||||
task.state = TaskState.Running;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.Tasks;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Database.iDBObject;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
@@ -15,8 +16,8 @@ public abstract class Task extends iDBObject {
|
||||
//</editor-fold>
|
||||
public TaskState state = TaskState.Inactive;
|
||||
//----------------------------------
|
||||
public int machine_id = Utils.Nan;
|
||||
public int user_id = Utils.Nan;
|
||||
public int machine_id = Constants.Nan;
|
||||
public int user_id = Constants.Nan;
|
||||
//-----------------------------------
|
||||
public String PID = "";
|
||||
public String project_path;// путь к проекту.
|
||||
@@ -28,9 +29,9 @@ public abstract class Task extends iDBObject {
|
||||
public long EndDate = 0;//дата окончания выполнения
|
||||
//---------------------------------
|
||||
@Description("IGNORE")
|
||||
public int progressStep = Utils.Nan;
|
||||
public int progressStep = Constants.Nan;
|
||||
@Description("IGNORE")
|
||||
public int progressAll = Utils.Nan;
|
||||
public int progressAll = Constants.Nan;
|
||||
public boolean belongsToProject(db_project_info project) {
|
||||
return this.project_path.equalsIgnoreCase(project.Home.getAbsolutePath());
|
||||
}
|
||||
@@ -107,11 +108,11 @@ public abstract class Task extends iDBObject {
|
||||
progressAll = progressAll_in;
|
||||
}
|
||||
public void dropProgress() {
|
||||
progressStep = Utils.Nan;
|
||||
progressAll = Utils.Nan;
|
||||
progressStep = Constants.Nan;
|
||||
progressAll = Constants.Nan;
|
||||
}
|
||||
public boolean hasProgress() {
|
||||
return (progressStep != Utils.Nan) && (progressAll != Utils.Nan);
|
||||
return (progressStep != Constants.Nan) && (progressAll != Constants.Nan);
|
||||
}
|
||||
//---------------------------------
|
||||
public void AnalyzeResultsTexts(db_project_info project) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user