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

80 lines
2.5 KiB
Java
Raw Normal View History

2024-10-14 12:14:01 +03:00
package _VisualDVM.Passes.All;
2024-10-11 00:00:30 +03:00
import Common.Visual.UI_;
2024-10-09 22:21:57 +03:00
import _VisualDVM.ProjectData.SapforData.Variants.ParallelVariant;
import _VisualDVM.Repository.Component.Sapfor.TransformationPermission;
2024-10-14 12:14:01 +03:00
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Sapfor.SapforTransformation;
2024-10-08 15:32:39 +03:00
import _VisualDVM.Global;
2023-09-17 22:13:42 +03:00
public class SPF_CreateParallelVariant extends SapforTransformation {
ParallelVariant variant = null;
@Override
protected TransformationPermission getPermission() {
return TransformationPermission.VariantsOnly;
}
@Override
public boolean hasStats() {
2023-09-17 22:13:42 +03:00
return false;
}
@Override
public boolean needsConfirmations() {
return false;
}
@Override
protected boolean needsAnimation() {
return false;
}
@Override
protected boolean resetAnalysesAfter() {
return false;
}
@Override
protected String getVersionLetter() {
return "p";
}
@Override
protected String getVersionDescription() {
return variant.getDescription();
}
@Override
2024-10-09 23:37:58 +03:00
protected PassCode necessary() {
return PassCode.SPF_GetArrayDistribution;
2023-09-17 22:13:42 +03:00
}
@Override
protected void performPreparation() throws Exception {
target.createEmptyVersion(getVersionLetter(), getVersionDescription());
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (super.canStart(args)) {
if (args.length > 0) {
variant = (ParallelVariant) args[0];
} else {
target.filter_distributed = 1;
target.filter_multiplied = 1;
target.gen_variants_vectors();
if (target.parallelVariants.size() == 1) {
variant = target.parallelVariants.getFirstRecord();
} else return false;
}
Options = variant.getVector();
return true;
}
return false;
}
@Override
protected void performDone() throws Exception {
Global.transformationPermission = TransformationPermission.VariantsOnly;
2023-11-26 16:11:17 +03:00
target.migrateFilesSettings(target.last_version, true, true);
2024-10-11 00:00:30 +03:00
if (UI_.isActive())
2023-09-17 22:13:42 +03:00
variant.UpdateStats(sapfor.getPredictorStats(), target.last_version.name);
}
@Override
2024-10-08 22:33:49 +03:00
protected void performFinish() throws Exception {}
2023-09-17 22:13:42 +03:00
@Override
protected void showFinish() throws Exception {
}
@Override
protected void FocusResult() {
}
}