Files
VisualSapfor/src/_VisualDVM/Passes/All/SPF_GetAllDeclaratedArrays.java

71 lines
2.6 KiB
Java
Raw Normal View History

2024-10-14 12:14:01 +03:00
package _VisualDVM.Passes.All;
2023-09-17 22:13:42 +03:00
import Common.Utils.Index;
2024-10-14 15:19:13 +03:00
import _VisualDVM.Global;
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
2024-10-09 22:21:57 +03:00
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
2024-10-14 15:19:13 +03:00
import _VisualDVM.Visual.UI;
2023-09-17 22:13:42 +03:00
import java.math.BigInteger;
public class SPF_GetAllDeclaratedArrays extends SapforAnalysis {
@Override
public String phase() {
return "GET_ALL_ARRAY_DECL";
}
@Override
protected void performPreparation() throws Exception {
super.performPreparation(); //удаление интеррупта.
target.declaratedArrays.clear();
for (DBProjectFile f : target.db.files.Data.values())
f.array_decls.clear();
}
@Override
protected void showPreparation() {
UI.getMainWindow().getProjectWindow().getArraysWindow().ShowNoArrays();
if (Global.mainModule.HasFile())
Global.mainModule.getFile().form.ShowNoArrays();
2023-09-17 22:13:42 +03:00
}
@Override
public void unpack(String packed) throws Exception {
if (packed.toCharArray()[packed.length() - 1] == '\0')
packed = packed.substring(packed.length() - 1);
if (packed.length() == 0)
return;
String[] splitedPackedList = packed.split("@");
for (String elem : splitedPackedList) {
String[] info = elem.split("#");
Index idx = new Index();
//тут знак.
ProjectArray arrayToAdd = new ProjectArray(info, idx,
BigInteger.ONE);
target.declaratedArrays.put(arrayToAdd.id, arrayToAdd);
}
for (DBProjectFile file : target.db.files.Data.values())
file.ArrayGraphTitle = "Объявлений: " + file.array_decls.size();
target.UpdateArraysCount();
}
@Override
protected boolean alwaysCheck() {
return true;
}
@Override
protected boolean isAtomic() {
return false;
}
@Override
protected void FocusResult() {
UI.getMainWindow().getProjectWindow().FocusArrays();
if (Global.mainModule.HasFile())
Global.mainModule.getFile().form.FocusArrays();
2023-09-17 22:13:42 +03:00
}
@Override
protected void showDone() throws Exception {
UI.getMainWindow().getProjectWindow().getArraysWindow().ShowArrays();
UI.getMainWindow().getProjectWindow().getAnalysisWindow().ShowArraysCount();
UI.getMainWindow().getProjectWindow().getAnalysisWindow().ShowRegions();
if (Global.mainModule.HasFile())
Global.mainModule.getFile().form.ShowArrays();
2023-09-17 22:13:42 +03:00
super.showDone();
}
}