no message
This commit is contained in:
@@ -3,6 +3,7 @@ import Common.Utils.Utils_;
|
||||
import Common.Utils.Stopwatch;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Visual.UI_;
|
||||
import MainModule_.MainModule_;
|
||||
import Visual_DVM_2021.PassStats.PassStats;
|
||||
import Visual_DVM_2021.Passes.PassCode;
|
||||
import Visual_DVM_2021.Passes.UI.PassForm;
|
||||
@@ -94,24 +95,22 @@ public class Pass<T> {
|
||||
public void UpdateStatsIfNeed() {
|
||||
if (hasStats()) {
|
||||
try {
|
||||
Global.mainModule.getDb().passStats.IncPassStat(code());
|
||||
MainModule_.object.getDb().passStats.IncPassStat(getName());
|
||||
} catch (Exception ex) {
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
UI.fastAccessMenuBar.Refresh(); //todo все бары в мейн модуль. или уи.мейн модуль
|
||||
}
|
||||
}
|
||||
public PassCode code() {
|
||||
return PassCode.valueOf(getClass().getSimpleName());
|
||||
}
|
||||
public boolean isDone() {
|
||||
return state.equals(PassState.Done);
|
||||
}
|
||||
public void setDone() {
|
||||
state.equals(PassState.Done);
|
||||
}
|
||||
public String getName(){return getClass().getSimpleName();}
|
||||
public String getDescription() {
|
||||
return code().getDescription();
|
||||
return Global.mainModule.getPassDescription(getName());
|
||||
}
|
||||
public String getStartDescription() {
|
||||
return getDescription();
|
||||
|
||||
@@ -88,6 +88,9 @@ public abstract class MainModule_<D extends VisualiserDatabase> {
|
||||
public Pass getPass(PassCode_ code){
|
||||
return passes.get(code);
|
||||
}
|
||||
public String getPassDescription(String passName){
|
||||
return ((PassCode_)Enum.valueOf(MainModule_.object.getPassCodesEnum(), passName)).getDescription();
|
||||
}
|
||||
public Vector<Pass> getFirstAccessPasses(){
|
||||
Vector<PassStats> sortedStats = new Vector<>(getDb().passStats.Data.values());
|
||||
sortedStats.sort(new Comparator<PassStats>() {
|
||||
|
||||
@@ -11,15 +11,14 @@ public class PassStatsDBTable extends DBTable<String, PassStats> {
|
||||
public String getSingleDescription() {
|
||||
return "статистика выполнения прохода";
|
||||
}
|
||||
public void IncPassStat(PassCode_ code) throws Exception {
|
||||
String code_s = code.toString();
|
||||
public void IncPassStat(String passName) throws Exception {
|
||||
PassStats passStats = null;
|
||||
if (Data.containsKey(code_s)) {
|
||||
passStats = Data.get(code_s);
|
||||
if (Data.containsKey(passName)) {
|
||||
passStats = Data.get(passName);
|
||||
passStats.Inc();
|
||||
getDb().Update(passStats);
|
||||
} else {
|
||||
passStats = new PassStats(code_s);
|
||||
passStats = new PassStats(passName);
|
||||
passStats.Inc();
|
||||
getDb().Insert(passStats);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class DVMConvertProject extends ComponentsRepositoryPass<db_project_info>
|
||||
//-
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Transformations/" + code().toString() + ".png";
|
||||
return "/icons/Transformations/" + getName() + ".png";
|
||||
}
|
||||
@Override
|
||||
public boolean hasStats() {
|
||||
|
||||
@@ -60,7 +60,7 @@ public class PublishComponent extends ComponentsRepositoryPass<Component> {
|
||||
f.fields.cbAssemblyOnServer.setVisible(false);
|
||||
f.fields.cbAssemblyOnServer.setSelected(false);
|
||||
}
|
||||
if (f.ShowDialog(code().getDescription())) {
|
||||
if (f.ShowDialog(getDescription())) {
|
||||
target.needs_update_minimal_version = f.fields.cbUpdateMinimalVersion.isSelected();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import MainModule_.MainModule_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||
@@ -41,6 +43,6 @@ public class SPF_GetArrayDistribution extends SPF_GetArrayDistributionOnlyAnalys
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return code().getDescription();
|
||||
return Global.mainModule.getPassDescription(getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.Vector_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.Controls.PassControl;
|
||||
import _VisualDVM.Visual.UI;
|
||||
@@ -15,8 +16,8 @@ import java.util.Comparator;
|
||||
import java.util.Vector;
|
||||
public class SPF_GetArrayDistributionOnlyAnalysis extends SapforAnalysis {
|
||||
@Override
|
||||
protected Vector<PassCode> getForbiddenPhases() {
|
||||
return new Vector<>(Collections.singletonList(PassCode.SPF_GetArrayDistributionOnlyRegions));
|
||||
protected Vector<String> getForbiddenPhases() {
|
||||
return new Vector_<>("SPF_GetArrayDistributionOnlyRegions");
|
||||
}
|
||||
@Override
|
||||
public String phase() {
|
||||
|
||||
@@ -19,7 +19,7 @@ public class SPF_StatisticAnalyzer extends SilentSapforPass {
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
sapfor.RunAnalysis(
|
||||
code().toString(),
|
||||
getName(),
|
||||
-Global.messagesServer.getPort(),
|
||||
Global.packSapforSettings(),
|
||||
Utils_.DQuotes(task.getLocalStsFile().getAbsolutePath()) +
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.awt.event.ActionEvent;
|
||||
import java.util.Vector;
|
||||
public class SapforAnalysis extends SapforPass {
|
||||
boolean asDonePhase = false;
|
||||
protected Vector<PassCode> getForbiddenPhases() {
|
||||
protected Vector<String> getForbiddenPhases() {
|
||||
return new Vector<>();
|
||||
}
|
||||
@Override
|
||||
@@ -106,8 +106,8 @@ public class SapforAnalysis extends SapforPass {
|
||||
if (!p.isEmpty() && !phase().equals(p)) {
|
||||
SapforAnalysis analysis =
|
||||
sapfor.getAnalysisByPhase(p);
|
||||
if ((analysis != null) && (analysis.code() != code()) && (analysis.alwaysCheck() || !analysis.isDone())) {
|
||||
if (getForbiddenPhases().contains(analysis.code())) {
|
||||
if ((analysis != null) && (!analysis.getName().equals(getName())) && (analysis.alwaysCheck() || !analysis.isDone())) {
|
||||
if (getForbiddenPhases().contains(analysis.getName())) {
|
||||
analysis.setDone();
|
||||
analysis.MarkAsDone();
|
||||
} else
|
||||
|
||||
@@ -15,7 +15,7 @@ public class SapforTransformation extends SapforPass {
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Transformations/" + code().toString() + ".png";
|
||||
return "/icons/Transformations/" + getName() + ".png";
|
||||
}
|
||||
protected String getVersionLetter() {
|
||||
return "v";
|
||||
@@ -46,7 +46,7 @@ public class SapforTransformation extends SapforPass {
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
sapfor.RunTransformation(
|
||||
code().toString(),
|
||||
getName(),
|
||||
-Global.messagesServer.getPort(),
|
||||
Global.packSapforSettings(),
|
||||
target.getProjFile().getAbsolutePath(),
|
||||
|
||||
@@ -13,7 +13,7 @@ public class SilentSapforPass extends CurrentProjectPass {
|
||||
return true;
|
||||
}
|
||||
protected String getSapforPassName() {
|
||||
return code().toString();
|
||||
return getName();
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Transformation extends CurrentProjectPass {
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Transformations/" + code().toString() + ".png";
|
||||
return "/icons/Transformations/" + getName() + ".png";
|
||||
}
|
||||
protected String getVersionLetter() {
|
||||
return "v";
|
||||
|
||||
Reference in New Issue
Block a user