2024-10-09 22:21:57 +03:00
|
|
|
|
package _VisualDVM.TestingSystem.DVM.DVMConfiguration;
|
2024-10-07 00:58:29 +03:00
|
|
|
|
import Common.Database.Objects.DBObject;
|
|
|
|
|
|
import Common.Database.Tables.iDBTable;
|
2024-10-08 00:39:13 +03:00
|
|
|
|
import Common.Visual.DataSetControlForm;
|
2024-10-16 20:45:59 +03:00
|
|
|
|
import Common.Visual.Menus.DataMenuBar;
|
2024-10-15 15:13:57 +03:00
|
|
|
|
import Common.Visual.Tables.RendererMultiline;
|
2024-10-14 15:19:13 +03:00
|
|
|
|
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
|
|
|
|
|
import _VisualDVM.Current;
|
2024-10-13 22:08:13 +03:00
|
|
|
|
import _VisualDVM.Global;
|
2024-10-16 20:45:59 +03:00
|
|
|
|
import _VisualDVM.Passes.PassCode;
|
2024-10-08 23:45:06 +03:00
|
|
|
|
import _VisualDVM.ServerObjectsCache.ConfigurationCache;
|
|
|
|
|
|
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
2024-10-09 22:21:57 +03:00
|
|
|
|
import _VisualDVM.TestingSystem.DVM.DVMConfiguration.UI.ConfigurationFields;
|
2024-09-15 01:36:19 +03:00
|
|
|
|
public class DVMConfigurationDBTable extends iDBTable<DVMConfiguration> {
|
|
|
|
|
|
public DVMConfigurationDBTable() {
|
2024-09-14 00:18:27 +03:00
|
|
|
|
super(DVMConfiguration.class);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Current CurrentName() {
|
2024-09-15 01:36:19 +03:00
|
|
|
|
return Current.DVMConfiguration;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getSingleDescription() {
|
2024-10-16 20:45:59 +03:00
|
|
|
|
return "конфигурация";
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getPluralDescription() {
|
2024-10-16 20:45:59 +03:00
|
|
|
|
return "конфигурации";
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected DataSetControlForm createUI() {
|
|
|
|
|
|
return new DataSetControlForm(this) {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public boolean hasCheckBox() {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected void AdditionalInitColumns() {
|
2024-10-15 15:13:57 +03:00
|
|
|
|
columns.get(6).setRendererClass(RendererMultiline.class);
|
2024-10-01 17:33:08 +03:00
|
|
|
|
columns.get(6).setMaxWidth(500);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String[] getUIColumnNames() {
|
|
|
|
|
|
return new String[]{
|
|
|
|
|
|
"имя",
|
|
|
|
|
|
"автор",
|
2024-09-20 01:52:39 +03:00
|
|
|
|
"ядра",
|
2024-10-01 17:33:08 +03:00
|
|
|
|
"параметры",
|
2024-09-15 01:36:19 +03:00
|
|
|
|
"группы",
|
|
|
|
|
|
"тестов",
|
2024-10-01 17:33:08 +03:00
|
|
|
|
"компиляция(с)",
|
|
|
|
|
|
"запуск(с)"
|
2023-09-17 22:13:42 +03:00
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
2024-09-14 00:18:27 +03:00
|
|
|
|
public Object getFieldAt(DVMConfiguration object, int columnIndex) {
|
2024-09-18 13:37:11 +03:00
|
|
|
|
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(object);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
switch (columnIndex) {
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
return object.description;
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
return object.sender_name;
|
|
|
|
|
|
case 4:
|
2024-09-20 01:52:39 +03:00
|
|
|
|
return object.kernels;
|
2024-09-19 23:05:04 +03:00
|
|
|
|
case 5:
|
2024-10-01 17:33:08 +03:00
|
|
|
|
return cache.settingsSummary;
|
2024-09-20 01:52:39 +03:00
|
|
|
|
case 6:
|
2024-10-01 17:33:08 +03:00
|
|
|
|
return cache.groupsSummary;
|
2024-09-19 23:05:04 +03:00
|
|
|
|
case 7:
|
2024-10-01 17:33:08 +03:00
|
|
|
|
return cache.getTestsCount();
|
2024-09-20 01:52:39 +03:00
|
|
|
|
case 8:
|
|
|
|
|
|
return object.c_maxtime;
|
2024-10-01 17:33:08 +03:00
|
|
|
|
case 9:
|
2024-09-20 01:52:39 +03:00
|
|
|
|
return object.maxtime;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
default:
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
2024-09-14 00:18:27 +03:00
|
|
|
|
public DBObjectDialog<DVMConfiguration, ConfigurationFields> getDialog() {
|
|
|
|
|
|
return new DBObjectDialog<DVMConfiguration, ConfigurationFields>(ConfigurationFields.class) {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
@Override
|
|
|
|
|
|
public int getDefaultHeight() {
|
2024-10-01 17:33:08 +03:00
|
|
|
|
return 300;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public int getDefaultWidth() {
|
2024-10-01 17:33:08 +03:00
|
|
|
|
return 500;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void fillFields() {
|
|
|
|
|
|
fields.tfName.setText(Result.description);
|
|
|
|
|
|
//------->>>>
|
|
|
|
|
|
fields.sCompilationMaxtime.setValue(Result.c_maxtime);
|
2024-09-14 00:18:27 +03:00
|
|
|
|
fields.sRunMaxtime.setValue(Result.maxtime);
|
2024-09-20 01:52:39 +03:00
|
|
|
|
fields.sKernels.setValue(Result.kernels);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void ProcessResult() {
|
|
|
|
|
|
Result.description = fields.tfName.getText();
|
|
|
|
|
|
Result.c_maxtime = (int) fields.sCompilationMaxtime.getValue();
|
2024-09-14 00:18:27 +03:00
|
|
|
|
Result.maxtime = (int) fields.sRunMaxtime.getValue();
|
2024-10-01 17:33:08 +03:00
|
|
|
|
Result.kernels = (int) fields.sKernels.getValue();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void SetReadonly() {
|
|
|
|
|
|
fields.tfName.setEnabled(false);
|
|
|
|
|
|
fields.sCompilationMaxtime.setEnabled(false);
|
|
|
|
|
|
fields.sRunMaxtime.setEnabled(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public boolean ShowEditObjectDialog(DBObject object) {
|
2024-10-13 22:08:13 +03:00
|
|
|
|
return (Global.mainModule.getAccount().CheckAccessRights(((DVMConfiguration) object).sender_address, null)) ? super.ShowEditObjectDialog(object) : ViewObject(object);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
2024-10-14 20:57:18 +03:00
|
|
|
|
@Override
|
2024-10-16 20:45:59 +03:00
|
|
|
|
public DataMenuBar createMenuBar() {
|
|
|
|
|
|
return new DataMenuBar(getPluralDescription(),
|
|
|
|
|
|
PassCode.PublishConfiguration,
|
|
|
|
|
|
PassCode.EditConfiguration,
|
|
|
|
|
|
PassCode.ShowCurrentDVMConfigurationTests,
|
|
|
|
|
|
PassCode.SaveCurrentDVMConfiguration,
|
|
|
|
|
|
PassCode.DeleteConfiguration,
|
|
|
|
|
|
PassCode.StartSelectedDVMConfigurations );
|
2024-10-14 20:57:18 +03:00
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|