no message
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Arrays.Templates;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
||||
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
||||
//для генерации вариантов и для управления распределением измерений.
|
||||
public class TemplateDimension extends DBObject {
|
||||
public int num = -1;
|
||||
public ProjectArray template = null;
|
||||
public ParallelRegion region = null;
|
||||
public TemplateDimensionState state;
|
||||
public TemplateDimension(int num_in, ProjectArray template_in, ParallelRegion region_in) {
|
||||
num = num_in;
|
||||
template = template_in;
|
||||
region = region_in;
|
||||
state = isBlocked() ? TemplateDimensionState.multiplied : TemplateDimensionState.distributed;
|
||||
}
|
||||
public boolean isBlocked() {
|
||||
return (num >= template.dimSize) || template.DimDisabled(num);
|
||||
}
|
||||
public void SwitchState() {
|
||||
switch (state) {
|
||||
case distributed:
|
||||
state = TemplateDimensionState.multiplied;
|
||||
break;
|
||||
case multiplied:
|
||||
state = TemplateDimensionState.distributed;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Object getPK() {
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Arrays.Templates;
|
||||
import _VisualDVM.Current;
|
||||
public enum TemplateDimensionState {
|
||||
multiplied, //0
|
||||
distributed; //1
|
||||
public String getMaskDescription() {
|
||||
switch (this) {
|
||||
case distributed:
|
||||
if (Current.getProject().f_distributed()) {
|
||||
return "BLOCK";
|
||||
} else {
|
||||
if (Current.getProject().f_multiplied())
|
||||
return " X ";
|
||||
else return "BLOCK";
|
||||
}
|
||||
case multiplied:
|
||||
if (Current.getProject().f_multiplied()) {
|
||||
return " * ";
|
||||
} else {
|
||||
if (Current.getProject().f_distributed())
|
||||
return " X ";
|
||||
else return " * ";
|
||||
}
|
||||
}
|
||||
return "?";
|
||||
}
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case distributed:
|
||||
return "BLOCK";
|
||||
case multiplied:
|
||||
return " * ";
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Arrays.Templates;
|
||||
import Common.Utils.Index;
|
||||
import javafx.util.Pair;
|
||||
|
||||
import java.util.Vector;
|
||||
public class TemplateLink {
|
||||
Vector<Integer> linkWithTemplate = new Vector<>();
|
||||
Vector<Pair<Integer, Integer>> alignRuleWithTemplate = new Vector<>();
|
||||
long templateArray;
|
||||
public TemplateLink(String[] splited, Index idx) {
|
||||
int linkWithTemplate_size = Integer.parseInt(splited[idx.Inc()]);
|
||||
for (int i = 0; i < linkWithTemplate_size; ++i) {
|
||||
int link_ = Integer.parseInt(splited[idx.Inc()]);
|
||||
linkWithTemplate.add(link_);
|
||||
}
|
||||
int alignRuleWithTemplate_size = Integer.parseInt(splited[idx.Inc()]);
|
||||
for (int i = 0; i < alignRuleWithTemplate_size; ++i) {
|
||||
int f = Integer.parseInt(splited[idx.Inc()]);
|
||||
int s = Integer.parseInt(splited[idx.Inc()]);
|
||||
alignRuleWithTemplate.add(new Pair<>(f, s));
|
||||
}
|
||||
templateArray = Long.parseLong(splited[idx.Inc()]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user