галочка для назначения профиля по умолчанию

This commit is contained in:
2025-01-16 23:44:17 +03:00
parent 72e4fbdf31
commit 01da3b3a70
9 changed files with 139 additions and 21 deletions

9
.idea/workspace.xml generated
View File

@@ -7,10 +7,15 @@
</component>
<component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SetDefaultSapforProfile.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Tables/RendererProfileAuto.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Tables/SwitcherProfileAuto.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/GlobalDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/GlobalDatabase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/SapforProperties.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/SapforProperties.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/ProjectMenuBar/ProjectSettingsMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/ProjectMenuBar/ProjectSettingsMenu.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/SapforProfile/SapforProfile.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/SapforProfile/SapforProfile.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/SapforProfile/UI/SapforProfilesForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/SapforProfile/UI/SapforProfilesForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@@ -3,7 +3,7 @@
"ServerAddress": "alex-freenas.ddns.net",
"ServerUserName": "testuser",
"ServerUserSHHPort": 2000,
"ComponentsServerPort": 7996,
"ComponentsServerPort": 7995,
"TestingServerPort": 7998,
"SocketTimeout": 5000,
"OldServer": false,
@@ -15,48 +15,48 @@
"collapseFileMessages": false,
"collapseProjectTrees": false,
"BackupWorkspace": "_sapfor_x64_backups",
"Workspace": "E:\\Workspace",
"Workspace": "",
"ProjectsSearchDirectory": "E:\\BUG",
"EditorFontSize": 16,
"EditorFontSize": 14,
"BackupHour": 5,
"BackupMinute": 0,
"EmailAdminsOnStart": false,
"AutoUpdateSearch": true,
"AutoBugReportsLoad": false,
"AutoTestsLoad": false,
"AutoUpdateSearch": false,
"AutoBugReportsLoad": true,
"AutoTestsLoad": true,
"ConfirmPassesStart": true,
"ShowPassesDone": true,
"FocusPassesResult": true,
"ProjectDBName": "new_project_base.sqlite",
"BugReportsDBName": "bug_reports.sqlite",
"TestsDBName": "tests.sqlite",
"ComponentsWindowWidth": 943,
"ComponentsWindowHeight": 310,
"ComponentsWindowWidth": 843,
"ComponentsWindowHeight": 250,
"VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
"InstructionPath": "",
"PerformanceAnalyzerPath": "",
"LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe",
"Kernels": 8,
"Kernels": 4,
"ComponentsBackUpsCount": 10,
"AutoCheckTesting": false,
"AutoCheckTesting": true,
"CheckTestingIntervalSeconds": 10,
"EmailOnTestingProgress": true,
"EmailOnTestingProgress": false,
"eraseTestingWorkspaces": true,
"lastMachineId": 13,
"lastUserId": 34,
"lastCompilerId": 52,
"lastMachineId": -1,
"lastUserId": -1,
"lastCompilerId": -1,
"RegisterOn": false,
"SpacesOn": false,
"EmptyLinesOn": false,
"FortranWrapsOn": false,
"ExtensionsOn": false,
"ComparsionDiffMergeOn": true,
"ShowFullArraysDeclarations": true,
"ComparsionDiffMergeOn": false,
"ShowFullArraysDeclarations": false,
"ShowFullTabsNames": true,
"SmallScreen": false,
"BugReportsAgeLimit": 8,
"FastAccessPassesCount": 5,
"LastOpenedProjectsCount": 25
"BugReportsAgeLimit": 2,
"FastAccessPassesCount": 10,
"LastOpenedProjectsCount": 10
}

View File

