упорядочил папки с кодом.
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
package Visual_DVM_2021.PassStats;
|
||||
import Common.Database.DBObject;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class PassStats extends DBObject {
|
||||
@Description("PRIMARY KEY, UNIQUE")
|
||||
public PassCode_2021 code = PassCode_2021.Undefined;
|
||||
//меняется только когда юзер кликает на пункте меню или же на кнопке.
|
||||
public int Usages = 0;
|
||||
public PassStats() {
|
||||
}
|
||||
public PassStats(Pass_2021 pass) {
|
||||
code = pass.code();
|
||||
}
|
||||
public void Inc() {
|
||||
Usages++;
|
||||
}
|
||||
public void Drop() {
|
||||
Usages = 0;
|
||||
}
|
||||
public boolean HasUsages() {
|
||||
return Usages > 0;
|
||||
}
|
||||
@Override
|
||||
public Object getPK() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package Visual_DVM_2021.PassStats;
|
||||
import Common.Database.DBTable;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class PassStatsDBTable extends DBTable<PassCode_2021, PassStats> {
|
||||
public PassStatsDBTable() {
|
||||
super(PassCode_2021.class, PassStats.class);
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "статистика выполнения прохода";
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package Visual_DVM_2021.Passes;
|
||||
import Common.Database.DBObject;
|
||||
public abstract class AddObjectPass<D extends DBObject> extends ObjectPass<D> {
|
||||
public AddObjectPass(Class<D> d_in) {
|
||||
super(d_in);
|
||||
}
|
||||
public Class<? extends DBObject> getOwner() {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = d.newInstance();
|
||||
return
|
||||
((getOwner() == null) || (getDb().tables.get(getOwner()).CheckCurrent(Log))) &&
|
||||
fillObjectFields();
|
||||
}
|
||||
protected boolean fillObjectFields() throws Exception {
|
||||
return getTable().ShowAddObjectDialog(target);
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/RedAdd.png";
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
getDb().Insert(target);
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
getTable().ShowUI(target.getPK());
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
||||
import TestingSystem.Common.TasksPackageToKill.TasksPackageToKill;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
|
||||
import java.util.Vector;
|
||||
public class AbortSapforTaskPackage extends TestingSystemPass<SapforTasksPackage> {
|
||||
Vector<TasksPackageToKill> packagesToKill;
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Ban.PNG";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.SapforTasksPackage)) {
|
||||
packagesToKill = new Vector<>();
|
||||
target = Current.getSapforTasksPackage();
|
||||
switch (target.state) {
|
||||
case Done:
|
||||
case Aborted:
|
||||
Log.Writeln_("Пакет уже завершен.");
|
||||
break;
|
||||
default:
|
||||
TasksPackageToKill tasksPackageToKill = new TasksPackageToKill();
|
||||
tasksPackageToKill.packageName = String.valueOf(target.id);
|
||||
packagesToKill.add(tasksPackageToKill);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
;
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishAccountObjects, Current.getAccount().email, packagesToKill));
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackage;
|
||||
import TestingSystem.Common.TasksPackageToKill.TasksPackageToKill;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
|
||||
import java.util.Vector;
|
||||
public class AbortSelectedPackages extends TestingSystemPass<Vector<TasksPackage>> {
|
||||
Vector<TasksPackageToKill> packagesToKill;
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Ban.PNG";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = server.account_db.packages.getCheckedItems();
|
||||
packagesToKill = new Vector<>();
|
||||
for (TasksPackage tasksPackage : target) {
|
||||
switch (tasksPackage.state) {
|
||||
case Done:
|
||||
case Aborted:
|
||||
break;
|
||||
default:
|
||||
TasksPackageToKill tasksPackageToKill = new TasksPackageToKill();
|
||||
tasksPackageToKill.packageName = tasksPackage.id;
|
||||
packagesToKill.add(tasksPackageToKill);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (packagesToKill.isEmpty()) {
|
||||
Log.Writeln_("Не отмечено ни одного активного пакета для удаления");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishAccountObjects, Current.getAccount().email, packagesToKill));
|
||||
}
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Account.AccountRole;
|
||||
import Repository.BugReport.BugReport;
|
||||
import Repository.BugReport.BugReportInterface;
|
||||
import Repository.BugReport.BugReportState;
|
||||
import Repository.Component.ComponentType;
|
||||
import Visual_DVM_2021.Passes.AddObjectPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.Date;
|
||||
import java.util.Vector;
|
||||
public class AddBugReport extends AddObjectPass<BugReport> {
|
||||
public AddBugReport() {
|
||||
super(BugReport.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.componentsServer.db;
|
||||
}
|
||||
@Override
|
||||
public boolean canStart(Object... args) throws Exception {
|
||||
if (Current.getAccount().role.equals(AccountRole.Undefined)) {
|
||||
Log.Writeln_("Для создания отчёта требуется регистрация");
|
||||
return false;
|
||||
}
|
||||
if (Current.HasProject()) {
|
||||
String version = Current.getProject().Home.getAbsolutePath().substring(Current.getRoot().Home.getParent().length());
|
||||
if (version.toCharArray()[0] == '\\') version = version.substring(1);
|
||||
target = new BugReport(Current.getAccount().name, Current.getAccount().email,
|
||||
"Черновик отчёта об ошибке.\nЗаполните описание ошибочной ситуации, и нажмите 'Опубликовать'", version);
|
||||
return true;
|
||||
} else {
|
||||
if (UI.Warning("Создать отчёт об ошибке без прикрепления проекта.")) {
|
||||
target = new BugReport();
|
||||
target.genName();
|
||||
target.sender_name = Current.getAccount().name;
|
||||
target.sender_address = Current.getAccount().email;
|
||||
target.project_version = "";
|
||||
target.visualiser_version = Global.visualiser.version;
|
||||
target.sapfor_version = Global.Components.get(ComponentType.Sapfor_F).version;
|
||||
target.sapfor_settings = Global.db.settings.getSapforSettingsText();
|
||||
target.percentage = 0;
|
||||
target.description = "Черновик отчёта об ошибке.\nЗаполните описание ошибочной ситуации, и нажмите 'Опубликовать'";
|
||||
target.date = new Date().getTime();
|
||||
target.change_date = new Date().getTime();
|
||||
target.state = BugReportState.draft;
|
||||
target.owner = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
super.body();
|
||||
if (!target.project_version.isEmpty()) {
|
||||
Current.getRoot().cleanDepAndGCOVR(); //удаление депов и гкова
|
||||
//логи во вложения.
|
||||
File attachementsDir = Current.getProject().getAttachmentsDirectory();
|
||||
Vector<File> logs = new Vector<>();
|
||||
logs.add(Global.Log.getLogFile());
|
||||
logs.add(Paths.get(Global.ComponentsDirectory.getAbsolutePath(), "Sapfor_log.txt").toFile());
|
||||
logs.add(Paths.get(Global.ComponentsDirectory.getAbsolutePath(), "Server_log.txt").toFile());
|
||||
logs.add(Global.Components.get(ComponentType.Visualizer_2).getLogFile());
|
||||
for (File file : logs) {
|
||||
if (file.exists())
|
||||
Files.copy(file.toPath(), Paths.get(attachementsDir.getAbsolutePath(), file.getName()), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
//запаковка рута
|
||||
passes.get(PassCode_2021.ZipFolderPass).Do(Current.getRoot().Home.getAbsolutePath(), BugReportInterface.getArchiveFile(target).getAbsolutePath());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
double size = Utils.getFileSizeMegaBytes(BugReportInterface.getArchiveFile(target));
|
||||
if (size > 100) {
|
||||
Log.Writeln_("Размер запакованного вложения " + size + " Мб превышает 100 Мб");
|
||||
return false;
|
||||
}
|
||||
return super.validate();
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import GlobalData.Machine.Machine;
|
||||
import Visual_DVM_2021.Passes.AddObjectPass;
|
||||
public class AddCompiler extends AddObjectPass<Compiler> {
|
||||
public AddCompiler() {
|
||||
super(Compiler.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
@Override
|
||||
public Class<? extends DBObject> getOwner() {
|
||||
return Machine.class;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.DVMParameter.DVMParameter;
|
||||
import GlobalData.RunConfiguration.RunConfiguration;
|
||||
import Visual_DVM_2021.Passes.AddObjectPass;
|
||||
public class AddDVMParameter extends AddObjectPass<DVMParameter> {
|
||||
public AddDVMParameter() {
|
||||
super(DVMParameter.class);
|
||||
}
|
||||
@Override
|
||||
public Class<? extends DBObject> getOwner() {
|
||||
return RunConfiguration.class;
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.DVMParameter.DVMParameter;
|
||||
import GlobalData.DVMParameter.UI.DVMParameterFields;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class AddDVMParameterForTesting extends Pass_2021<String> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
DBObjectDialog<DVMParameter, DVMParameterFields> dialog =
|
||||
new DBObjectDialog<DVMParameter, DVMParameterFields>(DVMParameterFields.class) {
|
||||
@Override
|
||||
public void fillFields() {
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
String name = (String) fields.cbName.getSelectedItem();
|
||||
String value = fields.tfValue.getText();
|
||||
if (name.isEmpty())
|
||||
Log.Writeln("Имя параметра DVM системы не может быть пустым.");
|
||||
if (Utils.isLinuxSystemCommand(name))
|
||||
Log.Writeln(Utils.DQuotes(name) + " является системной командой Linux");
|
||||
if (Utils.isLinuxSystemCommand(value))
|
||||
Log.Writeln(Utils.DQuotes(value) + " является системной командой Linux");
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
target = fields.cbName.getSelectedItem() +"="+fields.tfValue.getText();
|
||||
}
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 200;
|
||||
}
|
||||
};
|
||||
return dialog.ShowDialog("Добавление параметра DVM системы", new DVMParameter());
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.EnvironmentValue.EnvironmentValue;
|
||||
import Visual_DVM_2021.Passes.AddObjectPass;
|
||||
public class AddEnvironmentValue extends AddObjectPass<EnvironmentValue> {
|
||||
public AddEnvironmentValue() {
|
||||
super(EnvironmentValue.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Common.UI.Windows.Dialog.Text.FileNameForm;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import ProjectData.Files.FileType;
|
||||
import Visual_DVM_2021.Passes.ChangeFilePass;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class AddFile extends ChangeFilePass<DBProjectFile> {
|
||||
Mode mode;
|
||||
File src;
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
resetArgs();
|
||||
mode = Mode.Dialog;
|
||||
src = null;
|
||||
if (args.length > 0) {
|
||||
src = (File) args[0];
|
||||
mode = Mode.Import;
|
||||
fileName = src.getName();
|
||||
if (Utils.ContainsCyrillic(fileName)) {
|
||||
Log.Writeln_("Имя файла " + Utils.Brackets(fileName) + " содержит кириллицу.");
|
||||
return false;
|
||||
}
|
||||
if (Utils.ContainsForbiddenName(fileName)) {
|
||||
Log.Writeln_("Имя файла " + Utils.Brackets(fileName)
|
||||
+ " содержит запрещенные символы." +
|
||||
"\n" + Constants.all_forbidden_characters_string);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
(ff = new FileNameForm()).ShowDialog("Введите имя создаваемого файла");
|
||||
fileName = ff.Result;
|
||||
//тут имена фильтруются уже на этапе формы.
|
||||
}
|
||||
if (fileName != null) {
|
||||
//->
|
||||
parent_node = Current.getProjectCurrentParentNode();
|
||||
target_dir = (File) parent_node.getUserObject();
|
||||
//->
|
||||
dst = Paths.get(target_dir.getAbsolutePath(), fileName).toFile();
|
||||
if (dst.exists()) {
|
||||
Log.Writeln_("Файл с именем " + Utils.Brackets(fileName) + " уже существует");
|
||||
return false;
|
||||
}
|
||||
target = new DBProjectFile(dst, project);
|
||||
if (target.fileType.equals(FileType.forbidden)) {
|
||||
Log.Writeln_("Расширение " + Utils.Brackets(Utils.getExtension(dst)) + " недопустимо");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
if (mode == Mode.Dialog) Utils.WriteToFile(target.file, "");
|
||||
else FileUtils.copyFile(src, dst);
|
||||
project.db.Insert(target);
|
||||
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().AddNode(parent_node,
|
||||
dst_node = target.node = new DefaultMutableTreeNode(target)
|
||||
);
|
||||
}
|
||||
enum Mode {
|
||||
Dialog,
|
||||
Import
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import GlobalData.Compiler.CompilerType;
|
||||
import GlobalData.Machine.Machine;
|
||||
import GlobalData.Machine.MachineType;
|
||||
import GlobalData.User.User;
|
||||
import Visual_DVM_2021.Passes.AddObjectPass;
|
||||
public class AddMachine extends AddObjectPass<Machine> {
|
||||
public AddMachine() {
|
||||
super(Machine.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (super.canStart(args)) {
|
||||
if (target.type.equals(MachineType.Local) && Global.db.machines.LocalMachineExists()) {
|
||||
Log.Writeln_("Локальная машина уже добавлена.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
getDb().Insert(new Compiler(
|
||||
target,
|
||||
"gfortran",
|
||||
CompilerType.gnu,
|
||||
"gfortran",
|
||||
"--version",
|
||||
"--help"
|
||||
));
|
||||
getDb().Insert(new Compiler(
|
||||
target,
|
||||
"gcc",
|
||||
CompilerType.gnu,
|
||||
"gcc",
|
||||
"--version",
|
||||
"--help"
|
||||
));
|
||||
getDb().Insert(new Compiler(
|
||||
target,
|
||||
"g++",
|
||||
CompilerType.gnu,
|
||||
"g++",
|
||||
"--version",
|
||||
"--help"
|
||||
));
|
||||
if (target.type.equals(MachineType.Local))
|
||||
getDb().Insert(new User(target, "этот пользователь", ""));
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Machine.Machine;
|
||||
import GlobalData.Makefile.Makefile;
|
||||
import GlobalData.Module.Module;
|
||||
import ProjectData.LanguageName;
|
||||
import Visual_DVM_2021.Passes.AddObjectPass;
|
||||
public class AddMakefile extends AddObjectPass<Makefile> {
|
||||
public AddMakefile() {
|
||||
super(Makefile.class);
|
||||
}
|
||||
@Override
|
||||
public Class<? extends DBObject> getOwner() {
|
||||
return Machine.class;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
super.body();
|
||||
//создать модули для языков.
|
||||
getDb().Insert(new Module(LanguageName.fortran, target));
|
||||
getDb().Insert(new Module(LanguageName.c, target));
|
||||
getDb().Insert(new Module(LanguageName.cpp, target));
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Machine.Machine;
|
||||
import GlobalData.RunConfiguration.RunConfiguration;
|
||||
import Visual_DVM_2021.Passes.AddObjectPass;
|
||||
public class AddRunConfiguration extends AddObjectPass<RunConfiguration> {
|
||||
public AddRunConfiguration() {
|
||||
super(RunConfiguration.class);
|
||||
}
|
||||
@Override
|
||||
public Class<? extends DBObject> getOwner() {
|
||||
return Machine.class;
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Repository.Subscribes.Subscriber;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class AddSubscriber extends ComponentsRepositoryPass<Subscriber> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/RedAdd.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = new Subscriber();
|
||||
return fillObjectFields();
|
||||
}
|
||||
protected boolean fillObjectFields() throws Exception {
|
||||
return server.db.subscribers.ShowAddObjectDialog(target);
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, "", target));
|
||||
}
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
super.performFinish();
|
||||
passes.get(PassCode_2021.SynchronizeBugReports).Do();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
super.showDone();
|
||||
server.db.subscribers.ui_.Show(target.getPK());
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Machine.Machine;
|
||||
import GlobalData.Machine.MachineType;
|
||||
import GlobalData.User.User;
|
||||
import Visual_DVM_2021.Passes.AddObjectPass;
|
||||
public class AddUser extends AddObjectPass<User> {
|
||||
public AddUser() {
|
||||
super(User.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
@Override
|
||||
public Class<? extends DBObject> getOwner() {
|
||||
return Machine.class;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (super.canStart(args)) {
|
||||
Machine machine = Current.getMachine();
|
||||
if (machine.type.equals(MachineType.Local) && (machine.getUsers().size() > 0)) {
|
||||
Log.Writeln_("У локальной машины может быть только один пользователь");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
public class AppendBugReportComment extends AppendBugReportField {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart("comment",
|
||||
UI.getMainWindow().getCallbackWindow().getBugReportCommentAdditionText());
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
UI.getMainWindow().getCallbackWindow().ClearBugReportCommentAdditionText();
|
||||
}
|
||||
@Override
|
||||
protected boolean canUpdate() {
|
||||
return Current.getAccount().ExtendedCheckAccessRights(target, Log);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.UI.UI;
|
||||
public class AppendBugReportDescription extends AppendBugReportField {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart("description",
|
||||
UI.getMainWindow().getCallbackWindow().getBugReportDescriptionAdditionText());
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
UI.getMainWindow().getCallbackWindow().ClearBugReportDescriptionAdditionText();
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import Repository.BugReport.BugReport;
|
||||
import Repository.BugReport.BugReportInterface;
|
||||
import Repository.EmailMessage;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import javafx.util.Pair;
|
||||
|
||||
import java.util.Date;
|
||||
public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
|
||||
String fieldName;
|
||||
String oldValue;
|
||||
String addition;
|
||||
String newValue;
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Append.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
protected boolean canUpdate() {
|
||||
return Current.getAccount().CheckAccessRights(target.sender_address, Log);
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.BugReport)) {
|
||||
target = Current.getBugReport();
|
||||
if (!BugReportInterface.CheckNotDraft(target,Log))
|
||||
return false;
|
||||
fieldName = (String) args[0];
|
||||
addition = (String) args[1];
|
||||
if (addition.isEmpty()) {
|
||||
Log.Writeln_("Дополнение не может быть пустым.");
|
||||
return false;
|
||||
}
|
||||
return canUpdate();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
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(
|
||||
new Date())) + " " + Current.getAccount().name
|
||||
+ " : " + addition;
|
||||
//2. дописываем нужное поле.
|
||||
BugReport.class.getField(fieldName).set(target, newValue);
|
||||
//обновляем дату.
|
||||
target.change_date = new Date().getTime();
|
||||
server.db.Update(target);
|
||||
//3. отправляем на сервер
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.UpdateBugReportField, fieldName, target));
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
server.db.bugReports.RefreshUI();
|
||||
UI.getMainWindow().getCallbackWindow().ShowCurrentBugReport();
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
String message_header = BugReportInterface.getMailTitlePrefix(target);
|
||||
String message_text = "";
|
||||
switch (fieldName) {
|
||||
default:
|
||||
return;
|
||||
case "description":
|
||||
message_header += "описание дополнено";
|
||||
message_text = target.description
|
||||
;
|
||||
break;
|
||||
case "comment":
|
||||
message_header += "комментарий дополнен";
|
||||
message_text = target.comment;
|
||||
break;
|
||||
}
|
||||
passes.get(PassCode_2021.Email).Do(
|
||||
new EmailMessage(
|
||||
message_header + " " + Utils.Brackets(Current.getAccount().name),
|
||||
message_text,
|
||||
BugReportInterface.getRecipients(target,true)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import Repository.BugReport.BugReport;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
public class ApplyBugReportSettings extends Pass_2021<BugReport> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Apply.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
public boolean needsConfirmations() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
if (Current.Check(Log, Current.BugReport)) {
|
||||
target = Current.getBugReport();
|
||||
long vv = target.visualiser_version;
|
||||
if (vv < 500) {
|
||||
Log.Writeln_("Автоматическое применение настроек поддерживается только в отчётах об ошибках,\n" +
|
||||
"отправленных с версии визуализатора 500 и выше");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
String[] lines = target.sapfor_settings.split("\n");
|
||||
LinkedHashMap<SettingName, String> to_apply = new LinkedHashMap<>();
|
||||
for (int i = 1; i < lines.length; ++i) {
|
||||
SettingName settingName = SettingName.getByDescription(lines[i].substring(4, lines[i].indexOf('=')));
|
||||
String settingValue = lines[i].substring(lines[i].indexOf('=') + 1);
|
||||
if (!settingName.equals(SettingName.Undefined))
|
||||
to_apply.put(settingName, settingValue);
|
||||
}
|
||||
//сохранить текущие настройки как профиль
|
||||
// Global.db.rewriteProfileByDescription("Saved Profile");
|
||||
//--
|
||||
//само применение.
|
||||
for (SettingName settingName : to_apply.keySet())
|
||||
Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(
|
||||
settingName,
|
||||
to_apply.get(settingName));
|
||||
//сохранить настройки бага как профиль
|
||||
// Global.db.rewriteProfileByDescription(target.id);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Common.UI.Windows.Dialog.Text.ComboTextDialog;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.SapforData.Functions.FuncInfo;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Vector;
|
||||
public class ApplyCurrentFunction extends Pass_2021 {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Apply.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (passes.get(PassCode_2021.SPF_GetGraphFunctions).isDone()) {
|
||||
ComboTextDialog ff = new ComboTextDialog();
|
||||
Vector<String> names = new Vector<>(Current.getProject().allFunctions.keySet());
|
||||
names.sort(Comparator.naturalOrder());
|
||||
if (ff.ShowDialog("Выберите имя текущей процедуры", names)) {
|
||||
String func_name = ff.Result;
|
||||
if (Current.getProject().allFunctions.containsKey(func_name)) {
|
||||
FuncInfo fi = Current.getProject().allFunctions.get(func_name);
|
||||
Current.set(Current.Function, fi);
|
||||
return true;
|
||||
} else {
|
||||
Log.Writeln_("Проект не содержит процедуры с именем " + Utils.Brackets(func_name));
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
UI.getMainWindow().getProjectWindow().getFunctionsWindow().ShowCurrentFunction();
|
||||
if (SPF_GetGraphFunctionPositions.showByCurrentFunction) {
|
||||
Pass_2021.passes.get(PassCode_2021.SPF_GetGraphFunctionPositions).Do();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import GlobalData.SapforProfile.SapforProfile;
|
||||
import GlobalData.SapforProfileSetting.SapforProfileSetting;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class ApplyProfile extends Pass_2021<SapforProfile> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Apply.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
public boolean needsConfirmations() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.SapforProfile)) {
|
||||
target = (SapforProfile) Current.get(Current.SapforProfile);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
Vector<SapforProfileSetting> settings = new Vector<>();
|
||||
for (SapforProfileSetting sapforProfileSetting : Global.db.sapforProfilesSettings.Data.values())
|
||||
if (sapforProfileSetting.sapforprofile_id == target.id)
|
||||
settings.add(sapforProfileSetting);
|
||||
//--
|
||||
for (SapforProfileSetting setting : settings)
|
||||
if (Global.db.settings.containsKey(setting.name))
|
||||
passes.get(PassCode_2021.UpdateSetting).Do(setting.name, setting.value);
|
||||
//--
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Machine.Machine;
|
||||
import GlobalData.RemoteFile.RemoteFile;
|
||||
import GlobalData.User.User;
|
||||
import Visual_DVM_2021.Passes.SSH.ConnectionPass;
|
||||
import com.jcraft.jsch.ChannelSftp;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Vector;
|
||||
public class ArchivesBackupPass extends ConnectionPass<File> {
|
||||
File src;
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
machine = (Machine) args[0];
|
||||
user = (User) args[1];
|
||||
src = (File) args[2];
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean needsInitialize() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
String workspace_path = Utils.toU(Paths.get(sftpChannel.getHome(),Global.properties.BackupWorkspace).toString());
|
||||
RemoteFile workspace = new RemoteFile(workspace_path, true);
|
||||
tryMKDir(workspace);
|
||||
RemoteFile dst = new RemoteFile(workspace.full_name, src.getName());
|
||||
putSingleFile(src, dst);
|
||||
//-теперь, удалить старые файлы.
|
||||
Vector<ChannelSftp.LsEntry> raw_files = sftpChannel.ls(workspace.full_name);
|
||||
Vector<RemoteFile> files = new Vector<>();
|
||||
for (ChannelSftp.LsEntry file : raw_files) {
|
||||
if (!file.getAttrs().isDir()) {
|
||||
RemoteFile rfile = new RemoteFile(workspace.full_name, file.getFilename(), false);
|
||||
rfile.updateTime = RemoteFile.convertUpdateTime(file.getAttrs().getMTime());
|
||||
files.add(rfile);
|
||||
}
|
||||
}
|
||||
//сортируем по времени обновления. по убыванию.
|
||||
files.sort((o1, o2) -> (int) (o2.updateTime - o1.updateTime));
|
||||
for (int i = 2; i < files.size(); ++i) {
|
||||
System.out.println(files.get(i).full_name + ":" + files.get(i).updateTime);
|
||||
sftpChannel.rm(files.get(i).full_name);
|
||||
}
|
||||
//--------------
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Utils.Utils;
|
||||
import Repository.Component.Component;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.PassException;
|
||||
import Visual_DVM_2021.Passes.ProcessPass;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
public class BuildComponent extends ProcessPass<Component> {
|
||||
@Override
|
||||
protected PassCode_2021 necessary() {
|
||||
return PassCode_2021.DownloadRepository;
|
||||
}
|
||||
@Override
|
||||
protected boolean resetsNecessary() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = Current.getComponent();
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
Utils.forceDeleteWithCheck(target.getAssemblyFile());
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
ShowMessage1("Сборка " + target.getComponentType().getDescription());
|
||||
PerformScript(target.getAssemblyCommand());
|
||||
if (!target.getAssemblyFile().exists())
|
||||
throw new PassException("Сборка не найдена");
|
||||
Files.copy(target.getAssemblyFile().toPath(),
|
||||
target.getNewFile().toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
if (!target.getNewFile().exists())
|
||||
throw new PassException("Не удалось скопировать сборку для установки");
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class CheckAccount extends Pass_2021<Boolean> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = false;
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Registry.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
target = Current.getAccount().email.equals("?") ?
|
||||
(Pass_2021.passes.get(PassCode_2021.EditAccount).Do() &&
|
||||
Pass_2021.passes.get(PassCode_2021.CheckRegistrationOnServer).Do()) :
|
||||
(Pass_2021.passes.get(PassCode_2021.CheckRegistrationOnServer).Do());
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return target;
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
if (UI.getMainWindow() != null) {
|
||||
UI.getMainWindow().getCallbackWindow().ShowAccount();
|
||||
if (Current.HasBugReport())
|
||||
UI.getMainWindow().getCallbackWindow().ShowCurrentBugReport();
|
||||
}
|
||||
if (Current.getAccount().isAdmin())
|
||||
Pass_2021.passes.get(PassCode_2021.PublishComponent).setControlsVisible(true);
|
||||
setControlsVisible(false); //если проверка успешна, кнопку больше не показывать.
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Repository.Subscribes.Subscriber;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
public class CheckRegistrationOnServer extends ComponentsRepositoryPass<Subscriber> {
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.CheckSubscriberRole, "", Current.getAccount()));
|
||||
target = (Subscriber) response.object;
|
||||
Current.getAccount().role = target.role;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Repository.SubscriberWorkspace.SubscriberWorkspace;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
public class CheckRemoteWorkspace extends ComponentsRepositoryPass<SubscriberWorkspace> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target=null;
|
||||
return Current.getAccount().CheckRegistered(Log);
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
String email = Current.getAccount().email;
|
||||
String machineURL = Current.getMachine().getURL();
|
||||
String login = Current.getUser().login;
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.CheckURLRegistered,
|
||||
email+"\n"+machineURL+"\n"+login));
|
||||
target = (SubscriberWorkspace) response.object;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Visual_DVM_2021.Passes.CurrentProjectPass;
|
||||
public class CleanAnalyses extends CurrentProjectPass {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart(args) && (Current.getSapfor() != null);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
target.CleanAnalyses();
|
||||
target.CreateParserOptionsDirs();
|
||||
target.ClearGCOV();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
super.showDone();
|
||||
UI.getMainWindow().getProjectWindow().RefreshProjectFiles();
|
||||
UI.getMainWindow().getProjectWindow().ShowNoAnalyses();
|
||||
UI.getMainWindow().getProjectWindow().ShowProjectSapforLog();
|
||||
if (Current.HasFile()) {
|
||||
Current.getFile().form.ShowNoMessages();
|
||||
Current.getFile().form.ShowNoAnalyses();
|
||||
Current.getFile().form.ShowNoGCOVLog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Repository.BugReport.BugReportState;
|
||||
public class CloseBugReport extends UpdateBugReportField {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/CloseBugReport.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart("state", BugReportState.closed, "percentage", 100);
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
public class CloseCurrentFile extends Pass_2021<DBProjectFile> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Close.png";
|
||||
}
|
||||
@Override
|
||||
public Icon getTabIcon() {
|
||||
return Utils.getIcon("/icons/Close_18.png");
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return (target = Current.getFile()) != null;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
//действия по закрытию. сохранение и т д.
|
||||
target.form.SaveSplitters();
|
||||
target.UpdateLastLine(target.form.getEditor().getCurrentLine());
|
||||
passes.get(PassCode_2021.Save).Do();
|
||||
UI.getSearchReplaceForm().ClearMarkers();
|
||||
target.form = null;
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
Current.set(Current.File, null);
|
||||
Current.set(Current.FileGraphElement, null);
|
||||
//-
|
||||
Current.set(Current.Notes, null);
|
||||
Current.set(Current.Warnings, null);
|
||||
Current.set(Current.Errors, null);
|
||||
//-
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
//отобразить отсутствие файла.
|
||||
UI.getMainWindow().getProjectWindow().ShowNoFile();
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
public class CloseCurrentProject extends Pass_2021<db_project_info> {
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Close.png";
|
||||
}
|
||||
@Override
|
||||
public Icon getTabIcon() {
|
||||
return Utils.getIcon("/icons/Close_18.png");
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return (target = Current.getProject()) != null;
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
passes.get(PassCode_2021.CloseCurrentFile).Do();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
target.Close();
|
||||
UI.HideSearchForm();
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
Global.files_multiselection = false;
|
||||
//--
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
Current.getSapfor().cd(new File(Global.Home));
|
||||
Current.set(Current.Project, null);
|
||||
Current.set(Current.File, null);
|
||||
Current.set(Current.Function, null);
|
||||
Current.set(Current.SelectedFunction,null);
|
||||
Current.set(Current.ProjectNode, null);
|
||||
Current.set(Current.SelectedFile, null);
|
||||
Current.set(Current.SelectedDirectory, null);
|
||||
//-мб перестраховка. мб и нет.
|
||||
Current.set(Current.ParallelVariant, null);
|
||||
Current.set(Current.Dimensions, null);
|
||||
Current.set(Current.Array, null);
|
||||
Current.set(Current.DBArray, null);
|
||||
//-
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
if (UI.HasMainWindow()) {
|
||||
UI.getMainWindow().ShowNoProject();
|
||||
UI.getVersionsWindow().ShowNoProjectVariants();
|
||||
UI.getVersionsWindow().BlockVariants();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.io.File;
|
||||
public class CloseProject extends Pass_2021<db_project_info> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return (target = Current.getProject()) != null;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
target.Close();
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
Current.getSapfor().cd(new File(Global.Home));
|
||||
Current.set(Current.Project, null);
|
||||
//-
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import Common.UI.Windows.Dialog.Text.ComboTextDialog;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import Repository.Component.Sapfor.TransformationPermission;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Transformation;
|
||||
import Visual_DVM_2021.UI.Main.CombineFilesDialog;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class CombineFiles extends Transformation {
|
||||
ComboTextDialog fd = null;
|
||||
protected File result = null;
|
||||
@Override
|
||||
protected PassCode_2021 necessary() {
|
||||
return PassCode_2021.SPF_GetIncludeDependencies;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
switch (Global.transformationPermission) {
|
||||
case All:
|
||||
return super.canStart(args) && target.CheckSameStyle(Log) &&
|
||||
(fd = new CombineFilesDialog()).ShowDialog("Выберите имя итогового файла", target.files_order);
|
||||
case VariantsOnly:
|
||||
if (getPermission().equals(TransformationPermission.VariantsOnly)) {
|
||||
return super.canStart(args) && target.CheckSameStyle(Log) && (
|
||||
(fd = new CombineFilesDialog()).ShowDialog("Выберите имя итогового файла", target.files_order)
|
||||
);
|
||||
} else {
|
||||
Log.Writeln_("Разрешено только построение параллельных вариантов!");
|
||||
return false;
|
||||
}
|
||||
case None:
|
||||
Log.Writeln_("Нет разрешения на выполнение преобразований");
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//правила инклудов https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vna1/index.html
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
result = Paths.get(target.last_version.Home.getAbsolutePath(),
|
||||
Global.isWindows ? fd.Result : Utils.toU(fd.Result)).toFile();
|
||||
//-----------------------
|
||||
//получить список хедеров.
|
||||
//-----------------------
|
||||
Vector<String> result_lines = new Vector<>();
|
||||
Vector<String> all_includes = new Vector<>();
|
||||
//-----------------------------
|
||||
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)));
|
||||
}
|
||||
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));
|
||||
++i;
|
||||
}
|
||||
result_lines.add("!--------------------");
|
||||
for (String name : target.files_order) {
|
||||
//если есть инклуды начинаем мучиться.
|
||||
if (target.addictedFiles.containsKey(name)) {
|
||||
DBProjectFile file = target.db.files.Data.get(name);
|
||||
//---------------------------------------------------->>>
|
||||
List<String> file_lines = FileUtils.readLines(file.file);
|
||||
for (String line : file_lines) {
|
||||
String header = Utils.extractHeaderName(line);
|
||||
if (header != null) {
|
||||
if (file.relativeHeaders.containsKey(header))
|
||||
result_lines.add(" include " + Utils.Quotes(
|
||||
Utils.toU(
|
||||
file.relativeHeaders.get(header).name)));
|
||||
} else
|
||||
result_lines.add(line);
|
||||
}
|
||||
} else {
|
||||
//инклудов нет. добавляем все подряд.
|
||||
result_lines.addAll(FileUtils.readLines(target.db.files.Data.get(name).file));
|
||||
}
|
||||
}
|
||||
FileUtils.writeLines(result, result_lines, false);
|
||||
//-------------------------------
|
||||
//теперь скопировать остальные файлы
|
||||
for (String name : target.db.files.Data.keySet()) {
|
||||
if (!target.files_order.contains(name)) {
|
||||
Files.copy(
|
||||
target.db.files.Data.get(name).file.toPath(),
|
||||
Paths.get(target.last_version.Home.getAbsolutePath(), name)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
import GlobalData.User.UserState;
|
||||
import ProjectData.LanguageName;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.PassException;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class Compile extends Pass_2021<db_project_info> {
|
||||
Pass_2021 subpass = null;
|
||||
CompilationTask compilationTask = null;
|
||||
@Override
|
||||
protected PassCode_2021 necessary() {
|
||||
return Current.getProject().languageName.equals(LanguageName.fortran) ? PassCode_2021.SPF_ParseFilesWithOrder : null;
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Start.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
if (Current.Check(Log, Current.Project, Current.Machine, Current.User, Current.Makefile)) {
|
||||
target = Current.getProject();
|
||||
subpass = null;
|
||||
compilationTask = null;
|
||||
if (Current.getUser().state != UserState.ready_to_work)
|
||||
Log.Writeln_("Пользователь " + Utils.Brackets(Current.getUser().login) +
|
||||
" не проинициализирован\nПерейдите на вкладку 'Настройки компиляции и запуска',\n" +
|
||||
" и выполните команду 'Инициализация пользователя'\n");
|
||||
Current.getMakefile().Validate(Log);
|
||||
return Log.isEmpty();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
compilationTask = new CompilationTask();
|
||||
compilationTask.machine_id = Current.getMachine().id;
|
||||
compilationTask.user_id = Current.getUser().id;
|
||||
compilationTask.makefile_id = Current.getMakefile().id;
|
||||
compilationTask.project_path = target.Home.getAbsolutePath();
|
||||
compilationTask.project_description = target.description;
|
||||
//------------------------------------------
|
||||
compilationTask.CompleteSummary(target.compilation_maxtime);
|
||||
compilationTask.state = TaskState.Inactive;
|
||||
Global.db.Insert(compilationTask);
|
||||
Utils.forceDeleteWithCheck(compilationTask.getLocalWorkspace());
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
Global.db.compilationTasks.ShowUI(compilationTask.getPK());
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
|
||||
switch (Current.getMachine().type) {
|
||||
case Local:
|
||||
if (Global.isWindows) {
|
||||
subpass = passes.get(PassCode_2021.WindowsLocalCompilation);
|
||||
} else
|
||||
subpass = passes.get(PassCode_2021.LinuxLocalCompilation);
|
||||
break;
|
||||
case Undefined:
|
||||
throw new PassException("Компиляция не реализована для типа машины " + Utils.DQuotes(Current.getMachine().type));
|
||||
default:
|
||||
subpass = passes.get(PassCode_2021.RemoteCompilation);
|
||||
break;
|
||||
}
|
||||
subpass.Do(Current.getCompilationTask(), Current.getProject());
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return (subpass != null) && subpass.isDone();
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
Global.db.compilationTasks.ShowUI(compilationTask.getPK());
|
||||
UI.getDebugWindow().ShowLastCompilationTask();
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class ConvertCorrectnessTests extends TestingSystemPass<File> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/DownloadAll.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (!Current.getAccount().isAdmin())
|
||||
Log.Writeln_("Вы не являетесь администратором");
|
||||
else return UI.Warning("Загрузить полный пакет DVM тестов на корректность и производительность.");
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
passes.get(PassCode_2021.CloseCurrentProject);
|
||||
Current.set(Current.Root, null);
|
||||
Current.set(Current.Version, null);
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
UI.testingBar.ShowAutoCheckTesting();
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.RefreshDVMTests, "", Current.getAccount()));
|
||||
LinkedHashMap<Group, Vector<Test>> ids = (LinkedHashMap<Group, Vector<Test>>) response.object;
|
||||
ShowMessage1("Определение размерности тестов");
|
||||
for (Group group : ids.keySet()) {
|
||||
Vector<Test> tests = ids.get(group);
|
||||
for (Test test : tests) {
|
||||
ShowMessage2(group.description+" : "+test.description);
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.DownloadTest, String.valueOf(test.id)));
|
||||
File testArchive = Utils.getTempFileName(String.valueOf(test));
|
||||
response.Unpack(testArchive);
|
||||
File testProject = new File(Global.TempDirectory, String.valueOf(test.id));
|
||||
Utils.forceDeleteWithCheck(testProject);
|
||||
FileUtils.forceMkdir(testProject);
|
||||
passes.get(PassCode_2021.UnzipFolderPass).Do(testArchive.getAbsolutePath(), Global.TempDirectory.getAbsolutePath());
|
||||
//без создания бд!!
|
||||
File[] files = testProject.listFiles();
|
||||
if (files != null && files.length > 0) {
|
||||
db_project_info vizTestProject = new db_project_info(testProject, "", false);
|
||||
switch (group.language) {
|
||||
case fortran:
|
||||
test.dim = Current.getSapfor().getTextMaxDim(files[0], vizTestProject);
|
||||
System.out.println(test.dim);
|
||||
break;
|
||||
case c:
|
||||
test.dim = Utils.getCTestMaxDim(files[0]);
|
||||
System.out.println(test.dim);
|
||||
break;
|
||||
}
|
||||
}
|
||||
EditObject(test);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
super.performFinish();
|
||||
passes.get(PassCode_2021.SynchronizeTests).Do();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.UI.Windows.Dialog.Dialog;
|
||||
import Common.Utils.Utils;
|
||||
import Visual_DVM_2021.Passes.CurrentProjectPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.UI.CopyProjectFields;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class CopyProject extends CurrentProjectPass {
|
||||
protected File dstFile = null;
|
||||
protected boolean migrateData = false;
|
||||
@Override
|
||||
protected boolean hasStats() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (super.canStart(args)) {
|
||||
Dialog<Object, CopyProjectFields> dialog = new Dialog<Object, CopyProjectFields>(CopyProjectFields.class) {
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 230;
|
||||
}
|
||||
@Override
|
||||
public void Init(Object... params) {
|
||||
fields.tfParent.setText(Global.visualiser.getWorkspace().getAbsolutePath());
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
Utils.validateFileShortNewName(fields.tfName.getText(), Log);
|
||||
if (!fields.tfParent.getText().isEmpty()) {
|
||||
if (Utils.ContainsCyrillic(fields.tfParent.getText()))
|
||||
Log.Writeln_("Путь к целевой папке не может содержать кириллицу!");
|
||||
} else Log.Writeln_("Путь к целевой папке не может быть пустым!");
|
||||
if (Log.isEmpty()) {
|
||||
dstFile = Paths.get(fields.tfParent.getText(), fields.tfName.getText()).toFile();
|
||||
if (dstFile.exists())
|
||||
Log.Writeln_("Файл " + dstFile.getAbsolutePath() + " уже существует!");
|
||||
}
|
||||
}
|
||||
};
|
||||
if (dialog.ShowDialog(getDescription())) {
|
||||
migrateData = dialog.fields.MigrateData.isSelected();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Transformations/CopyProject.png";
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
FileUtils.forceMkdir(dstFile);
|
||||
target.Clone(dstFile, migrateData);
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
if (UI.Question("копия текущего проекта успешно создана по адресу\n" + dstFile.getAbsolutePath() + "\nОткрыть её")) {
|
||||
passes.get(PassCode_2021.CloseCurrentProject).Do();
|
||||
passes.get(PassCode_2021.OpenCurrentProject).Do(dstFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Visual_DVM_2021.Passes.CurrentComponentPass;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
public class CreateComponentBackUp extends CurrentComponentPass {
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
//form.ShowMessage2("копирование предыдущей версии...");
|
||||
if (target.getFile().exists())
|
||||
Files.copy(target.getFile().toPath(), target.getBackUpFile().toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Common.UI.Windows.Dialog.Text.FileNameForm;
|
||||
import Common.Utils.Utils;
|
||||
import Visual_DVM_2021.Passes.ChangeFilePass;
|
||||
import Visual_DVM_2021.Passes.PassException;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class CreateEmptyDirectory extends ChangeFilePass {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
resetArgs();
|
||||
if ((ff = new FileNameForm()).ShowDialog("Введите имя создаваемой папки")) {
|
||||
fileName = ff.Result;
|
||||
//->
|
||||
parent_node = Current.getProjectCurrentParentNode();
|
||||
target_dir = (File) parent_node.getUserObject();
|
||||
//->
|
||||
dst = Paths.get(target_dir.getAbsolutePath(), fileName).toFile();
|
||||
if (dst.exists()) {
|
||||
Log.Writeln("Файл с именем " + Utils.Brackets(fileName) + " уже существует");
|
||||
return false;
|
||||
}
|
||||
if (fileName.equalsIgnoreCase(Constants.data)) {
|
||||
Log.Writeln(Utils.Brackets(Constants.data) + " является зарезервированным именем!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
if (!dst.mkdir()) throw new PassException("Не удалось создать папку.");
|
||||
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().AddNode(parent_node, dst_node = new DefaultMutableTreeNode(dst));
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Global;
|
||||
import Common.UI.Windows.Dialog.Text.FileNameForm;
|
||||
import Common.Utils.Utils;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.PassException;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class CreateEmptyProject extends Pass_2021<File> {
|
||||
String project_name;
|
||||
FileNameForm ff = new FileNameForm();
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/CreateProject.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
project_name = "";
|
||||
target = null;
|
||||
if (ff.ShowDialog("Укажите имя создаваемого проекта", "NewProject")) {
|
||||
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уже существует");
|
||||
return Log.isEmpty();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
File data = new File(target, Constants.data);
|
||||
if (!(target.mkdir()&&data.mkdir()))
|
||||
throw new PassException("Не удалось создать проект.");
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
passes.get(PassCode_2021.OpenCurrentProject).Do(target);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.UI.UI;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.VariantsMassPass;
|
||||
public class CreateParallelVariants extends VariantsMassPass {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Create.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
public PassCode_2021 getSubPassCode() {
|
||||
return PassCode_2021.SPF_CreateParallelVariant;
|
||||
}
|
||||
@Override
|
||||
protected void FocusResult() {
|
||||
UI.getMainWindow().getProjectWindow().FocusVersions();
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
db_project_info.ResetNewVersions();
|
||||
super.performPreparation();
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import ProjectData.SapforData.Variants.ParallelVariant;
|
||||
import Repository.Component.Sapfor.Sapfor;
|
||||
import Visual_DVM_2021.Passes.CurrentProjectPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class CreateParallelVariantsCoverageForScenario extends CurrentProjectPass {
|
||||
@Override
|
||||
public void Interrupt() throws Exception {
|
||||
Current.getSapfor().Interrupt();
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
}
|
||||
@Override
|
||||
protected PassCode_2021 necessary() {
|
||||
return PassCode_2021.SPF_GetArrayDistribution;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (super.canStart(args)) {
|
||||
target.gen_variants_coverage();
|
||||
if (target.parallelVariants.size() == 0) {
|
||||
Log.Writeln_("Покрытие вариантов пусто");
|
||||
return false;
|
||||
} else if (!passes.get(PassCode_2021.SPF_GetArrayDistribution).isDone()) {
|
||||
Log.Writeln_("Варианты неактуальны. Сначала перестройте распределение данных.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
protected void body() throws Exception {
|
||||
for (ParallelVariant p : target.parallelVariants.Data.values())
|
||||
if (!passes.get(PassCode_2021.SPF_CreateParallelVariant).Do(p)) break;
|
||||
}
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
//распаковку соо делаем только 1 раз. после всей массы вариантов.
|
||||
Sapfor sapfor = Current.getSapfor();
|
||||
target.unpackMessagesAndLog(sapfor.getOutputMessage(), sapfor.getOutput());
|
||||
}
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.Test.TestType;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_project_info>> {
|
||||
Group group;
|
||||
Test test;
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/DownloadAll.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (!Current.getAccount().CheckRegistered(Log))
|
||||
return false;
|
||||
if (!Global.versions_multiselection) {
|
||||
Log.Writeln_("Нажмите правую клавишу мыши, и перейдите в режим выбора версий.");
|
||||
return false;
|
||||
}
|
||||
target = new Vector<>();
|
||||
group = null;
|
||||
test = null;
|
||||
Current.getRoot().getSelectedVersions(target);
|
||||
if (target.size() == 0) {
|
||||
Log.Writeln_("Не отмечено ни одной версии.");
|
||||
return false;
|
||||
}
|
||||
if (Current.getProject().hasSubdirectories()) {
|
||||
Log.Writeln_("Запрещено добавлять тестовые проекты, содержащие подпапки!");
|
||||
return false;
|
||||
}
|
||||
String cp_info = "";
|
||||
if (Current.HasProject()) {
|
||||
for (db_project_info version : target) {
|
||||
if (version.Home.getAbsolutePath().equals(Current.getProject().Home.getAbsolutePath())) {
|
||||
cp_info = "Текущий проект будет закрыт.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return UI.Question("Будет сформирована группа из " + target.size() + " тестов.\n" + cp_info +
|
||||
"\nПродолжить");
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
passes.get(PassCode_2021.CloseCurrentProject).Do();
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
UI.testingBar.ShowAutoCheckTesting();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
PublishGroup publishGroup = new PublishGroup() {
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Добавление группы";
|
||||
}
|
||||
@Override
|
||||
public boolean fillObjectFields() throws Exception {
|
||||
//тут имя надо генерить, потому что может совпасть.
|
||||
target.description = Utils.getDateName(Current.getRoot().name);
|
||||
target.type = TestType.Default;
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
ShowMessage1("Публикация группы ");
|
||||
if (publishGroup.Do()) {
|
||||
group = publishGroup.target;
|
||||
for (db_project_info vizTestProject : target) {
|
||||
//на случай если версия в текущем сеансе еще не открывалась.
|
||||
vizTestProject.Open();
|
||||
vizTestProject.Close();
|
||||
ShowMessage1("Публикация теста " + vizTestProject.getTitle());
|
||||
PublishTest pass = new PublishTest() {
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean fillObjectFields() throws Exception {
|
||||
project = vizTestProject;
|
||||
if (project.checkSubdirectories(Log)) {
|
||||
switch (project.languageName) {
|
||||
case fortran:
|
||||
project.testMaxDim = Current.getSapfor().getTextMaxDim(null, project);
|
||||
break;
|
||||
default:
|
||||
project.testMaxDim = 0;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Добавление версии " + vizTestProject.name;
|
||||
}
|
||||
};
|
||||
if (pass.Do())
|
||||
test = pass.target;
|
||||
}
|
||||
if (passes.get(PassCode_2021.SynchronizeTests).Do()) {
|
||||
if (group != null) Global.testingServer.db.groups.ui_.Show(group.getPK());
|
||||
if (test != null) Global.testingServer.db.tests.ui_.Show(test.getPK());
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void FocusResult() {
|
||||
UI.getMainWindow().FocusTesting();
|
||||
UI.getMainWindow().getTestingWindow().FocusTestingSystem();
|
||||
}
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.Menus_2023.PassMenuItem;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Date;
|
||||
import java.util.Vector;
|
||||
public class DVMConvertProject extends ComponentsRepositoryPass<db_project_info> {
|
||||
File workspace = null;
|
||||
File archive = null;
|
||||
Vector<DBProjectFile> programsToConvert = null;
|
||||
Vector<String> programsNames = null;
|
||||
String output = null;
|
||||
File versionArchive = null;
|
||||
File version = null;
|
||||
String badFiles = "";
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
programsToConvert = null;
|
||||
programsNames = null;
|
||||
output = "";
|
||||
workspace = null;
|
||||
archive = null;
|
||||
versionArchive = null;
|
||||
version = null;
|
||||
badFiles = "";
|
||||
//--
|
||||
if (Current.Check(Log, Current.Project)) {
|
||||
target = Current.getProject();
|
||||
programsToConvert = target.getPrograms().get(target.languageName);
|
||||
programsNames = new Vector<>();
|
||||
if (programsToConvert.size() > 100) {
|
||||
Log.Writeln_("Количество активных файлов кода на языке " + target.languageName + " в проекте превышает 100.");
|
||||
return false;
|
||||
}
|
||||
for (DBProjectFile program : programsToConvert) {
|
||||
if (Utils.getFileSizeMegaBytes(program.file) > 1) {
|
||||
Log.Writeln_("Размер файла кода " + Utils.Brackets(program.name) + " превышает 1 Мб.");
|
||||
return false;
|
||||
} else programsNames.add(Utils.toU(program.name));
|
||||
}
|
||||
workspace = Utils.getTempFileName("convertation");
|
||||
FileUtils.forceMkdir(workspace);
|
||||
File cleanCopy = Paths.get(workspace.getAbsolutePath(), target.name).toFile();
|
||||
FileUtils.forceMkdir(cleanCopy);
|
||||
archive = Paths.get(workspace.getAbsolutePath(), target.name + ".zip").toFile();
|
||||
target.Clone(cleanCopy, false);
|
||||
if (!passes.get(PassCode_2021.ZipFolderPass).Do(cleanCopy.getAbsolutePath(), archive.getAbsolutePath())) {
|
||||
Log.Writeln_("Не удалось создать архив проекта!");
|
||||
return false;
|
||||
}
|
||||
;
|
||||
if (Utils.getFileSizeMegaBytes(archive) > 500) {
|
||||
Log.Writeln_("Размер архива проекта превышает 500 МБ");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
super.performPreparation();
|
||||
db_project_info.ResetNewVersions();
|
||||
}
|
||||
//-
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Transformations/" + code().toString() + ".png";
|
||||
}
|
||||
@Override
|
||||
protected boolean hasStats() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected int getTimeout() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
ServerExchangeUnit_2021 unit = new ServerExchangeUnit_2021(ServerCode.DVMConvertProject);
|
||||
unit.object = Utils.packFile(archive);
|
||||
Vector<String> unit_args = new Vector<>();
|
||||
unit_args.add(target.name);
|
||||
unit_args.add(target.languageName.toString());
|
||||
unit_args.add(Global.db.settings.get(SettingName.DVMConvertationOptions).toString());
|
||||
unit_args.addAll(programsNames);
|
||||
unit.arg = String.join("\n", unit_args);
|
||||
Command(unit);
|
||||
output = response.arg;
|
||||
versionArchive = new File(workspace, target.name + "_result.zip");
|
||||
response.Unpack(versionArchive);
|
||||
File result = new File(workspace, "result");
|
||||
if (passes.get(PassCode_2021.UnzipFolderPass).Do(versionArchive.getAbsolutePath(), result.getAbsolutePath())) {
|
||||
if (target.last_modification == null) {
|
||||
target.last_modification = new db_project_info(target,
|
||||
"m",
|
||||
"копия от " + new Date(),
|
||||
"");
|
||||
target.last_modification.CloneParent();
|
||||
}
|
||||
File resultProject = new File(result, target.name);
|
||||
String versionName = target.GenerateVersionName("v");
|
||||
version = new File(target.Home, versionName);
|
||||
FileUtils.moveDirectory(resultProject, version);
|
||||
if (!version.exists()) Log.Writeln_("Не удалось перенести результат");
|
||||
} else Log.Writeln_("Не удалось распаковать результат");
|
||||
}
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
super.performFinish();
|
||||
String[] data = output.split("\\|");
|
||||
if (data.length > 1) {
|
||||
badFiles = "Не удалось сконвертировать " + data[0].split("\n").length + " файлов:\n" + data[0];
|
||||
target.updateCompilationOut(data[1]);
|
||||
} else
|
||||
target.updateCompilationOut(output);
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
UI.getMainWindow().getProjectWindow().RefreshProjectTreeAndMessages();
|
||||
if (Current.HasFile()) {
|
||||
Current.getFile().form.ShowCompilationOutput();
|
||||
if (!output.isEmpty())
|
||||
Current.getFile().form.FocusCompilationOut();
|
||||
}
|
||||
if (!badFiles.isEmpty())
|
||||
UI.Error(badFiles);
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
target.joinExistingVersion(version, getDescription());
|
||||
target.migrateFilesSettings(target.last_version, false, false, false);
|
||||
}
|
||||
@Override
|
||||
public JMenuItem createMenuItem() {
|
||||
if (menuItem == null)
|
||||
menuItem = new PassMenuItem(this);
|
||||
return menuItem;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import Repository.BugReport.BugReport;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class DeleteBugReport extends DeleteObjectPass<BugReport> {
|
||||
public DeleteBugReport() {
|
||||
super(BugReport.class);
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart(args) && Current.getAccount().CheckAccessRights(target.sender_address, Log);
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
passes.get(PassCode_2021.DeleteBugReportFromServer).Do(target);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.componentsServer.db;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Repository.BugReport.BugReport;
|
||||
import Repository.BugReport.BugReportState;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
public class DeleteBugReportFromServer extends ComponentsRepositoryPass<BugReport> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
target = (BugReport) args[0];
|
||||
return !target.state.equals(BugReportState.draft);
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.DeleteObject,"", target));
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
public class DeleteCompiler extends DeleteObjectPass<Compiler> {
|
||||
public DeleteCompiler() {
|
||||
super(Compiler.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.DVMParameter.DVMParameter;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
public class DeleteDVMParameter extends DeleteObjectPass<DVMParameter> {
|
||||
public DeleteDVMParameter() {
|
||||
super(DVMParameter.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Tasks.Task;
|
||||
import Visual_DVM_2021.Passes.CurrentProjectPass;
|
||||
|
||||
import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
public class DeleteDebugResults extends CurrentProjectPass {
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
Global.db.compilationTasks.ClearUI();
|
||||
Global.db.runTasks.ClearUI();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
Vector<Task> toDelete = Global.db.compilationTasks.Data.values().stream().filter(task -> task.belongsToProject(target)).collect(Collectors.toCollection(Vector::new));
|
||||
Global.db.runTasks.Data.values().stream().filter(task -> task.belongsToProject(target)).forEach(toDelete::add);
|
||||
for (Task task : toDelete) {
|
||||
Utils.forceDeleteWithCheck(task.getLocalWorkspace());
|
||||
Global.db.Delete(task);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
Global.db.compilationTasks.ShowUI();
|
||||
Global.db.runTasks.ShowUI();
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import Visual_DVM_2021.Passes.ChangeFilePass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.PassException;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Vector;
|
||||
public class DeleteDirectory extends ChangeFilePass {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
resetArgs();
|
||||
dst_node = Current.getProjectNode();
|
||||
if ((dst_node != null) && (dst_node.getUserObject() instanceof File)) {
|
||||
target_dir = Current.getSelectedDirectory();
|
||||
if (target_dir.equals(project.Home)) {
|
||||
Log.Writeln("Нельзя удалять домашнюю папку проекта.");
|
||||
return false;
|
||||
}
|
||||
return (UI.Warning("Удалить папку\n" + Utils.Brackets(target_dir.getAbsolutePath())
|
||||
+ "\n и всё её содержимое."));
|
||||
} else Log.Writeln_("Папка не выделена.");
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
if (Current.HasFile() && (Utils.isAnchestor(Current.getFile().file, target_dir)))
|
||||
passes.get(PassCode_2021.CloseCurrentFile).Do();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
FileUtils.deleteDirectory(target_dir);
|
||||
if (target_dir.exists()) throw new PassException("Не удалось удалить папку");
|
||||
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RemoveNode(dst_node);
|
||||
Vector<DBProjectFile> to_delete = new Vector<>();
|
||||
for (DBProjectFile file : project.db.files.Data.values()) {
|
||||
if (Utils.isAnchestor(file.file, target_dir))
|
||||
to_delete.add(file);
|
||||
}
|
||||
//так как имя первичный ключ приходится удалять их из бд проекта.
|
||||
for (DBProjectFile file : to_delete) {
|
||||
file.CleanAll();
|
||||
file.father.db.Delete(file);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
Current.set(Current.SelectedDirectory, null);
|
||||
Current.set(Current.ProjectNode, null);
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Vector;
|
||||
public class DeleteDownloadedBugReports extends Pass_2021<Vector<File>> {
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean needsConfirmations() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = null;
|
||||
File workspace = Global.visualiser.getWorkspace();
|
||||
File[] files = workspace.listFiles(pathname -> pathname.isDirectory() && pathname.getName().toLowerCase().startsWith("bugreport_"));
|
||||
if (files != null) {
|
||||
target = new Vector<>(Arrays.asList(files));
|
||||
return UI.Warning("Будет удалено " + target.size() + " скачанных отчётов об ошибках." +
|
||||
(Current.HasProject() ? "(Текущий проект будет закрыт)" : "")
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
if (Current.HasProject())
|
||||
passes.get(PassCode_2021.CloseCurrentProject).Do();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
for (File file : target) {
|
||||
ShowMessage1(file.getAbsolutePath());
|
||||
Utils.forceDeleteWithCheck(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.EnvironmentValue.EnvironmentValue;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
public class DeleteEnvironmentValue extends DeleteObjectPass<EnvironmentValue> {
|
||||
public DeleteEnvironmentValue() {
|
||||
super(EnvironmentValue.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import Visual_DVM_2021.Passes.ChangeFilePass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class DeleteFile extends ChangeFilePass<DBProjectFile> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
resetArgs();
|
||||
return (Current.Check(Log, Current.SelectedFile)) &&
|
||||
UI.Warning("Удалить файл "
|
||||
+ Utils.Brackets((target = Current.getSelectedFile()).name));
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
if (Current.HasFile() && (Current.getFile().file.equals(target.file)))
|
||||
passes.get(PassCode_2021.CloseCurrentFile).Do();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RemoveNode(target.node);
|
||||
project.db.Delete(target);
|
||||
Utils.forceDeleteWithCheck(target.file);
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
Current.set(Current.SelectedFile, null);
|
||||
Current.set(Current.ProjectNode, null);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObject;
|
||||
public class DeleteGroup extends DeleteServerObject<TestingServer, Group> {
|
||||
public DeleteGroup() {
|
||||
super(Global.testingServer, Group.class);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class DeleteLonelyM extends Pass_2021<db_project_info> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.Root)) {
|
||||
target = Current.getRoot();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
Vector<db_project_info> targets = target.getLonelyM();
|
||||
System.out.println(targets.size());
|
||||
for (db_project_info m : targets) {
|
||||
passes.get(PassCode_2021.DeleteVersion).Do(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Machine.Machine;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
public class DeleteMachine extends DeleteObjectPass<Machine> {
|
||||
public DeleteMachine() {
|
||||
super(Machine.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Makefile.Makefile;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
public class DeleteMakefile extends DeleteObjectPass<Makefile> {
|
||||
public DeleteMakefile() {
|
||||
super(Makefile.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.SapforProfile.SapforProfile;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
public class DeleteProfile extends DeleteObjectPass<SapforProfile> {
|
||||
public DeleteProfile() {
|
||||
super(SapforProfile.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.RunConfiguration.RunConfiguration;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
public class DeleteRunConfiguration extends DeleteObjectPass<RunConfiguration> {
|
||||
public DeleteRunConfiguration() {
|
||||
super(RunConfiguration.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObject;
|
||||
public class DeleteSapforConfiguration extends DeleteServerObject<TestingServer, SapforConfiguration> {
|
||||
public DeleteSapforConfiguration() {
|
||||
super(Global.testingServer, SapforConfiguration.class);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObject;
|
||||
public class DeleteSapforConfigurationCommand extends DeleteServerObject<TestingServer, SapforConfigurationCommand> {
|
||||
public DeleteSapforConfigurationCommand() {
|
||||
super(Global.testingServer, SapforConfigurationCommand.class);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackageState;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerAccountObject;
|
||||
public class DeleteSapforTasksPackage extends DeleteServerAccountObject<SapforTasksPackage> {
|
||||
public DeleteSapforTasksPackage() {
|
||||
super(SapforTasksPackage.class);
|
||||
}
|
||||
public boolean checkActivity() {
|
||||
if (!target.state.equals(TasksPackageState.Done) && !target.state.equals(TasksPackageState.Aborted)) {
|
||||
Log.Writeln_("Нельзя удалить активный пакет!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart(args) && checkActivity();
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
UI.getMainWindow().getTestingWindow().DropSapforComparison();
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
Utils.delete_with_check(target.getLocalWorkspace());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
import GlobalData.Tasks.RunTask.RunTask;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class DeleteSelectedCompilationTasks extends Pass_2021<Vector<CompilationTask>> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = new Vector<>();
|
||||
Global.db.compilationTasks.Data.values().stream().filter(task -> task.isVisible() && task.isSelected() && task.isPassive()).forEach(task -> target.add(task));
|
||||
if (target.isEmpty()) {
|
||||
Log.Writeln_("Не отмечено ни одной задачи для удаления.");
|
||||
return false;
|
||||
} else return true;
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
Global.db.compilationTasks.ClearUI();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
for (CompilationTask task : target) {
|
||||
for (RunTask runTask : task.getRunTasks().values()) {
|
||||
Global.db.Delete(runTask);
|
||||
Utils.forceDeleteWithCheck(runTask.getLocalWorkspace());
|
||||
}
|
||||
Global.db.Delete(task);
|
||||
Utils.forceDeleteWithCheck(task.getLocalWorkspace());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
Global.db.compilationTasks.ShowUI();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import Visual_DVM_2021.Passes.DeleteSelectedServerObjects;
|
||||
public class DeleteSelectedConfigurations extends DeleteSelectedServerObjects {
|
||||
public DeleteSelectedConfigurations() {
|
||||
super(Configuration.class);
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class DeleteSelectedFiles extends Pass_2021 {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.getProject().db.files.getCheckedCount() == 0) {
|
||||
Log.Writeln_("Не отмечено ни одного файла.");
|
||||
return false;
|
||||
}
|
||||
return UI.Warning("Удалить " + Current.getProject().db.files.getCheckedCount() + " файлов.");
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
boolean hasCurrent = false;
|
||||
boolean hasSelected = false;
|
||||
if (Current.HasFile()) {
|
||||
for (DBProjectFile file : Current.getProject().db.files.getCheckedItems()) {
|
||||
if (Current.getFile().file.equals(file.file))
|
||||
hasCurrent = true;
|
||||
if (Current.getSelectedFile().file.equals(file.file))
|
||||
hasSelected = true;
|
||||
}
|
||||
}
|
||||
if (hasCurrent)
|
||||
passes.get(PassCode_2021.CloseCurrentFile).Do();
|
||||
if (hasSelected) {
|
||||
Current.set(Current.SelectedFile, null);
|
||||
Current.set(Current.ProjectNode, null);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
for (DBProjectFile file : Current.getProject().db.files.getCheckedItems()) {
|
||||
ShowMessage1(file.name);
|
||||
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RemoveNode(file.node);
|
||||
Current.getProject().db.Delete(file);
|
||||
Utils.forceDeleteWithCheck(file.file);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Tasks.RunTask.RunTask;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class DeleteSelectedRunTasks extends Pass_2021<Vector<RunTask>> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = new Vector<>();
|
||||
Global.db.runTasks.Data.values().stream().filter(task -> task.isVisible() && task.isSelected() && task.isPassive()).forEach(task -> target.add(task));
|
||||
if (target.isEmpty()) {
|
||||
Log.Writeln_("Не отмечено ни одной задачи для удаления.");
|
||||
return false;
|
||||
} else return true;
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
Global.db.runTasks.ClearUI();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
for (RunTask task : target) {
|
||||
Global.db.Delete(task);
|
||||
Utils.forceDeleteWithCheck(task.getLocalWorkspace());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
Global.db.runTasks.ShowUI();
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class DeleteSelectedVersions extends Pass_2021<Vector<db_project_info>> {
|
||||
boolean has_current_project;
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
has_current_project = false;
|
||||
target = new Vector<>();
|
||||
//------------------------
|
||||
if (!Global.versions_multiselection) {
|
||||
Log.Writeln_("Нажмите правую клавишу мыши, и перейдите в режим выбора версий.");
|
||||
return false;
|
||||
}
|
||||
if (!Current.Check(Log, Current.Root)) {
|
||||
return false;
|
||||
}
|
||||
Vector<db_project_info> allVersions = new Vector<>();
|
||||
Current.getRoot().getSelectedVersions(allVersions);
|
||||
if (allVersions.size() == 0) {
|
||||
Log.Writeln_("Не отмечено ни одной версии.");
|
||||
return false;
|
||||
}
|
||||
int q = Current.getRoot().getSelectedVersionsForDeletion(target);
|
||||
if (Current.HasProject()) {
|
||||
for (db_project_info version : target) {
|
||||
if (Current.getProject().Home.getAbsolutePath().startsWith(version.Home.getAbsolutePath())) {
|
||||
has_current_project = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return UI.Warning("Удалить " + q + " версий.");
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
for (db_project_info version : target)
|
||||
passes.get(PassCode_2021.DeleteVersion).Do(version);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObject;
|
||||
public class DeleteServerSapfor extends DeleteServerObject<TestingServer, ServerSapfor> {
|
||||
public DeleteServerSapfor() {
|
||||
super(Global.testingServer, ServerSapfor.class);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import Repository.Subscribes.Subscriber;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class DeleteSubscriber extends DeleteObjectPass<Subscriber> {
|
||||
public DeleteSubscriber() {
|
||||
super(Subscriber.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.componentsServer.db;
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
passes.get(PassCode_2021.DeleteSubscriberOnServer).Do(target);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Repository.Subscribes.Subscriber;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class DeleteSubscriberOnServer extends ComponentsRepositoryPass<Subscriber> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = (Subscriber) args[0];
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.DeleteObject, "", target));
|
||||
}
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
super.performFinish();
|
||||
passes.get(PassCode_2021.SynchronizeBugReports).Do();
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.CurrentProjectPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class DeleteSubversions extends CurrentProjectPass {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
Vector<db_project_info> targets = new Vector<>(target.versions.values());
|
||||
for (db_project_info m : targets) {
|
||||
passes.get(PassCode_2021.DeleteVersion).Do(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObject;
|
||||
public class DeleteTest extends DeleteServerObject<TestingServer, Test> {
|
||||
public DeleteTest() {
|
||||
super(Global.testingServer, Test.class);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.User.User;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
public class DeleteUser extends DeleteObjectPass<User> {
|
||||
public DeleteUser() {
|
||||
super(User.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class DeleteVersion extends Pass_2021<db_project_info> {
|
||||
db_project_info parent;
|
||||
boolean current;
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
if (args.length > 0) {
|
||||
target = (db_project_info) args[0];
|
||||
current = (Current.getVersion() != null) && Current.getVersion().Home.equals(target.Home);
|
||||
return true;
|
||||
} else {
|
||||
if (((target = Current.getVersion()) != null) && (!Current.hasUI() ||
|
||||
UI.Warning("Удалить " +
|
||||
((Current.HasProject() && target.Home.equals(Current.getProject().Home)) ? "текущий проект" : "версию ")
|
||||
+ Utils.Brackets(target.name)))) {
|
||||
current = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
if (target.parent != null)
|
||||
target.parent.checkLastModification(target);
|
||||
if (Current.HasProject()) {
|
||||
if ((Current.getProject().Home.getAbsolutePath().startsWith(target.Home.getAbsolutePath())))
|
||||
passes.get(PassCode_2021.CloseCurrentProject).Do();
|
||||
}
|
||||
if (Current.hasUI()) {
|
||||
UI.getVersionsWindow().RemoveVersionFromComparison(target);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
Utils.forceDeleteWithCheck(target.Home);
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
parent = target.parent;
|
||||
if (current)
|
||||
Current.set(Current.Version, null);
|
||||
if (parent != null) {
|
||||
UI.getVersionsWindow().getVersionsForm().getTree().RemoveNode(target.node);
|
||||
parent.versions.remove(target.name);
|
||||
} else
|
||||
Current.set(Current.Root, null);
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class DownloadAllBugReportsArchives extends ComponentsRepositoryPass<File> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/DownloadAll.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
passes.get(PassCode_2021.CloseCurrentProject).Do();
|
||||
Current.set(Current.Root, null); //чтобы гарантированно не существовало корня.
|
||||
Utils.CleanDirectory(Global.BugReportsDirectory);
|
||||
}
|
||||
@Override
|
||||
protected int getTimeout() {
|
||||
return 60000;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveAllArchives));
|
||||
response.Unpack(target = Utils.getTempFileName("bugs"));
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return target.exists();
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
File tempFolder = Utils.getTempFileName("bugsBuffer");
|
||||
//-
|
||||
passes.get(PassCode_2021.UnzipFolderPass).Do(
|
||||
target.getAbsolutePath(),
|
||||
tempFolder.getAbsolutePath()
|
||||
);
|
||||
//-
|
||||
//теперь скопировать это в папку Bugs, с нормальными именами через zip
|
||||
File t2 = Paths.get(tempFolder.getAbsolutePath(), "Bugs").toFile();
|
||||
File[] archives = t2.listFiles();
|
||||
if (archives != null) {
|
||||
for (File file : archives) {
|
||||
FileUtils.moveFile(file, Paths.get(Global.BugReportsDirectory.getAbsolutePath(), file.getName() + ".zip").toFile());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import Repository.BugReport.BugReport;
|
||||
import Repository.BugReport.BugReportInterface;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
public class DownloadBugReport extends ComponentsRepositoryPass<BugReport> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
target = (BugReport) args[0];
|
||||
|
||||
|
||||
return !BugReportInterface.getArchiveFile(target).exists();
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
Utils.CheckDirectory(Global.BugReportsDirectory);
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveBugReport, target.id));
|
||||
Utils.unpackFile((byte[]) response.object, BugReportInterface.getArchiveFile(target));
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return BugReportInterface.getArchiveFile(target).exists();
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Utils.Utils;
|
||||
import Repository.Component.Component;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
public class DownloadComponent extends ComponentsRepositoryPass<Component> {
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
target = Current.getComponent();
|
||||
String packed = target.getComponentType()+"\n"+target.getFileName();
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveComponent, packed));
|
||||
Utils.unpackFile((byte[]) response.object, target.getNewFile());
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.RemoteFile.RemoteFile;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.PassException;
|
||||
import Visual_DVM_2021.Passes.SSH.CurrentConnectionPass;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class DownloadProject extends CurrentConnectionPass {
|
||||
private static final int maxSize = 10240;
|
||||
boolean dialogOK = false;
|
||||
RemoteFile src;
|
||||
RemoteFile remote_archive;
|
||||
File local_archive;
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
dialogOK = (UI.getRemoteFileChooser().ShowDialog(getDescription(), this, true));
|
||||
if (dialogOK) {
|
||||
src = Current.getRemoteFile();
|
||||
System.out.println(Current.getRemoteFile());
|
||||
remote_archive = new RemoteFile(src.full_name, src.name + ".zip", false);
|
||||
local_archive = Utils.getTempFileName(remote_archive.name);
|
||||
if ((getFileKBSize(src.full_name)) <= maxSize) {
|
||||
ShowMessage2("Запаковка папки проекта..");
|
||||
Command(
|
||||
"cd " + Utils.DQuotes(src.full_name),
|
||||
"zip -r " + Utils.DQuotes(remote_archive.full_name) + " ./"
|
||||
);
|
||||
// try {
|
||||
ShowMessage2("Загрузка проекта..");
|
||||
getSingleFile(remote_archive.full_name, local_archive.getAbsolutePath());
|
||||
// } catch (Exception ex) {
|
||||
// throw new PassException("Ошибка загрузки");
|
||||
// }
|
||||
sftpChannel.rm(remote_archive.full_name);
|
||||
} else throw new PassException("Размер проекта превышает " + maxSize + " KB.\n");
|
||||
} else {
|
||||
//диалога не вышло, сбрасываем файл.
|
||||
Current.set(Current.RemoteFile, null);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
Current.Check(Log, Current.RemoteFile);
|
||||
return (Log.isEmpty());
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
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) + " успешно загружен. Открыть его"))
|
||||
passes.get(PassCode_2021.OpenCurrentProject).Do(project);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import Visual_DVM_2021.Passes.ProcessPass;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class DownloadRepository extends ProcessPass {
|
||||
File dvmHome;
|
||||
File sapforHome;
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
dvmHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
|
||||
"dvm").toFile();
|
||||
sapforHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
|
||||
"sapfor").toFile();
|
||||
return true;
|
||||
}
|
||||
private void synchronize(String src, File dst) throws Exception {
|
||||
File loadedFile = Paths.get(dst.getAbsolutePath(), Constants.LOADED).toFile();
|
||||
if (loadedFile.exists()) {
|
||||
PerformScript("cd " +
|
||||
dst.getAbsolutePath() +
|
||||
"\nsvn update " + Constants.REPOSITORY_AUTHENTICATION + "\n");
|
||||
} else {
|
||||
Utils.CleanDirectory(dst);
|
||||
PerformScript("cd Repo\nsvn checkout " + Constants.REPOSITORY_AUTHENTICATION + " " + src + "\n"); //export
|
||||
FileUtils.write(loadedFile, "+");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
ShowProgress(2, 0, true);
|
||||
synchronize(Constants.DVM_REPOSITORY, dvmHome);
|
||||
ShowProgress(2, 1, true);
|
||||
synchronize(Constants.SAPFOR_REPOSITORY, sapforHome);
|
||||
ShowProgress(2, 2, true);
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Utils.Utils;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackageState;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
|
||||
import java.io.File;
|
||||
public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPackage> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/DownloadBugReport.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
File tmpArchive = null;
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (args.length > 0) {
|
||||
target = (SapforTasksPackage) args[0];
|
||||
} else {
|
||||
if (Current.Check(Log, Current.SapforTasksPackage))
|
||||
target = Current.getSapforTasksPackage();
|
||||
else return false;
|
||||
}
|
||||
//-
|
||||
if (!target.state.equals(TasksPackageState.Done)) {
|
||||
Log.Writeln_("Пакет не завершен.");
|
||||
return false;
|
||||
}
|
||||
if (target.isLoaded()) {
|
||||
System.out.println("Пакет уже загружен");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.DownloadSapforTasksPackage, Current.getAccount().email, target.id));
|
||||
response.Unpack(tmpArchive = Utils.getTempFileName(String.valueOf(target.id)));
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return tmpArchive != null && tmpArchive.exists();
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
passes.get(PassCode_2021.UnpackSapforTasksPackage).Do(tmpArchive, target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import TestingSystem.DVM.Tasks.TestRunTask;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
public class DownloadTaskTest extends DownloadTest {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = null;
|
||||
if (Current.getAccount().CheckRegistered(Log) && Current.Check(Log, Current.TestRunTask)) {
|
||||
TestRunTask task = Current.getTestRunTask();
|
||||
//-- квазиобъект, нам от него нужно только имя.
|
||||
target = new Test();
|
||||
target.id = task.test_id;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
public class DownloadTest extends TestingSystemPass<Test> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/DownloadBugReport.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.getAccount().CheckRegistered(Log) && Current.Check(Log, Current.Test)) {
|
||||
target = Current.getTest();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
passes.get(PassCode_2021.CloseCurrentProject).Do();
|
||||
Current.set(Current.Root, null); //чтобы гарантированно не существовало корня.
|
||||
Utils.forceDeleteWithCheck(target.getArchive());
|
||||
Utils.forceDeleteWithCheck(target.getHomePath());
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.DownloadTest, String.valueOf(target.id)));
|
||||
response.Unpack(target.getArchive());
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return target.getArchive().exists();
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
if (passes.get(PassCode_2021.UnzipFolderPass).Do(
|
||||
target.getArchive().getAbsolutePath(),
|
||||
Global.visualiser.getWorkspace().getAbsolutePath(), false
|
||||
))
|
||||
if (UI.Question("Тестовый проект успешно загружен под именем\n" +
|
||||
Utils.Brackets(target.getHomePath().getName()) +
|
||||
"\nОткрыть его"))
|
||||
passes.get(PassCode_2021.OpenCurrentProject).Do(target.getHomePath());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Visual_DVM_2021.Passes.CurrentProjectPass;
|
||||
public class DropAnalyses extends CurrentProjectPass {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart(args) && (Current.getSapfor() != null);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class DropFastAccess extends Pass_2021 {
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
for (Pass_2021 pass : Pass_2021.FAPasses) {
|
||||
pass.stats.Drop();
|
||||
Global.db.Update(pass.stats);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
UI.fastAccessMenuBar.Drop();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import GlobalData.DBLastProject.DBLastProject;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class DropLastProjects extends Pass_2021 {
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
Global.db.DeleteAll(DBLastProject.class);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import ProjectData.DBArray.DBArray;
|
||||
import Visual_DVM_2021.Passes.CurrentProjectPass;
|
||||
public class DropSavedArrays extends CurrentProjectPass {
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
target.db.DeleteAll(DBArray.class);
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
target.db.savedArrays.ShowUI();
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import Repository.EmailMessage;
|
||||
import Repository.Subscribes.Subscriber;
|
||||
import Repository.Subscribes.UI.SubscriberForm;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Vector;
|
||||
public class EditAccount extends Email {
|
||||
public String name;
|
||||
public String email;
|
||||
String password;
|
||||
SubscriberForm f = new SubscriberForm(){
|
||||
{
|
||||
fields.cbRole.setEnabled(false);
|
||||
}
|
||||
};
|
||||
public static int getRandomIntegerBetweenRange(int min, int max) {
|
||||
return (int) ((Math.random() * ((max - min) + 1)) + min);
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
Subscriber res = new Subscriber(); // объект для заполнения полей.не более.
|
||||
if (f.ShowDialog("Регистрация", res)) {
|
||||
if (!Utils.validateEmail(res.address, Log)) {
|
||||
return false;
|
||||
}
|
||||
name = res.name;
|
||||
email = res.address;
|
||||
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 false;
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
String attempt = null;
|
||||
do {
|
||||
attempt = JOptionPane.showInputDialog(null,
|
||||
new String[]{"Введите код активации, полученный по почте"},
|
||||
"Подтверждение адреса почты",
|
||||
JOptionPane.INFORMATION_MESSAGE);
|
||||
if (attempt != null) {
|
||||
System.out.println("Введенный код: " + Utils.Brackets(attempt));
|
||||
if (attempt.equals(password)) {
|
||||
UI.Info("Почта успешно подтверждена!");
|
||||
return true;
|
||||
} else {
|
||||
UI.Error("Неверный код активации.\nПовторите попытку.");
|
||||
}
|
||||
} else {
|
||||
UI.Info("Подтверждение почты отменено");
|
||||
return false;
|
||||
}
|
||||
} while (true);
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
Current.getAccount().name = name;
|
||||
Current.getAccount().email = email;
|
||||
Global.db.Update(Current.getAccount());
|
||||
//это не регистрация. только заполнение почты в своей бд и ее подтверждение на реальность.
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import Visual_DVM_2021.Passes.EditObjectPass;
|
||||
public class EditCompiler extends EditObjectPass<Compiler> {
|
||||
public EditCompiler() {
|
||||
super(Compiler.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import Visual_DVM_2021.Passes.EditObjectPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class EditConfiguration extends EditObjectPass<Configuration> {
|
||||
public EditConfiguration() {
|
||||
super(Configuration.class);
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.Configuration)) {
|
||||
return getTable().ShowEditObjectDialog(target= Current.getConfiguration());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.testingServer.db;
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
//отправка.
|
||||
passes.get(PassCode_2021.EditConfigurationOnServer).Do(target);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
public class EditConfigurationOnServer extends TestingSystemPass<Configuration> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = (Configuration) args[0];
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.EditObject, "", target));
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.DVMParameter.DVMParameter;
|
||||
import Visual_DVM_2021.Passes.EditObjectPass;
|
||||
public class EditDVMParameter extends EditObjectPass<DVMParameter> {
|
||||
public EditDVMParameter() {
|
||||
super(DVMParameter.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.EnvironmentValue.EnvironmentValue;
|
||||
import Visual_DVM_2021.Passes.EditObjectPass;
|
||||
public class EditEnvironmentValue extends EditObjectPass<EnvironmentValue> {
|
||||
public EditEnvironmentValue() {
|
||||
super(EnvironmentValue.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import Visual_DVM_2021.Passes.Server.EditServerObject;
|
||||
public class EditGroup extends EditServerObject<TestingServer, Group> {
|
||||
public EditGroup() {
|
||||
super(Global.testingServer, Group.class);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Machine.Machine;
|
||||
import Visual_DVM_2021.Passes.EditObjectPass;
|
||||
public class EditMachine extends EditObjectPass<Machine> {
|
||||
public EditMachine() {
|
||||
super(Machine.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Makefile.Makefile;
|
||||
import Visual_DVM_2021.Passes.EditObjectPass;
|
||||
public class EditMakefile extends EditObjectPass<Makefile> {
|
||||
public EditMakefile() {
|
||||
super(Makefile.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.Module.Module;
|
||||
import Visual_DVM_2021.Passes.EditObjectPass;
|
||||
public class EditModule extends EditObjectPass<Module> {
|
||||
public EditModule() {
|
||||
super(Module.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.SapforProfile.SapforProfile;
|
||||
import Visual_DVM_2021.Passes.EditObjectPass;
|
||||
public class EditProfile extends EditObjectPass<SapforProfile> {
|
||||
public EditProfile() {
|
||||
super(SapforProfile.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.Windows.Dialog.SessionMaxtimeDialog;
|
||||
import Visual_DVM_2021.Passes.CurrentProjectPass;
|
||||
public class EditProjectCompilationMaxtime extends CurrentProjectPass {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Maxtime.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
SessionMaxtimeDialog f;
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart(args) &&
|
||||
(f = new SessionMaxtimeDialog()).ShowDialog("максимальное время компиляции", Current.getProject().compilation_maxtime);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
target.UpdateCompilationMaxtime(f.Result);
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.Windows.Dialog.SessionMaxtimeDialog;
|
||||
import Visual_DVM_2021.Passes.CurrentProjectPass;
|
||||
public class EditProjectRunMaxtime extends CurrentProjectPass {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Maxtime.png";
|
||||
}
|
||||
SessionMaxtimeDialog f;
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart(args) &&
|
||||
(f = new SessionMaxtimeDialog()).ShowDialog("максимальное время запуска", Current.getProject().run_maxtime);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
target.UpdateRunMaxtime(f.Result);
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import GlobalData.RunConfiguration.RunConfiguration;
|
||||
import Visual_DVM_2021.Passes.EditObjectPass;
|
||||
public class EditRunConfiguration extends EditObjectPass<RunConfiguration> {
|
||||
public EditRunConfiguration() {
|
||||
super(RunConfiguration.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import Visual_DVM_2021.Passes.Server.EditServerObject;
|
||||
public class EditSapforConfiguration extends EditServerObject<TestingServer,SapforConfiguration> {
|
||||
public EditSapforConfiguration() {
|
||||
super(Global.testingServer, SapforConfiguration.class);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user