improve GUI

master
Sebastien Bourdeauducq 2020-08-11 18:35:49 +08:00
parent 702ee463dd
commit 946eb113bb
1 changed files with 4 additions and 4 deletions

View File

@ -42,15 +42,15 @@ class MainWindow(pg.GraphicsLayoutWidget):
self.addItem(self.text_locked, row=0, col=1)
self.update_ref(None, None, False)
p1 = self.addPlot(row=1, col=0, colspan=2)
p1 = self.addPlot(row=1, col=0, colspan=2, title="REF spectrum")
self.ref_spectrum = SpectrogramItem(freq_sample, freq_base, block_size)
p1.addItem(self.ref_spectrum)
p2 = self.addPlot(row=2, col=0, colspan=2)
p2 = self.addPlot(row=2, col=0, colspan=2, title="MEAS spectrum")
self.meas_spectrum = SpectrogramItem(freq_sample, freq_base, block_size)
p2.addItem(self.meas_spectrum)
self.position = self.addPlot(row=3, col=0, colspan=2)
self.position = self.addPlot(row=3, col=0, colspan=2, title="Position (nm)")
self.position_history = np.zeros(300)
def update_ref(self, block, peak_freq, locked):
@ -72,7 +72,7 @@ class MainWindow(pg.GraphicsLayoutWidget):
def update_position(self, position):
self.position_history = np.roll(self.position_history, -1)
self.position_history[-1] = position
self.position_history[-1] = position*632.816/2
self.position.clear()
self.position.plot(self.position_history)