Skip to content

Commit

Permalink
Merge branch 'develop' into copy-sources-with-other-file-support
Browse files Browse the repository at this point in the history
  • Loading branch information
coolbreeze413 committed Sep 26, 2023
2 parents 643f816 + 75f5d21 commit ee0774d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
35 changes: 30 additions & 5 deletions src/Compiler/QLDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,18 @@ QWidget* QLDeviceManager::createDeviceSelectionWidget(bool newProjectMode) {
m_combobox_layout->setSizeAdjustPolicy(QComboBox::AdjustToContents);

families.clear();
singularity.clear();
m_combobox_family->clear();
for (QLDeviceType device: this->device_list) {
families.push_back(device.family);
// ensure that the item being added has not been added before using std::set
// for performance reasons, keeping a vector as final container for future need of sorting.
if(singularity.insert(device.family).second == true) {
families.push_back(device.family);
}
}

for (std::string family: families) {
m_combobox_family->addItem(QString::fromStdString(family));
m_combobox_family->addItem(QString::fromStdString(family));
}

// connect( m_combobox_family, SIGNAL(currentTextChanged(const QString&)), this, SLOT(familyChanged(const QString&)) );
Expand Down Expand Up @@ -396,6 +401,7 @@ void QLDeviceManager::familyChanged(const QString& family_qstring)

// std::cout << "familychanged: " << family_qstring.toStdString() << std::endl;
foundrynodes.clear();
singularity.clear();
m_combobox_foundry_node->blockSignals(true);
m_combobox_foundry_node->clear();

Expand All @@ -405,7 +411,11 @@ void QLDeviceManager::familyChanged(const QString& family_qstring)
if(device.family == family) {

std::string _foundrynode = convertToFoundryNode(device.foundry, device.node);
foundrynodes.push_back(_foundrynode);
// ensure that the item being added has not been added before using std::set
// for performance reasons, keeping a vector as final container for future need of sorting.
if(singularity.insert(_foundrynode).second == true) {
foundrynodes.push_back(_foundrynode);
}
}
}

Expand Down Expand Up @@ -444,6 +454,7 @@ void QLDeviceManager::foundrynodeChanged(const QString& foundrynode_qstring)
foundry = foundrynode_vector[0];
node = foundrynode_vector[1];
voltage_thresholds.clear();
singularity.clear();
m_combobox_voltage_threshold->blockSignals(true);
m_combobox_voltage_threshold->clear();

Expand All @@ -452,7 +463,11 @@ void QLDeviceManager::foundrynodeChanged(const QString& foundrynode_qstring)
std::string _foundrynode = convertToFoundryNode(device.foundry, device.node);
if (_foundrynode == foundrynode) {
for (QLDeviceVariant variant : device.device_variants) {
// ensure that the item being added has not been added before using std::set
// for performance reasons, keeping a vector as final container for future need of sorting.
if(singularity.insert(variant.voltage_threshold).second == true) {
voltage_thresholds.push_back(variant.voltage_threshold);
}
}
}
}
Expand Down Expand Up @@ -485,6 +500,7 @@ void QLDeviceManager::voltage_thresholdChanged(const QString& voltage_threshold_

voltage_threshold = voltage_threshold_qstring.toStdString();
p_v_t_corners.clear();
singularity.clear();
m_combobox_p_v_t_corner->blockSignals(true);
m_combobox_p_v_t_corner->clear();

Expand All @@ -494,7 +510,11 @@ void QLDeviceManager::voltage_thresholdChanged(const QString& voltage_threshold_
if (_foundrynode == foundrynode) {
for (QLDeviceVariant variant : device.device_variants) {
if (variant.voltage_threshold == voltage_threshold) {
p_v_t_corners.push_back(variant.p_v_t_corner);
// ensure that the item being added has not been added before using std::set
// for performance reasons, keeping a vector as final container for future need of sorting.
if(singularity.insert(variant.p_v_t_corner).second == true) {
p_v_t_corners.push_back(variant.p_v_t_corner);
}
}
}
}
Expand Down Expand Up @@ -528,6 +548,7 @@ void QLDeviceManager::p_v_t_cornerChanged(const QString& p_v_t_corner_qstring)

p_v_t_corner = p_v_t_corner_qstring.toStdString();
layouts.clear();
singularity.clear();
m_combobox_layout->blockSignals(true);
m_combobox_layout->clear();

Expand All @@ -539,7 +560,11 @@ void QLDeviceManager::p_v_t_cornerChanged(const QString& p_v_t_corner_qstring)
if (variant.voltage_threshold == voltage_threshold) {
if(variant.p_v_t_corner == p_v_t_corner) {
for(QLDeviceVariantLayout _layout : variant.device_variant_layouts) {
layouts.push_back(_layout.name);
// ensure that the item being added has not been added before using std::set
// for performance reasons, keeping a vector as final container for future need of sorting.
if(singularity.insert(_layout.name).second == true) {
layouts.push_back(_layout.name);
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/QLDeviceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ class QLDeviceManager : public QObject {
std::string p_v_t_corner;
std::vector <std::string> layouts;
std::string layout;
std::set <std::string> singularity;

QComboBox* m_combobox_family;
QComboBox* m_combobox_foundry_node;
Expand Down

0 comments on commit ee0774d

Please sign in to comment.