no message
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMConfiguration;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import _VisualDVM.TestingSystem.Common.Configuration.Configuration;
|
||||
//конфгурация тестирования ДВМ
|
||||
public class DVMConfiguration extends Configuration {
|
||||
public int c_maxtime = 40;
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
DVMConfiguration c = (DVMConfiguration) src;
|
||||
c_maxtime=c.c_maxtime;
|
||||
}
|
||||
public DVMConfiguration(DVMConfiguration src){
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
public DVMConfiguration(){}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMConfiguration;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Tables.TableRenderers;
|
||||
import _VisualDVM.ServerObjectsCache.ConfigurationCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMConfiguration.UI.ConfigurationFields;
|
||||
public class DVMConfigurationDBTable extends iDBTable<DVMConfiguration> {
|
||||
public DVMConfigurationDBTable() {
|
||||
super(DVMConfiguration.class);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.DVMConfiguration;
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "конфигурация тестирования DVM системы";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "конфигурации тестирования DVM системы";
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this) {
|
||||
@Override
|
||||
public boolean hasCheckBox() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
columns.get(6).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(6).setMaxWidth(500);
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"имя",
|
||||
"автор",
|
||||
"ядра",
|
||||
"параметры",
|
||||
"группы",
|
||||
"тестов",
|
||||
"компиляция(с)",
|
||||
"запуск(с)"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(DVMConfiguration object, int columnIndex) {
|
||||
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(object);
|
||||
switch (columnIndex) {
|
||||
case 2:
|
||||
return object.description;
|
||||
case 3:
|
||||
return object.sender_name;
|
||||
case 4:
|
||||
return object.kernels;
|
||||
case 5:
|
||||
return cache.settingsSummary;
|
||||
case 6:
|
||||
return cache.groupsSummary;
|
||||
case 7:
|
||||
return cache.getTestsCount();
|
||||
case 8:
|
||||
return object.c_maxtime;
|
||||
case 9:
|
||||
return object.maxtime;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public DBObjectDialog<DVMConfiguration, ConfigurationFields> getDialog() {
|
||||
return new DBObjectDialog<DVMConfiguration, ConfigurationFields>(ConfigurationFields.class) {
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 300;
|
||||
}
|
||||
@Override
|
||||
public int getDefaultWidth() {
|
||||
return 500;
|
||||
}
|
||||
@Override
|
||||
public void fillFields() {
|
||||
fields.tfName.setText(Result.description);
|
||||
//------->>>>
|
||||
fields.sCompilationMaxtime.setValue(Result.c_maxtime);
|
||||
fields.sRunMaxtime.setValue(Result.maxtime);
|
||||
fields.sKernels.setValue(Result.kernels);
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.description = fields.tfName.getText();
|
||||
Result.c_maxtime = (int) fields.sCompilationMaxtime.getValue();
|
||||
Result.maxtime = (int) fields.sRunMaxtime.getValue();
|
||||
Result.kernels = (int) fields.sKernels.getValue();
|
||||
}
|
||||
@Override
|
||||
public void SetReadonly() {
|
||||
fields.tfName.setEnabled(false);
|
||||
fields.sCompilationMaxtime.setEnabled(false);
|
||||
fields.sRunMaxtime.setEnabled(false);
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public boolean ShowEditObjectDialog(DBObject object) {
|
||||
return (Current.getAccount().CheckAccessRights(((DVMConfiguration) object).sender_address, null)) ? super.ShowEditObjectDialog(object) : ViewObject(object);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMConfiguration;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class DVMConfigurationsMenuBar extends DataMenuBar {
|
||||
public DVMConfigurationsMenuBar() {
|
||||
super("конфигурации");
|
||||
addPasses(
|
||||
PassCode_2021.PublishConfiguration,
|
||||
|
||||
PassCode_2021.EditConfiguration,
|
||||
PassCode_2021.ShowCurrentDVMConfigurationTests,
|
||||
PassCode_2021.SaveCurrentDVMConfiguration,
|
||||
PassCode_2021.DeleteConfiguration,
|
||||
|
||||
PassCode_2021.StartSelectedDVMConfigurations
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.TestingSystem.DVM.DVMConfiguration.UI.ConfigurationFields">
|
||||
<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="467" height="163"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="5bf8c" layout-manager="GridLayoutManager" row-count="5" 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="18f5c" 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="68a9">
|
||||
<constraints>
|
||||
<grid row="4" 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="fdaa3" 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="1a85a" 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="fbc6d" class="javax.swing.JSpinner" binding="sCompilationMaxtime">
|
||||
<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="238" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="30c43" 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="69368" class="javax.swing.JSpinner" binding="sRunMaxtime">
|
||||
<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="15871" 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="ядра"/>
|
||||
<toolTipText value="количество ядер, задействованное при тестировани"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="bd4cb" class="javax.swing.JSpinner" binding="sKernels">
|
||||
<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>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
@@ -0,0 +1,34 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMConfiguration.UI;
|
||||
import _VisualDVM.Constants;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class ConfigurationFields implements DialogFields {
|
||||
public JTextField tfName;
|
||||
public JSpinner sCompilationMaxtime;
|
||||
public JSpinner sRunMaxtime;
|
||||
//-
|
||||
private JPanel content;
|
||||
public JSpinner sKernels;
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
}
|
||||
public ConfigurationFields(){
|
||||
sCompilationMaxtime.setModel(new SpinnerNumberModel(40,
|
||||
5, 3600, 1
|
||||
));
|
||||
sRunMaxtime.setModel(new SpinnerNumberModel(40,
|
||||
5, 3600, 1
|
||||
));
|
||||
sKernels.setModel(new SpinnerNumberModel(1, 1,
|
||||
Constants.testingMaxKernels,
|
||||
1));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user