Skip to content
Snippets Groups Projects
Commit ffc3f0af authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Added association loading in bottom metal marking

parent 6060a7f9
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,9 @@ bool MetadataManager::load(std::string filename, std::string layername) {
data.status = status;
newDataVector.push_back(data);
}
else if (c == 'x') { //read nothing, probably happens on the last line
continue;
}
else {
std::cerr << "Encountered unknown directive " << c << " while parsing file " << filename << std::endl;
}
......@@ -76,6 +79,51 @@ bool MetadataManager::addLayer(const Layer& layer) {
_metadataMap[layer.name()] = std::vector<ObjectMetadata>(layer.numObjects(), { 0 });
return true;
}
void MetadataManager::markBottomMetal(std::string layername) {
std::ifstream file("C:\\Users\\Pascal\\repos\\rbcomb-sample-visualizer\\gui\\resources\\association\\sample-minicircuit-association.txt");
std::string line;
while (std::getline(file, line))
{
if (line[0] == '#') {
continue;
}
std::istringstream iss(line);
unsigned index;
if (!(iss >> index)) {
continue;
}
if (index >= _metadataMap[layername].size()) {
continue;
}
if (line.back() == 'e') { //"None"
_metadataMap[layername][index].info = "Assignment:\n\tUnconnected";
continue;
}
else {
std::vector<std::string> split_line;
std::string tempstr = "";
for (auto c : line) {
if (c == ' ') {
if (tempstr != "") {
split_line.push_back(tempstr);
}
tempstr.clear();
}
else {
tempstr += c;
}
}
split_line.push_back(tempstr); //append last one
std::string infostr = "";
infostr += "\tBreakout zif pad " + split_line[3] + " on net " + split_line[1];
infostr += "\n\tAdapter zif pad " + split_line[4] + " on net " + split_line[5];
infostr += "\n\tMinicircuit " + split_line[2] + " on channel (" + split_line[6] + ", " + split_line[7] + ")";
_metadataMap[layername][index].info = infostr;
}
}
}
ObjectMetadata& MetadataManager::getData(std::string layername, int objectIndex) {
return _metadataMap[layername][objectIndex];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment