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

45 lines
1.5 KiB
Java
Raw Normal View History

2024-10-14 12:14:01 +03:00
package _VisualDVM.Passes.All;
import _VisualDVM.Global;
2024-10-14 12:14:01 +03:00
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Sapfor.SilentSapforPass;
2023-09-17 22:13:42 +03:00
public class SPF_GetMaxMinBlockDistribution extends SilentSapforPass {
@Override
public boolean needsConfirmations() {
return false;
}
@Override
protected boolean needsAnimation() {
return false;
}
@Override
protected boolean canStart(Object... args) throws Exception {
2024-10-14 15:19:13 +03:00
if (super.canStart(args)) {
2023-09-17 22:13:42 +03:00
SPF_ParseFilesWithOrder.silent = true;
2024-10-14 15:19:13 +03:00
return (Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).isDone() || Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do());
2023-09-17 22:13:42 +03:00
}
return false;
}
@Override
protected void body() throws Exception {
sapfor.RunAnalysis(
getSapforPassName(),
-Global.messagesServer.getPort(),
target.sapforProperties.pack(),
2023-09-17 22:13:42 +03:00
target.getProjFile().getAbsolutePath());
}
@Override
protected void performFinish() throws Exception {
super.performFinish();
SPF_ParseFilesWithOrder.silent = false;
}
@Override
protected void performDone() throws Exception {
super.performDone();
target.testMaxDim = 0;
String packed = sapfor.getResult();
2024-10-14 15:19:13 +03:00
String[] data = packed.split(" ");
if (data.length > 0)
target.testMaxDim = Integer.parseInt(data[data.length - 1]);
2023-09-17 22:13:42 +03:00
}
}