no message
This commit is contained in:
12
src/SapforTestingSystem/Json/SapforVersion_json.java
Normal file
12
src/SapforTestingSystem/Json/SapforVersion_json.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package SapforTestingSystem.Json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class SapforVersion_json {
|
||||
@Expose
|
||||
public String version = "";
|
||||
@Expose
|
||||
public String description = "";
|
||||
public SapforVersion_json(String version_in, String description_in) {
|
||||
version = version_in;
|
||||
description = description_in;
|
||||
}
|
||||
}
|
||||
10
src/SapforTestingSystem/Json/ScenarioResults_json.java
Normal file
10
src/SapforTestingSystem/Json/ScenarioResults_json.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package SapforTestingSystem.Json;
|
||||
import SapforTestingSystem.SapforTask.SapforTask_2023;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class ScenarioResults_json {
|
||||
@Expose
|
||||
public List<SapforTask_2023> tasks = new Vector<>();
|
||||
}
|
||||
14
src/SapforTestingSystem/Json/Scenario_json.java
Normal file
14
src/SapforTestingSystem/Json/Scenario_json.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package SapforTestingSystem.Json;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class Scenario_json {
|
||||
@Expose
|
||||
public String flags;
|
||||
@Expose
|
||||
public List<PassCode_2021> codes = new Vector<>();
|
||||
@Expose
|
||||
public List<String> tests = new Vector<>();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package SapforTestingSystem.SapforConfiguration;
|
||||
import Common.Database.rDBObject;
|
||||
public class SapforConfiguration extends rDBObject {
|
||||
//настройки.
|
||||
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 KEEP_DVM_DIRECTIVES = 0;// "Учитывать DVM директивы"; -keepDVM
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package SapforTestingSystem.SapforConfiguration;
|
||||
import Common.Current;
|
||||
import Common.Database.*;
|
||||
import Common.Global;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Utils.Utils;
|
||||
import SapforTestingSystem.SapforConfiguration.UI.SapforConfigurationFields;
|
||||
import SapforTestingSystem.SapforConfigurationCommand.SapforConfigurationCommand;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
public class SapforConfigurationDBTable extends DBTable<String, SapforConfiguration> {
|
||||
public SapforConfigurationDBTable() {
|
||||
super(String.class, SapforConfiguration.class);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.SapforConfiguration;
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "конфигурация тестирования SAPFOR";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "конфигурации";
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this){
|
||||
@Override
|
||||
public boolean hasCheckBox() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public void ShowCurrentObject() throws Exception {
|
||||
super.ShowCurrentObject();
|
||||
Global.db.sapforTasksPackages.ShowUI();
|
||||
}
|
||||
@Override
|
||||
public void ShowNoCurrentObject() throws Exception {
|
||||
super.ShowNoCurrentObject();
|
||||
Global.db.sapforTasksPackages.ClearUI();
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"имя",
|
||||
"автор",
|
||||
"флаги",
|
||||
"maxtime"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(SapforConfiguration object, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 2:
|
||||
return object.description;
|
||||
case 3:
|
||||
return object.sender_name;
|
||||
case 4:
|
||||
return SapforConfigurationInterface.getFlags(object);
|
||||
case 5:
|
||||
return object.maxtime;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public DBObjectDialog<SapforConfiguration, SapforConfigurationFields> getDialog() {
|
||||
return new DBObjectDialog<SapforConfiguration, SapforConfigurationFields>(SapforConfigurationFields.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);
|
||||
fields.sMaxtime.setValue(Result.maxtime);
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.description = fields.tfName.getText();
|
||||
Result.maxtime = (int) fields.sMaxtime.getValue();
|
||||
// Result.transformations = ((StyledStringList) (fields.transformationsList)).pack();
|
||||
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();
|
||||
}
|
||||
@Override
|
||||
public void SetReadonly() {
|
||||
fields.tfName.setEnabled(false);
|
||||
fields.sMaxtime.setEnabled(false);
|
||||
fields.sTransformationMaxtime.setEnabled(false);
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
||||
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
||||
res.put(SapforConfigurationCommand.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package SapforTestingSystem.SapforConfiguration;
|
||||
import Common.Global;
|
||||
import Common.Utils.TextLog;
|
||||
import SapforTestingSystem.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;
|
||||
}
|
||||
public static String getTransformationsNames(SapforConfiguration object) {
|
||||
Vector<String> res = new Vector<>();
|
||||
for (SapforConfigurationCommand command : Global.testingServer.db.sapforConfigurationCommands.Data.values()) {
|
||||
if (command.sapforconfiguration_id.equals(object.id)) {
|
||||
res.add(command.passCode.getDescription());
|
||||
}
|
||||
}
|
||||
return String.join(";", 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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="SapforTestingSystem.SapforConfiguration.UI.SapforConfigurationFields">
|
||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" 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="883" height="400"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="d1d6e" layout-manager="GridLayoutManager" row-count="9" 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>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="3257b" 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="224d6">
|
||||
<constraints>
|
||||
<grid row="8" 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="ecbf1" 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="3e6be" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" 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>
|
||||
<component id="db389" class="javax.swing.JSpinner" binding="sMaxtime">
|
||||
<constraints>
|
||||
<grid row="1" 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="100" height="30"/>
|
||||
<preferred-size width="240" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="b644a" class="javax.swing.JCheckBox" binding="cbFREE_FORM">
|
||||
<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="7721e" class="javax.swing.JCheckBox" binding="cbKEEP_SPF_DIRECTIVES">
|
||||
<constraints>
|
||||
<grid row="5" 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="f44c1" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="6" 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="54e77" class="javax.swing.JCheckBox" binding="cbSTATIC_SHADOW_ANALYSIS">
|
||||
<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="Оптимизация теневых обменов"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="4e865" class="javax.swing.JCheckBox" binding="cbKEEP_DVM_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="Учитывать DVM директивы"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="14243" class="javax.swing.JSlider" binding="sMAX_SHADOW_WIDTH">
|
||||
<constraints>
|
||||
<grid row="7" 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>
|
||||
@@ -0,0 +1,31 @@
|
||||
package SapforTestingSystem.SapforConfiguration.UI;
|
||||
import Common.UI.TextField.StyledTextField;
|
||||
import Common.UI.Windows.Dialog.DialogFields;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class SapforConfigurationFields implements DialogFields {
|
||||
private JPanel content;
|
||||
public JTextField tfName;
|
||||
public JSpinner sMaxtime;
|
||||
public JSpinner sTransformationMaxtime;
|
||||
public JCheckBox cbFREE_FORM;
|
||||
public JSlider sMAX_SHADOW_WIDTH;
|
||||
public JCheckBox cbSTATIC_SHADOW_ANALYSIS;
|
||||
public JCheckBox cbKEEP_SPF_DIRECTIVES;
|
||||
public JCheckBox cbKEEP_DVM_DIRECTIVES;
|
||||
//--
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
}
|
||||
public SapforConfigurationFields(){
|
||||
sMaxtime.setModel(new SpinnerNumberModel(40,
|
||||
5, 3600, 1
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package SapforTestingSystem.SapforConfigurationCommand;
|
||||
import Common.Database.rDBObject;
|
||||
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 PassCode_2021 passCode = PassCode_2021.SPF_RemoveDvmDirectives;
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return SapforConfigurationCommandInterface.isVisible(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package SapforTestingSystem.SapforConfigurationCommand;
|
||||
import Common.Current;
|
||||
public class SapforConfigurationCommandInterface {
|
||||
public static boolean isVisible(SapforConfigurationCommand object) {
|
||||
return Current.HasSapforConfiguration() && (Current.getSapforConfiguration().id.equals(object.sapforconfiguration_id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package SapforTestingSystem.SapforConfigurationCommand;
|
||||
import Common.Current;
|
||||
import Common.Database.DBTable;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.UI;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import SapforTestingSystem.SapforConfigurationCommand.UI.SapforConfigurationCommandFields;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class SapforConfigurationCommandsDBTable extends DBTable<String, SapforConfigurationCommand> {
|
||||
public SapforConfigurationCommandsDBTable() {
|
||||
super(String.class, SapforConfigurationCommand.class);
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "команда";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "команды";
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this);
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"Проход"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(SapforConfigurationCommand object, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 1:
|
||||
return object.passCode.getDescription();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.SapforConfigurationCommand;
|
||||
}
|
||||
@Override
|
||||
public DBObjectDialog<SapforConfigurationCommand, SapforConfigurationCommandFields> getDialog() {
|
||||
return new DBObjectDialog<SapforConfigurationCommand, SapforConfigurationCommandFields>(SapforConfigurationCommandFields.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.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_("После построения покрытия вариантов запрещено добавлять другие команды в сценарий.");
|
||||
}
|
||||
*/
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="SapforTestingSystem.SapforConfigurationCommand.UI.SapforConfigurationCommandFields">
|
||||
<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="97a3c" 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="7e4ea">
|
||||
<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="e95d0" 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>
|
||||
@@ -0,0 +1,32 @@
|
||||
package SapforTestingSystem.SapforConfigurationCommand.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 SapforConfigurationCommandFields 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);
|
||||
}
|
||||
}
|
||||
36
src/SapforTestingSystem/SapforTask/MatchState.java
Normal file
36
src/SapforTestingSystem/SapforTask/MatchState.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package SapforTestingSystem.SapforTask;
|
||||
import Common.Current;
|
||||
import Common.UI.StatusEnum;
|
||||
import Common.UI.Themes.VisualiserFonts;
|
||||
|
||||
import java.awt.*;
|
||||
public enum MatchState implements StatusEnum {
|
||||
Unknown,
|
||||
Match,
|
||||
NotMatch;
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case Unknown:
|
||||
return "неизвестно";
|
||||
case Match:
|
||||
return "да";
|
||||
case NotMatch:
|
||||
return "нет";
|
||||
default:
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Font getFont() {
|
||||
switch (this) {
|
||||
case Unknown:
|
||||
return Current.getTheme().Fonts.get(VisualiserFonts.UnknownState);
|
||||
case Match:
|
||||
return Current.getTheme().Fonts.get(VisualiserFonts.GoodState);
|
||||
case NotMatch:
|
||||
return Current.getTheme().Fonts.get(VisualiserFonts.BadState);
|
||||
default:
|
||||
return StatusEnum.super.getFont();
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/SapforTestingSystem/SapforTask/SapforTaskResult.java
Normal file
16
src/SapforTestingSystem/SapforTask/SapforTaskResult.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package SapforTestingSystem.SapforTask;
|
||||
import Common.Database.DBObject;
|
||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage_2023;
|
||||
public class SapforTaskResult extends DBObject {
|
||||
public SapforTasksPackage_2023 sapforTasksPackage;
|
||||
public SapforTask_2023 task;
|
||||
public MatchState match_state = MatchState.Unknown;
|
||||
@Override
|
||||
public Object getPK() {
|
||||
return task.test_description;
|
||||
}
|
||||
public SapforTaskResult(SapforTasksPackage_2023 package_in, SapforTask_2023 task_in) {
|
||||
sapforTasksPackage = package_in;
|
||||
task = task_in;
|
||||
}
|
||||
}
|
||||
55
src/SapforTestingSystem/SapforTask/SapforTask_2023.java
Normal file
55
src/SapforTestingSystem/SapforTask/SapforTask_2023.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package SapforTestingSystem.SapforTask;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
import SapforTestingSystem.Json.SapforVersion_json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.Vector;
|
||||
public class SapforTask_2023 extends DBObject {
|
||||
//------------------------------------>>
|
||||
@Description("PRIMARY KEY, UNIQUE")
|
||||
@Expose
|
||||
public long id = Utils.Nan;
|
||||
@Description("DEFAULT '-1'")
|
||||
@Expose
|
||||
public int sapfortaskspackage_2023_id = Utils.Nan;
|
||||
//------------------------------------->>
|
||||
@Description("DEFAULT ''")
|
||||
@Expose
|
||||
public String test_description = "";
|
||||
//-------------------------------------->>
|
||||
@Description("IGNORE")
|
||||
@Expose
|
||||
public Vector<SapforVersion_json> versions = new Vector<>();
|
||||
@Description("IGNORE")
|
||||
@Expose
|
||||
public Vector<SapforVersion_json> variants = new Vector<>();
|
||||
//-------------------------------------->>
|
||||
@Description("DEFAULT 'Inactive'")
|
||||
@Expose
|
||||
public TaskState state = TaskState.Inactive;
|
||||
@Description("DEFAULT '0'")
|
||||
@Expose
|
||||
public int versions_tree_built = 0;
|
||||
//-----------
|
||||
public SapforTask_2023() {
|
||||
}
|
||||
public SapforTask_2023(SapforTask_2023 src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
@Override
|
||||
public Object getPK() {
|
||||
return id;
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject object) {
|
||||
super.SynchronizeFields(object);
|
||||
SapforTask_2023 t = (SapforTask_2023) object;
|
||||
id = t.id;
|
||||
sapfortaskspackage_2023_id = t.sapfortaskspackage_2023_id;
|
||||
test_description = t.test_description;
|
||||
state = t.state;
|
||||
}
|
||||
}
|
||||
56
src/SapforTestingSystem/SapforTask/SapforTasksDBTable.java
Normal file
56
src/SapforTestingSystem/SapforTask/SapforTasksDBTable.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package SapforTestingSystem.SapforTask;
|
||||
import Common.Current;
|
||||
import Common.Database.DBTable;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import static Common.UI.Tables.TableRenderers.RendererStatusEnum;
|
||||
public class SapforTasksDBTable extends DBTable<Long, SapforTask_2023> {
|
||||
public SapforTasksDBTable() {
|
||||
super(Long.class, SapforTask_2023.class);
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "задача";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "задачи";
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.SapforTask;
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this) {
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
columns.get(2).setRenderer(RendererStatusEnum);
|
||||
}
|
||||
@Override
|
||||
public void MouseAction2() throws Exception {
|
||||
Pass_2021.passes.get(PassCode_2021.OpenSapforTest).Do();
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"Тест",
|
||||
"Статус"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(SapforTask_2023 object, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 1:
|
||||
return object.test_description;
|
||||
case 2:
|
||||
return object.state;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package SapforTestingSystem.SapforTasksPackage;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.iDBObject;
|
||||
import SapforTestingSystem.SapforConfiguration.SapforConfiguration;
|
||||
import TestingSystem.TasksPackage.TasksPackageState;
|
||||
import TestingSystem.Test.Test;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.Vector;
|
||||
public class SapforTasksPackage_2023 extends iDBObject {
|
||||
public String summary = "";
|
||||
//----
|
||||
public int FREE_FORM = 0; //"Свободный выходной стиль"; -f90
|
||||
public int STATIC_SHADOW_ANALYSIS = 0;//"Оптимизация теневых обменов"; -sh
|
||||
public int MAX_SHADOW_WIDTH = 50; // "Максимальный размер теневых граней"; (%) -shwidth значение поля
|
||||
public int STATIC_PRIVATE_ANALYSIS = 0; //"Статический анализ приватностей" -priv
|
||||
public int KEEP_SPF_DIRECTIVES = 0; //"Сохранять SPF директивы при построении параллельных вариантов"; -keepSPF
|
||||
public int KEEP_DVM_DIRECTIVES = 0;// "Учитывать DVM директивы"; -keepDVM
|
||||
//---
|
||||
@Description("DEFAULT ''")
|
||||
public String flags = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String passesNames = ""; //имена преобразований через ;
|
||||
@Description("DEFAULT ''")
|
||||
public String testsNames = "";//имена тестов через ;
|
||||
//---
|
||||
public String sapfor_version = "?";
|
||||
//---
|
||||
public String workspace = "";
|
||||
//---
|
||||
public int tasksCount = 0;
|
||||
@Description("DEFAULT 0")
|
||||
public int versions_tree_built = 0;
|
||||
//---
|
||||
public double Time; //время выполнения.
|
||||
public long StartDate = 0; //дата начала выполнения
|
||||
public long ChangeDate = 0;//дата окончания выполнения
|
||||
@Description("DEFAULT ''")
|
||||
public String sapforconfiguration_id = "";
|
||||
//-
|
||||
public TasksPackageState state = TasksPackageState.Queued;
|
||||
//--
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
SapforTasksPackage_2023 tasksPackage = (SapforTasksPackage_2023) src;
|
||||
summary = tasksPackage.summary;
|
||||
sapfor_version = tasksPackage.sapfor_version;
|
||||
tasksCount = tasksPackage.tasksCount;
|
||||
Time = tasksPackage.Time;
|
||||
StartDate = tasksPackage.StartDate;
|
||||
ChangeDate = tasksPackage.ChangeDate;
|
||||
state = tasksPackage.state;
|
||||
workspace = tasksPackage.workspace;
|
||||
//---
|
||||
flags = tasksPackage.flags;
|
||||
//---
|
||||
FREE_FORM = tasksPackage.FREE_FORM;
|
||||
STATIC_SHADOW_ANALYSIS = tasksPackage.FREE_FORM;
|
||||
MAX_SHADOW_WIDTH = tasksPackage.MAX_SHADOW_WIDTH;
|
||||
STATIC_PRIVATE_ANALYSIS = tasksPackage.STATIC_PRIVATE_ANALYSIS;
|
||||
KEEP_SPF_DIRECTIVES = tasksPackage.KEEP_SPF_DIRECTIVES;
|
||||
KEEP_DVM_DIRECTIVES = tasksPackage.KEEP_DVM_DIRECTIVES;
|
||||
}
|
||||
public SapforTasksPackage_2023(SapforTasksPackage_2023 src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
public SapforTasksPackage_2023() {
|
||||
}
|
||||
//----
|
||||
@Description("IGNORE")
|
||||
public Vector<Test> tests = null;
|
||||
@Description("IGNORE")
|
||||
public Vector<PassCode_2021> codes = null;
|
||||
public SapforTasksPackage_2023(SapforConfiguration configuration_in, Vector<Test> tests_in) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package SapforTestingSystem.SapforTasksPackage;
|
||||
import Common.Current;
|
||||
import Common.Database.*;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import SapforTestingSystem.SapforTask.SapforTask_2023;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import static Common.UI.Tables.TableRenderers.RendererDate;
|
||||
import static Common.UI.Tables.TableRenderers.RendererStatusEnum;
|
||||
public class SapforTasksPackagesDBTable extends iDBTable<SapforTasksPackage_2023> {
|
||||
public SapforTasksPackagesDBTable() {
|
||||
super(SapforTasksPackage_2023.class);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.SapforTasksPackage;
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "пакеты задач Sapfor";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "пакеты задач";
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this) {
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
columns.get(7).setRenderer(RendererDate);
|
||||
columns.get(8).setRenderer(RendererDate);
|
||||
columns.get(9).setRenderer(RendererStatusEnum);
|
||||
}
|
||||
@Override
|
||||
public void ShowCurrentObject() throws Exception {
|
||||
super.ShowCurrentObject();
|
||||
// UI.getNewMainWindow().getTestingWindow().DropTestRunTasksComparison();
|
||||
}
|
||||
@Override
|
||||
public void ShowNoCurrentObject() throws Exception {
|
||||
super.ShowNoCurrentObject();
|
||||
// UI.getNewMainWindow().getTestingWindow().DropTestRunTasksComparison();
|
||||
}
|
||||
@Override
|
||||
public boolean hasCheckBox() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"SAPFOR",
|
||||
"Флаги",
|
||||
"Проходы",
|
||||
"Тесты",
|
||||
"Задач",
|
||||
"Начало",
|
||||
"Изменено",
|
||||
"Статус"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(SapforTasksPackage_2023 object, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 2:
|
||||
return object.sapfor_version;
|
||||
case 3:
|
||||
return object.flags;
|
||||
case 4:
|
||||
return object.passesNames;
|
||||
case 5:
|
||||
return object.testsNames;
|
||||
case 6:
|
||||
return object.tasksCount;
|
||||
case 7:
|
||||
return new Date(object.StartDate);
|
||||
case 8:
|
||||
return new Date(object.ChangeDate);
|
||||
case 9:
|
||||
return object.state;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
||||
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
||||
res.put(SapforTask_2023.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user