Skip to content
Merged
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
10 changes: 10 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,16 @@ aside .description {
background-color: #3a2a1a !important;
}

.dndnode.filters {
border-left: 4px solid #20c997 !important;
background-color: #1a3a2f !important;
}

.dndnode.others {
border-left: 4px solid #ffc107 !important;
background-color: #3a3a1a !important;
}

.dndnode.input {
border-left: 4px solid #28a745 !important;
background-color: #1a2f1a !important;
Expand Down
2 changes: 2 additions & 0 deletions src/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useDnD } from './DnDContext';
import { nodeCategories, getNodeDisplayName } from './nodeConfig.js';

export default () => {

Check warning on line 5 in src/Sidebar.jsx

View workflow job for this annotation

GitHub Actions / test (20.x, 3.10)

Fast refresh can't handle anonymous components. Add a name to your export

Check warning on line 5 in src/Sidebar.jsx

View workflow job for this annotation

GitHub Actions / test (20.x, 3.11)

Fast refresh can't handle anonymous components. Add a name to your export
const [_, setType] = useDnD();
const [expandedCategories, setExpandedCategories] = useState({
'Sources': true,
Expand Down Expand Up @@ -32,6 +32,8 @@
'Output': 'dndnode output',
'Processing': 'dndnode processing',
'Math': 'dndnode math',
'Others': 'dndnode others',
'Filters': 'dndnode filters',
'Control': 'dndnode control',
'Fuel Cycle': 'dndnode fuel-cycle'
};
Expand Down
31 changes: 28 additions & 3 deletions src/nodeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ export const nodeTypes = {
constant: SourceNode,
source: SourceNode,
stepsource: StepSourceNode,
trianglewavesource: SourceNode,
sinusoidalsource: SourceNode,
gaussianpulsesource: SourceNode,
sinusoidalphasenoisesource: SourceNode,
chirpphasenoisesource: SourceNode,
chirpsource: SourceNode,
pulsesource: SourceNode,
clocksource: SourceNode,
squarewavesource: SourceNode,
amplifier: AmplifierNode,
amplifier_reverse: AmplifierNodeReverse,
integrator: IntegratorNode,
Expand All @@ -33,20 +41,29 @@ export const nodeTypes = {
function2to2: createFunctionNode(2, 2), // FunctionNode with 2 inputs and 2 outputs
rng: SourceNode,
pid: DefaultNode,
antiwinduppid: DefaultNode,
splitter2: Splitter2Node,
splitter3: Splitter3Node,
wall: WallNode,
bubbler: BubblerNode,
white_noise: SourceNode,
pink_noise: SourceNode,
spectrum: ScopeNode,
differentiator: DefaultNode
differentiator: DefaultNode,
samplehold: DefaultNode,
comparator: DefaultNode,
allpassfilter: DefaultNode,
butterworthlowpass: DefaultNode,
butterworthhighpass: DefaultNode,
butterworthbandpass: DefaultNode,
butterworthbandstop: DefaultNode,
fir: DefaultNode
};

// Node categories for better organization
export const nodeCategories = {
'Sources': {
nodes: ['constant', 'stepsource', 'source', 'pulsesource', 'rng', 'white_noise', 'pink_noise'],
nodes: ['constant', 'stepsource', 'source', 'pulsesource', 'trianglewavesource', 'sinusoidalsource', 'gaussianpulsesource', 'sinusoidalphasenoisesource', 'chirpphasenoisesource', 'chirpsource', 'clocksource', 'squarewavesource', 'rng', 'white_noise', 'pink_noise'],
description: 'Signal and data source nodes'
},
'Processing': {
Expand All @@ -58,13 +75,21 @@ export const nodeCategories = {
description: 'Mathematical operation nodes'
},
'Control': {
nodes: ['pid'],
nodes: ['pid', 'antiwinduppid'],
description: 'Control system nodes'
},
'Filters': {
nodes: ['allpassfilter', 'butterworthlowpass', 'butterworthhighpass', 'butterworthbandpass', 'butterworthbandstop', 'fir'],
description: 'Filter and flow control nodes'
},
'Fuel Cycle': {
nodes: ['process', 'process_horizontal', 'bubbler', 'wall'],
description: 'Fuel cycle specific nodes'
},
'Others': {
nodes: ['samplehold', 'comparator'],
description: 'Miscellaneous nodes'
},
'Output': {
nodes: ['scope', 'spectrum'],
description: 'Output and visualization nodes'
Expand Down
18 changes: 18 additions & 0 deletions src/pathsim_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Differentiator,
Schedule,
)
import pathsim.blocks
from pathsim.blocks.noise import WhiteNoise, PinkNoise
from .custom_pathsim_blocks import (
Process,
Expand All @@ -43,6 +44,14 @@
"constant": Constant,
"source": Source,
"stepsource": StepSource,
"trianglewavesource": pathsim.blocks.sources.TriangleWaveSource,
"sinusoidalsource": pathsim.blocks.sources.SinusoidalSource,
"gaussianpulsesource": pathsim.blocks.sources.GaussianPulseSource,
"sinusoidalphasenoisesource": pathsim.blocks.sources.SinusoidalPhaseNoiseSource,
"chirpphasenoisesource": pathsim.blocks.sources.ChirpPhaseNoiseSource,
"chirpsource": pathsim.blocks.sources.ChirpSource,
"clocksource": pathsim.blocks.sources.ClockSource,
"squarewavesource": pathsim.blocks.sources.SquareWaveSource,
"pulsesource": PulseSource,
"amplifier": Amplifier,
"amplifier_reverse": Amplifier,
Expand All @@ -56,6 +65,7 @@
"process_horizontal": Process,
"rng": RNG,
"pid": PID,
"antiwinduppid": pathsim.blocks.AntiWindupPID,
"integrator": Integrator,
"differentiator": Differentiator,
"function": Function,
Expand All @@ -66,6 +76,14 @@
"white_noise": WhiteNoise,
"pink_noise": PinkNoise,
"spectrum": Spectrum,
"samplehold": pathsim.blocks.SampleHold,
"comparator": pathsim.blocks.Comparator,
"allpassfilter": pathsim.blocks.AllpassFilter,
"butterworthlowpass": pathsim.blocks.ButterworthLowpassFilter,
"butterworthhighpass": pathsim.blocks.ButterworthHighpassFilter,
"butterworthbandpass": pathsim.blocks.ButterworthBandpassFilter,
"butterworthbandstop": pathsim.blocks.ButterworthBandstopFilter,
"fir": pathsim.blocks.FIR,
}


Expand Down
Loading