no message
This commit is contained in:
@@ -43,10 +43,10 @@ public class AlignRule {
|
||||
return new Pair<>(sign, buf);
|
||||
}
|
||||
public ProjectArray getAlignArray() {
|
||||
return parent_region.arrays.get(alignArray_address);
|
||||
return parent_region.arraysMap.get(alignArray_address);
|
||||
}
|
||||
public ProjectArray getAlignWith() {
|
||||
return parent_region.arrays.get(alignWith_address);
|
||||
return parent_region.arraysMap.get(alignWith_address);
|
||||
}
|
||||
String genStringExpr(String letter, Pair<Integer, Integer> expr) {
|
||||
String retVal = "";
|
||||
|
||||
@@ -10,24 +10,6 @@ public class DataDirective extends Directive {
|
||||
public Vector<AlignRule> alignRules;
|
||||
public String rules_ = "";
|
||||
public Vector<String> rules = new Vector<>();
|
||||
public void genRules_(LinkedHashMap<Long, ProjectArray> Arrays) {
|
||||
rules_ = "";
|
||||
int maxLen = 0;
|
||||
for (AlignRule a : alignRules)
|
||||
maxLen = Math.max(maxLen, a.GetLenString());
|
||||
LinkedHashMap<String, Vector<String>> toPrint = new LinkedHashMap<>();
|
||||
for (AlignRule a : alignRules) {
|
||||
if (Arrays.get(a.alignArray_address).getLocation() != ArrayLocation.parameter) {
|
||||
Pair<String, String> result = a.GenRule(maxLen);
|
||||
if (!toPrint.containsKey(result.getKey()))
|
||||
toPrint.put(result.getKey(), new Vector<>());
|
||||
toPrint.get(result.getKey()).add(result.getValue());
|
||||
}
|
||||
}
|
||||
for (Vector<String> v : toPrint.values()) {
|
||||
rules_ += String.join("\n", v);
|
||||
}
|
||||
}
|
||||
public void genRules(LinkedHashMap<BigInteger, ProjectArray> Arrays) {
|
||||
rules.clear();
|
||||
int maxLen = 0;
|
||||
|
||||
@@ -25,6 +25,8 @@ public class ProjectArray extends DBObject {
|
||||
@Expose
|
||||
public long id;
|
||||
@Expose
|
||||
public String packed_address;
|
||||
@Expose
|
||||
public String name;
|
||||
@Expose
|
||||
public String shortName;
|
||||
@@ -58,10 +60,12 @@ public class ProjectArray extends DBObject {
|
||||
//json-------------------
|
||||
public String UniqKey;
|
||||
public BigInteger address;
|
||||
// LinkedHashMap<BigInteger, TemplateLink> templateInfo = new LinkedHashMap<>();
|
||||
public void print(){
|
||||
Vector<String> res = new Vector<>();
|
||||
res.add(">");
|
||||
res.add("id="+id);
|
||||
res.add("packed_address="+ packed_address);
|
||||
res.add("name="+name);
|
||||
res.add("shortName="+shortName);
|
||||
res.add("dimSize="+dimSize);
|
||||
@@ -74,7 +78,6 @@ public class ProjectArray extends DBObject {
|
||||
res.add("<");
|
||||
System.out.println(String.join("\n",res));
|
||||
}
|
||||
|
||||
//--
|
||||
public ArrayState getState() {
|
||||
return ArrayState.fromInt(state);
|
||||
@@ -85,10 +88,9 @@ public class ProjectArray extends DBObject {
|
||||
public ArrayLocation getLocation() {
|
||||
return ArrayLocation.fromInt(location);
|
||||
}
|
||||
|
||||
//только для шаблонов. для ФИЛЬТРА управления распределением измерений.
|
||||
public Vector<TemplateDimension> dimensions = new Vector<>();
|
||||
//----------------------------
|
||||
//------
|
||||
public ParallelRegion parent_region = null; //родительяская область распараллеливания.
|
||||
//связи->
|
||||
public LinkedHashMap<Long, ProjectArray> links = new LinkedHashMap<>();
|
||||
@@ -106,8 +108,6 @@ public class ProjectArray extends DBObject {
|
||||
//------------------------------------------------------------------------------------------------------>
|
||||
//<editor-fold desc="Функционал шаблона">
|
||||
public Vector<BigInteger> regIDs = new Vector<>();
|
||||
|
||||
|
||||
//--
|
||||
public ProjectArray(String[] infoF, Index idx, BigInteger address_in) {
|
||||
id = Integer.parseInt(infoF[idx.Inc()]); //+
|
||||
@@ -115,7 +115,7 @@ public class ProjectArray extends DBObject {
|
||||
shortName = infoF[idx.Inc()]; //+
|
||||
dimSize = Integer.parseInt(infoF[idx.Inc()]); //+
|
||||
typeSize = Integer.parseInt(infoF[idx.Inc()]); //+
|
||||
// address = address_in;
|
||||
address = address_in;
|
||||
state = Integer.parseInt(infoF[idx.Inc()]); //+
|
||||
location = Integer.parseInt(infoF[idx.Inc()]); //+
|
||||
locName = infoF[idx.Inc()]; //+
|
||||
@@ -132,12 +132,14 @@ public class ProjectArray extends DBObject {
|
||||
for (int i = 0; i < sizes_size; ++i)
|
||||
mappedDims.add(Integer.parseInt(infoF[idx.Inc()])); //+
|
||||
|
||||
//todo удалить после перехода на json
|
||||
int templateInfo_size = Integer.parseInt(infoF[idx.Inc()]);
|
||||
for (int i = 0; i < templateInfo_size; ++i) {
|
||||
BigInteger key = new BigInteger(infoF[idx.Inc()]);
|
||||
TemplateLink templateLink = new TemplateLink(infoF, idx);
|
||||
// templateInfo.put(key, templateLink);
|
||||
// templateInfo.put(key, templateLink);
|
||||
}
|
||||
//todo
|
||||
String[] localSplited = infoF[idx.Inc()].split("\\|");
|
||||
isTemplFlag = Integer.parseInt(localSplited[0]); //+
|
||||
isLoopArrayFlag = Integer.parseInt(localSplited[1]); //+
|
||||
@@ -147,7 +149,6 @@ public class ProjectArray extends DBObject {
|
||||
String declFile = Utils_.toW(localSplited[idxPl]);
|
||||
DBProjectFile file = Global.mainModule.getProject().db.files.Data.get(declFile);
|
||||
int declLine = Integer.parseInt(localSplited[idxPl + 1]);
|
||||
//declPlaces.add(new Pair<>(declFile, declLine));
|
||||
ArrayDecl decl = new ArrayDecl(shortName, location, file, declLine);
|
||||
declPlaces.add(decl);
|
||||
file.array_decls.add(decl); //++
|
||||
@@ -158,12 +159,11 @@ public class ProjectArray extends DBObject {
|
||||
Init();
|
||||
}
|
||||
public void Init(){
|
||||
// address = packed_address !=null ? new BigInteger(packed_address):BigInteger.ONE;
|
||||
//короткое имя+ функция/модуль/комон+ размерность
|
||||
UniqKey = shortName + locName + dimSize;
|
||||
address = BigInteger.ONE;
|
||||
for (ArrayDecl arrayDecl: declPlaces){
|
||||
for (ArrayDecl arrayDecl: declPlaces)
|
||||
arrayDecl.file = Utils_.toW(arrayDecl.file);
|
||||
}
|
||||
}
|
||||
public static String fill_binary(int d, String binary) {
|
||||
int delta = Math.abs(binary.length() - d);
|
||||
|
||||
Reference in New Issue
Block a user