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

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>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <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$/.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/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/GlobalData/SapforProfile/SapforProfile.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/SapforProfile/SapforProfile.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/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> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

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

View File

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

View File

@@ -1,9 +1,23 @@
package _VisualDVM.GlobalData.SapforProfile; package _VisualDVM.GlobalData.SapforProfile;
import Common.Database.Objects.iDBObject; import Common.Database.Objects.iDBObject;
import Common.Utils.Utils_;
import com.sun.org.glassfish.gmbal.Description; import com.sun.org.glassfish.gmbal.Description;
import javax.swing.*;
public class SapforProfile extends iDBObject { public class SapforProfile extends iDBObject {
@Description("DEFAULT ''") @Description("DEFAULT ''")
public String description = ""; public String description = "";
@Description("DEFAULT 0") @Description("DEFAULT 0")
public long creationDate = 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 Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.GlobalData.SapforProfile.SapforProfile; import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
import _VisualDVM.Passes.PassCode; import _VisualDVM.Passes.PassCode;
import _VisualDVM.Visual.Tables.RendererProfileAuto;
import _VisualDVM.Visual.Tables.SwitcherProfileAuto;
import javax.swing.*; import javax.swing.*;
import java.util.Date; import java.util.Date;
@@ -29,6 +31,28 @@ public class SapforProfilesForm extends DataSetControlForm<SapforProfile> {
public Object getFieldAt(SapforProfile object) { public Object getFieldAt(SapforProfile object) {
return new Date(object.creationDate); 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, UpdateSapforProperty,
ShowAllParallelVariants, ShowAllParallelVariants,
ShowParallelVariantsCoverage, ShowParallelVariantsCoverage,
SetDefaultSapforProfile,
//- //-
DeleteServerSapfor, DeleteServerSapfor,
SaveProfile, SaveProfile,
@@ -356,6 +357,8 @@ public enum PassCode implements PassCode_ {
@Override @Override
public String getDescription() { public String getDescription() {
switch (this) { switch (this) {
case SetDefaultSapforProfile:
return "Установить профиль SAPFOR по умолчанию";
case UpdateSapforProperty: case UpdateSapforProperty:
return "Изменить настройку SAPFOR"; return "Изменить настройку SAPFOR";
case Email: 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;
}
}