diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2018-03-31 13:45:14 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2018-03-31 13:45:14 -0300 |
commit | a46acb2395c9ace96a16b5f2ecec4e8c06944b19 (patch) | |
tree | f9bb3315ffcebb320d82e196b425219ae8cd53ed /Project/ImportForm.cpp | |
parent | 856aebefdbaedfbe630c521106f6b06ae758c737 (diff) | |
download | PSP.git-a46acb2395c9ace96a16b5f2ecec4e8c06944b19.tar.gz PSP.git-a46acb2395c9ace96a16b5f2ecec4e8c06944b19.tar.xz PSP.git-a46acb2395c9ace96a16b5f2ecec4e8c06944b19.zip |
.LST file import bugfix
Diffstat (limited to 'Project/ImportForm.cpp')
-rw-r--r-- | Project/ImportForm.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Project/ImportForm.cpp b/Project/ImportForm.cpp index 8904c95..4ab6747 100644 --- a/Project/ImportForm.cpp +++ b/Project/ImportForm.cpp @@ -347,19 +347,23 @@ bool ParseAnarede::Parse() // Iterate through parsed components for(auto it = m_components.begin(), itEnd = m_components.end(); it != itEnd; ++it) { if(data1 == (*it).id) { - if((*it).type == ANA_TRANSFORMER) { - if(data2 == 1) { // Primary - (*it).busConnectionNode[0] = std::make_pair(data3, data4); - } else if(data2 == 2) { // Secondary - (*it).busConnectionNode[1] = std::make_pair(data3, data4); + if((*it).type == ANA_BUS) { + // If the data1 is a bus ID, the element is a element with different data order. + // Find the correct element ID with data3 + for(auto itDiff = m_components.begin(), itDiffEnd = m_components.end(); + itDiff != itDiffEnd; ++itDiff) { + if(data3 == (*itDiff).id) { + (*itDiff).busConnectionNode[data4 - 1] = std::make_pair(data1, data2); + break; + } } } else { - (*it).busConnectionNode[0] = std::make_pair(data3, data4); + (*it).busConnectionNode[data2 - 1] = std::make_pair(data3, data4); + break; } } } } - } break; default: break; |