Skip to content

Commit

Permalink
Fix minor issues with pair energies selection
Browse files Browse the repository at this point in the history
  • Loading branch information
peterspackman committed Sep 6, 2024
1 parent 48af042 commit 016704f
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 17 deletions.
26 changes: 26 additions & 0 deletions src/childpropertycontroller.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
<ui version="4.0">
<class>ChildPropertyController</class>
<widget class="QWidget" name="ChildPropertyController">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>469</width>
<height>351</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -768,6 +776,9 @@
<property name="text">
<string>Component</string>
</property>
<property name="buddy">
<cstring>componentComboBox</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
Expand All @@ -778,6 +789,9 @@
<property name="text">
<string>Model</string>
</property>
<property name="buddy">
<cstring>modelComboBox</cstring>
</property>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -817,6 +831,9 @@
<property name="text">
<string>Coloring</string>
</property>
<property name="buddy">
<cstring>frameworkColorComboBox</cstring>
</property>
</widget>
</item>
<item row="4" column="2">
Expand All @@ -831,6 +848,9 @@
<property name="text">
<string>Cutoff</string>
</property>
<property name="buddy">
<cstring>frameworkCutoffSpinBox</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
Expand All @@ -854,6 +874,9 @@
<property name="text">
<string>Tube Size</string>
</property>
<property name="buddy">
<cstring>frameworkTubeSizeSpinBox</cstring>
</property>
</widget>
</item>
<item row="3" column="4">
Expand Down Expand Up @@ -884,6 +907,9 @@
<property name="text">
<string>Connect</string>
</property>
<property name="buddy">
<cstring>frameworkConnectionComboBox</cstring>
</property>
</widget>
</item>
</layout>
Expand Down
1 change: 1 addition & 0 deletions src/core/slab_options.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "slab_options.h"
#include <array>

inline constexpr std::array<SlabGenerationOptions::Mode, 5> availableModes = {
SlabGenerationOptions::Mode::Atoms,
Expand Down
8 changes: 7 additions & 1 deletion src/crystalx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ void Crystalx::initConnections() {
// Project connections - current crystal changed in some way
connect(project, &Project::selectedSceneChanged, crystalController,
&CrystalController::handleSceneSelectionChange);
connect(project, &Project::selectedSceneChanged, this,
&Crystalx::handleSceneSelectionChange);
connect(project, &Project::selectedSceneChanged,
[&](int) { glWindow->setCurrentCrystal(project); });
connect(project, &Project::projectSaved, this, &Crystalx::updateWindowTitle);
Expand Down Expand Up @@ -1875,11 +1877,15 @@ void Crystalx::calculatePairEnergies(
}
}

void Crystalx::handleSceneSelectionChange() {
handleStructureChange();
}

void Crystalx::handleStructureChange() {
ChemicalStructure *structure = project->currentScene()->chemicalStructure();
if (structure) {
qDebug() << "Structure changed";

childPropertyController->setCurrentPairInteractions(structure->pairInteractions());
for (auto *child : structure->children()) {
auto *mesh = qobject_cast<Mesh *>(child);
if (mesh) {
Expand Down
1 change: 1 addition & 0 deletions src/crystalx.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ private slots:
void taskManagerTaskRemoved(TaskID);

void handleStructureChange();
void handleSceneSelectionChange();
void handleGenerateWavefunctionAction();

private:
Expand Down
29 changes: 25 additions & 4 deletions src/dialogs/celllimitsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
<property name="text">
<string>b-axis</string>
</property>
<property name="buddy">
<cstring>bAxisLowerBound</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
Expand Down Expand Up @@ -100,6 +103,9 @@
<property name="text">
<string>a-axis</string>
</property>
<property name="buddy">
<cstring>aAxisLowerBound</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
Expand All @@ -114,6 +120,9 @@
<property name="text">
<string>c-axis</string>
</property>
<property name="buddy">
<cstring>cAxisLowerBound</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
Expand Down Expand Up @@ -153,6 +162,9 @@
<property name="text">
<string>Include</string>
</property>
<property name="buddy">
<cstring>modeComboBox</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
Expand All @@ -173,6 +185,15 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>aAxisLowerBound</tabstop>
<tabstop>aAxisUpperBound</tabstop>
<tabstop>bAxisLowerBound</tabstop>
<tabstop>bAxisUpperBound</tabstop>
<tabstop>cAxisLowerBound</tabstop>
<tabstop>cAxisUpperBound</tabstop>
<tabstop>modeComboBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
Expand All @@ -182,8 +203,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
<x>260</x>
<y>322</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
Expand All @@ -198,8 +219,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
<x>328</x>
<y>322</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
Expand Down
39 changes: 27 additions & 12 deletions src/dialogs/exportdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,20 @@
<string>Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="1">
<widget class="QLabel" name="resolutionScaleLabel">
<item row="3" column="3">
<widget class="QLabel" name="resolutionLabel">
<property name="text">
<string>Resolution Scale Factor</string>
<string>0x0</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Background Color</string>
</property>
<property name="buddy">
<cstring>backgroundColorToolButton</cstring>
</property>
</widget>
</item>
Expand All @@ -81,17 +91,13 @@
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="resolutionLabel">
<item row="3" column="1">
<widget class="QLabel" name="resolutionScaleLabel">
<property name="text">
<string>0x0</string>
<string>Resolution Scale Factor</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Background Color</string>
<property name="buddy">
<cstring>resolutionScaleComboBox</cstring>
</property>
</widget>
</item>
Expand All @@ -106,6 +112,9 @@
<property name="text">
<string>Destination</string>
</property>
<property name="buddy">
<cstring>destinationLineEdit</cstring>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -139,6 +148,12 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>resolutionScaleComboBox</tabstop>
<tabstop>backgroundColorToolButton</tabstop>
<tabstop>destinationLineEdit</tabstop>
<tabstop>destinationBrowseButton</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
Expand Down
23 changes: 23 additions & 0 deletions src/dialogs/wavefunctioncalculationdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,29 @@
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>basisComboBox</cstring>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="programLabel">
<property name="text">
<string>Program</string>
</property>
<property name="buddy">
<cstring>programComboBox</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="methodLabel">
<property name="text">
<string>Method</string>
</property>
<property name="buddy">
<cstring>methodComboBox</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
Expand All @@ -75,13 +84,19 @@
<property name="text">
<string>Charge</string>
</property>
<property name="buddy">
<cstring>chargeSpinBox</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="multiplicityLabel">
<property name="text">
<string>Multiplicity</string>
</property>
<property name="buddy">
<cstring>multiplicitySpinBox</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
Expand Down Expand Up @@ -135,6 +150,14 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<tabstops>
<tabstop>programComboBox</tabstop>
<tabstop>methodComboBox</tabstop>
<tabstop>basisComboBox</tabstop>
<tabstop>chargeSpinBox</tabstop>
<tabstop>multiplicitySpinBox</tabstop>
<tabstop>editInputFileCheckbox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
Expand Down

0 comments on commit 016704f

Please sign in to comment.