no message
This commit is contained in:
258
src/_VisualDVM/GlobalData/RunConfiguration/RunConfiguration.java
Normal file
258
src/_VisualDVM/GlobalData/RunConfiguration/RunConfiguration.java
Normal file
@@ -0,0 +1,258 @@
|
||||
package _VisualDVM.GlobalData.RunConfiguration;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.TextLog;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.DVMParameter.DVMParameter;
|
||||
import _VisualDVM.GlobalData.EnvironmentValue.EnvironmentValue;
|
||||
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.PassException;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
import java.util.stream.IntStream;
|
||||
public class RunConfiguration extends iDBObject {
|
||||
public static final int maxProc = 16;
|
||||
public int machine_id;
|
||||
//---------------------------------------->
|
||||
@Description("DEFAULT -1")
|
||||
public int compiler_id = CommonConstants.Nan;
|
||||
public String LauncherCall = ""; //например DVM или mpirun
|
||||
public String LauncherOptions = ""; //например run
|
||||
//--------------------------------------
|
||||
//---------------------------------------
|
||||
//в случае mpi всегда одномерная. в случае DVM может быть многомерной
|
||||
//------------------------>>
|
||||
@Description("DEFAULT ''")
|
||||
public String matrix = ""; //решетка. устаревшее поле.
|
||||
//------------------------>>
|
||||
@Description("DEFAULT ''")
|
||||
public String minMatrix = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String maxMatrix = "";
|
||||
@Description("DEFAULT 0")
|
||||
public int dim = 0;
|
||||
@Description("DEFAULT 0")
|
||||
public int cube = 0;
|
||||
//------------------------>>
|
||||
//аргументы командной строки - в линию- для запуска
|
||||
public String args = ""; //аргументы КС
|
||||
//---------------------------------------
|
||||
@Description("DEFAULT 0")
|
||||
public int gcov = 0; //совместимость. гков отныне только на локалке.
|
||||
public static Vector<Integer> getBounds(String bounds) {
|
||||
String[] dims_ = bounds.split(" ");
|
||||
Vector<Integer> res = new Vector<>();
|
||||
for (String dim_ : dims_) {
|
||||
int dim = 1;
|
||||
try {
|
||||
dim = Integer.parseInt(dim_);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
res.add(dim);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static boolean checkCube(Vector<Integer> m) {
|
||||
return IntStream.range(1, m.size()).allMatch(j -> m.get(j).equals(m.get(0)));
|
||||
}
|
||||
public static void gen_rec(Vector<Integer> from, Vector<Integer> to, Vector<Vector<Integer>> res, int index, int dim_, boolean cube_) {
|
||||
if (index < dim_) {
|
||||
Vector<Vector<Integer>> old = new Vector<>();
|
||||
for (Vector<Integer> L : res)
|
||||
old.add(L);
|
||||
res.clear();
|
||||
for (int i = from.get(index); i <= to.get(index); ++i) {
|
||||
for (Vector<Integer> L : old) {
|
||||
Vector<Integer> buffer = new Vector<>(L);
|
||||
buffer.add(i);
|
||||
if (!cube_ || checkCube(buffer))
|
||||
res.add(buffer);
|
||||
}
|
||||
}
|
||||
gen_rec(from, to, res, index + 1, dim_, cube_);
|
||||
}
|
||||
}
|
||||
//для окна конфигурации.
|
||||
public static void validateMatrixes(String minMatrix_, String maxMatrix_, int dim_, boolean cube_, TextLog log) {
|
||||
Vector<Vector<Integer>> res_ = new Vector<>();
|
||||
Vector<String> res = new Vector<>();
|
||||
if (dim_ > 0) {
|
||||
Vector<Integer> from = getBounds(minMatrix_);
|
||||
Vector<Integer> to = getBounds(maxMatrix_);
|
||||
if (from.size() != to.size()) {
|
||||
log.Writeln_("Верхняя и нижняя границы матриц конфигурации имеют разные размерности");
|
||||
return;
|
||||
}
|
||||
if (from.size() != dim_) {
|
||||
log.Writeln_("Границы матриц не совпадают с размерностью конфигурации");
|
||||
return;
|
||||
}
|
||||
//1 стадия. заполнение.
|
||||
for (int j = from.get(0); j <= to.get(0); ++j) {
|
||||
Vector<Integer> m = new Vector<>();
|
||||
res_.add(m);
|
||||
m.add(j);
|
||||
}
|
||||
//---
|
||||
if (dim_ > 1)
|
||||
gen_rec(from, to, res_, 1, dim_, cube_);
|
||||
for (Vector<Integer> m : res_) {
|
||||
Vector<String> ms = new Vector<>();
|
||||
for (int i : m)
|
||||
ms.add(String.valueOf(i));
|
||||
res.add(String.join(" ", ms));
|
||||
}
|
||||
} else
|
||||
res.add("");
|
||||
if (res.isEmpty())
|
||||
log.Writeln_("По заданным границам не будет сгенерировано ни одной матрицы.");
|
||||
}
|
||||
//---------------------------------------->
|
||||
public Compiler getCompiler() {
|
||||
return CommonUtils.db.getById(Compiler.class, compiler_id);
|
||||
}
|
||||
public boolean isCube() {
|
||||
return cube != 0;
|
||||
}
|
||||
public void setCube(boolean cube_in) {
|
||||
cube = cube_in ? 1 : 0;
|
||||
}
|
||||
public String printCube() {
|
||||
return isCube() ? "Да" : "Нет";
|
||||
}
|
||||
public void Patch() {
|
||||
if (!matrix.isEmpty()) {
|
||||
// узнать из старой матрицы параметры минимума и максимума, и размерность.
|
||||
String[] dims = matrix.split(" ");
|
||||
dim = dims.length;
|
||||
Vector<String> minDims = new Vector<>();
|
||||
for (int i = 1; i <= dim; ++i)
|
||||
minDims.add("1");
|
||||
minMatrix = String.join(" ", minDims);
|
||||
maxMatrix = matrix;
|
||||
cube = 1;
|
||||
matrix = "";
|
||||
}
|
||||
}
|
||||
public String getDescription() {
|
||||
String res = "";
|
||||
if (!LauncherCall.isEmpty()) {
|
||||
res += CommonUtils.Brackets(LauncherCall);
|
||||
if (!LauncherOptions.isEmpty())
|
||||
res += " " + CommonUtils.Brackets(LauncherOptions);
|
||||
} else res = " — ";
|
||||
return res;
|
||||
}
|
||||
public String getLaunchScriptText(String binary_name, String task_matrix) {
|
||||
String res = "";
|
||||
if (!LauncherCall.isEmpty()) {
|
||||
res += CommonUtils.DQuotes(LauncherCall);
|
||||
if (!LauncherOptions.isEmpty())
|
||||
res += " " + LauncherOptions;
|
||||
if (!task_matrix.isEmpty())
|
||||
res += " " + task_matrix;
|
||||
}
|
||||
if (!res.isEmpty())
|
||||
res += " ";
|
||||
res += CommonUtils.DQuotes("./" + binary_name);
|
||||
if (!args.isEmpty())
|
||||
res += " " + args;
|
||||
return res;
|
||||
}
|
||||
public String getLaunchShortDescription() {
|
||||
String res = "";
|
||||
if (compiler_id != CommonConstants.Nan) {
|
||||
res += getCompiler().description;
|
||||
if (!LauncherOptions.isEmpty())
|
||||
res += " " + LauncherOptions;
|
||||
}
|
||||
if (!res.isEmpty())
|
||||
res += " ";
|
||||
if (!args.isEmpty())
|
||||
res += " " + args;
|
||||
return res;
|
||||
}
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return Current.HasMachine() && (machine_id == Current.getMachine().id);
|
||||
}
|
||||
@Override
|
||||
public String getFKName() {
|
||||
return "run_configuration_id";
|
||||
}
|
||||
public Vector<String> getEnvList() {
|
||||
return CommonUtils.db.getVectorStringByFK(this, EnvironmentValue.class);
|
||||
}
|
||||
public Vector<String> getParList() {
|
||||
return CommonUtils.db.getVectorStringByFK(this, DVMParameter.class);
|
||||
}
|
||||
public LinkedHashMap<String, String> getEnvMap() {
|
||||
LinkedHashMap<Integer, EnvironmentValue> envs = CommonUtils.db.getMapByFKi(this, EnvironmentValue.class);
|
||||
LinkedHashMap<String, String> res = new LinkedHashMap<>();
|
||||
for (EnvironmentValue e : envs.values()) {
|
||||
if (!res.containsKey(e.name))
|
||||
res.put(e.name, e.value);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public Vector<String> getMatrixes() throws Exception {
|
||||
Vector<Vector<Integer>> res_ = new Vector<>();
|
||||
Vector<String> res = new Vector<>();
|
||||
if (dim > 0) {
|
||||
Vector<Integer> from = getBounds(minMatrix);
|
||||
Vector<Integer> to = getBounds(maxMatrix);
|
||||
if (from.size() != to.size())
|
||||
throw new PassException("Верхняя и нижняя границы матриц конфигурации имеют разные размерности");
|
||||
if (from.size() != dim)
|
||||
throw new PassException("Границы матриц не совпадают с размерностью конфигурации");
|
||||
//1 стадия. заполнение.
|
||||
for (int j = from.get(0); j <= to.get(0); ++j) {
|
||||
Vector<Integer> m = new Vector<>();
|
||||
res_.add(m);
|
||||
m.add(j);
|
||||
}
|
||||
//---
|
||||
if (dim > 1)
|
||||
gen_rec(from, to, res_, 1, dim, isCube());
|
||||
for (Vector<Integer> m : res_) {
|
||||
Vector<String> ms = new Vector<>();
|
||||
for (int i : m)
|
||||
ms.add(String.valueOf(i));
|
||||
res.add(String.join(" ", ms));
|
||||
}
|
||||
} else
|
||||
res.add("");
|
||||
if (res.isEmpty())
|
||||
throw new PassException("Конфигурация не содержит ни одной матрицы.");
|
||||
return res;
|
||||
}
|
||||
public Vector<RunTask> generateRunTasks(db_project_info info, CompilationTask ctask) throws Exception {
|
||||
Vector<RunTask> res = new Vector<>();
|
||||
Vector<String> matrixes_ = getMatrixes();
|
||||
for (String matrix_ : matrixes_) {
|
||||
RunTask task = new RunTask();
|
||||
//->
|
||||
task.machine_id = machine_id;
|
||||
task.user_id = ctask.user_id;
|
||||
task.run_configuration_id = id;
|
||||
task.compilation_task_id = ctask.id;
|
||||
task.project_path = info.Home.getAbsolutePath();
|
||||
task.project_description = info.description;
|
||||
//------------------------------------------
|
||||
task.matrix = matrix_;
|
||||
task.maxtime = info.run_maxtime;
|
||||
task.state = TaskState.Inactive;
|
||||
//->
|
||||
res.add(task);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package _VisualDVM.GlobalData.RunConfiguration;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilerType;
|
||||
import _VisualDVM.GlobalData.DVMParameter.DVMParameter;
|
||||
import _VisualDVM.GlobalData.EnvironmentValue.EnvironmentValue;
|
||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.UI.MatrixBar;
|
||||
import _VisualDVM.GlobalData.RunConfiguration.UI.RunConfigurationFields;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.LinkedHashMap;
|
||||
public class RunConfigurationsDBTable extends iDBTable<RunConfiguration> {
|
||||
public RunConfigurationsDBTable() {
|
||||
super(RunConfiguration.class);
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "конфигурация запуска";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "конфигурации запуска";
|
||||
}
|
||||
@Override
|
||||
public DBObjectDialog<RunConfiguration, RunConfigurationFields> getDialog() {
|
||||
return new DBObjectDialog<RunConfiguration, RunConfigurationFields>(RunConfigurationFields.class) {
|
||||
@Override
|
||||
public void fillFields() {
|
||||
for (Compiler compiler : ((GlobalDatabase)CommonUtils.db).compilers.Data.values()) {
|
||||
if (compiler.isVisible() && compiler.type.equals(CompilerType.dvm))
|
||||
fields.cbLauncherCall.addItem(compiler);
|
||||
}
|
||||
CommonUI.TrySelect_s(fields.cbLauncherCall, Result.LauncherCall);
|
||||
CommonUI.TrySelect(fields.cbLaunchOptions, Result.LauncherOptions);
|
||||
fields.tfArgs.setText(Result.args);
|
||||
fields.cbLauncherCall.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (fields.cbLauncherCall.getSelectedItem() instanceof Compiler) {
|
||||
CommonUI.TrySelect(fields.cbLaunchOptions, "run");
|
||||
}
|
||||
}
|
||||
});
|
||||
fields.cbCube.setSelected(Result.isCube());
|
||||
//------------------------------------------->>>
|
||||
fields.sMaxDim.setModel(new SpinnerNumberModel(
|
||||
Result.dim,
|
||||
0, RunConfiguration.maxProc, 1));
|
||||
fields.minMatrixPanel.add(fields.minMatrixBar = new MatrixBar(Result.minMatrix));
|
||||
fields.maxMatrixPanel.add(fields.maxMatrixBar = new MatrixBar(Result.maxMatrix));
|
||||
//------------------------------------------->>>
|
||||
if (!edit)
|
||||
fields.sMaxDim.setValue(Current.getProject().maxdim);
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.machine_id = Current.getMachine().id;
|
||||
Result.LauncherCall = fields.cbLauncherCall.getSelectedItem().toString();
|
||||
Result.LauncherOptions = (String) fields.cbLaunchOptions.getSelectedItem();
|
||||
if (fields.cbLauncherCall.getSelectedItem() instanceof Compiler) {
|
||||
Result.compiler_id = ((Compiler) (fields.cbLauncherCall.getSelectedItem())).id;
|
||||
} else Result.compiler_id = CommonConstants.Nan;
|
||||
//-
|
||||
Result.dim = (int) fields.sMaxDim.getValue();
|
||||
Result.minMatrix = fields.minMatrixBar.pack(Result.dim);
|
||||
Result.maxMatrix = fields.maxMatrixBar.pack(Result.dim);
|
||||
//-
|
||||
Result.args = fields.tfArgs.getText();
|
||||
Result.cube = fields.cbCube.isSelected() ? 1 : 0;
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
String launcher_call = fields.cbLauncherCall.getSelectedItem().toString();
|
||||
String launcher_options = (String) fields.cbLaunchOptions.getSelectedItem();
|
||||
if (launcher_call.isEmpty() && !launcher_options.isEmpty())
|
||||
Log.Writeln_("Непустые опции запуска допускаются только для DVM системы или MPI");
|
||||
if (fields.cbLauncherCall.getSelectedItem() instanceof Compiler) {
|
||||
Compiler compiler = (Compiler) (fields.cbLauncherCall.getSelectedItem());
|
||||
switch (compiler.type) {
|
||||
case dvm:
|
||||
case mpi:
|
||||
int dim_ = (int) fields.sMaxDim.getValue();
|
||||
RunConfiguration.validateMatrixes(
|
||||
fields.minMatrixBar.pack(dim_),
|
||||
fields.maxMatrixBar.pack(dim_),
|
||||
dim_,
|
||||
fields.cbCube.isSelected(),
|
||||
Log
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
||||
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
||||
res.put(RunTask.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||
res.put(EnvironmentValue.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||
res.put(DVMParameter.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||
return res;
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this) {
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
columns.get(0).setVisible(false);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"Команда",
|
||||
"Опции",
|
||||
"Разм.",
|
||||
"Куб",
|
||||
"Min",
|
||||
"Max",
|
||||
"Аргументы"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(RunConfiguration object, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 1:
|
||||
return object.LauncherCall;
|
||||
case 2:
|
||||
return object.LauncherOptions;
|
||||
case 3:
|
||||
return object.dim;
|
||||
case 4:
|
||||
return object.printCube();
|
||||
case 5:
|
||||
return object.minMatrix;
|
||||
case 6:
|
||||
return object.maxMatrix;
|
||||
case 7:
|
||||
return object.args;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.RunConfiguration;
|
||||
}
|
||||
public void Patch() throws Exception {
|
||||
for (RunConfiguration c : Data.values()) {
|
||||
c.Patch();
|
||||
getDb().Update(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package _VisualDVM.GlobalData.RunConfiguration;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
public class RunConfigurationsMenuBar extends DataMenuBar {
|
||||
public RunConfigurationsMenuBar() {
|
||||
super("конфигурации запуска", PassCode_2021.Run,
|
||||
PassCode_2021.AddRunConfiguration, PassCode_2021.EditRunConfiguration, PassCode_2021.DeleteRunConfiguration);
|
||||
add(new JSeparator());
|
||||
addPasses(PassCode_2021.EditProjectRunMaxtime);
|
||||
}
|
||||
}
|
||||
36
src/_VisualDVM/GlobalData/RunConfiguration/UI/MatrixBar.java
Normal file
36
src/_VisualDVM/GlobalData/RunConfiguration/UI/MatrixBar.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package _VisualDVM.GlobalData.RunConfiguration.UI;
|
||||
import javax.swing.*;
|
||||
import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
public class MatrixBar extends JToolBar {
|
||||
public Vector<JSpinner> dimensions = new Vector<>();
|
||||
public MatrixBar(String bounds) {
|
||||
this.setFloatable(false);
|
||||
if (!bounds.isEmpty()) {
|
||||
String[] sDims = bounds.split(" ");
|
||||
for (String sDim : sDims) {
|
||||
JSpinner S = new MatrixDimensionSpinner(Integer.parseInt(sDim));
|
||||
dimensions.add(S);
|
||||
add(S);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void ShowTillDim(int dim) {
|
||||
if (dimensions.size() < dim) {
|
||||
int delta = dim - dimensions.size();
|
||||
// UI.Info("needs additions "+delta);
|
||||
for (int i = 0; i < delta; ++i) {
|
||||
JSpinner S = new MatrixDimensionSpinner(1);
|
||||
dimensions.add(S);
|
||||
add(S);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < dimensions.size(); ++i)
|
||||
dimensions.get(i).setVisible((i + 1) <= dim);
|
||||
this.revalidate();
|
||||
}
|
||||
public String pack(int dim) {
|
||||
return String.join(" ", IntStream.range(0, dim).mapToObj(i -> dimensions.get(i).getValue().toString()).collect(Collectors.toCollection(Vector::new)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package _VisualDVM.GlobalData.RunConfiguration.UI;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class MatrixDimensionSpinner extends JSpinner {
|
||||
public MatrixDimensionSpinner(int value_in) {
|
||||
java.awt.Dimension p = new Dimension(40, 26);
|
||||
setMinimumSize(p);
|
||||
setMaximumSize(p);
|
||||
setPreferredSize(p);
|
||||
setModel(new SpinnerNumberModel(
|
||||
value_in,
|
||||
1, 16, 1));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.GlobalData.RunConfiguration.UI.RunConfigurationFields">
|
||||
<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="754" height="402"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<splitpane id="e15f7">
|
||||
<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">
|
||||
<preferred-size width="200" height="200"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<dividerLocation value="87"/>
|
||||
<dividerSize value="3"/>
|
||||
<orientation value="0"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="23b61" layout-manager="GridLayoutManager" row-count="1" 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>
|
||||
<splitpane position="left"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="56586" class="javax.swing.JTextField" binding="tfArgs" 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">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="d5d38" 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>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="9b48" 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>
|
||||
<splitpane position="right"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<tabbedpane id="8af45" binding="taskTypeTabs">
|
||||
<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">
|
||||
<preferred-size width="200" height="200"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="7b7aa" layout-manager="GridLayoutManager" row-count="6" column-count="8" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<tabbedpane title="Параметры запуска"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<vspacer id="39e4a">
|
||||
<constraints>
|
||||
<grid row="5" column="1" row-span="1" col-span="7" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="6e0a2" 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="5328f" class="javax.swing.JComboBox" binding="cbLaunchOptions">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="7" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<font name="Times New Roman" size="16" style="0"/>
|
||||
<model>
|
||||
<item value=""/>
|
||||
<item value="run"/>
|
||||
<item value="-np"/>
|
||||
<item value="-n"/>
|
||||
<item value="-ppn"/>
|
||||
</model>
|
||||
<toolTipText value="Выберите из списка дополнительную команду компиляции ( актуально для DVM компиляторов)"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="24ab4" 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="61e12" 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="e88a9" class="javax.swing.JComboBox" binding="cbLauncherCall">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="7" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<font name="Times New Roman" size="16" style="0"/>
|
||||
<model>
|
||||
<item value=""/>
|
||||
<item value="mpirun"/>
|
||||
<item value="mpiexec"/>
|
||||
</model>
|
||||
<toolTipText value="Выберите из списка дополнительную команду компиляции ( актуально для DVM компиляторов)"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="6ae5a" 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="b2e51" 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="cac73" class="javax.swing.JSpinner" binding="sMaxDim">
|
||||
<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="40" height="28"/>
|
||||
<preferred-size width="40" height="28"/>
|
||||
<maximum-size width="40" height="28"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<grid id="70852" binding="minMatrixPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="7" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children/>
|
||||
</grid>
|
||||
<grid id="ca8e6" binding="maxMatrixPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<grid row="4" column="1" row-span="1" col-span="7" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children/>
|
||||
</grid>
|
||||
<component id="924db" class="javax.swing.JCheckBox" binding="cbCube">
|
||||
<constraints>
|
||||
<grid row="2" column="2" 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="icons/NotPick.png"/>
|
||||
<selectedIcon value="icons/Pick.png"/>
|
||||
<text value="кубические решётки"/>
|
||||
<toolTipText value="матрица с одинаковым размером измерений"/>
|
||||
</properties>
|
||||
</component>
|
||||
<hspacer id="22de8">
|
||||
<constraints>
|
||||
<grid row="2" column="3" row-span="1" col-span="5" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</tabbedpane>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</splitpane>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
@@ -0,0 +1,38 @@
|
||||
package _VisualDVM.GlobalData.RunConfiguration.UI;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class RunConfigurationFields implements DialogFields {
|
||||
public JPanel content;
|
||||
public JTabbedPane taskTypeTabs;
|
||||
public JTextField tfArgs;
|
||||
public JComboBox cbLaunchOptions;
|
||||
public JComboBox cbLauncherCall;
|
||||
public JButton bHelp;
|
||||
//---------------------------------------->>
|
||||
public JSpinner sMaxDim;
|
||||
public JPanel minMatrixPanel;
|
||||
public JPanel maxMatrixPanel;
|
||||
public JCheckBox cbCube;
|
||||
//---------------------------------------->>
|
||||
public MatrixBar minMatrixBar;
|
||||
public MatrixBar maxMatrixBar;
|
||||
//---------------------------------------->>
|
||||
public RunConfigurationFields() {
|
||||
sMaxDim.addChangeListener(e -> {
|
||||
minMatrixBar.ShowTillDim((Integer) sMaxDim.getValue());
|
||||
maxMatrixBar.ShowTillDim((Integer) sMaxDim.getValue());
|
||||
content.revalidate();
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfArgs = new StyledTextField();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user