рефакторинг. неудачные наименования классов, и остатки старых вариантов
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
package Visual_DVM_2021.UI.Interface;
|
||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||
public interface TestingWindow extends VisualizerForm {
|
||||
void ShowAll();
|
||||
void RestoreLastCredentials();
|
||||
@@ -51,6 +50,4 @@ public interface TestingWindow extends VisualizerForm {
|
||||
void ShowLastCompilationTask();
|
||||
void ShowLastRunTask();
|
||||
//-
|
||||
|
||||
void RemoveSapforPackageFromComparison(SapforTasksPackage package_2023);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
package Visual_DVM_2021.UI.Main;
|
||||
import Common.Current;
|
||||
import Common.Database.DataSet;
|
||||
import Common.Global;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.Label.ShortLabel;
|
||||
import Common.UI.Menus_2023.VisualiserMenuBar;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.TextLog;
|
||||
import SapforTestingSystem.SapforTask.SapforTaskResult;
|
||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||
import TestingSystem.Test.ProjectFiles_json;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -33,9 +27,9 @@ public class SapforPackagesComparisonForm {
|
||||
SapforPackagesComparisonForm slave = null;
|
||||
SapforPackagesComparisonForm master = null;
|
||||
//-->>
|
||||
protected SapforTasksPackage object = null;
|
||||
// protected SapforConfigurationTasksSet object = null;
|
||||
//-->>
|
||||
protected DataSet<String, SapforTaskResult> packageTasks;
|
||||
// protected DataSet<String, SapforTaskResult> packageTasks;
|
||||
protected DataSetControlForm Body;
|
||||
//--->>
|
||||
public boolean isMaster() {
|
||||
@@ -47,12 +41,13 @@ public class SapforPackagesComparisonForm {
|
||||
//--->>
|
||||
//неперегружаемые методы
|
||||
protected void RemoveObject() {
|
||||
object = null;
|
||||
// object = null;
|
||||
showNoObject();
|
||||
}
|
||||
public void ApplyObject() {
|
||||
RemoveObject();
|
||||
TextLog log = new TextLog();
|
||||
/*
|
||||
if (Current.Check(log, getCurrentObjectName())) {
|
||||
object = Current.getSapforTasksPackage();
|
||||
try {
|
||||
@@ -64,9 +59,11 @@ public class SapforPackagesComparisonForm {
|
||||
showObject();
|
||||
} else
|
||||
UI.Info(log.toString());
|
||||
*/
|
||||
}
|
||||
//предполагаем что оба объекта есть и мы можем получить с них текст.
|
||||
protected void Compare() throws Exception {
|
||||
/*
|
||||
//это всегда форма мастер
|
||||
//1. Получить файл теста.Для сапфора ограничение что файл может быть только один.Возможно и для других тоже.
|
||||
// File project_db = new File(object.Home, "project.json");
|
||||
@@ -77,49 +74,15 @@ public class SapforPackagesComparisonForm {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void compareTasks(SapforTaskResult masterTask, SapforTaskResult slaveTask) throws Exception {
|
||||
/*
|
||||
//надо сравнить все сраниваемых проектов.
|
||||
ProjectFiles_json masterFiles = getTaskFiles(masterTask);
|
||||
ProjectFiles_json slaveFiles = getTaskFiles(slaveTask);
|
||||
if (masterFiles.files.size() != slaveFiles.files.size()) {
|
||||
slaveTask.match_state = MatchState.NotMatch;
|
||||
return;
|
||||
}
|
||||
for (DBProjectFile masterDBFile : masterFiles.files) {
|
||||
boolean hasSameFile = false;
|
||||
for (DBProjectFile slaveDBFile : slaveFiles.files) {
|
||||
if (masterDBFile.name.equals(slaveDBFile.name)) {
|
||||
hasSameFile = true;
|
||||
File masterFile = new File(masterTask.last_version, masterDBFile.name);
|
||||
File slaveFile = new File(slaveTask.last_version, slaveDBFile.name);
|
||||
String masterFileText = FileUtils.readFileToString(masterFile);
|
||||
String slaveFileText = FileUtils.readFileToString(slaveFile);
|
||||
slaveTask.match_state = masterFileText.equals(slaveFileText) ? MatchState.Match : MatchState.NotMatch;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasSameFile) {
|
||||
slaveTask.match_state = MatchState.NotMatch;
|
||||
return;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
ProjectFiles_json getTaskFiles(SapforTaskResult task) throws Exception {
|
||||
// File project = new File(task.last_version);
|
||||
// File file_json = new File(project, "project.json");
|
||||
// return Utils.gson.fromJson(FileUtils.readFileToString(file_json), ProjectFiles_json.class);
|
||||
return null;
|
||||
}
|
||||
public void Show() throws Exception {
|
||||
}
|
||||
//Перегружаемые методы.
|
||||
//--->>
|
||||
protected Current getCurrentObjectName() {
|
||||
return Current.SapforTasksPackage;
|
||||
}
|
||||
// protected Current getCurrentObjectName() {
|
||||
// return Current.SapforTasksPackage;
|
||||
// }
|
||||
protected void showNoObject() {
|
||||
lObjectName.setText("?");
|
||||
lObjectName.setToolTipText("Объект не назначен.");
|
||||
@@ -127,12 +90,14 @@ public class SapforPackagesComparisonForm {
|
||||
UI.Clear(tasksPanel);
|
||||
}
|
||||
protected void showObject() {
|
||||
/*
|
||||
lObjectName.setText(object.getPK().toString() + (isMaster() ? "(эталон)" : ""));
|
||||
lObjectName.setToolTipText(object.getPK().toString());
|
||||
flagsLabel.setText(object.flags);
|
||||
//-
|
||||
packageTasks.mountUI(tasksPanel);
|
||||
packageTasks.ShowUI();
|
||||
*/
|
||||
}
|
||||
protected String getText() {
|
||||
return "";
|
||||
@@ -173,7 +138,7 @@ public class SapforPackagesComparisonForm {
|
||||
}
|
||||
//для сравнения по кнопке.
|
||||
public boolean isReady() {
|
||||
return object != null;
|
||||
return false; // object != null;
|
||||
}
|
||||
public void onClose() {
|
||||
RemoveObject();
|
||||
@@ -228,9 +193,4 @@ public class SapforPackagesComparisonForm {
|
||||
};
|
||||
pass.Do();
|
||||
}
|
||||
public void CheckObject(SapforTasksPackage object_in) {
|
||||
if ((object != null) && object_in.id == (object.id)) {
|
||||
RemoveObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import Common.UI.TextField.StyledTextField;
|
||||
import Common.UI.UI;
|
||||
import GlobalData.Compiler.CompilerType;
|
||||
import GlobalData.Credentials.Credentials;
|
||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||
import TestingSystem.Configuration.UI.ConfigurationDBTable;
|
||||
import TestingSystem.Group.Group;
|
||||
import TestingSystem.MachineMaxKernels.MachineMaxKernels;
|
||||
@@ -121,7 +120,6 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
Global.db.machines.mountUI(machinesPanel);
|
||||
Global.db.users.mountUI(usersPanel);
|
||||
Global.db.compilers.mountUI(compilersPanel);
|
||||
Global.db.remoteSapfors.mountUI(sapforsPanel);
|
||||
Global.db.makefiles.mountUI(makefilesPanel);
|
||||
//-----------------------------------------------
|
||||
Global.db.modules.mountUI(modulesPanel);
|
||||
@@ -153,8 +151,8 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
Global.testingServer.db.sapforConfigurations.mountUI(sapforConfigurationsPanel);
|
||||
Global.testingServer.db.sapforConfigurationCommands.mountUI(sapforConfigurationCommandsPanel);
|
||||
Global.testingServer.db.serverSapfors.mountUI(serverSapforsPanel);
|
||||
Global.testingServer.db.sapforScenarios.mountUI(sapforScenariosPanel);
|
||||
Global.testingServer.db.sapforTasksPackages.mountUI(sapforPackagesPanel);
|
||||
Global.testingServer.db.sapforTasksPackages.mountUI(sapforScenariosPanel);
|
||||
// Global.testingServer.db.sapforTasksPackages.mountUI(sapforPackagesPanel);
|
||||
|
||||
//Global.db.sapforTasks.mountUI(sapforTasksPanel);
|
||||
// Global.testingServer.account_db.sapforTasksPackages.mountUI(sapforPackagesPanel);
|
||||
@@ -191,7 +189,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
Global.testingServer.account_db.packages.ShowUI();
|
||||
Global.testingServer.db.serverSapfors.ShowUI();
|
||||
Global.testingServer.db.sapforConfigurations.ShowUI();
|
||||
Global.testingServer.db.sapforScenarios.ShowUI();
|
||||
Global.testingServer.db.sapforTasksPackages.ShowUI();
|
||||
}
|
||||
//-
|
||||
@Override
|
||||
@@ -388,12 +386,14 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
credentials.runconfiguration_id = Constants.Nan;
|
||||
Global.db.UpdateCredentials();
|
||||
}
|
||||
/*
|
||||
if (Global.db.remoteSapfors.containsKey(credentials.remotesapfor_id)) {
|
||||
Global.db.remoteSapfors.ShowUI(credentials.remotesapfor_id);
|
||||
} else {
|
||||
credentials.remotesapfor_id = Constants.Nan;
|
||||
Global.db.UpdateCredentials();
|
||||
}
|
||||
*/
|
||||
} else {
|
||||
credentials.machine_id = Constants.Nan;
|
||||
credentials.user_id = Constants.Nan;
|
||||
@@ -429,15 +429,6 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
}
|
||||
@Override
|
||||
public void ShowCurrentSapforTasksPackage() {
|
||||
/*
|
||||
UI.Clear(packageVersionsPanel);
|
||||
if (Current.getSapforTasksPackage().root != null) {
|
||||
PackageVersionsTree tree = new PackageVersionsTree();
|
||||
packageVersionsPanel.add(new JScrollPane(tree));
|
||||
packageVersionsPanel.revalidate();
|
||||
packageVersionsPanel.repaint();
|
||||
}
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
public void ShowNoSapforTasksPackage() {
|
||||
@@ -476,11 +467,6 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
singleRunTaskMaster.ApplyObject();
|
||||
}
|
||||
@Override
|
||||
public void RemoveSapforPackageFromComparison(SapforTasksPackage package_2023) {
|
||||
sapforTestingMaster.CheckObject(package_2023);
|
||||
sapforTestingSlave.CheckObject(package_2023);
|
||||
}
|
||||
@Override
|
||||
public void DropSapforTasksComparison() {
|
||||
sapforTestingMaster.RemoveObject();
|
||||
sapforTestingSlave.RemoveObject();
|
||||
|
||||
Reference in New Issue
Block a user