Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ring populations #1969

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/module/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ EnumOptions<ModuleTypes::ModuleType> moduleTypes_("ModuleType", {{ModuleTypes::A
{ModuleTypes::NeutronSQ, "NeutronSQ"},
{ModuleTypes::OrientedSDF, "OrientedSDF"},
{ModuleTypes::QSpecies, "QSpecies"},
{ModuleTypes::RingPopulations, "RingPopulations"},
{ModuleTypes::SDF, "SDF"},
{ModuleTypes::SiteRDF, "SiteRDF"},
{ModuleTypes::SQ, "SQ"},
Expand Down
1 change: 1 addition & 0 deletions src/module/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ enum ModuleType
NeutronSQ,
OrientedSDF,
QSpecies,
RingPopulations,
SDF,
SiteRDF,
Skeleton,
Expand Down
3 changes: 3 additions & 0 deletions src/modules/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "modules/neutronSQ/neutronSQ.h"
#include "modules/orientedSDF/orientedSDF.h"
#include "modules/qSpecies/qSpecies.h"
#include "modules/ringPopulations/ringPopulations.h"
#include "modules/sdf/sdf.h"
#include "modules/siteRDF/siteRDF.h"
#include "modules/sq/sq.h"
Expand Down Expand Up @@ -84,6 +85,8 @@ ModuleRegistry::ModuleRegistry()
registerProducer<ModifierOSitesModule>(ModuleTypes::ModifierOSites,
"Calculate the percentage FO, BO and NBO bonded to a modifier atom", "Analysis");
registerProducer<QSpeciesModule>(ModuleTypes::QSpecies, "Calculate QSpecies of a network former", "Analysis");
registerProducer<RingPopulationsModule>(ModuleTypes::RingPopulations, "Calculate the size of rings in a system",
"Analysis");
registerProducer<SDFModule>(ModuleTypes::SDF, "Calculate spatial density functions around oriented sites", "Analysis");
registerProducer<SiteRDFModule>(ModuleTypes::SiteRDF, "Calculate radial distribution functions between sites", "Analysis");
registerProducer<SQModule>(ModuleTypes::SQ, "Transform g(r) into unweighted S(Q)", "Correlation Functions");
Expand Down
1 change: 1 addition & 0 deletions src/modules/ringPopulations/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dissolve_add_module(ringPopulations.h ringPopulations)
1 change: 1 addition & 0 deletions src/modules/ringPopulations/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dissolve_add_module_gui(ringPopulations)
39 changes: 39 additions & 0 deletions src/modules/ringPopulations/gui/ringPopulationsWidget.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright (c) 2024 Team Dissolve and contributors

#pragma once

#include "modules/ringPopulations/gui/ui_ringPopulationsWidget.h"
#include "modules/widget.h"

// Forward Declarations
class RingPopulationsModule;
class DataViewer;

// Module Widget
class RingPopulationsModuleWidget : public ModuleWidget
{
// All Qt declarations derived from QObject must include this macro
Q_OBJECT

private:
// Associated Module
RingPopulationsModule *module_;

public:
RingPopulationsModuleWidget(QWidget *parent, RingPopulationsModule *module, Dissolve &dissolve);

/*
* UI
*/
private:
// Main form declaration
Ui::RingPopulationsModuleWidget ui_;

// DataViewer contained within this widget
DataViewer *ringPopulationsGraph_;

public:
// Update controls within widget
void updateControls(const Flags<ModuleWidget::UpdateFlags> &updateFlags = {}) override;
};
286 changes: 286 additions & 0 deletions src/modules/ringPopulations/gui/ringPopulationsWidget.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RingPopulationsModuleWidget</class>
<widget class="QWidget" name="RingPopulationsModuleWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>597</width>
<height>422</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="windowTitle">
<string>RingPopulations Controls</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="DataWidget" name="RingPopulationsPlotWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Oygen Sites</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<property name="spacing">
<number>4</number>
</property>
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QGroupBox" name="FreeOxygensGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Free Sites</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="SampledDoubleLabel" name="FOResultFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="title">
<string>Bridging Sites</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="SampledDoubleLabel" name="BOResultFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Non-Bridging Sites</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="SampledDoubleLabel" name="NBOResultFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Odd Sites</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="SampledDoubleLabel" name="OddOResultsFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>140</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>DataWidget</class>
<extends>QWidget</extends>
<header>gui/dataWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>SampledDoubleLabel</class>
<extends>QFrame</extends>
<header>gui/widgets/sampledDoubleLabel.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
Loading