Skip to content
Snippets Groups Projects
Commit d89ab9f2 authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Save SFG positions using int

parent 62509c17
Branches
Tags
No related merge requests found
Pipeline #88008 passed
......@@ -191,15 +191,15 @@ class MainWindow(QMainWindow):
operation_positions = {}
for op_drag, op_scene in self.dragOperationSceneDict.items():
operation_positions[op_drag.operation.graph_id] = (
op_scene.x(),
op_scene.y(),
int(op_scene.x()),
int(op_scene.y()),
)
try:
with open(module, "w+") as file_obj:
file_obj.write(
sfg_to_python(
sfg, suffix=f"positions = {str(operation_positions)}"
sfg, suffix=f"positions = {operation_positions}"
)
)
except Exception as e:
......
......@@ -2,9 +2,9 @@
"""
B-ASIC automatically generated SFG file.
Name: twotapfir
Last saved: 2023-01-23 11:29:09.423052.
Last saved: 2023-01-23 12:02:27.343483.
"""
from b_asic import SFG, Signal, Input, Output, ConstantMultiplication, Delay, Input, Output, Addition
from b_asic import SFG, Signal, Input, Output, ConstantMultiplication, Addition, Delay, Input, Output
# Inputs:
in1 = Input(name="")
......@@ -32,4 +32,4 @@ twotapfir = SFG(inputs=[in1], outputs=[out1], name='twotapfir')
# SFG Properties:
prop = {'name':twotapfir}
positions = {'in1': (-264.0, -202.0), 't1': (-135.0, -204.0), 'out1': (216.0, 92.0), 'cmul1': (-181.0, -67.0), 'cmul2': (-27.0, -66.0), 'add1': (91.0, 93.0)}
positions = {'cmul1': (-181, -67), 'in1': (-264, -202), 'add1': (91, 93), 'cmul2': (-27, -66), 'out1': (216, 92), 't1': (-135, -204)}
"""
B-ASIC automatically generated SFG file.
Name: twotapfir
Last saved: 2023-01-23 11:29:09.423052.
Last saved: 2023-01-23 12:02:27.343483.
"""
from b_asic import (
SFG,
Signal,
Input,
Output,
ConstantMultiplication,
Delay,
Input,
Output,
Addition,
)
from b_asic import SFG, Signal, Input, Output, ConstantMultiplication, Addition, Delay, Input, Output
# Inputs:
in1 = Input(name="")
......@@ -22,16 +12,10 @@ in1 = Input(name="")
out1 = Output(name="")
# Operations:
cmul1 = ConstantMultiplication(
value=0.5, name="cmul", latency_offsets={'in0': None, 'out0': None}
)
cmul1 = ConstantMultiplication(value=0.5, name="cmul", latency_offsets={'in0': None, 'out0': None})
in1 = Input(name="")
add1 = Addition(
name="", latency_offsets={'in0': None, 'in1': None, 'out0': None}
)
cmul2 = ConstantMultiplication(
value=0.5, name="cmul2", latency_offsets={'in0': None, 'out0': None}
)
add1 = Addition(name="", latency_offsets={'in0': None, 'in1': None, 'out0': None})
cmul2 = ConstantMultiplication(value=0.5, name="cmul2", latency_offsets={'in0': None, 'out0': None})
out1 = Output(name="")
t1 = Delay(initial_value=0, name="")
in1 = Input(name="")
......@@ -47,12 +31,5 @@ Signal(source=t1.output(0), destination=cmul2.input(0))
twotapfir = SFG(inputs=[in1], outputs=[out1], name='twotapfir')
# SFG Properties:
prop = {'name': twotapfir}
positions = {
'in1': (-264.0, -202.0),
't1': (-135.0, -204.0),
'out1': (216.0, 92.0),
'cmul1': (-181.0, -67.0),
'cmul2': (-27.0, -66.0),
'add1': (91.0, 93.0),
}
prop = {'name':twotapfir}
positions = {'cmul1': (-181, -67), 'in1': (-264, -202), 'add1': (91, 93), 'cmul2': (-27, -66), 'out1': (216, 92), 't1': (-135, -204)}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment