Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
joanna_hurnowicz99
projekt_pipeflow
Commits
63689732
Commit
63689732
authored
Jun 22, 2022
by
joanna_hurnowicz99
Browse files
bugs fixed
parent
b1c0d843
Changes
2
Hide whitespace changes
Inline
Side-by-side
gui/canvas.py
View file @
63689732
...
...
@@ -213,6 +213,7 @@ class NetworkCanvas(tk.Canvas):
new_components
=
[]
for
c_type
,
pos
,
prop
,
nodes
in
data
[
"components"
]:
c_type
=
eval
(
"gui.network_components."
+
c_type
)
new_component
=
self
.
add_component
(
c_type
,
pos
[
0
],
pos
[
1
])
new_components
.
append
([
nodes
,
new_component
])
for
p
,
v
in
prop
.
items
():
...
...
@@ -237,9 +238,9 @@ class NetworkCanvas(tk.Canvas):
def
save_project
(
self
,
filename
):
with
open
(
filename
,
"wb"
)
as
f
:
data
=
{
"components"
:
[(
type
(
c
),
c
.
get_pos
(),
c
.
component
.
properties
,
c
.
component
.
get_nodes
())
"components"
:
[(
str
(
c
.
__class__
.
__name__
),
c
.
get_pos
(),
c
.
component
.
properties
,
c
.
component
.
get_nodes
())
for
c
in
self
.
canvas_components
if
not
isinstance
(
c
,
Edge
)],
"edges"
:
self
.
component_graph
.
get_edges
()
"edges"
:
list
(
self
.
component_graph
.
get_edges
()
)
}
if
self
.
background
:
data
[
"background"
]
=
{
"image"
:
self
.
background
.
image_origin
,
"size"
:
self
.
background
.
base_size
}
...
...
model/component.py
View file @
63689732
...
...
@@ -139,7 +139,12 @@ class Component:
return
self
.
properties
def
set_property
(
self
,
property
,
value
):
self
.
properties
[
property
]
=
value
if
isinstance
(
self
.
properties
[
property
],
flow_graph
.
Variable
)
and
(
isinstance
(
value
,
int
)
or
isinstance
(
value
,
float
)):
self
.
properties
[
property
].
set_value
(
value
)
elif
isinstance
(
self
.
properties
[
property
],
flow_graph
.
Variable
)
and
isinstance
(
value
,
flow_graph
.
Variable
):
self
.
properties
[
property
].
set_value
(
value
.
get_value
())
else
:
self
.
properties
[
property
]
=
value
def
get_type
(
self
):
return
self
.
__class__
.
__name__
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment