Skip to content

Commit

Permalink
Nicer Iq Gui (#78)
Browse files Browse the repository at this point in the history
* start iq_widget

* only config file changes

* started to implement iq_gui

* restores compatibility with python3

* Iq gui still needs some cosmetics but we are gettin there...

* attempt to make acbandwidths more reliable when code changes (untested)

* Iq gui is BEAUTIFUL !!!

* ComboProperties options are now defined at the FPGA level

* Nicer iq_gui

* Solve the issue raised in Pull Request #75 by Leo (float acbandwidth)
  • Loading branch information
SamuelDeleglise authored and lneuhaus committed Sep 12, 2016
1 parent 764ac7f commit ce2779a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
21 changes: 18 additions & 3 deletions pyrpl/gui/iq_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,19 @@ def paint(self, painter, style, widget):

class MyFrame(QtGui.QFrame):
def __init__(self ,parent):
super(MyFrame, self).__init__()
super(MyFrame, self).__init__(parent)
self.setStyleSheet("background-color: white;")
self.parent = parent
self.lower()
#self.proxy = self.parent.scene.addWidget(self)
#self.proxy.setZValue(-1)

class MyFrameDrawing(QtGui.QFrame):
def __init__(self , parent):
super(MyFrameDrawing, self).__init__()
self.setStyleSheet("background-color: white;")
self.parent = parent
self.lower()
self.proxy = self.parent.scene.addWidget(self)
self.proxy.setZValue(-1)

Expand Down Expand Up @@ -191,8 +201,11 @@ def adjust_drawing(self):
"bandwidth", "quadrature_factor", "gain",
"amplitude", "output_direct"][::2]):
widget = iq.properties[prop].widget
self.frames[index].setFixedSize(widget.width(), self.view.height())
self.frames[index].move(widget.x(),0)
self.frames[index].setFixedSize(widget.width() + iq.main_layout.spacing(), self.height())
self.frames[index].move(widget.x() + iq.pos().x() - iq.main_layout.spacing()/2, 0)

self.frames_drawing[index].setFixedSize(widget.width() + iq.main_layout.spacing(), self.height())
self.frames_drawing[index].move(widget.x() + iq.pos().x() - self.view.pos().x() - iq.main_layout.spacing()/2, 0)
self.scene.setSceneRect(QtCore.QRectF(self.view.rect()))


Expand Down Expand Up @@ -255,6 +268,8 @@ def make_drawing(self):
self.connect(self.output_direct, self.output_signal, h_first=False)

self.frames = [MyFrame(self) for i in range(4)]
self.frames_drawing = [MyFrameDrawing(self) for i in range(4)]




Expand Down
7 changes: 0 additions & 7 deletions pyrpl/gui/redpitaya_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,6 @@ def __init__(self, number, name, options):
self.lay = QtGui.QHBoxLayout()
self.combos = []
self.options = options
"""
vals = [int(2.371593461809983*2**n) for n in range(1, 27)]
self._options = [0] + vals
vals = [-val for val in reversed(vals)]
self._options = vals + self._options
self._options = list(map(str, self._options))
"""
for i in range(number):
combo = QtGui.QComboBox()
self.combos.append(combo)
Expand Down
2 changes: 1 addition & 1 deletion pyrpl/redpitaya_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ def acbandwidth(self):

@acbandwidth.setter
def acbandwidth(self, val):
val = int(val)
val = float(val)
self.inputfilter = -val
return val

Expand Down

0 comments on commit ce2779a

Please sign in to comment.