diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 54c43310..872050f0 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,305 +7,14 @@
-
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -326,9 +35,9 @@
diff --git a/src/Common/Passes/PassCode_.java b/src/Common/Passes/PassCode_.java
new file mode 100644
index 00000000..8d018948
--- /dev/null
+++ b/src/Common/Passes/PassCode_.java
@@ -0,0 +1,6 @@
+package Common.Passes;
+public interface PassCode_ {
+ default String getDescription(){
+ return "?";
+ }
+}
diff --git a/src/Common/Utils/Passes/PassCode_.java b/src/Common/Utils/Passes/PassCode_.java
deleted file mode 100644
index 57109b37..00000000
--- a/src/Common/Utils/Passes/PassCode_.java
+++ /dev/null
@@ -1,3 +0,0 @@
-package Common.Utils.Passes;
-public interface PassCode_ {
-}
diff --git a/src/Common/Utils/Passes/Pass_.java b/src/Common/Utils/Passes/Pass_.java
deleted file mode 100644
index 37c2b2fa..00000000
--- a/src/Common/Utils/Passes/Pass_.java
+++ /dev/null
@@ -1,3 +0,0 @@
-package Common.Utils.Passes;
-public class Pass_ {
-}
diff --git a/src/Visual_DVM_2021/PassStats/PassStats.java b/src/Visual_DVM_2021/PassStats/PassStats.java
index 4c8cccfa..82a76f9c 100644
--- a/src/Visual_DVM_2021/PassStats/PassStats.java
+++ b/src/Visual_DVM_2021/PassStats/PassStats.java
@@ -5,7 +5,7 @@ import Visual_DVM_2021.Passes.Pass;
import com.sun.org.glassfish.gmbal.Description;
public class PassStats extends DBObject {
@Description("PRIMARY KEY, UNIQUE")
- public PassCode code = PassCode.Undefined;
+ public PassCode code = null; //TODO в строчный формат.
//меняется только когда юзер кликает на пункте меню или же на кнопке.
public int Usages = 0;
public PassStats() {
diff --git a/src/Visual_DVM_2021/Passes/All/UpdateComponent.java b/src/Visual_DVM_2021/Passes/All/UpdateComponent.java
index 4641df64..213e35d4 100644
--- a/src/Visual_DVM_2021/Passes/All/UpdateComponent.java
+++ b/src/Visual_DVM_2021/Passes/All/UpdateComponent.java
@@ -17,20 +17,20 @@ public class UpdateComponent extends Pass {
}
@Override
protected void body() throws Exception {
- PassCode subPass = PassCode.Undefined;
+ PassCode subPassCode = null;
//
switch (Current.getComponent().getComponentType()) {
case Sapfor_F:
case Visualizer_2:
- subPass = CommonUtils.isWindows() ? PassCode.DownloadComponent : PassCode.BuildComponent;
+ subPassCode = CommonUtils.isWindows() ? PassCode.DownloadComponent : PassCode.BuildComponent;
break;
case Visualiser:
case Instruction:
case PerformanceAnalyzer:
- subPass = PassCode.DownloadComponent;
+ subPassCode = PassCode.DownloadComponent;
break;
}
- if ((subPass != PassCode.Undefined) && passes.get(subPass).Do()) {
+ if ((subPassCode != null) && passes.get(subPassCode).Do()) {
//
if (!Current.getComponent().getNewFile().exists())
throw new PassException("Не удалось получить новый файл для компонента " + Current.getComponent().getComponentType().getDescription());
diff --git a/src/Visual_DVM_2021/Passes/Pass.java b/src/Visual_DVM_2021/Passes/Pass.java
index 95a65935..26a055fa 100644
--- a/src/Visual_DVM_2021/Passes/Pass.java
+++ b/src/Visual_DVM_2021/Passes/Pass.java
@@ -1,18 +1,18 @@
package Visual_DVM_2021.Passes;
import Common.Current_;
import Common.Utils.CommonUtils;
+import Common.Utils.Stopwatch;
+import Common.Utils.TextLog;
import Common.Visual.CommonUI;
+import Visual_DVM_2021.PassStats.PassStats;
+import Visual_DVM_2021.Passes.UI.PassForm;
import _VisualDVM.Current;
-import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.Global;
+import _VisualDVM.GlobalData.GlobalDatabase;
import _VisualDVM.Visual.Controls.PassButton;
import _VisualDVM.Visual.Controls.PassControl;
import _VisualDVM.Visual.Menus.StablePassMenuItem;
import _VisualDVM.Visual.UI;
-import Common.Utils.Stopwatch;
-import Common.Utils.TextLog;
-import Visual_DVM_2021.PassStats.PassStats;
-import Visual_DVM_2021.Passes.UI.PassForm;
import javax.swing.*;
import java.awt.event.ActionEvent;
@@ -49,27 +49,25 @@ public class Pass {
for (PassCode code_in : codes_in)
passes.get(code_in).setControlsVisible(flag);
}
- //важно. вызывать только если есть интерфейс.
+ //важно. вызывать только если есть интерфейс. passstats делать частью общей бд.пусть будут.
public static void CheckAllStats() throws Exception {
for (Pass pass : FAPasses) {
- if (!((GlobalDatabase)CommonUtils.db).passStats.Data.containsKey(pass.code()))
+ if (!((GlobalDatabase) CommonUtils.db).passStats.Data.containsKey(pass.code()))
CommonUtils.db.Insert(pass.stats = new PassStats(pass));
- else pass.stats = ((GlobalDatabase)CommonUtils.db).passStats.Data.get(pass.code());
+ else pass.stats = ((GlobalDatabase) CommonUtils.db).passStats.Data.get(pass.code());
}
FAPasses.sort(new SortPassesByStats());
}
public static void CreateAll() {
for (PassCode code : PassCode.values()) {
- if (code != PassCode.Undefined) {
- try {
- Class> clazz = Class.forName("Visual_DVM_2021.Passes.All." + code.toString());
- Pass pass = ((Pass) clazz.newInstance());
- passes.put(code, pass);
- if (pass.hasStats())
- FAPasses.add(pass);
- } catch (Exception ex) {
- CommonUtils.MainLog.PrintException(ex);
- }
+ try {
+ Class> clazz = Class.forName("Visual_DVM_2021.Passes.All." + code.toString());
+ Pass pass = ((Pass) clazz.newInstance());
+ passes.put(code, pass);
+ if (pass.hasStats())
+ FAPasses.add(pass);
+ } catch (Exception ex) {
+ CommonUtils.MainLog.PrintException(ex);
}
}
}
@@ -78,7 +76,7 @@ public class Pass {
public String getIconPath() {
return null;
}
- public Icon getTabIcon(){
+ public Icon getTabIcon() {
return CommonUtils.getTabIcon(getIconPath());
}
public AbstractAction getControlAction() {
diff --git a/src/Visual_DVM_2021/Passes/PassCode.java b/src/Visual_DVM_2021/Passes/PassCode.java
index bd59f55b..db5bd124 100644
--- a/src/Visual_DVM_2021/Passes/PassCode.java
+++ b/src/Visual_DVM_2021/Passes/PassCode.java
@@ -1,8 +1,7 @@
package Visual_DVM_2021.Passes;
-import Common.Utils.Passes.PassCode_;
+import Common.Passes.PassCode_;
import _VisualDVM.Constants;
public enum PassCode implements PassCode_ {
- Undefined,
//-
UpdateProperty,
ShowAllParallelVariants,
@@ -354,13 +353,11 @@ public enum PassCode implements PassCode_ {
EditDVMSettings,
DeleteDVMSettings,
CloneDVMSettings,
- CloneSapforSettings,
- ;
+ CloneSapforSettings;
//--
+ @Override
public String getDescription() {
switch (this) {
- case Undefined:
- return "?";
case CloneSapforSettings:
return "Клонировать параметры тестирования SAPFOR";
case CloneDVMSettings:
@@ -954,6 +951,7 @@ public enum PassCode implements PassCode_ {
return toString();
}
}
+ //----------------------------------------->>
public String getTestingCommand() {
String p = "-passN";
String name = "?";
@@ -1050,7 +1048,6 @@ public enum PassCode implements PassCode_ {
}
return p + " " + name;
}
- //-- для тестирования.
public boolean isSapforStart(){
return Constants.startSapforCodes.contains(this);
}