Files
VisualSapfor/src/Visual_DVM_2021/Passes/All/SPF_GetFileLineInfo.java

56 lines
1.9 KiB
Java
Raw Normal View History

package Visual_DVM_2021.Passes.All;
2024-10-07 14:22:52 +03:00
import Common.Utils.CommonUtils;
2024-10-09 22:01:19 +03:00
import _VisualDVM.Visual.UI;
2024-10-09 22:21:57 +03:00
import _VisualDVM.ProjectData.Files.DBProjectFile;
import Visual_DVM_2021.Passes.SapforAnalysis;
2023-09-17 22:13:42 +03:00
public class SPF_GetFileLineInfo extends SapforAnalysis {
@Override
public String phase() {
return "FILE_LINE_INFO";
}
@Override
public void performPreparation() throws Exception {
super.performPreparation(); //удаление интеррупта.
target.numLines = 0;
target.numSPF = 0;
target.numDVM = 0;
}
@Override
protected void showPreparation() throws Exception {
UI.getMainWindow().getProjectWindow().getAnalysisWindow().ShowNoMetrics();
}
@Override
protected void unpack(String packed) throws Exception {
//----------------------------------------
String[] data_ = packed.split("@");
DBProjectFile file_ = null;
for (int i = 0; i < data_.length; ++i) {
String s = data_[i];
if (i % 2 == 0) {
2024-10-07 14:22:52 +03:00
file_ = target.db.files.Data.get(CommonUtils.toW(s));
2023-09-17 22:13:42 +03:00
} else {
String[] local = s.split("_");
int num = Integer.parseInt(local[0]);
target.numSPF += Integer.parseInt(local[1]);
target.numDVM += Integer.parseInt(local[2]);
if (file_ != null)
file_.lines_count = num;
target.numLines += num;
}
}
target.UpdateDVMCount();
target.UpdateSPFCount();
target.UpdateLinesCount();
}
@Override
protected void showDone() throws Exception {
UI.getMainWindow().getProjectWindow().getAnalysisWindow().ShowMetrics();
super.showDone();
}
@Override
protected void FocusResult() {
super.FocusResult();
UI.getMainWindow().getProjectWindow().FocusAnalysis();
}
}