no message

This commit is contained in:
2024-10-07 14:22:52 +03:00
parent 6b1576461d
commit 61fc37b574
173 changed files with 960 additions and 1526 deletions

View File

@@ -1,9 +1,9 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common.Database.Database;
import _VisualDVM.Global;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import GlobalData.Account.AccountRole;
import Repository.BugReport.BugReport;
import Repository.BugReport.BugReportInterface;
@@ -85,7 +85,7 @@ public class AddBugReport extends AddObjectPass<BugReport> {
}
@Override
protected boolean validate() {
double size = Utils.getFileSizeMegaBytes(BugReportInterface.getArchiveFile(target));
double size = CommonUtils.getFileSizeMegaBytes(BugReportInterface.getArchiveFile(target));
if (size > 100) {
Log.Writeln_("Размер запакованного вложения " + size + " Мб превышает 100 Мб");
return false;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.UI.Windows.Dialog.DBObjectDialog;
import Common_old.Utils.Utils;
import GlobalData.DVMParameter.DVMParameter;
@@ -19,9 +20,9 @@ public class AddDVMParameterForTesting extends Pass_2021<String> {
if (name.isEmpty())
Log.Writeln("Имя параметра DVM системы не может быть пустым.");
if (Utils.isLinuxSystemCommand(name))
Log.Writeln(Utils.DQuotes(name) + " является системной командой Linux");
Log.Writeln(CommonUtils.DQuotes(name) + " является системной командой Linux");
if (Utils.isLinuxSystemCommand(value))
Log.Writeln(Utils.DQuotes(value) + " является системной командой Linux");
Log.Writeln(CommonUtils.DQuotes(value) + " является системной командой Linux");
}
@Override
public void ProcessResult() {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import Common_old.UI.UI;
@@ -24,12 +25,12 @@ public class AddFile extends ChangeFilePass<DBProjectFile> {
src = (File) args[0];
mode = Mode.Import;
fileName = src.getName();
if (Utils.ContainsCyrillic(fileName)) {
Log.Writeln_("Имя файла " + Utils.Brackets(fileName) + " содержит кириллицу.");
if (CommonUtils.ContainsCyrillic(fileName)) {
Log.Writeln_("Имя файла " + CommonUtils.Brackets(fileName) + " содержит кириллицу.");
return false;
}
if (Utils.ContainsForbiddenName(fileName)) {
Log.Writeln_("Имя файла " + Utils.Brackets(fileName)
Log.Writeln_("Имя файла " + CommonUtils.Brackets(fileName)
+ " содержит запрещенные символы." +
"\n" + Constants.all_forbidden_characters_string);
return false;
@@ -46,12 +47,12 @@ public class AddFile extends ChangeFilePass<DBProjectFile> {
//->
dst = Paths.get(target_dir.getAbsolutePath(), fileName).toFile();
if (dst.exists()) {
Log.Writeln_("Файл с именем " + Utils.Brackets(fileName) + " уже существует");
Log.Writeln_("Файл с именем " + CommonUtils.Brackets(fileName) + " уже существует");
return false;
}
target = new DBProjectFile(dst, project);
if (target.fileType.equals(FileType.forbidden)) {
Log.Writeln_("Расширение " + Utils.Brackets(Utils.getExtension(dst)) + " недопустимо");
Log.Writeln_("Расширение " + CommonUtils.Brackets(CommonUtils.getExtension(dst)) + " недопустимо");
return false;
}
return true;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
@@ -49,7 +50,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
Command(new ServerExchangeUnit_2021(ServerCode.GetObjectCopyByPK, "", new Pair<>(BugReport.class, target.id)));
target.SynchronizeFields((BugReport) response.object);
oldValue = (String) BugReport.class.getField(fieldName).get(target);
newValue = oldValue + "\n" + Utils.Brackets(Utils.print_date(
newValue = oldValue + "\n" + CommonUtils.Brackets(Utils.print_date(
new Date())) + " " + Current.getAccount().name
+ " : " + addition;
//2. дописываем нужное поле.
@@ -84,7 +85,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
}
passes.get(PassCode_2021.Email).Do(
new EmailMessage(
message_header + " " + Utils.Brackets(Current.getAccount().name),
message_header + " " + CommonUtils.Brackets(Current.getAccount().name),
message_text,
BugReportInterface.getRecipients(target)
)

View File

@@ -1,8 +1,8 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.UI.Windows.Dialog.Text.ComboTextDialog;
import Common_old.Utils.Utils;
import ProjectData.SapforData.Functions.FuncInfo;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
@@ -31,7 +31,7 @@ public class ApplyCurrentFunction extends Pass_2021 {
Current.set(Current.Function, fi);
return true;
} else {
Log.Writeln_("Проект не содержит процедуры с именем " + Utils.Brackets(func_name));
Log.Writeln_("Проект не содержит процедуры с именем " + CommonUtils.Brackets(func_name));
}
}
}

View File

@@ -1,6 +1,6 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
import GlobalData.Machine.Machine;
import GlobalData.RemoteFile.RemoteFile;
import GlobalData.User.User;
@@ -22,7 +22,7 @@ public class ArchivesBackupPass extends ConnectionPass<File> {
}
@Override
protected void ServerAction() throws Exception {
String workspace_path = Utils.toU(Paths.get(user.connection.sftpChannel.getHome(), Global.properties.BackupWorkspace).toString());
String workspace_path = CommonUtils.toU(Paths.get(user.connection.sftpChannel.getHome(), Global.properties.BackupWorkspace).toString());
RemoteFile workspace = new RemoteFile(workspace_path, true);
user.connection.MKDIR(workspace);
RemoteFile dst = new RemoteFile(workspace.full_name, src.getName());

View File

@@ -1,5 +1,6 @@
package Visual_DVM_2021.Passes.All;
import Common_old.Constants;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common.Database.Database;
import _VisualDVM.Global;
@@ -45,7 +46,7 @@ public class CloneDVMPackage extends AddObjectPass<DVMPackage> {
}
protected void createTarget() {
target = new DVMPackage();
target.id = Constants.Nan;
target.id = CommonConstants.Nan;
//-
target.sender_name = Current.getAccount().name;
target.sender_address = Current.getAccount().email;
@@ -167,7 +168,7 @@ public class CloneDVMPackage extends AddObjectPass<DVMPackage> {
src_jsons = new Vector<>();
for (DVMPackage src : srcPackages) {
if (src.state.equals(TasksPackageState.Draft)) {
Log.Writeln_("Пакет " + Utils.Brackets(src.id) + " является черновиком.");
Log.Writeln_("Пакет " + CommonUtils.Brackets(src.id) + " является черновиком.");
return false;
}
src_ids.add(src.id);

View File

@@ -1,10 +1,10 @@
package Visual_DVM_2021.Passes.All;
import Common_old.Constants;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common.Database.Database;
import _VisualDVM.Global;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import TestingSystem.Common.TasksPackageState;
@@ -105,7 +105,7 @@ public class CloneSapforPackage extends AddObjectPass<SapforPackage> {
Vector<SapforPackage_json> src_jsons = new Vector<>();
for (SapforPackage src : srcPackages) {
if (src.state.equals(TasksPackageState.Draft)) {
Log.Writeln_("Пакет " + Utils.Brackets(src.id) + " является черновиком.");
Log.Writeln_("Пакет " + CommonUtils.Brackets(src.id) + " является черновиком.");
return false;
}
src_ids.add(src.id);
@@ -128,7 +128,7 @@ public class CloneSapforPackage extends AddObjectPass<SapforPackage> {
inexistingConfigurations = new Vector<>();
//--
target = new SapforPackage();
target.id = Constants.Nan;
target.id = CommonConstants.Nan;
//-
target.sender_name = Current.getAccount().name;
target.sender_address = Current.getAccount().email;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import _VisualDVM.Global;
import Common_old.UI.Windows.Dialog.Text.ComboTextDialog;
import Common_old.Utils.Utils;
@@ -46,7 +47,7 @@ public class CombineFiles extends Transformation {
@Override
protected void body() throws Exception {
result = Paths.get(target.last_version.Home.getAbsolutePath(),
Global.isWindows ? fd.Result : Utils.toU(fd.Result)).toFile();
Global.isWindows ? fd.Result : CommonUtils.toU(fd.Result)).toFile();
//-----------------------
//получить список хедеров.
//-----------------------
@@ -55,13 +56,13 @@ public class CombineFiles extends Transformation {
//-----------------------------
result_lines.add("!-Found " + target.allIncludes.size() + " headers");
for (String name : target.allIncludes.keySet()) {
all_includes.add(" include " + Utils.Quotes(Utils.toU(name)));
result_lines.add("! include " + Utils.Quotes(Utils.toU(name)));
all_includes.add(" include " + CommonUtils.Quotes(CommonUtils.toU(name)));
result_lines.add("! include " + CommonUtils.Quotes(CommonUtils.toU(name)));
}
result_lines.add("!-Collapse-" + target.files_order.size() + " files");
int i = 1;
for (String name : target.files_order) {
result_lines.add("! -- " + i + ". " + Utils.Brackets(name));
result_lines.add("! -- " + i + ". " + CommonUtils.Brackets(name));
++i;
}
result_lines.add("!--------------------");
@@ -75,8 +76,8 @@ public class CombineFiles extends Transformation {
String header = Utils.extractHeaderName(line);
if (header != null) {
if (file.relativeHeaders.containsKey(header))
result_lines.add(" include " + Utils.Quotes(
Utils.toU(
result_lines.add(" include " + CommonUtils.Quotes(
CommonUtils.toU(
file.relativeHeaders.get(header).name)));
} else
result_lines.add(line);

View File

@@ -1,8 +1,8 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import TestingSystem.DVM.DVMTasks.DVMRunTask;
import Visual_DVM_2021.Passes.Pass_2021;
@@ -25,8 +25,8 @@ public class CompareDVMRunTasks extends Pass_2021<Vector<DVMRunTask>> {
//--
target = Global.testingServer.db.dvmRunTasks.getCheckedItems();
if (target.size() == 2) {
if (UI.Question("Назначить задачу " + Utils.Brackets(target.get(0).getPK()) + " эталоном" +
"\n(в случае отказа, будет назначена задача " + Utils.Brackets(target.get(1).getPK()) + ")")) {
if (UI.Question("Назначить задачу " + CommonUtils.Brackets(target.get(0).getPK()) + " эталоном" +
"\n(в случае отказа, будет назначена задача " + CommonUtils.Brackets(target.get(1).getPK()) + ")")) {
master = target.get(0);
slave = target.get(1);
} else {
@@ -37,11 +37,11 @@ public class CompareDVMRunTasks extends Pass_2021<Vector<DVMRunTask>> {
} else if (target.size() == 1) {
master = target.get(0);
slave = null;
return UI.Question("Отобразить задачу " + Utils.Brackets(master.getPK()));
return UI.Question("Отобразить задачу " + CommonUtils.Brackets(master.getPK()));
} else if ((target.size() == 0) && (Current.HasDVMRunTask())) {
master = Current.getDVMRunTask();
slave = null;
return UI.Question("Отобразить задачу " + Utils.Brackets(master.getPK()));
return UI.Question("Отобразить задачу " + CommonUtils.Brackets(master.getPK()));
} else {
Log.Writeln_("Для сравнения требуется отметить две задачи.\nДля отображения требуется отметить одну задачу,или выделить её.");
return false;

View File

@@ -1,8 +1,8 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
import Visual_DVM_2021.Passes.Pass_2021;
@@ -25,8 +25,8 @@ public class CompareSapforPackages extends Pass_2021<Vector<SapforPackage>> {
//--
target = Global.testingServer.db.sapforPackages.getCheckedItems();
if (target.size() == 2) {
if (UI.Question("Назначить пакет " + Utils.Brackets(target.get(0).getPK()) + " эталоном" +
"\n(в случае отказа, будет назначен пакет " + Utils.Brackets(target.get(1).getPK()) + ")")) {
if (UI.Question("Назначить пакет " + CommonUtils.Brackets(target.get(0).getPK()) + " эталоном" +
"\n(в случае отказа, будет назначен пакет " + CommonUtils.Brackets(target.get(1).getPK()) + ")")) {
master = target.get(0);
slave = target.get(1);
} else {
@@ -37,11 +37,11 @@ public class CompareSapforPackages extends Pass_2021<Vector<SapforPackage>> {
} else if (target.size() == 1) {
master = target.get(0);
slave = null;
return UI.Question("Отобразить пакет " + Utils.Brackets(master.getPK()));
return UI.Question("Отобразить пакет " + CommonUtils.Brackets(master.getPK()));
} else if ((target.size() == 0) && (Current.HasSapforPackage())) {
master = Current.getSapforPackage();
slave = null;
return UI.Question("Отобразить пакет " + Utils.Brackets(master.getPK()));
return UI.Question("Отобразить пакет " + CommonUtils.Brackets(master.getPK()));
} else {
Log.Writeln_("Для сравнения требуется отметить два пакета.\nДля отображения требуется отметить один пакет,или выделить его");
return false;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -33,7 +34,7 @@ public class Compile extends Pass_2021<db_project_info> {
subpass = null;
compilationTask = null;
if (Current.getUser().state != UserState.ready_to_work)
Log.Writeln_("Пользователь " + Utils.Brackets(Current.getUser().login) +
Log.Writeln_("Пользователь " + CommonUtils.Brackets(Current.getUser().login) +
" не проинициализирован\ерейдите на вкладку 'Настройки компиляции и запуска',\n" +
" и выполните команду 'Инициализация пользователя'\n");
Current.getMakefile().Validate(Log);
@@ -71,7 +72,7 @@ public class Compile extends Pass_2021<db_project_info> {
break;
case Undefined:
case MVS_cluster:
throw new PassException("Компиляция не реализована для типа машины " + Utils.DQuotes(Current.getMachine().type));
throw new PassException("Компиляция не реализована для типа машины " + CommonUtils.DQuotes(Current.getMachine().type));
default:
subpass = passes.get(PassCode_2021.RemoteCompilation);
break;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import _VisualDVM.Global;
import Common_old.UI.UI;
import Common_old.UI.Windows.Dialog.Dialog;
@@ -33,7 +34,7 @@ public class CopyProject extends CurrentProjectPass {
public void validateFields() {
Utils.validateFileShortNewName(fields.tfName.getText(), Log);
if (!fields.tfParent.getText().isEmpty()) {
if (Utils.ContainsCyrillic(fields.tfParent.getText()))
if (CommonUtils.ContainsCyrillic(fields.tfParent.getText()))
Log.Writeln_("Путь к целевой папке не может содержать кириллицу!");
} else Log.Writeln_("Путь к целевой папке не может быть пустым!");
if (Log.isEmpty()) {

View File

@@ -1,9 +1,9 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.UI.Windows.Dialog.Text.FileNameForm;
import Common_old.Utils.Utils;
import Visual_DVM_2021.Passes.ChangeFilePass;
import Visual_DVM_2021.Passes.PassException;
@@ -22,11 +22,11 @@ public class CreateEmptyDirectory extends ChangeFilePass {
//->
dst = Paths.get(target_dir.getAbsolutePath(), fileName).toFile();
if (dst.exists()) {
Log.Writeln("Файл с именем " + Utils.Brackets(fileName) + " уже существует");
Log.Writeln("Файл с именем " + CommonUtils.Brackets(fileName) + " уже существует");
return false;
}
if (fileName.equalsIgnoreCase(Constants.data)) {
Log.Writeln(Utils.Brackets(Constants.data) + " является зарезервированным именем!");
Log.Writeln(CommonUtils.Brackets(Constants.data) + " является зарезервированным именем!");
return false;
}
return true;

View File

@@ -1,8 +1,8 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import _VisualDVM.Global;
import Common_old.UI.Windows.Dialog.Text.FileNameForm;
import Common_old.Utils.Utils;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.PassException;
import Visual_DVM_2021.Passes.Pass_2021;
@@ -28,7 +28,7 @@ public class CreateEmptyProject extends Pass_2021<File> {
project_name = ff.Result;
target = Paths.get(Global.visualiser.getWorkspace().getAbsolutePath(), project_name).toFile();
if (target.exists())
Log.Writeln("Файл\n" + Utils.Brackets(target.getAbsolutePath()) + "\nуже существует");
Log.Writeln("Файл\n" + CommonUtils.Brackets(target.getAbsolutePath()) + "\nуже существует");
return Log.isEmpty();
}
return false;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import Common_old.Utils.Files.VDirectoryChooser;
@@ -34,15 +35,15 @@ public class CreateGroupFromDirectory extends PublishTests {
}
//---------------
if (!dir.isDirectory()) {
Log.Writeln_(Utils.Brackets(dir) + "\е является папкой!");
Log.Writeln_(CommonUtils.Brackets(dir) + "\е является папкой!");
return false;
}
if (dir.getName().equals(Constants.data)) {
Log.Writeln_(Utils.Brackets(dir) + "\nявляется служебной папкой визуализатора!");
Log.Writeln_(CommonUtils.Brackets(dir) + "\nявляется служебной папкой визуализатора!");
return false;
}
if (!Utils.validateProjectFile(dir, Log)) {
Log.Writeln_("Имя папки " + Utils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
return false;
}
//--

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import Common_old.Utils.Files.VFileChooser;
@@ -34,11 +35,11 @@ public class CreateGroupFromFiles extends PublishTests{
Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, dir);
//---------------
if (dir.getName().equals(Constants.data)) {
Log.Writeln_(Utils.Brackets(dir) + "\nявляется служебной папкой визуализатора!");
Log.Writeln_(CommonUtils.Brackets(dir) + "\nявляется служебной папкой визуализатора!");
return false;
}
if (!Utils.validateProjectFile(dir, Log)) {
Log.Writeln_("Имя папки " + Utils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
return false;
}
if (passes.get(PassCode_2021.PublishGroup).Do(dir.getName().toUpperCase())) {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import Common_old.Utils.Files.VDirectoryChooser;
@@ -89,17 +90,17 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
int other_project_files = 0;
//---
if (dir.getName().equalsIgnoreCase(Constants.data)) {
Log.Writeln_("Папка " + Utils.Brackets(dir) + " является служебной папкой визуализатора.");
Log.Writeln_("Папка " + CommonUtils.Brackets(dir) + " является служебной папкой визуализатора.");
return false;
}
//--
if (Utils.ContainsCyrillic(dir.getName()) || Utils.ContainsForbiddenName(dir.getName())) {
Log.Writeln_("Имя папки " + Utils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
if (CommonUtils.ContainsCyrillic(dir.getName()) || Utils.ContainsForbiddenName(dir.getName())) {
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
return false;
}
//--
if (files == null) {
Log.Writeln_("Не удалось получить список файлов для папки " + Utils.Brackets(dir) + ".");
Log.Writeln_("Не удалось получить список файлов для папки " + CommonUtils.Brackets(dir) + ".");
return false;
}
//---
@@ -113,7 +114,7 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
!Utils.isVersion(file)) {
subdirs++;
}
} else if (file.isFile() && !Utils.ContainsCyrillic(file.getName()) && !Utils.ContainsForbiddenName(file.getName())) {
} else if (file.isFile() && !CommonUtils.ContainsCyrillic(file.getName()) && !Utils.ContainsForbiddenName(file.getName())) {
//если файл. все недопустимые файлы просто игнорируются.
ProjectFile projectFile = new ProjectFile(file);
if (isNotExcluded(projectFile)) {
@@ -142,7 +143,7 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
}
//--
if (subdirs > 0) {
Log.Writeln_("Папка " + Utils.Brackets(dir) + " содержит вложенные подпапки,\n" +
Log.Writeln_("Папка " + CommonUtils.Brackets(dir) + " содержит вложенные подпапки,\n" +
"не являющиеся версиями или данными визуализатора");
return false;
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import Common_old.Utils.Utils;
@@ -36,14 +37,14 @@ public class CreateTestFromFile extends Pass_2021<Test> {
File file_in = (File) args[0];
group = (Group) args[1];
//--
if (Utils.ContainsCyrillic(file_in.getName()) || Utils.ContainsForbiddenName(file_in.getName())) {
Log.Writeln_("Имя файла " + Utils.Brackets(file_in.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
if (CommonUtils.ContainsCyrillic(file_in.getName()) || Utils.ContainsForbiddenName(file_in.getName())) {
Log.Writeln_("Имя файла " + CommonUtils.Brackets(file_in.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
return false;
}
//--
projectFile = new ProjectFile(file_in);
if (!projectFile.fileType.equals(FileType.program) || !projectFile.languageName.equals(group.language)) {
Log.Writeln_("Не удалось распознать файл " +Utils.Brackets(file_in.getName()) +
Log.Writeln_("Не удалось распознать файл " + CommonUtils.Brackets(file_in.getName()) +
" как программу на языке " + group.language.getDescription());
return false;
}
@@ -52,7 +53,7 @@ public class CreateTestFromFile extends Pass_2021<Test> {
target.sender_address = Current.getAccount().email;
target.sender_name = Current.getAccount().name;
target.group_id = group.id;
target.description = Utils.getNameWithoutExtension(file_in.getName());
target.description = CommonUtils.getNameWithoutExtension(file_in.getName());
target.files = file_in.getName();
return true;
}

View File

@@ -1,7 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import ProjectData.Project.db_project_info;
import TestingSystem.Common.Test.Test;
import Visual_DVM_2021.Passes.PassCode_2021;
@@ -45,7 +45,7 @@ public class CreateTestsGroupFromSelectedVersions extends PublishTests {
return false;
}
//---
return UI.Question("В группу " + Utils.Brackets(group.description) +
return UI.Question("В группу " + CommonUtils.Brackets(group.description) +
"\nбудет добавлено " + target.size() + " тестов.\родолжить");
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.Menus_2023.PassMenuItem;
@@ -47,10 +48,10 @@ public class DVMConvertProject extends ComponentsRepositoryPass<db_project_info>
return false;
}
for (DBProjectFile program : programsToConvert) {
if (Utils.getFileSizeMegaBytes(program.file) > 1) {
Log.Writeln_("Размер файла кода " + Utils.Brackets(program.name) + " превышает 1 Мб.");
if (CommonUtils.getFileSizeMegaBytes(program.file) > 1) {
Log.Writeln_("Размер файла кода " + CommonUtils.Brackets(program.name) + " превышает 1 Мб.");
return false;
} else programsNames.add(Utils.toU(program.name));
} else programsNames.add(CommonUtils.toU(program.name));
}
workspace = Utils.getTempFileName("convertation");
FileUtils.forceMkdir(workspace);
@@ -63,7 +64,7 @@ public class DVMConvertProject extends ComponentsRepositoryPass<db_project_info>
return false;
}
;
if (Utils.getFileSizeMegaBytes(archive) > 500) {
if (CommonUtils.getFileSizeMegaBytes(archive) > 500) {
Log.Writeln_("Размер архива проекта превышает 500 МБ");
return false;
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
@@ -25,7 +26,7 @@ public class DeleteDirectory extends ChangeFilePass {
Log.Writeln("Нельзя удалять домашнюю папку проекта.");
return false;
}
return (UI.Warning("Удалить папку\n" + Utils.Brackets(target_dir.getAbsolutePath())
return (UI.Warning("Удалить папку\n" + CommonUtils.Brackets(target_dir.getAbsolutePath())
+ "\n и всё её содержимое."));
} else Log.Writeln_("Папка не выделена.");
return false;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
@@ -15,7 +16,7 @@ public class DeleteFile extends ChangeFilePass<DBProjectFile> {
resetArgs();
return (Current.Check(Log, Current.SelectedFile)) &&
UI.Warning("Удалить файл "
+ Utils.Brackets((target = Current.getSelectedFile()).name));
+ CommonUtils.Brackets((target = Current.getSelectedFile()).name));
}
@Override
protected void performPreparation() throws Exception {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
@@ -22,7 +23,7 @@ public class DeleteVersion extends Pass_2021<db_project_info> {
if (((target = Current.getVersion()) != null) && (!Current.hasUI() ||
UI.Warning("Удалить " +
((Current.HasProject() && target.Home.equals(Current.getProject().Home)) ? "текущий проект" : "версию ")
+ Utils.Brackets(target.name)))) {
+ CommonUtils.Brackets(target.name)))) {
current = true;
return true;
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -26,8 +27,8 @@ public class DownloadProject extends CurrentConnectionPass {
if ((user.connection.getFileKBSize(src.full_name)) <= maxSize) {
ShowMessage2("Запаковка папки проекта..");
user.connection.Command(
"cd " + Utils.DQuotes(src.full_name),
"zip -r " + Utils.DQuotes(remote_archive.full_name) + " ./"
"cd " + CommonUtils.DQuotes(src.full_name),
"zip -r " + CommonUtils.DQuotes(remote_archive.full_name) + " ./"
);
// try {
ShowMessage2("Загрузка проекта..");
@@ -52,7 +53,7 @@ public class DownloadProject extends CurrentConnectionPass {
File project = Paths.get(Global.visualiser.getWorkspace().getAbsolutePath(),
Utils.getDateName(src.name)).toFile();
if (passes.get(PassCode_2021.UnzipFolderPass).Do(local_archive.getAbsolutePath(), project.getAbsolutePath())) {
if (UI.Question("Проект " + Utils.Brackets(src.name) + " успешно загружен. Открыть его"))
if (UI.Question("Проект " + CommonUtils.Brackets(src.name) + " успешно загружен. Открыть его"))
passes.get(PassCode_2021.OpenCurrentProject).Do(project);
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -49,7 +50,7 @@ public class DownloadTest extends TestingSystemPass<Test> {
Global.visualiser.getWorkspace().getAbsolutePath(), false
))
if (UI.Question("Тестовый проект успешно загружен под именем\n" +
Utils.Brackets(target.getHomePath().getName()) +
CommonUtils.Brackets(target.getHomePath().getName()) +
"\nОткрыть его"))
passes.get(PassCode_2021.OpenCurrentProject).Do(target.getHomePath());
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -33,7 +34,7 @@ public class EditAccount extends Email {
Vector<String> rec = new Vector<>();
rec.add(email);
password = String.valueOf(getRandomIntegerBetweenRange(1111, 9999));
return super.canStart(new EmailMessage("Код подтверждения визуализатора для: " + Utils.Brackets(name), password, rec));
return super.canStart(new EmailMessage("Код подтверждения визуализатора для: " + CommonUtils.Brackets(name), password, rec));
}
return false;
}

View File

@@ -1,6 +1,6 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
import ProjectData.Files.DBProjectFile;
import Visual_DVM_2021.Passes.Transformation;
import org.apache.commons.io.FileUtils;
@@ -14,10 +14,10 @@ public class EraseBadSymbols extends Transformation {
String file_text = FileUtils.readFileToString(file.file);
StringBuilder res_text = new StringBuilder();
for (char c : file_text.toCharArray()) {
if (Utils.isEnglishLetter(c) || Character.isDigit(c) || Utils.isSign(c)) {
if (CommonUtils.isEnglishLetter(c) || Character.isDigit(c) || CommonUtils.isSign(c)) {
res_text.append(c);
} else if (Utils.isRussianLetter(c))
res_text.append(Utils.Translit(c));
} else if (CommonUtils.isRussianLetter(c))
res_text.append(CommonUtils.Translit(c));
else res_text.append(' ');
}
File dst = Paths.get(target.last_version.Home.getAbsolutePath(), Global.isWindows ? file.name : file.name.replace('\\', '/')).toFile();

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import _VisualDVM.Global;
@@ -249,7 +250,7 @@ public class ExportDVMPackageToExcel extends Pass_2021<Vector<DVMPackage>> {
return res;
}
String formatMatrix(String matrix) {
return Utils.DQuotes(matrix.trim());
return CommonUtils.DQuotes(matrix.trim());
}
void createStyles() {
styles = new Vector<>();
@@ -396,7 +397,7 @@ public class ExportDVMPackageToExcel extends Pass_2021<Vector<DVMPackage>> {
protected void performDone() throws Exception {
super.performDone();
if (Desktop.isDesktopSupported()) {
if (UI.Question("Таблица сформирована в файле\n" + Utils.DQuotes(res.getAbsolutePath()) + ".\nОткрыть её"
if (UI.Question("Таблица сформирована в файле\n" + CommonUtils.DQuotes(res.getAbsolutePath()) + ".\nОткрыть её"
)) {
Desktop.getDesktop().open(res);
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
@@ -82,10 +83,10 @@ public class GCOV extends Precompilation {
Utils.forceDeleteWithCheck(gcov);
name_to_kill = "gcov.exe";
StartProcess("gcov -b " +
Utils.DQuotes(
CommonUtils.DQuotes(
Paths.get(workspace.getAbsolutePath(), uname))
+ " -o " +
Utils.DQuotes(
CommonUtils.DQuotes(
Paths.get(workspace.getAbsolutePath(), gcno)
), 40);
if (gcov.exists()) {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
@@ -36,12 +37,12 @@ public class LocalInitaliseUser extends ProcessPass<User> {
//-
PerformScript(
String.join("\n",
"cd " + Utils.DQuotes(target.getLocalModulesDir()),
"cd " + CommonUtils.DQuotes(target.getLocalModulesDir()),
"g++ starter -o starter",
"chmod 0777 starter"
));
PerformScript(String.join("\n",
"cd " + Utils.DQuotes(target.getLocalModulesDir()),
"cd " + CommonUtils.DQuotes(target.getLocalModulesDir()),
"g++ launcher.cpp -o launcher",
"chmod 0777 launcher"
));

View File

@@ -1,7 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
import Repository.BugReport.BugReport;
import Repository.BugReport.BugReportInterface;
import Visual_DVM_2021.Passes.PassCode_2021;
@@ -29,8 +29,8 @@ public class OpenBugReportTestProject extends Pass_2021<BugReport> {
root = Paths.get(Global.visualiser.getWorkspace().getAbsolutePath(),
target.id).toFile();
project = Paths.get(root.getAbsolutePath(),
Global.isWindows ? Utils.toW(target.project_version)
: Utils.toU(target.project_version)).toFile();
Global.isWindows ? CommonUtils.toW(target.project_version)
: CommonUtils.toU(target.project_version)).toFile();
return true;
}else {
Log.Writeln_("Отчёт об ошибке не содержит прикреплённого проекта!");

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import _VisualDVM.Global;
@@ -53,18 +54,18 @@ public class OpenCurrentProject extends Pass_2021<db_project_info> {
mode = Mode.ProjectInfo;
target = (db_project_info) arg;
dir = target.Home;
Global.Log.Print(DebugPrintLevel.Project, "готовая версия " + Utils.Brackets(dir.getAbsolutePath()));
Global.Log.Print(DebugPrintLevel.Project, "готовая версия " + CommonUtils.Brackets(dir.getAbsolutePath()));
return needsOpen();
}
}
if ((dir != null) && needsOpen()) {
Global.Log.Print(DebugPrintLevel.Project, Utils.Brackets(dir.toString()));
Global.Log.Print(DebugPrintLevel.Project, CommonUtils.Brackets(dir.toString()));
if (!dir.isDirectory()) {
Log.Writeln_(Utils.Brackets(dir) + "\е является папкой!");
Log.Writeln_(CommonUtils.Brackets(dir) + "\е является папкой!");
return false;
}
if (dir.getName().equals(Constants.data)) {
Log.Writeln_(Utils.Brackets(dir) + "\nявляется служебной папкой визуализатора!");
Log.Writeln_(CommonUtils.Brackets(dir) + "\nявляется служебной папкой визуализатора!");
return false;
}
return Utils.validateProjectFolder(dir, Log) && Utils.containsSource(dir, true);

View File

@@ -1,5 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common_old.Constants;
import Common.CommonConstants;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.Windows.Dialog.Dialog;
@@ -29,7 +29,7 @@ public class PickCompilerEnvironments extends Pass_2021<String> {
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.RunConfiguration)) {
RunConfiguration configuration = Current.getRunConfiguration();
if (configuration.compiler_id == Constants.Nan) {
if (configuration.compiler_id == CommonConstants.Nan) {
Log.Writeln_("Отсутвует DVM компилятор, связанный с текущей конфигурацией запуска.\n" +
"Если конфигурация содержит вызов DVM компилятора, но была создана на версии 801 и ниже,\n" +
"войдите в окно её редактирования,нажмите ОК, а затем повторите попытку.");

View File

@@ -1,7 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.Windows.Dialog.Dialog;
import Common_old.Utils.Utils;
import GlobalData.Compiler.Compiler;
import GlobalData.Compiler.CompilerType;
import GlobalData.CompilerEnvironment.CompilerEnvironment;
@@ -54,7 +54,7 @@ public class PickCompilerEnvironmentsForTesting extends Pass_2021<String> {
Vector<String> envs = new Vector<>();
for (CompilerEnvironment compilerEnv : compiler.environments.Data.values()) {
if (compilerEnv.isSelected())
envs.add(compilerEnv.name + "=" + Utils.DQuotes(compilerEnv.value));
envs.add(compilerEnv.name + "=" + CommonUtils.DQuotes(compilerEnv.value));
}
target = String.join(" ", envs);
}

View File

@@ -1,4 +1,6 @@
package Visual_DVM_2021.Passes.All;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import _VisualDVM.Global;
@@ -89,7 +91,7 @@ public class Precompilation extends Pass_2021<db_project_info> {
prepareForParse(); //---->
//-
performanceTime = 0;
exitCode = Constants.Nan;
exitCode = CommonConstants.Nan;
//------------------
workspace = Paths.get(Global.TempDirectory.getAbsolutePath(), Utils.getDateName("precompilation")).toFile();
FileUtils.forceMkdir(workspace);
@@ -138,8 +140,8 @@ public class Precompilation extends Pass_2021<db_project_info> {
protected static void unpackPrecompilationMessages(db_project_info target, String text) throws Exception {
boolean messageStarted = false;
String messageFile = "";
int messageLine = Constants.Nan;
int messageType = Constants.Nan;
int messageLine = CommonConstants.Nan;
int messageType = CommonConstants.Nan;
Vector<String> messageText = new Vector<>();
String[] nw = text.split("\n");
for (String S : nw) {
@@ -155,7 +157,7 @@ public class Precompilation extends Pass_2021<db_project_info> {
messageText.add(S.substring(6));
messageType = 2;
}
if (messageType != Constants.Nan) {
if (messageType != CommonConstants.Nan) {
target.db.files.Data.get(messageFile).CreateAndAddNewMessage(messageType, String.join("\n", messageText), messageLine, Constants.compiler_group);
messageStarted = false;
} else {
@@ -165,12 +167,12 @@ public class Precompilation extends Pass_2021<db_project_info> {
} else {
//анализ начала строки.
for (String name : target.db.files.Data.keySet()) {
if (S.startsWith(Utils.toU(name))) {
if (S.startsWith(CommonUtils.toU(name))) {
String[] data = S.split(":");
if (data.length > 1) {
messageFile = name;
messageLine = Integer.parseInt(data[1]);
messageType = Constants.Nan;
messageType = CommonConstants.Nan;
messageText = new Vector<>();
messageStarted = true;
}
@@ -184,7 +186,7 @@ public class Precompilation extends Pass_2021<db_project_info> {
protected void body() throws Exception {
if (Global.isWindows) {
name_to_kill = "make.exe";
StartProcess(Utils.DQuotes(Global.db.settings.get(SettingName.LocalMakePathWindows).Value) + " -j " + Global.db.settings.get(SettingName.Kernels).toString(),
StartProcess(CommonUtils.DQuotes(Global.db.settings.get(SettingName.LocalMakePathWindows).Value) + " -j " + Global.db.settings.get(SettingName.Kernels).toString(),
target.compilation_maxtime);
} else
StartProcess("make -j " + Global.db.settings.get(SettingName.Kernels).toString(), target.compilation_maxtime);
@@ -221,7 +223,7 @@ public class Precompilation extends Pass_2021<db_project_info> {
protected void performFinish() throws Exception {
for (DBProjectFile file : target.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);
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
import ProjectData.Files.DBProjectFile;
@@ -45,7 +46,7 @@ public class PrepareForModulesAssembly extends Transformation {
//--создать
Vector<String> total_lines = new Vector<>();
for (String name : target.files_order) {
total_lines.add(" include " + Utils.Quotes(Utils.toU(name)));
total_lines.add(" include " + CommonUtils.Quotes(CommonUtils.toU(name)));
}
FileUtils.writeLines(total, total_lines, false);
//-------------------------------

View File

@@ -1,8 +1,8 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import Repository.BugReport.BugReport;
import Repository.BugReport.BugReportInterface;
import Repository.BugReport.BugReportState;
@@ -54,7 +54,7 @@ public class PublishBugReport extends Pass_2021<BugReport> {
passes.get(PassCode_2021.SendBugReport).Do();
Global.componentsServer.db.Update(target);
//3- рассылка
EmailMessage message = new EmailMessage("Обнаружена ошибка " + Utils.Brackets(target.id),
EmailMessage message = new EmailMessage("Обнаружена ошибка " + CommonUtils.Brackets(target.id),
BugReportInterface.getNewMailText(target),
BugReportInterface.getRecipients(target));
if (!target.project_version.isEmpty()) {

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -70,9 +71,9 @@ public class PublishComponent extends ComponentsRepositoryPass<Component> {
protected void ServerAction() throws Exception {
String change_description = (f.Result == null) ? "не указаны" : f.Result;
String change_record_header = String.join(" ",
Utils.Brackets(Utils.print_date(new Date())) + ":",
Current.getAccount().name + Utils.RBrackets(Current.getAccount().email),
"публикует версию", Utils.DQuotes(target.version)
CommonUtils.Brackets(Utils.print_date(new Date())) + ":",
Current.getAccount().name + CommonUtils.RBrackets(Current.getAccount().email),
"публикует версию", CommonUtils.DQuotes(target.version)
);
String change_record = String.join("\n", change_record_header, "Изменения:",
change_description,
@@ -102,9 +103,9 @@ public class PublishComponent extends ComponentsRepositoryPass<Component> {
if ((f.Result != null)) {
version_mail_header = String.join(" ",
"Опубликована версия",
Utils.DQuotes(target.version),
CommonUtils.DQuotes(target.version),
"компонента",
Utils.DQuotes(target.getComponentType().getDescription()));
CommonUtils.DQuotes(target.getComponentType().getDescription()));
EmailMessage message =
new EmailMessage(version_mail_header,
f.Result,

View File

@@ -1,6 +1,6 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import TestingSystem.Common.Group.Group;
@@ -66,7 +66,7 @@ public abstract class PublishTests extends TestingSystemPass<Vector<Test>> {
return false;
}
//---
return UI.Question("В группу " + Utils.Brackets(group.description) +
return UI.Question("В группу " + CommonUtils.Brackets(group.description) +
"\nбудет добавлено " + target.size() + " тестов.\родолжить");
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Utils.Utils;
import GlobalData.RemoteFile.RemoteFile;
import Visual_DVM_2021.Passes.SSH.CurrentConnectionPass;
@@ -15,7 +16,7 @@ public class RemoteSingleCommand extends CurrentConnectionPass<String> {
@Override
protected void ServerAction() throws Exception {
RemoteFile file = new RemoteFile(user.connection.sftpChannel.getHome(), Utils.getDateName("out"));
user.connection.Command(command + " 1>" + Utils.DQuotes(file.full_name));
user.connection.Command(command + " 1>" + CommonUtils.DQuotes(file.full_name));
if (user.connection.Exists(file)) {
target = user.connection.readFromFile(file);
user.connection.sftpChannel.rm(file.full_name);

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.UI.Windows.Dialog.Text.FileNameForm;
@@ -33,7 +34,7 @@ public class RenameDirectory extends ChangeFilePass {
fileName = ff.Result;
dst = Paths.get(target_dir.getParentFile().getAbsolutePath(), fileName).toFile();
if (dst.exists()) {
Log.Writeln("Файл с именем " + Utils.Brackets(fileName) + " уже существует");
Log.Writeln("Файл с именем " + CommonUtils.Brackets(fileName) + " уже существует");
return false;
}
if (target_dir.equals(project.Home)) {

View File

@@ -1,8 +1,8 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.UI.Windows.Dialog.Text.FileNameForm;
import Common_old.Utils.Utils;
import ProjectData.Files.DBProjectFile;
import ProjectData.Files.FileType;
import Visual_DVM_2021.Passes.ChangeFilePass;
@@ -29,12 +29,12 @@ public class RenameFile extends ChangeFilePass<DBProjectFile> {
//->
dst = Paths.get(target_dir.getAbsolutePath(), fileName).toFile();
if (dst.exists()) {
Log.Writeln_("Файл с именем " + Utils.Brackets(fileName) + " уже существует");
Log.Writeln_("Файл с именем " + CommonUtils.Brackets(fileName) + " уже существует");
return false;
}
target = new DBProjectFile(dst, project);
if (target.fileType == FileType.forbidden)
Log.Writeln_("Расширение " + Utils.Brackets(Utils.getExtension(dst)) + " недопустимо");
Log.Writeln_("Расширение " + CommonUtils.Brackets(CommonUtils.getExtension(dst)) + " недопустимо");
return true;
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import Common_old.UI.UI;
@@ -43,11 +44,11 @@ public class ReplaceTestsFromFiles extends TestingSystemPass<Vector<Test>> {
Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, dir);
//---------------
if (dir.getName().equals(Constants.data)) {
Log.Writeln_(Utils.Brackets(dir) + "\nявляется служебной папкой визуализатора!");
Log.Writeln_(CommonUtils.Brackets(dir) + "\nявляется служебной папкой визуализатора!");
return false;
}
if (!Utils.validateProjectFile(dir, Log)) {
Log.Writeln_("Имя папки " + Utils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
return false;
}
if (files.isEmpty()) {
@@ -58,7 +59,7 @@ public class ReplaceTestsFromFiles extends TestingSystemPass<Vector<Test>> {
LinkedHashMap<String, File> filesByNames = new LinkedHashMap<>(); //выделенные файлы, сортированные по именам.
//--
for (File file : files) {
String name = Utils.getNameWithoutExtension(file.getName()).toLowerCase();
String name = CommonUtils.getNameWithoutExtension(file.getName()).toLowerCase();
if (!filesByNames.containsKey(name)) {
filesByNames.put(name, file);
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -65,7 +66,7 @@ public class Run extends Pass_2021<db_project_info> {
break;
case Undefined:
case MVS_cluster:
throw new PassException("Запуск не реализован для типа машины " + Utils.DQuotes(Current.getMachine().type));
throw new PassException("Запуск не реализован для типа машины " + CommonUtils.DQuotes(Current.getMachine().type));
/*
case MVS_cluster:
subpass = passes.get(PassCode_2021.MVSRun);

View File

@@ -1,6 +1,6 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import ProjectData.Files.DBProjectFile;
import Visual_DVM_2021.Passes.SapforAnalysis;
public class SPF_GetFileLineInfo extends SapforAnalysis {
@@ -27,7 +27,7 @@ public class SPF_GetFileLineInfo extends SapforAnalysis {
for (int i = 0; i < data_.length; ++i) {
String s = data_[i];
if (i % 2 == 0) {
file_ = target.db.files.Data.get(Utils.toW(s));
file_ = target.db.files.Data.get(CommonUtils.toW(s));
} else {
String[] local = s.split("_");
int num = Integer.parseInt(local[0]);

View File

@@ -1,8 +1,8 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
import Common.Utils.Index;
import Common_old.Utils.Utils;
import ProjectData.Files.DBProjectFile;
import ProjectData.SapforData.Functions.FuncCall;
import ProjectData.SapforData.Functions.FuncInfo;
@@ -54,7 +54,7 @@ public class SPF_GetGraphFunctions extends SapforAnalysis {
int numOfFiles = Integer.parseInt(splited[idx.Inc()]);
Vector<String> done_programs = new Vector<>();
for (int i = 0; i < numOfFiles; ++i) {
String fileName = Utils.toW(splited[idx.Inc()]);
String fileName = CommonUtils.toW(splited[idx.Inc()]);
int functions_count = Integer.parseInt(splited[idx.Inc()]);
DBProjectFile file = target.db.files.Data.get(fileName);
if (!done_programs.contains(fileName)) {

View File

@@ -1,8 +1,8 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
import Common.Utils.Index;
import Common_old.Utils.Utils;
import ProjectData.Files.DBProjectFile;
import ProjectData.SapforData.Loops.Loop;
import Visual_DVM_2021.Passes.SapforAnalysis;
@@ -41,7 +41,7 @@ public class SPF_GetGraphLoops extends SapforAnalysis {
Vector<String> done_programs = new Vector<>();
String[] splitedPackedGraph = packed.split("\\|");
for (int i = 0; i < splitedPackedGraph.length; i += 2) {
String name_ = Utils.toW(splitedPackedGraph[i]);
String name_ = CommonUtils.toW(splitedPackedGraph[i]);
String[] packedLoopInfo = splitedPackedGraph[i + 1].split("#");
Index idx = new Index();
int nests_ = Integer.parseInt(packedLoopInfo[idx.Inc()]);

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
@@ -38,7 +39,7 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
FileInfo fileInfo = null;
String[] data_ = packed.split("@");
for (int i = 0; i < data_.length; ++i) {
String s = Utils.toW(data_[i]);
String s = CommonUtils.toW(data_[i]);
if (i % 2 == 0) {
if (target.db.files.Data.containsKey(s)) {
fileInfo = new FileInfo(s);

View File

@@ -1,7 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import _VisualDVM.Global;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import GlobalData.Settings.SettingName;
import ProjectData.SapforData.Functions.FuncCall;
import ProjectData.SapforData.Functions.FuncInfo;
@@ -42,7 +42,7 @@ public class SPF_InlineProcedures extends SapforTransformation {
);
return false;
}
Options = Utils.toU(String.join("|", Result));
Options = CommonUtils.toU(String.join("|", Result));
Global.changeSetting(SettingName.PARSE_FOR_INLINE, "1");
SPF_ParseFilesWithOrder.silent = true;
return passes.get(PassCode_2021.SPF_ParseFilesWithOrder).Do(false);

View File

@@ -1,7 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import _VisualDVM.Global;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import GlobalData.Settings.SettingName;
import ProjectData.SapforData.Functions.FuncCallH;
import Visual_DVM_2021.Passes.PassCode_2021;
@@ -72,7 +72,7 @@ public class SPF_InlineProceduresH extends SapforTransformation {
Result.add(call.isSelected() ? "1" : "0");
}
}
Options = Utils.toU(String.join("|", Result));
Options = CommonUtils.toU(String.join("|", Result));
Global.changeSetting(SettingName.PARSE_FOR_INLINE, "1");
SPF_ParseFilesWithOrder.silent = true;
return passes.get(PassCode_2021.SPF_ParseFilesWithOrder).Do();

View File

@@ -1,7 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.UI.Selectable;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import ProjectData.SapforData.Includes.DependencyInfo;
import ProjectData.SapforData.Includes.FileInfo;
import Visual_DVM_2021.Passes.PassCode_2021;
@@ -35,7 +35,7 @@ public class SPF_InsertIncludesPass extends SapforTransformation {
Log.Writeln_("Не отмечено ни одного заголовка для подстановки");
return false;
}
Options = Utils.toU(String.join("|", Result));
Options = CommonUtils.toU(String.join("|", Result));
return true;
}
return false;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -72,7 +73,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
case HasNotes:
case HasWarnings:
if (f.isActiveProgram())
projLines.add(Utils.toU(f.getDepFile().getAbsolutePath()));
projLines.add(CommonUtils.toU(f.getDepFile().getAbsolutePath()));
goodCount++;
break;
case HasErrors:
@@ -94,7 +95,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
}
if (goodCount == 0) {
Log.Writeln_("Не найдено ни одного успешно проанализированного файла на языке проекта :" +
Utils.DQuotes(target.languageName.getDescription()));
CommonUtils.DQuotes(target.languageName.getDescription()));
return false;
}
return true;
@@ -104,7 +105,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
@Override
protected void unpack(String packed) throws Exception {
for (String fileName_ : packed.split("\\|"))
target.files_order.add(Utils.toW(fileName_));
target.files_order.add(CommonUtils.toW(fileName_));
}
@Override
protected void performPreparation() throws Exception {
@@ -125,7 +126,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
//---------------------------
for (DBProjectFile f : target.db.files.Data.values()) {
if (f.isActiveProgram()) {
projLines.add(Utils.toU(f.file.getAbsolutePath()));
projLines.add(CommonUtils.toU(f.file.getAbsolutePath()));
f.CreateParserOptions();
}
}

View File

@@ -1,6 +1,6 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
import GlobalData.Tasks.RunTask.RunTask;
import Visual_DVM_2021.Passes.SilentSapforPass;
@@ -22,9 +22,9 @@ public class SPF_StatisticAnalyzer extends SilentSapforPass {
code().toString(),
-Global.messagesServer.getPort(),
Global.packSapforSettings(),
Utils.DQuotes(task.getLocalStsFile().getAbsolutePath()) +
CommonUtils.DQuotes(task.getLocalStsFile().getAbsolutePath()) +
" "
+ Utils.DQuotes(target.getStsFile().getAbsolutePath()));
+ CommonUtils.DQuotes(target.getStsFile().getAbsolutePath()));
}
@Override
protected boolean isGoodCode() {

View File

@@ -1,8 +1,8 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import ProjectData.SapforData.Functions.UI.Graph.FunctionsGraphForm;
import Visual_DVM_2021.Passes.PassException;
import Visual_DVM_2021.Passes.Pass_2021;
@@ -42,7 +42,7 @@ public class SaveGraph extends Pass_2021<File> {
protected void body() throws Exception {
target = Paths.get(Global.visualiser.getWorkspace().getAbsolutePath(), "Graph.png").toFile();
if (target.exists() && !target.delete())
throw new PassException("Не удается удалить предыдущий файл " + Utils.Brackets(target.getAbsolutePath()));
throw new PassException("Не удается удалить предыдущий файл " + CommonUtils.Brackets(target.getAbsolutePath()));
//-
mxGraph graph = graphForm.control.getGraph();
BufferedImage image = mxCellRenderer.createBufferedImage(graph,
@@ -63,6 +63,6 @@ public class SaveGraph extends Pass_2021<File> {
}
@Override
protected void showDone() throws Exception {
UI.Info("Граф успешно сохранен в файл: " + Utils.Brackets(target.getAbsolutePath()));
UI.Info("Граф успешно сохранен в файл: " + CommonUtils.Brackets(target.getAbsolutePath()));
}
}

View File

@@ -1,7 +1,7 @@
package Visual_DVM_2021.Passes.All;
import Common.Database.Database;
import Common.Utils.CommonUtils;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
import GlobalData.SapforProfile.SapforProfile;
import Visual_DVM_2021.Passes.AddObjectPass;
@@ -23,7 +23,7 @@ public class SaveProfile extends AddObjectPass<SapforProfile> {
//1. проверить нет ли уже такой последовательности настроек.
SapforProfile profile = Global.db.checkProfileForCurrentSettings();
if (profile != null) {
Log.Writeln_("Текущий набор настроек уже сохранён как профиль " + Utils.Brackets(profile.description));
Log.Writeln_("Текущий набор настроек уже сохранён как профиль " + CommonUtils.Brackets(profile.description));
return false;
}
return super.canStart(args);

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.Windows.Dialog.Text.ReadOnlyMultilineTextForm;
import Common_old.Utils.Utils;
@@ -50,7 +51,7 @@ public class ShowComponentChangesLog extends ComponentsRepositoryPass<Component>
for (int i = lines.size() - 1; i >= 0; i--)
res.add(lines.get(i));
ff.ShowDialog("Журнал изменений компонента " +
Utils.Brackets(target.getComponentType().getDescription()),
CommonUtils.Brackets(target.getComponentType().getDescription()),
String.join("\n", res)
);
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
@@ -120,7 +121,7 @@ public class UpdateBugReportField extends ComponentsRepositoryPass<BugReport> {
message_header += target.executor + " назначается исполнителем";
break;
case "state":
message_header += "состояние изменилось на " + Utils.Brackets(target.state.getDescription());
message_header += "состояние изменилось на " + CommonUtils.Brackets(target.state.getDescription());
break;
}
passes.get(PassCode_2021.Email).Do(

View File

@@ -1,5 +1,5 @@
package Visual_DVM_2021.Passes;
import Common_old.Constants;
import Common.CommonConstants;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
import TestingSystem.Common.TestingPackage.TestingPackage;
@@ -35,7 +35,7 @@ public abstract class DeleteTestingPackages<P extends TestingPackage> extends De
if (super.canStart(args) && checkActivity()) {
for (Object key : target) {
int id = (int) key;
if (id == Constants.Nan) {
if (id == CommonConstants.Nan) {
delete_draft = true;
} else {
target_.add(id);
@@ -57,7 +57,7 @@ public abstract class DeleteTestingPackages<P extends TestingPackage> extends De
}
void DeleteDraftOnly() throws Exception {
showPreparation();
getDb().tables.get(d).Data.remove(Constants.Nan);
getDb().tables.get(d).Data.remove(CommonConstants.Nan);
getDb().tables.get(d).ShowUI();
}
@Override

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.Passes;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.DebugPrintLevel;
@@ -269,7 +270,7 @@ public class Pass_2021<T> {
return false;
}
public void Interrupt() throws Exception {
UI.Info("Проход " + Utils.Brackets(getDescription()) + " не разрешено прерывать.");
UI.Info("Проход " + CommonUtils.Brackets(getDescription()) + " не разрешено прерывать.");
}
public boolean needsConfirmations() {
return false;
@@ -382,11 +383,11 @@ public class Pass_2021<T> {
Global.Log.Print(DebugPrintLevel.Passes,
getDescription() +
" окончен за " + timer.Print() +
" состояние " + Utils.Brackets(state.getDescription())
" состояние " + CommonUtils.Brackets(state.getDescription())
);
if (!Log.isEmpty() && Current.hasUI())
UI.Error(
"проход " + Utils.Brackets(getDescription()) + "\n" + state.getDescription() + "\n\n" +
"проход " + CommonUtils.Brackets(getDescription()) + "\n" + state.getDescription() + "\n\n" +
Log.toString());
}
//------------------------------->
@@ -407,17 +408,17 @@ public class Pass_2021<T> {
form.fields.ProgressBar.setValue((data.length > 1) ? Integer.parseInt(data[1]) : 0);
break;
}
} else System.out.println(Utils.Brackets(message));
} else System.out.println(CommonUtils.Brackets(message));
}
public void ShowMessage1(String message) {
if (form != null)
form.fields.Label1.setText((message.length() > 1) ? message : "");
else System.out.println(Utils.Brackets(message));
else System.out.println(CommonUtils.Brackets(message));
}
public void ShowMessage2(String message) {
if (form != null)
form.fields.Label2.setText((message.isEmpty() ? "" : message));
else System.out.println(Utils.Brackets(message));
else System.out.println(CommonUtils.Brackets(message));
}
public void ShowProgress(int total, int current, boolean auto) {
if (form != null) {

View File

@@ -1,5 +1,5 @@
package Visual_DVM_2021.Passes;
import Common_old.Constants;
import Common.CommonConstants;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
@@ -11,13 +11,13 @@ import java.util.LinkedHashMap;
import java.util.Vector;
public abstract class ProcessPass<T> extends Pass_2021<T> {
public Process process = null;
public int exit_code = Constants.Nan;
public int exit_code = CommonConstants.Nan;
public LinkedHashMap<String, String> envs = new LinkedHashMap<>();
public Vector<String> output = new Vector<>();
protected String process_path = "";
public void CreateProcess(String exec_path_in, File workspace, String ... command) throws Exception {
output.clear();
exit_code = Constants.Nan;
exit_code = CommonConstants.Nan;
process_path = exec_path_in;
ProcessBuilder procBuilder = new ProcessBuilder(process_path);
//-

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.UI.Interface;
import Common.Utils.CommonUtils;
import Common_old.Current;
import Common_old.UI.DebugPrintLevel;
import Common_old.UI.UI;
@@ -25,7 +26,7 @@ public interface Loggable {
default void Print(String message) {
try {
FileWriter Log = new FileWriter(getLogFile(), true);
String datedMessage = Utils.Brackets(new Date()) + " " + message;
String datedMessage = CommonUtils.Brackets(new Date()) + " " + message;
Log.write(datedMessage + "\n");
Log.close();
} catch (Exception ignored) {
@@ -33,7 +34,7 @@ public interface Loggable {
}
default void Print(DebugPrintLevel level, String message) {
if (level.isEnabled())
Print(Utils.Brackets(level.getDescription()) + " " + message);
Print(CommonUtils.Brackets(level.getDescription()) + " " + message);
}
default void PrintException(Exception ex) {
StringWriter out = new StringWriter();
@@ -43,6 +44,6 @@ public interface Loggable {
Print(out.toString());
if (Current.hasUI())
UI.Error("Возникло исключение. Подробности в файле журнала\n" +
Utils.Brackets(getLogFile().getAbsolutePath()));
CommonUtils.Brackets(getLogFile().getAbsolutePath()));
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.UI.Main;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.Editor.BaseEditor;
@@ -6,7 +7,6 @@ import Common_old.UI.Editor.Viewer;
import Common_old.UI.Menus_2023.VisualiserMenuBar;
import Common_old.UI.TextField.StyledTextField;
import Common_old.UI.UI;
import Common_old.Utils.Utils;
import GlobalData.Settings.SettingName;
import Repository.BugReport.BugReport;
import Repository.BugReport.BugReportInterface;
@@ -434,9 +434,9 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
}
@Override
public void ShowAccount() {
lAccountName.setText(Utils.Brackets(Current.getAccount().name));
lAccountMail.setText(Utils.Brackets(Current.getAccount().email));
lAccountRole.setText(Utils.Brackets(Current.getAccount().role.getDescription()));
lAccountName.setText(CommonUtils.Brackets(Current.getAccount().name));
lAccountMail.setText(CommonUtils.Brackets(Current.getAccount().email));
lAccountRole.setText(CommonUtils.Brackets(Current.getAccount().role.getDescription()));
switch (Current.getAccount().role) {
case Undefined:
/// UI.Clear(accountPanel);

View File

@@ -1,5 +1,5 @@
package Visual_DVM_2021.UI.Main;
import Common_old.Constants;
import Common.CommonConstants;
import Common_old.Current;
import Common.Database.Objects.DBObject;
import _VisualDVM.Global;
@@ -105,7 +105,7 @@ public abstract class ComparisonForm<T> {
//предполагаем что оба объекта есть и мы можем получить с них текст.
protected void Compare() throws Exception {
events_on = false;
current_diff_line = Constants.Nan;
current_diff_line = CommonConstants.Nan;
colors.clear();
//-----------------------------------------------------------------------------------------------
Body.setText("");
@@ -169,7 +169,7 @@ public abstract class ComparisonForm<T> {
}
public void Show() throws Exception {
events_on = false;
current_diff_line = Constants.Nan;
current_diff_line = CommonConstants.Nan;
colors.clear();
//----------------------------------------------------------------------------------------------
Body.setText("");
@@ -259,7 +259,7 @@ public abstract class ComparisonForm<T> {
//</editor-fold>
slave.master = this;
bPrevious.addActionListener(e -> {
if (current_diff_line != Constants.Nan) {
if (current_diff_line != CommonConstants.Nan) {
if (current_diff_line > 0)
current_diff_line--;
else
@@ -268,7 +268,7 @@ public abstract class ComparisonForm<T> {
}
});
bNext.addActionListener(e -> {
if (current_diff_line != Constants.Nan) {
if (current_diff_line != CommonConstants.Nan) {
if (current_diff_line < colors.size() - 1)
current_diff_line++;
else

View File

@@ -1,5 +1,5 @@
package Visual_DVM_2021.UI.Main;
import Common_old.Constants;
import Common.CommonConstants;
import _VisualDVM.Global;
import Common_old.UI.Editor.Viewer;
import Common_old.UI.Menus_2023.FileMenuBar.FileMenuBar;
@@ -29,7 +29,7 @@ public class FileForm implements FileWindow, FormWithSplitters {
//контролы в столбцах
//https://stackoverflow.com/questions/7137786/how-can-i-put-a-control-in-the-jtableheader-of-a-jtable
//todo _ временно
public static int current_file_line = Constants.Nan;
public static int current_file_line = CommonConstants.Nan;
private final Viewer compilationOutput;
private final Viewer runOutput;
private final Viewer gcovLog;

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.UI.Main;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common_old.Current;
import _VisualDVM.Global;
@@ -82,8 +83,8 @@ public class SapforVersionsComparisonForm extends ComparisonForm<SapforVersion_j
if (isReady()) {
if (getMaster().isReady()) {
boolean ExtensionsOn = Global.db.settings.get(SettingName.ExtensionsOn).toBoolean();
String name1 = ExtensionsOn ? getMaster().file.file.getName() : Utils.getFileNameWithoutExtension(getMaster().file.file);
String name2 = ExtensionsOn ? file.file.getName() : Utils.getFileNameWithoutExtension(file.file);
String name1 = ExtensionsOn ? getMaster().file.file.getName() : CommonUtils.getFileNameWithoutExtension(getMaster().file.file);
String name2 = ExtensionsOn ? file.file.getName() : CommonUtils.getFileNameWithoutExtension(file.file);
if (Global.db.settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
if (name1.equalsIgnoreCase(name2))
master.DoComparePass(true);
@@ -112,7 +113,7 @@ public class SapforVersionsComparisonForm extends ComparisonForm<SapforVersion_j
@Override
protected void showObject() {
lObjectName.setText(object.toString());
lObjectName.setToolTipText(object.Home.getName() + " : " + Utils.Brackets(object.description));
lObjectName.setToolTipText(object.Home.getName() + " : " + CommonUtils.Brackets(object.description));
cbFile.removeAllItems();
for (ProjectFile file : object.files.values())
cbFile.addItem(file);
@@ -161,8 +162,8 @@ public class SapforVersionsComparisonForm extends ComparisonForm<SapforVersion_j
return true;
}
} else {
if (Utils.getNameWithoutExtension(projectFile.file.getName()).equals(
Utils.getNameWithoutExtension(file_name))) {
if (CommonUtils.getNameWithoutExtension(projectFile.file.getName()).equals(
CommonUtils.getNameWithoutExtension(file_name))) {
cbFile.setSelectedIndex(i);
return true;
}

View File

@@ -1,5 +1,5 @@
package Visual_DVM_2021.UI.Main;
import Common_old.Constants;
import Common.CommonConstants;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.TextField.StyledTextField;
@@ -268,42 +268,42 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
}
public void RestoreLastCredentials() {
Credentials credentials = (Credentials) Current.get(Current.Credentials);
if (credentials.machine_id != Constants.Nan) {
if (credentials.machine_id != CommonConstants.Nan) {
if (Global.db.machines.containsKey(credentials.machine_id)) {
Global.db.machines.ShowUI(credentials.machine_id);
if (Global.db.users.containsKey(credentials.user_id)) {
Global.db.users.ShowUI(credentials.user_id);
} else {
credentials.user_id = Constants.Nan;
credentials.user_id = CommonConstants.Nan;
Global.db.UpdateCredentials();
}
if (Global.db.compilers.containsKey(credentials.compiler_id)) {
Global.db.compilers.ShowUI(credentials.compiler_id);
} else {
credentials.compiler_id = Constants.Nan;
credentials.compiler_id = CommonConstants.Nan;
Global.db.UpdateCredentials();
}
//-
if (Global.db.makefiles.containsKey(credentials.makefile_id)) {
Global.db.makefiles.ShowUI(credentials.makefile_id);
} else {
credentials.makefile_id = Constants.Nan;
credentials.makefile_id = CommonConstants.Nan;
Global.db.UpdateCredentials();
}
//-
if (Global.db.runConfigurations.containsKey(credentials.runconfiguration_id)) {
Global.db.runConfigurations.ShowUI(credentials.runconfiguration_id);
} else {
credentials.runconfiguration_id = Constants.Nan;
credentials.runconfiguration_id = CommonConstants.Nan;
Global.db.UpdateCredentials();
}
} else {
credentials.machine_id = Constants.Nan;
credentials.user_id = Constants.Nan;
credentials.compiler_id = Constants.Nan;
credentials.remotesapfor_id = Constants.Nan;
credentials.makefile_id = Constants.Nan;
credentials.runconfiguration_id = Constants.Nan;
credentials.machine_id = CommonConstants.Nan;
credentials.user_id = CommonConstants.Nan;
credentials.compiler_id = CommonConstants.Nan;
credentials.remotesapfor_id = CommonConstants.Nan;
credentials.makefile_id = CommonConstants.Nan;
credentials.runconfiguration_id = CommonConstants.Nan;
Global.db.UpdateCredentials();
}
}

View File

@@ -1,4 +1,5 @@
package Visual_DVM_2021.UI.Main;
import Common.Utils.CommonUtils;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
@@ -35,8 +36,8 @@ public class VersionsComparisonForm extends ComparisonForm<db_project_info> {
if (isReady()) {
if (getMaster().isReady()) {
boolean ExtensionsOn = Global.db.settings.get(SettingName.ExtensionsOn).toBoolean();
String name1 = ExtensionsOn ? getMaster().file.file.getName() : Utils.getFileNameWithoutExtension(getMaster().file.file);
String name2 = ExtensionsOn ? file.file.getName() : Utils.getFileNameWithoutExtension(file.file);
String name1 = ExtensionsOn ? getMaster().file.file.getName() : CommonUtils.getFileNameWithoutExtension(getMaster().file.file);
String name2 = ExtensionsOn ? file.file.getName() : CommonUtils.getFileNameWithoutExtension(file.file);
if (Global.db.settings.get(SettingName.ComparsionDiffMergeOn).toBoolean()) {
if (name1.equalsIgnoreCase(name2))
master.DoComparePass(true);
@@ -89,8 +90,8 @@ public class VersionsComparisonForm extends ComparisonForm<db_project_info> {
return true;
}
} else {
if (Utils.getNameWithoutExtension(projectFile.file.getName()).equals(
Utils.getNameWithoutExtension(file_in.file.getName()))) {
if (CommonUtils.getNameWithoutExtension(projectFile.file.getName()).equals(
CommonUtils.getNameWithoutExtension(file_in.file.getName()))) {
cbFile.setSelectedIndex(i);
return true;
}