no message
This commit is contained in:
@@ -1,11 +1,59 @@
|
||||
package TestingSystem.SAPFOR.SapforConfiguration;
|
||||
import Common.Database.rDBObject;
|
||||
public class SapforConfiguration extends rDBObject {
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.riDBObject;
|
||||
import Common.Global;
|
||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class SapforConfiguration extends riDBObject {
|
||||
//настройки.
|
||||
public int maxtime = 300; //лимит времени преобразования.
|
||||
public int maxtime = 300; //лимит времени преобразования. (пока не используется)
|
||||
public int FREE_FORM = 0; //"Свободный выходной стиль"; -f90
|
||||
public int STATIC_SHADOW_ANALYSIS=0;//"Оптимизация теневых обменов"; -sh
|
||||
public int MAX_SHADOW_WIDTH=50; // "Максимальный размер теневых граней"; (%) -shwidth значение поля
|
||||
public int KEEP_SPF_DIRECTIVES=0; //"Сохранять SPF директивы при построении параллельных вариантов"; -keepSPF
|
||||
public int STATIC_SHADOW_ANALYSIS = 0;//"Оптимизация теневых обменов"; -sh
|
||||
public int MAX_SHADOW_WIDTH = 50; // "Максимальный размер теневых граней"; (%) -shwidth значение поля
|
||||
public int KEEP_SPF_DIRECTIVES = 0; //"Сохранять SPF директивы при построении параллельных вариантов"; -keepSPF
|
||||
public int KEEP_DVM_DIRECTIVES = 0;// "Учитывать DVM директивы"; -keepDVM
|
||||
//----
|
||||
public String getFlags() {
|
||||
Vector<String> res = new Vector<>();
|
||||
if (FREE_FORM > 0)
|
||||
res.add("-f90");
|
||||
if (STATIC_SHADOW_ANALYSIS > 0)
|
||||
res.add("-sh");
|
||||
if (MAX_SHADOW_WIDTH > 0)
|
||||
res.add("-shwidth " + MAX_SHADOW_WIDTH);
|
||||
if (KEEP_DVM_DIRECTIVES > 0)
|
||||
res.add("-keepDVM");
|
||||
if (KEEP_SPF_DIRECTIVES > 0)
|
||||
res.add("-keepSPF");
|
||||
return String.join(" ", res);
|
||||
}
|
||||
//-
|
||||
public Vector<PassCode_2021> getPassCodes() {
|
||||
Vector<PassCode_2021> res = new Vector<>();
|
||||
for (SapforConfigurationCommand command : Global.testingServer.db.sapforConfigurationCommands.Data.values()) {
|
||||
if (command.sapforconfiguration_id == id) {
|
||||
res.add(command.passCode);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
SapforConfiguration c = (SapforConfiguration) src;
|
||||
maxtime = c.maxtime;
|
||||
FREE_FORM = c.FREE_FORM;
|
||||
STATIC_SHADOW_ANALYSIS = c.STATIC_SHADOW_ANALYSIS;
|
||||
MAX_SHADOW_WIDTH = c.MAX_SHADOW_WIDTH;
|
||||
KEEP_SPF_DIRECTIVES = c.KEEP_SPF_DIRECTIVES;
|
||||
KEEP_DVM_DIRECTIVES = c.KEEP_DVM_DIRECTIVES;
|
||||
}
|
||||
public SapforConfiguration(SapforConfiguration sapforConfiguration) {
|
||||
this.SynchronizeFields(sapforConfiguration);
|
||||
}
|
||||
public SapforConfiguration() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ import TestingSystem.SAPFOR.SapforConfiguration.UI.SapforConfigurationFields;
|
||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
public class SapforConfigurationDBTable extends DBTable<String, SapforConfiguration> {
|
||||
public class SapforConfigurationDBTable extends iDBTable<SapforConfiguration> {
|
||||
public SapforConfigurationDBTable() {
|
||||
super(String.class, SapforConfiguration.class);
|
||||
super(SapforConfiguration.class);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
@@ -33,17 +33,7 @@ public class SapforConfigurationDBTable extends DBTable<String, SapforConfigurat
|
||||
}
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
columns.get(0).setVisible(false);
|
||||
}
|
||||
@Override
|
||||
public void ShowCurrentObject() throws Exception {
|
||||
super.ShowCurrentObject();
|
||||
// Global.db.sapforTasksPackages.ShowUI();
|
||||
}
|
||||
@Override
|
||||
public void ShowNoCurrentObject() throws Exception {
|
||||
super.ShowNoCurrentObject();
|
||||
// Global.db.sapforTasksPackages.ClearUI();
|
||||
//columns.get(0).setVisible(false);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -63,7 +53,7 @@ public class SapforConfigurationDBTable extends DBTable<String, SapforConfigurat
|
||||
case 3:
|
||||
return object.sender_name;
|
||||
case 4:
|
||||
return SapforConfigurationInterface.getFlags(object);
|
||||
return object.getFlags();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforConfiguration;
|
||||
import Common.Global;
|
||||
import Common.Utils.TextLog;
|
||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class SapforConfigurationInterface {
|
||||
public static String getFlags(SapforConfiguration object) {
|
||||
Vector<String> res = new Vector<>();
|
||||
if (object.FREE_FORM > 0)
|
||||
res.add("-f90");
|
||||
if (object.STATIC_SHADOW_ANALYSIS > 0)
|
||||
res.add("-sh");
|
||||
if (object.MAX_SHADOW_WIDTH > 0)
|
||||
res.add("-shwidth " + object.MAX_SHADOW_WIDTH);
|
||||
if (object.KEEP_DVM_DIRECTIVES > 0)
|
||||
res.add("-keepDVM");
|
||||
if (object.KEEP_SPF_DIRECTIVES > 0)
|
||||
res.add("-keepSPF");
|
||||
return String.join(" ", res);
|
||||
}
|
||||
public static Vector<PassCode_2021> getPassCodes(SapforConfiguration object) {
|
||||
Vector<PassCode_2021> res = new Vector<>();
|
||||
for (SapforConfigurationCommand command : Global.testingServer.db.sapforConfigurationCommands.Data.values()) {
|
||||
if (command.sapforconfiguration_id.equals(object.id)) {
|
||||
res.add(command.passCode);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//todo вывести.
|
||||
public static boolean validateCommands(SapforConfiguration sapforConfiguration, TextLog log) {
|
||||
//1. получить список всех команд.
|
||||
Vector<SapforConfigurationCommand> commands = new Vector<>();
|
||||
int count = 0;
|
||||
for (SapforConfigurationCommand command : Global.testingServer.db.sapforConfigurationCommands.Data.values()) {
|
||||
if (command.sapforconfiguration_id.equals(sapforConfiguration.id)) {
|
||||
commands.add(command);
|
||||
if (command.passCode.equals(PassCode_2021.CreateParallelVariants))
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if ((count == 0) || commands.isEmpty())
|
||||
return true;
|
||||
//--
|
||||
if (count > 2) {
|
||||
log.Writeln_("Неверная конфигурация:" + sapforConfiguration.id + ": построение параллельных вариантов возможно единожды.");
|
||||
return false;
|
||||
}
|
||||
//--
|
||||
if (count == 1) {
|
||||
if (commands.size() == 1) return true;
|
||||
if (!commands.lastElement().passCode.equals(PassCode_2021.CreateParallelVariants)) {
|
||||
log.Writeln_("Неверная конфигурация:" + sapforConfiguration.id + ": построение параллельных вариантов может быть только завершающей командой!");
|
||||
return false;
|
||||
}
|
||||
;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
package TestingSystem.SAPFOR.SapforConfigurationCommand;
|
||||
import Common.Database.rDBObject;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Database.riDBObject;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class SapforConfigurationCommand extends rDBObject {
|
||||
@Description("DEFAULT ''")
|
||||
public String sapforconfiguration_id = "";
|
||||
public class SapforConfigurationCommand extends riDBObject {
|
||||
@Description("DEFAULT -1")
|
||||
public int sapforconfiguration_id = Constants.Nan;
|
||||
public PassCode_2021 passCode = PassCode_2021.SPF_RemoveDvmDirectives;
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return SapforConfigurationCommandInterface.isVisible(this);
|
||||
return Current.HasSapforConfiguration() && (Current.getSapforConfiguration().id == sapforconfiguration_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforConfigurationCommand;
|
||||
import Common.Current;
|
||||
public class SapforConfigurationCommandInterface {
|
||||
public static boolean isVisible(SapforConfigurationCommand object) {
|
||||
return Current.HasSapforConfiguration() && (Current.getSapforConfiguration().id.equals(object.sapforconfiguration_id));
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
package TestingSystem.SAPFOR.SapforConfigurationCommand;
|
||||
import Common.Current;
|
||||
import Common.Database.DBTable;
|
||||
import Common.Database.iDBTable;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.UI;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.UI.SapforConfigurationCommandFields;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class SapforConfigurationCommandsDBTable extends DBTable<String, SapforConfigurationCommand> {
|
||||
public class SapforConfigurationCommandsDBTable extends iDBTable<SapforConfigurationCommand> {
|
||||
public SapforConfigurationCommandsDBTable() {
|
||||
super(String.class, SapforConfigurationCommand.class);
|
||||
super(SapforConfigurationCommand.class);
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
@@ -62,15 +62,6 @@ public class SapforConfigurationCommandsDBTable extends DBTable<String, SapforCo
|
||||
Result.passCode = (PassCode_2021) fields.cbPassCode.getSelectedItem();
|
||||
Result.sapforconfiguration_id = Current.getSapforConfiguration().id;
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
/*
|
||||
Vector<ScenarioCommand> commands = new Vector<>(Current.getSapforConfiguration().getCommands().values());
|
||||
if (!commands.isEmpty()&&commands.get(commands.size()-1).passCode.equals(PassCode_2021.CreateParallelVariantsCoverageForScenario)){
|
||||
Log.Writeln_("После построения покрытия вариантов запрещено добавлять другие команды в сценарий.");
|
||||
}
|
||||
*/
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,18 +5,17 @@ import Common.Global;
|
||||
import Common.GlobalProperties;
|
||||
import Common.Utils.Utils;
|
||||
import Repository.Server.ServerCode;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TestingPlanner;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackageState;
|
||||
import TestingSystem.SAPFOR.Json.SapforConfiguration_json;
|
||||
import TestingSystem.SAPFOR.Json.SapforTasksPackage_json;
|
||||
import TestingSystem.SAPFOR.Json.SapforTasksResults_json;
|
||||
import TestingSystem.SAPFOR.Json.SapforTest_json;
|
||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfigurationInterface;
|
||||
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackageState;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TestingPlanner;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import javafx.util.Pair;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@@ -39,7 +38,7 @@ public class SapforTasksPackageSupervisor {
|
||||
Vector<Object> tests_ = (Vector<Object>) planner.ServerCommand(ServerCode.GetObjectsCopiesByPK, "", new Pair<>(Test.class, testsIds));
|
||||
Vector<Object> configurations_ = (Vector<Object>) planner.ServerCommand(ServerCode.GetObjectsCopiesByPK, "", new Pair<>(SapforConfiguration.class, configurationsIds));
|
||||
LinkedHashMap<Integer, Test> tests = new LinkedHashMap<>();
|
||||
LinkedHashMap<String, SapforConfiguration> configurations = new LinkedHashMap<>();
|
||||
LinkedHashMap<Integer, SapforConfiguration> configurations = new LinkedHashMap<>();
|
||||
Vector<Integer> groupsIds = new Vector<>();
|
||||
LinkedHashMap<Integer, Group> groups = new LinkedHashMap<>();
|
||||
//--
|
||||
@@ -107,9 +106,9 @@ public class SapforTasksPackageSupervisor {
|
||||
//--
|
||||
SapforConfiguration_json configuration_json = new SapforConfiguration_json();
|
||||
configuration_json.id = String.valueOf(configuration_id);
|
||||
configuration_json.flags = SapforConfigurationInterface.getFlags(configuration);
|
||||
configuration_json.flags = configuration.getFlags();
|
||||
configuration_json.codes.add(PassCode_2021.SPF_CorrectCodeStylePass); //всегда добавляется.
|
||||
configuration_json.codes.addAll(SapforConfigurationInterface.getPassCodes(configuration));
|
||||
configuration_json.codes.addAll(configuration.getPassCodes());
|
||||
//--->>
|
||||
package_json.configurations.add(configuration_json);
|
||||
//-->>
|
||||
|
||||
Reference in New Issue
Block a user