@@ -31,6 +31,7 @@ import _VisualDVM.Passes.PassCode;
import java.nio.file.Paths;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Vector;
public class GlobalDatabase extends VisualiserDatabase {
//---------СЕАНС----------------------------------------------
public MachinesDBTable machines;

View File

@@ -1,9 +1,23 @@
package _VisualDVM.GlobalData.SapforProfile;
import Common.Database.Objects.iDBObject;
import Common.Utils.Utils_;
import com.sun.org.glassfish.gmbal.Description;
import javax.swing.*;
public class SapforProfile extends iDBObject {
@Description("DEFAULT ''")
public String description = "";
@Description("DEFAULT 0")
public long creationDate = 0;
@Description("DEFAULT 0")
public int isAuto = 0;
public ImageIcon GetAutoIcon() {
return Utils_.getIcon("/Common/icons/" + (isAuto == 1 ? "RedPick" : "NotPick") + ".png");
}
public String printAuto() {
return isAuto > 0 ? "Да" : "Нет";
}
public void SwitchAuto() {
isAuto = (isAuto == 0) ? 1 : 0;
}
}

View File

@@ -8,6 +8,8 @@ import Common.Visual.Windows.Dialog.DBObjectDialog;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Visual.Tables.RendererProfileAuto;
import _VisualDVM.Visual.Tables.SwitcherProfileAuto;
import javax.swing.*;
import java.util.Date;
@@ -29,6 +31,28 @@ public class SapforProfilesForm extends DataSetControlForm<SapforProfile> {
public Object getFieldAt(SapforProfile object) {
return new Date(object.creationDate);
}
},
new ColumnInfo<SapforProfile>("") {
@Override
public Object getFieldAt(SapforProfile object) {
return object.printAuto();
}
@Override
public Class getRendererClass() {
return RendererProfileAuto.class;
}
@Override
public Class getEditorClass() {
return SwitcherProfileAuto.class;
}
@Override
public int getMinWidth() {
return 25;
}
@Override
public int getMaxWidth() {
return 25;
}
}
);
}

View File

@@ -0,0 +1,37 @@
package _VisualDVM.Passes.All;
import Common.Passes.Pass;
import Common.Utils.Utils_;
import Common.Visual.UI;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
import _VisualDVM.Utils;
import java.util.Vector;
public class SetDefaultSapforProfile extends Pass<SapforProfile> {
@Override
protected boolean canStart(Object... args) throws Exception {
target = (SapforProfile) args[0];
return UI.Question("Назначить профиль "+ Utils_.Brackets(target.description)+" профилем по умолчанию");
}
@Override
protected void body() throws Exception {
Vector<SapforProfile> toDrop = new Vector<>();
for (SapforProfile sapforProfile : Global.mainModule.getDb().sapforProfiles.Data.values()) {
if (sapforProfile.id!=target.id) {
if (sapforProfile.isAuto != 0) {
sapforProfile.isAuto = 0;
toDrop.add(sapforProfile);
}
}
}
for (SapforProfile sapforProfile : toDrop)
Global.mainModule.getDb().Update(sapforProfile);
//--
target.SwitchAuto();
Global.mainModule.getDb().Update(target);
}
@Override
protected void showFinish() throws Exception {
Global.mainModule.getDb().sapforProfiles.getUI().RedrawControl();
}
}

View File

@@ -6,6 +6,7 @@ public enum PassCode implements PassCode_ {
UpdateSapforProperty,
ShowAllParallelVariants,
ShowParallelVariantsCoverage,
SetDefaultSapforProfile,
//-
DeleteServerSapfor,
SaveProfile,
@@ -356,6 +357,8 @@ public enum PassCode implements PassCode_ {
@Override
public String getDescription() {
switch (this) {
case SetDefaultSapforProfile:
return "Установить профиль SAPFOR по умолчанию";
case UpdateSapforProperty:
return "Изменить настройку SAPFOR";
case Email:

View File

@@ -0,0 +1,12 @@
package _VisualDVM.Visual.Tables;
import Common.Visual.Tables.RendererDBObject;
import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
import _VisualDVM.TestingSystem.Common.Configuration.Configuration;
public class RendererProfileAuto extends RendererDBObject {
@Override
public void Display() {
if (value != null) {
setIcon(((SapforProfile) value).GetAutoIcon());
}
}
}

View File

@@ -0,0 +1,22 @@
package _VisualDVM.Visual.Tables;
import Common.Passes.Pass;
import Common.Visual.Tables.EditorDBObject;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Server.EditServerObject;
import _VisualDVM.ServerObjectsCache.VisualCaches;
import _VisualDVM.TestingSystem.Common.Configuration.Configuration;
import _VisualDVM.TestingSystem.Common.TestingServer;
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
public class SwitcherProfileAuto extends EditorDBObject<SapforProfile> {
@Override
public void Action() {
Global.mainModule.getPass(PassCode.SetDefaultSapforProfile).Do(value);
setIcon(value.GetAutoIcon());
}
@Override
public Object getCellEditorValue() {
return value;
}
}