2023-11-19 02:12:44 +03:00
|
|
|
package Visual_DVM_2021.Passes.All;
|
2024-10-07 14:22:52 +03:00
|
|
|
import Common.Utils.CommonUtils;
|
2024-10-07 00:58:29 +03:00
|
|
|
import Common_old.UI.UI;
|
2023-09-17 22:13:42 +03:00
|
|
|
import ProjectData.Files.DBProjectFile;
|
2023-11-19 02:12:44 +03:00
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|