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

This commit is contained in:
2025-03-04 02:14:30 +03:00
parent 4da5f4bc03
commit 7f9305f02b
25 changed files with 495 additions and 284 deletions

View File

@@ -43,6 +43,7 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
Object savedCurrentKey = null;
Vector<Object> savedSelectedKeys = new Vector<>();
//--
public DataMenuBar getMenuBar() {return bar;}
public DataSetControlForm(DataSet<?, D> dataSource_in, JPanel mountPanel_in) {
super(DataTable.class, mountPanel_in);
dataSource = dataSource_in;

View File

@@ -1,5 +1,6 @@
package Common.Visual.Menus;
import Common.MainModule_;
import Common.Passes.Pass;
import Common.Passes.PassCode_;
import Common.Utils.Utils_;
import Common.Visual.Fonts.VisualiserFonts;
@@ -20,6 +21,10 @@ public class VisualiserMenuBar extends JToolBar {
}
}
}
public void addPasses(Pass...passes){
for (Pass pass: passes)
add(pass.createButton());
}
public JMenuBar addMenus(JMenu... menus) {
JMenuBar bar = new JMenuBar() {
{

View File

@@ -47,8 +47,9 @@ public class Constants {
public static final int SMTPPort = 465;
public static final int MailSocketPort = 465;
//
//7996 отладочный порт.
public static final int ComponentsServerPort = 7995; //7795
public static final int TestingServerPort = 7998; //7998
public static final int TestingServerPort = 7996; //7998
public static final int SocketTimeout = 0;
//-
public static final String ServerAddress = "alex-freenas.ddns.net";

View File

@@ -2,7 +2,7 @@ package _VisualDVM.GlobalData.Compiler;
import Common.Database.Objects.iDBObject;
import Common.Utils.Utils_;
import _VisualDVM.GlobalData.CompilerEnvironment.CompilerEnvironmentsSet;
import _VisualDVM.GlobalData.CompilerOption.CompilerOptionsSet;
import _VisualDVM.GlobalData.CompilerOption.RawCompilerOptionsSet;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.LanguageName;
@@ -29,7 +29,7 @@ public class Compiler extends iDBObject {
@Description("IGNORE")
public String versionText = "";
//-
public CompilerOptionsSet options = new CompilerOptionsSet();
public RawCompilerOptionsSet options = new RawCompilerOptionsSet();
public CompilerEnvironmentsSet environments = new CompilerEnvironmentsSet();
//-
public Compiler() {

View File

@@ -12,4 +12,12 @@ public class CompilerEnvironmentsSet extends DataSet<String, CompilerEnvironment
protected DataSetControlForm createUI(JPanel mountPanel) {
return new CompilerEnvironmentsForm(this, mountPanel);
}
@Override
public String getPluralDescription() {
return "переменные окружения";
}
@Override
public String getSingleDescription() {
return "переменная окружения";
}
}

View File

@@ -8,7 +8,6 @@ import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CompilerOption extends DBObject {
@Description("PRIMARY KEY, UNIQUE")
public String name = "";
public String parameterSeparator = "";
public String parameterName = "";

View File

@@ -1,15 +0,0 @@
package _VisualDVM.GlobalData.CompilerOption;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import _VisualDVM.GlobalData.CompilerOption.UI.CompilerOptionsForm;
import javax.swing.*;
public class CompilerOptionsSet extends DataSet<String, CompilerOption> {
public CompilerOptionsSet() {
super(String.class, CompilerOption.class);
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new CompilerOptionsForm(this, mountPanel);
}
}

View File

@@ -0,0 +1,13 @@
package _VisualDVM.GlobalData.CompilerOption.Json;
import _VisualDVM.GlobalData.CompilerOption.CompilerOption;
import com.google.gson.annotations.Expose;
public class OptionJson {
@Expose
public String name; //в том числе и с разделителем если есть. поиск по startswith
@Expose
public String value; //значение без кавычек
public OptionJson(CompilerOption src){
name= src.name+src.parameterSeparator;
value = src.parameterValue;
}
}

View File

@@ -0,0 +1,19 @@
package _VisualDVM.GlobalData.CompilerOption.Json;
import Common.Utils.Utils_;
import com.google.gson.annotations.Expose;
import java.util.List;
import java.util.Vector;
public class OptionsJson {
@Expose
public List<OptionJson> values = new Vector<>();
public String toLine(){
Vector<String> res = new Vector<>();
for (OptionJson optionJson: values){
res.add(optionJson.name+
(optionJson.value.contains(" ")? Utils_.DQuotes(optionJson.value): optionJson.value));
}
return String.join(" ", res);
}
}

View File

@@ -0,0 +1,11 @@
package _VisualDVM.GlobalData.CompilerOption.Json;
import com.google.gson.annotations.Expose;
import java.util.List;
import java.util.Vector;
public class OptionsSetJson {
@Expose
public List<OptionsJson> values = new Vector<>();
public OptionsSetJson(){
}
}

View File

@@ -0,0 +1,9 @@
package _VisualDVM.GlobalData.CompilerOption;
import Common.Database.Objects.iDBObject;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
public class OptionsLine extends iDBObject {
public OptionsJson json;
public OptionsLine(OptionsJson json_in){
json = json_in;
}
}

View File

@@ -0,0 +1,32 @@
package _VisualDVM.GlobalData.CompilerOption;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsSetJson;
import _VisualDVM.GlobalData.CompilerOption.UI.OptionsLinesForm;
import javax.swing.*;
public class OptionsLinesSet extends DataSet<Integer, OptionsLine> {
public int maxId = 1;
public OptionsLinesSet() {
super(Integer.class, OptionsLine.class);
}
@Override
public String getSingleDescription() {
return "набор опций компиляции";
}
@Override
public String getPluralDescription() {
return "наборы опций компиляции";
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new OptionsLinesForm(this,mountPanel);
}
public OptionsSetJson toJson(){
OptionsSetJson res= new OptionsSetJson();
for (OptionsLine optionsLine: Data.values()){
res.values.add(optionsLine.json);
}
return res;
}
}

View File

@@ -0,0 +1,49 @@
package _VisualDVM.GlobalData.CompilerOption;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionJson;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
import _VisualDVM.GlobalData.CompilerOption.UI.CompilerOptionsForm;
import javax.swing.*;
//нужно для опций компиляции получаемых из хелпа
public class RawCompilerOptionsSet extends DataSet<String, CompilerOption> {
public RawCompilerOptionsSet() {
super(String.class, CompilerOption.class);
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new CompilerOptionsForm(this, mountPanel);
}
@Override
public String getPluralDescription() {
return "опции компиляции";
}
@Override
public String getSingleDescription() {
return "опция компиляции";
}
public CompilerOption findByJson(OptionJson json){
for (CompilerOption compilerOption: Data.values()){
if (json.name.equals(compilerOption.name+compilerOption.parameterSeparator))
return compilerOption;
}
return null;
}
public void Reset(){
for (CompilerOption option: Data.values()){
option.select(false);
option.parameterValue="";
}
}
public void Synchronize(OptionsJson json){
for (OptionJson option_json: json.values){
// найти опцию по началу
CompilerOption compilerOption = findByJson(option_json);
if (compilerOption!=null){
compilerOption.select(true);
compilerOption.parameterValue = option_json.value;
}
}
}
}

View File

@@ -16,7 +16,7 @@ public class CompilerOptionsForm extends DataSetControlForm<CompilerOption> {
new ColumnInfo<CompilerOption>("Параметр") {
@Override
public Object getFieldAt(CompilerOption object) {
return object.parameterName + object.parameterSeparator;
return object.parameterName;
}
@Override
public Class getRendererClass() {

View File

@@ -0,0 +1,106 @@
package _VisualDVM.GlobalData.CompilerOption.UI;
import Common.Database.Tables.DataSet;
import Common.Passes.Pass;
import Common.Visual.DataSetControlForm;
import Common.Visual.Menus.DataMenuBar;
import Common.Visual.Tables.ColumnInfo;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
import _VisualDVM.GlobalData.CompilerOption.OptionsLine;
import _VisualDVM.GlobalData.CompilerOption.OptionsLinesSet;
import _VisualDVM.Passes.PassCode;
import javax.swing.*;
public class OptionsLinesForm extends DataSetControlForm<OptionsLine> {
public OptionsLinesForm(OptionsLinesSet dataSource_in, JPanel mountPanel_in) {
super(dataSource_in, mountPanel_in);
}
@Override
protected void createColumns() {
AddColumns(new ColumnInfo<OptionsLine>("") {
@Override
public Object getFieldAt(OptionsLine object) {
return object.json.toLine();
}
});
}
@Override
protected boolean hasCheckBox() {
return false;
}
@Override
protected boolean isPKVisible() {
return false;
}
@Override
protected DataMenuBar createMenuBar() {
DataMenuBar res = super.createMenuBar();
res.addPasses(
new Pass<OptionsLine>(){
@Override
public String getIconPath() {
return "/Common/icons/RedAdd.png";
}
@Override
public String getDescription() {
return "Добавление набора опций компиляции";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
if (pass.Do(Global.mainModule.getDb().compilers.getUI().getCurrent())){
target= new OptionsLine((OptionsJson) pass.target);
target.id = ((OptionsLinesSet)dataSource).maxId++;
return true;
}
return false;
}
@Override
protected void body() throws Exception {
dataSource.put(target.getPK(), target);
}
@Override
protected void showDone() throws Exception {
dataSource.ShowUI(target.getPK());
}
},
new Pass<OptionsLine>(){
@Override
public String getIconPath() {
return "/Common/icons/Edit.png";
}
@Override
public String getDescription() {
return "Редактирование набора опций компиляции";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (dataSource.getUI().CheckCurrent(Log)) {
target = dataSource.getUI().getCurrent();
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
if (pass.Do(Global.mainModule.getDb().compilers.getUI().getCurrent(), target.json)){
return true;
}
}
return false;
}
@Override
protected void body() throws Exception {
}
@Override
protected void showFinish() throws Exception {
dataSource.ShowUI(target.getPK());
}
}
);
return res;
}
}

View File

@@ -6,6 +6,7 @@ import Common.Visual.UI;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.Makefile.Makefile;
import _VisualDVM.GlobalData.Module.Module;
@@ -39,9 +40,9 @@ public class ModuleAnchestorFields implements DialogFields {
BPickOptions.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Pass<String> pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
if (pass.Do(compiler)) {
UI.TrySelect(cbFlags, pass.target);
UI.TrySelect(cbFlags, ((OptionsJson)pass.target).toLine());
}
}
});

View File

@@ -47,7 +47,7 @@ public class PickCompilerEnvironmentsForTesting extends Pass<String> {
}
}
};
return dialog.ShowDialog("Назначение переменных окружения");
return dialog.ShowDialog("");
}
@Override
protected void body() throws Exception {

View File

@@ -5,16 +5,18 @@ import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Compiler.CompilerType;
import _VisualDVM.GlobalData.CompilerOption.CompilerOption;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionJson;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
import _VisualDVM.GlobalData.CompilerOption.UI.CompilerOptionsFields;
import _VisualDVM.Passes.PassCode;
import javax.swing.*;
import java.util.Vector;
public class PickCompilerOptions extends Pass<String> {
public class PickCompilerOptions extends Pass<OptionsJson> {
Compiler compiler = null;
//-
@Override
protected boolean canStart(Object... args) throws Exception {
target = new OptionsJson();
if (args[0] == null) {
Log.Writeln_("Отсутствует текущий компилятор. Выбор флагов недоступен.");
return false;
@@ -26,6 +28,11 @@ public class PickCompilerOptions extends Pass<String> {
}
if (!(compiler.helpLoaded || Global.mainModule.getPass(PassCode.ShowCompilerHelp).Do(compiler, false)))
return false;
compiler.options.Reset();
if (args.length>1){
target =(OptionsJson) args[1];
compiler.options.Synchronize(target);
}
Dialog<String, CompilerOptionsFields> dialog = new Dialog<String, CompilerOptionsFields>(CompilerOptionsFields.class) {
@Override
public void InitFields() {
@@ -45,15 +52,15 @@ public class PickCompilerOptions extends Pass<String> {
}
}
};
return dialog.ShowDialog("Назначение опций компилятора");
return dialog.ShowDialog("");
}
@Override
protected void body() throws Exception {
Vector<String> res = new Vector<>();
target.values.clear();
for (CompilerOption option : compiler.options.Data.values()) {
if (option.isSelected())
res.add(option.toString());
if (option.isSelected()) {
target.values.add(new OptionJson(option));
}
}
target = String.join(" ", res);
}
}

View File

@@ -10,13 +10,17 @@ public class DVMSettings extends Settings {
public String environments = "";
@Description("DEFAULT 0")
public int Is_DVM_STAT = 0; //флаг вмест usr par, которые не использовались.
// public String usr_par = "";
//---
public int cube = 0; //
public int max_proc_count = 4;
public int min_dim_proc_count = 1;
public int max_dim_proc_count = 4;
//
//--
@Description("DEFAULT ''")
public String packedCompilationOptionsJson=""; //вывести (?)
@Description("DEFAULT ''")
public String packedCompilationOptionsSetsJson="";
//--
public DVMSettings() {
}
public DVMSettings(DVMSettings src) {
@@ -29,6 +33,8 @@ public class DVMSettings extends Settings {
environments = c.environments;
Is_DVM_STAT = c.Is_DVM_STAT;
// usr_par=c.usr_par;
packedCompilationOptionsJson= ((DVMSettings) src).packedCompilationOptionsJson;
packedCompilationOptionsSetsJson = ((DVMSettings)src).packedCompilationOptionsSetsJson;
//-
cube = c.cube;
max_proc_count = c.max_proc_count;

View File

@@ -1,4 +1,5 @@
package _VisualDVM.TestingSystem.DVM.DVMSettings.UI;
import Common.Utils.Utils_;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.TestingSystem.DVM.DVMSettings.DVMSettings;
public class DVMSettingsDialog extends DBObjectDialog<DVMSettings, DVMSettingsFields> {
@@ -7,7 +8,7 @@ public class DVMSettingsDialog extends DBObjectDialog<DVMSettings, DVMSettingsFi
}
@Override
public int getDefaultHeight() {
return 400;
return 600;
}
@Override
public int getDefaultWidth() {
@@ -28,8 +29,8 @@ public class DVMSettingsDialog extends DBObjectDialog<DVMSettings, DVMSettingsFi
public void fillFields() {
fields.tfName.setText(Result.description);
//------->>>
fields.tfFlags.setText(Result.flags);
fields.tfEnvironments.setText(Result.environments);
// fields.tfFlags.setText(Result.flags);
// fields.tfEnvironments.setText(Result.environments);
//------->>>
fields.sMinDimProc.setValue(Result.min_dim_proc_count);
fields.sMaxDimProc.setValue(Result.max_dim_proc_count);
@@ -37,6 +38,8 @@ public class DVMSettingsDialog extends DBObjectDialog<DVMSettings, DVMSettingsFi
//-
fields.sMaxProc.setValue(Result.max_proc_count);
fields.cbDvmStat.setSelected(Result.Is_DVM_STAT != 0);
//---
fields.fillOptionsLines(Result.packedCompilationOptionsJson);
}
@Override
public void ProcessResult() {
@@ -45,9 +48,11 @@ public class DVMSettingsDialog extends DBObjectDialog<DVMSettings, DVMSettingsFi
Result.max_dim_proc_count = (int) fields.sMaxDimProc.getValue();
Result.cube = fields.cbCube.isSelected() ? 1 : 0;
Result.max_proc_count = (int) fields.sMaxProc.getValue();
Result.flags = fields.tfFlags.getText();
Result.environments = fields.tfEnvironments.getText();
// Result.flags = fields.tfFlags.getText();
// Result.environments = fields.tfEnvironments.getText();
Result.Is_DVM_STAT = fields.cbDvmStat.isSelected() ? 1 : 0;
//--
Result.packedCompilationOptionsJson = Utils_.gson.toJson(fields.optionsLines.toJson());
}
@Override
public void SetReadonly() {

View File

@@ -2,226 +2,169 @@
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.TestingSystem.DVM.DVMSettings.UI.DVMSettingsFields">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="20" y="20" width="777" height="400"/>
<xy x="20" y="20" width="729" height="563"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="e9baf" layout-manager="GridLayoutManager" row-count="9" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<splitpane id="f2435" binding="SC1">
<constraints border-constraint="Center"/>
<properties/>
<properties>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<component id="8f4d9" class="javax.swing.JLabel">
<grid id="2abc3" layout-manager="BorderLayout" hgap="0" vgap="0">
<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="2176d">
<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"/>
</constraints>
</vspacer>
<component id="c61a7" class="javax.swing.JTextField" binding="tfName" custom-create="true">
<constraints>
<grid row="0" column="3" 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="238" height="30"/>
<maximum-size width="200" height="30"/>
</grid>
<splitpane position="right"/>
</constraints>
<properties/>
</component>
<component id="a1d86" class="javax.swing.JSpinner" binding="sMinDimProc">
<border type="none"/>
<children>
<splitpane id="10c04" binding="SC2">
<constraints border-constraint="Center"/>
<properties>
<dividerLocation value="150"/>
<dividerSize value="3"/>
<orientation value="0"/>
</properties>
<border type="none"/>
<children>
<grid id="8243" binding="optionsLinesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="2deb5" binding="environmentsLinesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="5ee89" layout-manager="GridLayoutManager" row-count="6" 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="5" column="3" 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="100" height="30"/>
<maximum-size width="100" height="30"/>
</grid>
<splitpane position="left"/>
</constraints>
<properties/>
</component>
<component id="deae5" 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="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="мин. число процессоров по измерению"/>
</properties>
</component>
<component id="61ffc" 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="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="макс. число процессоров по измерению"/>
</properties>
</component>
<component id="380de" class="javax.swing.JSpinner" binding="sMaxDimProc">
<constraints>
<grid row="6" column="3" 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="100" height="30"/>
<maximum-size width="100" height="30"/>
</grid>
</constraints>
<properties/>
</component>
<component id="9b010" class="javax.swing.JCheckBox" binding="cbCube">
<constraints>
<grid row="7" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<horizontalAlignment value="0"/>
<icon value="Common/icons/NotPick.png"/>
<selectedIcon value="Common/icons/Pick.png"/>
<text value="кубические решётки"/>
<toolTipText value="матрица с одинаковым размером измерений"/>
</properties>
</component>
<component id="bd5c7" class="javax.swing.JLabel">
<constraints>
<grid row="4" 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>
<component id="ad38a" class="javax.swing.JSpinner" binding="sMaxProc">
<constraints>
<grid row="4" column="3" 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="100" height="30"/>
<maximum-size width="100" height="30"/>
</grid>
</constraints>
<properties/>
</component>
<component id="4d47b" 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"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="флаги"/>
</properties>
</component>
<component id="45943" class="javax.swing.JLabel">
<constraints>
<grid row="2" 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>
<component id="decc3" class="javax.swing.JTextField" binding="tfFlags">
<constraints>
<grid row="1" column="3" 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="400" height="30"/>
<preferred-size width="400" height="30"/>
<maximum-size width="400" height="30"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
<font size="10"/>
</properties>
</component>
<component id="f6927" class="javax.swing.JTextField" binding="tfEnvironments">
<constraints>
<grid row="2" column="3" 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="400" height="30"/>
<preferred-size width="400" height="30"/>
<maximum-size width="400" height="30"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
<font size="10"/>
</properties>
</component>
<component id="265bb" class="javax.swing.JButton" binding="bAddFlags">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<borderPainted value="false"/>
<icon value="icons/Menu/Regions.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Редактировать флаги"/>
</properties>
</component>
<component id="77de1" class="javax.swing.JButton" binding="bAddEnvironments">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<borderPainted value="false"/>
<icon value="icons/Menu/Regions.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Добавить набор переменных окружения"/>
</properties>
</component>
<component id="7682" class="javax.swing.JButton" binding="bDeleteFlags">
<constraints>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<borderPainted value="false"/>
<icon value="Common/icons/Delete.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Удалить флаги"/>
</properties>
</component>
<component id="6c384" class="javax.swing.JButton" binding="bDeleteEnvironment">
<constraints>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<borderPainted value="false"/>
<icon value="Common/icons/Delete.png"/>
<maximumSize width="30" height="30"/>
<minimumSize width="30" height="30"/>
<preferredSize width="30" height="30"/>
<text value=""/>
<toolTipText value="Удалить переменную окружения"/>
</properties>
</component>
<component id="3f04c" class="javax.swing.JCheckBox" binding="cbDvmStat">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<horizontalAlignment value="0"/>
<icon value="Common/icons/NotPick.png"/>
<selectedIcon value="Common/icons/Pick.png"/>
<text value="Is_DVM_STAT"/>
<toolTipText value="сбор статистики DVM после запуска"/>
</properties>
</component>
<border type="none"/>
<children>
<component id="3540c" 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>
<component id="b047b" 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="238" height="30"/>
<maximum-size width="200" height="30"/>
</grid>
</constraints>
<properties/>
</component>
<component id="4243a" class="javax.swing.JSpinner" binding="sMinDimProc">
<constraints>
<grid row="2" 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="100" height="30"/>
<maximum-size width="100" height="30"/>
</grid>
</constraints>
<properties/>
</component>
<component id="9c464" class="javax.swing.JLabel">
<constraints>
<grid row="2" 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>
<component id="33de5" class="javax.swing.JLabel">
<constraints>
<grid row="3" 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>
<component id="6848c" class="javax.swing.JSpinner" binding="sMaxDimProc">
<constraints>
<grid row="3" 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="100" height="30"/>
<maximum-size width="100" height="30"/>
</grid>
</constraints>
<properties/>
</component>
<component id="9e1a7" 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"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="макс. число процессоров"/>
</properties>
</component>
<component id="67ad5" class="javax.swing.JSpinner" binding="sMaxProc">
<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="100" height="30"/>
<maximum-size width="100" height="30"/>
</grid>
</constraints>
<properties/>
</component>
<component id="e4da0" class="javax.swing.JCheckBox" binding="cbDvmStat">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<horizontalAlignment value="0"/>
<icon value="Common/icons/NotPick.png"/>
<selectedIcon value="Common/icons/Pick.png"/>
<text value="Is_DVM_STAT"/>
<toolTipText value="сбор статистики DVM после запуска"/>
</properties>
</component>
<component id="1f229" class="javax.swing.JCheckBox" binding="cbCube">
<constraints>
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<horizontalAlignment value="0"/>
<icon value="Common/icons/NotPick.png"/>
<selectedIcon value="Common/icons/Pick.png"/>
<text value="кубические решётки"/>
<toolTipText value="матрица с одинаковым размером измерений"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</splitpane>
</children>
</grid>
</form>

View File

@@ -1,23 +1,25 @@
package _VisualDVM.TestingSystem.DVM.DVMSettings.UI;
import Common.MainModule_;
import Common.Database.Objects.DBObject;
import Common.Passes.Pass;
import Common.Utils.Utils_;
import Common.Visual.TextField.StyledTextField;
import Common.Visual.UI;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsSetJson;
import _VisualDVM.GlobalData.CompilerOption.OptionsLine;
import _VisualDVM.GlobalData.CompilerOption.OptionsLinesSet;
import _VisualDVM.Passes.PassCode;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class DVMSettingsFields implements DialogFields {
public JTextField tfName;
public JSpinner sMinDimProc;
public JSpinner sMaxDimProc;
public JSpinner sMaxProc;
public JCheckBox cbCube;
public JTextField tfFlags;
public JTextField tfEnvironments;
public JCheckBox cbDvmStat;
private JPanel content;
@@ -25,39 +27,30 @@ public class DVMSettingsFields implements DialogFields {
public JButton bAddEnvironments;
public JButton bDeleteFlags;
public JButton bDeleteEnvironment;
private JPanel optionsLinesPanel;
private JPanel environmentsLinesPanel;
private JSplitPane SC1;
private JSplitPane SC2;
//
public OptionsLinesSet optionsLines;
//
public void fillOptionsLines(String packed) {
optionsLines = new OptionsLinesSet(); //нужен для отображения таблицы, как дб объекты с ключами
OptionsSetJson optionsSetJson = packed.isEmpty() ? new OptionsSetJson() : Utils_.gson.fromJson(packed, OptionsSetJson.class);
for (OptionsJson optionsJson: optionsSetJson.values) {
OptionsLine optionsLine =new OptionsLine(optionsJson);
optionsLine.id = optionsLines.maxId++;
optionsLines.put(optionsLine.id, optionsLine);
}
//-
optionsLines.mountUI(optionsLinesPanel);
optionsLines.ShowUI();
}
public DVMSettingsFields() {
sMinDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
sMaxDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
sMaxProc.setModel(new SpinnerNumberModel(0, 0, 128, 1));
bAddFlags.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
if (pass.Do(MainModule_.instance.getDb().getTable(Compiler.class).getUI().getCurrent())) {
tfFlags.setText((String) pass.target);
}
}
});
bAddEnvironments.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerEnvironmentsForTesting);
if (pass.Do(MainModule_.instance.getDb().getTable(Compiler.class).getUI().getCurrent()))
tfEnvironments.setText((String) pass.target);
}
});
bDeleteFlags.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
tfFlags.setText("");
}
});
bDeleteEnvironment.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
tfEnvironments.setText("");
}
});
//-
}
@Override
public Component getContent() {

View File

@@ -21,7 +21,7 @@ public class DVMHelpParser {
//-
public static Compiler compiler = null;
public static String[] banned_options = new String[]{
"-o",
// "-o", todo убрать
"-c",
"-f90",
"-FI"