рефакторинг
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
package GlobalData.Credentials;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Database.iDBObject;
|
||||
import Common.Utils.Utils;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class Credentials extends iDBObject {
|
||||
@Description("DEFAULT -1")
|
||||
public int machine_id = Utils.Nan;
|
||||
public int machine_id = Constants.Nan;
|
||||
@Description("DEFAULT -1")
|
||||
public int user_id = Utils.Nan;
|
||||
public int user_id = Constants.Nan;
|
||||
@Description("DEFAULT -1")
|
||||
public int compiler_id = Utils.Nan;
|
||||
public int compiler_id = Constants.Nan;
|
||||
@Description("DEFAULT -1")
|
||||
public int makefile_id = Utils.Nan;
|
||||
public int makefile_id = Constants.Nan;
|
||||
@Description("DEFAULT -1")
|
||||
public int runconfiguration_id = Utils.Nan;
|
||||
public int runconfiguration_id = Constants.Nan;
|
||||
@Description("DEFAULT -1")
|
||||
public int remotesapfor_id = Utils.Nan;
|
||||
public int remotesapfor_id = Constants.Nan;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package GlobalData.EnvironmentValue;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Current;
|
||||
import Common.Database.iDBObject;
|
||||
import Common.Utils.Utils;
|
||||
public class EnvironmentValue extends iDBObject {
|
||||
public String name = "";
|
||||
public String value = "";
|
||||
public int machine_id = Utils.Nan; //для удаления машин
|
||||
public int run_configuration_id = Utils.Nan;
|
||||
public int machine_id = Constants.Nan; //для удаления машин
|
||||
public int run_configuration_id = Constants.Nan;
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return Current.HasRunConfiguration() && (run_configuration_id == Current.getRunConfiguration().id);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package GlobalData.Module;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Makefile.Makefile;
|
||||
import ProjectData.LanguageName;
|
||||
public class Module extends ModuleAnchestor {
|
||||
public int makefile_id = Utils.Nan;
|
||||
public int makefile_id = Constants.Nan;
|
||||
public LanguageName language = LanguageName.n;
|
||||
public int on = 1; //учитывать ли модуль при сборке. указание пользователя. если файлы отсутствуют - игнорится
|
||||
public Module() {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package GlobalData.Module;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Database.iDBObject;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
public class ModuleAnchestor extends iDBObject {
|
||||
//--------------------------------------------------------------------------------------
|
||||
public int machine_id = Utils.Nan;
|
||||
public int compiler_id = Utils.Nan;
|
||||
public int machine_id = Constants.Nan;
|
||||
public int compiler_id = Constants.Nan;
|
||||
public String command = ""; //дополнительная команда компилятору. между вызовом и флагами.
|
||||
public String flags = ""; //последовательность флагов
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package GlobalData.Module.UI;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import GlobalData.Compiler.CompilerType;
|
||||
import GlobalData.Makefile.Makefile;
|
||||
@@ -100,7 +100,7 @@ public class ModuleAnchestorForm<T extends ModuleAnchestor> extends DBObjectDial
|
||||
public void ProcessResult() {
|
||||
Result.machine_id = Current.getMachine().id;
|
||||
Compiler compiler = (Compiler) fields.cbCompilers.getSelectedItem();
|
||||
Result.compiler_id = (compiler != null) ? compiler.id : Utils.Nan;
|
||||
Result.compiler_id = (compiler != null) ? compiler.id : Constants.Nan;
|
||||
Result.command = command;
|
||||
Result.flags = flags;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.RunConfiguration;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Current;
|
||||
import Common.Database.iDBObject;
|
||||
import Common.Global;
|
||||
@@ -22,7 +23,7 @@ public class RunConfiguration extends iDBObject {
|
||||
public int machine_id;
|
||||
//---------------------------------------->
|
||||
@Description("DEFAULT -1")
|
||||
public int compiler_id = Utils.Nan;
|
||||
public int compiler_id = Constants.Nan;
|
||||
public String LauncherCall = ""; //например DVM или mpirun
|
||||
public String LauncherOptions = ""; //например run
|
||||
//--------------------------------------
|
||||
@@ -175,7 +176,7 @@ public class RunConfiguration extends iDBObject {
|
||||
}
|
||||
public String getLaunchShortDescription() {
|
||||
String res = "";
|
||||
if (compiler_id != Utils.Nan) {
|
||||
if (compiler_id != Constants.Nan) {
|
||||
res += getCompiler().description;
|
||||
if (!LauncherOptions.isEmpty())
|
||||
res += " " + LauncherOptions;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package GlobalData.RunConfiguration;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Current;
|
||||
import Common.Database.*;
|
||||
import Common.Global;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.UI;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import GlobalData.Compiler.CompilerType;
|
||||
import GlobalData.DVMParameter.DVMParameter;
|
||||
@@ -68,7 +68,7 @@ public class RunConfigurationsDBTable extends iDBTable<RunConfiguration> {
|
||||
Result.LauncherOptions = (String) fields.cbLaunchOptions.getSelectedItem();
|
||||
if (fields.cbLauncherCall.getSelectedItem() instanceof Compiler) {
|
||||
Result.compiler_id = ((Compiler) (fields.cbLauncherCall.getSelectedItem())).id;
|
||||
} else Result.compiler_id = Utils.Nan;
|
||||
} else Result.compiler_id = Constants.Nan;
|
||||
//-
|
||||
Result.dim = (int) fields.sMaxDim.getValue();
|
||||
Result.minMatrix = fields.minMatrixBar.pack(Result.dim);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package GlobalData.SapforProfileSetting;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Current;
|
||||
import Common.Database.iDBObject;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class SapforProfileSetting extends iDBObject {
|
||||
@@ -10,7 +10,7 @@ public class SapforProfileSetting extends iDBObject {
|
||||
@Description("DEFAULT ''")
|
||||
public String value = "";
|
||||
@Description("DEFAULT -1")
|
||||
public int sapforprofile_id = Utils.Nan;
|
||||
public int sapforprofile_id = Constants.Nan;
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return Current.HasSapforProfile() && Current.getSapforProfile().id == sapforprofile_id;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package GlobalData.Splitter;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Utils.Utils;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -8,7 +8,7 @@ public class Splitter extends DBObject {
|
||||
@Description("PRIMARY KEY, UNIQUE")
|
||||
public String name = "";
|
||||
@Description("DEFAULT -1")
|
||||
public int position = Utils.Nan;
|
||||
public int position = Constants.Nan;
|
||||
public Splitter() {
|
||||
}
|
||||
public Splitter(JSplitPane splitPane) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package GlobalData.User;
|
||||
import Common.Constants.Constants;
|
||||
import Common.Current;
|
||||
import Common.Database.iDBObject;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Machine.Machine;
|
||||
import TestingSystem.UserConnection;
|
||||
import Visual_DVM_2021.Passes.SSH.ConnectionPass;
|
||||
@@ -12,7 +12,7 @@ import java.nio.file.Paths;
|
||||
public class User extends iDBObject {
|
||||
public String login;
|
||||
public String password = "";
|
||||
public int machine_id = Utils.Nan;
|
||||
public int machine_id = Constants.Nan;
|
||||
public UserAuthentication authentication = UserAuthentication.password;
|
||||
public String workspace = ""; //рабочая папка визуализатора пользователя на машине. полный путь.
|
||||
public UserState state = UserState.initial;
|
||||
|
||||
Reference in New Issue
Block a user