Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OPOSSUM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
phelix
rust
OPOSSUM
Commits
56772623
Commit
56772623
authored
1 year ago
by
Udo Eisenbarth
Browse files
Options
Downloads
Patches
Plain Diff
Further work on refnode
parent
fc70870e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/pa_doublepass_graph.rs
+6
-7
6 additions, 7 deletions
examples/pa_doublepass_graph.rs
src/nodes/node_reference.rs
+2
-2
2 additions, 2 deletions
src/nodes/node_reference.rs
src/optic_scenery.rs
+1
-0
1 addition, 0 deletions
src/optic_scenery.rs
with
9 additions
and
9 deletions
examples/pa_doublepass_graph.rs
+
6
−
7
View file @
56772623
...
...
@@ -13,12 +13,11 @@ fn main() {
let
n3
=
scenery
.add_node
(
OpticNode
::
new
(
"Faraday"
,
Box
::
new
(
NodeDummy
)));
let
n4
=
scenery
.add_node
(
OpticNode
::
new
(
"0° mirror"
,
Box
::
new
(
NodeDummy
)));
//let ref_node= NodeReference::new(&Box::new(NodeDummy));
let
mut
node
=
OpticNode
::
new
(
"Faraday"
,
Box
::
new
(
NodeDummy
));
let
mut
node
=
OpticNode
::
new
(
"Faraday"
,
Box
::
new
(
NodeDummy
));
node
.set_inverted
(
true
);
let
n3i
=
scenery
.add_node
(
node
);
let
_ref_node
=
NodeReference
::
new
(
&
node
);
scenery
.add_node
(
node
);
//let n3i=scenery.add_node(OpticNode::new("ref", Box::new(ref_node)));
let
mut
node
=
OpticNode
::
new
(
"19mm amp"
,
Box
::
new
(
NodeDummy
));
node
.set_inverted
(
true
);
...
...
@@ -31,8 +30,8 @@ fn main() {
scenery
.connect_nodes
(
n1
,
n2
)
.unwrap
();
scenery
.connect_nodes
(
n2
,
n3
)
.unwrap
();
scenery
.connect_nodes
(
n3
,
n4
)
.unwrap
();
scenery
.connect_nodes
(
n4
,
n3i
)
.unwrap
();
scenery
.connect_nodes
(
n3i
,
n2i
)
.unwrap
();
//
scenery.connect_nodes(n4, n3i).unwrap();
//
scenery.connect_nodes(n3i, n2i).unwrap();
scenery
.connect_nodes
(
n2i
,
n1i
)
.unwrap
();
let
path
=
"graph.dot"
;
...
...
This diff is collapsed.
Click to expand it.
src/nodes/node_reference.rs
+
2
−
2
View file @
56772623
...
...
@@ -2,11 +2,11 @@ use crate::optic_node::{OpticNode, Optical};
/// A virtual component referring to another existing component. This node type is necessary in order to model resonators (loops) or double-pass systems.
pub
struct
NodeReference
<
'a
>
{
reference
:
&
'a
Box
<
dyn
Optic
al
>
,
reference
:
&
'a
Optic
Node
,
}
impl
<
'a
>
NodeReference
<
'a
>
{
pub
fn
new
(
node
:
&
'a
Box
<
dyn
Optic
al
>
)
->
Self
{
pub
fn
new
(
node
:
&
'a
Optic
Node
)
->
Self
{
Self
{
reference
:
node
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/optic_scenery.rs
+
1
−
0
View file @
56772623
use
crate
::
optic_node
::
OpticNode
;
use
petgraph
::
algo
::
*
;
use
petgraph
::
data
::
DataMap
;
use
petgraph
::
prelude
::{
DiGraph
,
EdgeIndex
,
NodeIndex
};
#[derive(Debug,
Clone)]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment