no message
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package GlobalData.Compiler;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common_old.Utils.Utils;
|
||||
import Common_old.Utils.Validators.DVMHelpParser;
|
||||
import GlobalData.CompilerEnvironment.CompilerEnvironmentsSet;
|
||||
import GlobalData.CompilerOption.CompilerOptionsSet;
|
||||
@@ -182,10 +182,10 @@ public class Compiler extends iDBObject {
|
||||
return "";
|
||||
}
|
||||
public String getHelpCommand() {
|
||||
return Utils.DQuotes(call_command) + " " + help_command;
|
||||
return CommonUtils.DQuotes(call_command) + " " + help_command;
|
||||
}
|
||||
public String getVersionCommand() {
|
||||
return Utils.DQuotes(call_command) + " " + version_command;
|
||||
return CommonUtils.DQuotes(call_command) + " " + version_command;
|
||||
}
|
||||
public String getVersionInfo(){
|
||||
return "v="+version+" r="+revision;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.Compiler;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
import Common_old.UI.UI;
|
||||
@@ -45,7 +46,7 @@ public class CompilersDBTable extends iDBTable<Compiler> {
|
||||
String home = fields.tfHome.getText();
|
||||
if (!home.isEmpty()) {
|
||||
if (home.startsWith("/")) {
|
||||
if (Utils.ContainsCyrillic(home))
|
||||
if (CommonUtils.ContainsCyrillic(home))
|
||||
Log.Writeln("Расположение компилятора не может содержать кириллицу");
|
||||
else {
|
||||
new PathValidator(home, "Расположение компилятора", Log).Validate();
|
||||
@@ -58,7 +59,7 @@ public class CompilersDBTable extends iDBTable<Compiler> {
|
||||
String call_command = fields.tfCallCommand.getText();
|
||||
if (call_command.isEmpty())
|
||||
Log.Writeln("Команда вызова компилятора не может быть пустой");
|
||||
else if (Utils.ContainsCyrillic(call_command))
|
||||
else if (CommonUtils.ContainsCyrillic(call_command))
|
||||
Log.Writeln("Команда вызова компилятора не может содержать кириллицу");
|
||||
else {
|
||||
switch (call_command.charAt(0)) {
|
||||
@@ -80,7 +81,7 @@ public class CompilersDBTable extends iDBTable<Compiler> {
|
||||
Log.Writeln("Прямая команда вызова содержит запрещённые символы");
|
||||
else {
|
||||
if (Utils.isLinuxSystemCommand(call_command))
|
||||
Log.Writeln(Utils.DQuotes(call_command) + " является системной командой Linux");
|
||||
Log.Writeln(CommonUtils.DQuotes(call_command) + " является системной командой Linux");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package GlobalData.CompilerOption;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common_old.Utils.Utils;
|
||||
import Common.Utils.CommonUtils;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -26,7 +26,7 @@ public class CompilerOption extends DBObject {
|
||||
@Override
|
||||
public String toString() {
|
||||
return name + (hasParameter() ? (parameterSeparator +
|
||||
(parameterValue.contains(" ") ? Utils.DQuotes(parameterValue) : parameterValue)) : "");
|
||||
(parameterValue.contains(" ") ? CommonUtils.DQuotes(parameterValue) : parameterValue)) : "");
|
||||
}
|
||||
public void CheckParameterVariants() {
|
||||
for (String line : description)
|
||||
@@ -34,7 +34,7 @@ public class CompilerOption extends DBObject {
|
||||
}
|
||||
public boolean CheckLine(String line) {
|
||||
if (hasParameter()) {
|
||||
Pattern DVM_PARAM_VALUES_REGEX = Pattern.compile(Utils.TBrackets(parameterName) + "\\s*=\\s*" + "\\w+(\\|\\w+)+", Pattern.CASE_INSENSITIVE);
|
||||
Pattern DVM_PARAM_VALUES_REGEX = Pattern.compile(CommonUtils.TBrackets(parameterName) + "\\s*=\\s*" + "\\w+(\\|\\w+)+", Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = DVM_PARAM_VALUES_REGEX.matcher(line);
|
||||
if (matcher.find()) {
|
||||
String s = line.substring(matcher.start(), matcher.end());
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package GlobalData.Credentials;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class Credentials extends iDBObject {
|
||||
@Description("DEFAULT -1")
|
||||
public int machine_id = Constants.Nan;
|
||||
public int machine_id = CommonConstants.Nan;
|
||||
@Description("DEFAULT -1")
|
||||
public int user_id = Constants.Nan;
|
||||
public int user_id = CommonConstants.Nan;
|
||||
@Description("DEFAULT -1")
|
||||
public int compiler_id = Constants.Nan;
|
||||
public int compiler_id = CommonConstants.Nan;
|
||||
@Description("DEFAULT -1")
|
||||
public int makefile_id = Constants.Nan;
|
||||
public int makefile_id = CommonConstants.Nan;
|
||||
@Description("DEFAULT -1")
|
||||
public int runconfiguration_id = Constants.Nan;
|
||||
public int runconfiguration_id = CommonConstants.Nan;
|
||||
@Description("DEFAULT -1")
|
||||
public int remotesapfor_id = Constants.Nan;
|
||||
public int remotesapfor_id = CommonConstants.Nan;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.DVMParameter;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import _VisualDVM.Global;
|
||||
@@ -68,7 +69,7 @@ public class DVMParameterDBTable extends iDBTable<DVMParameter> {
|
||||
}
|
||||
*/
|
||||
if (Utils.isLinuxSystemCommand(name))
|
||||
Log.Writeln(Utils.DQuotes(name) + " является системной командой Linux,\nи не может быть задано в качестве имени переменной окружения.");
|
||||
Log.Writeln(CommonUtils.DQuotes(name) + " является системной командой Linux,\nи не может быть задано в качестве имени переменной окружения.");
|
||||
|
||||
/*
|
||||
if (value.contains("\"")) {
|
||||
@@ -77,7 +78,7 @@ public class DVMParameterDBTable extends iDBTable<DVMParameter> {
|
||||
*/
|
||||
for (DVMParameter par : Global.db.dvmParameters.Data.values()) {
|
||||
if (par.isVisible() && (Result.id != par.id) && (par.name.equals(name))) {
|
||||
Log.Writeln("В конфигурации запуска уже задан параметр DVM системы с именем " + Utils.Brackets(name));
|
||||
Log.Writeln("В конфигурации запуска уже задан параметр DVM системы с именем " + CommonUtils.Brackets(name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package GlobalData.EnvironmentValue;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common_old.Utils.Utils;
|
||||
public class EnvironmentValue extends iDBObject {
|
||||
public String name = "";
|
||||
public String value = "";
|
||||
public int machine_id = Constants.Nan; //для удаления машин
|
||||
public int run_configuration_id = Constants.Nan;
|
||||
public int machine_id = CommonConstants.Nan; //для удаления машин
|
||||
public int run_configuration_id = CommonConstants.Nan;
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return Current.HasRunConfiguration() && (run_configuration_id == Current.getRunConfiguration().id);
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return name + "=" + Utils.DQuotes(value);
|
||||
return name + "=" + CommonUtils.DQuotes(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.EnvironmentValue;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import _VisualDVM.Global;
|
||||
@@ -38,13 +39,13 @@ public class EnvironmentValuesDBTable extends iDBTable<EnvironmentValue> {
|
||||
Log.Writeln("Имя переменной окружения может содержать только латинские буквы, цифры и подчёркивания");
|
||||
}
|
||||
if (Utils.isLinuxSystemCommand(name))
|
||||
Log.Writeln(Utils.DQuotes(name) + " является системной командой Linux,\nи не может быть задано в качестве имени переменной окружения.");
|
||||
Log.Writeln(CommonUtils.DQuotes(name) + " является системной командой Linux,\nи не может быть задано в качестве имени переменной окружения.");
|
||||
if (value.contains("\"")) {
|
||||
Log.Writeln("Значение переменной окружения не может содержать двойные кавычки");
|
||||
}
|
||||
for (EnvironmentValue env : Global.db.environmentValues.Data.values()) {
|
||||
if (env.isVisible() && (Result.id != env.id) && (env.name.equals(name))) {
|
||||
Log.Writeln("В конфигурации запуска уже задана переменная окружения с именем " + Utils.Brackets(name));
|
||||
Log.Writeln("В конфигурации запуска уже задана переменная окружения с именем " + CommonUtils.Brackets(name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package GlobalData.Machine;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.CommonUtils;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import GlobalData.User.User;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Machine extends iDBObject {
|
||||
}
|
||||
public String getFullDescription() {
|
||||
return //this.equals(Constants.repository_machine) ? "Репозиторий визуализатора" :
|
||||
"Машина по адресу " + Utils.Brackets(getURL());
|
||||
"Машина по адресу " + CommonUtils.Brackets(getURL());
|
||||
}
|
||||
public LinkedHashMap<Integer, Compiler> getCompilers() {
|
||||
return Global.db.getMapByFKi(this, Compiler.class);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.Makefile;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Utils.TextLog;
|
||||
@@ -37,7 +38,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
Vector<String> titles = new Vector<>();
|
||||
Vector<String> objects = new Vector<>();
|
||||
Vector<String> bodies = new Vector<>();
|
||||
String binary = Utils.DQuotes("0"); // Utils.DQuotes(project.name);
|
||||
String binary = CommonUtils.DQuotes("0"); // Utils.DQuotes(project.name);
|
||||
for (Module module : modules.values()) {
|
||||
//определить а активен ли модуль.
|
||||
//выбран ли он. есть ли у него компилятор. есть ли для него программы.
|
||||
@@ -61,7 +62,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
for (DBProjectFile program : programsToAssembly) {
|
||||
//--
|
||||
program.last_assembly_name = module.language.toString() + "_" + i + ".o";
|
||||
String object = Utils.DQuotes(program.last_assembly_name);
|
||||
String object = CommonUtils.DQuotes(program.last_assembly_name);
|
||||
module_objects.add(object);
|
||||
module_body +=
|
||||
object + ":\n" +
|
||||
@@ -78,7 +79,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
++i;
|
||||
}
|
||||
titles.add(String.join("\n",
|
||||
LANG_ + "COMMAND=" + Utils.DQuotes(module_compiler.call_command) + " " + module.command,
|
||||
LANG_ + "COMMAND=" + CommonUtils.DQuotes(module_compiler.call_command) + " " + module.command,
|
||||
LANG_ + "FLAGS=" + module.flags,
|
||||
LANG_ + "OBJECTS=" + String.join(" ", module_objects),
|
||||
""
|
||||
@@ -88,7 +89,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
}
|
||||
}
|
||||
return String.join("\n",
|
||||
"LINK_COMMAND=" + Utils.DQuotes(linker.call_command) + " " + command,
|
||||
"LINK_COMMAND=" + CommonUtils.DQuotes(linker.call_command) + " " + command,
|
||||
"LINK_FLAGS=" + flags + "\n",
|
||||
String.join("\n", titles),
|
||||
"all: " + binary,
|
||||
@@ -124,7 +125,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
for (DBProjectFile program : programsToAssembly) {
|
||||
//--
|
||||
program.last_assembly_name = module.language.toString() + "_" + i + ".o";
|
||||
String object = Utils.DQuotes(program.last_assembly_name);
|
||||
String object = CommonUtils.DQuotes(program.last_assembly_name);
|
||||
module_objects.add(object);
|
||||
module_body +=
|
||||
object + ":\n" +
|
||||
@@ -141,7 +142,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
++i;
|
||||
}
|
||||
titles.add(String.join("\n",
|
||||
LANG_ + "COMMAND=" + Utils.DQuotes(module_compiler.call_command) + " " + module.command,
|
||||
LANG_ + "COMMAND=" + CommonUtils.DQuotes(module_compiler.call_command) + " " + module.command,
|
||||
LANG_ + "FLAGS=" + module.flags,
|
||||
LANG_ + "OBJECTS=" + String.join(" ", module_objects),
|
||||
""
|
||||
@@ -178,7 +179,7 @@ public class Makefile extends ModuleAnchestor {
|
||||
if (linker.type.equals(CompilerType.dvm)) {
|
||||
if (!Current.getProject().languageName.getDVMLink().equals(command))
|
||||
Log.Writeln("команда линковки " +
|
||||
Utils.Quotes(command) +
|
||||
CommonUtils.Quotes(command) +
|
||||
" не соответствует языку текущего проекта "
|
||||
+ Current.getProject().languageName.getDescription() + "\n" +
|
||||
"Используйте команду " + Current.getProject().languageName.getDVMLink());
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package GlobalData.Module;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import GlobalData.Makefile.Makefile;
|
||||
import ProjectData.LanguageName;
|
||||
public class Module extends ModuleAnchestor {
|
||||
public int makefile_id = Constants.Nan;
|
||||
public int makefile_id = CommonConstants.Nan;
|
||||
public LanguageName language = LanguageName.n;
|
||||
public int on = 1; //учитывать ли модуль при сборке. указание пользователя. если файлы отсутствуют - игнорится
|
||||
public Module() {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package GlobalData.Module;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
public class ModuleAnchestor extends iDBObject {
|
||||
//--------------------------------------------------------------------------------------
|
||||
public int machine_id = Constants.Nan;
|
||||
public int compiler_id = Constants.Nan;
|
||||
public int machine_id = CommonConstants.Nan;
|
||||
public int compiler_id = CommonConstants.Nan;
|
||||
public String command = ""; //дополнительная команда компилятору. между вызовом и флагами.
|
||||
public String flags = ""; //последовательность флагов
|
||||
//---------------------------------------------------------------------------------------
|
||||
@@ -22,11 +22,11 @@ public class ModuleAnchestor extends iDBObject {
|
||||
public String getDescription() {
|
||||
String res = "";
|
||||
if (getCompiler() != null) {
|
||||
res += Utils.Brackets(getCompiler().getDescription());
|
||||
res += CommonUtils.Brackets(getCompiler().getDescription());
|
||||
if (!command.isEmpty())
|
||||
res += " " + Utils.Brackets(command);
|
||||
res += " " + CommonUtils.Brackets(command);
|
||||
if (!flags.isEmpty())
|
||||
res += " " + Utils.Brackets(flags);
|
||||
res += " " + CommonUtils.Brackets(flags);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package GlobalData.Module.UI;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
import Common_old.UI.Windows.Dialog.DBObjectDialog;
|
||||
@@ -103,7 +103,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 : Constants.Nan;
|
||||
Result.compiler_id = (compiler != null) ? compiler.id : CommonConstants.Nan;
|
||||
Result.command = command;
|
||||
Result.flags = flags;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package GlobalData.RunConfiguration;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Utils.TextLog;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import GlobalData.DVMParameter.DVMParameter;
|
||||
import GlobalData.EnvironmentValue.EnvironmentValue;
|
||||
@@ -23,7 +23,7 @@ public class RunConfiguration extends iDBObject {
|
||||
public int machine_id;
|
||||
//---------------------------------------->
|
||||
@Description("DEFAULT -1")
|
||||
public int compiler_id = Constants.Nan;
|
||||
public int compiler_id = CommonConstants.Nan;
|
||||
public String LauncherCall = ""; //например DVM или mpirun
|
||||
public String LauncherOptions = ""; //например run
|
||||
//--------------------------------------
|
||||
@@ -146,16 +146,16 @@ public class RunConfiguration extends iDBObject {
|
||||
public String getDescription() {
|
||||
String res = "";
|
||||
if (!LauncherCall.isEmpty()) {
|
||||
res += Utils.Brackets(LauncherCall);
|
||||
res += CommonUtils.Brackets(LauncherCall);
|
||||
if (!LauncherOptions.isEmpty())
|
||||
res += " " + Utils.Brackets(LauncherOptions);
|
||||
res += " " + CommonUtils.Brackets(LauncherOptions);
|
||||
} else res = " — ";
|
||||
return res;
|
||||
}
|
||||
public String getLaunchScriptText(String binary_name, String task_matrix) {
|
||||
String res = "";
|
||||
if (!LauncherCall.isEmpty()) {
|
||||
res += Utils.DQuotes(LauncherCall);
|
||||
res += CommonUtils.DQuotes(LauncherCall);
|
||||
if (!LauncherOptions.isEmpty())
|
||||
res += " " + LauncherOptions;
|
||||
if (!task_matrix.isEmpty())
|
||||
@@ -163,14 +163,14 @@ public class RunConfiguration extends iDBObject {
|
||||
}
|
||||
if (!res.isEmpty())
|
||||
res += " ";
|
||||
res += Utils.DQuotes("./" + binary_name);
|
||||
res += CommonUtils.DQuotes("./" + binary_name);
|
||||
if (!args.isEmpty())
|
||||
res += " " + args;
|
||||
return res;
|
||||
}
|
||||
public String getLaunchShortDescription() {
|
||||
String res = "";
|
||||
if (compiler_id != Constants.Nan) {
|
||||
if (compiler_id != CommonConstants.Nan) {
|
||||
res += getCompiler().description;
|
||||
if (!LauncherOptions.isEmpty())
|
||||
res += " " + LauncherOptions;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package GlobalData.RunConfiguration;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.DataSetControlForm;
|
||||
@@ -72,7 +72,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 = Constants.Nan;
|
||||
} else Result.compiler_id = CommonConstants.Nan;
|
||||
//-
|
||||
Result.dim = (int) fields.sMaxDim.getValue();
|
||||
Result.minMatrix = fields.minMatrixBar.pack(Result.dim);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package GlobalData.SapforProfileSetting;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import GlobalData.Settings.SettingName;
|
||||
@@ -10,7 +10,7 @@ public class SapforProfileSetting extends iDBObject {
|
||||
@Description("DEFAULT ''")
|
||||
public String value = "";
|
||||
@Description("DEFAULT -1")
|
||||
public int sapforprofile_id = Constants.Nan;
|
||||
public int sapforprofile_id = CommonConstants.Nan;
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return Current.HasSapforProfile() && Current.getSapforProfile().id == sapforprofile_id;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package GlobalData.Settings;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.UI.Menus_2023.StableMenuItem;
|
||||
import Common_old.Utils.Utils;
|
||||
import Repository.Component.ComponentType;
|
||||
@@ -70,7 +71,7 @@ public class DBSetting extends DBObject {
|
||||
getMenuItem().setText(Name.getDescription() + " : " + this + "%");
|
||||
break;
|
||||
case StringField:
|
||||
String valueToShow = Value.isEmpty()? "не задано":Utils.Quotes(toString());
|
||||
String valueToShow = Value.isEmpty()? "не задано": CommonUtils.Quotes(toString());
|
||||
getMenuItem().setText(Name.getDescription() + " : " + valueToShow);
|
||||
break;
|
||||
case IntField:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package GlobalData.Splitter;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
@@ -8,7 +8,7 @@ public class Splitter extends DBObject {
|
||||
@Description("PRIMARY KEY, UNIQUE")
|
||||
public String name = "";
|
||||
@Description("DEFAULT -1")
|
||||
public int position = Constants.Nan;
|
||||
public int position = CommonConstants.Nan;
|
||||
public Splitter() {
|
||||
}
|
||||
public Splitter(JSplitPane splitPane) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package GlobalData.Tasks.CompilationTask;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.Makefile.Makefile;
|
||||
import GlobalData.Module.Module;
|
||||
import GlobalData.Tasks.RunTask.RunTask;
|
||||
@@ -16,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 = Constants.Nan;
|
||||
public int makefile_id = CommonConstants.Nan;
|
||||
public String binary_name = ""; //исполняемый файл.
|
||||
//---------------------------------------------------
|
||||
@Description("DEFAULT ''")
|
||||
@@ -100,7 +100,7 @@ public class CompilationTask extends Task {
|
||||
String errors = getErrors();
|
||||
for (DBProjectFile file : project.db.files.Data.values()) {
|
||||
if (!file.last_assembly_name.isEmpty()) {
|
||||
String replacement = file.last_assembly_name + " " + Utils.RBrackets(file.name);
|
||||
String replacement = file.last_assembly_name + " " + CommonUtils.RBrackets(file.name);
|
||||
output = output.replace(file.last_assembly_name, replacement);
|
||||
errors = errors.replace(file.last_assembly_name, replacement);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package GlobalData.Tasks.QueueSystem;
|
||||
import Common_old.Utils.Utils;
|
||||
import Common.Utils.CommonUtils;
|
||||
import GlobalData.Tasks.Task;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
public class QueueSystem {
|
||||
@@ -28,9 +28,9 @@ public class QueueSystem {
|
||||
}
|
||||
}
|
||||
public String getCheckTaskCommand(Task task) {
|
||||
return check_command + " " + Utils.DQuotes(task.PID);
|
||||
return check_command + " " + CommonUtils.DQuotes(task.PID);
|
||||
}
|
||||
public String getCancelTaskCommand(Task task) {
|
||||
return cancel_command + " " + Utils.DQuotes(task.PID);
|
||||
return cancel_command + " " + CommonUtils.DQuotes(task.PID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package GlobalData.Tasks.RunTask;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Utils.StringTemplate;
|
||||
@@ -17,8 +17,8 @@ import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
public class RunTask extends Task {
|
||||
public int compilation_task_id = Constants.Nan; //нужна для бинарника
|
||||
public int run_configuration_id = Constants.Nan;
|
||||
public int compilation_task_id = CommonConstants.Nan; //нужна для бинарника
|
||||
public int run_configuration_id = CommonConstants.Nan;
|
||||
@Description("DEFAULT ''")
|
||||
public String last_sts_name = "";
|
||||
@Description("DEFAULT 0")
|
||||
@@ -152,7 +152,7 @@ public class RunTask extends Task {
|
||||
public boolean hasDVMPar() {
|
||||
RunConfiguration config = getRunConfiguration();
|
||||
return
|
||||
config.compiler_id != Constants.Nan &&
|
||||
config.compiler_id != CommonConstants.Nan &&
|
||||
config.getCompiler().type.equals(CompilerType.dvm) &&
|
||||
!config.getParList().isEmpty()
|
||||
;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.Tasks.Supervisor.Local.Linux;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.Tasks.Supervisor.Local.LocalTaskSupervisor;
|
||||
@@ -23,10 +24,10 @@ public abstract class LinuxLocalTaskSupervisor<T extends Task> extends LocalTask
|
||||
User user = task.getUser();
|
||||
return
|
||||
String.join(" ",
|
||||
Utils.DQuotes(user.getStarterFile()),
|
||||
Utils.DQuotes(user.getLauncherFile()),
|
||||
CommonUtils.DQuotes(user.getStarterFile()),
|
||||
CommonUtils.DQuotes(user.getLauncherFile()),
|
||||
String.valueOf(task.maxtime),
|
||||
Utils.DQuotes(getCoupDeGrace()),
|
||||
CommonUtils.DQuotes(getCoupDeGrace()),
|
||||
task.getFullCommand()
|
||||
);
|
||||
}
|
||||
@@ -47,7 +48,7 @@ public abstract class LinuxLocalTaskSupervisor<T extends Task> extends LocalTask
|
||||
if (task.PID.isEmpty())
|
||||
throw new PassException("Ошибка при старте : идентификатор задачи не определен.");
|
||||
task.StartDate = (new Date()).getTime();
|
||||
pass.ShowMessage1("Задача активна, идентификатор " + Utils.Brackets(task.PID));
|
||||
pass.ShowMessage1("Задача активна, идентификатор " + CommonUtils.Brackets(task.PID));
|
||||
RefreshProgress();
|
||||
do {
|
||||
Thread.sleep(getTaskCheckPeriod() * 1000L);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.Tasks.Supervisor.Local;
|
||||
import Common.CommonConstants;
|
||||
import Common_old.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
@@ -22,7 +23,7 @@ public abstract class LocalTaskSupervisor<T extends Task> extends TaskSupervisor
|
||||
protected int exitCode;
|
||||
@Override
|
||||
protected void StartTask() throws Exception {
|
||||
exitCode = Constants.Nan;
|
||||
exitCode = CommonConstants.Nan;
|
||||
taskProcess = Utils.startScript(task.getLocalWorkspace(), getProjectCopy(), "start_task_script", getScriptText(), getEnvs());
|
||||
task.state = TaskState.Running;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.Tasks.Supervisor.Local.Windows;
|
||||
import Common.Utils.CommonUtils;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.Makefile.Makefile;
|
||||
@@ -18,7 +19,7 @@ public class WindowsLocalCompilationSupervisor extends WindowsLocalTaskSuperviso
|
||||
}
|
||||
@Override
|
||||
protected String getScriptText() {
|
||||
return Utils.DQuotes(Global.db.settings.get(SettingName.LocalMakePathWindows).Value) + " 1>out.txt 2>err.txt";
|
||||
return CommonUtils.DQuotes(Global.db.settings.get(SettingName.LocalMakePathWindows).Value) + " 1>out.txt 2>err.txt";
|
||||
}
|
||||
//скорее всего как то выделить подготовку к компиляции как метод предка.
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package GlobalData.Tasks.Supervisor.Remote;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.RemoteFile.RemoteFile;
|
||||
import GlobalData.Tasks.QueueSystem.MVS;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
@@ -32,7 +32,7 @@ public class MVSRunSupervisor extends ServerRunSupervisor {
|
||||
String env = String.join(" ", Current.getRunConfiguration().getEnvList());
|
||||
mvs_time = (task.maxtime / 60); //в минутах
|
||||
if (task.maxtime % 60 > 0) mvs_time += 1;
|
||||
String res = "maxtime=" + Utils.DQuotes(mvs_time) + " ./run";
|
||||
String res = "maxtime=" + CommonUtils.DQuotes(mvs_time) + " ./run";
|
||||
if (!env.isEmpty())
|
||||
res = env + " " + res;
|
||||
/*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package GlobalData.Tasks.Supervisor.Remote;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.RemoteFile.RemoteFile;
|
||||
import GlobalData.Tasks.Supervisor.TaskSupervisor;
|
||||
import GlobalData.Tasks.Task;
|
||||
@@ -77,10 +77,10 @@ public abstract class RemoteTaskSupervisor<T extends Task> extends TaskSuperviso
|
||||
protected String getStartCommand() {
|
||||
String res =
|
||||
String.join(" ",
|
||||
Utils.DQuotes(getStarter()),
|
||||
Utils.DQuotes(getLauncher()),
|
||||
CommonUtils.DQuotes(getStarter()),
|
||||
CommonUtils.DQuotes(getLauncher()),
|
||||
String.valueOf(task.maxtime),
|
||||
Utils.DQuotes(getCoupDeGrace()),
|
||||
CommonUtils.DQuotes(getCoupDeGrace()),
|
||||
task.getFullCommand()
|
||||
);
|
||||
return res;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.Tasks.Supervisor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.Tasks.Task;
|
||||
@@ -96,7 +97,7 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass_2021> {
|
||||
task.state = TaskState.AbortedByUser;
|
||||
ShowTaskState();
|
||||
}
|
||||
pass.ShowMessage1("Задача " + Utils.Brackets(task.state.getDescription()));
|
||||
pass.ShowMessage1("Задача " + CommonUtils.Brackets(task.state.getDescription()));
|
||||
task.EndDate = (new Date()).getTime();
|
||||
pass.ShowMessage2("Получение результатов");
|
||||
AchieveResults();
|
||||
@@ -119,7 +120,7 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass_2021> {
|
||||
if (task.PID.isEmpty())
|
||||
throw new PassException("Ошибка при старте : идентификатор задачи не определен.");
|
||||
task.StartDate = (new Date()).getTime();
|
||||
pass.ShowMessage1("Задача активна, идентификатор " + Utils.Brackets(task.PID));
|
||||
pass.ShowMessage1("Задача активна, идентификатор " + CommonUtils.Brackets(task.PID));
|
||||
RefreshProgress();
|
||||
do {
|
||||
Thread.sleep(getTaskCheckPeriod() * 1000);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package GlobalData.Tasks;
|
||||
import Common.CommonConstants;
|
||||
import Common_old.Constants;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.Global;
|
||||
@@ -16,8 +17,8 @@ public abstract class Task extends iDBObject {
|
||||
//</editor-fold>
|
||||
public TaskState state = TaskState.Inactive;
|
||||
//----------------------------------
|
||||
public int machine_id = Constants.Nan;
|
||||
public int user_id = Constants.Nan;
|
||||
public int machine_id = CommonConstants.Nan;
|
||||
public int user_id = CommonConstants.Nan;
|
||||
//-----------------------------------
|
||||
public String PID = "";
|
||||
public String project_path;// путь к проекту.
|
||||
@@ -29,9 +30,9 @@ public abstract class Task extends iDBObject {
|
||||
public long EndDate = 0;//дата окончания выполнения
|
||||
//---------------------------------
|
||||
@Description("IGNORE")
|
||||
public int progressStep = Constants.Nan;
|
||||
public int progressStep = CommonConstants.Nan;
|
||||
@Description("IGNORE")
|
||||
public int progressAll = Constants.Nan;
|
||||
public int progressAll = CommonConstants.Nan;
|
||||
public boolean belongsToProject(db_project_info project) {
|
||||
return this.project_path.equalsIgnoreCase(project.Home.getAbsolutePath());
|
||||
}
|
||||
@@ -108,11 +109,11 @@ public abstract class Task extends iDBObject {
|
||||
progressAll = progressAll_in;
|
||||
}
|
||||
public void dropProgress() {
|
||||
progressStep = Constants.Nan;
|
||||
progressAll = Constants.Nan;
|
||||
progressStep = CommonConstants.Nan;
|
||||
progressAll = CommonConstants.Nan;
|
||||
}
|
||||
public boolean hasProgress() {
|
||||
return (progressStep != Constants.Nan) && (progressAll != Constants.Nan);
|
||||
return (progressStep != CommonConstants.Nan) && (progressAll != CommonConstants.Nan);
|
||||
}
|
||||
//---------------------------------
|
||||
public void AnalyzeResultsTexts(db_project_info project) throws Exception {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package GlobalData.User;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import GlobalData.Machine.Machine;
|
||||
@@ -11,7 +11,7 @@ import java.nio.file.Paths;
|
||||
public class User extends iDBObject {
|
||||
public String login;
|
||||
public String password = "";
|
||||
public int machine_id = Constants.Nan;
|
||||
public int machine_id = CommonConstants.Nan;
|
||||
public UserAuthentication authentication = UserAuthentication.password;
|
||||
public String workspace = ""; //рабочая папка визуализатора пользователя на машине. полный путь.
|
||||
public UserState state = UserState.initial;
|
||||
|
||||
Reference in New Issue
Block a user