промежуточный. вариант с разбитием конфигурации сапфора и настройки как отдельный объект

This commit is contained in:
2024-09-27 22:50:47 +03:00
parent 30b51180c4
commit 4547fd10bd
27 changed files with 777 additions and 69 deletions

View File

@@ -21,6 +21,7 @@ import Repository.Subscribes.Subscriber;
import TestingSystem.Common.Test.Test;
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import Visual_DVM_2021.Passes.UI.PassForm;
import javax.swing.tree.DefaultMutableTreeNode;
@@ -106,7 +107,10 @@ public enum Current {
//--
ProjectView,
SubscriberWorkspace,
DVMRunTask;
DVMRunTask,
SapforSettings,
SapforSettingsCommand
;
//-
private static final LinkedHashMap<Current, Object> objects = new LinkedHashMap<>();
public static Mode mode;
@@ -156,6 +160,13 @@ public enum Current {
return get(ProjectView) != null;
}
//для быстрого доступа на чтение. слишком много на нем завязано.
public static SapforSettings getSapforSettings() {
return (SapforSettings) get(SapforSettings);
}
public static boolean HasSapforSettings() {
return get(SapforSettings) != null;
}
public static db_project_info getProject() {
return (db_project_info) get(Project);
}
@@ -375,6 +386,10 @@ public enum Current {
//--------------------------------------------
public String getDescription() {
switch (this) {
case SapforSettings:
return "Настройки системы SAPFOR";
case SapforSettingsCommand:
return "Команда настроек тестирования SAPFOR";
case DVMRunTask:
return "Задача DVM тестирования";
case SapforPackage:

View File

@@ -79,6 +79,10 @@ import TestingSystem.SAPFOR.SapforConfiguration.SapforConfigurationsMenuBar;
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommandsMenuBar;
import TestingSystem.SAPFOR.SapforPackage.SapforPackageDBTable;
import TestingSystem.SAPFOR.SapforSettings.SapforSettingsBar;
import TestingSystem.SAPFOR.SapforSettings.SapforSettingsCommandsBar;
import TestingSystem.SAPFOR.SapforSettings.SapforSettingsDBTable;
import TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommandsDBTable;
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforPackagesBar;
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforVersionsTreeCellRenderer;
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforsBar;
@@ -258,6 +262,8 @@ public class UI {
menuBars.put(SubsribersDBTable.class, new SubscribersMenuBar());
menuBars.put(SapforProfilesDBTable.class, new DataMenuBar("профили", PassCode_2021.SaveProfile, PassCode_2021.EditProfile, PassCode_2021.ApplyProfile, PassCode_2021.DeleteProfile));
menuBars.put(ServerSapforsDBTable.class, new ServerSapforsBar());
menuBars.put(SapforSettingsDBTable.class, new SapforSettingsBar());
menuBars.put(SapforSettingsCommandsDBTable.class, new SapforSettingsCommandsBar());
//---->>
}
public static void CreateWindows() {

View File

@@ -0,0 +1,14 @@
package TestingSystem.Common.Settings;
import Common.Database.DBObject;
import Common.Database.riDBObject;
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
//предопределенный набор настроек тестируемой системы. сохраняется для упрощения.
public abstract class Settings extends riDBObject {
public String flags="";
@Override
public void SynchronizeFields(DBObject src) {
super.SynchronizeFields(src);
Settings s = (Settings) src;
flags=s.flags;
}
}

View File

@@ -25,6 +25,8 @@ import TestingSystem.SAPFOR.Json.SapforPackage_json;
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommand;
import TestingSystem.SAPFOR.SapforTestingPlanner;
import TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforState;
@@ -110,6 +112,16 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
SapforPackage sapforPackage = (SapforPackage) object;
File workspace = sapforPackage.getLocalWorkspace();
Utils.forceDeleteWithCheck(workspace);
} else if (object instanceof SapforSettings) {
SapforSettings sapforSettings = (SapforSettings) object;
Vector<SapforSettingsCommand> commands = new Vector<>();
for (SapforSettingsCommand command : db.sapforSettingsCommands.Data.values()) {
if (command.sapforsettings_id== sapforSettings.id)
commands.add(command);
}
for (SapforSettingsCommand command : commands) {
db.Delete(command);
}
}
}
//-->>>
@@ -641,30 +653,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
afterPublishAction(target);
//--
}
/*
public void PATCH() {
for (DVMPackage testingPackage : db.dvmPackages.Data.values()) {
boolean hasErrors = false;
try {
testingPackage.readJson();
//---------------------------------------------------
for (DVMCompilationTask compilationTask : testingPackage.package_json.compilationTasks) {
if (!compilationTask.state.equals(TaskState.Done))
hasErrors = true;
for (DVMRunTask runTask : compilationTask.runTasks) {
if (!runTask.state.equals(TaskState.Done))
hasErrors = true;
}
}
if (hasErrors)
testingPackage.state = TasksPackageState.DoneWithErrors;
//---------------------------------------------------
db.Update(testingPackage);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
*/
}

View File

@@ -19,6 +19,8 @@ import TestingSystem.SAPFOR.SapforConfiguration.SapforConfigurationDBTable;
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
import TestingSystem.SAPFOR.SapforPackage.SapforPackageDBTable;
import TestingSystem.SAPFOR.SapforSettings.SapforSettingsDBTable;
import TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommandsDBTable;
import TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforState;
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforsDBTable;
@@ -33,7 +35,6 @@ import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.Vector;
public class TestsDatabase extends SQLiteDatabase {
public DVMConfigurationDBTable dvm_configurations;
public TestDBTable tests;
public GroupsDBTable groups;
@@ -48,6 +49,8 @@ public class TestsDatabase extends SQLiteDatabase {
public ServerSapforsDBTable serverSapfors;
//---
public DVMRunTasksSet dvmRunTasks = new DVMRunTasksSet(); //задачи текущего пакета тестирования DVM
public SapforSettingsDBTable sapforSettings;
public SapforSettingsCommandsDBTable sapforSettingsCommands;
//--
public TestsDatabase() {
super(Paths.get(System.getProperty("user.dir"), "Data", Constants.tests_db_name + ".sqlite").toFile());
@@ -64,6 +67,8 @@ public class TestsDatabase extends SQLiteDatabase {
addTable(sapforConfigurations = new SapforConfigurationDBTable());
addTable(sapforConfigurationCommands = new SapforConfigurationCommandsDBTable());
addTable(serverSapfors = new ServerSapforsDBTable());
addTable(sapforSettings = new SapforSettingsDBTable());
addTable(sapforSettingsCommands = new SapforSettingsCommandsDBTable());
}
@Override
public PassCode_2021 getSynchronizePassCode() {
@@ -272,19 +277,18 @@ public class TestsDatabase extends SQLiteDatabase {
return res;
}
public ServerSapfor getSapforCopyForCompilation() {
for (ServerSapfor serverSapfor: serverSapfors.Data.values()){
if (serverSapfor.state.equals(ServerSapforState.Queued)){
for (ServerSapfor serverSapfor : serverSapfors.Data.values()) {
if (serverSapfor.state.equals(ServerSapforState.Queued)) {
return new ServerSapfor(serverSapfor);
}
}
return null;
}
public Integer getInstalledSapforMaxVersion() {
int max_version=Constants.Nan;
int max_version = Constants.Nan;
for (ServerSapfor sapfor : serverSapfors.Data.values()) {
if (sapfor.state.equals(ServerSapforState.Done)) {
int version=Constants.Nan;
int version = Constants.Nan;
try {
version = Integer.parseInt(sapfor.version);
} catch (Exception ex) {
@@ -295,15 +299,14 @@ public class TestsDatabase extends SQLiteDatabase {
}
return max_version;
}
public boolean hasActiveSapfors(){
for (ServerSapfor serverSapfor: serverSapfors.Data.values()){
if (serverSapfor.state.isActive())
return true;
public boolean hasActiveSapfors() {
for (ServerSapfor serverSapfor : serverSapfors.Data.values()) {
if (serverSapfor.state.isActive())
return true;
}
return false;
}
public void UnselectAllGTC(){
public void UnselectAllGTC() {
groups.CheckAll(false);
tests.CheckAll(false);
dvm_configurations.CheckAll(false);

View File

@@ -0,0 +1,45 @@
package TestingSystem.SAPFOR.SapforSettings;
import Common.Database.DBObject;
import TestingSystem.Common.Settings.Settings;
import java.util.Vector;
public class SapforSettings extends Settings {
//настройки.
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 KEEP_DVM_DIRECTIVES = 0;// "Учитывать DVM директивы"; -keepDVM
//----
public void packFlags() {
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");
//--
flags= String.join(" ", res);
}
//--
@Override
public void SynchronizeFields(DBObject src) {
super.SynchronizeFields(src);
SapforSettings c = (SapforSettings) src;
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 SapforSettings(SapforSettings sapforSettings) {
this.SynchronizeFields(sapforSettings);
}
public SapforSettings(){}
}

View File

@@ -0,0 +1,12 @@
package TestingSystem.SAPFOR.SapforSettings;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
public class SapforSettingsBar extends DataMenuBar {
public SapforSettingsBar() {
super("настройки",
PassCode_2021.PublishSapforSettings,
PassCode_2021.EditSapforSettings,
PassCode_2021.DeleteSapforSettings
);
}
}

View File

@@ -0,0 +1,12 @@
package TestingSystem.SAPFOR.SapforSettings;
import Common.UI.Menus_2023.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode_2021;
public class SapforSettingsCommandsBar extends DataMenuBar {
public SapforSettingsCommandsBar() {
super("команды",
PassCode_2021.PublishSapforSettingsCommand,
PassCode_2021.EditSapforSettingsCommand,
PassCode_2021.DeleteSapforSettingsCommand
);
}
}

View File

@@ -0,0 +1,114 @@
package TestingSystem.SAPFOR.SapforSettings;
import Common.Current;
import Common.Database.*;
import Common.UI.DataSetControlForm;
import Common.UI.Windows.Dialog.DBObjectDialog;
import Common.Utils.Utils;
import TestingSystem.SAPFOR.SapforSettings.UI.SapforSettingsFields;
import TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommand;
import java.util.LinkedHashMap;
public class SapforSettingsDBTable extends iDBTable<SapforSettings> {
public SapforSettingsDBTable() {
super(SapforSettings.class);
}
@Override
public Current CurrentName() {
return Current.SapforSettings;
}
@Override
public String getSingleDescription() {
return "настройки системы SAPFOR";
}
@Override
public String getPluralDescription() {
return "настройки системы SAPFOR";
}
@Override
protected DataSetControlForm createUI() {
return new DataSetControlForm(this) {
@Override
public boolean hasCheckBox() {
return true;
}
@Override
protected void AdditionalInitColumns() {
/*
columns.get(5).setRenderer(TableRenderers.RendererAutoConfiguration);
columns.get(5).setEditor(TableEditors.EditorAutoConfiguration);
columns.get(5).setMinWidth(25);
columns.get(5).setMaxWidth(25);
columns.get(6).setMaxWidth(300);
*/
}
};
}
@Override
public String[] getUIColumnNames() {
return new String[]{
"имя",
"автор",
"флаги"
//"проходы"
};
}
@Override
public Object getFieldAt(SapforSettings object, int columnIndex) {
switch (columnIndex) {
case 2:
return object.description;
case 3:
return object.sender_name;
case 4:
return object.flags;
default:
return null;
}
}
//-
@Override
public DBObjectDialog<SapforSettings, SapforSettingsFields> getDialog() {
return new DBObjectDialog<SapforSettings, SapforSettingsFields>(SapforSettingsFields.class) {
@Override
public int getDefaultHeight() {
return 415;
}
@Override
public int getDefaultWidth() {
return 600;
}
@Override
public void validateFields() {
}
@Override
public void fillFields() {
fields.tfName.setText(Result.description);
fields.cbFREE_FORM.setSelected(Result.FREE_FORM != 0);
fields.cbKEEP_DVM_DIRECTIVES.setSelected(Result.KEEP_DVM_DIRECTIVES != 0);
fields.cbKEEP_SPF_DIRECTIVES.setSelected(Result.KEEP_SPF_DIRECTIVES != 0);
fields.cbSTATIC_SHADOW_ANALYSIS.setSelected(Result.STATIC_SHADOW_ANALYSIS != 0);
fields.sMAX_SHADOW_WIDTH.setValue(Result.MAX_SHADOW_WIDTH);
}
@Override
public void ProcessResult() {
Result.description = fields.tfName.getText();
Result.FREE_FORM = Utils.fromBoolean(fields.cbFREE_FORM.isSelected());
Result.KEEP_DVM_DIRECTIVES = Utils.fromBoolean(fields.cbKEEP_DVM_DIRECTIVES.isSelected());
Result.KEEP_SPF_DIRECTIVES = Utils.fromBoolean(fields.cbKEEP_SPF_DIRECTIVES.isSelected());
Result.STATIC_SHADOW_ANALYSIS = Utils.fromBoolean(fields.cbSTATIC_SHADOW_ANALYSIS.isSelected());
Result.MAX_SHADOW_WIDTH = fields.sMAX_SHADOW_WIDTH.getValue();
Result.packFlags();
}
@Override
public void SetReadonly() {
fields.tfName.setEnabled(false);
}
};
}
@Override
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
res.put(SapforSettingsCommand.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
return res;
}
}

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="TestingSystem.SAPFOR.SapforSettings.UI.SapforSettingsCommandFields">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="4edf7" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="проход"/>
</properties>
</component>
<vspacer id="40ef0">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="64847" class="javax.swing.JComboBox" binding="cbPassCode" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<toolTipText value="выберите проход"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -0,0 +1,33 @@
package TestingSystem.SAPFOR.SapforSettings.UI;
import Common.Current;
import Common.UI.Tables.StyledCellLabel;
import Common.UI.Windows.Dialog.DialogFields;
import Repository.Component.Sapfor.Sapfor;
import Visual_DVM_2021.Passes.PassCode_2021;
import javax.swing.*;
import java.awt.*;
public class SapforSettingsCommandFields implements DialogFields {
private JPanel content;
public JComboBox<PassCode_2021> cbPassCode;
@Override
public Component getContent() {
return content;
}
private void createUIComponents() {
// TODO: place custom component creation code here
cbPassCode = new JComboBox<>();
cbPassCode.setRenderer((list, value, index, isSelected, cellHasFocus) -> {
JLabel res = new StyledCellLabel();
res.setText(value.getDescription());
res.setBackground(isSelected ?
Current.getTheme().selection_background : Current.getTheme().background
);
return res;
});
//-
for (PassCode_2021 code : Sapfor.getScenariosCodes())
cbPassCode.addItem(code);
}
}

View File

@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="TestingSystem.SAPFOR.SapforSettings.UI.SapforSettingsFields">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="528" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="3b4b2" layout-manager="GridLayoutManager" row-count="8" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children>
<component id="2c43d" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false">
<preferred-size width="284" height="20"/>
</grid>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="название"/>
</properties>
</component>
<vspacer id="2c147">
<constraints>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false">
<preferred-size width="284" height="14"/>
</grid>
</constraints>
</vspacer>
<component id="7844f" class="javax.swing.JTextField" binding="tfName" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<minimum-size width="200" height="30"/>
<preferred-size width="200" height="30"/>
<maximum-size width="200" height="30"/>
</grid>
</constraints>
<properties/>
</component>
<component id="7788a" class="javax.swing.JCheckBox" binding="cbFREE_FORM">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="284" height="25"/>
</grid>
</constraints>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<icon value="icons/NotPick.png"/>
<selectedIcon value="icons/Pick.png"/>
<text value="Свободный выходной стиль"/>
</properties>
</component>
<component id="243fb" class="javax.swing.JCheckBox" binding="cbKEEP_SPF_DIRECTIVES">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="284" height="25"/>
</grid>
</constraints>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<icon value="icons/NotPick.png"/>
<selectedIcon value="icons/Pick.png"/>
<text value="Сохранять SPF директивы"/>
</properties>
</component>
<component id="16d89" class="javax.swing.JLabel">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="3" use-parent-layout="false">
<preferred-size width="284" height="17"/>
</grid>
</constraints>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<text value="Максимальный размер теневых граней, %"/>
</properties>
</component>
<component id="5eba5" class="javax.swing.JCheckBox" binding="cbSTATIC_SHADOW_ANALYSIS">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="284" height="25"/>
</grid>
</constraints>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<icon value="icons/NotPick.png"/>
<selectedIcon value="icons/Pick.png"/>
<text value="Оптимизация теневых обменов"/>
</properties>
</component>
<component id="27b84" class="javax.swing.JCheckBox" binding="cbKEEP_DVM_DIRECTIVES">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="284" height="25"/>
</grid>
</constraints>
<properties>
<font name="Times New Roman" size="14" style="2"/>
<icon value="icons/NotPick.png"/>
<selectedIcon value="icons/Pick.png"/>
<text value="Учитывать DVM директивы"/>
</properties>
</component>
<component id="d47f0" class="javax.swing.JSlider" binding="sMAX_SHADOW_WIDTH">
<constraints>
<grid row="6" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<minimum-size width="500" height="40"/>
<preferred-size width="500" height="40"/>
<maximum-size width="500" height="40"/>
</grid>
</constraints>
<properties>
<majorTickSpacing value="25"/>
<minorTickSpacing value="1"/>
<paintLabels value="true"/>
<paintTicks value="true"/>
<snapToTicks value="false"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,24 @@
package TestingSystem.SAPFOR.SapforSettings.UI;
import Common.UI.TextField.StyledTextField;
import Common.UI.Windows.Dialog.DialogFields;
import Common.Utils.Utils;
import javax.swing.*;
import java.awt.*;
public class SapforSettingsFields implements DialogFields {
private JPanel content;
public JTextField tfName;
public JCheckBox cbFREE_FORM;
public JCheckBox cbKEEP_SPF_DIRECTIVES;
public JCheckBox cbSTATIC_SHADOW_ANALYSIS;
public JCheckBox cbKEEP_DVM_DIRECTIVES;
public JSlider sMAX_SHADOW_WIDTH;
@Override
public Component getContent() {
return content;
}
private void createUIComponents() {
// TODO: place custom component creation code here
tfName = new StyledTextField();
}
}

View File

@@ -0,0 +1,30 @@
package TestingSystem.SAPFOR.SapforSettingsCommand;
import Common.Constants;
import Common.Current;
import Common.Database.DBObject;
import Common.Database.riDBObject;
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import Visual_DVM_2021.Passes.PassCode_2021;
import com.sun.org.glassfish.gmbal.Description;
public class SapforSettingsCommand extends riDBObject {
@Description("DEFAULT -1")
public int sapforsettings_id = Constants.Nan;
public PassCode_2021 passCode = PassCode_2021.SPF_RemoveDvmDirectives;
@Override
public boolean isVisible() {
return Current.HasSapforSettings() && (Current.getSapforSettings().id == sapforsettings_id);
}
@Override
public void SynchronizeFields(DBObject src) {
super.SynchronizeFields(src);
SapforSettingsCommand c = (SapforSettingsCommand) src;
sapforsettings_id = c.sapforsettings_id;
passCode = c.passCode;
}
public SapforSettingsCommand() {
}
public SapforSettingsCommand(SapforSettingsCommand sapforSettingsCommand) {
this.SynchronizeFields(sapforSettingsCommand);
}
}

View File

@@ -0,0 +1,85 @@
package TestingSystem.SAPFOR.SapforSettingsCommand;
import Common.Current;
import Common.Database.iDBTable;
import Common.UI.DataSetControlForm;
import Common.UI.UI;
import Common.UI.Windows.Dialog.DBObjectDialog;
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
import TestingSystem.SAPFOR.SapforConfigurationCommand.UI.SapforConfigurationCommandFields;
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import TestingSystem.SAPFOR.SapforSettings.UI.SapforSettingsCommandFields;
import Visual_DVM_2021.Passes.PassCode_2021;
import java.util.Vector;
public class SapforSettingsCommandsDBTable extends iDBTable<SapforSettingsCommand> {
public SapforSettingsCommandsDBTable() {
super(SapforSettingsCommand.class);
}
@Override
public String getSingleDescription() {
return "команда";
}
@Override
public String getPluralDescription() {
return "команды";
}
@Override
public String[] getUIColumnNames() {
return new String[]{
"Проход"
};
}
@Override
public Object getFieldAt(SapforSettingsCommand object, int columnIndex) {
switch (columnIndex) {
case 2:
return object.passCode.getDescription();
default:
return null;
}
}
@Override
public Current CurrentName() {
return Current.SapforSettingsCommand;
}
@Override
protected DataSetControlForm createUI() {
return new DataSetControlForm(this) {
@Override
public boolean hasCheckBox() {
return true;
}
@Override
protected void AdditionalInitColumns() {
//columns.get(0).setVisible(false);
}
};
}
@Override
public DBObjectDialog<SapforSettingsCommand, SapforSettingsCommandFields> getDialog() {
return new DBObjectDialog<SapforSettingsCommand, SapforSettingsCommandFields>(SapforSettingsCommandFields.class) {
@Override
public int getDefaultHeight() {
return 250;
}
@Override
public void fillFields() {
UI.TrySelect(fields.cbPassCode, Result.passCode);
}
@Override
public void ProcessResult() {
Result.passCode = (PassCode_2021) fields.cbPassCode.getSelectedItem();
Result.sapforsettings_id = Current.getSapforSettings().id;
}
};
}
//--
public Vector<PassCode_2021> getCodes(SapforSettings sapforSettings) {
Vector<PassCode_2021> res = new Vector<>();
for (SapforSettingsCommand command : Data.values()) {
if (command.sapforsettings_id == sapforSettings.id)
res.add(command.passCode);
}
return res;
}
}

View File

@@ -0,0 +1,10 @@
package Visual_DVM_2021.Passes.All;
import Common.Global;
import TestingSystem.Common.TestingServer;
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import Visual_DVM_2021.Passes.Server.DeleteServerObjects;
public class DeleteSapforSettings extends DeleteServerObjects<TestingServer, SapforSettings> {
public DeleteSapforSettings() {
super(Global.testingServer, SapforSettings.class);
}
}

View File

@@ -0,0 +1,10 @@
package Visual_DVM_2021.Passes.All;
import Common.Global;
import TestingSystem.Common.TestingServer;
import TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommand;
import Visual_DVM_2021.Passes.Server.DeleteServerObjects;
public class DeleteSapforSettingsCommand extends DeleteServerObjects<TestingServer, SapforSettingsCommand> {
public DeleteSapforSettingsCommand() {
super(Global.testingServer, SapforSettingsCommand.class);
}
}

View File

@@ -0,0 +1,11 @@
package Visual_DVM_2021.Passes.All;
import Common.Global;
import TestingSystem.Common.TestingServer;
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import Visual_DVM_2021.Passes.Server.EditServerObject;
public class EditSapforSettings extends EditServerObject<TestingServer, SapforSettings> {
public EditSapforSettings() {
super(Global.testingServer, SapforSettings.class);
}
}

View File

@@ -0,0 +1,11 @@
package Visual_DVM_2021.Passes.All;
import Common.Global;
import TestingSystem.Common.TestingServer;
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
import TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommand;
import Visual_DVM_2021.Passes.Server.EditServerObject;
public class EditSapforSettingsCommand extends EditServerObject<TestingServer, SapforSettingsCommand> {
public EditSapforSettingsCommand() {
super(Global.testingServer,SapforSettingsCommand.class);
}
}

View File

@@ -0,0 +1,11 @@
package Visual_DVM_2021.Passes.All;
import Common.Global;
import TestingSystem.Common.TestingServer;
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
import Visual_DVM_2021.Passes.Server.PublishServerObject;
public class PublishSapforSettings extends PublishServerObject<TestingServer, SapforSettings> {
public PublishSapforSettings() {
super(Global.testingServer, SapforSettings.class);
}
}

View File

@@ -0,0 +1,21 @@
package Visual_DVM_2021.Passes.All;
import Common.Current;
import Common.Global;
import TestingSystem.Common.TestingServer;
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
import TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommand;
import Visual_DVM_2021.Passes.Server.PublishServerObject;
public class PublishSapforSettingsCommand extends PublishServerObject<TestingServer, SapforSettingsCommand> {
public PublishSapforSettingsCommand() {
super(Global.testingServer, SapforSettingsCommand.class);
}
@Override
public boolean fillObjectFields() throws Exception {
target.sapforsettings_id = Current.getSapforSettings().id;
return super.fillObjectFields();
}
@Override
protected boolean canStart(Object... args) throws Exception {
return Current.Check(Log, Current.SapforSettings)&&super.canStart(args);
}
}

View File

@@ -40,6 +40,7 @@ public class SynchronizeTests extends TestingSystemPass<Object> {
server.db.serverSapfors.ClearUI();
server.db.dvmPackages.ClearUI();
server.db.sapforPackages.ClearUI();
server.db.sapforSettings.ClearUI();
}
@Override
protected void ServerAction() throws Exception {
@@ -66,6 +67,7 @@ public class SynchronizeTests extends TestingSystemPass<Object> {
server.db.serverSapfors.ShowUI();
server.db.dvmPackages.ShowUI();
server.db.sapforPackages.ShowUI();
server.db.sapforSettings.ShowUI();
server.db.RestoreLastSelections(); //---- ? объединить с RestoreCredentials
UI.getMainWindow().ShowCheckedTestsCount();
}

View File

@@ -346,13 +346,31 @@ public enum PassCode_2021 {
SaveCurrentSAPFORConfiguration,
StartSelectedSAPFORConfigurations,
CloneCurrentDVMConfiguration,
CloneCurrentDVMConfiguration, //?
PublishSapforSettings,
EditSapforSettings,
DeleteSapforSettings,
PublishSapforSettingsCommand,
EditSapforSettingsCommand,
DeleteSapforSettingsCommand
;
//--
public String getDescription() {
switch (this) {
case Undefined:
return "?";
case PublishSapforSettingsCommand:
return "Опубликовать команду настроек SAPFOR";
case EditSapforSettingsCommand:
return "Редактировать команду настроек SAPFOR";
case DeleteSapforSettingsCommand:
return "Удалить команду настроек SAPFOR";
case PublishSapforSettings:
return "Опубликовать настройки SAPFOR";
case EditSapforSettings:
return "Редактировать настройки SAPFOR";
case DeleteSapforSettings:
return "Удалить настройки SAPFOR";
case CloneCurrentDVMConfiguration:
return "Дублировать текущую конфигурацию тестирования DVM системы";
case StartSelectedSAPFORConfigurations:

View File

@@ -327,24 +327,22 @@
<properties/>
<border type="none"/>
<children>
<splitpane id="7df69" binding="SC59">
<splitpane id="a599d" binding="SC83">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="328"/>
<dividerLocation value="300"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="53e04" layout-manager="BorderLayout" hgap="0" vgap="0">
<grid id="aacb9" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties>
<minimumSize width="300" height="100"/>
</properties>
<properties/>
<border type="none"/>
<children>
<grid id="fbd57" binding="sapforConfigurationsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<grid id="ded37" binding="sapforSettingsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
@@ -352,16 +350,14 @@
</grid>
</children>
</grid>
<grid id="71fcb" layout-manager="BorderLayout" hgap="0" vgap="0">
<grid id="e3fd8" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties>
<minimumSize width="300" height="0"/>
</properties>
<properties/>
<border type="none"/>
<children>
<grid id="a3fa0" binding="sapforConfigurationCommandsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<grid id="b5055" binding="sapforSettingsCommandsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
@@ -384,12 +380,67 @@
<properties/>
<border type="none"/>
<children>
<grid id="63cbc" binding="sapforPackagesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<splitpane id="df761" binding="SC80">
<constraints border-constraint="Center"/>
<properties/>
<properties>
<dividerLocation value="150"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children/>
</grid>
<children>
<grid id="30c24" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="c70f1" binding="SC81">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="500"/>
<dividerSize value="3"/>
</properties>
<border type="none"/>
<children>
<grid id="2f93b" binding="sapforConfigurationsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="3f00d" binding="sapforConfigurationCommandsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="1ee44" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="fd73e" binding="sapforPackagesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
</children>

View File

@@ -29,12 +29,14 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
public JSplitPane SC64;
public JSplitPane SC70;
public JSplitPane SC63;
public JSplitPane SC59;
public JSplitPane SC71;
public JSplitPane SC72;
public JSplitPane SC74;
public JSplitPane SC18;
public JSplitPane SC19;
public JSplitPane SC80;
public JSplitPane SC81;
public JSplitPane SC83;
//---
private JTabbedPane testingTabs;
private JPanel dvmPackagesTab;
@@ -60,6 +62,8 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
private JPanel machinesPanel;
private JPanel usersPanel;
private JPanel credentialsPanel;
private JPanel sapforSettingsPanel;
private JPanel sapforSettingsCommandsPanel;
private JPanel testsRunTasksBackground;
private JCheckBox filterFinished;
private JButton bTest;
@@ -133,6 +137,8 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
Global.testingServer.db.sapforConfigurationCommands.mountUI(sapforConfigurationCommandsPanel);
Global.testingServer.db.serverSapfors.mountUI(serverSapforsPanel);
Global.testingServer.db.sapforPackages.mountUI(sapforPackagesPanel);
Global.testingServer.db.sapforSettings.mountUI(sapforSettingsPanel);
Global.testingServer.db.sapforSettingsCommands.mountUI(sapforSettingsCommandsPanel);
//--
if (Global.properties.collapseCredentials)
CollapseCredentials();
@@ -148,6 +154,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
Global.testingServer.db.serverSapfors.ShowUI();
Global.testingServer.db.sapforConfigurations.ShowUI();
Global.testingServer.db.dvmRunTasks.ShowUI();
Global.testingServer.db.sapforSettings.ShowUI();
//---
RestoreLastCredentials();
//---

View File

@@ -6,15 +6,6 @@
</constraints>
<properties/>
<border type="none"/>
<children>
<toolbar id="1582f">
<constraints border-constraint="North"/>
<properties>
<orientation value="1"/>
</properties>
<border type="none"/>
<children/>
</toolbar>
</children>
<children/>
</grid>
</form>